diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 9e645aaf84..e9031fadb3 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -2,77 +2,78 @@ import { defineConfig } from 'vitepress' export default defineConfig({ lastUpdated: true, + lang: 'zh-CN', locales: { - '/': { + root: { lang: 'zh-CN', + label: '简体中文', title: '一键虚拟化项目', description: '开源、易于使用的服务器虚拟化项目', - }, - '/en_US/': { + link: '/', + themeConfig: { + lastUpdatedText: '上次更新', + editLink: { + pattern: 'https://github.com/oneclickvirt/oneclickvirt.github.io/edit/main/docs/:path', + text: '在GitHub中编辑', + }, + nav: [ + { text: '一键虚拟化', + link: '/', + activeMatch: '^/$|^/guide/' + }, + { text: 'Linux相关', + link: '/case/index', + activeMatch: '^/case/' + }, + { + text: '开发手册', + link: '/developer/index', + activeMatch: '^/developer/' + } + ], + sidebar: { + '/': getGuideSidebarZhCN(), + '/guide/': getGuideSidebarZhCN(), + '/case/': getCaseSidebarZhCN(), + '/developer/': getDeveloperSidebarZhCN(), + } + } + }, + en_US: { lang: 'en-US', + label: 'English', title: 'One Click Virtualization Project', description: 'Open source, easy to use server virtualization project', - } + link: '/en_US/', + themeConfig: { + lastUpdatedText: 'Last Updated', + editLink: { + text: 'Edit this page on GitHub', + pattern: 'https://github.com/oneclickvirt/oneclickvirt.github.io/edit/main/docs/:path', + }, + nav: [ + { text: 'One Click Virtualization', link: '/en_US/', activeMatch: '^/en_US/guide/' }, + { text: 'Development Manual', link: '/en_US/developer/index', activeMatch: '^/en_US/developer/' } + ], + sidebar: { + '/en_US/': getGuideSidebarEnUS(), + '/en_US/guide/': getGuideSidebarEnUS(), + '/en_US/developer/': getDeveloperSidebarEnUS() + }, + }, + }, }, - themeConfig: { locales: { - '/': { - label: '简体中文', - nav: [ - { text: '一键虚拟化', - link: '/', - activeMatch: '^/$|^/guide/' - }, - { text: 'Linux相关', - link: '/case/index', - activeMatch: '^/case/' - }, - { - text: '开发手册', - link: '/developer/index', - activeMatch: '^/developer/' - } - ], - - sidebar: { - '/guide/': getGuideSidebarZhCN(), - '/case/': getCaseSidebarZhCN(), - '/developer/': getDeveloperSidebarZhCN(), - '/': getGuideSidebarZhCN() - }, - repo: 'oneclickvirt/oneclickvirt.github.io', - docsDir: 'docs', - docsBranch: 'main', - editLinks: true, - editLinkText: '在GitHub中编辑', - lastUpdated: '上次更新' + algolia: { + appId: '', + apiKey: '', + indexName: '' }, - '/en_US/': { - label: 'English', - nav: [ - { text: 'One Click Virtualization', link: '/en_US/', activeMatch: '^/en_US/guide/' }, - { text: 'Development Manual', link: '/en_US/developer/index', activeMatch: '^/en_US/developer/' } - ], - - sidebar: { - '/en_US/guide/': getGuideSidebarEnUS(), - '/en_US/developer/': getDeveloperSidebarEnUS(), - '/en_US/': getGuideSidebarEnUS() - }, - repo: 'oneclickvirt/oneclickvirt.github.io', - docsDir: 'docs', - docsBranch: 'main', - editLinks: true, - editLinkText: 'Edit this page on GitHub', - lastUpdated: 'Last Updated' + footer: { + message: 'This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) License', + copyright: 'Copyright © 2022-present oneclickvirt' } - }, - algolia: { - appId: '', - apiKey: '', - indexName: '' - } } }) @@ -80,46 +81,46 @@ function getGuideSidebarZhCN() { return [ { text: '所有项目的前置条件', - children: [ - { text: '准备工作', link: '/guide/dashboard' }, + items: [ + { text: '准备工作', link: '/guide/dashboard.html' }, ] }, { text: 'Proxmox VE', - children: [ - { text: '系统和硬件配置要求', link: '/guide/pve_precheck' }, - { text: 'PVE主体安装', link: '/guide/pve_install' }, - { text: 'KVM虚拟化', link: '/guide/pve_kvm' }, - { text: 'LXC虚拟化', link: '/guide/pve_lxc' }, - { text: '致谢', link: '/guide/pve_thanks' }, - { text: '常见问题答疑', link: '/guide/pve_qa' } + items: [ + { text: '系统和硬件配置要求', link: '/guide/pve_precheck.html' }, + { text: 'PVE主体安装', link: '/guide/pve_install.html' }, + { text: 'KVM虚拟化', link: '/guide/pve_kvm.html' }, + { text: 'LXC虚拟化', link: '/guide/pve_lxc.html' }, + { text: '致谢', link: '/guide/pve_thanks.html' }, + { text: '常见问题答疑', link: '/guide/pve_qa.html' } ] }, { text: 'LXD', - children: [ - { text: '系统和硬件配置要求', link: '/guide/lxd_precheck' }, - { text: 'LXD主体安装', link: '/guide/lxd_install' }, - { text: 'LXC虚拟化', link: '/guide/lxd_lxc' }, - { text: '其他自定义配置', link: '/guide/lxd_extra_config' }, - { text: '致谢', link: '/guide/lxd_thanks' }, - { text: '常见问题答疑', link: '/guide/lxd_qa' } + items: [ + { text: '系统和硬件配置要求', link: '/guide/lxd_precheck.html' }, + { text: 'LXD主体安装', link: '/guide/lxd_install.html' }, + { text: 'LXC虚拟化', link: '/guide/lxd_lxc.html' }, + { text: '其他自定义配置', link: '/guide/lxd_extra_config.html' }, + { text: '致谢', link: '/guide/lxd_thanks.html' }, + { text: '常见问题答疑', link: '/guide/lxd_qa.html' } ] }, { text: 'Docker', - children: [ - { text: '系统和硬件配置要求', link: '/guide/docker_precheck' }, - { text: '主体安装', link: '/guide/docker_install' }, - { text: 'Docker虚拟化', link: '/guide/docker_build' }, - { text: '致谢', link: '/guide/docker_thanks' }, - { text: '常见问题答疑', link: '/guide/docker_qa' } + items: [ + { text: '系统和硬件配置要求', link: '/guide/docker_precheck.html' }, + { text: '主体安装', link: '/guide/docker_install.html' }, + { text: 'Docker虚拟化', link: '/guide/docker_build.html' }, + { text: '致谢', link: '/guide/docker_thanks.html' }, + { text: '常见问题答疑', link: '/guide/docker_qa.html' } ] }, { text: '捐赠', - children: [ - { text: '捐赠', link: '/guide/dashboardq' }, + items: [ + { text: '捐赠', link: '/guide/dashboardq.html' }, ] } ] @@ -129,12 +130,12 @@ function getCaseSidebarZhCN() { return [ { text: 'Linux相关', - children: [ - { text: '1. 一键修复与安装脚本(各种linux系统修复与服务器环境安装脚本)', link: '/case/case1' }, - { text: '2. VPS融合怪服务器测评脚本', link: '/case/case2' }, - { text: '3. 自动更新测试服务器节点列表的网络基准测试脚本', link: '/case/case3' }, - { text: '4. 甲骨文服务器保活脚本', link: '/case/case4' }, - { text: '5. convoy面板安装脚本', link: '/case/case5' } + items: [ + { text: '1. 一键修复与安装脚本(各种linux系统修复与服务器环境安装脚本)', link: '/case/case1.html' }, + { text: '2. VPS融合怪服务器测评脚本', link: '/case/case2.html' }, + { text: '3. 自动更新测试服务器节点列表的网络基准测试脚本', link: '/case/case3.html' }, + { text: '4. 甲骨文服务器保活脚本', link: '/case/case4.html' }, + { text: '5. convoy面板安装脚本', link: '/case/case5.html' } ] } ] @@ -144,8 +145,8 @@ function getDeveloperSidebarZhCN() { return [ { text: '开发手册', - children: [ - { text: 'l10n', link: '/developer/l10n' } + items: [ + { text: 'l10n', link: '/developer/l10n.html' } ] } ] @@ -155,46 +156,46 @@ function getGuideSidebarEnUS() { return [ { text: 'Pre-requisites for all projects', - children: [ - { text: 'Preparation', link: '/en_US/guide/dashboard' } + items: [ + { text: 'Preparation', link: '/en_US/guide/dashboard.html' } ] }, { text: 'Proxmox VE', - children: [ - { text: 'System and hardware configuration requirements', link: '/en_US/guide/pve_precheck' }, - { text: 'PVE main installation', link: '/en_US/guide/pve_install' }, - { text: 'KVM Virtualization', link: '/en_US/guide/pve_kvm' }, - { text: 'LXC Virtualization', link: '/en_US/guide/pve_lxc' }, - { text: 'Acknowledgements', link: '/en_US/guide/pve_thanks' }, - { text: 'FAQ', link: '/en_US/guide/pve_qa' } + items: [ + { text: 'System and hardware configuration requirements', link: '/en_US/guide/pve_precheck.html' }, + { text: 'PVE main installation', link: '/en_US/guide/pve_install.html' }, + { text: 'KVM Virtualization', link: '/en_US/guide/pve_kvm.html' }, + { text: 'LXC Virtualization', link: '/en_US/guide/pve_lxc.html' }, + { text: 'Acknowledgements', link: '/en_US/guide/pve_thanks.html' }, + { text: 'FAQ', link: '/en_US/guide/pve_qa.html' } ] }, { text: 'LXD', - children: [ - { text: 'System and hardware configuration requirements', link: '/en_US/guide/lxd_precheck' }, - { text: 'LXD main installation', link: '/en_US/guide/lxd_install' }, - { text: 'LXC Virtualization', link: '/en_US/guide/lxd_lxc' }, - { text: 'Other custom configuration', link: '/en_US/guide/lxd_extra_config' }, - { text: 'Acknowledgements', link: '/en_US/guide/lxd_thanks' }, - { text: 'FAQ', link: '/en_US/guide/lxd_qa' } + items: [ + { text: 'System and hardware configuration requirements', link: '/en_US/guide/lxd_precheck.html' }, + { text: 'LXD main installation', link: '/en_US/guide/lxd_install.html' }, + { text: 'LXC Virtualization', link: '/en_US/guide/lxd_lxc.html' }, + { text: 'Other custom configuration', link: '/en_US/guide/lxd_extra_config.html' }, + { text: 'Acknowledgements', link: '/en_US/guide/lxd_thanks.html' }, + { text: 'FAQ', link: '/en_US/guide/lxd_qa.html' } ] }, { text: 'Docker', - children: [ - { text: 'System and hardware configuration requirements', link: '/en_US/guide/docker_precheck' }, - { text: 'Main installation', link: '/en_US/guide/docker_install' }, - { text: 'Docker Virtualization', link: '/en_US/guide/docker_build' }, - { text: 'Acknowledgements', link: '/en_US/guide/docker_thanks' }, - { text: 'FAQ', link: '/en_US/guide/docker_qa' } + items: [ + { text: 'System and hardware configuration requirements', link: '/en_US/guide/docker_precheck.html' }, + { text: 'Main installation', link: '/en_US/guide/docker_install.html' }, + { text: 'Docker Virtualization', link: '/en_US/guide/docker_build.html' }, + { text: 'Acknowledgements', link: '/en_US/guide/docker_thanks.html' }, + { text: 'FAQ', link: '/en_US/guide/docker_qa.html' } ] }, { text: 'Donation', - children: [ - { text: 'Donation', link: '/guide/dashboardq' } + items: [ + { text: 'Donation', link: '/guide/dashboardq.html' } ] } ] @@ -204,8 +205,8 @@ function getDeveloperSidebarEnUS() { return [ { text: 'Development Manual', - children: [ - { text: 'l10n', link: '/en_US/developer/l10n' } + items: [ + { text: 'l10n', link: '/en_US/developer/l10n.html' } ] } ] diff --git a/docs/.vitepress/dist/_headers b/docs/.vitepress/dist/_headers new file mode 100644 index 0000000000..f7fa3afc62 --- /dev/null +++ b/docs/.vitepress/dist/_headers @@ -0,0 +1,3 @@ +/assets/* + cache-control: max-age=31536000 + cache-control: immutable \ No newline at end of file diff --git a/docs/.vitepress/dist/assets/app.8fc4a373.js b/docs/.vitepress/dist/assets/app.8fc4a373.js new file mode 100644 index 0000000000..926e4121f9 --- /dev/null +++ b/docs/.vitepress/dist/assets/app.8fc4a373.js @@ -0,0 +1 @@ +var Uo=Object.defineProperty,Ro=Object.defineProperties;var Fo=Object.getOwnPropertyDescriptors;var Ms=Object.getOwnPropertySymbols;var No=Object.prototype.hasOwnProperty,Ho=Object.prototype.propertyIsEnumerable;var Is=(e,t,n)=>t in e?Uo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Os=(e,t)=>{for(var n in t||(t={}))No.call(t,n)&&Is(e,n,t[n]);if(Ms)for(var n of Ms(t))Ho.call(t,n)&&Is(e,n,t[n]);return e},Us=(e,t)=>Ro(e,Fo(t));const Do="modulepreload",Rs={},Bo="/",vr=function(t,n){return!n||n.length===0?t():Promise.all(n.map(s=>{if(s=`${Bo}${s}`,s in Rs)return;Rs[s]=!0;const r=s.endsWith(".css"),o=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${o}`))return;const i=document.createElement("link");if(i.rel=r?"stylesheet":Do,r||(i.as="script",i.crossOrigin=""),i.href=s,document.head.appendChild(i),r)return new Promise((l,c)=>{i.addEventListener("load",l),i.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>t())};function ts(e,t){const n=Object.create(null),s=e.split(",");for(let r=0;r!!n[r.toLowerCase()]:r=>!!n[r]}const jo="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",qo=ts(jo);function xr(e){return!!e||e===""}function ns(e){if(U(e)){const t={};for(let n=0;n{if(n){const s=n.split(Wo);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function at(e){let t="";if(pe(e))t=e;else if(U(e))for(let n=0;npe(e)?e:e==null?"":U(e)||fe(e)&&(e.toString===wr||!H(e.toString))?JSON.stringify(e,br,2):String(e),br=(e,t)=>t&&t.__v_isRef?br(e,t.value):xt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r])=>(n[`${s} =>`]=r,n),{})}:kr(t)?{[`Set(${t.size})`]:[...t.values()]}:fe(t)&&!U(t)&&!$r(t)?String(t):t,Z={},vt=[],Ie=()=>{},zo=()=>!1,Xo=/^on[^a-z]/,Vt=e=>Xo.test(e),ss=e=>e.startsWith("onUpdate:"),ke=Object.assign,rs=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Jo=Object.prototype.hasOwnProperty,W=(e,t)=>Jo.call(e,t),U=Array.isArray,xt=e=>xn(e)==="[object Map]",kr=e=>xn(e)==="[object Set]",H=e=>typeof e=="function",pe=e=>typeof e=="string",os=e=>typeof e=="symbol",fe=e=>e!==null&&typeof e=="object",yr=e=>fe(e)&&H(e.then)&&H(e.catch),wr=Object.prototype.toString,xn=e=>wr.call(e),Yo=e=>xn(e).slice(8,-1),$r=e=>xn(e)==="[object Object]",is=e=>pe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Mt=ts(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),bn=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Qo=/-(\w)/g,Ne=bn(e=>e.replace(Qo,(t,n)=>n?n.toUpperCase():"")),Zo=/\B([A-Z])/g,$t=bn(e=>e.replace(Zo,"-$1").toLowerCase()),kn=bn(e=>e.charAt(0).toUpperCase()+e.slice(1)),On=bn(e=>e?`on${kn(e)}`:""),Ht=(e,t)=>!Object.is(e,t),Un=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},Go=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Fs;const ei=()=>Fs||(Fs=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});let Re;class ti{constructor(t=!1){this.active=!0,this.effects=[],this.cleanups=[],!t&&Re&&(this.parent=Re,this.index=(Re.scopes||(Re.scopes=[])).push(this)-1)}run(t){if(this.active){const n=Re;try{return Re=this,t()}finally{Re=n}}}on(){Re=this}off(){Re=this.parent}stop(t){if(this.active){let n,s;for(n=0,s=this.effects.length;n{const t=new Set(e);return t.w=0,t.n=0,t},Cr=e=>(e.w&Ge)>0,Er=e=>(e.n&Ge)>0,si=({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let s=0;s{(f==="length"||f>=s)&&l.push(c)});else switch(n!==void 0&&l.push(i.get(n)),t){case"add":U(e)?is(n)&&l.push(i.get("length")):(l.push(i.get(rt)),xt(e)&&l.push(i.get(Kn)));break;case"delete":U(e)||(l.push(i.get(rt)),xt(e)&&l.push(i.get(Kn)));break;case"set":xt(e)&&l.push(i.get(rt));break}if(l.length===1)l[0]&&Wn(l[0]);else{const c=[];for(const f of l)f&&c.push(...f);Wn(ls(c))}}function Wn(e,t){for(const n of U(e)?e:[...e])(n!==Ae||n.allowRecurse)&&(n.scheduler?n.scheduler():n.run())}const oi=ts("__proto__,__v_isRef,__isVue"),Tr=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(os)),ii=as(),li=as(!1,!0),ci=as(!0),Hs=ai();function ai(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const s=z(this);for(let o=0,i=this.length;o{e[t]=function(...n){Ct();const s=z(this)[t].apply(this,n);return Et(),s}}),e}function as(e=!1,t=!1){return function(s,r,o){if(r==="__v_isReactive")return!e;if(r==="__v_isReadonly")return e;if(r==="__v_isShallow")return t;if(r==="__v_raw"&&o===(e?t?Ci:Or:t?Ir:Mr).get(s))return s;const i=U(s);if(!e&&i&&W(Hs,r))return Reflect.get(Hs,r,o);const l=Reflect.get(s,r,o);return(os(r)?Tr.has(r):oi(r))||(e||Le(s,"get",r),t)?l:he(l)?!i||!is(r)?l.value:l:fe(l)?e?Ur(l):wn(l):l}}const ui=Pr(),fi=Pr(!0);function Pr(e=!1){return function(n,s,r,o){let i=n[s];if(Dt(i)&&he(i)&&!he(r))return!1;if(!e&&!Dt(r)&&(Rr(r)||(r=z(r),i=z(i)),!U(n)&&he(i)&&!he(r)))return i.value=r,!0;const l=U(n)&&is(s)?Number(s)e,yn=e=>Reflect.getPrototypeOf(e);function Qt(e,t,n=!1,s=!1){e=e.__v_raw;const r=z(e),o=z(t);t!==o&&!n&&Le(r,"get",t),!n&&Le(r,"get",o);const{has:i}=yn(r),l=s?us:n?hs:Bt;if(i.call(r,t))return l(e.get(t));if(i.call(r,o))return l(e.get(o));e!==r&&e.get(t)}function Zt(e,t=!1){const n=this.__v_raw,s=z(n),r=z(e);return e!==r&&!t&&Le(s,"has",e),!t&&Le(s,"has",r),e===r?n.has(e):n.has(e)||n.has(r)}function Gt(e,t=!1){return e=e.__v_raw,!t&&Le(z(e),"iterate",rt),Reflect.get(e,"size",e)}function Ds(e){e=z(e);const t=z(this);return yn(t).has.call(t,e)||(t.add(e),qe(t,"add",e,e)),this}function Bs(e,t){t=z(t);const n=z(this),{has:s,get:r}=yn(n);let o=s.call(n,e);o||(e=z(e),o=s.call(n,e));const i=r.call(n,e);return n.set(e,t),o?Ht(t,i)&&qe(n,"set",e,t):qe(n,"add",e,t),this}function js(e){const t=z(this),{has:n,get:s}=yn(t);let r=n.call(t,e);r||(e=z(e),r=n.call(t,e)),s&&s.call(t,e);const o=t.delete(e);return r&&qe(t,"delete",e,void 0),o}function qs(){const e=z(this),t=e.size!==0,n=e.clear();return t&&qe(e,"clear",void 0,void 0),n}function en(e,t){return function(s,r){const o=this,i=o.__v_raw,l=z(i),c=t?us:e?hs:Bt;return!e&&Le(l,"iterate",rt),i.forEach((f,h)=>s.call(r,c(f),c(h),o))}}function tn(e,t,n){return function(...s){const r=this.__v_raw,o=z(r),i=xt(o),l=e==="entries"||e===Symbol.iterator&&i,c=e==="keys"&&i,f=r[e](...s),h=n?us:t?hs:Bt;return!t&&Le(o,"iterate",c?Kn:rt),{next(){const{value:m,done:x}=f.next();return x?{value:m,done:x}:{value:l?[h(m[0]),h(m[1])]:h(m),done:x}},[Symbol.iterator](){return this}}}}function ze(e){return function(...t){return e==="delete"?!1:this}}function mi(){const e={get(o){return Qt(this,o)},get size(){return Gt(this)},has:Zt,add:Ds,set:Bs,delete:js,clear:qs,forEach:en(!1,!1)},t={get(o){return Qt(this,o,!1,!0)},get size(){return Gt(this)},has:Zt,add:Ds,set:Bs,delete:js,clear:qs,forEach:en(!1,!0)},n={get(o){return Qt(this,o,!0)},get size(){return Gt(this,!0)},has(o){return Zt.call(this,o,!0)},add:ze("add"),set:ze("set"),delete:ze("delete"),clear:ze("clear"),forEach:en(!0,!1)},s={get(o){return Qt(this,o,!0,!0)},get size(){return Gt(this,!0)},has(o){return Zt.call(this,o,!0)},add:ze("add"),set:ze("set"),delete:ze("delete"),clear:ze("clear"),forEach:en(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{e[o]=tn(o,!1,!1),n[o]=tn(o,!0,!1),t[o]=tn(o,!1,!0),s[o]=tn(o,!0,!0)}),[e,n,t,s]}const[vi,xi,bi,ki]=mi();function fs(e,t){const n=t?e?ki:bi:e?xi:vi;return(s,r,o)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(W(n,r)&&r in s?n:s,r,o)}const yi={get:fs(!1,!1)},wi={get:fs(!1,!0)},$i={get:fs(!0,!1)},Mr=new WeakMap,Ir=new WeakMap,Or=new WeakMap,Ci=new WeakMap;function Ei(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Li(e){return e.__v_skip||!Object.isExtensible(e)?0:Ei(Yo(e))}function wn(e){return Dt(e)?e:ds(e,!1,Ar,yi,Mr)}function Si(e){return ds(e,!1,gi,wi,Ir)}function Ur(e){return ds(e,!0,_i,$i,Or)}function ds(e,t,n,s,r){if(!fe(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=r.get(e);if(o)return o;const i=Li(e);if(i===0)return e;const l=new Proxy(e,i===2?s:n);return r.set(e,l),l}function bt(e){return Dt(e)?bt(e.__v_raw):!!(e&&e.__v_isReactive)}function Dt(e){return!!(e&&e.__v_isReadonly)}function Rr(e){return!!(e&&e.__v_isShallow)}function Fr(e){return bt(e)||Dt(e)}function z(e){const t=e&&e.__v_raw;return t?z(t):e}function It(e){return on(e,"__v_skip",!0),e}const Bt=e=>fe(e)?wn(e):e,hs=e=>fe(e)?Ur(e):e;function Nr(e){Qe&&Ae&&(e=z(e),Sr(e.dep||(e.dep=ls())))}function Hr(e,t){e=z(e),e.dep&&Wn(e.dep)}function he(e){return!!(e&&e.__v_isRef===!0)}function ot(e){return Dr(e,!1)}function Ti(e){return Dr(e,!0)}function Dr(e,t){return he(e)?e:new Pi(e,t)}class Pi{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:z(t),this._value=n?t:Bt(t)}get value(){return Nr(this),this._value}set value(t){t=this.__v_isShallow?t:z(t),Ht(t,this._rawValue)&&(this._rawValue=t,this._value=this.__v_isShallow?t:Bt(t),Hr(this))}}function $(e){return he(e)?e.value:e}const Ai={get:(e,t,n)=>$(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return he(r)&&!he(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function Br(e){return bt(e)?e:new Proxy(e,Ai)}function jr(e){const t=U(e)?new Array(e.length):{};for(const n in e)t[n]=Ii(e,n);return t}class Mi{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}}function Ii(e,t,n){const s=e[t];return he(s)?s:new Mi(e,t,n)}class Oi{constructor(t,n,s,r){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this._dirty=!0,this.effect=new cs(t,()=>{this._dirty||(this._dirty=!0,Hr(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=s}get value(){const t=z(this);return Nr(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function Ui(e,t,n=!1){let s,r;const o=H(e);return o?(s=e,r=Ie):(s=e.get,r=e.set),new Oi(s,r,o||!r,n)}function Ze(e,t,n,s){let r;try{r=s?e(...s):e()}catch(o){zt(o,t,n)}return r}function Oe(e,t,n,s){if(H(e)){const o=Ze(e,t,n,s);return o&&yr(o)&&o.catch(i=>{zt(i,t,n)}),o}const r=[];for(let o=0;o>>1;jt(Ee[s])je&&Ee.splice(t,1)}function Vr(e,t,n,s){U(e)?n.push(...e):(!t||!t.includes(e,e.allowRecurse?s+1:s))&&n.push(e),Wr()}function Hi(e){Vr(e,At,Ot,_t)}function Di(e){Vr(e,Je,Ut,gt)}function gs(e,t=null){if(Ot.length){for(zn=t,At=[...new Set(Ot)],Ot.length=0,_t=0;_tjt(n)-jt(s)),gt=0;gte.id==null?1/0:e.id;function zr(e){Vn=!1,ln=!0,gs(e),Ee.sort((n,s)=>jt(n)-jt(s));const t=Ie;try{for(je=0;jeE.trim()):m&&(r=n.map(Go))}let l,c=s[l=On(t)]||s[l=On(Ne(t))];!c&&o&&(c=s[l=On($t(t))]),c&&Oe(c,e,6,r);const f=s[l+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Oe(f,e,6,r)}}function Xr(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(r!==void 0)return r;const o=e.emits;let i={},l=!1;if(!H(e)){const c=f=>{const h=Xr(f,t,!0);h&&(l=!0,ke(i,h))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!o&&!l?(s.set(e,null),null):(U(o)?o.forEach(c=>i[c]=null):ke(i,o),s.set(e,i),i)}function $n(e,t){return!e||!Vt(t)?!1:(t=t.slice(2).replace(/Once$/,""),W(e,t[0].toLowerCase()+t.slice(1))||W(e,$t(t))||W(e,t))}let xe=null,Cn=null;function an(e){const t=xe;return xe=e,Cn=e&&e.type.__scopeId||null,t}function Jr(e){Cn=e}function Yr(){Cn=null}function Be(e,t=xe,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&Gs(-1);const o=an(t),i=e(...r);return an(o),s._d&&Gs(1),i};return s._n=!0,s._c=!0,s._d=!0,s}function Rn(e){const{type:t,vnode:n,proxy:s,withProxy:r,props:o,propsOptions:[i],slots:l,attrs:c,emit:f,render:h,renderCache:m,data:x,setupState:E,ctx:L,inheritAttrs:B}=e;let p,b;const I=an(e);try{if(n.shapeFlag&4){const D=r||s;p=Pe(h.call(D,D,m,o,E,x,L)),b=c}else{const D=t;p=Pe(D.length>1?D(o,{attrs:c,slots:l,emit:f}):D(o,null)),b=t.props?c:ji(c)}}catch(D){Nt.length=0,zt(D,e,1),p=R(Ke)}let M=p;if(b&&B!==!1){const D=Object.keys(b),{shapeFlag:Y}=M;D.length&&Y&7&&(i&&D.some(ss)&&(b=qi(b,i)),M=Wt(M,b))}return n.dirs&&(M.dirs=M.dirs?M.dirs.concat(n.dirs):n.dirs),n.transition&&(M.transition=n.transition),p=M,an(I),p}const ji=e=>{let t;for(const n in e)(n==="class"||n==="style"||Vt(n))&&((t||(t={}))[n]=e[n]);return t},qi=(e,t)=>{const n={};for(const s in e)(!ss(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Ki(e,t,n){const{props:s,children:r,component:o}=e,{props:i,children:l,patchFlag:c}=t,f=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return s?Ks(s,i,f):!!i;if(c&8){const h=t.dynamicProps;for(let m=0;me.__isSuspense;function Qr(e,t){t&&t.pendingBranch?U(e)?t.effects.push(...e):t.effects.push(e):Di(e)}function zi(e,t){if(ue){let n=ue.provides;const s=ue.parent&&ue.parent.provides;s===n&&(n=ue.provides=Object.create(s)),n[e]=t}}function Rt(e,t,n=!1){const s=ue||xe;if(s){const r=s.parent==null?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides;if(r&&e in r)return r[e];if(arguments.length>1)return n&&H(t)?t.call(s.proxy):t}}function Zr(e,t){return ms(e,null,t)}const Ws={};function it(e,t,n){return ms(e,t,n)}function ms(e,t,{immediate:n,deep:s,flush:r,onTrack:o,onTrigger:i}=Z){const l=ue;let c,f=!1,h=!1;if(he(e)?(c=()=>e.value,f=Rr(e)):bt(e)?(c=()=>e,s=!0):U(e)?(h=!0,f=e.some(bt),c=()=>e.map(b=>{if(he(b))return b.value;if(bt(b))return mt(b);if(H(b))return Ze(b,l,2)})):H(e)?t?c=()=>Ze(e,l,2):c=()=>{if(!(l&&l.isUnmounted))return m&&m(),Oe(e,l,3,[x])}:c=Ie,t&&s){const b=c;c=()=>mt(b())}let m,x=b=>{m=p.onStop=()=>{Ze(b,l,4)}};if(yt)return x=Ie,t?n&&Oe(t,l,3,[c(),h?[]:void 0,x]):c(),Ie;let E=h?[]:Ws;const L=()=>{if(!!p.active)if(t){const b=p.run();(s||f||(h?b.some((I,M)=>Ht(I,E[M])):Ht(b,E)))&&(m&&m(),Oe(t,l,3,[b,E===Ws?void 0:E,x]),E=b)}else p.run()};L.allowRecurse=!!t;let B;r==="sync"?B=L:r==="post"?B=()=>$e(L,l&&l.suspense):B=()=>{!l||l.isMounted?Hi(L):L()};const p=new cs(c,B);return t?n?L():E=p.run():r==="post"?$e(p.run.bind(p),l&&l.suspense):p.run(),()=>{p.stop(),l&&l.scope&&rs(l.scope.effects,p)}}function Xi(e,t,n){const s=this.proxy,r=pe(e)?e.includes(".")?Gr(s,e):()=>s[e]:e.bind(s,s);let o;H(t)?o=t:(o=t.handler,n=t);const i=ue;kt(this);const l=ms(r,o.bind(s),n);return i?kt(i):ct(),l}function Gr(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;r{mt(n,t)});else if($r(e))for(const n in e)mt(e[n],t);return e}function re(e){return H(e)?{setup:e,name:e.name}:e}const qt=e=>!!e.type.__asyncLoader;function Ji(e){H(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:r=200,timeout:o,suspensible:i=!0,onError:l}=e;let c=null,f,h=0;const m=()=>(h++,c=null,x()),x=()=>{let E;return c||(E=c=t().catch(L=>{if(L=L instanceof Error?L:new Error(String(L)),l)return new Promise((B,p)=>{l(L,()=>B(m()),()=>p(L),h+1)});throw L}).then(L=>E!==c&&c?c:(L&&(L.__esModule||L[Symbol.toStringTag]==="Module")&&(L=L.default),f=L,L)))};return re({name:"AsyncComponentWrapper",__asyncLoader:x,get __asyncResolved(){return f},setup(){const E=ue;if(f)return()=>Fn(f,E);const L=I=>{c=null,zt(I,E,13,!s)};if(i&&E.suspense||yt)return x().then(I=>()=>Fn(I,E)).catch(I=>(L(I),()=>s?R(s,{error:I}):null));const B=ot(!1),p=ot(),b=ot(!!r);return r&&setTimeout(()=>{b.value=!1},r),o!=null&&setTimeout(()=>{if(!B.value&&!p.value){const I=new Error(`Async component timed out after ${o}ms.`);L(I),p.value=I}},o),x().then(()=>{B.value=!0,E.parent&&vs(E.parent.vnode)&&_s(E.parent.update)}).catch(I=>{L(I),p.value=I}),()=>{if(B.value&&f)return Fn(f,E);if(p.value&&s)return R(s,{error:p.value});if(n&&!b.value)return R(n)}}})}function Fn(e,{vnode:{ref:t,props:n,children:s}}){const r=R(e,n,s);return r.ref=t,r}const vs=e=>e.type.__isKeepAlive;function Yi(e,t){eo(e,"a",t)}function Qi(e,t){eo(e,"da",t)}function eo(e,t,n=ue){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(En(t,s,n),n){let r=n.parent;for(;r&&r.parent;)vs(r.parent.vnode)&&Zi(s,t,n,r),r=r.parent}}function Zi(e,t,n,s){const r=En(t,e,s,!0);Ln(()=>{rs(s[t],r)},n)}function En(e,t,n=ue,s=!1){if(n){const r=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{if(n.isUnmounted)return;Ct(),kt(n);const l=Oe(t,n,e,i);return ct(),Et(),l});return s?r.unshift(o):r.push(o),o}}const We=e=>(t,n=ue)=>(!yt||e==="sp")&&En(e,t,n),Gi=We("bm"),ft=We("m"),el=We("bu"),to=We("u"),tl=We("bum"),Ln=We("um"),nl=We("sp"),sl=We("rtg"),rl=We("rtc");function ol(e,t=ue){En("ec",e,t)}let Xn=!0;function il(e){const t=so(e),n=e.proxy,s=e.ctx;Xn=!1,t.beforeCreate&&Vs(t.beforeCreate,e,"bc");const{data:r,computed:o,methods:i,watch:l,provide:c,inject:f,created:h,beforeMount:m,mounted:x,beforeUpdate:E,updated:L,activated:B,deactivated:p,beforeDestroy:b,beforeUnmount:I,destroyed:M,unmounted:D,render:Y,renderTracked:Q,renderTriggered:j,errorCaptured:le,serverPrefetch:ne,expose:oe,inheritAttrs:ge,components:K,directives:ie,filters:ye}=t;if(f&&ll(f,s,null,e.appContext.config.unwrapInjectedRef),i)for(const se in i){const G=i[se];H(G)&&(s[se]=G.bind(n))}if(r){const se=r.call(n,n);fe(se)&&(e.data=wn(se))}if(Xn=!0,o)for(const se in o){const G=o[se],He=H(G)?G.bind(n,n):H(G.get)?G.get.bind(n,n):Ie,An=!H(G)&&H(G.set)?G.set.bind(n):Ie,Lt=q({get:He,set:An});Object.defineProperty(s,se,{enumerable:!0,configurable:!0,get:()=>Lt.value,set:dt=>Lt.value=dt})}if(l)for(const se in l)no(l[se],s,n,se);if(c){const se=H(c)?c.call(n):c;Reflect.ownKeys(se).forEach(G=>{zi(G,se[G])})}h&&Vs(h,e,"c");function we(se,G){U(G)?G.forEach(He=>se(He.bind(n))):G&&se(G.bind(n))}if(we(Gi,m),we(ft,x),we(el,E),we(to,L),we(Yi,B),we(Qi,p),we(ol,le),we(rl,Q),we(sl,j),we(tl,I),we(Ln,D),we(nl,ne),U(oe))if(oe.length){const se=e.exposed||(e.exposed={});oe.forEach(G=>{Object.defineProperty(se,G,{get:()=>n[G],set:He=>n[G]=He})})}else e.exposed||(e.exposed={});Y&&e.render===Ie&&(e.render=Y),ge!=null&&(e.inheritAttrs=ge),K&&(e.components=K),ie&&(e.directives=ie)}function ll(e,t,n=Ie,s=!1){U(e)&&(e=Jn(e));for(const r in e){const o=e[r];let i;fe(o)?"default"in o?i=Rt(o.from||r,o.default,!0):i=Rt(o.from||r):i=Rt(o),he(i)&&s?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:l=>i.value=l}):t[r]=i}}function Vs(e,t,n){Oe(U(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function no(e,t,n,s){const r=s.includes(".")?Gr(n,s):()=>n[s];if(pe(e)){const o=t[e];H(o)&&it(r,o)}else if(H(e))it(r,e.bind(n));else if(fe(e))if(U(e))e.forEach(o=>no(o,t,n,s));else{const o=H(e.handler)?e.handler.bind(n):t[e.handler];H(o)&&it(r,o,e)}}function so(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,l=o.get(t);let c;return l?c=l:!r.length&&!n&&!s?c=t:(c={},r.length&&r.forEach(f=>un(c,f,i,!0)),un(c,t,i)),o.set(t,c),c}function un(e,t,n,s=!1){const{mixins:r,extends:o}=t;o&&un(e,o,n,!0),r&&r.forEach(i=>un(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const l=cl[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const cl={data:zs,props:nt,emits:nt,methods:nt,computed:nt,beforeCreate:ve,created:ve,beforeMount:ve,mounted:ve,beforeUpdate:ve,updated:ve,beforeDestroy:ve,beforeUnmount:ve,destroyed:ve,unmounted:ve,activated:ve,deactivated:ve,errorCaptured:ve,serverPrefetch:ve,components:nt,directives:nt,watch:ul,provide:zs,inject:al};function zs(e,t){return t?e?function(){return ke(H(e)?e.call(this,this):e,H(t)?t.call(this,this):t)}:t:e}function al(e,t){return nt(Jn(e),Jn(t))}function Jn(e){if(U(e)){const t={};for(let n=0;n0)&&!(i&16)){if(i&8){const h=e.vnode.dynamicProps;for(let m=0;m{c=!0;const[x,E]=oo(m,t,!0);ke(i,x),E&&l.push(...E)};!n&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}if(!o&&!c)return s.set(e,vt),vt;if(U(o))for(let h=0;h-1,E[1]=B<0||L-1||W(E,"default"))&&l.push(m)}}}const f=[i,l];return s.set(e,f),f}function Xs(e){return e[0]!=="$"}function Js(e){const t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:e===null?"null":""}function Ys(e,t){return Js(e)===Js(t)}function Qs(e,t){return U(t)?t.findIndex(n=>Ys(n,e)):H(t)&&Ys(t,e)?0:-1}const io=e=>e[0]==="_"||e==="$stable",xs=e=>U(e)?e.map(Pe):[Pe(e)],hl=(e,t,n)=>{const s=Be((...r)=>xs(t(...r)),n);return s._c=!1,s},lo=(e,t,n)=>{const s=e._ctx;for(const r in e){if(io(r))continue;const o=e[r];if(H(o))t[r]=hl(r,o,s);else if(o!=null){const i=xs(o);t[r]=()=>i}}},co=(e,t)=>{const n=xs(t);e.slots.default=()=>n},pl=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=z(t),on(t,"_",n)):lo(t,e.slots={})}else e.slots={},t&&co(e,t);on(e.slots,Sn,1)},_l=(e,t,n)=>{const{vnode:s,slots:r}=e;let o=!0,i=Z;if(s.shapeFlag&32){const l=t._;l?n&&l===1?o=!1:(ke(r,t),!n&&l===1&&delete r._):(o=!t.$stable,lo(t,r)),i=t}else t&&(co(e,t),i={default:1});if(o)for(const l in r)!io(l)&&!(l in i)&&delete r[l]};function Fe(e,t,n,s){const r=e.dirs,o=t&&t.dirs;for(let i=0;ifn(x,t&&(U(t)?t[E]:t),n,s,r));return}if(qt(s)&&!r)return;const o=s.shapeFlag&4?ys(s.component)||s.component.proxy:s.el,i=r?null:o,{i:l,r:c}=e,f=t&&t.r,h=l.refs===Z?l.refs={}:l.refs,m=l.setupState;if(f!=null&&f!==c&&(pe(f)?(h[f]=null,W(m,f)&&(m[f]=null)):he(f)&&(f.value=null)),H(c))Ze(c,l,12,[i,h]);else{const x=pe(c),E=he(c);if(x||E){const L=()=>{if(e.f){const B=x?h[c]:c.value;r?U(B)&&rs(B,o):U(B)?B.includes(o)||B.push(o):x?(h[c]=[o],W(m,c)&&(m[c]=h[c])):(c.value=[o],e.k&&(h[e.k]=c.value))}else x?(h[c]=i,W(m,c)&&(m[c]=i)):he(c)&&(c.value=i,e.k&&(h[e.k]=i))};i?(L.id=-1,$e(L,n)):L()}}}let Xe=!1;const nn=e=>/svg/.test(e.namespaceURI)&&e.tagName!=="foreignObject",Nn=e=>e.nodeType===8;function vl(e){const{mt:t,p:n,o:{patchProp:s,nextSibling:r,parentNode:o,remove:i,insert:l,createComment:c}}=e,f=(p,b)=>{if(!b.hasChildNodes()){n(null,p,b),cn();return}Xe=!1,h(b.firstChild,p,null,null,null),cn(),Xe&&console.error("Hydration completed but contains mismatches.")},h=(p,b,I,M,D,Y=!1)=>{const Q=Nn(p)&&p.data==="[",j=()=>L(p,b,I,M,D,Q),{type:le,ref:ne,shapeFlag:oe}=b,ge=p.nodeType;b.el=p;let K=null;switch(le){case Kt:ge!==3?K=j():(p.data!==b.children&&(Xe=!0,p.data=b.children),K=r(p));break;case Ke:ge!==8||Q?K=j():K=r(p);break;case Ft:if(ge!==1)K=j();else{K=p;const ie=!b.children.length;for(let ye=0;ye{Y=Y||!!b.dynamicChildren;const{type:Q,props:j,patchFlag:le,shapeFlag:ne,dirs:oe}=b,ge=Q==="input"&&oe||Q==="option";if(ge||le!==-1){if(oe&&Fe(b,null,I,"created"),j)if(ge||!Y||le&48)for(const ie in j)(ge&&ie.endsWith("value")||Vt(ie)&&!Mt(ie))&&s(p,ie,null,j[ie],!1,void 0,I);else j.onClick&&s(p,"onClick",null,j.onClick,!1,void 0,I);let K;if((K=j&&j.onVnodeBeforeMount)&&Se(K,I,b),oe&&Fe(b,null,I,"beforeMount"),((K=j&&j.onVnodeMounted)||oe)&&Qr(()=>{K&&Se(K,I,b),oe&&Fe(b,null,I,"mounted")},M),ne&16&&!(j&&(j.innerHTML||j.textContent))){let ie=x(p.firstChild,b,p,I,M,D,Y);for(;ie;){Xe=!0;const ye=ie;ie=ie.nextSibling,i(ye)}}else ne&8&&p.textContent!==b.children&&(Xe=!0,p.textContent=b.children)}return p.nextSibling},x=(p,b,I,M,D,Y,Q)=>{Q=Q||!!b.dynamicChildren;const j=b.children,le=j.length;for(let ne=0;ne{const{slotScopeIds:Q}=b;Q&&(D=D?D.concat(Q):Q);const j=o(p),le=x(r(p),b,j,I,M,D,Y);return le&&Nn(le)&&le.data==="]"?r(b.anchor=le):(Xe=!0,l(b.anchor=c("]"),j,le),le)},L=(p,b,I,M,D,Y)=>{if(Xe=!0,b.el=null,Y){const le=B(p);for(;;){const ne=r(p);if(ne&&ne!==le)i(ne);else break}}const Q=r(p),j=o(p);return i(p),n(null,b,j,Q,I,M,nn(j),D),Q},B=p=>{let b=0;for(;p;)if(p=r(p),p&&Nn(p)&&(p.data==="["&&b++,p.data==="]")){if(b===0)return r(p);b--}return p};return[f,h]}const $e=Qr;function xl(e){return bl(e,vl)}function bl(e,t){const n=ei();n.__VUE__=!0;const{insert:s,remove:r,patchProp:o,createElement:i,createText:l,createComment:c,setText:f,setElementText:h,parentNode:m,nextSibling:x,setScopeId:E=Ie,cloneNode:L,insertStaticContent:B}=e,p=(a,u,d,g=null,_=null,y=null,C=!1,k=null,w=!!u.dynamicChildren)=>{if(a===u)return;a&&!Tt(a,u)&&(g=Yt(a),Ve(a,_,y,!0),a=null),u.patchFlag===-2&&(w=!1,u.dynamicChildren=null);const{type:v,ref:P,shapeFlag:S}=u;switch(v){case Kt:b(a,u,d,g);break;case Ke:I(a,u,d,g);break;case Ft:a==null&&M(u,d,g,C);break;case de:ie(a,u,d,g,_,y,C,k,w);break;default:S&1?Q(a,u,d,g,_,y,C,k,w):S&6?ye(a,u,d,g,_,y,C,k,w):(S&64||S&128)&&v.process(a,u,d,g,_,y,C,k,w,ht)}P!=null&&_&&fn(P,a&&a.ref,y,u||a,!u)},b=(a,u,d,g)=>{if(a==null)s(u.el=l(u.children),d,g);else{const _=u.el=a.el;u.children!==a.children&&f(_,u.children)}},I=(a,u,d,g)=>{a==null?s(u.el=c(u.children||""),d,g):u.el=a.el},M=(a,u,d,g)=>{[a.el,a.anchor]=B(a.children,u,d,g,a.el,a.anchor)},D=({el:a,anchor:u},d,g)=>{let _;for(;a&&a!==u;)_=x(a),s(a,d,g),a=_;s(u,d,g)},Y=({el:a,anchor:u})=>{let d;for(;a&&a!==u;)d=x(a),r(a),a=d;r(u)},Q=(a,u,d,g,_,y,C,k,w)=>{C=C||u.type==="svg",a==null?j(u,d,g,_,y,C,k,w):oe(a,u,_,y,C,k,w)},j=(a,u,d,g,_,y,C,k)=>{let w,v;const{type:P,props:S,shapeFlag:A,transition:O,patchFlag:V,dirs:te}=a;if(a.el&&L!==void 0&&V===-1)w=a.el=L(a.el);else{if(w=a.el=i(a.type,y,S&&S.is,S),A&8?h(w,a.children):A&16&&ne(a.children,w,null,g,_,y&&P!=="foreignObject",C,k),te&&Fe(a,null,g,"created"),S){for(const ee in S)ee!=="value"&&!Mt(ee)&&o(w,ee,null,S[ee],y,a.children,g,_,De);"value"in S&&o(w,"value",null,S.value),(v=S.onVnodeBeforeMount)&&Se(v,g,a)}le(w,a,a.scopeId,C,g)}te&&Fe(a,null,g,"beforeMount");const J=(!_||_&&!_.pendingBranch)&&O&&!O.persisted;J&&O.beforeEnter(w),s(w,u,d),((v=S&&S.onVnodeMounted)||J||te)&&$e(()=>{v&&Se(v,g,a),J&&O.enter(w),te&&Fe(a,null,g,"mounted")},_)},le=(a,u,d,g,_)=>{if(d&&E(a,d),g)for(let y=0;y{for(let v=w;v{const k=u.el=a.el;let{patchFlag:w,dynamicChildren:v,dirs:P}=u;w|=a.patchFlag&16;const S=a.props||Z,A=u.props||Z;let O;d&&tt(d,!1),(O=A.onVnodeBeforeUpdate)&&Se(O,d,u,a),P&&Fe(u,a,d,"beforeUpdate"),d&&tt(d,!0);const V=_&&u.type!=="foreignObject";if(v?ge(a.dynamicChildren,v,k,d,g,V,y):C||He(a,u,k,null,d,g,V,y,!1),w>0){if(w&16)K(k,u,S,A,d,g,_);else if(w&2&&S.class!==A.class&&o(k,"class",null,A.class,_),w&4&&o(k,"style",S.style,A.style,_),w&8){const te=u.dynamicProps;for(let J=0;J{O&&Se(O,d,u,a),P&&Fe(u,a,d,"updated")},g)},ge=(a,u,d,g,_,y,C)=>{for(let k=0;k{if(d!==g){for(const k in g){if(Mt(k))continue;const w=g[k],v=d[k];w!==v&&k!=="value"&&o(a,k,v,w,C,u.children,_,y,De)}if(d!==Z)for(const k in d)!Mt(k)&&!(k in g)&&o(a,k,d[k],null,C,u.children,_,y,De);"value"in g&&o(a,"value",d.value,g.value)}},ie=(a,u,d,g,_,y,C,k,w)=>{const v=u.el=a?a.el:l(""),P=u.anchor=a?a.anchor:l("");let{patchFlag:S,dynamicChildren:A,slotScopeIds:O}=u;O&&(k=k?k.concat(O):O),a==null?(s(v,d,g),s(P,d,g),ne(u.children,d,P,_,y,C,k,w)):S>0&&S&64&&A&&a.dynamicChildren?(ge(a.dynamicChildren,A,d,_,y,C,k),(u.key!=null||_&&u===_.subTree)&&uo(a,u,!0)):He(a,u,d,P,_,y,C,k,w)},ye=(a,u,d,g,_,y,C,k,w)=>{u.slotScopeIds=k,a==null?u.shapeFlag&512?_.ctx.activate(u,d,g,C,w):Pn(u,d,g,_,y,C,w):we(a,u,w)},Pn=(a,u,d,g,_,y,C)=>{const k=a.component=Al(a,g,_);if(vs(a)&&(k.ctx.renderer=ht),Ml(k),k.asyncDep){if(_&&_.registerDep(k,se),!a.el){const w=k.subTree=R(Ke);I(null,w,u,d)}return}se(k,a,u,d,_,y,C)},we=(a,u,d)=>{const g=u.component=a.component;if(Ki(a,u,d))if(g.asyncDep&&!g.asyncResolved){G(g,u,d);return}else g.next=u,Ni(g.update),g.update();else u.component=a.component,u.el=a.el,g.vnode=u},se=(a,u,d,g,_,y,C)=>{const k=()=>{if(a.isMounted){let{next:P,bu:S,u:A,parent:O,vnode:V}=a,te=P,J;tt(a,!1),P?(P.el=V.el,G(a,P,C)):P=V,S&&Un(S),(J=P.props&&P.props.onVnodeBeforeUpdate)&&Se(J,O,P,V),tt(a,!0);const ee=Rn(a),Te=a.subTree;a.subTree=ee,p(Te,ee,m(Te.el),Yt(Te),a,_,y),P.el=ee.el,te===null&&Wi(a,ee.el),A&&$e(A,_),(J=P.props&&P.props.onVnodeUpdated)&&$e(()=>Se(J,O,P,V),_)}else{let P;const{el:S,props:A}=u,{bm:O,m:V,parent:te}=a,J=qt(u);if(tt(a,!1),O&&Un(O),!J&&(P=A&&A.onVnodeBeforeMount)&&Se(P,te,u),tt(a,!0),S&&In){const ee=()=>{a.subTree=Rn(a),In(S,a.subTree,a,_,null)};J?u.type.__asyncLoader().then(()=>!a.isUnmounted&&ee()):ee()}else{const ee=a.subTree=Rn(a);p(null,ee,d,g,a,_,y),u.el=ee.el}if(V&&$e(V,_),!J&&(P=A&&A.onVnodeMounted)){const ee=u;$e(()=>Se(P,te,ee),_)}u.shapeFlag&256&&a.a&&$e(a.a,_),a.isMounted=!0,u=d=g=null}},w=a.effect=new cs(k,()=>_s(a.update),a.scope),v=a.update=w.run.bind(w);v.id=a.uid,tt(a,!0),v()},G=(a,u,d)=>{u.component=a;const g=a.vnode.props;a.vnode=u,a.next=null,dl(a,u.props,g,d),_l(a,u.children,d),Ct(),gs(void 0,a.update),Et()},He=(a,u,d,g,_,y,C,k,w=!1)=>{const v=a&&a.children,P=a?a.shapeFlag:0,S=u.children,{patchFlag:A,shapeFlag:O}=u;if(A>0){if(A&128){Lt(v,S,d,g,_,y,C,k,w);return}else if(A&256){An(v,S,d,g,_,y,C,k,w);return}}O&8?(P&16&&De(v,_,y),S!==v&&h(d,S)):P&16?O&16?Lt(v,S,d,g,_,y,C,k,w):De(v,_,y,!0):(P&8&&h(d,""),O&16&&ne(S,d,g,_,y,C,k,w))},An=(a,u,d,g,_,y,C,k,w)=>{a=a||vt,u=u||vt;const v=a.length,P=u.length,S=Math.min(v,P);let A;for(A=0;AP?De(a,_,y,!0,!1,S):ne(u,d,g,_,y,C,k,w,S)},Lt=(a,u,d,g,_,y,C,k,w)=>{let v=0;const P=u.length;let S=a.length-1,A=P-1;for(;v<=S&&v<=A;){const O=a[v],V=u[v]=w?Ye(u[v]):Pe(u[v]);if(Tt(O,V))p(O,V,d,null,_,y,C,k,w);else break;v++}for(;v<=S&&v<=A;){const O=a[S],V=u[A]=w?Ye(u[A]):Pe(u[A]);if(Tt(O,V))p(O,V,d,null,_,y,C,k,w);else break;S--,A--}if(v>S){if(v<=A){const O=A+1,V=OA)for(;v<=S;)Ve(a[v],_,y,!0),v++;else{const O=v,V=v,te=new Map;for(v=V;v<=A;v++){const Ce=u[v]=w?Ye(u[v]):Pe(u[v]);Ce.key!=null&&te.set(Ce.key,v)}let J,ee=0;const Te=A-V+1;let pt=!1,Ts=0;const St=new Array(Te);for(v=0;v=Te){Ve(Ce,_,y,!0);continue}let Ue;if(Ce.key!=null)Ue=te.get(Ce.key);else for(J=V;J<=A;J++)if(St[J-V]===0&&Tt(Ce,u[J])){Ue=J;break}Ue===void 0?Ve(Ce,_,y,!0):(St[Ue-V]=v+1,Ue>=Ts?Ts=Ue:pt=!0,p(Ce,u[Ue],d,null,_,y,C,k,w),ee++)}const Ps=pt?kl(St):vt;for(J=Ps.length-1,v=Te-1;v>=0;v--){const Ce=V+v,Ue=u[Ce],As=Ce+1{const{el:y,type:C,transition:k,children:w,shapeFlag:v}=a;if(v&6){dt(a.component.subTree,u,d,g);return}if(v&128){a.suspense.move(u,d,g);return}if(v&64){C.move(a,u,d,ht);return}if(C===de){s(y,u,d);for(let S=0;Sk.enter(y),_);else{const{leave:S,delayLeave:A,afterLeave:O}=k,V=()=>s(y,u,d),te=()=>{S(y,()=>{V(),O&&O()})};A?A(y,V,te):te()}else s(y,u,d)},Ve=(a,u,d,g=!1,_=!1)=>{const{type:y,props:C,ref:k,children:w,dynamicChildren:v,shapeFlag:P,patchFlag:S,dirs:A}=a;if(k!=null&&fn(k,null,d,a,!0),P&256){u.ctx.deactivate(a);return}const O=P&1&&A,V=!qt(a);let te;if(V&&(te=C&&C.onVnodeBeforeUnmount)&&Se(te,u,a),P&6)Oo(a.component,d,g);else{if(P&128){a.suspense.unmount(d,g);return}O&&Fe(a,null,u,"beforeUnmount"),P&64?a.type.remove(a,u,d,_,ht,g):v&&(y!==de||S>0&&S&64)?De(v,u,d,!1,!0):(y===de&&S&384||!_&&P&16)&&De(w,u,d),g&&Ls(a)}(V&&(te=C&&C.onVnodeUnmounted)||O)&&$e(()=>{te&&Se(te,u,a),O&&Fe(a,null,u,"unmounted")},d)},Ls=a=>{const{type:u,el:d,anchor:g,transition:_}=a;if(u===de){Io(d,g);return}if(u===Ft){Y(a);return}const y=()=>{r(d),_&&!_.persisted&&_.afterLeave&&_.afterLeave()};if(a.shapeFlag&1&&_&&!_.persisted){const{leave:C,delayLeave:k}=_,w=()=>C(d,y);k?k(a.el,y,w):w()}else y()},Io=(a,u)=>{let d;for(;a!==u;)d=x(a),r(a),a=d;r(u)},Oo=(a,u,d)=>{const{bum:g,scope:_,update:y,subTree:C,um:k}=a;g&&Un(g),_.stop(),y&&(y.active=!1,Ve(C,a,u,d)),k&&$e(k,u),$e(()=>{a.isUnmounted=!0},u),u&&u.pendingBranch&&!u.isUnmounted&&a.asyncDep&&!a.asyncResolved&&a.suspenseId===u.pendingId&&(u.deps--,u.deps===0&&u.resolve())},De=(a,u,d,g=!1,_=!1,y=0)=>{for(let C=y;Ca.shapeFlag&6?Yt(a.component.subTree):a.shapeFlag&128?a.suspense.next():x(a.anchor||a.el),Ss=(a,u,d)=>{a==null?u._vnode&&Ve(u._vnode,null,null,!0):p(u._vnode||null,a,u,null,null,null,d),cn(),u._vnode=a},ht={p,um:Ve,m:dt,r:Ls,mt:Pn,mc:ne,pc:He,pbc:ge,n:Yt,o:e};let Mn,In;return t&&([Mn,In]=t(ht)),{render:Ss,hydrate:Mn,createApp:ml(Ss,Mn)}}function tt({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function uo(e,t,n=!1){const s=e.children,r=t.children;if(U(s)&&U(r))for(let o=0;o>1,e[n[l]]0&&(t[s]=n[o-1]),n[o]=s)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}const yl=e=>e.__isTeleport,fo="components";function dn(e,t){return $l(fo,e,!0,t)||e}const wl=Symbol();function $l(e,t,n=!0,s=!1){const r=xe||ue;if(r){const o=r.type;if(e===fo){const l=Rl(o);if(l&&(l===t||l===Ne(t)||l===kn(Ne(t))))return o}const i=Zs(r[e]||o[e],t)||Zs(r.appContext[e],t);return!i&&s?o:i}}function Zs(e,t){return e&&(e[t]||e[Ne(t)]||e[kn(Ne(t))])}const de=Symbol(void 0),Kt=Symbol(void 0),Ke=Symbol(void 0),Ft=Symbol(void 0),Nt=[];let lt=null;function T(e=!1){Nt.push(lt=e?null:[])}function Cl(){Nt.pop(),lt=Nt[Nt.length-1]||null}let hn=1;function Gs(e){hn+=e}function ho(e){return e.dynamicChildren=hn>0?lt||vt:null,Cl(),hn>0&<&<.push(e),e}function F(e,t,n,s,r,o){return ho(N(e,t,n,s,r,o,!0))}function _e(e,t,n,s,r){return ho(R(e,t,n,s,r,!0))}function pn(e){return e?e.__v_isVNode===!0:!1}function Tt(e,t){return e.type===t.type&&e.key===t.key}const Sn="__vInternal",po=({key:e})=>e!=null?e:null,rn=({ref:e,ref_key:t,ref_for:n})=>e!=null?pe(e)||he(e)||H(e)?{i:xe,r:e,k:t,f:!!n}:e:null;function N(e,t=null,n=null,s=0,r=null,o=e===de?0:1,i=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&po(t),ref:t&&rn(t),scopeId:Cn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null};return l?(bs(c,n),o&128&&e.normalize(c)):n&&(c.shapeFlag|=pe(n)?8:16),hn>0&&!i&<&&(c.patchFlag>0||o&6)&&c.patchFlag!==32&<.push(c),c}const R=El;function El(e,t=null,n=null,s=0,r=null,o=!1){if((!e||e===wl)&&(e=Ke),pn(e)){const l=Wt(e,t,!0);return n&&bs(l,n),l}if(Fl(e)&&(e=e.__vccOpts),t){t=Ll(t);let{class:l,style:c}=t;l&&!pe(l)&&(t.class=at(l)),fe(c)&&(Fr(c)&&!U(c)&&(c=ke({},c)),t.style=ns(c))}const i=pe(e)?1:Vi(e)?128:yl(e)?64:fe(e)?4:H(e)?2:0;return N(e,t,n,s,r,i,o,!0)}function Ll(e){return e?Fr(e)||Sn in e?ke({},e):e:null}function Wt(e,t,n=!1){const{props:s,ref:r,patchFlag:o,children:i}=e,l=t?ks(s||{},t):s;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&po(l),ref:t&&t.ref?n&&r?U(r)?r.concat(rn(t)):[r,rn(t)]:rn(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==de?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Wt(e.ssContent),ssFallback:e.ssFallback&&Wt(e.ssFallback),el:e.el,anchor:e.anchor}}function Xt(e=" ",t=0){return R(Kt,null,e,t)}function _f(e,t){const n=R(Ft,null,e);return n.staticCount=t,n}function X(e="",t=!1){return t?(T(),_e(Ke,null,e)):R(Ke,null,e)}function Pe(e){return e==null||typeof e=="boolean"?R(Ke):U(e)?R(de,null,e.slice()):typeof e=="object"?Ye(e):R(Kt,null,String(e))}function Ye(e){return e.el===null||e.memo?e:Wt(e)}function bs(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(U(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),bs(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!(Sn in t)?t._ctx=xe:r===3&&xe&&(xe.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else H(t)?(t={default:t,_ctx:xe},n=32):(t=String(t),s&64?(n=16,t=[Xt(t)]):n=8);e.children=t,e.shapeFlag|=n}function ks(...e){const t={};for(let n=0;nt(i,l,void 0,o&&o[l]));else{const i=Object.keys(e);r=new Array(i.length);for(let l=0,c=i.length;lpn(t)?!(t.type===Ke||t.type===de&&!_o(t.children)):!0)?e:null}const Qn=e=>e?go(e)?ys(e)||e.proxy:Qn(e.parent):null,_n=ke(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Qn(e.parent),$root:e=>Qn(e.root),$emit:e=>e.emit,$options:e=>so(e),$forceUpdate:e=>()=>_s(e.update),$nextTick:e=>Kr.bind(e.proxy),$watch:e=>Xi.bind(e)}),Sl={get({_:e},t){const{ctx:n,setupState:s,data:r,props:o,accessCache:i,type:l,appContext:c}=e;let f;if(t[0]!=="$"){const E=i[t];if(E!==void 0)switch(E){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return o[t]}else{if(s!==Z&&W(s,t))return i[t]=1,s[t];if(r!==Z&&W(r,t))return i[t]=2,r[t];if((f=e.propsOptions[0])&&W(f,t))return i[t]=3,o[t];if(n!==Z&&W(n,t))return i[t]=4,n[t];Xn&&(i[t]=0)}}const h=_n[t];let m,x;if(h)return t==="$attrs"&&Le(e,"get",t),h(e);if((m=l.__cssModules)&&(m=m[t]))return m;if(n!==Z&&W(n,t))return i[t]=4,n[t];if(x=c.config.globalProperties,W(x,t))return x[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:o}=e;return r!==Z&&W(r,t)?(r[t]=n,!0):s!==Z&&W(s,t)?(s[t]=n,!0):W(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:o}},i){let l;return!!n[i]||e!==Z&&W(e,i)||t!==Z&&W(t,i)||(l=o[0])&&W(l,i)||W(s,i)||W(_n,i)||W(r.config.globalProperties,i)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:W(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},Tl=ao();let Pl=0;function Al(e,t,n){const s=e.type,r=(t?t.appContext:e.appContext)||Tl,o={uid:Pl++,vnode:e,type:s,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,scope:new ti(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:oo(s,r),emitsOptions:Xr(s,r),emit:null,emitted:null,propsDefaults:Z,inheritAttrs:s.inheritAttrs,ctx:Z,data:Z,props:Z,attrs:Z,slots:Z,refs:Z,setupState:Z,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=Bi.bind(null,o),e.ce&&e.ce(o),o}let ue=null;const gf=()=>ue||xe,kt=e=>{ue=e,e.scope.on()},ct=()=>{ue&&ue.scope.off(),ue=null};function go(e){return e.vnode.shapeFlag&4}let yt=!1;function Ml(e,t=!1){yt=t;const{props:n,children:s}=e.vnode,r=go(e);fl(e,n,r,t),pl(e,s);const o=r?Il(e,t):void 0;return yt=!1,o}function Il(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=It(new Proxy(e.ctx,Sl));const{setup:s}=n;if(s){const r=e.setupContext=s.length>1?Ul(e):null;kt(e),Ct();const o=Ze(s,e,0,[e.props,r]);if(Et(),ct(),yr(o)){if(o.then(ct,ct),t)return o.then(i=>{er(e,i,t)}).catch(i=>{zt(i,e,0)});e.asyncDep=o}else er(e,o,t)}else mo(e,t)}function er(e,t,n){H(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:fe(t)&&(e.setupState=Br(t)),mo(e,n)}let tr;function mo(e,t,n){const s=e.type;if(!e.render){if(!t&&tr&&!s.render){const r=s.template;if(r){const{isCustomElement:o,compilerOptions:i}=e.appContext.config,{delimiters:l,compilerOptions:c}=s,f=ke(ke({isCustomElement:o,delimiters:l},i),c);s.render=tr(r,f)}}e.render=s.render||Ie}kt(e),Ct(),il(e),Et(),ct()}function Ol(e){return new Proxy(e.attrs,{get(t,n){return Le(e,"get","$attrs"),t[n]}})}function Ul(e){const t=s=>{e.exposed=s||{}};let n;return{get attrs(){return n||(n=Ol(e))},slots:e.slots,emit:e.emit,expose:t}}function ys(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Br(It(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in _n)return _n[n](e)}}))}function Rl(e){return H(e)&&e.displayName||e.name}function Fl(e){return H(e)&&"__vccOpts"in e}const q=(e,t)=>Ui(e,t,yt);function ut(e,t,n){const s=arguments.length;return s===2?fe(t)&&!U(t)?pn(t)?R(e,null,[t]):R(e,t):R(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&pn(n)&&(n=[n]),R(e,t,n))}const Nl="3.2.33",Hl="http://www.w3.org/2000/svg",st=typeof document!="undefined"?document:null,nr=st&&st.createElement("template"),Dl={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t?st.createElementNS(Hl,e):st.createElement(e,n?{is:n}:void 0);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>st.createTextNode(e),createComment:e=>st.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>st.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},cloneNode(e){const t=e.cloneNode(!0);return"_value"in e&&(t._value=e._value),t},insertStaticContent(e,t,n,s,r,o){const i=n?n.previousSibling:t.lastChild;if(r&&(r===o||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===o||!(r=r.nextSibling)););else{nr.innerHTML=s?`${e}`:e;const l=nr.content;if(s){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function Bl(e,t,n){const s=e._vtc;s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}function jl(e,t,n){const s=e.style,r=pe(n);if(n&&!r){for(const o in n)Zn(s,o,n[o]);if(t&&!pe(t))for(const o in t)n[o]==null&&Zn(s,o,"")}else{const o=s.display;r?t!==n&&(s.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(s.display=o)}}const sr=/\s*!important$/;function Zn(e,t,n){if(U(n))n.forEach(s=>Zn(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=ql(e,t);sr.test(n)?e.setProperty($t(s),n.replace(sr,""),"important"):e[s]=n}}const rr=["Webkit","Moz","ms"],Hn={};function ql(e,t){const n=Hn[t];if(n)return n;let s=Ne(t);if(s!=="filter"&&s in e)return Hn[t]=s;s=kn(s);for(let r=0;r{let e=Date.now,t=!1;if(typeof window!="undefined"){Date.now()>document.createEvent("Event").timeStamp&&(e=()=>performance.now());const n=navigator.userAgent.match(/firefox\/(\d+)/i);t=!!(n&&Number(n[1])<=53)}return[e,t]})();let Gn=0;const zl=Promise.resolve(),Xl=()=>{Gn=0},Jl=()=>Gn||(zl.then(Xl),Gn=vo());function Yl(e,t,n,s){e.addEventListener(t,n,s)}function Ql(e,t,n,s){e.removeEventListener(t,n,s)}function Zl(e,t,n,s,r=null){const o=e._vei||(e._vei={}),i=o[t];if(s&&i)i.value=s;else{const[l,c]=Gl(t);if(s){const f=o[t]=ec(s,r);Yl(e,l,f,c)}else i&&(Ql(e,l,i,c),o[t]=void 0)}}const ir=/(?:Once|Passive|Capture)$/;function Gl(e){let t;if(ir.test(e)){t={};let n;for(;n=e.match(ir);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[$t(e.slice(2)),t]}function ec(e,t){const n=s=>{const r=s.timeStamp||vo();(Vl||r>=n.attached-1)&&Oe(tc(s,n.value),t,5,[s])};return n.value=e,n.attached=Jl(),n}function tc(e,t){if(U(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const lr=/^on[a-z]/,nc=(e,t,n,s,r=!1,o,i,l,c)=>{t==="class"?Bl(e,s,r):t==="style"?jl(e,n,s):Vt(t)?ss(t)||Zl(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):sc(e,t,s,r))?Wl(e,t,s,o,i,l,c):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Kl(e,t,s,r))};function sc(e,t,n,s){return s?!!(t==="innerHTML"||t==="textContent"||t in e&&lr.test(t)&&H(n)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||lr.test(t)&&pe(n)?!1:t in e}const rc=ke({patchProp:nc},Dl);let Dn,cr=!1;function oc(){return Dn=cr?Dn:xl(rc),cr=!0,Dn}const ic=(...e)=>{const t=oc().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=lc(s);if(r)return n(r,!0,r instanceof SVGElement)},t};function lc(e){return pe(e)?document.querySelector(e):e}var cc='{"lang":"en-US","title":"VitePress","description":"A VitePress site","base":"/","head":[],"themeConfig":{"locales":{"/":{"label":"\u7B80\u4F53\u4E2D\u6587","nav":[{"text":"\u4E00\u952E\u865A\u62DF\u5316","link":"/","activeMatch":"^/$|^/guide/"},{"text":"Linux\u76F8\u5173","link":"/case/index","activeMatch":"^/case/"},{"text":"\u5F00\u53D1\u624B\u518C","link":"/developer/index","activeMatch":"^/developer/"}],"sidebar":{"/guide/":[{"text":"\u6240\u6709\u9879\u76EE\u7684\u524D\u7F6E\u6761\u4EF6","children":[{"text":"\u51C6\u5907\u5DE5\u4F5C","link":"/guide/dashboard"}]},{"text":"Proxmox VE","children":[{"text":"\u7CFB\u7EDF\u548C\u786C\u4EF6\u914D\u7F6E\u8981\u6C42","link":"/guide/pve_precheck"},{"text":"PVE\u4E3B\u4F53\u5B89\u88C5","link":"/guide/pve_install"},{"text":"KVM\u865A\u62DF\u5316","link":"/guide/pve_kvm"},{"text":"LXC\u865A\u62DF\u5316","link":"/guide/pve_lxc"},{"text":"\u81F4\u8C22","link":"/guide/pve_thanks"},{"text":"\u5E38\u89C1\u95EE\u9898\u7B54\u7591","link":"/guide/pve_qa"}]},{"text":"LXD","children":[{"text":"\u7CFB\u7EDF\u548C\u786C\u4EF6\u914D\u7F6E\u8981\u6C42","link":"/guide/lxd_precheck"},{"text":"LXD\u4E3B\u4F53\u5B89\u88C5","link":"/guide/lxd_install"},{"text":"LXC\u865A\u62DF\u5316","link":"/guide/lxd_lxc"},{"text":"\u5176\u4ED6\u81EA\u5B9A\u4E49\u914D\u7F6E","link":"/guide/lxd_extra_config"},{"text":"\u81F4\u8C22","link":"/guide/lxd_thanks"},{"text":"\u5E38\u89C1\u95EE\u9898\u7B54\u7591","link":"/guide/lxd_qa"}]},{"text":"Docker","children":[{"text":"\u7CFB\u7EDF\u548C\u786C\u4EF6\u914D\u7F6E\u8981\u6C42","link":"/guide/docker_precheck"},{"text":"\u4E3B\u4F53\u5B89\u88C5","link":"/guide/docker_install"},{"text":"Docker\u865A\u62DF\u5316","link":"/guide/docker_build"},{"text":"\u81F4\u8C22","link":"/guide/docker_thanks"},{"text":"\u5E38\u89C1\u95EE\u9898\u7B54\u7591","link":"/guide/docker_qa"}]},{"text":"\u6350\u8D60","children":[{"text":"\u6350\u8D60","link":"/guide/dashboardq"}]}],"/case/":[{"text":"Linux\u76F8\u5173","children":[{"text":"1. \u4E00\u952E\u4FEE\u590D\u4E0E\u5B89\u88C5\u811A\u672C(\u5404\u79CDlinux\u7CFB\u7EDF\u4FEE\u590D\u4E0E\u670D\u52A1\u5668\u73AF\u5883\u5B89\u88C5\u811A\u672C)","link":"/case/case1"},{"text":"2. VPS\u878D\u5408\u602A\u670D\u52A1\u5668\u6D4B\u8BC4\u811A\u672C","link":"/case/case2"},{"text":"3. \u81EA\u52A8\u66F4\u65B0\u6D4B\u8BD5\u670D\u52A1\u5668\u8282\u70B9\u5217\u8868\u7684\u7F51\u7EDC\u57FA\u51C6\u6D4B\u8BD5\u811A\u672C","link":"/case/case3"},{"text":"4. \u7532\u9AA8\u6587\u670D\u52A1\u5668\u4FDD\u6D3B\u811A\u672C","link":"/case/case4"},{"text":"5. convoy\u9762\u677F\u5B89\u88C5\u811A\u672C","link":"/case/case5"}]}],"/developer/":[{"text":"\u5F00\u53D1\u624B\u518C","children":[{"text":"l10n","link":"/developer/l10n"}]}],"/":[{"text":"\u6240\u6709\u9879\u76EE\u7684\u524D\u7F6E\u6761\u4EF6","children":[{"text":"\u51C6\u5907\u5DE5\u4F5C","link":"/guide/dashboard"}]},{"text":"Proxmox VE","children":[{"text":"\u7CFB\u7EDF\u548C\u786C\u4EF6\u914D\u7F6E\u8981\u6C42","link":"/guide/pve_precheck"},{"text":"PVE\u4E3B\u4F53\u5B89\u88C5","link":"/guide/pve_install"},{"text":"KVM\u865A\u62DF\u5316","link":"/guide/pve_kvm"},{"text":"LXC\u865A\u62DF\u5316","link":"/guide/pve_lxc"},{"text":"\u81F4\u8C22","link":"/guide/pve_thanks"},{"text":"\u5E38\u89C1\u95EE\u9898\u7B54\u7591","link":"/guide/pve_qa"}]},{"text":"LXD","children":[{"text":"\u7CFB\u7EDF\u548C\u786C\u4EF6\u914D\u7F6E\u8981\u6C42","link":"/guide/lxd_precheck"},{"text":"LXD\u4E3B\u4F53\u5B89\u88C5","link":"/guide/lxd_install"},{"text":"LXC\u865A\u62DF\u5316","link":"/guide/lxd_lxc"},{"text":"\u5176\u4ED6\u81EA\u5B9A\u4E49\u914D\u7F6E","link":"/guide/lxd_extra_config"},{"text":"\u81F4\u8C22","link":"/guide/lxd_thanks"},{"text":"\u5E38\u89C1\u95EE\u9898\u7B54\u7591","link":"/guide/lxd_qa"}]},{"text":"Docker","children":[{"text":"\u7CFB\u7EDF\u548C\u786C\u4EF6\u914D\u7F6E\u8981\u6C42","link":"/guide/docker_precheck"},{"text":"\u4E3B\u4F53\u5B89\u88C5","link":"/guide/docker_install"},{"text":"Docker\u865A\u62DF\u5316","link":"/guide/docker_build"},{"text":"\u81F4\u8C22","link":"/guide/docker_thanks"},{"text":"\u5E38\u89C1\u95EE\u9898\u7B54\u7591","link":"/guide/docker_qa"}]},{"text":"\u6350\u8D60","children":[{"text":"\u6350\u8D60","link":"/guide/dashboardq"}]}]},"repo":"oneclickvirt/oneclickvirt.github.io","docsDir":"docs","docsBranch":"main","editLinks":true,"editLinkText":"\u5728GitHub\u4E2D\u7F16\u8F91","lastUpdated":"\u4E0A\u6B21\u66F4\u65B0"},"/en_US/":{"label":"English","nav":[{"text":"One Click Virtualization","link":"/en_US/","activeMatch":"^/en_US/guide/"},{"text":"Development Manual","link":"/en_US/developer/index","activeMatch":"^/en_US/developer/"}],"sidebar":{"/en_US/guide/":[{"text":"Pre-requisites for all projects","children":[{"text":"Preparation","link":"/en_US/guide/dashboard"}]},{"text":"Proxmox VE","children":[{"text":"System and hardware configuration requirements","link":"/en_US/guide/pve_precheck"},{"text":"PVE main installation","link":"/en_US/guide/pve_install"},{"text":"KVM Virtualization","link":"/en_US/guide/pve_kvm"},{"text":"LXC Virtualization","link":"/en_US/guide/pve_lxc"},{"text":"Acknowledgements","link":"/en_US/guide/pve_thanks"},{"text":"FAQ","link":"/en_US/guide/pve_qa"}]},{"text":"LXD","children":[{"text":"System and hardware configuration requirements","link":"/en_US/guide/lxd_precheck"},{"text":"LXD main installation","link":"/en_US/guide/lxd_install"},{"text":"LXC Virtualization","link":"/en_US/guide/lxd_lxc"},{"text":"Other custom configuration","link":"/en_US/guide/lxd_extra_config"},{"text":"Acknowledgements","link":"/en_US/guide/lxd_thanks"},{"text":"FAQ","link":"/en_US/guide/lxd_qa"}]},{"text":"Docker","children":[{"text":"System and hardware configuration requirements","link":"/en_US/guide/docker_precheck"},{"text":"Main installation","link":"/en_US/guide/docker_install"},{"text":"Docker Virtualization","link":"/en_US/guide/docker_build"},{"text":"Acknowledgements","link":"/en_US/guide/docker_thanks"},{"text":"FAQ","link":"/en_US/guide/docker_qa"}]},{"text":"Donation","children":[{"text":"Donation","link":"/guide/dashboardq"}]}],"/en_US/developer/":[{"text":"Development Manual","children":[{"text":"l10n","link":"/en_US/developer/l10n"}]}],"/en_US/":[{"text":"Pre-requisites for all projects","children":[{"text":"Preparation","link":"/en_US/guide/dashboard"}]},{"text":"Proxmox VE","children":[{"text":"System and hardware configuration requirements","link":"/en_US/guide/pve_precheck"},{"text":"PVE main installation","link":"/en_US/guide/pve_install"},{"text":"KVM Virtualization","link":"/en_US/guide/pve_kvm"},{"text":"LXC Virtualization","link":"/en_US/guide/pve_lxc"},{"text":"Acknowledgements","link":"/en_US/guide/pve_thanks"},{"text":"FAQ","link":"/en_US/guide/pve_qa"}]},{"text":"LXD","children":[{"text":"System and hardware configuration requirements","link":"/en_US/guide/lxd_precheck"},{"text":"LXD main installation","link":"/en_US/guide/lxd_install"},{"text":"LXC Virtualization","link":"/en_US/guide/lxd_lxc"},{"text":"Other custom configuration","link":"/en_US/guide/lxd_extra_config"},{"text":"Acknowledgements","link":"/en_US/guide/lxd_thanks"},{"text":"FAQ","link":"/en_US/guide/lxd_qa"}]},{"text":"Docker","children":[{"text":"System and hardware configuration requirements","link":"/en_US/guide/docker_precheck"},{"text":"Main installation","link":"/en_US/guide/docker_install"},{"text":"Docker Virtualization","link":"/en_US/guide/docker_build"},{"text":"Acknowledgements","link":"/en_US/guide/docker_thanks"},{"text":"FAQ","link":"/en_US/guide/docker_qa"}]},{"text":"Donation","children":[{"text":"Donation","link":"/guide/dashboardq"}]}]},"repo":"oneclickvirt/oneclickvirt.github.io","docsDir":"docs","docsBranch":"main","editLinks":true,"editLinkText":"Edit this page on GitHub","lastUpdated":"Last Updated"}},"algolia":{"appId":"","apiKey":"","indexName":""}},"locales":{"/":{"lang":"zh-CN","title":"\u4E00\u952E\u865A\u62DF\u5316\u9879\u76EE","description":"\u5F00\u6E90\u3001\u6613\u4E8E\u4F7F\u7528\u7684\u670D\u52A1\u5668\u865A\u62DF\u5316\u9879\u76EE"},"/en_US/":{"lang":"en-US","title":"One Click Virtualization Project","description":"Open source, easy to use server virtualization project"}},"langs":{"/":{"label":"\u7B80\u4F53\u4E2D\u6587","lang":"zh-CN"},"/en_US/":{"label":"English","lang":"en-US"}},"scrollOffset":90}';const xo=/^https?:/i,Me=typeof window!="undefined";function ac(e,t){t.sort((n,s)=>{const r=s.split("/").length-n.split("/").length;return r!==0?r:s.length-n.length});for(const n of t)if(e.startsWith(n))return n}function ar(e,t){const n=ac(t,Object.keys(e));return n?e[n]:void 0}function uc(e){const{locales:t}=e.themeConfig||{},n=e.locales;return t&&n?Object.keys(t).reduce((s,r)=>(s[r]={label:t[r].label,lang:n[r].lang},s),{}):{}}function fc(e,t){t=dc(e,t);const n=ar(e.locales||{},t),s=ar(e.themeConfig.locales||{},t);return Object.assign({},e,n,{themeConfig:Object.assign({},e.themeConfig,s,{locales:{}}),lang:(n||e).lang,locales:{},langs:uc(e)})}function dc(e,t){if(!Me)return t;const n=e.base,s=n.endsWith("/")?n.slice(0,-1):n;return t.slice(s.length)}const bo=Symbol(),Jt=Ti(hc(cc));function hc(e){return JSON.parse(e)}function pc(e){const t=q(()=>fc(Jt.value,e.path));return{site:t,theme:q(()=>t.value.themeConfig),page:q(()=>e.data),frontmatter:q(()=>e.data.frontmatter),lang:q(()=>t.value.lang),localePath:q(()=>{const{langs:n,lang:s}=t.value,r=Object.keys(n).find(o=>n[o].lang===s);return wt(r||"/")}),title:q(()=>e.data.title?e.data.title+" | "+t.value.title:t.value.title),description:q(()=>e.data.description||t.value.description)}}function me(){const e=Rt(bo);if(!e)throw new Error("vitepress data not properly injected in app");return e}function _c(e,t){return`${e}${t}`.replace(/\/+/g,"/")}function wt(e){return xo.test(e)?e:_c(Jt.value.base,e)}function ko(e){let t=e.replace(/\.html$/,"");if(t=decodeURIComponent(t),t.endsWith("/")&&(t+="index"),Me){const n="/";t=t.slice(n.length).replace(/\//g,"_")+".md";const s=__VP_HASH_MAP__[t.toLowerCase()];t=`${n}assets/${t}.${s}.js`}else t=`./${t.slice(1).replace(/\//g,"_")}.md.js`;return t}const yo=Symbol(),ur="http://a.com",wo={relativePath:"",title:"404",description:"Not Found",headers:[],frontmatter:{},lastUpdated:0},gc=()=>({path:"/",component:null,data:wo});function mc(e,t){const n=wn(gc());function s(i=Me?location.href:"/"){const l=new URL(i,ur);return!l.pathname.endsWith("/")&&!l.pathname.endsWith(".html")&&(l.pathname+=".html",i=l.pathname+l.search+l.hash),Me&&(history.replaceState({scrollPosition:window.scrollY},document.title),history.pushState(null,"",i)),o(i)}let r=null;async function o(i,l=0,c=!1){const f=new URL(i,ur),h=r=f.pathname;try{let m=e(h);if("then"in m&&typeof m.then=="function"&&(m=await m),r===h){r=null;const{default:x,__pageData:E}=m;if(!x)throw new Error(`Invalid route component: ${x}`);n.path=h,n.component=It(x),n.data=It(JSON.parse(E)),Me&&Kr(()=>{if(f.hash&&!l){let L=null;try{L=document.querySelector(decodeURIComponent(f.hash))}catch(B){console.warn(B)}if(L){fr(L,f.hash);return}}window.scrollTo(0,l)})}}catch(m){if(m.message.match(/fetch/)||console.error(m),!c)try{const x=await fetch(Jt.value.base+"hashmap.json");window.__VP_HASH_MAP__=await x.json(),await o(i,l,!0);return}catch{}r===h&&(r=null,n.path=h,n.component=t?It(t):null,n.data=wo)}}return Me&&(window.addEventListener("click",i=>{const l=i.target.closest("a");if(l){const{href:c,protocol:f,hostname:h,pathname:m,hash:x,target:E}=l,L=window.location,B=m.match(/\.\w+$/);!i.ctrlKey&&!i.shiftKey&&!i.altKey&&!i.metaKey&&E!=="_blank"&&f===L.protocol&&h===L.hostname&&!(B&&B[0]!==".html")&&(i.preventDefault(),m===L.pathname?x&&x!==L.hash&&(history.pushState(null,"",x),window.dispatchEvent(new Event("hashchange")),fr(l,x,l.classList.contains("header-anchor"))):s(c))}},{capture:!0}),window.addEventListener("popstate",i=>{o(location.href,i.state&&i.state.scrollPosition||0)}),window.addEventListener("hashchange",i=>{i.preventDefault()})),{route:n,go:s}}function vc(){const e=Rt(yo);if(!e)throw new Error("useRouter() is called without provider.");return e}function et(){return vc().route}function fr(e,t,n=!1){let s=null;try{s=e.classList.contains("header-anchor")?e:document.querySelector(decodeURIComponent(t))}catch(r){console.warn(r)}if(s){let r=Jt.value.scrollOffset;typeof r=="string"&&(r=document.querySelector(r).getBoundingClientRect().bottom+24);const o=parseInt(window.getComputedStyle(s).paddingTop,10),i=window.scrollY+s.getBoundingClientRect().top-r+o;!n||Math.abs(i-window.scrollY)>window.innerHeight?window.scrollTo(0,i):window.scrollTo({left:0,top:i,behavior:"smooth"})}}function xc(e,t){let n=[],s=!0;const r=o=>{if(s){s=!1;return}const i=[],l=Math.min(n.length,o.length);for(let c=0;cdocument.head.removeChild(c)),o.slice(l).forEach(c=>{const f=dr(c);document.head.appendChild(f),i.push(f)}),n=i};Zr(()=>{const o=e.data,i=t.value,l=o&&o.title,c=o&&o.description,f=o&&o.frontmatter.head;document.title=(l?l+" | ":"")+i.title,document.querySelector("meta[name=description]").setAttribute("content",c||i.description),r([...f?kc(f):[]])})}function dr([e,t,n]){const s=document.createElement(e);for(const r in t)s.setAttribute(r,t[r]);return n&&(s.innerHTML=n),s}function bc(e){return e[0]==="meta"&&e[1]&&e[1].name==="description"}function kc(e){return e.filter(t=>!bc(t))}const yc=re({name:"VitePressContent",setup(){const e=et();return()=>ut("div",{style:{position:"relative"}},[e.component?ut(e.component):null])}});var ce=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n};const wc=/#.*$/,$c=/(index)?\.(md|html)$/,gn=/\/$/,Cc=/^[a-z]+:/i;function ws(e){return Array.isArray(e)}function $s(e){return Cc.test(e)}function Ec(e,t){if(t===void 0)return!1;const n=hr(`/${e.data.relativePath}`),s=hr(t);return n===s}function hr(e){return decodeURI(e).replace(wc,"").replace($c,"")}function Lc(e,t){const n=e.endsWith("/"),s=t.startsWith("/");return n&&s?e.slice(0,-1)+t:!n&&!s?`${e}/${t}`:e+t}function es(e){return/^\//.test(e)?e:`/${e}`}function $o(e){return e.replace(/(index)?(\.(md|html))?$/,"")||"/"}function Sc(e){return e===!1||e==="auto"||ws(e)}function Tc(e){return e.children!==void 0}function Pc(e){return ws(e)?e.length===0:!e}function Cs(e,t){if(Sc(e))return e;t=es(t);for(const n in e)if(t.startsWith(es(n)))return e[n];return"auto"}function Co(e){return e.reduce((t,n)=>(n.link&&t.push({text:n.text,link:$o(n.link)}),Tc(n)&&(t=[...t,...Co(n.children)]),t),[])}function Eo(e){const t=et(),n=$s(e.value.link);return{props:q(()=>{const r=pr(`/${t.data.relativePath}`);let o=!1;if(e.value.activeMatch)o=new RegExp(e.value.activeMatch).test(r);else{const i=pr(e.value.link);o=i==="/"?i===r:r.startsWith(i)}return{class:{active:o,isExternal:n},href:n?e.value.link:wt(e.value.link),target:e.value.target||(n?"_blank":null),rel:e.value.rel||(n?"noopener noreferrer":null),"aria-label":e.value.ariaLabel}}),isExternal:n}}function pr(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\.(html|md)$/,"").replace(/\/index$/,"/")}const Ac={},Mc={class:"icon outbound",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"},Ic=N("path",{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"},null,-1),Oc=N("polygon",{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"},null,-1),Uc=[Ic,Oc];function Rc(e,t){return T(),F("svg",Mc,Uc)}var Es=ce(Ac,[["render",Rc]]);const Fc={class:"nav-link"},Nc=re({props:{item:null},setup(e){const n=jr(e),{props:s,isExternal:r}=Eo(n.item);return(o,i)=>(T(),F("div",Fc,[N("a",ks({class:"item"},$(s)),[Xt(be(e.item.text)+" ",1),$(r)?(T(),_e(Es,{key:0})):X("",!0)],16)]))}});var mn=ce(Nc,[["__scopeId","data-v-b8818f8c"]]);const Hc={key:0,class:"home-hero"},Dc={key:0,class:"figure"},Bc=["src","alt"],jc={key:1,id:"main-title",class:"title"},qc={key:2,class:"tagline"},Kc=re({setup(e){const{site:t,frontmatter:n}=me(),s=q(()=>{const{heroImage:i,heroText:l,tagline:c,actionLink:f,actionText:h}=n.value;return i||l||c||f&&h}),r=q(()=>n.value.heroText||t.value.title),o=q(()=>n.value.tagline||t.value.description);return(i,l)=>$(s)?(T(),F("header",Hc,[$(n).heroImage?(T(),F("figure",Dc,[N("img",{class:"image",src:$(wt)($(n).heroImage),alt:$(n).heroAlt},null,8,Bc)])):X("",!0),$(r)?(T(),F("h1",jc,be($(r)),1)):X("",!0),$(o)?(T(),F("p",qc,be($(o)),1)):X("",!0),$(n).actionLink&&$(n).actionText?(T(),_e(mn,{key:3,item:{link:$(n).actionLink,text:$(n).actionText},class:"action"},null,8,["item"])):X("",!0),$(n).altActionLink&&$(n).altActionText?(T(),_e(mn,{key:4,item:{link:$(n).altActionLink,text:$(n).altActionText},class:"action alt"},null,8,["item"])):X("",!0)])):X("",!0)}});var Wc=ce(Kc,[["__scopeId","data-v-370f18c0"]]);const Vc={key:0,class:"home-features"},zc={class:"wrapper"},Xc={class:"container"},Jc={class:"features"},Yc={key:0,class:"title"},Qc={key:1,class:"details"},Zc=re({setup(e){const{frontmatter:t}=me(),n=q(()=>t.value.features&&t.value.features.length>0),s=q(()=>t.value.features?t.value.features:[]);return(r,o)=>$(n)?(T(),F("div",Vc,[N("div",zc,[N("div",Xc,[N("div",Jc,[(T(!0),F(de,null,Tn($(s),(i,l)=>(T(),F("section",{key:l,class:"feature"},[i.title?(T(),F("h2",Yc,be(i.title),1)):X("",!0),i.details?(T(),F("p",Qc,be(i.details),1)):X("",!0)]))),128))])])])])):X("",!0)}});var Gc=ce(Zc,[["__scopeId","data-v-e39c13e0"]]);const ea={key:0,class:"footer"},ta={class:"container"},na={class:"text"},sa=re({setup(e){const{frontmatter:t}=me();return(n,s)=>$(t).footer?(T(),F("footer",ea,[N("div",ta,[N("p",na,be($(t).footer),1)])])):X("",!0)}});var ra=ce(sa,[["__scopeId","data-v-30918238"]]);const oa={class:"home","aria-labelledby":"main-title"},ia={class:"home-content"},la=re({setup(e){return(t,n)=>{const s=dn("Content");return T(),F("main",oa,[R(Wc),ae(t.$slots,"hero",{},void 0,!0),R(Gc),N("div",ia,[R(s)]),ae(t.$slots,"features",{},void 0,!0),R(ra),ae(t.$slots,"footer",{},void 0,!0)])}}});var ca=ce(la,[["__scopeId","data-v-10122c92"]]);const aa=["href","aria-label"],ua=["src"],fa=re({setup(e){const{site:t,theme:n,localePath:s}=me();return(r,o)=>(T(),F("a",{class:"nav-bar-title",href:$(s),"aria-label":`${$(t).title}, back to home`},[$(n).logo?(T(),F("img",{key:0,class:"logo",src:$(wt)($(n).logo),alt:"Logo"},null,8,ua)):X("",!0),Xt(" "+be($(t).title),1)],8,aa))}});var da=ce(fa,[["__scopeId","data-v-cc01ef16"]]);function ha(){const{site:e,localePath:t,theme:n}=me();return q(()=>{const s=e.value.langs,r=Object.keys(s);if(r.length<2)return null;const i=et().path.replace(t.value,""),l=r.map(f=>({text:s[f].label,link:`${f}${i}`}));return{text:n.value.selectText||"Languages",items:l}})}const pa=["GitHub","GitLab","Bitbucket"].map(e=>[e,new RegExp(e,"i")]);function _a(){const{site:e}=me();return q(()=>{const t=e.value.themeConfig,n=t.docsRepo||t.repo;if(!n)return null;const s=ga(n);return{text:ma(s,t.repoLabel),link:s}})}function ga(e){return xo.test(e)?e:`https://github.com/${e}`}function ma(e,t){if(t)return t;const n=e.match(/^https?:\/\/[^/]+/);if(!n)return"Source";const s=pa.find(([r,o])=>o.test(n[0]));return s&&s[0]?s[0]:"Source"}const va=e=>(Jr("data-v-bbc27490"),e=e(),Yr(),e),xa={class:"nav-dropdown-link-item"},ba=va(()=>N("span",{class:"arrow"},null,-1)),ka={class:"text"},ya={class:"icon"},wa=re({props:{item:null},setup(e){const n=jr(e),{props:s,isExternal:r}=Eo(n.item);return(o,i)=>(T(),F("div",xa,[N("a",ks({class:"item"},$(s)),[ba,N("span",ka,be(e.item.text),1),N("span",ya,[$(r)?(T(),_e(Es,{key:0})):X("",!0)])],16)]))}});var $a=ce(wa,[["__scopeId","data-v-bbc27490"]]);const Ca=["aria-label"],Ea={class:"button-text"},La={class:"dialog"},Sa=re({props:{item:null},setup(e){const t=et(),n=ot(!1);it(()=>t.path,()=>{n.value=!1});function s(){n.value=!n.value}return(r,o)=>(T(),F("div",{class:at(["nav-dropdown-link",{open:n.value}])},[N("button",{class:"button","aria-label":e.item.ariaLabel,onClick:s},[N("span",Ea,be(e.item.text),1),N("span",{class:at(["button-arrow",n.value?"down":"right"])},null,2)],8,Ca),N("ul",La,[(T(!0),F(de,null,Tn(e.item.items,i=>(T(),F("li",{key:i.text,class:"dialog-item"},[R($a,{item:i},null,8,["item"])]))),128))])],2))}});var _r=ce(Sa,[["__scopeId","data-v-56bf3a3f"]]);const Ta={key:0,class:"nav-links"},Pa={key:1,class:"item"},Aa={key:2,class:"item"},Ma=re({setup(e){const{theme:t}=me(),n=ha(),s=_a(),r=q(()=>t.value.nav||s.value||n.value);return(o,i)=>$(r)?(T(),F("nav",Ta,[$(t).nav?(T(!0),F(de,{key:0},Tn($(t).nav,l=>(T(),F("div",{key:l.text,class:"item"},[l.items?(T(),_e(_r,{key:0,item:l},null,8,["item"])):(T(),_e(mn,{key:1,item:l},null,8,["item"]))]))),128)):X("",!0),$(n)?(T(),F("div",Pa,[R(_r,{item:$(n)},null,8,["item"])])):X("",!0),$(s)?(T(),F("div",Aa,[R(mn,{item:$(s)},null,8,["item"])])):X("",!0)])):X("",!0)}});var Lo=ce(Ma,[["__scopeId","data-v-eab3edfe"]]);const Ia={emits:["toggle"]},Oa=N("svg",{class:"icon",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",viewBox:"0 0 448 512"},[N("path",{fill:"currentColor",d:"M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z",class:""})],-1),Ua=[Oa];function Ra(e,t,n,s,r,o){return T(),F("div",{class:"sidebar-button",onClick:t[0]||(t[0]=i=>e.$emit("toggle"))},Ua)}var Fa=ce(Ia,[["render",Ra]]);const Na=e=>(Jr("data-v-675d8756"),e=e(),Yr(),e),Ha={class:"nav-bar"},Da=Na(()=>N("div",{class:"flex-grow"},null,-1)),Ba={class:"nav"},ja=re({emits:["toggle"],setup(e){return(t,n)=>(T(),F("header",Ha,[R(Fa,{onToggle:n[0]||(n[0]=s=>t.$emit("toggle"))}),R(da),Da,N("div",Ba,[R(Lo)]),ae(t.$slots,"search",{},void 0,!0)]))}});var qa=ce(ja,[["__scopeId","data-v-675d8756"]]);function Ka(){let e=null,t=null;const n=Ja(s,300);function s(){const i=Wa(),l=Va(i);for(let c=0;c ul > li");l&&l!==t.parentElement?(e=l.querySelector("a"),e&&e.classList.add("active")):e=null}function o(i){i&&i.classList.remove("active")}ft(()=>{s(),window.addEventListener("scroll",n)}),to(()=>{r(decodeURIComponent(location.hash))}),Ln(()=>{window.removeEventListener("scroll",n)})}function Wa(){return[].slice.call(document.querySelectorAll(".sidebar a.sidebar-link-item"))}function Va(e){return[].slice.call(document.querySelectorAll(".header-anchor")).filter(t=>e.some(n=>n.hash===t.hash))}function za(){return document.querySelector(".nav-bar").offsetHeight}function gr(e){const t=za();return e.parentElement.offsetTop-t-15}function Xa(e,t,n){const s=window.scrollY;return e===0&&s===0?[!0,null]:s{n&&clearTimeout(n),s?n=setTimeout(e,t):(e(),s=!0,setTimeout(()=>{s=!1},t))}}function Ya(){const e=et(),{site:t}=me();return Ka(),q(()=>{const n=e.data.headers,s=e.data.frontmatter.sidebar,r=e.data.frontmatter.sidebarDepth;if(s===!1)return[];if(s==="auto")return mr(n,r);const o=Cs(t.value.themeConfig.sidebar,e.data.relativePath);return o===!1?[]:o==="auto"?mr(n,r):o})}function mr(e,t){const n=[];if(e===void 0)return[];let s;return e.forEach(({level:r,title:o,slug:i})=>{if(r-1>t)return;const l={text:o,link:`#${i}`};r===2?(s=l,n.push(l)):s&&(s.children||(s.children=[])).push(l)}),n}const So=e=>{const t=et(),{site:n,frontmatter:s}=me(),r=e.depth||1,o=s.value.sidebarDepth||1/0,i=t.data.headers,l=e.item.text,c=Qa(n.value.base,e.item.link),f=e.item.children,h=Ec(t,e.item.link),m=r0?ut("ul",{class:"sidebar-links"},t.map(r=>ut(So,{item:r,depth:s}))):e&&n?To(!1,Za(n),void 0,s):null}function Za(e){return Po(Ga(e))}function Ga(e){e=e.map(n=>Object.assign({},n));let t;return e.forEach(n=>{n.level===2?t=n:t&&(t.children||(t.children=[])).push(n)}),e.filter(n=>n.level===2)}function Po(e){return e.map(t=>({text:t.title,link:`#${t.slug}`,children:t.children?Po(t.children):void 0}))}const eu={key:0,class:"sidebar-links"},tu=re({setup(e){const t=Ya();return(n,s)=>$(t).length>0?(T(),F("ul",eu,[(T(!0),F(de,null,Tn($(t),r=>(T(),_e($(So),{item:r},null,8,["item"]))),256))])):X("",!0)}});const nu=re({props:{open:{type:Boolean}},setup(e){return(t,n)=>(T(),F("aside",{class:at(["sidebar",{open:e.open}])},[R(Lo,{class:"nav"}),ae(t.$slots,"sidebar-top",{},void 0,!0),R(tu),ae(t.$slots,"sidebar-bottom",{},void 0,!0)],2))}});var su=ce(nu,[["__scopeId","data-v-83e92a68"]]);const ru=/bitbucket.org/;function ou(){const{page:e,theme:t,frontmatter:n}=me(),s=q(()=>{const{repo:o,docsDir:i="",docsBranch:l="master",docsRepo:c=o,editLinks:f}=t.value,h=n.value.editLink!=null?n.value.editLink:f,{relativePath:m}=e.value;return!h||!m||!o?null:iu(o,c,i,l,m)}),r=q(()=>t.value.editLinkText||"Edit this page");return{url:s,text:r}}function iu(e,t,n,s,r){return ru.test(e)?cu(e,t,n,s,r):lu(e,t,n,s,r)}function lu(e,t,n,s,r){return($s(t)?t:`https://github.com/${t}`).replace(gn,"")+`/edit/${s}/`+(n?n.replace(gn,"")+"/":"")+r}function cu(e,t,n,s,r){return($s(t)?t:e).replace(gn,"")+`/src/${s}/`+(n?n.replace(gn,"")+"/":"")+r+`?mode=edit&spa=0&at=${s}&fileviewer=file-view-default`}const au={class:"edit-link"},uu=["href"],fu=re({setup(e){const{url:t,text:n}=ou();return(s,r)=>(T(),F("div",au,[$(t)?(T(),F("a",{key:0,class:"link",href:$(t),target:"_blank",rel:"noopener noreferrer"},[Xt(be($(n))+" ",1),R(Es,{class:"icon"})],8,uu)):X("",!0)]))}});var du=ce(fu,[["__scopeId","data-v-1ed99556"]]);const hu={key:0,class:"last-updated"},pu={class:"prefix"},_u={class:"datetime"},gu=re({setup(e){const{theme:t,page:n}=me(),s=q(()=>{const i=t.value.lastUpdated;return i!==void 0&&i!==!1&&n.value.lastUpdated!==0}),r=q(()=>{const i=t.value.lastUpdated;return i===!0?"Last Updated":i}),o=ot("");return ft(()=>{Zr(()=>{o.value=new Date(n.value.lastUpdated).toLocaleString("en-US")})}),(i,l)=>$(s)?(T(),F("p",hu,[N("span",pu,be($(r))+":",1),N("span",_u,be(o.value),1)])):X("",!0)}});var mu=ce(gu,[["__scopeId","data-v-abce3432"]]);const vu={class:"page-footer"},xu={class:"edit"},bu={class:"updated"},ku=re({setup(e){const{page:t}=me();return(n,s)=>(T(),F("footer",vu,[N("div",xu,[R(du)]),N("div",bu,[$(t).lastUpdated?(T(),_e(mu,{key:0})):X("",!0)])]))}});var yu=ce(ku,[["__scopeId","data-v-07c132fc"]]);function wu(){const{page:e,theme:t}=me(),n=q(()=>$o(es(e.value.relativePath))),s=q(()=>{const c=Cs(t.value.sidebar,n.value);return ws(c)?Co(c):[]}),r=q(()=>s.value.findIndex(c=>c.link===n.value)),o=q(()=>{if(t.value.nextLinks!==!1&&r.value>-1&&r.value{if(t.value.prevLinks!==!1&&r.value>0)return s.value[r.value-1]}),l=q(()=>!!o.value||!!i.value);return{next:o,prev:i,hasLinks:l}}const $u={},Cu={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Eu=N("path",{d:"M19,11H7.4l5.3-5.3c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0l-7,7c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.2-0.1,0.5,0,0.8c0.1,0.1,0.1,0.2,0.2,0.3l7,7c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L7.4,13H19c0.6,0,1-0.4,1-1S19.6,11,19,11z"},null,-1),Lu=[Eu];function Su(e,t){return T(),F("svg",Cu,Lu)}var Tu=ce($u,[["render",Su]]);const Pu={},Au={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Mu=N("path",{d:"M19.9,12.4c0.1-0.2,0.1-0.5,0-0.8c-0.1-0.1-0.1-0.2-0.2-0.3l-7-7c-0.4-0.4-1-0.4-1.4,0s-0.4,1,0,1.4l5.3,5.3H5c-0.6,0-1,0.4-1,1s0.4,1,1,1h11.6l-5.3,5.3c-0.4,0.4-0.4,1,0,1.4c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3l7-7C19.8,12.6,19.9,12.5,19.9,12.4z"},null,-1),Iu=[Mu];function Ou(e,t){return T(),F("svg",Au,Iu)}var Uu=ce(Pu,[["render",Ou]]);const Ru={key:0,class:"next-and-prev-link"},Fu={class:"container"},Nu={class:"prev"},Hu=["href"],Du={class:"text"},Bu={class:"next"},ju=["href"],qu={class:"text"},Ku=re({setup(e){const{hasLinks:t,prev:n,next:s}=wu();return(r,o)=>$(t)?(T(),F("div",Ru,[N("div",Fu,[N("div",Nu,[$(n)?(T(),F("a",{key:0,class:"link",href:$(wt)($(n).link)},[R(Tu,{class:"icon icon-prev"}),N("span",Du,be($(n).text),1)],8,Hu)):X("",!0)]),N("div",Bu,[$(s)?(T(),F("a",{key:0,class:"link",href:$(wt)($(s).link)},[N("span",qu,be($(s).text),1),R(Uu,{class:"icon icon-next"})],8,ju)):X("",!0)])])])):X("",!0)}});var Wu=ce(Ku,[["__scopeId","data-v-38ede35f"]]);const Vu={class:"page"},zu={class:"container"},Xu=re({setup(e){return(t,n)=>{const s=dn("Content");return T(),F("main",Vu,[N("div",zu,[ae(t.$slots,"top",{},void 0,!0),R(s,{class:"content"}),R(yu),R(Wu),ae(t.$slots,"bottom",{},void 0,!0)])])}}});var Ju=ce(Xu,[["__scopeId","data-v-7eddb2c4"]]);const Yu={key:0,id:"ads-container"},Qu=re({setup(e){const t=()=>null,n=t,s=t,r=Ji(()=>vr(()=>import("./chunks/AlgoliaSearchBox.381679cc.js"),[])),o=et(),{site:i,page:l,theme:c,frontmatter:f}=me(),h=q(()=>!!f.value.customLayout),m=q(()=>!!f.value.home),x=q(()=>Object.keys(i.value.langs).length>1),E=q(()=>{const M=c.value;return f.value.navbar===!1||M.navbar===!1?!1:i.value.title||M.logo||M.repo||M.nav}),L=ot(!1),B=q(()=>f.value.home||f.value.sidebar===!1?!1:!Pc(Cs(c.value.sidebar,o.data.relativePath))),p=M=>{L.value=typeof M=="boolean"?M:!L.value},b=p.bind(null,!1);it(o,b);const I=q(()=>[{"no-navbar":!E.value,"sidebar-open":L.value,"no-sidebar":!B.value}]);return(M,D)=>{const Y=dn("Content"),Q=dn("Debug");return T(),F(de,null,[N("div",{class:at(["theme",$(I)])},[$(E)?(T(),_e(qa,{key:0,onToggle:p},{search:Be(()=>[ae(M.$slots,"navbar-search",{},()=>[$(c).algolia?(T(),_e($(r),{key:0,options:$(c).algolia,multilang:$(x)},null,8,["options","multilang"])):X("",!0)])]),_:3})):X("",!0),R(su,{open:L.value},{"sidebar-top":Be(()=>[ae(M.$slots,"sidebar-top")]),"sidebar-bottom":Be(()=>[ae(M.$slots,"sidebar-bottom")]),_:3},8,["open"]),N("div",{class:"sidebar-mask",onClick:D[0]||(D[0]=j=>p(!1))}),$(h)?(T(),_e(Y,{key:1})):$(m)?ae(M.$slots,"home",{key:2},()=>[R(ca,null,{hero:Be(()=>[ae(M.$slots,"home-hero")]),features:Be(()=>[ae(M.$slots,"home-features")]),footer:Be(()=>[ae(M.$slots,"home-footer")]),_:3})]):(T(),_e(Ju,{key:3},{top:Be(()=>[ae(M.$slots,"page-top-ads",{},()=>[$(c).carbonAds&&$(c).carbonAds.carbon?(T(),F("div",Yu,[(T(),_e($(n),{key:"carbon"+$(l).relativePath,code:$(c).carbonAds.carbon,placement:$(c).carbonAds.placement},null,8,["code","placement"]))])):X("",!0)]),ae(M.$slots,"page-top")]),bottom:Be(()=>[ae(M.$slots,"page-bottom"),ae(M.$slots,"page-bottom-ads",{},()=>[$(c).carbonAds&&$(c).carbonAds.custom?(T(),_e($(s),{key:"custom"+$(l).relativePath,code:$(c).carbonAds.custom,placement:$(c).carbonAds.placement},null,8,["code","placement"])):X("",!0)])]),_:3}))],2),R(Q)],64)}}}),Zu={class:"theme"},Gu=N("h1",null,"404",-1),ef=["href"],tf=re({setup(e){const{site:t}=me(),n=["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."];function s(){return n[Math.floor(Math.random()*n.length)]}return(r,o)=>(T(),F("div",Zu,[Gu,N("blockquote",null,be(s()),1),N("a",{href:$(t).base,"aria-label":"go to home"},"Take me home.",8,ef)]))}}),Ao={Layout:Qu,NotFound:tf},nf={setup(e){const{Layout:t}=Ao;return ft(()=>{window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(console.log("setting as dark"),document.body.classList.add("dark")),setTimeout(()=>{let n=document.body.classList.contains("dark")?"\u{1F506}":"\u{1F319}",s=document.getElementsByClassName("nav-links");if(s){let r=s[0];r&&r.insertAdjacentHTML("beforeend",`
${n}
`),r=s[1],r&&r.insertAdjacentHTML("beforeend",`
${n}
`)}},100)}),(n,s)=>(T(),_e($(t)))}};var vn=Us(Os({},Ao),{Layout:nf});const Bn=new Set,Mo=()=>document.createElement("link"),sf=e=>{const t=Mo();t.rel="prefetch",t.href=e,document.head.appendChild(t)},rf=e=>{const t=new XMLHttpRequest;t.open("GET",e,t.withCredentials=!0),t.send()};let sn;const of=Me&&(sn=Mo())&&sn.relList&&sn.relList.supports&&sn.relList.supports("prefetch")?sf:rf;function lf(){if(!Me||!window.IntersectionObserver)return;let e;if((e=navigator.connection)&&(e.saveData||/2g/.test(e.effectiveType)))return;const t=window.requestIdleCallback||setTimeout;let n=null;const s=()=>{n&&n.disconnect(),n=new IntersectionObserver(o=>{o.forEach(i=>{if(i.isIntersecting){const l=i.target;n.unobserve(l);const{pathname:c}=l;if(!Bn.has(c)){Bn.add(c);const f=ko(c);of(f)}}})}),t(()=>{document.querySelectorAll("#app a").forEach(o=>{const{target:i,hostname:l,pathname:c}=o,f=c.match(/\.\w+$/);f&&f[0]!==".html"||i!=="_blank"&&l===location.hostname&&(c!==location.pathname?n.observe(o):Bn.add(c))})})};ft(s);const r=et();it(()=>r.path,s),Ln(()=>{n&&n.disconnect()})}const cf=re({setup(e,{slots:t}){const n=ot(!1);return ft(()=>{n.value=!0}),()=>n.value&&t.default?t.default():null}}),af=vn.NotFound||(()=>"404 Not Found"),uf={name:"VitePressApp",setup(){const{site:e}=me();return ft(()=>{it(()=>e.value.lang,t=>{document.documentElement.lang=t},{immediate:!0})}),lf(),()=>ut(vn.Layout)}};function ff(){const e=hf(),t=df();t.provide(yo,e);const n=pc(e.route);return t.provide(bo,n),t.component("Content",yc),t.component("ClientOnly",cf),t.component("Debug",()=>null),Object.defineProperty(t.config.globalProperties,"$frontmatter",{get(){return n.frontmatter.value}}),vn.enhanceApp&&vn.enhanceApp({app:t,router:e,siteData:Jt}),{app:t,router:e,data:n}}function df(){return ic(uf)}function hf(){let e=Me,t;return mc(n=>{let s=ko(n);return e&&(t=s),(e||t===s)&&(s=s.replace(/\.js$/,".lean.js")),Me?(e=!1,vr(()=>import(s),[])):require(s)},af)}if(Me){const{app:e,router:t,data:n}=ff();t.go().then(()=>{xc(t.route,n.site),e.mount("#app")})}export{ce as _,_f as a,N as b,F as c,ff as createApp,Xt as d,re as e,vc as f,ft as g,me as h,gf as i,T as o,et as u,it as w}; diff --git a/docs/.vitepress/dist/assets/case_case1.md.2ed77e73.js b/docs/.vitepress/dist/assets/case_case1.md.2ed77e73.js new file mode 100644 index 0000000000..0b85fb5491 --- /dev/null +++ b/docs/.vitepress/dist/assets/case_case1.md.2ed77e73.js @@ -0,0 +1,46 @@ +import{_ as a,c as n,o as s,a as e}from"./app.8fc4a373.js";const b='{"title":"\u4ED3\u5E93","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u524D\u8A00","slug":"\u524D\u8A00"},{"level":2,"title":"\u76EE\u5F55","slug":"\u76EE\u5F55"},{"level":2,"title":"\u4E00\u952E\u4FEE\u590D\u811A\u672C","slug":"\u4E00\u952E\u4FEE\u590D\u811A\u672C"},{"level":2,"title":"\u4E00\u952E\u73AF\u5883\u5B89\u88C5\u811A\u672C","slug":"\u4E00\u952E\u73AF\u5883\u5B89\u88C5\u811A\u672C"},{"level":2,"title":"\u90E8\u5206\u624B\u52A8\u547D\u4EE4","slug":"\u90E8\u5206\u624B\u52A8\u547D\u4EE4"},{"level":3,"title":"\u4E00\u952E\u5F00\u542Froot\u767B\u9646\u5E76\u66FF\u6362\u5BC6\u7801","slug":"\u4E00\u952E\u5F00\u542Froot\u767B\u9646\u5E76\u66FF\u6362\u5BC6\u7801"},{"level":3,"title":"\u4E00\u952E\u5C4F\u853D\u90AE\u4EF6\u7AEF\u53E3\u907F\u514D\u88AB\u6076\u610F\u7A0B\u5E8F\u4F7F\u7528","slug":"\u4E00\u952E\u5C4F\u853D\u90AE\u4EF6\u7AEF\u53E3\u907F\u514D\u88AB\u6076\u610F\u7A0B\u5E8F\u4F7F\u7528"},{"level":3,"title":"\u8BBE\u7F6E\u8BED\u8A00\u5305","slug":"\u8BBE\u7F6E\u8BED\u8A00\u5305"},{"level":3,"title":"ubuntu\u66F4\u65B0\u6E90\u88AB\u9501","slug":"ubuntu\u66F4\u65B0\u6E90\u88AB\u9501"},{"level":3,"title":"debian\u7F3A\u5931\u516C\u94A5","slug":"debian\u7F3A\u5931\u516C\u94A5"},{"level":3,"title":"ubuntu\u6216debian\u7F3A\u5931\u516C\u94A5","slug":"ubuntu\u6216debian\u7F3A\u5931\u516C\u94A5"},{"level":3,"title":"centos\u6362\u6E90","slug":"centos\u6362\u6E90"},{"level":3,"title":"\u5B89\u88C5gitea","slug":"\u5B89\u88C5gitea"},{"level":3,"title":"\u5378\u8F7Daapanel","slug":"\u5378\u8F7Daapanel"},{"level":3,"title":"\u5B89\u88C5docker\u548Cdocker-compose","slug":"\u5B89\u88C5docker\u548Cdocker-compose"}],"relativePath":"case/case1.md","lastUpdated":1687182420000}',t={},i=e(`

\u4ED3\u5E93

https://github.com/spiritLHLS/one-click-installation-script

\u524D\u8A00

\u6240\u6709\u811A\u672C\u5982\u9700\u5728\u56FD\u5185\u670D\u52A1\u5668\u4F7F\u7528\uFF0C\u8BF7\u5728\u94FE\u63A5\u524D\u52A0\u4E0Ahttps://ghproxy.com/\u786E\u4FDD\u547D\u4EE4\u53EF\u4EE5\u4E0B\u8F7D\u672C\u4ED3\u5E93\u7684shell\u811A\u672C\u6267\u884C

\u76EE\u5F55

\u4E00\u952E\u4FEE\u590D\u811A\u672C

\u8FD0\u884C\u6240\u6709\u4E00\u952E\u4FEE\u590D\u811A\u672C\u524D\u6CE8\u610F\u770B\u8BF4\u660E\uFF0C\u4EE5\u53CA\u4FDD\u8BC1\u670D\u52A1\u5668\u65E0\u91CD\u8981\u6570\u636E\uFF0C\u8FD0\u884C\u540E\u9020\u6210\u7684\u4E00\u5207\u540E\u679C\u4F5C\u8005\u4E0D\u8D1F\u4EFB\u4F55\u8D23\u4EFB\uFF0C\u81EA\u884C\u8BC4\u5224\u98CE\u9669\uFF01

\u4E00\u952E\u5C1D\u8BD5\u4FEE\u590Dapt\u6E90

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/package.sh -o package.sh && chmod +x package.sh && bash package.sh
+

\u4E00\u952E\u5C1D\u8BD5\u4FEE\u590D\u7CFB\u7EDF\u65F6\u95F4

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/modify_time.sh -o modify_time.sh && chmod +x modify_time.sh && bash modify_time.sh
+

\u4E00\u952E\u5C1D\u8BD5\u4FEE\u590Dsudo\u8B66\u544A

\u4E0D\u8981\u5728\u751F\u4EA7\u73AF\u5883\u4E0A\u4F7F\u7528\u8BE5\u811A\u672C\uFF0C\u5426\u5219\u5BB9\u6613\u9020\u6210\u7F51\u7EDChosts\u914D\u7F6E\u9519\u8BEF\uFF0C\u914D\u7F6E\u7684host\u540D\u5B57\u4E0D\u5728\u5916\u7F51IP\u4E0A\u53CD\u800C\u5728\u5185\u7F51IP(127.0.0.1)\u4E0A

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/check_sudo.sh -o check_sudo.sh && chmod +x check_sudo.sh && bash check_sudo.sh
+

\u4E00\u952E\u4FEE\u6539\u7CFB\u7EDF\u81EA\u5E26\u7684journal\u65E5\u5FD7\u8BB0\u5F55\u5927\u5C0F\u91CA\u653E\u7CFB\u7EDF\u76D8\u7A7A\u95F4

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/resize_journal.sh -o resize_journal.sh && chmod +x resize_journal.sh && bash resize_journal.sh
+

\u4E00\u952E\u5C1D\u8BD5\u4FEE\u590D\u7F51\u7EDC

\u8BE5\u811A\u672C\u8F7B\u6613\u52FF\u8981\u4F7F\u7528\uFF0C\u8BF7\u786E\u4FDD\u8FD0\u884C\u65F6\u670D\u52A1\u5668\u65E0\u91CD\u8981\u6587\u4EF6\u6216\u7A0B\u5E8F\uFF0C\u51FA\u73B0\u8FD0\u884Cbug\u540E\u7EED\u53EF\u80FD\u9700\u8981\u91CD\u88C5\u7CFB\u7EDF

\u4E00\u5B9A\u8981\u5728screen\u4E2D\u6267\u884C\u8BE5\u811A\u672C\uFF0C\u5426\u5219\u53EF\u80FD\u5BFC\u81F4\u4FEE\u6539\u8FC7\u7A0B\u4E2Dssh\u65AD\u94FE\u63A5\u800C\u4FEE\u6539\u5931\u8D25\u5361\u4F4F\u6700\u7EC8SSH\u65E0\u6CD5\u8FDE\u63A5\uFF01\u4E0D\u5728screen\u4E2D\u6267\u884C\u540E\u679C\u81EA\u8D1F\uFF01

curl -L https://cdn.spiritlhl.workers.dev/https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/network.sh -o network.sh && chmod +x network.sh && bash network.sh
+

\u5982\u679C\u662F\u7EAFV6\u7684\u4E5F\u53EF\u4EE5\u4E0D\u4F7F\u7528\u4E0A\u9762\u811A\u672C\u7684nat64\uFF0C\u4F7F\u7528warp\u6DFB\u52A0V4\u7F51\u7EDC

\u6BD4\u5982\uFF1Ahttps://github.com/fscarmen/warp

wget -N https://raw.githubusercontent.com/fscarmen/warp/main/menu.sh && bash menu.sh [option] [lisence]
+

\u975E\u7EAFV6\u7684\uFF0C\u5E26V4\u5207\u6362\u4F18\u5148\u7EA7\u5230IPV4\u53EF\u7528\u4EE5\u4E0B\u547D\u4EE4

sudo sed -i 's/.*precedence ::ffff:0:0\\/96.*/precedence ::ffff:0:0\\/96  100/g' /etc/gai.conf && sudo systemctl restart networking
+

\u4E00\u952E\u73AF\u5883\u5B89\u88C5\u811A\u672C

\u53EA\u63A8\u8350\u5728\u65B0\u670D\u52A1\u5668\u4E0A\u5B89\u88C5\uFF0C\u73AF\u5883\u4E0D\u7EAF\u51C0\u4E0D\u4FDD\u8BC1\u4E0D\u51FAbug

\u8FD0\u884C\u6240\u6709\u4E00\u952E\u73AF\u5883\u5B89\u88C5\u811A\u672C\u524D\u6CE8\u610F\u770B\u8BF4\u660E\uFF0C\u4EE5\u53CA\u4FDD\u8BC1\u670D\u52A1\u5668\u65E0\u91CD\u8981\u6570\u636E\uFF0C\u8FD0\u884C\u540E\u9020\u6210\u7684\u4E00\u5207\u540E\u679C\u4F5C\u8005\u4E0D\u8D1F\u4EFB\u4F55\u8D23\u4EFB\uFF0C\u81EA\u884C\u8BC4\u5224\u98CE\u9669\uFF01

\u4E00\u952E\u5B89\u88C5jupyter\u73AF\u5883

\u539F\u59CB\u7528\u9014\u662F\u65B9\u4FBF\u5FEB\u6377\u7684\u5728\u6309\u5C0F\u65F6\u8BA1\u8D39\u7684\u8D85\u5927\u578B\u670D\u52A1\u5668\u4E0A\u90E8\u7F72python\u73AF\u5883\u8FDB\u884C\u79D1\u5B66\u8BA1\u7B97\uFF0C\u5145\u5206\u5229\u7528\u65F6\u95F4\u522B\u6D6A\u8D39\u5728\u6784\u5EFA\u73AF\u5883\u4E0A\u3002

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/jupyter.sh -o jupyter.sh && chmod +x jupyter.sh && bash jupyter.sh
+

\u5B89\u88C5\u540E\u8BB0\u5F97\u5F00\u653E 13692 \u7AEF\u53E3

apt install ufw -y
+ufw allow 13692
+

\u4E00\u952E\u5B89\u88C5R\u8BED\u8A00\u73AF\u5883

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/R.sh -o R.sh && chmod +x R.sh && bash R.sh
+

\u4E00\u952E\u5B89\u88C5rust\u73AF\u5883

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/rust.sh -o rust.sh && chmod +x rust.sh && bash rust.sh 
+

\u4E00\u952E\u5B89\u88C5C\u73AF\u5883

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/cplusplus.sh -o cplusplus.sh && chmod +x cplusplus.sh && bash cplusplus.sh 
+

\u4E00\u952E\u5B89\u88C5vnstat\u73AF\u5883

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/vnstat.sh -o vnstat.sh && chmod +x vnstat.sh && bash vnstat.sh 
+

\u4E00\u952E\u5347\u7EA7\u4F4E\u7248\u672Cdebian\u4E3Adebian11

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/todebian11.sh -o todebian11.sh && chmod +x todebian11.sh && bash todebian11.sh
+

\u4E00\u952E\u5347\u7EA7\u4F4E\u7248\u672Cubuntu\u4E3Aubuntu22

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/toubuntu22.sh -o toubuntu22.sh && chmod +x toubuntu22.sh && bash toubuntu22.sh
+

\u4E00\u952E\u5B89\u88C5zipline\u5E73\u53F0

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/zipline.sh -o zipline.sh && chmod +x zipline.sh && bash zipline.sh
+

\u5982\u679C\u9700\u8981\u5220\u96640\u5B57\u8282\u6587\u4EF6\uFF0C\u6253\u5F00/root/zipline\u6587\u4EF6\u5939\uFF0C\u6267\u884C

docker-compose exec zipline yarn scripts:clear-zero-byte
+

\u6309\u7167\u63D0\u793A\u64CD\u4F5C

\u4E00\u952E\u5B89\u88C5filebrowser\u5E73\u53F0

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/filebrowser.sh -o filebrowser.sh && chmod +x filebrowser.sh && bash filebrowser.sh
+

\u4E00\u952E\u5220\u9664\u5E73\u53F0\u76D1\u63A7

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/dlm.sh -o dlm.sh && chmod +x dlm.shh && bash dlm.sh
+

\u90E8\u5206\u624B\u52A8\u547D\u4EE4

\u4E00\u952E\u5F00\u542Froot\u767B\u9646\u5E76\u66FF\u6362\u5BC6\u7801

bash <(curl -sSL https://raw.githubusercontent.com/fscarmen/tools/main/root.sh) [PASSWORD]
+

\u4E00\u952E\u5C4F\u853D\u90AE\u4EF6\u7AEF\u53E3\u907F\u514D\u88AB\u6076\u610F\u7A0B\u5E8F\u4F7F\u7528

iptables -A INPUT -p tcp --dport 25 -j DROP
+iptables -A OUTPUT -p tcp --dport 25 -j DROP
+/sbin/iptables-save
+

\u8BBE\u7F6E\u8BED\u8A00\u5305

sudo apt-get update
+sudo apt-get install language-pack-en-base
+sudo locale-gen en_US.UTF-8
+

\u4E0B\u8F7DUTF-8\u7684\u73AF\u5883\uFF0C\u751F\u6210UTF-8\u7684\u5305\uFF0C\u7136\u540E\u91CD\u542F\u670D\u52A1\u5668

locale -a
+export LC_ALL=en_US.UTF-8
+

\u67E5\u770B\u5E76\u8BBE\u7F6E\u8BED\u8A00\u5305

language-pack-en-base \u5728debian\u4E2D\u597D\u50CF\u6CA1\u6709\uFF0C\u53EA\u6709Ubuntu\u6709\u597D\u50CF\uFF0C\u4E0D\u77E5\u9053\u662F\u4E0D\u662F\u4E2A\u4F8B\uFF0C\u6709\u95EE\u9898\u518D\u8BF4

ubuntu\u66F4\u65B0\u6E90\u88AB\u9501

sudo rm -rf /var/cache/apt/archives/lock
+sudo pkill apt
+sudo rm /var/lib/dpkg/lock-frontend
+sudo rm /var/lib/apt/lists/lock
+sudo rm /var/cache/apt/archives/lock
+sudo rm /var/lib/dpkg/lock
+sudo dpkg --configure -a
+

\u7136\u540E\u91CD\u542F\u7CFB\u7EDF

debian\u7F3A\u5931\u516C\u94A5

apt-get install debian-keyring debian-archive-keyring -y
+

ubuntu\u6216debian\u7F3A\u5931\u516C\u94A5

\u540E\u7EED\u8FD9\u5757\u6709\u8BA1\u5212\u6574\u7406\u4E3A\u4E00\u4E2A\u4E00\u952E\u811A\u672C

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys \u516C\u94A5
+

centos\u6362\u6E90

sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
+sudo sed -i 's/^mirrorlist=http/mirrorlist=https/' /etc/yum.repos.d/CentOS-Base.repo
+

\u5B89\u88C5gitea

Ubuntu 20\u65E0\u95EE\u9898\uFF0CUbuntu 22\u597D\u50CF\u4E0D\u884C

https://gitlab.com/packaging/gitea

\u5378\u8F7Daapanel

apt install sysv-rc-conf -y && service bt stop && sysv-rc-conf bt off && rm -f /etc/init.d/bt && rm -rf /www/server/panel
+

\u5B89\u88C5docker\u548Cdocker-compose

curl -sSL https://get.docker.com/ | sh
+curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m)" -o /usr/local/bin/docker-compose
+chmod +x /usr/local/bin/docker-compose
+docker-compose --version
+
`,98),o=[i];function l(p,r,c,u,d,h){return s(),n("div",null,o)}var k=a(t,[["render",l]]);export{b as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/case_case1.md.2ed77e73.lean.js b/docs/.vitepress/dist/assets/case_case1.md.2ed77e73.lean.js new file mode 100644 index 0000000000..44ed238deb --- /dev/null +++ b/docs/.vitepress/dist/assets/case_case1.md.2ed77e73.lean.js @@ -0,0 +1 @@ +import{_ as a,c as n,o as s,a as e}from"./app.8fc4a373.js";const b='{"title":"\u4ED3\u5E93","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u524D\u8A00","slug":"\u524D\u8A00"},{"level":2,"title":"\u76EE\u5F55","slug":"\u76EE\u5F55"},{"level":2,"title":"\u4E00\u952E\u4FEE\u590D\u811A\u672C","slug":"\u4E00\u952E\u4FEE\u590D\u811A\u672C"},{"level":2,"title":"\u4E00\u952E\u73AF\u5883\u5B89\u88C5\u811A\u672C","slug":"\u4E00\u952E\u73AF\u5883\u5B89\u88C5\u811A\u672C"},{"level":2,"title":"\u90E8\u5206\u624B\u52A8\u547D\u4EE4","slug":"\u90E8\u5206\u624B\u52A8\u547D\u4EE4"},{"level":3,"title":"\u4E00\u952E\u5F00\u542Froot\u767B\u9646\u5E76\u66FF\u6362\u5BC6\u7801","slug":"\u4E00\u952E\u5F00\u542Froot\u767B\u9646\u5E76\u66FF\u6362\u5BC6\u7801"},{"level":3,"title":"\u4E00\u952E\u5C4F\u853D\u90AE\u4EF6\u7AEF\u53E3\u907F\u514D\u88AB\u6076\u610F\u7A0B\u5E8F\u4F7F\u7528","slug":"\u4E00\u952E\u5C4F\u853D\u90AE\u4EF6\u7AEF\u53E3\u907F\u514D\u88AB\u6076\u610F\u7A0B\u5E8F\u4F7F\u7528"},{"level":3,"title":"\u8BBE\u7F6E\u8BED\u8A00\u5305","slug":"\u8BBE\u7F6E\u8BED\u8A00\u5305"},{"level":3,"title":"ubuntu\u66F4\u65B0\u6E90\u88AB\u9501","slug":"ubuntu\u66F4\u65B0\u6E90\u88AB\u9501"},{"level":3,"title":"debian\u7F3A\u5931\u516C\u94A5","slug":"debian\u7F3A\u5931\u516C\u94A5"},{"level":3,"title":"ubuntu\u6216debian\u7F3A\u5931\u516C\u94A5","slug":"ubuntu\u6216debian\u7F3A\u5931\u516C\u94A5"},{"level":3,"title":"centos\u6362\u6E90","slug":"centos\u6362\u6E90"},{"level":3,"title":"\u5B89\u88C5gitea","slug":"\u5B89\u88C5gitea"},{"level":3,"title":"\u5378\u8F7Daapanel","slug":"\u5378\u8F7Daapanel"},{"level":3,"title":"\u5B89\u88C5docker\u548Cdocker-compose","slug":"\u5B89\u88C5docker\u548Cdocker-compose"}],"relativePath":"case/case1.md","lastUpdated":1687182420000}',t={},i=e("",98),o=[i];function l(p,r,c,u,d,h){return s(),n("div",null,o)}var k=a(t,[["render",l]]);export{b as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/case_case2.md.d656eaf0.js b/docs/.vitepress/dist/assets/case_case2.md.d656eaf0.js new file mode 100644 index 0000000000..4074218e5e --- /dev/null +++ b/docs/.vitepress/dist/assets/case_case2.md.d656eaf0.js @@ -0,0 +1,10 @@ +import{_ as e,c as a,o as s,a as n}from"./app.8fc4a373.js";const b='{"title":"\u4ED3\u5E93","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u524D\u8A00","slug":"\u524D\u8A00"},{"level":2,"title":"\u878D\u5408\u602A\u6D4B\u8BC4\u811A\u672C","slug":"\u878D\u5408\u602A\u6D4B\u8BC4\u811A\u672C"},{"level":3,"title":"\u4EA4\u4E92\u5F62\u5F0F","slug":"\u4EA4\u4E92\u5F62\u5F0F"},{"level":3,"title":"\u65E0\u4EA4\u4E92\u5F62\u5F0F","slug":"\u65E0\u4EA4\u4E92\u5F62\u5F0F"},{"level":3,"title":"\u8BF4\u660E","slug":"\u8BF4\u660E"},{"level":3,"title":"\u7EAF\u6D4BIP\u8D28\u91CF","slug":"\u7EAF\u6D4Bip\u8D28\u91CF"},{"level":3,"title":"\u529F\u80FD","slug":"\u529F\u80FD"},{"level":3,"title":"\u811A\u672C\u6982\u51B5","slug":"\u811A\u672C\u6982\u51B5"},{"level":2,"title":"\u81F4\u8C22","slug":"\u81F4\u8C22"}],"relativePath":"case/case2.md","lastUpdated":1687182420000}',t={},r=n(`

\u4ED3\u5E93

https://github.com/spiritLHLS/ecs

\u524D\u8A00

\u652F\u6301\u7CFB\u7EDF\uFF1A

Ubuntu 18+, Debian 8+, centos 7+, Fedora 22+, Almalinux 8.5+, OracleLinux 8+, RockyLinux 8+, AstraLinux CE, Arch, FreeBSD(\u524D\u63D0\u5DF2\u6267\u884Cpkg install -y curl bash)

\u76EE\u5F55

\u878D\u5408\u602A\u6D4B\u8BC4\u811A\u672C

\u4EA4\u4E92\u5F62\u5F0F

curl -L https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh
+

\u6216

curl -L https://github.com/spiritLHLS/ecs/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh
+

\u6216

bash <(wget -qO- bash.spiritlhl.net/ecs)
+

\u65E0\u4EA4\u4E92\u5F62\u5F0F

echo 1 | bash <(wget -qO- --no-check-certificate https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh)
+

\u6216

echo 1 | bash <(wget -qO- --no-check-certificate https://github.com/spiritLHLS/ecs/raw/main/ecs.sh)
+

\u6216

echo 1 | bash <(wget -qO- bash.spiritlhl.net/ecs)
+

\u8BF4\u660E

\u878D\u5408\u602A\u7684\u6267\u884C\u7ED3\u679C\u4FDD\u5B58\u5728\u5F53\u524D\u8DEF\u5F84\u4E0B\u7684test_result.txt\u4E2D\uFF0C\u8FD0\u884C\u5B8C\u6BD5\u53EF\u7528cat test_result.txt\u67E5\u770B\u8BB0\u5F55

\u878D\u5408\u602A\u7684\u5B8C\u6574\u7248\u548C\u7CBE\u7B80\u7248\u8FD0\u884C\u5B8C\u6BD5\u81EA\u52A8\u4E0A\u4F20\u7ED3\u679C\u5230pastebin\u5E76\u56DE\u4F20\u5206\u4EAB\u94FE\u63A5

\u6709\u65F6\u5019\u60F3\u8981\u6D4B\u4E00\u4E9B\u914D\u7F6E\u6781\u5176\u62C9\u8DE8\u7684\u673A\u5668\u65F6\uFF0C\u63A8\u8350\u4F7F\u7528screen\u547D\u4EE4\u6302\u8D77\u6267\u884C\u9009\u98791\u7684\u878D\u5408\u602A\uFF0C\u7136\u540E\u4F60\u53EF\u4EE5\u5173\u95EDSSH\u8FDE\u63A5\uFF0C\u7B49\u5F85\u4E00\u6BB5\u65F6\u95F4\u540E\u4F7F\u7528cat test_result.txt\u67E5\u770B\u8FD0\u884C\u7684\u5B9E\u65F6\u72B6\u51B5\uFF0C\u8FD9\u6837\u53EF\u4EE5\u907F\u514DIO\u6216\u8005CPU\u8FC7\u4E8E\u5783\u573E\u5BFC\u81F4\u7684\u6D4B\u8BD5\u8FC7\u7A0B\u4E2D\u7684SSH\u8FDE\u63A5\u4E2D\u65AD\uFF0C\u5C31\u4E0D\u4F1A\u6D4B\u4E00\u534A\u5565\u90FD\u6CA1\u4E86

\u6700\u70C2\u673A\u5668\u6D4B\u8BD5\u7684\u4F8B\u5B50(\u8DD1\u4E8647\u5206\u949F\u4E00\u6837\u6D4B\u5B8C)\uFF1A\u8DF3\u8F6C

\u4F7F\u7528CDN\u52A0\u901F\u5DF2\u652F\u6301\u56FD\u5185\u548C\u56FD\u5916\u670D\u52A1\u5668\u6D4B\u8BD5\uFF0C\u4F46\u56FD\u5185\u53D7CDN\u8FDE\u901A\u6027\u6216\u56FD\u5185\u673A\u5668\u5E26\u5BBD\u5927\u5C0F\u7684\u9650\u5236\u52A0\u8F7D\u4F1A\u6162\u5F88\u591A

\u878D\u5408\u602A\u6D4B\u8BD5\u8BF4\u660E\u4EE5\u53CA\u90E8\u5206\u6D4B\u8BD5\u7ED3\u679C\u7684\u5185\u5BB9\u89E3\u91CA(\u521D\u6B21\u4F7F\u7528\u63A8\u8350\u67E5\u770B)\uFF1A

\u9664\u4E86\u5DF2\u6807\u6CE8\u7684\u539F\u521B\u5185\u5BB9\uFF0C\u5176\u4F59\u6240\u6709\u5206\u533A\u5747\u4E3A\u501F\u9274\u5E76\u8FDB\u884C\u4F18\u5316\u4FEE\u6539\u540E\u7684\u7248\u672C\uFF0C\u4E0E\u539F\u59CB\u5BF9\u5E94\u7684\u811A\u672C\u4E0D\u4E00\u6837

\u7CFB\u7EDF\u57FA\u7840\u4FE1\u606F\u6D4B\u8BD5\u878D\u5408\u4E86\u4E09\u5BB6\u8FD8\u6709\u6211\u81EA\u5DF1\u4FEE\u8865\u7684\u90E8\u5206\u68C0\u6D4B(systl\u3001virt\u3001NAT\u7C7B\u578B\u68C0\u6D4B\u7B49)\uFF0C\u5E94\u8BE5\u662F\u76EE\u524D\u6700\u5168\u9762\u7684\u4E86

CPU\u6D4B\u8BD5\u4F7F\u7528sysbench\u6D4B\u8BD5\u5F97\u5206\uFF0C\u4E0D\u662Fyabs\u7684gb4\u6216gb5\uFF0C\u524D\u8005\u53EA\u662F\u7B80\u5355\u7684\u8BA1\u7B97\u8D28\u6570\u6D4B\u8BD5\u901F\u5EA6\u5FEB\uFF0C\u540E\u8005geekbench\u662F\u7EFC\u5408\u6D4B\u8BD5\u7CFB\u7EDF\u7B97\u52A0\u6743\u5F97\u5206\uFF0C\u4E0D\u662F\u540C\u4E00\u79CD\u4E1C\u897F\uFF0C\u522B\u4E92\u76F8\u6BD4\u8F83\u4E86\uFF0C\u6CA1\u6709\u4EFB\u4F55\u7528\u5904

CPU\u6D4B\u8BD5\u5355\u6838\u5F97\u5206\u57285000\u4EE5\u4E0A\u7684\u53EF\u4EE5\u7B97\u7B2C\u4E00\u68AF\u961F\uFF0C4000\u52305000\u5206\u7B97\u7B2C\u4E8C\u68AF\u961F\uFF0C\u6BCF1000\u5206\u7B97\u4E00\u6863\uFF0C\u81EA\u5DF1\u770B\u770B\u81EA\u5DF1\u5728\u54EA\u4E2A\u6863\u4F4D\u5427

AMD 7950x\u5355\u6838\u6EE1\u8840\u6027\u80FD\u5F97\u5206\u57286500\u5DE6\u53F3\uFF0CAMD 5950x\u5355\u6838\u6EE1\u8840\u6027\u80FD\u5F97\u52065700\u5DE6\u53F3\uFF0CIntel\u666E\u901A\u7684CPU(E5\u4E4B\u7C7B\u7684)\u57281000~800\u5DE6\u53F3\uFF0C\u4F4E\u4E8E500\u7684\u5355\u6838CPU\u53EF\u4EE5\u7B97\u662F\u6BD4\u8F83\u70C2\u7684\u4E86

IO\u6D4B\u8BD5\u6536\u5F55\u4E86\u4E24\u79CD\uFF0C\u6765\u6E90\u4E8Elemonbench\u7684dd\u78C1\u76D8\u6D4B\u8BD5\u548Cyabs\u7684fio\u78C1\u76D8\u6D4B\u8BD5\uFF0C\u7EFC\u5408\u6765\u770B\u4F1A\u6BD4\u8F83\u597D\uFF0C\u524D\u8005\u53EF\u80FD\u8BEF\u5DEE\u504F\u5927\u4F46\u6D4B\u8BD5\u901F\u5EA6\u5FEB\u65E0\u786C\u76D8\u5927\u5C0F\u9650\u5236\uFF0C\u540E\u8005\u771F\u5B9E\u4E00\u70B9\u4F46\u6D4B\u8BD5\u901F\u5EA6\u6162\u6709\u786C\u76D8\u4EE5\u53CA\u5185\u5B58\u5927\u5C0F\u9650\u5236

\u6D41\u5A92\u4F53\u6D4B\u8BD5\u6536\u5F55\u4E86\u4E24\u79CD\uFF0C\u4E00\u4E2A\u662Fgo\u7F16\u8BD1\u7684\u4E8C\u8FDB\u5236\u6587\u4EF6\u548C\u4E00\u4E2Ashell\u811A\u672C\u7248\u672C\uFF0C\u4E8C\u8005\u5404\u6709\u4F18\u52A3\uFF0C\u4E92\u76F8\u5BF9\u6BD4\u770B\u5373\u53EF

tiktok\u6D4B\u8BD5\u6709superbench\u548Clmc999\u4E24\u79CD\u7248\u672C\uFF0C\u54EA\u4E2A\u5931\u6548\u4E86\u968F\u65F6\u53EF\u80FD\u66F4\u65B0\u4E3A\u5176\u4E2D\u4E00\u79CD\u7248\u672C\uFF0C\u4EE5\u6700\u65B0\u7684\u811A\u672C\u4E3A\u51C6

\u56DE\u7A0B\u8DEF\u7531\u6D4B\u8BD5\u9009\u7528\u7684GO\u7F16\u8BD1\u7684\u4E8C\u8FDB\u5236\u7248\u672C\u548C\u670B\u53CBPR\u7684\u7248\u672C\uFF0C\u672C\u4EBA\u505A\u4E86\u4F18\u5316\u9002\u914D\u591A\u4E2AIP\u5217\u8868\u4EE5\u53CA\u878D\u5408\u90E8\u5206\u67E5\u8BE2

IP\u8D28\u91CF\u68C0\u6D4B\u7EAF\u539F\u521B\uFF0C\u5982\u6709bug\u6216\u8005\u66F4\u591A\u6570\u636E\u5E93\u6765\u6E90\u53EF\u5728issues\u4E2D\u63D0\u51FA\uFF0C\u65E5\u5E38\u770BIP2Location\u6570\u636E\u5E93\u7684IP\u7C7B\u578B\u5373\u53EF

\u878D\u5408\u602A\u7684IP\u8D28\u91CF\u68C0\u6D4B\u662F\u7B80\u5316\u8FC7\u7684\uFF0C\u6CA1\u6709\u67E5\u8BE2Cloudflare\u7684\u5A01\u80C1\u5F97\u5206\uFF0C\u4E2A\u4EBA\u539F\u521B\u533A\u7684IP\u8D28\u91CF\u68C0\u6D4B\u624D\u662F\u5B8C\u6574\u7248(\u6216\u8005\u4ED3\u5E93\u8BF4\u660E\u4E2D\u5217\u51FA\u7684\u90A3\u4E2AIP\u8D28\u91CF\u68C0\u6D4B\u7684\u547D\u4EE4\u4E5F\u662F\u5B8C\u6574\u7248)

\u4E09\u7F51\u6D4B\u901F\u4F7F\u7528\u81EA\u5199\u7684\u6D4B\u901F\u811A\u672C\uFF0C\u5C3D\u91CF\u4F7F\u7528\u6700\u65B0\u8282\u70B9\u6700\u65B0\u7EC4\u4EF6\u8FDB\u884C\u6D4B\u901F\uFF0C\u4E14\u6709\u5907\u7528go\u7248\u672C\u6D4B\u901F\uFF0C\u505A\u5230\u81EA\u66F4\u65B0\u6D4B\u901F\u8282\u70B9\u5217\u8868\uFF0C\u81EA\u9002\u5E94\u7CFB\u7EDF\u73AF\u5883\u6D4B\u901F

\u5176\u4ED6\u7B2C\u4E09\u65B9\u811A\u672C\u5F52\u7EB3\u5230\u4E86\u7B2C\u4E09\u65B9\u811A\u672C\u533A\uFF0C\u91CC\u9762\u6709\u540C\u7C7B\u578B\u811A\u672C\u4E0D\u540C\u4F5C\u8005\u7684\u5404\u79CD\u7ADE\u54C1\u811A\u672C\uFF0C\u5982\u679C\u878D\u5408\u602A\u4E0D\u80FD\u4F7F\u4F60\u6EE1\u610F\u6216\u8005\u6709\u9519\u8BEF\uFF0C\u53EF\u4EE5\u770B\u770B\u90A3\u90E8\u5206

\u539F\u521B\u811A\u672C\u533A\u662F\u4E2A\u4EBA\u539F\u521B\u7684\u90E8\u5206\uFF0C\u6709\u4E8B\u6CA1\u4E8B\u4E5F\u53EF\u4EE5\u770B\u770B\uFF0C\u53EF\u80FD\u4F1A\u66F4\u65B0\u67D0\u4E9B\u504F\u95E8\u6216\u8005\u72EC\u5230\u7684\u811A\u672C

VPS\u6D4B\u8BD5\uFF0CVPS\u6D4B\u901F\uFF0CVPS\u7EFC\u5408\u6027\u80FD\u6D4B\u8BD5\uFF0CVPS\u56DE\u7A0B\u7EBF\u8DEF\u6D4B\u8BD5\uFF0CVPS\u6D41\u5A92\u4F53\u6D4B\u8BD5\u7B49\u6240\u6709\u6D4B\u8BD5\u878D\u5408\u7684\u811A\u672C\uFF0C\u672C\u811A\u672C\u80FD\u878D\u5408\u7684\u90FD\u878D\u5408\u4E86

\u7EAF\u6D4BIP\u8D28\u91CF

bash <(wget -qO- --no-check-certificate https://gitlab.com/spiritysdx/za/-/raw/main/qzcheck.sh)
+

\u6216

bash <(wget -qO- bash.spiritlhl.net/ecs-ipcheck)
+

\u6216

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/ecs/main/qzcheck.sh)
+

\u529F\u80FD

\u811A\u672C\u6982\u51B5

\u4E3B\u754C\u9762\uFF1A

\u9009\u98791\u878D\u5408\u602A\u5B8C\u5168\u4F53\uFF1A

\u9009\u98796\u539F\u521B\u533A\uFF1A

\u81F4\u8C22

\u611F\u8C22 ipinfo.io ip.sb ipip.net cip.cc cheervision.co \u7B49\u7F51\u7AD9\u63D0\u4F9B\u7684\u68C0\u6D4BAPI

\u611F\u8C22\u6240\u6709\u5F00\u6E90\u9879\u76EE\u63D0\u4F9B\u7684\u539F\u59CB\u6D4B\u8BD5\u811A\u672C

\u540C\u65F6\u611F\u8C22\u4EE5\u4E0B\u5E73\u53F0\u63D0\u4F9B\u7F16\u8F91\u548C\u6D4B\u8BD5\u652F\u6301

`,63),p=[r];function c(i,o,l,h,d,u){return s(),a("div",null,p)}var f=e(t,[["render",c]]);export{b as __pageData,f as default}; diff --git a/docs/.vitepress/dist/assets/case_case2.md.d656eaf0.lean.js b/docs/.vitepress/dist/assets/case_case2.md.d656eaf0.lean.js new file mode 100644 index 0000000000..8125ed2cb0 --- /dev/null +++ b/docs/.vitepress/dist/assets/case_case2.md.d656eaf0.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as s,a as n}from"./app.8fc4a373.js";const b='{"title":"\u4ED3\u5E93","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u524D\u8A00","slug":"\u524D\u8A00"},{"level":2,"title":"\u878D\u5408\u602A\u6D4B\u8BC4\u811A\u672C","slug":"\u878D\u5408\u602A\u6D4B\u8BC4\u811A\u672C"},{"level":3,"title":"\u4EA4\u4E92\u5F62\u5F0F","slug":"\u4EA4\u4E92\u5F62\u5F0F"},{"level":3,"title":"\u65E0\u4EA4\u4E92\u5F62\u5F0F","slug":"\u65E0\u4EA4\u4E92\u5F62\u5F0F"},{"level":3,"title":"\u8BF4\u660E","slug":"\u8BF4\u660E"},{"level":3,"title":"\u7EAF\u6D4BIP\u8D28\u91CF","slug":"\u7EAF\u6D4Bip\u8D28\u91CF"},{"level":3,"title":"\u529F\u80FD","slug":"\u529F\u80FD"},{"level":3,"title":"\u811A\u672C\u6982\u51B5","slug":"\u811A\u672C\u6982\u51B5"},{"level":2,"title":"\u81F4\u8C22","slug":"\u81F4\u8C22"}],"relativePath":"case/case2.md","lastUpdated":1687182420000}',t={},r=n("",63),p=[r];function c(i,o,l,h,d,u){return s(),a("div",null,p)}var f=e(t,[["render",c]]);export{b as __pageData,f as default}; diff --git a/docs/.vitepress/dist/assets/case_case3.md.d4e43a36.js b/docs/.vitepress/dist/assets/case_case3.md.d4e43a36.js new file mode 100644 index 0000000000..a329cdb1fb --- /dev/null +++ b/docs/.vitepress/dist/assets/case_case3.md.d4e43a36.js @@ -0,0 +1,10 @@ +import{_ as e,c as t,o as s,a as r}from"./app.8fc4a373.js";const u='{"title":"\u4ED3\u5E93","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u8BF4\u660E","slug":"\u8BF4\u660E"},{"level":3,"title":"\u5BF9\u5E94 speedtest.net \u7684\u81EA\u52A8\u66F4\u65B0\u6D4B\u901F\u670D\u52A1\u5668ID\u7684\u6D4B\u901F\u811A\u672C","slug":"\u5BF9\u5E94-speedtest-net-\u7684\u81EA\u52A8\u66F4\u65B0\u6D4B\u901F\u670D\u52A1\u5668id\u7684\u6D4B\u901F\u811A\u672C"},{"level":3,"title":"\u5BF9\u5E94 speedtest.cn \u7684\u81EA\u52A8\u66F4\u65B0\u6D4B\u901F\u670D\u52A1\u5668ID\u7684\u6D4B\u901F\u811A\u672C","slug":"\u5BF9\u5E94-speedtest-cn-\u7684\u81EA\u52A8\u66F4\u65B0\u6D4B\u901F\u670D\u52A1\u5668id\u7684\u6D4B\u901F\u811A\u672C"},{"level":3,"title":"\u81EA\u52A8\u66F4\u65B0\u6D4B\u8BD5\u670D\u52A1\u5668\u5217\u8868\u7684\u4E09\u7F51\u5EF6\u8FDF\u6D4B\u8BD5\u811A\u672C","slug":"\u81EA\u52A8\u66F4\u65B0\u6D4B\u8BD5\u670D\u52A1\u5668\u5217\u8868\u7684\u4E09\u7F51\u5EF6\u8FDF\u6D4B\u8BD5\u811A\u672C"},{"level":2,"title":"\u529F\u80FD","slug":"\u529F\u80FD"},{"level":2,"title":".cn\u6570\u636E","slug":"cn\u6570\u636E"},{"level":2,"title":".net\u6570\u636E","slug":"net\u6570\u636E"},{"level":3,"title":"\u4EA4\u6D41","slug":"\u4EA4\u6D41"},{"level":3,"title":"\u81F4\u8C22","slug":"\u81F4\u8C22"}],"relativePath":"case/case3.md","lastUpdated":1687182420000}',a={},p=r(`

\u4ED3\u5E93

https://github.com/spiritLHLS/ecsspeed

ecsspeed

\u81EA\u52A8\u66F4\u65B0\u6D4B\u901F\u670D\u52A1\u5668\u8282\u70B9\u5217\u8868\u7684\u7F51\u7EDC\u57FA\u51C6\u6D4B\u8BD5\u811A\u672C

Network benchmarking script that automatically updates the list of speed measurement server nodes

\u8BF4\u660E

\u6240\u6709\u7EC4\u4EF6\u4EE5\u53CA\u6570\u636E\u5747\u6765\u6E90\u4E8E\u5E73\u53F0\u6216\u5DF2\u6709\u7684\u5F00\u6E90\u9879\u76EE\uFF0C\u65E0\u975E\u5F00\u6E90\u90E8\u5206\uFF0C\u653E\u5FC3\u98DF\u7528

\u5BF9\u5E94 speedtest.net \u7684\u81EA\u52A8\u66F4\u65B0\u6D4B\u901F\u670D\u52A1\u5668ID\u7684\u6D4B\u901F\u811A\u672C

\u65E5\u5E38\u63A8\u8350\u4F7F\u7528

bash <(wget -qO- bash.spiritlhl.net/ecs-net)
+

\u6216

bash <(wget -qO- --no-check-certificate https://github.com/spiritLHLS/ecsspeed/raw/main/script/ecsspeed-net.sh)
+

\u6216\u56FD\u5185\u7528

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/ecsspeed/main/script/ecsspeed-net.sh)
+

\u652F\u6301\u6D4B\u901F\u7684\u67B6\u6784\uFF1Ai386, x86_64, amd64, arm64, s390x, riscv64, ppc64le, ppc64

\u6DB5\u76D6\u4E2D\u56FD\u4E09\u5927\u8FD0\u8425\u5546\u3001\u9999\u6E2F\u3001\u53F0\u6E7E\u7684\u6D4B\u901F\u8282\u70B9\uFF0C\u9ED8\u8BA4\u7684\u4E09\u7F51\u6D4B\u901F\u6BCF\u4E2A\u8FD0\u8425\u5546\u9009\u62E9\u672C\u673Aping\u503C\u6700\u4F4E\u7684\u4E24\u4E2A\u8282\u70B9\u6D4B\u901F\uFF0C\u8BE6\u60C5\u4E09\u7F51\u6D4B\u901F\u624D\u662F\u5168\u6D4B\uFF0C\u8282\u70B9\u5217\u8868\u5927\u6982\u6BCF7\u5929\u81EA\u52A8\u66F4\u65B0\u4E00\u6B21\u3002

\u652F\u6301\u56FD\u5185\u670D\u52A1\u5668\u6D4B\u8BD5(\u6709\u5224\u65AD\u662F\u5426\u4E3A\u56FD\u5185\u673A\u5668)\uFF0C\u4F46\u7531\u4E8E\u56FD\u5185\u670D\u52A1\u5668\u5E26\u5BBD\u8FC7\u5C0F\uFF0C\u4F1A\u5F88\u6162\uFF0C\u8BE6\u89C1\u521D\u6B21\u8FD0\u884C\u7684\u663E\u793A

\u5F53\u5B98\u65B9CLI\u5B89\u88C5\u5931\u8D25(\u5982\u7F55\u89C1\u7684\u67B6\u6784\u6216\u8005\u5B98\u65B9\u7F51\u7AD9\u8BBF\u95EE\u5931\u8D25\u65F6)\u81EA\u52A8\u4F7F\u7528 speedtest-go \u4F5C\u4E3A\u66FF\u4EE3\u54C1\u6D4B\u901F

\u5BF9\u5E94 speedtest.cn \u7684\u81EA\u52A8\u66F4\u65B0\u6D4B\u901F\u670D\u52A1\u5668ID\u7684\u6D4B\u901F\u811A\u672C

\u5355\u7EBF\u7A0B\u6D4B\u901F

bash <(wget -qO- bash.spiritlhl.net/ecs-cn)
+

\u6216

bash <(wget -qO- --no-check-certificate https://github.com/spiritLHLS/ecsspeed/raw/main/script/ecsspeed-cn.sh)
+

\u6216\u56FD\u5185\u7528

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/ecsspeed/main/script/ecsspeed-cn.sh)
+

\u652F\u6301\u6D4B\u901F\u7684\u67B6\u6784\uFF1Ai386, x86_64, amd64, arm64, s390x, riscv64, ppc64le, ppc64

\u6DB5\u76D6\u4E2D\u56FD\u4E09\u5927\u8FD0\u8425\u5546\u3001\u9999\u6E2F\u3001\u53F0\u6E7E\u7684\u6D4B\u901F\u8282\u70B9\uFF0C\u9ED8\u8BA4\u7684\u4E09\u7F51\u6D4B\u901F\u6BCF\u4E2A\u8FD0\u8425\u5546\u9009\u62E9\u672C\u673Aping\u503C\u6700\u4F4E\u7684\u4E24\u4E2A\u8282\u70B9\u6D4B\u901F\uFF0C\u8BE6\u60C5\u4E09\u7F51\u6D4B\u901F\u624D\u662F\u5168\u6D4B\uFF0C\u8282\u70B9\u5217\u8868\u6BCF\u5929\u81EA\u52A8\u66F4\u65B0\u4E00\u6B21\u3002

\u652F\u6301\u56FD\u5185\u670D\u52A1\u5668\u6D4B\u8BD5(\u6709\u5224\u65AD\u662F\u5426\u4E3A\u56FD\u5185\u673A\u5668)\uFF0C\u4F46\u7531\u4E8E\u56FD\u5185\u670D\u52A1\u5668\u5E26\u5BBD\u8FC7\u5C0F\uFF0C\u4F1A\u5F88\u6162\uFF0C\u8BE6\u89C1\u521D\u6B21\u8FD0\u884C\u7684\u663E\u793A

\u81EA\u52A8\u66F4\u65B0\u6D4B\u8BD5\u670D\u52A1\u5668\u5217\u8868\u7684\u4E09\u7F51\u5EF6\u8FDF\u6D4B\u8BD5\u811A\u672C

\u5E73\u5747\u8017\u65F610~15\u79D2

bash <(wget -qO- bash.spiritlhl.net/ecs-ping)
+

\u6216

bash <(wget -qO- --no-check-certificate https://github.com/spiritLHLS/ecsspeed/raw/main/script/ecsspeed-ping.sh)
+

\u6216\u56FD\u5185\u7528

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/ecsspeed/main/script/ecsspeed-ping.sh)
+

\u6548\u679C\u56FE

\u529F\u80FD

.cn\u6570\u636E

\u4ED3\u5E93\uFF1Ahttps://github.com/spiritLHLS/speedtest.cn-CN-ID

.net\u6570\u636E

\u4ED3\u5E93\uFF1Ahttps://github.com/spiritLHLS/speedtest.net-CN-ID

\u4EA4\u6D41

admin@spiritlhl.net

\u81F4\u8C22

\u611F\u8C22 @fscarmen \u63D0\u4F9B\u7684\u5E76\u53D1\u6D4Bping\u652F\u6301

\u611F\u8C22 speedtest-go \u63D0\u4F9B\u7684\u7B2C\u4E09\u65B9\u6D4B\u901F\u5185\u6838

\u611F\u8C22 speedtest.net \u548C speedtest.cn \u63D0\u4F9B\u7684\u6D4B\u901F\u670D\u52A1\u5668

`,49),n=[p];function i(c,d,h,l,o,g){return s(),t("div",null,n)}var b=e(a,[["render",i]]);export{u as __pageData,b as default}; diff --git a/docs/.vitepress/dist/assets/case_case3.md.d4e43a36.lean.js b/docs/.vitepress/dist/assets/case_case3.md.d4e43a36.lean.js new file mode 100644 index 0000000000..0f5801fa44 --- /dev/null +++ b/docs/.vitepress/dist/assets/case_case3.md.d4e43a36.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as s,a as r}from"./app.8fc4a373.js";const u='{"title":"\u4ED3\u5E93","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u8BF4\u660E","slug":"\u8BF4\u660E"},{"level":3,"title":"\u5BF9\u5E94 speedtest.net \u7684\u81EA\u52A8\u66F4\u65B0\u6D4B\u901F\u670D\u52A1\u5668ID\u7684\u6D4B\u901F\u811A\u672C","slug":"\u5BF9\u5E94-speedtest-net-\u7684\u81EA\u52A8\u66F4\u65B0\u6D4B\u901F\u670D\u52A1\u5668id\u7684\u6D4B\u901F\u811A\u672C"},{"level":3,"title":"\u5BF9\u5E94 speedtest.cn \u7684\u81EA\u52A8\u66F4\u65B0\u6D4B\u901F\u670D\u52A1\u5668ID\u7684\u6D4B\u901F\u811A\u672C","slug":"\u5BF9\u5E94-speedtest-cn-\u7684\u81EA\u52A8\u66F4\u65B0\u6D4B\u901F\u670D\u52A1\u5668id\u7684\u6D4B\u901F\u811A\u672C"},{"level":3,"title":"\u81EA\u52A8\u66F4\u65B0\u6D4B\u8BD5\u670D\u52A1\u5668\u5217\u8868\u7684\u4E09\u7F51\u5EF6\u8FDF\u6D4B\u8BD5\u811A\u672C","slug":"\u81EA\u52A8\u66F4\u65B0\u6D4B\u8BD5\u670D\u52A1\u5668\u5217\u8868\u7684\u4E09\u7F51\u5EF6\u8FDF\u6D4B\u8BD5\u811A\u672C"},{"level":2,"title":"\u529F\u80FD","slug":"\u529F\u80FD"},{"level":2,"title":".cn\u6570\u636E","slug":"cn\u6570\u636E"},{"level":2,"title":".net\u6570\u636E","slug":"net\u6570\u636E"},{"level":3,"title":"\u4EA4\u6D41","slug":"\u4EA4\u6D41"},{"level":3,"title":"\u81F4\u8C22","slug":"\u81F4\u8C22"}],"relativePath":"case/case3.md","lastUpdated":1687182420000}',a={},p=r("",49),n=[p];function i(c,d,h,l,o,g){return s(),t("div",null,n)}var b=e(a,[["render",i]]);export{u as __pageData,b as default}; diff --git a/docs/.vitepress/dist/assets/case_case4.md.b9d23b9c.js b/docs/.vitepress/dist/assets/case_case4.md.b9d23b9c.js new file mode 100644 index 0000000000..0b80cafcb2 --- /dev/null +++ b/docs/.vitepress/dist/assets/case_case4.md.b9d23b9c.js @@ -0,0 +1,4 @@ +import{_ as e,c as a,o as r,a as i}from"./app.8fc4a373.js";const _='{"title":"\u4ED3\u5E93","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u7532\u9AA8\u6587\u670D\u52A1\u5668\u4FDD\u6D3B\u811A\u672C","slug":"\u7532\u9AA8\u6587\u670D\u52A1\u5668\u4FDD\u6D3B\u811A\u672C"},{"level":3,"title":"\u57FA\u7840\u5F00\u53D1\u5B8C\u6BD5\uFF0C\u6D4B\u8BD5\u4E2D\uFF0C\u6709\u95EE\u9898\u8BF7\u5728issues\u4E2D\u53CD\u9988","slug":"\u57FA\u7840\u5F00\u53D1\u5B8C\u6BD5\uFF0C\u6D4B\u8BD5\u4E2D\uFF0C\u6709\u95EE\u9898\u8BF7\u5728issues\u4E2D\u53CD\u9988"},{"level":3,"title":"\u8BF4\u660E","slug":"\u8BF4\u660E"}],"relativePath":"case/case4.md","lastUpdated":1687182420000}',s={},t=i(`

\u4ED3\u5E93

https://github.com/spiritLHLS/Oracle-server-keep-alive-script

Oracle-server-keep-alive-script

\u5B9E\u9645\u4E0D\u6B62\u53EF\u4EE5\u5728\u7532\u9AA8\u6587\u670D\u52A1\u5668\u4E0A\u4F7F\u7528\uFF0C\u4E5F\u53EF\u4EE5\u4F7F\u7528\u5728\u4EFB\u610FARM\u6216X86_64\u67B6\u6784\u7684\u7CFB\u7EDF\uFF0C\u7528\u4F5C\u8D44\u6E90\u5360\u7528

\u7532\u9AA8\u6587\u670D\u52A1\u5668\u4FDD\u6D3B\u811A\u672C

\u9002\u914D\u7CFB\u7EDF\uFF1A\u5DF2\u5728Ubuntu 20+\uFF0CDebian 10+, Centos 7+, Oracle linux 8+\uFF0CAlmaLinux 8.5+

\u4E0A\u8FF0\u7CFB\u7EDF\u9A8C\u8BC1\u65E0\u95EE\u9898\uFF0C\u522B\u7684\u4E3B\u6D41\u7CFB\u7EDF\u5E94\u8BE5\u4E5F\u6CA1\u6709\u95EE\u9898

\u53EF\u9009\u5360\u7528\uFF1ACPU\uFF0C\u5185\u5B58\uFF0C\u5E26\u5BBD

\u5B89\u88C5\u5B8C\u6BD5\u540E\u5982\u679C\u6709\u95EE\u9898\u8BF7\u5378\u8F7D\u811A\u672C\u53CD\u9988\u95EE\u9898(\u91CD\u590D\u5378\u8F7D\u4E5F\u6CA1\u95EE\u9898)

\u6240\u6709\u8D44\u6E90(\u9664\u4E86CPU)\u53EF\u9009\u9ED8\u8BA4\u914D\u7F6E\u5219\u52A8\u6001\u5360\u7528\uFF0C\u5B9E\u65F6\u8C03\u6574\uFF0C\u907F\u514D\u670D\u52A1\u5668\u6709\u522B\u7684\u4EFB\u4F55\u8D44\u6E90\u5DF2\u7ECF\u8D85\u8FC7\u9650\u989D\u4E86\u4ECD\u7136\u518D\u5360\u7528\u8D44\u6E90

\u4E3A\u907F\u514DGitHub\u7684CDN\u62BD\u98CE\u52A0\u8F7D\u4E0D\u4E86\u65B0\u5185\u5BB9\uFF0C\u6240\u6709\u65B0\u66F4\u65B0\u5DF2\u4F7F\u7528Gitlab\u4ED3\u5E93

\u7531\u4E8Espeedtest-go\u7684release\u4F9D\u8D56\u4E8EGitHub\uFF0C\u6240\u4EE5\u8BF7\u68C0\u67E5 www.githubstatus.com ,\u6709\u95EE\u9898\u65F6\u65E0\u6CD5\u5B89\u88C5\u5E26\u5BBD\u5360\u7528

\u57FA\u7840\u5F00\u53D1\u5B8C\u6BD5\uFF0C\u6D4B\u8BD5\u4E2D\uFF0C\u6709\u95EE\u9898\u8BF7\u5728issues\u4E2D\u53CD\u9988

\u9009\u98791\u5B89\u88C5\uFF0C\u9009\u98792\u5378\u8F7D\uFF0C\u9009\u98793\u66F4\u65B0\u5B89\u88C5\u5F15\u5BFC\u811A\u672C\uFF0C\u9009\u98794\u9000\u51FA\u811A\u672C

\u5B89\u88C5\u8FC7\u7A0B\u4E2D\u65E0\u8111\u56DE\u8F66\u5219\u5168\u90E8\u53EF\u9009\u7684\u5360\u7528\u90FD\u5360\u7528\uFF0C\u4E0D\u9700\u8981\u4EC0\u4E48\u5360\u7528\u8F93\u5165n\u518D\u56DE\u8F66

\u5982\u679C\u9009\u62E9\u5E26\u5BBD\u5360\u7528\uFF0C\u4F1A\u8BE2\u95EE\u4F7F\u7528speedtest-go\u5360\u7528\u8FD8\u662F\u4F7F\u7528wget\u5360\u7528\uFF0C\u6309\u7167\u63D0\u793A\u8FDB\u884C\u9009\u62E9\u5373\u53EF

\u6709\u8BE2\u95EE\u662F\u5426\u9700\u8981\u5E26\u5BBD\u5360\u7528\u7684\u53C2\u6570\u81EA\u5B9A\u4E49\uFF0C\u8FD9\u65F6\u5019\u9ED8\u8BA4\u9009\u9879\u5C31\u662Fn\uFF0C\u56DE\u8F66\u5C31\u4F7F\u7528\u9ED8\u8BA4\u914D\u7F6E\uFF0C\u8F93\u5165y\u518D\u56DE\u8F66\u5219\u9700\u8981\u6309\u7167\u63D0\u793A\u81EA\u5B9A\u4E49\u53C2\u6570

curl -L https://gitlab.com/spiritysdx/Oracle-server-keep-alive-script/-/raw/main/oalive.sh -o oalive.sh && chmod +x oalive.sh && bash oalive.sh
+

\u6216

bash oalive.sh
+

\u6216

bash <(wget -qO- --no-check-certificate https://gitlab.com/spiritysdx/Oracle-server-keep-alive-script/-/raw/main/oalive.sh)
+

\u8BF4\u660E

\u5982\u82E5\u4E0D\u5E0C\u671B\u4E00\u952E\u7684\uFF0C\u5E0C\u671B\u81EA\u5B9A\u4E49\u8BBE\u7F6E\u65F6\u95F4\u7684\uFF0C\u8BF7\u67E5\u770BREADME_CRON.md\u81EA\u884C\u8BBE\u7F6E\u5B9A\u65F6\u4EFB\u52A1

`,25),l=[t];function p(c,o,d,n,h,u){return r(),a("div",null,l)}var g=e(s,[["render",p]]);export{_ as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/case_case4.md.b9d23b9c.lean.js b/docs/.vitepress/dist/assets/case_case4.md.b9d23b9c.lean.js new file mode 100644 index 0000000000..2d1a9e2165 --- /dev/null +++ b/docs/.vitepress/dist/assets/case_case4.md.b9d23b9c.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as r,a as i}from"./app.8fc4a373.js";const _='{"title":"\u4ED3\u5E93","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u7532\u9AA8\u6587\u670D\u52A1\u5668\u4FDD\u6D3B\u811A\u672C","slug":"\u7532\u9AA8\u6587\u670D\u52A1\u5668\u4FDD\u6D3B\u811A\u672C"},{"level":3,"title":"\u57FA\u7840\u5F00\u53D1\u5B8C\u6BD5\uFF0C\u6D4B\u8BD5\u4E2D\uFF0C\u6709\u95EE\u9898\u8BF7\u5728issues\u4E2D\u53CD\u9988","slug":"\u57FA\u7840\u5F00\u53D1\u5B8C\u6BD5\uFF0C\u6D4B\u8BD5\u4E2D\uFF0C\u6709\u95EE\u9898\u8BF7\u5728issues\u4E2D\u53CD\u9988"},{"level":3,"title":"\u8BF4\u660E","slug":"\u8BF4\u660E"}],"relativePath":"case/case4.md","lastUpdated":1687182420000}',s={},t=i("",25),l=[t];function p(c,o,d,n,h,u){return r(),a("div",null,l)}var g=e(s,[["render",p]]);export{_ as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/case_case5.md.38489a56.js b/docs/.vitepress/dist/assets/case_case5.md.38489a56.js new file mode 100644 index 0000000000..11d479d8f5 --- /dev/null +++ b/docs/.vitepress/dist/assets/case_case5.md.38489a56.js @@ -0,0 +1,2 @@ +import{_ as e,c as a,o as t,a as n}from"./app.8fc4a373.js";const v='{"title":"\u4ED3\u5E93","description":"","frontmatter":{},"headers":[{"level":3,"title":"One-click installation of convoy panel","slug":"one-click-installation-of-convoy-panel"},{"level":3,"title":"Thanks","slug":"thanks"}],"relativePath":"case/case5.md","lastUpdated":1687182420000}',o={},s=n(`

\u4ED3\u5E93

https://github.com/spiritLHLS/convoypanel-scripts

convoypanel-scripts

One-click installation of convoy panel

Prerequisites for installation:

I don't guarantee that this script is error-free, it's just for my own amusement.

curl -L https://github.com/spiritLHLS/convoypanel-scripts/raw/main/installconvoy.sh -o installconvoy.sh && chmod +x installconvoy.sh && bash installconvoy.sh
+

Thanks

Base on https://github.com/spiritLHLS/pve

Base on https://docs.convoypanel.com/guide/deployment/#installation

Base on https://github.com/ConvoyPanel/panel

`,12),r=[s];function i(l,c,p,h,d,m){return t(),a("div",null,r)}var u=e(o,[["render",i]]);export{v as __pageData,u as default}; diff --git a/docs/.vitepress/dist/assets/case_case5.md.38489a56.lean.js b/docs/.vitepress/dist/assets/case_case5.md.38489a56.lean.js new file mode 100644 index 0000000000..05c25fdadf --- /dev/null +++ b/docs/.vitepress/dist/assets/case_case5.md.38489a56.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as t,a as n}from"./app.8fc4a373.js";const v='{"title":"\u4ED3\u5E93","description":"","frontmatter":{},"headers":[{"level":3,"title":"One-click installation of convoy panel","slug":"one-click-installation-of-convoy-panel"},{"level":3,"title":"Thanks","slug":"thanks"}],"relativePath":"case/case5.md","lastUpdated":1687182420000}',o={},s=n("",12),r=[s];function i(l,c,p,h,d,m){return t(),a("div",null,r)}var u=e(o,[["render",i]]);export{v as __pageData,u as default}; diff --git a/docs/.vitepress/dist/assets/case_index.md.0e4336f3.js b/docs/.vitepress/dist/assets/case_index.md.0e4336f3.js new file mode 100644 index 0000000000..8e6ce8aa86 --- /dev/null +++ b/docs/.vitepress/dist/assets/case_index.md.0e4336f3.js @@ -0,0 +1 @@ +import{_ as a,c as s,o,b as e,d as t}from"./app.8fc4a373.js";const x='{"title":"Home","description":"","frontmatter":{"home":true,"heroImage":"https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png","heroText":"Linux\u76F8\u5173\u9879\u76EE","tagline":"\u4E0ELinux\u76F8\u5173\u7684\u4E00\u4E9B\u9879\u76EE","actionText":"\u67E5\u770B\u9879\u76EE \u2192","actionLink":"/case/case1","features":[{"title":"\u6CE8\u610F\u4E8B\u9879","details":"\u6CE8\u610F\u6BCF\u4E2A\u9879\u76EE\u8BF4\u660E\uFF0C\u90E8\u5206\u9879\u76EE\u6709\u53EF\u80FD\u5BF9\u7CFB\u7EDF\u9020\u6210\u4E0D\u53EF\u4FEE\u590D\u7684\u9519\u8BEF\uFF0C\u9700\u8981\u91CD\u88C5\u7CFB\u7EDF\uFF0C\u8BF7\u4ED4\u7EC6\u67E5\u770B\u8BF4\u660E"}]},"headers":[],"relativePath":"case/index.md","lastUpdated":1687182420000}',n={},r=e("p",null,[e("br"),t("\u672C\u4F5C\u54C1\u91C7\u7528 "),e("a",{rel:"license",href:"http://creativecommons.org/licenses/by-nc-sa/4.0/"},"\u77E5\u8BC6\u5171\u4EAB\u7F72\u540D-\u975E\u5546\u4E1A\u6027\u4F7F\u7528-\u76F8\u540C\u65B9\u5F0F\u5171\u4EAB 4.0 \u56FD\u9645\u8BB8\u53EF\u534F\u8BAE"),t(" \u8FDB\u884C\u8BB8\u53EF\u3002")],-1),c=[r];function i(l,d,p,_,h,m){return o(),s("div",null,c)}var f=a(n,[["render",i]]);export{x as __pageData,f as default}; diff --git a/docs/.vitepress/dist/assets/case_index.md.0e4336f3.lean.js b/docs/.vitepress/dist/assets/case_index.md.0e4336f3.lean.js new file mode 100644 index 0000000000..8e6ce8aa86 --- /dev/null +++ b/docs/.vitepress/dist/assets/case_index.md.0e4336f3.lean.js @@ -0,0 +1 @@ +import{_ as a,c as s,o,b as e,d as t}from"./app.8fc4a373.js";const x='{"title":"Home","description":"","frontmatter":{"home":true,"heroImage":"https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png","heroText":"Linux\u76F8\u5173\u9879\u76EE","tagline":"\u4E0ELinux\u76F8\u5173\u7684\u4E00\u4E9B\u9879\u76EE","actionText":"\u67E5\u770B\u9879\u76EE \u2192","actionLink":"/case/case1","features":[{"title":"\u6CE8\u610F\u4E8B\u9879","details":"\u6CE8\u610F\u6BCF\u4E2A\u9879\u76EE\u8BF4\u660E\uFF0C\u90E8\u5206\u9879\u76EE\u6709\u53EF\u80FD\u5BF9\u7CFB\u7EDF\u9020\u6210\u4E0D\u53EF\u4FEE\u590D\u7684\u9519\u8BEF\uFF0C\u9700\u8981\u91CD\u88C5\u7CFB\u7EDF\uFF0C\u8BF7\u4ED4\u7EC6\u67E5\u770B\u8BF4\u660E"}]},"headers":[],"relativePath":"case/index.md","lastUpdated":1687182420000}',n={},r=e("p",null,[e("br"),t("\u672C\u4F5C\u54C1\u91C7\u7528 "),e("a",{rel:"license",href:"http://creativecommons.org/licenses/by-nc-sa/4.0/"},"\u77E5\u8BC6\u5171\u4EAB\u7F72\u540D-\u975E\u5546\u4E1A\u6027\u4F7F\u7528-\u76F8\u540C\u65B9\u5F0F\u5171\u4EAB 4.0 \u56FD\u9645\u8BB8\u53EF\u534F\u8BAE"),t(" \u8FDB\u884C\u8BB8\u53EF\u3002")],-1),c=[r];function i(l,d,p,_,h,m){return o(),s("div",null,c)}var f=a(n,[["render",i]]);export{x as __pageData,f as default}; diff --git a/docs/.vitepress/dist/assets/chunks/AlgoliaSearchBox.381679cc.js b/docs/.vitepress/dist/assets/chunks/AlgoliaSearchBox.381679cc.js new file mode 100644 index 0000000000..3a1b876edb --- /dev/null +++ b/docs/.vitepress/dist/assets/chunks/AlgoliaSearchBox.381679cc.js @@ -0,0 +1,13 @@ +import{e as Sr,u as Er,f as wr,w as Ct,g as jr,h as Pr,o as Ir,c as kr,i as Cr}from"../app.8fc4a373.js";/*! @docsearch/js 3.0.0 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */function Dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function P(e){for(var t=1;t=0||(c[s]=i[s]);return c}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Fe(e,t){return function(n){if(Array.isArray(n))return n}(e)||function(n,r){var o=n==null?null:typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(o!=null){var a,i,u=[],s=!0,l=!1;try{for(o=o.call(n);!(s=(a=o.next()).done)&&(u.push(a.value),!r||u.length!==r);s=!0);}catch(c){l=!0,i=c}finally{try{s||o.return==null||o.return()}finally{if(l)throw i}}return u}}(e,t)||qn(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Be(e){return function(t){if(Array.isArray(t))return lt(t)}(e)||function(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(e)||qn(e)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function qn(e,t){if(e){if(typeof e=="string")return lt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lt(e,t):void 0}}function lt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n3)for(n=[n],a=3;a0?ge(p.type,p.props,p.key,null,p.__v):p)!=null){if(p.__=n,p.__b=n.__b+1,(m=_[c])===null||m&&p.key==m.key&&p.type===m.type)_[c]=void 0;else for(d=0;d3)for(n=[n],a=3;a=n.__.length&&n.__.push({}),n.__[e]}function Ft(e,t,n){var r=we(ce++,2);return r.t=e,r.__c||(r.__=[n?n(t):Qn(void 0,t),function(o){var a=r.t(r.__[0],o);r.__[0]!==a&&(r.__=[a,r.__[1]],r.__c.setState({}))}],r.__c=L),r.__}function Bt(e,t){var n=we(ce++,4);!E.__s&&Et(n.__H,t)&&(n.__=e,n.__H=t,L.__h.push(n))}function Le(e,t){var n=we(ce++,7);return Et(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Lr(){ft.forEach(function(e){if(e.__P)try{e.__H.__h.forEach(qe),e.__H.__h.forEach(pt),e.__H.__h=[]}catch(t){e.__H.__h=[],E.__e(t,e.__v)}}),ft=[]}E.__b=function(e){L=null,Lt&&Lt(e)},E.__r=function(e){qt&&qt(e),ce=0;var t=(L=e.__c).__H;t&&(t.__h.forEach(qe),t.__h.forEach(pt),t.__h=[])},E.diffed=function(e){Mt&&Mt(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(ft.push(t)!==1&&Tt===E.requestAnimationFrame||((Tt=E.requestAnimationFrame)||function(n){var r,o=function(){clearTimeout(a),Vt&&cancelAnimationFrame(r),setTimeout(n)},a=setTimeout(o,100);Vt&&(r=requestAnimationFrame(o))})(Lr)),L=void 0},E.__c=function(e,t){t.some(function(n){try{n.__h.forEach(qe),n.__h=n.__h.filter(function(r){return!r.__||pt(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],E.__e(r,n.__v)}}),Ht&&Ht(e,t)},E.unmount=function(e){Ut&&Ut(e);var t=e.__c;if(t&&t.__H)try{t.__H.__.forEach(qe)}catch(n){E.__e(n,t.__v)}};var Vt=typeof requestAnimationFrame=="function";function qe(e){var t=L;typeof e.__c=="function"&&e.__c(),L=t}function pt(e){var t=L;e.__c=e.__(),L=t}function Et(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Qn(e,t){return typeof t=="function"?t(e):t}function Yn(e,t){for(var n in t)e[n]=t[n];return e}function mt(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function dt(e){this.props=e}(dt.prototype=new B).isPureReactComponent=!0,dt.prototype.shouldComponentUpdate=function(e,t){return mt(this.props,e)||mt(this.state,t)};var zt=E.__b;E.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),zt&&zt(e)};var qr=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911,Kt=function(e,t){return e==null?null:K(K(e).map(t))},Mr={map:Kt,forEach:Kt,count:function(e){return e?K(e).length:0},only:function(e){var t=K(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:K},Hr=E.__e;function Me(){this.__u=0,this.t=null,this.__b=null}function Gn(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function ve(){this.u=null,this.o=null}E.__e=function(e,t,n){if(e.then){for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}Hr(e,t,n)},(Me.prototype=new B).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var o=Gn(r.__v),a=!1,i=function(){a||(a=!0,n.componentWillUnmount=n.__c,o?o(u):u())};n.__c=n.componentWillUnmount,n.componentWillUnmount=function(){i(),n.__c&&n.__c()};var u=function(){if(!--r.__u){if(r.state.__e){var l=r.state.__e;r.__v.__k[0]=function d(m,p,v){return m&&(m.__v=null,m.__k=m.__k&&m.__k.map(function(h){return d(h,p,v)}),m.__c&&m.__c.__P===p&&(m.__e&&v.insertBefore(m.__e,m.__d),m.__c.__e=!0,m.__c.__P=v)),m}(l,l.__c.__P,l.__c.__O)}var c;for(r.setState({__e:r.__b=null});c=r.t.pop();)c.forceUpdate()}},s=t.__h===!0;r.__u++||s||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(i,i)},Me.prototype.componentWillUnmount=function(){this.t=[]},Me.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function a(i,u,s){return i&&(i.__c&&i.__c.__H&&(i.__c.__H.__.forEach(function(l){typeof l.__c=="function"&&l.__c()}),i.__c.__H=null),(i=Yn({},i)).__c!=null&&(i.__c.__P===s&&(i.__c.__P=u),i.__c=null),i.__k=i.__k&&i.__k.map(function(l){return a(l,u,s)})),i}(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__e&&F(Q,null,e.fallback);return o&&(o.__h=null),[F(Q,null,t.__e?null:e.children),o]};var Wt=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(r)}}),Ee(F(Ur,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Zn(e,t){return F(Fr,{__v:e,i:t})}(ve.prototype=new B).__e=function(e){var t=this,n=Gn(t.__v),r=t.o.get(e);return r[0]++,function(o){var a=function(){t.props.revealOrder?(r.push(o),Wt(t,e,r)):o()};n?n(a):a()}},ve.prototype.render=function(e){this.u=null,this.o=new Map;var t=K(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},ve.prototype.componentDidUpdate=ve.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){Wt(e,n,t)})};var Xn=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Br=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Vr=function(e){return(typeof Symbol!="undefined"&&Oe(Symbol())=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(e)};function er(e,t,n){return t.__k==null&&(t.textContent=""),Ee(e,t),typeof n=="function"&&n(),e?e.__c:null}B.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(B.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Jt=E.event;function zr(){}function Kr(){return this.cancelBubble}function Wr(){return this.defaultPrevented}E.event=function(e){return Jt&&(e=Jt(e)),e.persist=zr,e.isPropagationStopped=Kr,e.isDefaultPrevented=Wr,e.nativeEvent=e};var tr,$t={configurable:!0,get:function(){return this.class}},Qt=E.vnode;E.vnode=function(e){var t=e.type,n=e.props,r=n;if(typeof t=="string"){for(var o in r={},n){var a=n[o];o==="value"&&"defaultValue"in n&&a==null||(o==="defaultValue"&&"value"in n&&n.value==null?o="value":o==="download"&&a===!0?a="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!Vr(n.type)?o="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():Br.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():a===null&&(a=void 0),r[o]=a)}t=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=K(n.children).forEach(function(i){i.props.selected=r.value.indexOf(i.props.value)!=-1})),t=="select"&&r.defaultValue!=null&&(r.value=K(n.children).forEach(function(i){i.props.selected=r.multiple?r.defaultValue.indexOf(i.props.value)!=-1:r.defaultValue==i.props.value})),e.props=r}t&&n.class!=n.className&&($t.enumerable="className"in n,n.className!=null&&(r.class=n.className),Object.defineProperty(r,"className",$t)),e.$$typeof=Xn,Qt&&Qt(e)};var Yt=E.__r;E.__r=function(e){Yt&&Yt(e),tr=e.__c};var Jr={ReactCurrentDispatcher:{current:{readContext:function(e){return tr.__n[e.__c].props.value}}}};(typeof performance=="undefined"?"undefined":Oe(performance))=="object"&&typeof performance.now=="function"&&performance.now.bind(performance);function Gt(e){return!!e&&e.$$typeof===Xn}var f={useState:function(e){return oe=1,Ft(Qn,e)},useReducer:Ft,useEffect:function(e,t){var n=we(ce++,3);!E.__s&&Et(n.__H,t)&&(n.__=e,n.__H=t,L.__H.__h.push(n))},useLayoutEffect:Bt,useRef:function(e){return oe=5,Le(function(){return{current:e}},[])},useImperativeHandle:function(e,t,n){oe=6,Bt(function(){typeof e=="function"?e(t()):e&&(e.current=t())},n==null?n:n.concat(e))},useMemo:Le,useCallback:function(e,t){return oe=8,Le(function(){return e},t)},useContext:function(e){var t=L.context[e.__c],n=we(ce++,9);return n.__c=e,t?(n.__==null&&(n.__=!0,t.sub(L)),t.props.value):e.__},useDebugValue:function(e,t){E.useDebugValue&&E.useDebugValue(t?t(e):e)},version:"16.8.0",Children:Mr,render:er,hydrate:function(e,t,n){return $n(e,t),typeof n=="function"&&n(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(Ee(null,e),!0)},createPortal:Zn,createElement:F,createContext:function(e,t){var n={__c:t="__cC"+Hn++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,a;return this.getChildContext||(o=[],(a={})[t]=this,this.getChildContext=function(){return a},this.shouldComponentUpdate=function(i){this.props.value!==i.value&&o.some(st)},this.sub=function(i){o.push(i);var u=i.componentWillUnmount;i.componentWillUnmount=function(){o.splice(o.indexOf(i),1),u&&u.call(i)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n},createFactory:function(e){return F.bind(null,e)},cloneElement:function(e){return Gt(e)?Tr.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:Q,isValidElement:Gt,findDOMNode:function(e){return e&&(e.base||e.nodeType===1&&e)||null},Component:B,PureComponent:dt,memo:function(e,t){function n(o){var a=this.props.ref,i=a==o.ref;return!i&&a&&(a.call?a(null):a.current=null),t?!t(this.props,o)||!i:mt(this.props,o)}function r(o){return this.shouldComponentUpdate=n,F(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r},forwardRef:function(e){function t(n,r){var o=Yn({},n);return delete o.ref,e(o,(r=n.ref||r)&&(Oe(r)!="object"||"current"in r)?r:null)}return t.$$typeof=qr,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:Q,Suspense:Me,SuspenseList:ve,lazy:function(e){var t,n,r;function o(a){if(t||(t=e()).then(function(i){n=i.default||i},function(i){r=i}),r)throw r;if(!n)throw t;return F(n,a)}return o.displayName="Lazy",o.__f=!0,o},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Jr};function $r(){return f.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},f.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"}))}function nr(){return f.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20"},f.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"}))}var Qr=["translations"];function ht(){return ht=Object.assign||function(e){for(var t=1;t=0||(c[s]=i[s]);return c}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Gr=f.forwardRef(function(e,t){var n=e.translations,r=n===void 0?{}:n,o=Yr(e,Qr),a=r.buttonText,i=a===void 0?"Search":a,u=r.buttonAriaLabel,s=u===void 0?"Search":u,l=Le(function(){return typeof navigator!="undefined"?/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?"\u2318":"Ctrl":null},[]);return f.createElement("button",ht({type:"button",className:"DocSearch DocSearch-Button","aria-label":s},o,{ref:t}),f.createElement("span",{className:"DocSearch-Button-Container"},f.createElement(nr,null),f.createElement("span",{className:"DocSearch-Button-Placeholder"},i)),f.createElement("span",{className:"DocSearch-Button-Keys"},l!==null&&f.createElement(f.Fragment,null,f.createElement("span",{className:"DocSearch-Button-Key"},l==="Ctrl"?f.createElement($r,null):l),f.createElement("span",{className:"DocSearch-Button-Key"},"K"))))});function je(e){return e.reduce(function(t,n){return t.concat(n)},[])}var Zr=0;function vt(e){return e.collections.length===0?0:e.collections.reduce(function(t,n){return t+n.items.length},0)}var Xr=function(){},eo=[{segment:"autocomplete-core",version:"1.5.2"}];function He(e,t){var n=t;return{then:function(r,o){return He(e.then(Ce(r,n,e),Ce(o,n,e)),n)},catch:function(r){return He(e.catch(Ce(r,n,e)),n)},finally:function(r){return r&&n.onCancelList.push(r),He(e.finally(Ce(r&&function(){return n.onCancelList=[],r()},n,e)),n)},cancel:function(){n.isCanceled=!0;var r=n.onCancelList;n.onCancelList=[],r.forEach(function(o){o()})},isCanceled:function(){return n.isCanceled===!0}}}function Zt(e){return He(e,{isCanceled:!1,onCancelList:[]})}function Ce(e,t,n){return e?function(r){return t.isCanceled?r:e(r)}:n}function Xt(e,t,n,r){if(!n)return null;if(e<0&&(t===null||r!==null&&t===0))return n+e;var o=(t===null?-1:t)+e;return o<=-1||o>=n?r===null?null:0:o}function en(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function to(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function no(e,t){var n=[];return Promise.resolve(e(t)).then(function(r){return Promise.all(r.filter(function(o){return Boolean(o)}).map(function(o){if(o.sourceId,n.includes(o.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(o.sourceId)," is not unique."));n.push(o.sourceId);var a=function(i){for(var u=1;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(c[s]=i[s]);return c}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var sn,ot,Re,de=null,fn=(sn=-1,ot=-1,Re=void 0,function(e){var t=++sn;return Promise.resolve(e).then(function(n){return Re&&t=0||(c[s]=i[s]);return c}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Oo=["props","refresh","store"],So=["inputElement","formElement","panelElement"],Eo=["inputElement"],wo=["inputElement","maxLength"],jo=["item","source"];function mn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function T(e){for(var t=1;t=0||(c[s]=i[s]);return c}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Io(e){var t=e.props,n=e.refresh,r=e.store,o=he(e,Oo);return{getEnvironmentProps:function(a){var i=a.inputElement,u=a.formElement,s=a.panelElement;return T({onTouchStart:function(l){!r.getState().isOpen&&r.pendingRequests.isEmpty()||l.target===i||[u,s].some(function(c){return d=c,m=l.target,d===m||d.contains(m);var d,m})===!1&&(r.dispatch("blur",null),t.debug||r.pendingRequests.cancelAll())},onTouchMove:function(l){r.getState().isOpen!==!1&&i===t.environment.document.activeElement&&l.target!==i&&i.blur()}},he(a,So))},getRootProps:function(a){return T({role:"combobox","aria-expanded":r.getState().isOpen,"aria-haspopup":"listbox","aria-owns":r.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label")},a)},getFormProps:function(a){return a.inputElement,T({action:"",noValidate:!0,role:"search",onSubmit:function(i){var u;i.preventDefault(),t.onSubmit(T({event:i,refresh:n,state:r.getState()},o)),r.dispatch("submit",null),(u=a.inputElement)===null||u===void 0||u.blur()},onReset:function(i){var u;i.preventDefault(),t.onReset(T({event:i,refresh:n,state:r.getState()},o)),r.dispatch("reset",null),(u=a.inputElement)===null||u===void 0||u.focus()}},he(a,Eo))},getLabelProps:function(a){return T({htmlFor:"".concat(t.id,"-input"),id:"".concat(t.id,"-label")},a)},getInputProps:function(a){function i(p){(t.openOnFocus||Boolean(r.getState().query))&&re(T({event:p,props:t,query:r.getState().completion||r.getState().query,refresh:n,store:r},o)),r.dispatch("focus",null)}var u="ontouchstart"in t.environment,s=a||{},l=(s.inputElement,s.maxLength),c=l===void 0?512:l,d=he(s,wo),m=ae(r.getState());return T({"aria-autocomplete":"both","aria-activedescendant":r.getState().isOpen&&r.getState().activeItemId!==null?"".concat(t.id,"-item-").concat(r.getState().activeItemId):void 0,"aria-controls":r.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label"),value:r.getState().completion||r.getState().query,id:"".concat(t.id,"-input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:m!=null&&m.itemUrl?"go":"search",spellCheck:"false",autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:c,type:"search",onChange:function(p){re(T({event:p,props:t,query:p.currentTarget.value.slice(0,c),refresh:n,store:r},o))},onKeyDown:function(p){(function(v){var h=v.event,y=v.props,_=v.refresh,g=v.store,b=bo(v,_o);if(h.key==="ArrowUp"||h.key==="ArrowDown"){var O=function(){var R=y.environment.document.getElementById("".concat(y.id,"-item-").concat(g.getState().activeItemId));R&&(R.scrollIntoViewIfNeeded?R.scrollIntoViewIfNeeded(!1):R.scrollIntoView(!1))},S=function(){var R=ae(g.getState());if(g.getState().activeItemId!==null&&R){var Ge=R.item,Ze=R.itemInputValue,Pe=R.itemUrl,W=R.source;W.onActive(G({event:h,item:Ge,itemInputValue:Ze,itemUrl:Pe,refresh:_,source:W,state:g.getState()},b))}};h.preventDefault(),g.getState().isOpen===!1&&(y.openOnFocus||Boolean(g.getState().query))?re(G({event:h,props:y,query:g.getState().query,refresh:_,store:g},b)).then(function(){g.dispatch(h.key,{nextActiveItemId:y.defaultActiveItemId}),S(),setTimeout(O,0)}):(g.dispatch(h.key,{}),S(),O())}else if(h.key==="Escape")h.preventDefault(),g.dispatch(h.key,null),g.pendingRequests.cancelAll();else if(h.key==="Enter"){if(g.getState().activeItemId===null||g.getState().collections.every(function(R){return R.items.length===0}))return;h.preventDefault();var I=ae(g.getState()),D=I.item,A=I.itemInputValue,k=I.itemUrl,N=I.source;if(h.metaKey||h.ctrlKey)k!==void 0&&(N.onSelect(G({event:h,item:D,itemInputValue:A,itemUrl:k,refresh:_,source:N,state:g.getState()},b)),y.navigator.navigateNewTab({itemUrl:k,item:D,state:g.getState()}));else if(h.shiftKey)k!==void 0&&(N.onSelect(G({event:h,item:D,itemInputValue:A,itemUrl:k,refresh:_,source:N,state:g.getState()},b)),y.navigator.navigateNewWindow({itemUrl:k,item:D,state:g.getState()}));else if(!h.altKey){if(k!==void 0)return N.onSelect(G({event:h,item:D,itemInputValue:A,itemUrl:k,refresh:_,source:N,state:g.getState()},b)),void y.navigator.navigate({itemUrl:k,item:D,state:g.getState()});re(G({event:h,nextState:{isOpen:!1},props:y,query:A,refresh:_,store:g},b)).then(function(){N.onSelect(G({event:h,item:D,itemInputValue:A,itemUrl:k,refresh:_,source:N,state:g.getState()},b))})}}})(T({event:p,props:t,refresh:n,store:r},o))},onFocus:i,onBlur:function(){u||(r.dispatch("blur",null),t.debug||r.pendingRequests.cancelAll())},onClick:function(p){a.inputElement!==t.environment.document.activeElement||r.getState().isOpen||i(p)}},d)},getPanelProps:function(a){return T({onMouseDown:function(i){i.preventDefault()},onMouseLeave:function(){r.dispatch("mouseleave",null)}},a)},getListProps:function(a){return T({role:"listbox","aria-labelledby":"".concat(t.id,"-label"),id:"".concat(t.id,"-list")},a)},getItemProps:function(a){var i=a.item,u=a.source,s=he(a,jo);return T({id:"".concat(t.id,"-item-").concat(i.__autocomplete_id),role:"option","aria-selected":r.getState().activeItemId===i.__autocomplete_id,onMouseMove:function(l){if(i.__autocomplete_id!==r.getState().activeItemId){r.dispatch("mousemove",i.__autocomplete_id);var c=ae(r.getState());if(r.getState().activeItemId!==null&&c){var d=c.item,m=c.itemInputValue,p=c.itemUrl,v=c.source;v.onActive(T({event:l,item:d,itemInputValue:m,itemUrl:p,refresh:n,source:v,state:r.getState()},o))}}},onMouseDown:function(l){l.preventDefault()},onClick:function(l){var c=u.getItemInputValue({item:i,state:r.getState()}),d=u.getItemUrl({item:i,state:r.getState()});(d?Promise.resolve():re(T({event:l,nextState:{isOpen:!1},props:t,query:c,refresh:n,store:r},o))).then(function(){u.onSelect(T({event:l,item:i,itemInputValue:c,itemUrl:d,refresh:n,source:u,state:r.getState()},o))})}},s)}}}function dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ko(e){for(var t=1;t0},reshape:function(m){return m.sources}},u),{},{id:(l=u.id)!==null&&l!==void 0?l:"autocomplete-".concat(Zr++),plugins:d,initialState:te({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},u.initialState),onStateChange:function(m){var p;(p=u.onStateChange)===null||p===void 0||p.call(u,m),d.forEach(function(v){var h;return(h=v.onStateChange)===null||h===void 0?void 0:h.call(v,m)})},onSubmit:function(m){var p;(p=u.onSubmit)===null||p===void 0||p.call(u,m),d.forEach(function(v){var h;return(h=v.onSubmit)===null||h===void 0?void 0:h.call(v,m)})},onReset:function(m){var p;(p=u.onReset)===null||p===void 0||p.call(u,m),d.forEach(function(v){var h;return(h=v.onReset)===null||h===void 0?void 0:h.call(v,m)})},getSources:function(m){return Promise.all([].concat(co(d.map(function(p){return p.getSources})),[u.getSources]).filter(Boolean).map(function(p){return no(p,m)})).then(function(p){return je(p)}).then(function(p){return p.map(function(v){return te(te({},v),{},{onSelect:function(h){v.onSelect(h),s.forEach(function(y){var _;return(_=y.onSelect)===null||_===void 0?void 0:_.call(y,h)})},onActive:function(h){v.onActive(h),s.forEach(function(y){var _;return(_=y.onActive)===null||_===void 0?void 0:_.call(y,h)})}})})})},navigator:te({navigate:function(m){var p=m.itemUrl;c.location.assign(p)},navigateNewTab:function(m){var p=m.itemUrl,v=c.open(p,"_blank","noopener");v==null||v.focus()},navigateNewWindow:function(m){var p=m.itemUrl;c.open(p,"_blank","noopener")}},u.navigator)})}(e,t),r=ao(xo,n,function(u){var s=u.prevState,l=u.state;n.onStateChange(Z({prevState:s,state:l,refresh:i},o))}),o=function(u){var s=u.store;return{setActiveItemId:function(l){s.dispatch("setActiveItemId",l)},setQuery:function(l){s.dispatch("setQuery",l)},setCollections:function(l){var c=0,d=l.map(function(m){return xe(xe({},m),{},{items:je(m.items).map(function(p){return xe(xe({},p),{},{__autocomplete_id:c++})})})});s.dispatch("setCollections",d)},setIsOpen:function(l){s.dispatch("setIsOpen",l)},setStatus:function(l){s.dispatch("setStatus",l)},setContext:function(l){s.dispatch("setContext",l)}}}({store:r}),a=Io(Z({props:n,refresh:i,store:r},o));function i(){return re(Z({event:new Event("input"),nextState:{isOpen:r.getState().isOpen},props:n,query:r.getState().query,refresh:i,store:r},o))}return n.plugins.forEach(function(u){var s;return(s=u.subscribe)===null||s===void 0?void 0:s.call(u,Z(Z({},o),{},{refresh:i,onSelect:function(l){t.push({onSelect:l})},onActive:function(l){t.push({onActive:l})}}))}),function(u){var s,l=u.metadata,c=u.environment;if(!((s=c.navigator)===null||s===void 0)&&s.userAgent.includes("Algolia Crawler")){var d=c.document.createElement("meta"),m=c.document.querySelector("head");d.name="algolia:metadata",setTimeout(function(){d.content=JSON.stringify(l),m.appendChild(d)},0)}}({metadata:Co({plugins:n.plugins,options:e}),environment:n.environment}),Z(Z({refresh:i},a),o)}function Ro(e){var t=e.translations,n=(t===void 0?{}:t).searchByText,r=n===void 0?"Search by":n;return f.createElement("a",{href:"https://www.algolia.com/ref/docsearch/?utm_source=".concat(window.location.hostname,"&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch"),target:"_blank",rel:"noopener noreferrer"},f.createElement("span",{className:"DocSearch-Label"},r),f.createElement("svg",{width:"77",height:"19","aria-label":"Algolia",role:"img"},f.createElement("path",{d:"M2.5067 0h14.0245c1.384.001 2.5058 1.1205 2.5068 2.5017V16.5c-.0014 1.3808-1.1232 2.4995-2.5068 2.5H2.5067C1.1232 18.9995.0014 17.8808 0 16.5V2.4958A2.495 2.495 0 01.735.7294 2.505 2.505 0 012.5068 0zM37.95 15.0695c-3.7068.0168-3.7068-2.986-3.7068-3.4634L34.2372.3576 36.498 0v11.1794c0 .2715 0 1.9889 1.452 1.994v1.8961zm-9.1666-1.8388c.694 0 1.2086-.0397 1.5678-.1088v-2.2934a5.3639 5.3639 0 00-1.3303-.1679 4.8283 4.8283 0 00-.758.0582 2.2845 2.2845 0 00-.688.2024c-.2029.0979-.371.2362-.4919.4142-.1268.1788-.185.2826-.185.5533 0 .5297.185.8359.5205 1.0375.3355.2016.7928.3053 1.365.3053v-.0008zm-.1969-8.1817c.7463 0 1.3768.092 1.8856.2767.5088.1838.9195.4428 1.2204.7717.3068.334.5147.7777.6423 1.251.1327.4723.196.991.196 1.5603v5.798c-.5235.1036-1.05.192-1.5787.2649-.7048.1037-1.4976.156-2.3774.156-.5832 0-1.1215-.0582-1.6016-.167a3.385 3.385 0 01-1.2432-.5364 2.6034 2.6034 0 01-.8037-.9565c-.191-.3922-.29-.9447-.29-1.5208 0-.5533.11-.905.3246-1.2863a2.7351 2.7351 0 01.8849-.9329c.376-.242.8029-.415 1.2948-.5187a7.4517 7.4517 0 011.5381-.156 7.1162 7.1162 0 011.6667.2024V8.886c0-.259-.0296-.5061-.093-.7372a1.5847 1.5847 0 00-.3245-.6158 1.5079 1.5079 0 00-.6119-.4158 2.6788 2.6788 0 00-.966-.173c-.5206 0-.9948.0634-1.4283.1384a6.5481 6.5481 0 00-1.065.259l-.2712-1.849c.2831-.0986.7048-.1964 1.2491-.2943a9.2979 9.2979 0 011.752-.1501v.0008zm44.6597 8.1193c.6947 0 1.2086-.0405 1.567-.1097v-2.2942a5.3743 5.3743 0 00-1.3303-.1679c-.2485 0-.503.0177-.7573.0582a2.2853 2.2853 0 00-.688.2024 1.2333 1.2333 0 00-.4918.4142c-.1268.1788-.1843.2826-.1843.5533 0 .5297.1843.8359.5198 1.0375.3414.2066.7927.3053 1.365.3053v.0009zm-.191-8.1767c.7463 0 1.3768.0912 1.8856.2759.5087.1847.9195.4436 1.2204.7717.3.329.5147.7786.6414 1.251a5.7248 5.7248 0 01.197 1.562v5.7972c-.3466.0742-.874.1602-1.5788.2648-.7049.1038-1.4976.1552-2.3774.1552-.5832 0-1.1215-.0573-1.6016-.167a3.385 3.385 0 01-1.2432-.5356 2.6034 2.6034 0 01-.8038-.9565c-.191-.3922-.2898-.9447-.2898-1.5216 0-.5533.1098-.905.3245-1.2854a2.7373 2.7373 0 01.8849-.9338c.376-.2412.8029-.4141 1.2947-.5178a7.4545 7.4545 0 012.325-.1097c.2781.0287.5672.081.879.156v-.3686a2.7781 2.7781 0 00-.092-.738 1.5788 1.5788 0 00-.3246-.6166 1.5079 1.5079 0 00-.612-.415 2.6797 2.6797 0 00-.966-.1729c-.5205 0-.9947.0633-1.4282.1384a6.5608 6.5608 0 00-1.065.259l-.2712-1.8498c.283-.0979.7048-.1957 1.2491-.2935a9.8597 9.8597 0 011.752-.1494zm-6.79-1.072c-.7576.001-1.373-.6103-1.3759-1.3664 0-.755.6128-1.3664 1.376-1.3664.764 0 1.3775.6115 1.3775 1.3664s-.6195 1.3664-1.3776 1.3664zm1.1393 11.1507h-2.2726V5.3409l2.2734-.3568v10.0845l-.0008.0017zm-3.984 0c-3.707.0168-3.707-2.986-3.707-3.4642L59.7069.3576 61.9685 0v11.1794c0 .2715 0 1.9889 1.452 1.994V15.0703zm-7.3512-4.979c0-.975-.2138-1.7873-.6305-2.3516-.4167-.571-.9998-.852-1.747-.852-.7454 0-1.3302.281-1.7452.852-.4166.5702-.6195 1.3765-.6195 2.3516 0 .9851.208 1.6473.6254 2.2183.4158.576.9998.8587 1.7461.8587.7454 0 1.3303-.2885 1.747-.8595.4158-.5761.6237-1.2315.6237-2.2184v.0009zm2.3132-.006c0 .7609-.1099 1.3361-.3356 1.9654a4.654 4.654 0 01-.9533 1.6076A4.214 4.214 0 0155.613 14.69c-.579.2412-1.4697.3795-1.9143.3795-.4462-.005-1.3303-.1324-1.9033-.3795a4.307 4.307 0 01-1.474-1.0316c-.4115-.4445-.7293-.9801-.9609-1.6076a5.3423 5.3423 0 01-.3465-1.9653c0-.7608.104-1.493.3356-2.1155a4.683 4.683 0 01.9719-1.5958 4.3383 4.3383 0 011.479-1.0257c.5739-.242 1.2043-.3567 1.8864-.3567.6829 0 1.3125.1197 1.8906.3567a4.1245 4.1245 0 011.4816 1.0257 4.7587 4.7587 0 01.9592 1.5958c.2426.6225.3643 1.3547.3643 2.1155zm-17.0198 0c0 .9448.208 1.9932.6238 2.431.4166.4386.955.6579 1.6142.6579.3584 0 .6998-.0523 1.0176-.1502.3186-.0978.5721-.2134.775-.3517V7.0784a8.8706 8.8706 0 00-1.4926-.1906c-.8206-.0236-1.4452.312-1.8847.8468-.4335.5365-.6533 1.476-.6533 2.3516v-.0008zm6.2863 4.4485c0 1.5385-.3938 2.662-1.1866 3.3773-.791.7136-2.0005 1.0712-3.6308 1.0712-.5958 0-1.834-.1156-2.8228-.334l.3643-1.7865c.8282.173 1.9202.2193 2.4932.2193.9077 0 1.555-.1847 1.943-.5533.388-.3686.578-.916.578-1.643v-.3687a6.8289 6.8289 0 01-.8848.3349c-.3634.1096-.786.167-1.261.167-.6246 0-1.1917-.0979-1.7055-.2944a3.5554 3.5554 0 01-1.3244-.8645c-.3642-.3796-.6541-.8579-.8561-1.4289-.2028-.571-.3068-1.59-.3068-2.339 0-.7034.1099-1.5856.3245-2.1735.2198-.5871.5316-1.0949.9542-1.515.4167-.42.9255-.743 1.5213-.98a5.5923 5.5923 0 012.052-.3855c.7353 0 1.4114.092 2.0707.2024.6592.1088 1.2204.2236 1.6776.35v8.945-.0008zM11.5026 4.2418v-.6511c-.0005-.4553-.3704-.8241-.8266-.8241H8.749c-.4561 0-.826.3688-.8265.824v.669c0 .0742.0693.1264.1445.1096a6.0346 6.0346 0 011.6768-.2362 6.125 6.125 0 011.6202.2185.1116.1116 0 00.1386-.1097zm-5.2806.852l-.3296-.3282a.8266.8266 0 00-1.168 0l-.393.3922a.8199.8199 0 000 1.164l.3237.323c.0524.0515.1268.0397.1733-.0117.191-.259.3989-.507.6305-.7372.2374-.2362.48-.4437.7462-.6335.0575-.0354.0634-.1155.017-.1687zm3.5159 2.069v2.818c0 .081.0879.1392.1622.0987l2.5102-1.2964c.0574-.0287.0752-.0987.0464-.1552a3.1237 3.1237 0 00-2.603-1.574c-.0575 0-.115.0456-.115.1097l-.0008-.0009zm.0008 6.789c-2.0933.0005-3.7915-1.6912-3.7947-3.7804C5.9468 8.0821 7.6452 6.39 9.7387 6.391c2.0932-.0005 3.7911 1.6914 3.794 3.7804a3.7783 3.7783 0 01-1.1124 2.675 3.7936 3.7936 0 01-2.6824 1.1054h.0008zM9.738 4.8002c-1.9218 0-3.6975 1.0232-4.6584 2.6841a5.359 5.359 0 000 5.3683c.9609 1.661 2.7366 2.6841 4.6584 2.6841a5.3891 5.3891 0 003.8073-1.5725 5.3675 5.3675 0 001.578-3.7987 5.3574 5.3574 0 00-1.5771-3.797A5.379 5.379 0 009.7387 4.801l-.0008-.0008z",fill:"currentColor",fillRule:"evenodd"})))}function Te(e){return f.createElement("svg",{width:"15",height:"15","aria-label":e.ariaLabel,role:"img"},f.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"},e.children))}function To(e){var t=e.translations,n=t===void 0?{}:t,r=n.selectText,o=r===void 0?"to select":r,a=n.selectKeyAriaLabel,i=a===void 0?"Enter key":a,u=n.navigateText,s=u===void 0?"to navigate":u,l=n.navigateUpKeyAriaLabel,c=l===void 0?"Arrow up":l,d=n.navigateDownKeyAriaLabel,m=d===void 0?"Arrow down":d,p=n.closeText,v=p===void 0?"to close":p,h=n.closeKeyAriaLabel,y=h===void 0?"Escape key":h,_=n.searchByText,g=_===void 0?"Search by":_;return f.createElement(f.Fragment,null,f.createElement("div",{className:"DocSearch-Logo"},f.createElement(Ro,{translations:{searchByText:g}})),f.createElement("ul",{className:"DocSearch-Commands"},f.createElement("li",null,f.createElement("span",{className:"DocSearch-Commands-Key"},f.createElement(Te,{ariaLabel:i},f.createElement("path",{d:"M12 3.53088v3c0 1-1 2-2 2H4M7 11.53088l-3-3 3-3"}))),f.createElement("span",{className:"DocSearch-Label"},o)),f.createElement("li",null,f.createElement("span",{className:"DocSearch-Commands-Key"},f.createElement(Te,{ariaLabel:m},f.createElement("path",{d:"M7.5 3.5v8M10.5 8.5l-3 3-3-3"}))),f.createElement("span",{className:"DocSearch-Commands-Key"},f.createElement(Te,{ariaLabel:c},f.createElement("path",{d:"M7.5 11.5v-8M10.5 6.5l-3-3-3 3"}))),f.createElement("span",{className:"DocSearch-Label"},s)),f.createElement("li",null,f.createElement("span",{className:"DocSearch-Commands-Key"},f.createElement(Te,{ariaLabel:y},f.createElement("path",{d:"M13.6167 8.936c-.1065.3583-.6883.962-1.4875.962-.7993 0-1.653-.9165-1.653-2.1258v-.5678c0-1.2548.7896-2.1016 1.653-2.1016.8634 0 1.3601.4778 1.4875 1.0724M9 6c-.1352-.4735-.7506-.9219-1.46-.8972-.7092.0246-1.344.57-1.344 1.2166s.4198.8812 1.3445.9805C8.465 7.3992 8.968 7.9337 9 8.5c.032.5663-.454 1.398-1.4595 1.398C6.6593 9.898 6 9 5.963 8.4851m-1.4748.5368c-.2635.5941-.8099.876-1.5443.876s-1.7073-.6248-1.7073-2.204v-.4603c0-1.0416.721-2.131 1.7073-2.131.9864 0 1.6425 1.031 1.5443 2.2492h-2.956"}))),f.createElement("span",{className:"DocSearch-Label"},v))))}function Lo(e){var t=e.hit,n=e.children;return f.createElement("a",{href:t.url},n)}function qo(){return f.createElement("svg",{viewBox:"0 0 38 38",stroke:"currentColor",strokeOpacity:".5"},f.createElement("g",{fill:"none",fillRule:"evenodd"},f.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},f.createElement("circle",{strokeOpacity:".3",cx:"18",cy:"18",r:"18"}),f.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18"},f.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))))}function Mo(){return f.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},f.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},f.createElement("path",{d:"M3.18 6.6a8.23 8.23 0 1112.93 9.94h0a8.23 8.23 0 01-11.63 0"}),f.createElement("path",{d:"M6.44 7.25H2.55V3.36M10.45 6v5.6M10.45 11.6L13 13"})))}function yt(){return f.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},f.createElement("path",{d:"M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function Ho(){return f.createElement("svg",{className:"DocSearch-Hit-Select-Icon",width:"20",height:"20",viewBox:"0 0 20 20"},f.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},f.createElement("path",{d:"M18 3v4c0 2-2 4-4 4H2"}),f.createElement("path",{d:"M8 17l-6-6 6-6"})))}var Uo=function(){return f.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},f.createElement("path",{d:"M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))};function Fo(e){switch(e.type){case"lvl1":return f.createElement(Uo,null);case"content":return f.createElement(Vo,null);default:return f.createElement(Bo,null)}}function Bo(){return f.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},f.createElement("path",{d:"M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function Vo(){return f.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},f.createElement("path",{d:"M17 5H3h14zm0 5H3h14zm0 5H3h14z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function _n(){return f.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},f.createElement("path",{d:"M10 14.2L5 17l1-5.6-4-4 5.5-.7 2.5-5 2.5 5 5.6.8-4 4 .9 5.5z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function zo(){return f.createElement("svg",{width:"40",height:"40",viewBox:"0 0 20 20",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},f.createElement("path",{d:"M19 4.8a16 16 0 00-2-1.2m-3.3-1.2A16 16 0 001.1 4.7M16.7 8a12 12 0 00-2.8-1.4M10 6a12 12 0 00-6.7 2M12.3 14.7a4 4 0 00-4.5 0M14.5 11.4A8 8 0 0010 10M3 16L18 2M10 18h0"}))}function Ko(){return f.createElement("svg",{width:"40",height:"40",viewBox:"0 0 20 20",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},f.createElement("path",{d:"M15.5 4.8c2 3 1.7 7-1 9.7h0l4.3 4.3-4.3-4.3a7.8 7.8 0 01-9.8 1m-2.2-2.2A7.8 7.8 0 0113.2 2.4M2 18L18 2"}))}function Wo(e){var t=e.translations,n=t===void 0?{}:t,r=n.titleText,o=r===void 0?"Unable to fetch results":r,a=n.helpText,i=a===void 0?"You might want to check your network connection.":a;return f.createElement("div",{className:"DocSearch-ErrorScreen"},f.createElement("div",{className:"DocSearch-Screen-Icon"},f.createElement(zo,null)),f.createElement("p",{className:"DocSearch-Title"},o),f.createElement("p",{className:"DocSearch-Help"},i))}var Jo=["translations"];function $o(e){return function(t){if(Array.isArray(t))return at(t)}(e)||function(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(e)||function(t,n){if(!!t){if(typeof t=="string")return at(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return at(t,n)}}(e)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function at(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(c[s]=i[s]);return c}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Yo(e){var t=e.translations,n=t===void 0?{}:t,r=Qo(e,Jo),o=n.noResultsText,a=o===void 0?"No results for":o,i=n.suggestedQueryText,u=i===void 0?"Try searching for":i,s=n.reportMissingResultsText,l=s===void 0?"Believe this query should return results?":s,c=n.reportMissingResultsLinkText,d=c===void 0?"Let us know.":c,m=r.state.context.searchSuggestions;return f.createElement("div",{className:"DocSearch-NoResults"},f.createElement("div",{className:"DocSearch-Screen-Icon"},f.createElement(Ko,null)),f.createElement("p",{className:"DocSearch-Title"},a,' "',f.createElement("strong",null,r.state.query),'"'),m&&m.length>0&&f.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},f.createElement("p",{className:"DocSearch-Help"},u,":"),f.createElement("ul",null,m.slice(0,3).reduce(function(p,v){return[].concat($o(p),[f.createElement("li",{key:v},f.createElement("button",{className:"DocSearch-Prefill",key:v,type:"button",onClick:function(){r.setQuery(v.toLowerCase()+" "),r.refresh(),r.inputRef.current.focus()}},v))])},[]))),r.getMissingResultsUrl&&f.createElement("p",{className:"DocSearch-Help"},"".concat(l," "),f.createElement("a",{href:r.getMissingResultsUrl({query:r.state.query}),target:"_blank",rel:"noopener noreferrer"},d)))}var Go=["hit","attribute","tagName"];function gn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function bn(e){for(var t=1;t=0||(c[s]=i[s]);return c}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function On(e,t){return t.split(".").reduce(function(n,r){return n!=null&&n[r]?n[r]:null},e)}function ne(e){var t=e.hit,n=e.attribute,r=e.tagName;return F(r===void 0?"span":r,bn(bn({},Xo(e,Go)),{},{dangerouslySetInnerHTML:{__html:On(t,"_snippetResult.".concat(n,".value"))||On(t,n)}}))}function Sn(e,t){return function(n){if(Array.isArray(n))return n}(e)||function(n,r){var o=n==null?null:typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(o!=null){var a,i,u=[],s=!0,l=!1;try{for(o=o.call(n);!(s=(a=o.next()).done)&&(u.push(a.value),!r||u.length!==r);s=!0);}catch(c){l=!0,i=c}finally{try{s||o.return==null||o.return()}finally{if(l)throw i}}return u}}(e,t)||function(n,r){if(!!n){if(typeof n=="string")return En(n,r);var o=Object.prototype.toString.call(n).slice(8,-1);if(o==="Object"&&n.constructor&&(o=n.constructor.name),o==="Map"||o==="Set")return Array.from(n);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return En(n,r)}}(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function En(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n|<\/mark>)/g,na=RegExp(ar.source);function ir(e){var t,n,r,o,a,i=e;if(!i.__docsearch_parent&&!e._highlightResult)return e.hierarchy.lvl0;var u=((i.__docsearch_parent?(t=i.__docsearch_parent)===null||t===void 0||(n=t._highlightResult)===null||n===void 0||(r=n.hierarchy)===null||r===void 0?void 0:r.lvl0:(o=e._highlightResult)===null||o===void 0||(a=o.hierarchy)===null||a===void 0?void 0:a.lvl0)||{}).value;return u&&na.test(u)?u.replace(ar,""):u}function gt(){return gt=Object.assign||function(e){for(var t=1;t=0||(c[s]=i[s]);return c}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ia(e){var t=e.translations,n=t===void 0?{}:t,r=aa(e,oa),o=n.recentSearchesTitle,a=o===void 0?"Recent":o,i=n.noRecentSearchesText,u=i===void 0?"No recent searches":i,s=n.saveRecentSearchButtonTitle,l=s===void 0?"Save this search":s,c=n.removeRecentSearchButtonTitle,d=c===void 0?"Remove this search from history":c,m=n.favoriteSearchesTitle,p=m===void 0?"Favorite":m,v=n.removeFavoriteSearchButtonTitle,h=v===void 0?"Remove this search from favorites":v;return r.state.status==="idle"&&r.hasCollections===!1?r.disableUserPersonalization?null:f.createElement("div",{className:"DocSearch-StartScreen"},f.createElement("p",{className:"DocSearch-Help"},u)):r.hasCollections===!1?null:f.createElement("div",{className:"DocSearch-Dropdown-Container"},f.createElement(_t,We({},r,{title:a,collection:r.state.collections[0],renderIcon:function(){return f.createElement("div",{className:"DocSearch-Hit-icon"},f.createElement(Mo,null))},renderAction:function(y){var _=y.item,g=y.runFavoriteTransition,b=y.runDeleteTransition;return f.createElement(f.Fragment,null,f.createElement("div",{className:"DocSearch-Hit-action"},f.createElement("button",{className:"DocSearch-Hit-action-button",title:l,type:"submit",onClick:function(O){O.preventDefault(),O.stopPropagation(),g(function(){r.favoriteSearches.add(_),r.recentSearches.remove(_),r.refresh()})}},f.createElement(_n,null))),f.createElement("div",{className:"DocSearch-Hit-action"},f.createElement("button",{className:"DocSearch-Hit-action-button",title:d,type:"submit",onClick:function(O){O.preventDefault(),O.stopPropagation(),b(function(){r.recentSearches.remove(_),r.refresh()})}},f.createElement(yt,null))))}})),f.createElement(_t,We({},r,{title:p,collection:r.state.collections[1],renderIcon:function(){return f.createElement("div",{className:"DocSearch-Hit-icon"},f.createElement(_n,null))},renderAction:function(y){var _=y.item,g=y.runDeleteTransition;return f.createElement("div",{className:"DocSearch-Hit-action"},f.createElement("button",{className:"DocSearch-Hit-action-button",title:h,type:"submit",onClick:function(b){b.preventDefault(),b.stopPropagation(),g(function(){r.favoriteSearches.remove(_),r.refresh()})}},f.createElement(yt,null)))}})))}var ca=["translations"];function Je(){return Je=Object.assign||function(e){for(var t=1;t=0||(c[s]=i[s]);return c}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var la=f.memo(function(e){var t=e.translations,n=t===void 0?{}:t,r=ua(e,ca);if(r.state.status==="error")return f.createElement(Wo,{translations:n==null?void 0:n.errorScreen});var o=r.state.collections.some(function(a){return a.items.length>0});return r.state.query?o===!1?f.createElement(Yo,Je({},r,{translations:n==null?void 0:n.noResultsScreen})):f.createElement(ra,r):f.createElement(ia,Je({},r,{hasCollections:o,translations:n==null?void 0:n.startScreen}))},function(e,t){return t.state.status==="loading"||t.state.status==="stalled"}),sa=["translations"];function $e(){return $e=Object.assign||function(e){for(var t=1;t=0||(c[s]=i[s]);return c}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function pa(e){var t=e.translations,n=t===void 0?{}:t,r=fa(e,sa),o=n.resetButtonTitle,a=o===void 0?"Clear the query":o,i=n.resetButtonAriaLabel,u=i===void 0?"Clear the query":i,s=n.cancelButtonText,l=s===void 0?"Cancel":s,c=n.cancelButtonAriaLabel,d=c===void 0?"Cancel":c,m=r.getFormProps({inputElement:r.inputRef.current}).onReset;return f.useEffect(function(){r.autoFocus&&r.inputRef.current&&r.inputRef.current.focus()},[r.autoFocus,r.inputRef]),f.useEffect(function(){r.isFromSelection&&r.inputRef.current&&r.inputRef.current.select()},[r.isFromSelection,r.inputRef]),f.createElement(f.Fragment,null,f.createElement("form",{className:"DocSearch-Form",onSubmit:function(p){p.preventDefault()},onReset:m},f.createElement("label",$e({className:"DocSearch-MagnifierLabel"},r.getLabelProps()),f.createElement(nr,null)),f.createElement("div",{className:"DocSearch-LoadingIndicator"},f.createElement(qo,null)),f.createElement("input",$e({className:"DocSearch-Input",ref:r.inputRef},r.getInputProps({inputElement:r.inputRef.current,autoFocus:r.autoFocus,maxLength:64}))),f.createElement("button",{type:"reset",title:a,className:"DocSearch-Reset","aria-label":u,hidden:!r.state.query},f.createElement(yt,null))),f.createElement("button",{className:"DocSearch-Cancel",type:"reset","aria-label":d,onClick:r.onClose},l))}var ma=["_highlightResult","_snippetResult"];function da(e,t){if(e==null)return{};var n,r,o=function(i,u){if(i==null)return{};var s,l,c={},d=Object.keys(i);for(l=0;l=0||(c[s]=i[s]);return c}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ha(e){return function(){var t="__TEST_KEY__";try{return localStorage.setItem(t,""),localStorage.removeItem(t),!0}catch{return!1}}()===!1?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){return window.localStorage.setItem(e,JSON.stringify(t))},getItem:function(){var t=window.localStorage.getItem(e);return t?JSON.parse(t):[]}}}function Pn(e){var t=e.key,n=e.limit,r=n===void 0?5:n,o=ha(t),a=o.getItem().slice(0,r);return{add:function(i){var u=i,s=(u._highlightResult,u._snippetResult,da(u,ma)),l=a.findIndex(function(c){return c.objectID===s.objectID});l>-1&&a.splice(l,1),a.unshift(s),a=a.slice(0,r),o.setItem(a)},remove:function(i){a=a.filter(function(u){return u.objectID!==i.objectID}),o.setItem(a)},getAll:function(){return a}}}var va=["facetName","facetQuery"];function ya(e){var t,n="algoliasearch-client-js-".concat(e.key),r=function(){return t===void 0&&(t=e.localStorage||window.localStorage),t},o=function(){return JSON.parse(r().getItem(n)||"{}")};return{get:function(a,i){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){var s=JSON.stringify(a),l=o()[s];return Promise.all([l||i(),l!==void 0])}).then(function(s){var l=Fe(s,2),c=l[0],d=l[1];return Promise.all([c,d||u.miss(c)])}).then(function(s){return Fe(s,1)[0]})},set:function(a,i){return Promise.resolve().then(function(){var u=o();return u[JSON.stringify(a)]=i,r().setItem(n,JSON.stringify(u)),i})},delete:function(a){return Promise.resolve().then(function(){var i=o();delete i[JSON.stringify(a)],r().setItem(n,JSON.stringify(i))})},clear:function(){return Promise.resolve().then(function(){r().removeItem(n)})}}}function ye(e){var t=Be(e.caches),n=t.shift();return n===void 0?{get:function(r,o){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return o().then(function(i){return Promise.all([i,a.miss(i)])}).then(function(i){return Fe(i,1)[0]})},set:function(r,o){return Promise.resolve(o)},delete:function(r){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(r,o){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(r,o,a).catch(function(){return ye({caches:t}).get(r,o,a)})},set:function(r,o){return n.set(r,o).catch(function(){return ye({caches:t}).set(r,o)})},delete:function(r){return n.delete(r).catch(function(){return ye({caches:t}).delete(r)})},clear:function(){return n.clear().catch(function(){return ye({caches:t}).clear()})}}}function it(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},t={};return{get:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(n);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var i=r(),u=o&&o.miss||function(){return Promise.resolve()};return i.then(function(s){return u(s)}).then(function(){return i})},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(n){return delete t[JSON.stringify(n)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function _a(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}function cr(e,t){return t&&Object.keys(t).forEach(function(n){e[n]=t[n](e)}),e}function Qe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0?r:void 0,timeout:n.timeout||t,headers:n.headers||{},queryParameters:n.queryParameters||{},cacheable:n.cacheable}}var ie={Read:1,Write:2,Any:3},ur=1,ga=2,lr=3;function sr(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ur;return P(P({},e),{},{status:t,lastUpdate:Date.now()})}function fr(e){return typeof e=="string"?{protocol:"https",url:e,accept:ie.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||ie.Any}}var kn="GET",Ye="POST";function ba(e,t){return Promise.all(t.map(function(n){return e.get(n,function(){return Promise.resolve(sr(n))})})).then(function(n){var r=n.filter(function(i){return function(u){return u.status===ur||Date.now()-u.lastUpdate>12e4}(i)}),o=n.filter(function(i){return function(u){return u.status===lr&&Date.now()-u.lastUpdate<=12e4}(i)}),a=[].concat(Be(r),Be(o));return{getTimeout:function(i,u){return(o.length===0&&i===0?1:o.length+3+i)*u},statelessHosts:a.length>0?a.map(function(i){return fr(i)}):t}})}function Cn(e,t,n,r){var o=[],a=function(m,p){if(!(m.method===kn||m.data===void 0&&p.data===void 0)){var v=Array.isArray(m.data)?m.data:P(P({},m.data),p.data);return JSON.stringify(v)}}(n,r),i=function(m,p){var v=P(P({},m.headers),p.headers),h={};return Object.keys(v).forEach(function(y){var _=v[y];h[y.toLowerCase()]=_}),h}(e,r),u=n.method,s=n.method!==kn?{}:P(P({},n.data),r.data),l=P(P(P({"x-algolia-agent":e.userAgent.value},e.queryParameters),s),r.queryParameters),c=0,d=function m(p,v){var h=p.pop();if(h===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:Dn(o)};var y={data:a,headers:i,method:u,url:Sa(h,n.path,l),connectTimeout:v(c,e.timeouts.connect),responseTimeout:v(c,r.timeout)},_=function(b){var O={request:y,response:b,host:h,triesLeft:p.length};return o.push(O),O},g={onSucess:function(b){return function(O){try{return JSON.parse(O.content)}catch(S){throw function(I,D){return{name:"DeserializationError",message:I,response:D}}(S.message,O)}}(b)},onRetry:function(b){var O=_(b);return b.isTimedOut&&c++,Promise.all([e.logger.info("Retryable failure",mr(O)),e.hostsCache.set(h,sr(h,b.isTimedOut?lr:ga))]).then(function(){return m(p,v)})},onFail:function(b){throw _(b),function(O,S){var I=O.content,D=O.status,A=I;try{A=JSON.parse(I).message}catch{}return function(k,N,R){return{name:"ApiError",message:k,status:N,transporterStackTrace:R}}(A,D,S)}(b,Dn(o))}};return e.requester.send(y).then(function(b){return function(O,S){return function(I){var D=I.status;return I.isTimedOut||function(A){var k=A.isTimedOut,N=A.status;return!k&&~~N==0}(I)||~~(D/100)!=2&&~~(D/100)!=4}(O)?S.onRetry(O):~~(O.status/100)==2?S.onSucess(O):S.onFail(O)}(b,g)})};return ba(e.hostsCache,t).then(function(m){return d(Be(m.statelessHosts).reverse(),m.getTimeout)})}function Oa(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(n){var r="; ".concat(n.segment).concat(n.version!==void 0?" (".concat(n.version,")"):"");return t.value.indexOf(r)===-1&&(t.value="".concat(t.value).concat(r)),t}};return t}function Sa(e,t,n){var r=pr(n),o="".concat(e.protocol,"://").concat(e.url,"/").concat(t.charAt(0)==="/"?t.substr(1):t);return r.length&&(o+="?".concat(r)),o}function pr(e){return Object.keys(e).map(function(t){return Qe("%s=%s",t,(n=e[t],Object.prototype.toString.call(n)==="[object Object]"||Object.prototype.toString.call(n)==="[object Array]"?JSON.stringify(e[t]):e[t]));var n}).join("&")}function Dn(e){return e.map(function(t){return mr(t)})}function mr(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return P(P({},e),{},{request:P(P({},e.request),{},{headers:P(P({},e.request.headers),t)})})}var Ea=function(e){var t=e.appId,n=function(a,i,u){var s={"x-algolia-api-key":u,"x-algolia-application-id":i};return{headers:function(){return a===Ue.WithinHeaders?s:{}},queryParameters:function(){return a===Ue.WithinQueryParameters?s:{}}}}(e.authMode!==void 0?e.authMode:Ue.WithinHeaders,t,e.apiKey),r=function(a){var i=a.hostsCache,u=a.logger,s=a.requester,l=a.requestsCache,c=a.responsesCache,d=a.timeouts,m=a.userAgent,p=a.hosts,v=a.queryParameters,h={hostsCache:i,logger:u,requester:s,requestsCache:l,responsesCache:c,timeouts:d,userAgent:m,headers:a.headers,queryParameters:v,hosts:p.map(function(y){return fr(y)}),read:function(y,_){var g=In(_,h.timeouts.read),b=function(){return Cn(h,h.hosts.filter(function(S){return(S.accept&ie.Read)!=0}),y,g)};if((g.cacheable!==void 0?g.cacheable:y.cacheable)!==!0)return b();var O={request:y,mappedRequestOptions:g,transporter:{queryParameters:h.queryParameters,headers:h.headers}};return h.responsesCache.get(O,function(){return h.requestsCache.get(O,function(){return h.requestsCache.set(O,b()).then(function(S){return Promise.all([h.requestsCache.delete(O),S])},function(S){return Promise.all([h.requestsCache.delete(O),Promise.reject(S)])}).then(function(S){var I=Fe(S,2);return I[0],I[1]})})},{miss:function(S){return h.responsesCache.set(O,S)}})},write:function(y,_){return Cn(h,h.hosts.filter(function(g){return(g.accept&ie.Write)!=0}),y,In(_,h.timeouts.write))}};return h}(P(P({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:ie.Read},{url:"".concat(t,".algolia.net"),accept:ie.Write}].concat(_a([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:P(P(P({},n.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:P(P({},n.queryParameters()),e.queryParameters)})),o={transporter:r,appId:t,addAlgoliaAgent:function(a,i){r.userAgent.add({segment:a,version:i})},clearCache:function(){return Promise.all([r.requestsCache.clear(),r.responsesCache.clear()]).then(function(){})}};return cr(o,e.methods)},dr=function(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={transporter:e.transporter,appId:e.appId,indexName:t};return cr(r,n.methods)}},xn=function(e){return function(t,n){var r=t.map(function(o){return P(P({},o),{},{params:pr(o.params||{})})});return e.transporter.read({method:Ye,path:"1/indexes/*/queries",data:{requests:r},cacheable:!0},n)}},An=function(e){return function(t,n){return Promise.all(t.map(function(r){var o=r.params,a=o.facetName,i=o.facetQuery,u=xr(o,va);return dr(e)(r.indexName,{methods:{searchForFacetValues:hr}}).searchForFacetValues(a,i,P(P({},n),u))}))}},wa=function(e){return function(t,n,r){return e.transporter.read({method:Ye,path:Qe("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:n},cacheable:!0},r)}},ja=function(e){return function(t,n){return e.transporter.read({method:Ye,path:Qe("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},n)}},hr=function(e){return function(t,n,r){return e.transporter.read({method:Ye,path:Qe("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:n},cacheable:!0},r)}},Pa=1,Ia=2,ka=3;function vr(e,t,n){var r,o={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(a){return new Promise(function(i){var u=new XMLHttpRequest;u.open(a.method,a.url,!0),Object.keys(a.headers).forEach(function(d){return u.setRequestHeader(d,a.headers[d])});var s,l=function(d,m){return setTimeout(function(){u.abort(),i({status:0,content:m,isTimedOut:!0})},1e3*d)},c=l(a.connectTimeout,"Connection timeout");u.onreadystatechange=function(){u.readyState>u.OPENED&&s===void 0&&(clearTimeout(c),s=l(a.responseTimeout,"Socket timeout"))},u.onerror=function(){u.status===0&&(clearTimeout(c),clearTimeout(s),i({content:u.responseText||"Network request failed",status:u.status,isTimedOut:!1}))},u.onload=function(){clearTimeout(c),clearTimeout(s),i({content:u.responseText,status:u.status,isTimedOut:!1})},u.send(a.data)})}},logger:(r=ka,{debug:function(a,i){return Pa>=r&&console.debug(a,i),Promise.resolve()},info:function(a,i){return Ia>=r&&console.info(a,i),Promise.resolve()},error:function(a,i){return console.error(a,i),Promise.resolve()}}),responsesCache:it(),requestsCache:it({serializable:!1}),hostsCache:ye({caches:[ya({key:"".concat("4.8.5","-").concat(e)}),it()]}),userAgent:Oa("4.8.5").add({segment:"Browser",version:"lite"}),authMode:Ue.WithinQueryParameters};return Ea(P(P(P({},o),n),{},{methods:{search:xn,searchForFacetValues:An,multipleQueries:xn,multipleSearchForFacetValues:An,initIndex:function(a){return function(i){return dr(a)(i,{methods:{search:ja,searchForFacetValues:hr,findAnswers:wa}})}}}}))}vr.version="4.8.5";var Ca=["footer","searchBox"];function be(){return be=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(c[s]=i[s]);return c}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Na(e){var t=e.appId,n=e.apiKey,r=e.indexName,o=e.placeholder,a=o===void 0?"Search docs":o,i=e.searchParameters,u=e.onClose,s=u===void 0?ta:u,l=e.transformItems,c=l===void 0?jn:l,d=e.hitComponent,m=d===void 0?Lo:d,p=e.resultsFooterComponent,v=p===void 0?function(){return null}:p,h=e.navigator,y=e.initialScrollY,_=y===void 0?0:y,g=e.transformSearchClient,b=g===void 0?jn:g,O=e.disableUserPersonalization,S=O!==void 0&&O,I=e.initialQuery,D=I===void 0?"":I,A=e.translations,k=A===void 0?{}:A,N=e.getMissingResultsUrl,R=k.footer,Ge=k.searchBox,Ze=Aa(k,Ca),Pe=xa(f.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),W=Pe[0],yr=Pe[1],wt=f.useRef(null),Xe=f.useRef(null),jt=f.useRef(null),Ie=f.useRef(null),ue=f.useRef(null),J=f.useRef(10),Pt=f.useRef(typeof window!="undefined"?window.getSelection().toString().slice(0,64):"").current,Y=f.useRef(D||Pt).current,It=function(j,C,q){return f.useMemo(function(){var M=vr(j,C);return M.addAlgoliaAgent("docsearch","3.0.0"),/docsearch.js \(.*\)/.test(M.transporter.userAgent.value)===!1&&M.addAlgoliaAgent("docsearch-react","3.0.0"),q(M)},[j,C,q])}(t,n,b),X=f.useRef(Pn({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(r),limit:10})).current,le=f.useRef(Pn({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(r),limit:X.getAll().length===0?7:4})).current,se=f.useCallback(function(j){if(!S){var C=j.type==="content"?j.__docsearch_parent:j;C&&X.getAll().findIndex(function(q){return q.objectID===C.objectID})===-1&&le.add(C)}},[X,le,S]),fe=f.useMemo(function(){return No({id:"docsearch",defaultActiveItemId:0,placeholder:a,openOnFocus:!0,initialState:{query:Y,context:{searchSuggestions:[]}},navigator:h,onStateChange:function(j){yr(j.state)},getSources:function(j){var C=j.query,q=j.state,M=j.setContext,$=j.setStatus;return C?It.search([{query:C,indexName:r,params:ct({attributesToRetrieve:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:["hierarchy.lvl1:".concat(J.current),"hierarchy.lvl2:".concat(J.current),"hierarchy.lvl3:".concat(J.current),"hierarchy.lvl4:".concat(J.current),"hierarchy.lvl5:".concat(J.current),"hierarchy.lvl6:".concat(J.current),"content:".concat(J.current)],snippetEllipsisText:"\u2026",highlightPreTag:"",highlightPostTag:"",hitsPerPage:20},i)}]).catch(function(x){throw x.name==="RetryError"&&$("error"),x}).then(function(x){var H=x.results[0],U=H.hits,br=H.nbHits,et=wn(U,function(tt){return ir(tt)});return q.context.searchSuggestions.length0&&(kt(),ue.current&&ue.current.focus())},[Y,kt]),f.useEffect(function(){function j(){if(Xe.current){var C=.01*window.innerHeight;Xe.current.style.setProperty("--docsearch-vh","".concat(C,"px"))}}return j(),window.addEventListener("resize",j),function(){window.removeEventListener("resize",j)}},[]),f.createElement("div",be({ref:wt},gr({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container",W.status==="stalled"&&"DocSearch-Container--Stalled",W.status==="error"&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),role:"button",tabIndex:0,onMouseDown:function(j){j.target===j.currentTarget&&s()}}),f.createElement("div",{className:"DocSearch-Modal",ref:Xe},f.createElement("header",{className:"DocSearch-SearchBar",ref:jt},f.createElement(pa,be({},fe,{state:W,autoFocus:Y.length===0,inputRef:ue,isFromSelection:Boolean(Y)&&Y===Pt,translations:Ge,onClose:s}))),f.createElement("div",{className:"DocSearch-Dropdown",ref:Ie},f.createElement(la,be({},fe,{indexName:r,state:W,hitComponent:m,resultsFooterComponent:v,disableUserPersonalization:S,recentSearches:le,favoriteSearches:X,inputRef:ue,translations:Ze,getMissingResultsUrl:N,onItemClick:function(j){se(j),s()}}))),f.createElement("footer",{className:"DocSearch-Footer"},f.createElement(To,{translations:R}))))}function bt(){return bt=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:window;return typeof t=="string"?n.document.querySelector(t):t}(e.container,e.environment))}const La={class:"algolia-search-box",id:"docsearch"},Ma=Sr({props:{options:null,multilang:{type:Boolean}},setup(e){var d;const t=e,n=Cr(),r=Er(),o=wr();Ct(()=>t.options,m=>{u(m)}),jr(()=>{c(t.options)});function a(m){return m.button===1||m.altKey||m.ctrlKey||m.metaKey||m.shiftKey}function i(m){const{pathname:p,hash:v}=new URL(m);return p+v}function u(m){n&&n.vnode.el&&(n.vnode.el.innerHTML='',c(m))}const{lang:s}=Pr(),l=t.multilang?["lang:"+s.value]:[];(d=t.options.searchParameters)!=null&&d.facetFilters&&l.push(...t.options.searchParameters.facetFilters),Ct(s,(m,p)=>{const v=l.findIndex(h=>h==="lang:"+p);v>-1&&l.splice(v,1,"lang:"+m)});function c(m){Ta(Object.assign({},m,{container:"#docsearch",searchParameters:Object.assign({},m.searchParameters,{facetFilters:l}),navigator:{navigate:({itemUrl:p})=>{const{pathname:v}=new URL(window.location.origin+p);r.path===v?window.location.assign(window.location.origin+p):o.go(p)}},transformItems:p=>p.map(v=>Object.assign({},v,{url:i(v.url)})),hitComponent:({hit:p,children:v})=>{const h=p.url.startsWith("http")?i(p.url):p.url;return{type:"a",ref:void 0,constructor:void 0,key:void 0,props:{href:p.url,onClick:y=>{a(y)||r.path!==h&&(r.path!==h&&y.preventDefault(),o.go(h))},children:v},__v:null}}}))}return(m,p)=>(Ir(),kr("div",La))}});export{Ma as default}; diff --git a/docs/.vitepress/dist/assets/developer_index.md.5ec90a44.js b/docs/.vitepress/dist/assets/developer_index.md.5ec90a44.js new file mode 100644 index 0000000000..f27439ae98 --- /dev/null +++ b/docs/.vitepress/dist/assets/developer_index.md.5ec90a44.js @@ -0,0 +1 @@ +import{_ as o,c as r,o as a,b as e,d as t}from"./app.8fc4a373.js";const f='{"title":"Home","description":"","frontmatter":{"home":true,"heroImage":"https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png","heroText":"\u5F00\u53D1\u624B\u518C","tagline":"\u6B22\u8FCE\u4F7F\u7528\u4E00\u952E\u865A\u62DF\u5316\u9879\u76EE\u5F00\u53D1\u624B\u518C\uFF0C\u6B22\u8FCE\u4F60\u63D0\u51FA\u9AD8\u8D28\u91CF\u7684Pull Request\uFF0C\u5E2E\u52A9\u4E00\u952E\u865A\u62DF\u5316\u9879\u76EE\u53D8\u5F97\u66F4\u597D\uFF01","actionText":"\u5F00\u59CB\u4F7F\u7528 \u2192","actionLink":"/developer/l10n","footer":"Copyright \xA9 2023-present oneclickvirt"},"headers":[],"relativePath":"developer/index.md","lastUpdated":1687182420000}',n={},s=e("p",null,[e("br"),t("\u672C\u4F5C\u54C1\u91C7\u7528 "),e("a",{rel:"license",href:"http://creativecommons.org/licenses/by-nc-sa/4.0/"},"\u77E5\u8BC6\u5171\u4EAB\u7F72\u540D-\u975E\u5546\u4E1A\u6027\u4F7F\u7528-\u76F8\u540C\u65B9\u5F0F\u5171\u4EAB 4.0 \u56FD\u9645\u8BB8\u53EF\u534F\u8BAE"),t(" \u8FDB\u884C\u8BB8\u53EF\u3002")],-1),c=[s];function i(l,p,d,_,h,m){return a(),r("div",null,c)}var g=o(n,[["render",i]]);export{f as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/developer_index.md.5ec90a44.lean.js b/docs/.vitepress/dist/assets/developer_index.md.5ec90a44.lean.js new file mode 100644 index 0000000000..f27439ae98 --- /dev/null +++ b/docs/.vitepress/dist/assets/developer_index.md.5ec90a44.lean.js @@ -0,0 +1 @@ +import{_ as o,c as r,o as a,b as e,d as t}from"./app.8fc4a373.js";const f='{"title":"Home","description":"","frontmatter":{"home":true,"heroImage":"https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png","heroText":"\u5F00\u53D1\u624B\u518C","tagline":"\u6B22\u8FCE\u4F7F\u7528\u4E00\u952E\u865A\u62DF\u5316\u9879\u76EE\u5F00\u53D1\u624B\u518C\uFF0C\u6B22\u8FCE\u4F60\u63D0\u51FA\u9AD8\u8D28\u91CF\u7684Pull Request\uFF0C\u5E2E\u52A9\u4E00\u952E\u865A\u62DF\u5316\u9879\u76EE\u53D8\u5F97\u66F4\u597D\uFF01","actionText":"\u5F00\u59CB\u4F7F\u7528 \u2192","actionLink":"/developer/l10n","footer":"Copyright \xA9 2023-present oneclickvirt"},"headers":[],"relativePath":"developer/index.md","lastUpdated":1687182420000}',n={},s=e("p",null,[e("br"),t("\u672C\u4F5C\u54C1\u91C7\u7528 "),e("a",{rel:"license",href:"http://creativecommons.org/licenses/by-nc-sa/4.0/"},"\u77E5\u8BC6\u5171\u4EAB\u7F72\u540D-\u975E\u5546\u4E1A\u6027\u4F7F\u7528-\u76F8\u540C\u65B9\u5F0F\u5171\u4EAB 4.0 \u56FD\u9645\u8BB8\u53EF\u534F\u8BAE"),t(" \u8FDB\u884C\u8BB8\u53EF\u3002")],-1),c=[s];function i(l,p,d,_,h,m){return a(),r("div",null,c)}var g=o(n,[["render",i]]);export{f as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/developer_l10n.md.df111cbe.js b/docs/.vitepress/dist/assets/developer_l10n.md.df111cbe.js new file mode 100644 index 0000000000..c8b49f1fd8 --- /dev/null +++ b/docs/.vitepress/dist/assets/developer_l10n.md.df111cbe.js @@ -0,0 +1 @@ +import{_ as e,c as t,o,a as l}from"./app.8fc4a373.js";const f='{"title":"\u4ECB\u7ECD","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u4ECB\u7ECD","slug":"\u4ECB\u7ECD"},{"level":2,"title":"\u65B0\u672C\u5730\u5316\u6587\u672C\u7684\u6DFB\u52A0","slug":"\u65B0\u672C\u5730\u5316\u6587\u672C\u7684\u6DFB\u52A0"}],"relativePath":"developer/l10n.md","lastUpdated":1687182420000}',a={},r=l('

\u4F60\u53EF\u4EE5\u5728\u5F00\u53D1\u65B0\u529F\u80FD\u65F6\u9075\u5FAA\u4EE5\u4E0B\u6B65\u9AA4\u6765\u652F\u6301\u672C\u5730\u5316

\u4ECB\u7ECD

  1. \u4F60\u53EF\u4EE5\u76F4\u63A5\u4F7F\u7528 /resource/l10n/zh-CN.toml \u4E2D\u5DF2\u6709\u7684\u6587\u672C\u914D\u7F6E\u6765\u66FF\u6362\u65B0\u529F\u80FD\u4E2D\u7684\u6587\u672C
  2. \u5982\u679C\u65B0\u529F\u80FD\u4E2D\u6709\u65B0\u589E\u6587\u672C\uFF0C\u8BF7\u53C2\u8003 zh-CN.toml \u7684\u914D\u7F6E\u6587\u672C\uFF0C\u5C06\u65B0\u6587\u672C\u62C9\u53D6\u5230 zh-CN.toml \u7B49\u5176\u4ED6\u8BED\u8A00\u7684\u914D\u7F6E\u6587\u4EF6\u4E2D\uFF0C\u5E76\u6DFB\u52A0\u7FFB\u8BD1

\u65B0\u672C\u5730\u5316\u6587\u672C\u7684\u6DFB\u52A0

  1. \u5728 /resource/l10n/ \u4E2D\u6DFB\u52A0\u65B0\u7684\u8BED\u8A00\u6587\u672C\u914D\u7F6E
  2. \u5728\u65B0\u7684\u8BED\u8A00\u6587\u672C\u914D\u7F6E\u4E2D\u62C9\u53D6\u5176\u4ED6\u8BED\u8A00\u5DF2\u6709\u7684\u6587\u672C\u914D\u7F6E
  3. \u4E3A\u65B0\u7684\u8BED\u8A00\u6587\u672C\u914D\u7F6E\u6DFB\u52A0\u7FFB\u8BD1
',5),c=[r];function d(i,s,n,_,h,p){return o(),t("div",null,c)}var m=e(a,[["render",d]]);export{f as __pageData,m as default}; diff --git a/docs/.vitepress/dist/assets/developer_l10n.md.df111cbe.lean.js b/docs/.vitepress/dist/assets/developer_l10n.md.df111cbe.lean.js new file mode 100644 index 0000000000..9fd57901ba --- /dev/null +++ b/docs/.vitepress/dist/assets/developer_l10n.md.df111cbe.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o,a as l}from"./app.8fc4a373.js";const f='{"title":"\u4ECB\u7ECD","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u4ECB\u7ECD","slug":"\u4ECB\u7ECD"},{"level":2,"title":"\u65B0\u672C\u5730\u5316\u6587\u672C\u7684\u6DFB\u52A0","slug":"\u65B0\u672C\u5730\u5316\u6587\u672C\u7684\u6DFB\u52A0"}],"relativePath":"developer/l10n.md","lastUpdated":1687182420000}',a={},r=l("",5),c=[r];function d(i,s,n,_,h,p){return o(),t("div",null,c)}var m=e(a,[["render",d]]);export{f as __pageData,m as default}; diff --git a/docs/.vitepress/dist/assets/en_US_developer_index.md.cf040c9e.js b/docs/.vitepress/dist/assets/en_US_developer_index.md.cf040c9e.js new file mode 100644 index 0000000000..bb88681e59 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_developer_index.md.cf040c9e.js @@ -0,0 +1 @@ +import{_ as o,c as n,o as a,b as e,d as t}from"./app.8fc4a373.js";const g='{"title":"Home","description":"","frontmatter":{"home":true,"heroImage":"https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png","heroText":"Development Manual","tagline":"Welcome to the Nezha Monitoring Development Manual.","actionText":"Start Now \u2192","actionLink":"/en_US/developer/l10n","footer":"Copyright \xA9 2023-present oneclickvirt"},"headers":[],"relativePath":"en_US/developer/index.md","lastUpdated":1687182420000}',r={},i=e("p",null,[e("br"),t("This work is licensed under a "),e("a",{rel:"license",href:"http://creativecommons.org/licenses/by-nc-sa/4.0/"},"Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License"),t(".")],-1),s=[i];function c(l,p,d,m,h,_){return a(),n("div",null,s)}var v=o(r,[["render",c]]);export{g as __pageData,v as default}; diff --git a/docs/.vitepress/dist/assets/en_US_developer_index.md.cf040c9e.lean.js b/docs/.vitepress/dist/assets/en_US_developer_index.md.cf040c9e.lean.js new file mode 100644 index 0000000000..bb88681e59 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_developer_index.md.cf040c9e.lean.js @@ -0,0 +1 @@ +import{_ as o,c as n,o as a,b as e,d as t}from"./app.8fc4a373.js";const g='{"title":"Home","description":"","frontmatter":{"home":true,"heroImage":"https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png","heroText":"Development Manual","tagline":"Welcome to the Nezha Monitoring Development Manual.","actionText":"Start Now \u2192","actionLink":"/en_US/developer/l10n","footer":"Copyright \xA9 2023-present oneclickvirt"},"headers":[],"relativePath":"en_US/developer/index.md","lastUpdated":1687182420000}',r={},i=e("p",null,[e("br"),t("This work is licensed under a "),e("a",{rel:"license",href:"http://creativecommons.org/licenses/by-nc-sa/4.0/"},"Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License"),t(".")],-1),s=[i];function c(l,p,d,m,h,_){return a(),n("div",null,s)}var v=o(r,[["render",c]]);export{g as __pageData,v as default}; diff --git a/docs/.vitepress/dist/assets/en_US_developer_l10n.md.a6235dd5.js b/docs/.vitepress/dist/assets/en_US_developer_l10n.md.a6235dd5.js new file mode 100644 index 0000000000..4b995fcaa0 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_developer_l10n.md.a6235dd5.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as n,a as o}from"./app.8fc4a373.js";const _='{"title":"Introduction","description":"","frontmatter":{},"headers":[{"level":2,"title":"Introduction","slug":"introduction"},{"level":2,"title":"Adding a new localized text file","slug":"adding-a-new-localized-text-file"}],"relativePath":"en_US/developer/l10n.md","lastUpdated":1687182420000}',a={},i=o('

You can follow these steps to support localization when developing new features

Introduction

  1. You can directly use the text configuration already available in /resource/l10n/en-US.toml to replace the text in the new feature.
  2. If there is new text in the new feature, please refer to the configuration text in en-US.toml, pull the new text into the configuration files of other languages such as en-US.toml, and add translations.

Adding a new localized text file

  1. Add a new language text configuration in /resource/l10n/.
  2. Pull existing text configurations from other languages in the new language text configuration.
  3. Add translations for the new language text configuration.
',5),l=[i];function r(d,c,s,u,h,f){return n(),t("div",null,l)}var p=e(a,[["render",r]]);export{_ as __pageData,p as default}; diff --git a/docs/.vitepress/dist/assets/en_US_developer_l10n.md.a6235dd5.lean.js b/docs/.vitepress/dist/assets/en_US_developer_l10n.md.a6235dd5.lean.js new file mode 100644 index 0000000000..c35610c536 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_developer_l10n.md.a6235dd5.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as n,a as o}from"./app.8fc4a373.js";const _='{"title":"Introduction","description":"","frontmatter":{},"headers":[{"level":2,"title":"Introduction","slug":"introduction"},{"level":2,"title":"Adding a new localized text file","slug":"adding-a-new-localized-text-file"}],"relativePath":"en_US/developer/l10n.md","lastUpdated":1687182420000}',a={},i=o("",5),l=[i];function r(d,c,s,u,h,f){return n(),t("div",null,l)}var p=e(a,[["render",r]]);export{_ as __pageData,p as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_dashboard.md.94484359.js b/docs/.vitepress/dist/assets/en_US_guide_dashboard.md.94484359.js new file mode 100644 index 0000000000..b979d6ac40 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_dashboard.md.94484359.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a,a as r}from"./app.8fc4a373.js";const b='{"title":"\u51C6\u5907\u5DE5\u4F5C","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u9879\u76EE\u4ED3\u5E93","slug":"\u9879\u76EE\u4ED3\u5E93"},{"level":3,"title":"PVE\u76F8\u5173\u7684\u5404\u79CD\u4E00\u952E\u811A\u672C","slug":"pve\u76F8\u5173\u7684\u5404\u79CD\u4E00\u952E\u811A\u672C"},{"level":3,"title":"\u901A\u8FC7LXD/LXC\u547D\u4EE4\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBENAT\u670D\u52A1\u5668\u4EE5\u53CA\u7EF4\u62A4","slug":"\u901A\u8FC7lxd-lxc\u547D\u4EE4\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBEnat\u670D\u52A1\u5668\u4EE5\u53CA\u7EF4\u62A4"},{"level":3,"title":"\u901A\u8FC7docker\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBENAT\u670D\u52A1\u5668","slug":"\u901A\u8FC7docker\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBEnat\u670D\u52A1\u5668"}],"relativePath":"en_US/guide/dashboard.md","lastUpdated":1687182420000}',i={},s=r('

\u51C6\u5907\u5DE5\u4F5C

\u9700\u8981\u865A\u62DF\u5316\u51FA\u670D\u52A1\u5668\uFF0C\u4F60\u9700\u8981\uFF1A

  1. \u4E00\u53F0\u53EF\u4EE5\u8FDE\u63A5\u516C\u7F51\u7684\u670D\u52A1\u5668( VPS \u6216 Dedicated Server)\uFF0C\u6700\u597D\u80FD\u5B8C\u7F8E\u8BBF\u95EE Github \u7684 RAW \u9875\u9762\uFF0C\u90E8\u5206\u9879\u76EE\u90E8\u5206\u7EC4\u4EF6\u53EF\u80FD\u672A\u4F7F\u7528 CDN \u52A0\u901F

TIP

\u5982\u679C\u60A8\u4F4D\u4E8E\u4E2D\u56FD\u5927\u9646\uFF0C\u8BBF\u95EE Github \u6709\u56F0\u96BE\uFF0C\u8BF7\u6CE8\u610F\u914D\u5957\u811A\u672C\u548C\u9879\u76EE\u662F\u5426\u6709\u8BF4\u660E\u5DF2\u4F7F\u7528 CDN \u52A0\u901F

  1. \u672C\u5730\u53EF\u4EE5\u7A33\u5B9A\u8FDE\u63A5SSH\uFF0C\u5982\u679C\u4E0D\u80FD\u7A33\u5B9A\u8FDE\u63A5\uFF0C\u8BF7\u4F7F\u7528screen\u547D\u4EE4\u521B\u5EFA\u7A97\u53E3\u540E\uFF0C\u5728\u7A97\u53E3\u5185\u6267\u884C\u547D\u4EE4

TIP

\u4E0D\u4F1A\u7528screen\u547D\u4EE4\u7684\uFF0C\u81EA\u884C\u67E5\u627E\u76F8\u5173\u6559\u7A0B\u5B66\u4E60

  1. \u786E\u4FDD\u670D\u52A1\u5668\u7684\u7CFB\u7EDF\u548C\u786C\u4EF6\u6EE1\u8DB3\u5BF9\u5E94\u9879\u76EE\u7684\u8981\u6C42\uFF0C\u8BE6\u89C1\u5BF9\u5E94\u9879\u76EE\u8BF4\u660E

\u672C\u6587\u6863\u5C06\u4EE5VPS\u4F5C\u4E3A\u8303\u4F8B\uFF0C\u4E14\u8BE5VPS\u7EAF\u51C0\uFF0C\u65E0\u539F\u751F\u73AF\u5883\u95EE\u9898\uFF0C\u5982\u6709\u5FC5\u8981\u8BF7\u91CD\u88C5\u7CFB\u7EDF\u4FDD\u8BC1\u521D\u59CB\u73AF\u5883\u7684\u7EAF\u51C0

WARNING

PVE\u9879\u76EE\u53EF\u80FD\u9020\u6210\u5BBF\u4E3B\u673A\u51FA\u73B0\u95EE\u9898\uFF0C\u5982\u679C\u4F60\u4E0D\u4F1A\u770BBug\u548C\u4FEE\u590D\u7CFB\u7EDF\uFF0C\u90A3\u4E48\u4E0D\u5EFA\u8BAE\u4F60\u5728\u751F\u4EA7\u73AF\u5883\u4E2D\u4F7F\u7528\uFF0C\u4F7F\u7528PVE\u76F8\u5173\u811A\u672C\u8BF7\u786E\u4FDD\u5BBF\u4E3B\u673A\u968F\u65F6\u53EF\u91CD\u88C5\u7CFB\u7EDF

\u9879\u76EE\u4ED3\u5E93

\u6B22\u8FCEStar\u548CFork\uFF0C\u5982\u6709\u95EE\u9898\uFF0C\u5BF9\u5E94\u4ED3\u5E93\u7684issues\u63D0\u51FA\uFF0C\u6709\u7A7A\u4F1A\u770B\u770B\u4E0E\u89E3\u51B3\uFF0C\u5F53\u7136\u4EC5\u9650\u811A\u672C\u76F8\u5173\u95EE\u9898

PVE\u76F8\u5173\u7684\u5404\u79CD\u4E00\u952E\u811A\u672C

https://github.com/spiritLHLS/pve

\u901A\u8FC7LXD/LXC\u547D\u4EE4\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBENAT\u670D\u52A1\u5668\u4EE5\u53CA\u7EF4\u62A4

https://github.com/spiritLHLS/lxc

\u901A\u8FC7docker\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBENAT\u670D\u52A1\u5668

https://github.com/spiritLHLS/docker



',19),o=[s];function l(c,d,p,n,h,u){return a(),t("div",null,o)}var g=e(i,[["render",l]]);export{b as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_dashboard.md.94484359.lean.js b/docs/.vitepress/dist/assets/en_US_guide_dashboard.md.94484359.lean.js new file mode 100644 index 0000000000..561377c93d --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_dashboard.md.94484359.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a,a as r}from"./app.8fc4a373.js";const b='{"title":"\u51C6\u5907\u5DE5\u4F5C","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u9879\u76EE\u4ED3\u5E93","slug":"\u9879\u76EE\u4ED3\u5E93"},{"level":3,"title":"PVE\u76F8\u5173\u7684\u5404\u79CD\u4E00\u952E\u811A\u672C","slug":"pve\u76F8\u5173\u7684\u5404\u79CD\u4E00\u952E\u811A\u672C"},{"level":3,"title":"\u901A\u8FC7LXD/LXC\u547D\u4EE4\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBENAT\u670D\u52A1\u5668\u4EE5\u53CA\u7EF4\u62A4","slug":"\u901A\u8FC7lxd-lxc\u547D\u4EE4\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBEnat\u670D\u52A1\u5668\u4EE5\u53CA\u7EF4\u62A4"},{"level":3,"title":"\u901A\u8FC7docker\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBENAT\u670D\u52A1\u5668","slug":"\u901A\u8FC7docker\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBEnat\u670D\u52A1\u5668"}],"relativePath":"en_US/guide/dashboard.md","lastUpdated":1687182420000}',i={},s=r("",19),o=[s];function l(c,d,p,n,h,u){return a(),t("div",null,o)}var g=e(i,[["render",l]]);export{b as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_dashboardq.md.00431e49.js b/docs/.vitepress/dist/assets/en_US_guide_dashboardq.md.00431e49.js new file mode 100644 index 0000000000..bd60da3bbd --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_dashboardq.md.00431e49.js @@ -0,0 +1,2 @@ +import{_ as t,c as o,o as a,b as e}from"./app.8fc4a373.js";const k='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/guide/dashboardq.md","lastUpdated":1687182420000}',s={},n=e("p",null,"Give me a cup of coffee.",-1),r=e("p",null,[e("a",{href:"https://ko-fi.com/spiritlhl",target:"_blank",rel:"noopener noreferrer"},"https://ko-fi.com/spiritlhl")],-1),c=e("p",null,"USDT-TRC20",-1),l=e("div",{class:"language-bash"},[e("pre",null,[e("code",null,`TZ7nf8XAL9zQUo63xokazaBdCPeCgPfcwd +`)])],-1),d=[n,r,c,l];function i(_,p,f,h,u,m){return a(),o("div",null,d)}var b=t(s,[["render",i]]);export{k as __pageData,b as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_dashboardq.md.00431e49.lean.js b/docs/.vitepress/dist/assets/en_US_guide_dashboardq.md.00431e49.lean.js new file mode 100644 index 0000000000..bd60da3bbd --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_dashboardq.md.00431e49.lean.js @@ -0,0 +1,2 @@ +import{_ as t,c as o,o as a,b as e}from"./app.8fc4a373.js";const k='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/guide/dashboardq.md","lastUpdated":1687182420000}',s={},n=e("p",null,"Give me a cup of coffee.",-1),r=e("p",null,[e("a",{href:"https://ko-fi.com/spiritlhl",target:"_blank",rel:"noopener noreferrer"},"https://ko-fi.com/spiritlhl")],-1),c=e("p",null,"USDT-TRC20",-1),l=e("div",{class:"language-bash"},[e("pre",null,[e("code",null,`TZ7nf8XAL9zQUo63xokazaBdCPeCgPfcwd +`)])],-1),d=[n,r,c,l];function i(_,p,f,h,u,m){return a(),o("div",null,d)}var b=t(s,[["render",i]]);export{k as __pageData,b as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_docker_build.md.f6eeb15c.js b/docs/.vitepress/dist/assets/en_US_guide_docker_build.md.f6eeb15c.js new file mode 100644 index 0000000000..e66ebafb81 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_docker_build.md.f6eeb15c.js @@ -0,0 +1,18 @@ +import{_ as s,c as e,o as a,a as n}from"./app.8fc4a373.js";const m='{"title":"Docker\u865A\u62DF\u5316","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u5355\u72EC\u5F00\u8BBE","slug":"\u5355\u72EC\u5F00\u8BBE"},{"level":2,"title":"\u793A\u4F8B","slug":"\u793A\u4F8B"},{"level":2,"title":"\u67E5\u8BE2\u4FE1\u606F","slug":"\u67E5\u8BE2\u4FE1\u606F"},{"level":2,"title":"\u6279\u91CF\u5F00\u8BBE","slug":"\u6279\u91CF\u5F00\u8BBE"},{"level":2,"title":"\u67E5\u8BE2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F","slug":"\u67E5\u8BE2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F"},{"level":2,"title":"\u5378\u8F7D\u6240\u6709docker\u5BB9\u5668\u548C\u955C\u50CF","slug":"\u5378\u8F7D\u6240\u6709docker\u5BB9\u5668\u548C\u955C\u50CF"}],"relativePath":"en_US/guide/docker_build.md","lastUpdated":1687182420000}',o={},c=n(`

Docker\u865A\u62DF\u5316

\u5355\u72EC\u5F00\u8BBE

\u4E0B\u8F7D\u811A\u672C

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/onedocker.sh -o onedocker.sh && chmod +x onedocker.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/onedocker.sh -o onedocker.sh && chmod +x onedocker.sh
+

\u8FD0\u884C

./onedocker.sh name cpu memory password sshport startport endport system
+

\u76EE\u524Dsystem\u4EC5\u652F\u6301\u9009\u62E9alpine\u6216debian\uFF0C\u9ED8\u8BA4\u662Fdebian

\u793A\u4F8B

  • \u4EE5\u4E0B\u4E3A\u5F00\u8BBE\u7684\u793A\u4F8B\u5BB9\u5668\u7684\u4FE1\u606F\uFF1A
    \u5BB9\u5668\u540D\u5B57 - test SSH\u767B\u5F55\u7684\u7528\u6237\u540D - root SSH\u767B\u5F55\u7684\u5BC6\u7801 - 123456 CPU\u6838\u6570 - 1
    \u5185\u5B58\u5927\u5C0F - 512MB SSH\u7AEF\u53E3 - 25000 \u5185\u5916\u7F51\u6620\u5C04\u7AEF\u53E3\u4E00\u81F4\u7684\u533A\u95F4 - 34975\u523035000 \u7CFB\u7EDF - debian
./onedocker.sh test 1 512 123456 25000 34975 35000 debian
+

\u5220\u9664\u793A\u4F8B

docker rm -f test
+rm -rf test
+ls
+

\u8FDB\u5165\u793A\u4F8B

docker exec -it test /bin/bash
+

\u8981\u9000\u51FA\u5BB9\u5668\u5C31\u6267\u884Cexit\u9000\u51FA\u3002

\u67E5\u8BE2\u4FE1\u606F

cat \u5BB9\u5668\u540D\u5B57
+

\u8F93\u51FA\u683C\u5F0F

\u5BB9\u5668\u540D\u5B57 SSH\u7AEF\u53E3 \u767B\u9646\u7684root\u5BC6\u7801 \u6838\u6570 \u5185\u5B58 \u5916\u7F51\u7AEF\u53E3\u8D77 \u5916\u7F51\u7AEF\u53E3\u6B62 
+

\u6279\u91CF\u5F00\u8BBE

  • \u6279\u91CF\u591A\u6B21\u8FD0\u884C\u7EE7\u627F\u914D\u7F6E\u751F\u6210
  • \u751F\u6210\u591A\u4E2A\u65F6\u4E3A\u907F\u514DSSH\u8FDE\u63A5\u4E2D\u65AD\u5EFA\u8BAE\u5728screen\u4E2D\u6267\u884C

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/dockers.sh -o dockers.sh && chmod +x dockers.sh && bash dockers.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/onedocker.sh -o onedocker.sh && chmod +x onedocker.sh
+

\u67E5\u8BE2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F

cat dclog
+

\u8F93\u51FA\u683C\u5F0F

\u5BB9\u5668\u540D\u5B57 SSH\u7AEF\u53E3 \u767B\u9646\u7684root\u5BC6\u7801 \u6838\u6570 \u5185\u5B58 \u5916\u7F51\u7AEF\u53E3\u8D77 \u5916\u7F51\u7AEF\u53E3\u6B62 
+

\u4E00\u884C\u4E00\u4E2A\u5BB9\u5668\u5BF9\u5E94\u7684\u4FE1\u606F

\u5378\u8F7D\u6240\u6709docker\u5BB9\u5668\u548C\u955C\u50CF

docker rm -f $(docker ps -aq); docker rmi $(docker images -aq)
+rm -rf dclog
+ls
+
`,35),t=[c];function p(r,l,d,i,h,u){return a(),e("div",null,t)}var g=s(o,[["render",p]]);export{m as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_docker_build.md.f6eeb15c.lean.js b/docs/.vitepress/dist/assets/en_US_guide_docker_build.md.f6eeb15c.lean.js new file mode 100644 index 0000000000..77b55f32e4 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_docker_build.md.f6eeb15c.lean.js @@ -0,0 +1 @@ +import{_ as s,c as e,o as a,a as n}from"./app.8fc4a373.js";const m='{"title":"Docker\u865A\u62DF\u5316","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u5355\u72EC\u5F00\u8BBE","slug":"\u5355\u72EC\u5F00\u8BBE"},{"level":2,"title":"\u793A\u4F8B","slug":"\u793A\u4F8B"},{"level":2,"title":"\u67E5\u8BE2\u4FE1\u606F","slug":"\u67E5\u8BE2\u4FE1\u606F"},{"level":2,"title":"\u6279\u91CF\u5F00\u8BBE","slug":"\u6279\u91CF\u5F00\u8BBE"},{"level":2,"title":"\u67E5\u8BE2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F","slug":"\u67E5\u8BE2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F"},{"level":2,"title":"\u5378\u8F7D\u6240\u6709docker\u5BB9\u5668\u548C\u955C\u50CF","slug":"\u5378\u8F7D\u6240\u6709docker\u5BB9\u5668\u548C\u955C\u50CF"}],"relativePath":"en_US/guide/docker_build.md","lastUpdated":1687182420000}',o={},c=n("",35),t=[c];function p(r,l,d,i,h,u){return a(),e("div",null,t)}var g=s(o,[["render",p]]);export{m as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_docker_install.md.2e3e0949.js b/docs/.vitepress/dist/assets/en_US_guide_docker_install.md.2e3e0949.js new file mode 100644 index 0000000000..f9c2f8abb5 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_docker_install.md.2e3e0949.js @@ -0,0 +1,3 @@ +import{_ as s,c as a,o as e,a as n}from"./app.8fc4a373.js";const m='{"title":"\u73AF\u5883\u9884\u8BBE","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u73AF\u5883\u9884\u8BBE","slug":"\u73AF\u5883\u9884\u8BBE"}],"relativePath":"en_US/guide/docker_install.md","lastUpdated":1687182420000}',t={},p=n(`

\u73AF\u5883\u9884\u8BBE

  • \u68C0\u6D4B\u73AF\u5883
  • \u5B89\u88C5docker
  • \u4E0B\u8F7D\u9884\u5236\u811A\u672C

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/pre_build.sh -o pre_build.sh && chmod +x pre_build.sh && bash pre_build.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/pre_build.sh -o pre_build.sh && chmod +x pre_build.sh && bash pre_build.sh
+
`,6),o=[p];function r(c,i,l,d,_,u){return e(),a("div",null,o)}var k=s(t,[["render",r]]);export{m as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_docker_install.md.2e3e0949.lean.js b/docs/.vitepress/dist/assets/en_US_guide_docker_install.md.2e3e0949.lean.js new file mode 100644 index 0000000000..42142673f2 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_docker_install.md.2e3e0949.lean.js @@ -0,0 +1 @@ +import{_ as s,c as a,o as e,a as n}from"./app.8fc4a373.js";const m='{"title":"\u73AF\u5883\u9884\u8BBE","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u73AF\u5883\u9884\u8BBE","slug":"\u73AF\u5883\u9884\u8BBE"}],"relativePath":"en_US/guide/docker_install.md","lastUpdated":1687182420000}',t={},p=n("",6),o=[p];function r(c,i,l,d,_,u){return e(),a("div",null,o)}var k=s(t,[["render",r]]);export{m as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_docker_precheck.md.1963a1ba.js b/docs/.vitepress/dist/assets/en_US_guide_docker_precheck.md.1963a1ba.js new file mode 100644 index 0000000000..9371020afb --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_docker_precheck.md.1963a1ba.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as t,a}from"./app.8fc4a373.js";const f='{"title":"\u9879\u76EE\u7279\u70B9","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u9879\u76EE\u7279\u70B9","slug":"\u9879\u76EE\u7279\u70B9"},{"level":2,"title":"\u914D\u7F6E\u8981\u6C42","slug":"\u914D\u7F6E\u8981\u6C42"}],"relativePath":"en_US/guide/docker_precheck.md","lastUpdated":1687182420000}',o={},p=a('

\u9879\u76EE\u7279\u70B9

\u901A\u8FC7docker\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBENAT\u670D\u52A1\u5668(Bulk or individual NAT server provisioning via docker)

\u9ED8\u8BA4\u4F7F\u7528debian\u7CFB\u7EDF\uFF0C\u6BCF\u4E2A\u5BB9\u5668\u81EA\u5E261\u4E2A\u5916\u7F51ssh\u7AEF\u53E3\uFF0C25\u4E2A\u5185\u5916\u7F51\u4E00\u81F4\u7AEF\u53E3

\u9ED8\u8BA4\u521B\u5EFA\u7684\u662F\u975E\u7279\u6743\u5BB9\u5668\uFF0C\u4E14\u4E0D\u6302\u8F7D\u4E0E\u5BBF\u4E3B\u673A\u7684docker\u7684\u5B88\u62A4\u8FDB\u7A0B\u4E4B\u95F4\u7684\u901A\u4FE1\uFF0C\u6240\u4EE5\u5BBF\u4E3B\u673A\u521B\u5EFA\u7684docker\u865A\u62DF\u5316\u7684NAT\u670D\u52A1\u5668\u5185\u65E0\u6CD5\u518D\u5D4C\u5957\u865A\u62DF\u5316docker

\u7531\u4E8E\u53EA\u662F\u5728\u5BBF\u4E3B\u673A\u8FDB\u884C\u4E86CPU\u548C\u5185\u5B58\u7684\u9650\u5236\u672A\u5728\u5BB9\u5668\u5185\u4F7F\u7528cgroup\u9A71\u52A8\uFF0C\u6240\u4EE5\u5728\u5BB9\u5668\u5185\u4F7F\u7528\u670D\u52A1\u5668\u6D4B\u8BD5\u811A\u672C\u68C0\u6D4B\u5BB9\u5668\u7684\u53EF\u7528\u8D44\u6E90\u662F\u65E0\u6548\u7684\uFF0C\u663E\u793A\u7684\u4F1A\u662F\u5BBF\u4E3B\u673A\u7684\u8D44\u6E90

\u7531\u4E8E\u5927\u90E8\u5206\u4E91\u670D\u52A1\u5668xfs\u6587\u4EF6\u7CFB\u7EDF\u4E0D\u542F\u7528pquota\u9009\u9879\uFF0C\u6240\u4EE5\u9ED8\u8BA4\u5171\u4EAB\u5BBF\u4E3B\u673A\u786C\u76D8\uFF0C\u65E0\u6CD5\u9650\u5236\u6BCF\u4E2A\u5BB9\u5668\u7684\u78C1\u76D8\u5927\u5C0F

\u914D\u7F6E\u8981\u6C42

\u7CFB\u7EDF\u53EF\u5B89\u88C5docker\u5373\u53EF\u7528\uFF0C\u7F51\u7EDC\u80FD\u8FDE\u63A5Github\u7684raw\u754C\u9762\u5C31\u80FD\u7528\uFF0C\u786C\u4EF6\u914D\u7F6E\u53EA\u8981\u4E0D\u62C9\u8DE8\u5C31\u884C\uFF0C\u7A7A\u95F2\u786C\u76D8\u67093G\u5C31\u884C

\u63A8\u8350\u5728\u5F00\u8BBENAT\u670D\u52A1\u5668\u524D\u5148\u589E\u52A0\u90E8\u5206SWAP\u865A\u62DF\u5185\u5B58\uFF0C\u907F\u514D\u7A81\u53D1\u7684\u5185\u5B58\u5360\u7528\u5BFC\u81F4\u6BCD\u9E21\u5361\u6B7B \u8DF3\u8F6C

PS: \u5982\u679C\u786C\u4EF6\u8D44\u6E90\u53EA\u662F\u597D\u4E86\u4E00\u70B9\uFF0C\u9700\u8981\u9650\u5236\u66F4\u591A\u4E1C\u897F\u5E76\u9700\u8981\u914D\u7F6EIPV6\u72EC\u7ACB\u5730\u5740\u548C\u9650\u5236\u786C\u76D8\u5927\u5C0F\uFF0C\u53EF\u4F7F\u7528LXD\u6279\u91CF\u5F00LXC\u865A\u62DF\u5316\u7684\u5BB9\u5668 \u8DF3\u8F6C

PS: \u5982\u679C\u786C\u4EF6\u975E\u5E38\u597D\u8D44\u6E90\u5F88\u591A\uFF0C\u53EF\u4F7F\u7528PVE\u6279\u91CF\u5F00KVM\u865A\u62DF\u5316\u7684\u865A\u62DF\u673A \u8DF3\u8F6C

',11),n=[p];function s(i,c,d,_,h,l){return t(),r("div",null,n)}var g=e(o,[["render",s]]);export{f as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_docker_precheck.md.1963a1ba.lean.js b/docs/.vitepress/dist/assets/en_US_guide_docker_precheck.md.1963a1ba.lean.js new file mode 100644 index 0000000000..8e92dabec4 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_docker_precheck.md.1963a1ba.lean.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as t,a}from"./app.8fc4a373.js";const f='{"title":"\u9879\u76EE\u7279\u70B9","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u9879\u76EE\u7279\u70B9","slug":"\u9879\u76EE\u7279\u70B9"},{"level":2,"title":"\u914D\u7F6E\u8981\u6C42","slug":"\u914D\u7F6E\u8981\u6C42"}],"relativePath":"en_US/guide/docker_precheck.md","lastUpdated":1687182420000}',o={},p=a("",11),n=[p];function s(i,c,d,_,h,l){return t(),r("div",null,n)}var g=e(o,[["render",s]]);export{f as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_docker_qa.md.552cf73e.js b/docs/.vitepress/dist/assets/en_US_guide_docker_qa.md.552cf73e.js new file mode 100644 index 0000000000..45cc572e85 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_docker_qa.md.552cf73e.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a}from"./app.8fc4a373.js";const f='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/guide/docker_qa.md","lastUpdated":1687182420000}',r={};function o(c,s,n,_,d,p){return a(),t("div")}var l=e(r,[["render",o]]);export{f as __pageData,l as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_docker_qa.md.552cf73e.lean.js b/docs/.vitepress/dist/assets/en_US_guide_docker_qa.md.552cf73e.lean.js new file mode 100644 index 0000000000..45cc572e85 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_docker_qa.md.552cf73e.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a}from"./app.8fc4a373.js";const f='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/guide/docker_qa.md","lastUpdated":1687182420000}',r={};function o(c,s,n,_,d,p){return a(),t("div")}var l=e(r,[["render",o]]);export{f as __pageData,l as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_docker_thanks.md.e5e5ba20.js b/docs/.vitepress/dist/assets/en_US_guide_docker_thanks.md.e5e5ba20.js new file mode 100644 index 0000000000..cdd83b79b1 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_docker_thanks.md.e5e5ba20.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a}from"./app.8fc4a373.js";const f='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/guide/docker_thanks.md","lastUpdated":1687182420000}',r={};function o(s,c,n,_,d,p){return a(),t("div")}var l=e(r,[["render",o]]);export{f as __pageData,l as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_docker_thanks.md.e5e5ba20.lean.js b/docs/.vitepress/dist/assets/en_US_guide_docker_thanks.md.e5e5ba20.lean.js new file mode 100644 index 0000000000..cdd83b79b1 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_docker_thanks.md.e5e5ba20.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a}from"./app.8fc4a373.js";const f='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/guide/docker_thanks.md","lastUpdated":1687182420000}',r={};function o(s,c,n,_,d,p){return a(),t("div")}var l=e(r,[["render",o]]);export{f as __pageData,l as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_lxd_extra_config.md.8bf0f547.js b/docs/.vitepress/dist/assets/en_US_guide_lxd_extra_config.md.8bf0f547.js new file mode 100644 index 0000000000..a2eb6ea132 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_lxd_extra_config.md.8bf0f547.js @@ -0,0 +1,25 @@ +import{_ as s,c as a,o as n,a as e}from"./app.8fc4a373.js";const k='{"title":"\u81EA\u52A8\u914D\u7F6EIPV6\u5730\u5740","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u81EA\u52A8\u914D\u7F6EIPV6\u5730\u5740","slug":"\u81EA\u52A8\u914D\u7F6Eipv6\u5730\u5740"},{"level":2,"title":"\u5C4F\u853D\u5BB9\u6613\u88AB\u6EE5\u7528\u7684\u7AEF\u53E3\u7684\u51FA\u5165\u6D41\u91CF\u4EE5\u5C4F\u853D\u7AEF\u53E3\u548C\u5C4F\u853D\u6EE5\u7528\u5DE5\u5177\u5305","slug":"\u5C4F\u853D\u5BB9\u6613\u88AB\u6EE5\u7528\u7684\u7AEF\u53E3\u7684\u51FA\u5165\u6D41\u91CF\u4EE5\u5C4F\u853D\u7AEF\u53E3\u548C\u5C4F\u853D\u6EE5\u7528\u5DE5\u5177\u5305"}],"relativePath":"en_US/guide/lxd_extra_config.md","lastUpdated":1687182420000}',t={},o=e(`

TIP

\u4EE5\u4E0B\u7684\u914D\u7F6E\u5B89\u88C5\u4F1A\u52A0\u91CD\u6BCD\u9E21\u7684\u8D1F\u62C5\uFF0C\u975E\u5FC5\u8981\u4E0D\u8981\u5B89\u88C5 \u5982\u679C\u662F\u4E2A\u4EBA\u4F7F\u7528\uFF0C\u53EF\u5FFD\u7565\u9632\u6EE5\u7528\u90E8\u5206\u811A\u672C\u7684\u5B89\u88C5

\u81EA\u52A8\u914D\u7F6EIPV6\u5730\u5740

  • (\u975E\u5FC5\u987B\uFF0C\u4E0D\u4F7F\u7528\u7684\u4E5F\u6CA1\u95EE\u9898)
  • \u8BE5\u811A\u672C\u4EC5\u9002\u7528\u4E8E\u6BCD\u9E21\u6709\u7ED9IPV6\u5B50\u7F51\u4E14\u662F/64\u7684\uFF0C\u4E14\u6BCD\u9E21\u7ED1\u5B9A\u4E86\u5B50\u7F51\u7684\u7B2C\u4E00\u4E2AIP\u505A\u6BCD\u9E21\u7684IPV6\u5730\u5740\u6216IPV6\u7684gateway
  • \u81EA\u52A8\u4E3ALXD\u521B\u5EFA\u7684LXC\u5BB9\u5668\u914D\u7F6EIPV6\u5730\u5740
  • \u5DF2\u96C6\u6210\u5230buildone.sh\u4E2D\u53EF\u4F7F\u7528\u53D8\u91CF\u63A7\u5236\u4E14\u65E0\u9700\u4E8B\u5148\u4E0B\u8F7D\uFF0C\u8BE5\u811A\u672C\u53EF\u4E0D\u624B\u52A8\u4F7F\u7528\uFF0C\u5728\u4F7F\u7528buildone.sh\u65F6\u914D\u7F6EY\u5F00\u542F\u5373\u53EF

\u4E0B\u8F7D\u811A\u672C

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_ipv6_network.sh -o build_ipv6_network.sh && chmod +x build_ipv6_network.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_ipv6_network.sh -o build_ipv6_network.sh && chmod +x build_ipv6_network.sh
+

\u81EA\u52A8\u4E3A\u5BB9\u5668\u914D\u7F6EIPV6\u6620\u5C04\u5730\u5740

bash build_ipv6_network.sh \u5BB9\u5668\u540D\u79F0
+

\u6620\u5C04\u5B8C\u6BD5\u4F1A\u6253\u5370\u4FE1\u606F

\u793A\u4F8B(\u7ED9test\u5BB9\u5668\u81EA\u52A8\u914D\u7F6EIPV6\u5730\u5740\uFF0C\u914D\u7F6E\u5B8C\u6210\u4F1A\u5199\u5165\u4E00\u4E2Atest_v6\u7684\u6587\u4EF6\u4FE1\u606F)

bash build_ipv6_network.sh test
+

\u5220\u9664\u6240\u6709IPV6\u5DF2\u6620\u5C04\u7684\u89C4\u5219

ip6tables -t nat -F PREROUTING
+ip6tables-legacy -t nat -F PREROUTING
+ip6tables-save > /etc/iptables/rules.v6
+netfilter-persistent save
+netfilter-persistent reload
+service netfilter-persistent restart
+

\u5378\u8F7DIPV6\u5730\u5740\u7ED1\u5B9A\u7684\u5B88\u62A4\u8FDB\u7A0B\u548C\u5BF9\u5E94\u7684\u6587\u4EF6

systemctl stop add-ipv6.service
+systemctl disable add-ipv6.service
+rm /etc/systemd/system/add-ipv6.service
+systemctl daemon-reload
+rm /usr/local/bin/add-ipv6.sh
+

\u5C4F\u853D\u5BB9\u6613\u88AB\u6EE5\u7528\u7684\u7AEF\u53E3\u7684\u51FA\u5165\u6D41\u91CF\u4EE5\u5C4F\u853D\u7AEF\u53E3\u548C\u5C4F\u853D\u6EE5\u7528\u5DE5\u5177\u5305

  • (\u975E\u5FC5\u987B\uFF0C\u8BE5\u811A\u672C\u4EC5\u4EC5\u662F\u4E3A\u4E86\u9632\u6B62\u5BB9\u5668\u6EE5\u7528\u65B9\u4FBF\uFF0C\u4E0D\u88C5\u7684\u4E5F\u6CA1\u95EE\u9898)
  • \u4E8B\u524D\u9884\u9632

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/rules.sh -o rules.sh && chmod +x rules.sh && bash rules.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/rules.sh -o rules.sh && chmod +x rules.sh && bash rules.sh
+
\u4F7F\u7528screen\u914D\u7F6E\u76D1\u63A7\u5C4F\u853D\u67D0\u4E9B\u8FDB\u7A0B\u7684\u6267\u884C\u9047\u5230\u67D0\u4E9B\u8FDB\u7A0B\u7684\u51FA\u73B0\u76F4\u63A5\u5173\u95ED\u5BB9\u5668
  • \u5982\u9700\u505C\u6B62\u76D1\u63A7\u53EF\u4F7F\u7528screen\u547D\u4EE4\u505C\u6B62lxc_moniter\u8FD9\u4E2A\u540D\u5B57\u7684\u7A97\u53E3\u5E76\u5220\u9664
  • (\u975E\u5FC5\u987B\uFF0C\u8BE5\u811A\u672C\u4EC5\u4EC5\u662F\u4E3A\u4E86\u9632\u6B62\u5BB9\u5668\u6EE5\u7528\u65B9\u4FBF\uFF0C\u4E0D\u88C5\u7684\u4E5F\u6CA1\u95EE\u9898)
  • \u4E8B\u540E\u505C\u673A

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_monitor.sh -o build_monitor.sh && chmod +x build_monitor.sh && bash build_monitor.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_monitor.sh -o build_monitor.sh && chmod +x build_monitor.sh && bash build_monitor.sh
+
\u4E00\u952E\u5B89\u88C5\u5F00lxd\u6BCD\u9E21\u6240\u9700\u8981\u7684\u5E26vnstat\u73AF\u5883\u7684\u5E38\u7528\u9884\u914D\u7F6E\u73AF\u5883
  • (\u975E\u5FC5\u987B\uFF0C\u8BE5\u811A\u672C\u4EC5\u4EC5\u662F\u4E3A\u4E86\u7AD9\u70B9\u5BF9\u63A5\u76D1\u63A7\u65B9\u4FBF\uFF0C\u4E0D\u88C5\u7684\u4E5F\u6CA1\u95EE\u9898)

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/backend.sh -o backend.sh && chmod +x backend.sh && bash backend.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/backend.sh -o backend.sh && chmod +x backend.sh && bash backend.sh
+
\u4E00\u952E\u5B89\u88C5\u6BCD\u9E21\u53EF\u89C6\u5316\u64CD\u4F5C\u7684\u9762\u677F
  • (\u975E\u5FC5\u987B\uFF0C\u8BE5\u9762\u677F\u53EA\u662F\u4E3A\u4E86\u65B9\u4FBF\u53EF\u89C6\u5316\u64CD\u4F5C\uFF0C\u6CA1\u6709\u4E5F\u6CA1\u95EE\u9898)
  • \u539F\u4F5C\u8005\u4ED3\u5E93\uFF1A\u8DF3\u8F6C
lxc config set core.https_address [::]
+lxc config set core.trust_password some-secret-string
+snap install lxdmosaic
+

\u5B89\u88C5\u5B8C\u6BD5\u540E\u6253\u5F00\u6BCD\u9E21IP\u5730\u5740\uFF0C\u6309\u7167\u63D0\u793A\u8BBE\u7F6Eadmin\u7684\u5BC6\u7801\uFF0C\u5176\u4ED6\u4E00\u8DEF\u9ED8\u8BA4\u5C31\u80FD\u4F7F\u7528\u9762\u677F\u4E86

`,39),p=[o];function c(i,l,r,d,u,h){return n(),a("div",null,p)}var b=s(t,[["render",c]]);export{k as __pageData,b as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_lxd_extra_config.md.8bf0f547.lean.js b/docs/.vitepress/dist/assets/en_US_guide_lxd_extra_config.md.8bf0f547.lean.js new file mode 100644 index 0000000000..d68a63d404 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_lxd_extra_config.md.8bf0f547.lean.js @@ -0,0 +1 @@ +import{_ as s,c as a,o as n,a as e}from"./app.8fc4a373.js";const k='{"title":"\u81EA\u52A8\u914D\u7F6EIPV6\u5730\u5740","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u81EA\u52A8\u914D\u7F6EIPV6\u5730\u5740","slug":"\u81EA\u52A8\u914D\u7F6Eipv6\u5730\u5740"},{"level":2,"title":"\u5C4F\u853D\u5BB9\u6613\u88AB\u6EE5\u7528\u7684\u7AEF\u53E3\u7684\u51FA\u5165\u6D41\u91CF\u4EE5\u5C4F\u853D\u7AEF\u53E3\u548C\u5C4F\u853D\u6EE5\u7528\u5DE5\u5177\u5305","slug":"\u5C4F\u853D\u5BB9\u6613\u88AB\u6EE5\u7528\u7684\u7AEF\u53E3\u7684\u51FA\u5165\u6D41\u91CF\u4EE5\u5C4F\u853D\u7AEF\u53E3\u548C\u5C4F\u853D\u6EE5\u7528\u5DE5\u5177\u5305"}],"relativePath":"en_US/guide/lxd_extra_config.md","lastUpdated":1687182420000}',t={},o=e("",39),p=[o];function c(i,l,r,d,u,h){return n(),a("div",null,p)}var b=s(t,[["render",c]]);export{k as __pageData,b as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_lxd_install.md.ee14e163.js b/docs/.vitepress/dist/assets/en_US_guide_lxd_install.md.ee14e163.js new file mode 100644 index 0000000000..fd5afdc353 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_lxd_install.md.ee14e163.js @@ -0,0 +1,15 @@ +import{_ as a,c as s,o as n,a as p}from"./app.8fc4a373.js";const x='{"title":"LXD\u4E3B\u4F53\u5B89\u88C5","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u624B\u52A8\u5B89\u88C5","slug":"\u624B\u52A8\u5B89\u88C5"},{"level":3,"title":"\u5173\u95ED\u9632\u706B\u5899","slug":"\u5173\u95ED\u9632\u706B\u5899"},{"level":3,"title":"\u5F00\u8BBE\u865A\u62DF\u5185\u5B58SWAP","slug":"\u5F00\u8BBE\u865A\u62DF\u5185\u5B58swap"},{"level":3,"title":"\u5B89\u88C5LXD","slug":"\u5B89\u88C5lxd"},{"level":2,"title":"\u4E00\u952E\u5B89\u88C5","slug":"\u4E00\u952E\u5B89\u88C5"}],"relativePath":"en_US/guide/lxd_install.md","lastUpdated":1687182420000}',e={},t=p(`

LXD\u4E3B\u4F53\u5B89\u88C5

\u624B\u52A8\u5B89\u88C5

\u65B0\u624B\u63A8\u8350\uFF0C\u907F\u514D\u6709bug\u4E0D\u77E5\u9053\u600E\u4E48\u4FEE\uFF0C\u5F53\u7136\u5982\u679C\u53EA\u662F\u56FE\u65B9\u4FBF\u53C8\u662F\u8001\u624B\u61C2\u6392\u67E5BUG\uFF0C\u7528\u540E\u9762\u7684\u4E00\u952E\u5B89\u88C5\u4E5F\u884C

\u5173\u95ED\u9632\u706B\u5899

apt update
+apt install curl wget sudo dos2unix ufw jq -y
+ufw disable
+

\u5F00\u8BBE\u865A\u62DF\u5185\u5B58SWAP

\u5185\u5B58\u770B\u4F60\u5F00\u591A\u5C11\u5C0F\u9E21\uFF0C\u8FD9\u91CC\u5982\u679C\u8981\u5F008\u4E2A\uFF0C\u6362\u7B97\u9700\u89812G\u5185\u5B58\uFF0C\u5B9E\u9645\u5185\u5B58\u5982\u679C\u662F512MB\u5185\u5B58\uFF0C\u8FD8\u9700\u8981\u5F001.5G\uFF0C\u4FDD\u5B88\u70B9\u5F002G\u865A\u62DF\u5185\u5B58\u5373\u53EF

\u6267\u884C\u4E0B\u9762\u547D\u4EE4\uFF0C\u8F93\u51651\uFF0C\u518D\u8F93\u51652048\uFF0C\u4EE3\u8868\u5F002G\u865A\u62DF\u5185\u5B58

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/swap.sh -o swap.sh && chmod +x swap.sh && bash swap.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/swap.sh -o swap.sh && chmod +x swap.sh && bash swap.sh
+

\u5B89\u88C5LXD

\u5B9E\u9645swap\u5F00\u7684\u865A\u62DF\u5185\u5B58\u5E94\u8BE5\u662F\u5B9E\u9645\u5185\u5B58\u76842\u500D\uFF0C\u4E5F\u5C31\u662F\u5F001G\u662F\u5408\u7406\u7684\uFF0C\u4E0A\u9762\u6211\u63CF\u8FF0\u7684\u60C5\u51B5\u5C5E\u4E8E\u8D85\u5F00\u4E86

apt install snapd -y
+snap install lxd
+/snap/bin/lxd init
+

\u5982\u679C\u4E0A\u9762\u7684\u547D\u4EE4\u4E2D\u51FA\u73B0\u4E0B\u9762\u7684\u9519\u8BEF

(snap "lxd" assumes unsupported features: snapd2.39 (try to update snapd and refresh the core snap))

\u4F7F\u7528\u547D\u4EE4\u4FEE\u8865\u540E\u518D\u8FDB\u884Clxd\u7684\u5B89\u88C5

snap install core
+

\u5982\u679C\u65E0\u5F02\u5E38\uFF0C\u4E0A\u9762\u4E09\u884C\u547D\u4EE4\u6267\u884C\u7ED3\u679C\u5982\u4E0B

\u4E00\u822C\u7684\u9009\u9879\u56DE\u8F66\u9ED8\u8BA4\u5373\u53EF

\u9009\u62E9\u914D\u7F6E\u7269\u7406\u76D8\u5927\u5C0F(\u63D0\u793A\u9ED8\u8BA4\u6700\u5C0F1GB\u90A3\u4E2A\u9009\u9879)\uFF0C\u4E00\u822C\u6211\u586B\u7A7A\u95F2\u78C1\u76D8\u5927\u5C0F\u51CF\u53BB\u5185\u5B58\u5927\u5C0F\u540E\u4E58\u4EE50.95\u5E76\u5411\u4E0B\u53D6\u6574\uFF0C\u8FD9\u91CC\u6211\u586B\u4E8610GB

\u63D0\u793A\u5E26auto\u7684\u66F4\u65B0image\u7684\u9009\u9879\u8BB0\u5F97\u9009no\uFF0C\u907F\u514D\u66F4\u65B0\u5360\u7528\u7CFB\u7EDF

\u6D4B\u8BD5lxc\u6709\u6CA1\u6709\u8F6F\u8FDE\u63A5\u4E0A

lxc -h
+

\u5982\u679C\u62A5\u9519\u5219\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u8F6F\u8FDE\u63A5lxc\u547D\u4EE4

! lxc -h >/dev/null 2>&1 && echo 'alias lxc="/snap/bin/lxc"' >> /root/.bashrc && source /root/.bashrc
+export PATH=$PATH:/snap/bin
+

\u8FDE\u63A5\u540E\u518D\u6D4B\u8BD5lxc\u547D\u4EE4\u662F\u5426\u6709\u62A5\u9519\u627E\u4E0D\u5230

\u4E00\u952E\u5B89\u88C5

TIP

\u5982\u679C\u662F\u5168\u65B0\u7684\u670D\u52A1\u5668\uFF0C\u52A1\u5FC5\u4FDD\u8BC1apt update\u548Capt install curl\u90FD\u65E0\u95EE\u9898\u518D\u6267\u884C\u672C\u811A\u672C \u4E14\u81EA\u5F00\u673A\u8D77\u6700\u597D\u7B49\u5F855\u5206\u949F\u540E\u518D\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\uFF0C\u907F\u514D\u7CFB\u7EDF\u9ED8\u8BA4\u8BBE\u7F6E\u4E2D\u5C31\u6267\u884C\u4E86\u672C\u811A\u672C\u5BFC\u81F4apt\u6E90\u5361\u6B7B

  • \u73AF\u5883\u8981\u6C42\uFF1AUbuntu 18+(\u63A8\u8350)\uFF0CDebian 8+(\u4EC5\u9650x86_64\u67B6\u6784)

\u5982\u679C\u662FDebian\u7CFB\u7684\u5BBF\u4E3B\u673A\uFF0C\u52A1\u5FC5\u5728screen\u4E2D\u6267\u884C\u672C\u811A\u672C\uFF0C\u907F\u514D\u957F\u671F\u8FD0\u884C\u65F6SSH\u4E2D\u65AD\u5BFC\u81F4ZFS\u7F16\u8BD1\u5B89\u88C5\u5931\u8D25

\u8FD9\u91CC\u7684\u865A\u62DF\u5185\u5B58\u662F\u8BF4\u8981\u5F00\u7684SWAP\u5927\u5C0F\uFF0C\u5B58\u50A8\u6C60\u5219\u662F\u4F60\u6240\u6709\u8981\u5F00\u7684\u5C0F\u9E21\u5360\u7684\u76D8\u7684\u5927\u5C0F\u7684\u603B\u548C

\u73AF\u5883\u5B89\u88C5\u8FC7\u7A0B\u4E2D\u53EF\u80FD\u9700\u8981\u91CD\u542F\u670D\u52A1\u5668\u518D\u6B21\u6267\u884C\u4EE5\u52A0\u8F7D\u542Bzfs\u7684\u5185\u6838\uFF0C\u4E00\u5207\u4EE5\u8FD0\u884C\u540E\u547D\u4EE4\u884C\u7684\u63D0\u793A\u4E3A\u51C6

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/lxdinstall.sh -o lxdinstall.sh && chmod +x lxdinstall.sh && bash lxdinstall.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/lxdinstall.sh -o lxdinstall.sh && chmod +x lxdinstall.sh && bash lxdinstall.sh
+

\u4F8B\u5B50\uFF1A

\u5982\u679C\u7CFB\u7EDF\u76D8\u9664\u53BB\u5DF2\u5360\u7528\u7A7A\u95F4\u8FD8\u670918G\u786C\u76D8\u7A7A\u4F59\uFF0C\u60F3\u5F002G\u865A\u62DF\u5185\u5B58(2048MB\u7684SWAP)\uFF0C15G\u7684\u5B58\u50A8\u6C60\uFF0C\u6309\u7167\u547D\u4EE4\u884C\u7684\u63D0\u793A\u5219\u4F9D\u6B21\u8F93\u51652048\u548C15

`,41),o=[t];function l(c,i,r,d,h,u){return n(),s("div",null,o)}var g=a(e,[["render",l]]);export{x as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_lxd_install.md.ee14e163.lean.js b/docs/.vitepress/dist/assets/en_US_guide_lxd_install.md.ee14e163.lean.js new file mode 100644 index 0000000000..570c98a95a --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_lxd_install.md.ee14e163.lean.js @@ -0,0 +1 @@ +import{_ as a,c as s,o as n,a as p}from"./app.8fc4a373.js";const x='{"title":"LXD\u4E3B\u4F53\u5B89\u88C5","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u624B\u52A8\u5B89\u88C5","slug":"\u624B\u52A8\u5B89\u88C5"},{"level":3,"title":"\u5173\u95ED\u9632\u706B\u5899","slug":"\u5173\u95ED\u9632\u706B\u5899"},{"level":3,"title":"\u5F00\u8BBE\u865A\u62DF\u5185\u5B58SWAP","slug":"\u5F00\u8BBE\u865A\u62DF\u5185\u5B58swap"},{"level":3,"title":"\u5B89\u88C5LXD","slug":"\u5B89\u88C5lxd"},{"level":2,"title":"\u4E00\u952E\u5B89\u88C5","slug":"\u4E00\u952E\u5B89\u88C5"}],"relativePath":"en_US/guide/lxd_install.md","lastUpdated":1687182420000}',e={},t=p("",41),o=[t];function l(c,i,r,d,h,u){return n(),s("div",null,o)}var g=a(e,[["render",l]]);export{x as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_lxd_lxc.md.10e4a9d8.js b/docs/.vitepress/dist/assets/en_US_guide_lxd_lxc.md.10e4a9d8.js new file mode 100644 index 0000000000..c075a51fa1 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_lxd_lxc.md.10e4a9d8.js @@ -0,0 +1,32 @@ +import{_ as s,c as a,o as n,a as e}from"./app.8fc4a373.js";const m='{"title":"\u666E\u901A\u7684\u6279\u91CF\u7248\u672C","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u666E\u901A\u7684\u6279\u91CF\u7248\u672C","slug":"\u666E\u901A\u7684\u6279\u91CF\u7248\u672C"},{"level":3,"title":"\u53EA\u6709\u4E00\u4E2ASSH\u7AEF\u53E3\u7684\u7248\u672C","slug":"\u53EA\u6709\u4E00\u4E2Assh\u7AEF\u53E3\u7684\u7248\u672C"},{"level":2,"title":"\u67E5\u770B\u5DF2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F","slug":"\u67E5\u770B\u5DF2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F"},{"level":2,"title":"\u90E8\u5206\u5E38\u7528LXD\u547D\u4EE4","slug":"\u90E8\u5206\u5E38\u7528lxd\u547D\u4EE4"},{"level":2,"title":"\u4E00\u952E\u811A\u672C\u8001\u624B\u63A8\u8350\u65B9\u4FBF\u5FEB\u6377","slug":"\u4E00\u952E\u811A\u672C\u8001\u624B\u63A8\u8350\u65B9\u4FBF\u5FEB\u6377"},{"level":3,"title":"\u53EA\u5F00\u4E00\u4E2ANAT\u670D\u52A1\u5668","slug":"\u53EA\u5F00\u4E00\u4E2Anat\u670D\u52A1\u5668"}],"relativePath":"en_US/guide/lxd_lxc.md","lastUpdated":1687182420000}',p={},t=e(`

\u666E\u901A\u7684\u6279\u91CF\u7248\u672C

\u5F00\u51FA\u7684\u5C0F\u9E21\u914D\u7F6E\uFF1A

  • 1\u6838256MB\u5185\u5B581GB\u786C\u76D8\u9650\u901F250Mbps\u5E26\u5BBD
  • \u5E261\u4E2ASSH\u7AEF\u53E3\uFF0C25\u4E2A\u5916\u7F51\u7AEF\u53E3
  • \u9ED8\u8BA4\u5185\u5B58\u548C\u786C\u76D8\u5927\u5C0F

TIP

lxc\u82E5\u547D\u4EE4\u65E0\u95EE\u9898\uFF0C\u6267\u884C\u521D\u59CB\u5316\u5F00\u5C0F\u9E21\uFF0C\u8FD9\u4E00\u6B65\u6700\u597D\u653Escreen\u4E2D\u540E\u53F0\u6302\u8D77\u6267\u884C\uFF0C\u5F00\u5C0F\u9E21\u65F6\u957F\u4E0E\u4F60\u5F00\u51E0\u4E2A\u548C\u6BCD\u9E21\u914D\u7F6E\u76F8\u5173

\u6267\u884C\u4E0B\u9762\u547D\u4EE4\u52A0\u8F7D\u5F00\u673A\u811A\u672C

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/init.sh -o init.sh && chmod +x init.sh && dos2unix init.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/init.sh -o init.sh && chmod +x init.sh && dos2unix init.sh
+

\u4E0B\u9762\u547D\u4EE4\u4E3A\u5F00\u5C0F\u9E21\u540D\u5B57\u524D\u7F00\u4E3Atj\u768410\u4E2A\u5C0F\u9E21

./init.sh tj 10
+

\u6709\u65F6\u5019init.sh\u7684\u8FD0\u884C\u8DEF\u5F84\u6709\u95EE\u9898\uFF0C\u6B64\u65F6\u5EFA\u8BAE\u524D\u9762\u52A0\u4E0Asudo\u5F3A\u5236\u6839\u76EE\u5F55\u6267\u884C

\u53EA\u6709\u4E00\u4E2ASSH\u7AEF\u53E3\u7684\u7248\u672C

\u5F00\u51FA\u7684\u5C0F\u9E21\u914D\u7F6E\uFF1A

  • 1\u6838128MB\u5185\u5B58300MB\u786C\u76D8\u9650\u901F200Mbps\u5E26\u5BBD
  • \u53EA\u6709\u4E00\u4E2ASSH\u7AEF\u53E3
  • \u65E0\u6CD5\u6302\u8F7Dwarp

TIP

lxc\u82E5\u547D\u4EE4\u65E0\u95EE\u9898\uFF0C\u6267\u884C\u521D\u59CB\u5316\u5F00\u5C0F\u9E21\uFF0C\u8FD9\u4E00\u6B65\u6700\u597D\u653Escreen\u4E2D\u540E\u53F0\u6302\u8D77\u6267\u884C\uFF0C\u5F00\u5C0F\u9E21\u65F6\u957F\u4E0E\u4F60\u5F00\u51E0\u4E2A\u548C\u6BCD\u9E21\u914D\u7F6E\u76F8\u5173

\u52A0\u8F7D\u5F00\u673A\u811A\u672C

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/least.sh -o least.sh && chmod +x least.sh && dos2unix least.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/least.sh -o least.sh && chmod +x least.sh && dos2unix least.sh
+

\u4E0B\u5217\u547D\u4EE4\u6700\u540E\u4E00\u884C\u4E3A\u5F00\u5C0F\u9E21\u540D\u5B57\u524D\u7F00\u4E3Atj\u768410\u4E2A\u5C0F\u9E21

./least.sh tj 10
+

\u6709\u65F6\u5019least.sh\u7684\u8FD0\u884C\u8DEF\u5F84\u6709\u95EE\u9898\uFF0C\u6B64\u65F6\u5EFA\u8BAE\u524D\u9762\u52A0\u4E0Asudo\u5F3A\u5236\u6839\u76EE\u5F55\u6267\u884C

\u67E5\u770B\u5DF2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F

\u5F00\u5B8C\u5C0F\u9E21\u540E\uFF0C\u5177\u4F53\u4FE1\u606F\u4F1A\u751F\u6210\u5728\u5F53\u524D\u76EE\u5F55\u4E0B\u7684log\u6587\u4EF6\u4E2D\uFF0C\u683C\u5F0F\u5982\u4E0B

1\u53F7\u670D\u52A1\u5668\u540D\u79F0 \u5BC6\u7801 ssh\u7AEF\u53E3 \u5916\u7F51\u7AEF\u53E3\u8D77\u59CB \u5916\u7F51\u7AEF\u53E3\u7EC8\u6B62
+2\u53F7\u670D\u52A1\u5668\u540D\u79F0 \u5BC6\u7801 ssh\u7AEF\u53E3 \u5916\u7F51\u7AEF\u53E3\u8D77\u59CB \u5916\u7F51\u7AEF\u53E3\u7EC8\u6B62
+

\u5982\u679C\u60F3\u8981\u67E5\u770B\uFF0C\u53EA\u9700\u5728\u5F53\u524D\u76EE\u5F55\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u6253\u5370log\u6587\u4EF6\u5373\u53EF

cat log
+

::warning \u4E0D\u8981\u62FF\u8BE5\u811A\u672C\u5F00\u51FA\u7684\u5C0F\u9E21\u5F53\u751F\u4EA7\u73AF\u5883\uFF0CLXC\u865A\u62DF\u5316\u4E0D\u652F\u6301\u6362\u5185\u6838\uFF0Cdd\uFF0C\u5F00\u542Fbbr\u7B49\u64CD\u4F5C ::

\u90E8\u5206\u5E38\u7528LXD\u547D\u4EE4

\u67E5\u770B\u6240\u6709

lxc list
+

\u67E5\u770B\u4E2A\u4F8B

lxc info \u670D\u52A1\u5668\u540D\u5B57
+

\u542F\u52A8\u4E2A\u4F8B

lxc start \u670D\u52A1\u5668\u540D\u5B57
+

\u505C\u6B62\u4E2A\u4F8B

lxc stop \u670D\u52A1\u5668\u540D\u5B57
+

\u5220\u9664\u4E2A\u4F8B

lxc delete -f \u670D\u52A1\u5668\u540D\u5B57
+

\u8FDB\u5165\u5185\u90E8

lxc exec \u670D\u52A1\u5668\u540D\u5B57 /bin/bash
+

\u9000\u51FA\u5219\u8F93\u5165exit\u56DE\u8F66\u5373\u53EF

\u5220\u9664\u6240\u6709LXC\u5BB9\u5668

lxc list | awk '{print $2}' | grep -v "^$" | xargs -I {} lxc delete -f {}
+

\u5728\u5BB9\u5668\u5185\u6267\u884C\u5220\u9664\u65E0\u7528\u65E5\u5FD7

sudo apt-get autoremove
+sudo apt-get clean
+sudo find /var/log -type f -delete
+sudo find /var/tmp -type f -delete
+sudo find /tmp -type f -delete
+sudo find /var/cache/apt/archives -type f -delete
+

\u4E00\u952E\u811A\u672C\u8001\u624B\u63A8\u8350\u65B9\u4FBF\u5FEB\u6377

  • \u53EA\u751F\u6210\u4E00\u4E2ANAT\u670D\u52A1\u5668\uFF0C\u53EF\u81EA\u5B9A\u4E49\u9650\u5236\u6240\u6709\u5185\u5BB9

\u53EA\u5F00\u4E00\u4E2ANAT\u670D\u52A1\u5668

\u4E0B\u8F7D\u5F00\u673A\u811A\u672C

  • (\u975E\u5FC5\u987B\uFF0C\u5982\u679C\u4F60\u4F7F\u7528\u8FC7\u4E00\u952E\u5B89\u88C5LXD\u7684\u547D\u4EE4\uFF0C\u81EA\u52A8\u5DF2\u4E0B\u8F7D\u5BF9\u5E94\u7684\u5F00\u673A\u811A\u672C\uFF0C\u4E0D\u7528\u4E0B\u8F7D\u8BE5\u811A\u672C)

\u56FD\u9645

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/buildone.sh -o buildone.sh && chmod +x buildone.sh && dos2unix buildone.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/buildone.sh -o buildone.sh && chmod +x buildone.sh && dos2unix buildone.sh
+
\u5F00NAT\u670D\u52A1\u5668

\u5185\u5B58\u5927\u5C0F\u4EE5MB\u8BA1\u7B97\uFF0C\u786C\u76D8\u5927\u5C0F\u4EE5GB\u8BA1\u7B97\uFF0C\u4E0B\u8F7D\u901F\u5EA6\u4E0A\u4F20\u901F\u5EA6\u4EE5Mbit\u8BA1\u7B97\uFF0C\u662F\u5426\u542F\u7528IPV6\u4E0D\u4E00\u5B9A\u8981\u586BY\u6216\u8005N\uFF0C\u6CA1\u6709\u8FD9\u4E2A\u53C2\u6570\u4E5F\u884C

\u5982\u679C\u5916\u7F51\u8D77\u7AEF\u53E3\u548C\u5916\u7F51\u6B62\u7AEF\u53E3\u90FD\u8BBE\u7F6E\u4E3A0\u5219\u4E0D\u505A\u533A\u95F4\u5916\u7F51\u7AEF\u53E3\u6620\u5C04\u4E86\uFF0C\u53EA\u6620\u5C04\u57FA\u7840\u7684SSH\u7AEF\u53E3\uFF0C\u6CE8\u610F\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u4E0D\u8FDB\u884C\u6620\u5C04\u9700\u8981\u8BBE\u7F6E\u4E3A0

\u652F\u6301\u81EA\u5B9A\u4E49\u5C0F\u9E21\u7684\u7CFB\u7EDF\uFF0C\u6CE8\u610F\u4F20\u5165\u53C2\u6570\u4E3A\u7CFB\u7EDF\u540D\u5B57+\u7248\u672C\u53F7\uFF0C\u5982\uFF1Adebian11\u3001ubuntu20\uFF0Ccentos8\uFF0C\u6CE8\u610F\u90FD\u662F\u5C0F\u5199\u5B57\u6BCD+\u6570\u5B57\u7684\u7EC4\u5408

./buildone.sh \u5C0F\u9E21\u540D\u79F0 \u5185\u5B58\u5927\u5C0F \u786C\u76D8\u5927\u5C0F SSH\u7AEF\u53E3 \u5916\u7F51\u8D77\u7AEF\u53E3 \u5916\u7F51\u6B62\u7AEF\u53E3 \u4E0B\u8F7D\u901F\u5EA6 \u4E0A\u4F20\u901F\u5EA6 \u662F\u5426\u542F\u7528IPV6(Y or N) \u7CFB\u7EDF(\u7559\u7A7A\u5219\u4E3Adebian11)
+

\u793A\u4F8B

./buildone.sh test 256 2 20001 20002 20025 300 300 N
+
  • \u4EE5\u4E0B\u4E3A\u5F00\u8BBE\u7684\u793A\u4F8B\u5C0F\u9E21\u7684\u4FE1\u606F\uFF1A
    \u5C0F\u9E21\u540D\u5B57 - test SSH\u767B\u5F55\u7684\u7528\u6237\u540D - root SSH\u767B\u5F55\u7684\u5BC6\u7801 - \u968F\u673A\u751F\u6210 CPU\u6838\u6570 - 1
    \u5185\u5B58\u5927\u5C0F - 256MB \u78C1\u76D8\u5927\u5C0F - 2G
    \u5185\u5916\u7F51\u6620\u5C04\u7AEF\u53E3\u4E00\u81F4\u7684\u533A\u95F4 - 20002\u523020025 \u4E0A\u4F20\u5E26\u5BBD - 300Mbit \u4E0B\u8F7D\u5E26\u5BBD - 300Mbit \u81EA\u52A8\u8BBE\u7F6E\u5916\u7F51IPV6\u5730\u5740 - N \u7CFB\u7EDF - debian11

\u9700\u8981\u67E5\u770B\u4FE1\u606F\u5219\u6267\u884C

cat \u5C0F\u9E21\u540D\u5B57
+

\u6BD4\u5982\u67E5\u8BE2\u793A\u4F8B\u7684\u4FE1\u606F\u5C31\u662F

cat test
+

\u5982\u679C\u5DF2\u901A\u8FC7\u4EE5\u4E0A\u65B9\u6CD5\u751F\u6210\u8FC7\u5C0F\u9E21\uFF0C\u8FD8\u9700\u8981\u6279\u91CF\u751F\u6210\u5C0F\u9E21\uFF0C\u53EF\u4F7F\u7528\u624B\u52A8\u5B89\u88C5\u90E8\u5206\u7684\u811A\u672C\uFF0C\u4F46\u6CE8\u610F\u5148\u5220\u9664\u6D4B\u8BD5\u5C0F\u9E21\u518D\u8FDB\u884C\u6279\u91CF\u751F\u6210\u5C0F\u9E21

\u5220\u9664\u6D4B\u8BD5\u5C0F\u9E21

lxc delete -f test
+rm -rf test
+ls
+
`,72),o=[t];function c(l,i,d,r,u,h){return n(),a("div",null,o)}var k=s(p,[["render",c]]);export{m as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_lxd_lxc.md.10e4a9d8.lean.js b/docs/.vitepress/dist/assets/en_US_guide_lxd_lxc.md.10e4a9d8.lean.js new file mode 100644 index 0000000000..8057e4e40a --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_lxd_lxc.md.10e4a9d8.lean.js @@ -0,0 +1 @@ +import{_ as s,c as a,o as n,a as e}from"./app.8fc4a373.js";const m='{"title":"\u666E\u901A\u7684\u6279\u91CF\u7248\u672C","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u666E\u901A\u7684\u6279\u91CF\u7248\u672C","slug":"\u666E\u901A\u7684\u6279\u91CF\u7248\u672C"},{"level":3,"title":"\u53EA\u6709\u4E00\u4E2ASSH\u7AEF\u53E3\u7684\u7248\u672C","slug":"\u53EA\u6709\u4E00\u4E2Assh\u7AEF\u53E3\u7684\u7248\u672C"},{"level":2,"title":"\u67E5\u770B\u5DF2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F","slug":"\u67E5\u770B\u5DF2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F"},{"level":2,"title":"\u90E8\u5206\u5E38\u7528LXD\u547D\u4EE4","slug":"\u90E8\u5206\u5E38\u7528lxd\u547D\u4EE4"},{"level":2,"title":"\u4E00\u952E\u811A\u672C\u8001\u624B\u63A8\u8350\u65B9\u4FBF\u5FEB\u6377","slug":"\u4E00\u952E\u811A\u672C\u8001\u624B\u63A8\u8350\u65B9\u4FBF\u5FEB\u6377"},{"level":3,"title":"\u53EA\u5F00\u4E00\u4E2ANAT\u670D\u52A1\u5668","slug":"\u53EA\u5F00\u4E00\u4E2Anat\u670D\u52A1\u5668"}],"relativePath":"en_US/guide/lxd_lxc.md","lastUpdated":1687182420000}',p={},t=e("",72),o=[t];function c(l,i,d,r,u,h){return n(),a("div",null,o)}var k=s(p,[["render",c]]);export{m as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_lxd_precheck.md.0acc8392.js b/docs/.vitepress/dist/assets/en_US_guide_lxd_precheck.md.0acc8392.js new file mode 100644 index 0000000000..9f080ebffb --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_lxd_precheck.md.0acc8392.js @@ -0,0 +1,2 @@ +import{_ as e,c as t,o as i,a as r}from"./app.8fc4a373.js";const b='{"title":"\u914D\u7F6E\u8981\u6C42","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u914D\u7F6E\u8981\u6C42","slug":"\u914D\u7F6E\u8981\u6C42"},{"level":2,"title":"\u9879\u76EE\u7279\u70B9","slug":"\u9879\u76EE\u7279\u70B9"},{"level":2,"title":"\u68C0\u6D4B\u73AF\u5883","slug":"\u68C0\u6D4B\u73AF\u5883"}],"relativePath":"en_US/guide/lxd_precheck.md","lastUpdated":1687182420000}',a={},l=r(`

\u914D\u7F6E\u8981\u6C42

\u786C\u4EF6\u8981\u6C42:

  • \u7CFB\u7EDF\uFF1ADebian 8+, Ubuntu 18+(\u63A8\u8350)\uFF0C\u7CFB\u7EDF\u8D8A\u65B0\u8D8A\u597D
  • \u865A\u62DF\u5316\uFF1A\u63A8\u8350KVM\u3001VMWARE\u865A\u62DF\u5316
  • \u5185\u5B58\uFF1A\u5185\u5B58\u81F3\u5C11512MB
  • \u786C\u76D8\uFF1A\u786C\u76D8(\u7CFB\u7EDF\u76D8)\u81F3\u5C1110G
  • \u7F51\u7EDC\uFF1A\u72EC\u7ACB\u7684IPV4\u5730\u5740\uFF0CIPV6\u53EF\u6709\u53EF\u65E0\uFF0C\u5E26\u5BBD\u80FD\u4E0B\u8F7D\u811A\u672C\u5C31\u884C\uFF0C\u7F51\u7EDC\u80FD\u8FDE\u63A5Github\u7684raw\u9875\u9762\u5C31\u884C

PS: \u5982\u679C\u786C\u4EF6\u975E\u5E38\u597D\u8D44\u6E90\u5F88\u591A\uFF0C\u53EF\u4F7F\u7528PVE\u6279\u91CF\u5F00KVM\u865A\u62DF\u5316\u7684\u865A\u62DF\u673A \u8DF3\u8F6C

PS: \u5982\u679C\u786C\u4EF6\u8D44\u6E90\u66F4\u70C2\uFF0C\u865A\u62DF\u5316\u4E0D\u652F\u6301\uFF0C\u53EF\u4F7F\u7528docker\u7248\u672C\u7684\uFF0C\u9002\u914D\u9762\u66F4\u5E7F \u8DF3\u8F6C

\u9879\u76EE\u7279\u70B9

  • \u672C\u5957\u811A\u672C\u5F00\u53D1\u4F7F\u7528\u7684Ubuntu20\uFF0CUbuntu\u522B\u7684\u957F\u671F\u7EF4\u62A4\u7248\u672C\u5E94\u8BE5\u4E5F\u6CA1\u95EE\u9898\uFF0CDebian\u65E0\u6CD5\u4F7F\u7528zfs\u65F6\u81EA\u52A8\u5207\u6362\u522B\u7684\u5B58\u50A8\u7C7B\u578B

  • \u5DF2\u8BBE\u7F6E\u540C\u65F6\u8FDB\u884CTCP\u548CUDP\u8F6C\u53D1\uFF0C\u9664\u4E86SSH\u7AEF\u53E3\u5176\u4ED6\u7684\u6620\u5C04\u5185\u7F51\u5916\u7F51\u7AEF\u53E3\u4E00\u81F4

  • \u5DF2\u8BBE\u7F6E\u652F\u6301\u5F00\u51FA\u7684LXC\u5BB9\u5668\u8FDB\u884Cdocker\u5D4C\u5957\u865A\u62DF\uFF0C\u9ED8\u8BA4\u666E\u901A\u7248\u672C\u548C\u7EAF\u63A2\u9488\u7248\u672C\u4F7F\u7528debian11\u7CFB\u7EDF

  • \u5DF2\u5C4F\u853D\u5BB9\u5668\u5185\u53EF\u80FD\u7528\u4E8E\u6EE5\u7528\u7684\u5DE5\u5177\u5305\u548CIPV4\u7F51\u7EDC\u7684TCP/UDP\u534F\u8BAE\u7684\u7AEF\u53E3( 3389 8888 54321 65432 )\uFF0C\u4EE5\u9632\u6B62\u5BB9\u5668\u88AB\u7528\u4E8E\u626B\u63CF\u548C\u7206\u7834\uFF0C\u4E14\u53EF\u5916\u7F6E\u8FDB\u7A0B\u68C0\u67E5\u6709\u95EE\u9898\u81EA\u52A8\u505C\u673A

  • \u5DF2\u652F\u6301\u4E00\u952E\u4E3ALXC\u5BB9\u5668\u914D\u7F6EIPV6\u5730\u5740(\u524D\u63D0\u662F\u6BCD\u9E21\u6709IPV6\u5B50\u7F51\uFF0C\u65E0IPV6\u5730\u5740\u5219\u4E0D\u914D\u7F6E)

  • \u4E00\u5B9A\u8981\u5728 /root \u7684\u8DEF\u5F84\u4E0B\u8FD0\u884C\u672C\u4ED3\u5E93\u811A\u672C\uFF0C\u4E14\u4F7F\u7528\u4E00\u952E\u811A\u672C\u7684\u4E0D\u8981\u5220\u9664\u8DEF\u5F84\u4E0B\u7684ssh.sh\u548Cconfig.sh\u6587\u4EF6

  • \u4FDD\u8BC1\u4F60\u8981\u5F00\u7684\u76D8\u4E3A\u9ED8\u8BA4\u7684\u7CFB\u7EDF\u76D8(sda\u6216\u8005sda1)\u800C\u4E0D\u662F\u6302\u8F7D\u7684\u76D8(sdb\u4E4B\u7C7B\u7684)\uFF0C\u4E0D\u786E\u5B9A\u7684\u4F7F\u7528fdisk -l\u548Cdf\u67E5\u770B

  • \u6302\u8F7D\u5176\u4ED6\u76D8\u7684\u8BE6\u770B \u5176\u4ED6\u8BF4\u660E

  • \u4E00\u952E\u811A\u672C\u652F\u6301\u81EA\u5B9A\u4E49\u9650\u5236\u6240\u6709\u5185\u5BB9\uFF0C\u666E\u901A\u7248\u672C\u652F\u6301\u591A\u6B21\u8FD0\u884C\u6279\u91CF\u751F\u6210\u4E0D\u8986\u76D6\u5148\u524D\u751F\u6210\u7684\u914D\u7F6E

\u68C0\u6D4B\u73AF\u5883

\u4F7F\u7528\u540E\u7EED\u811A\u672C\u7684\u52A1\u5FC5\u6267\u884C\u672C\u547D\u4EE4\u68C0\u6D4B\u6BCD\u9E21\u662F\u5426\u7B26\u5408\u8981\u6C42

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/pre_check.sh)
+
`,10),o=[l];function c(d,s,n,p,h,_){return i(),t("div",null,o)}var f=e(a,[["render",c]]);export{b as __pageData,f as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_lxd_precheck.md.0acc8392.lean.js b/docs/.vitepress/dist/assets/en_US_guide_lxd_precheck.md.0acc8392.lean.js new file mode 100644 index 0000000000..afc159e04a --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_lxd_precheck.md.0acc8392.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as i,a as r}from"./app.8fc4a373.js";const b='{"title":"\u914D\u7F6E\u8981\u6C42","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u914D\u7F6E\u8981\u6C42","slug":"\u914D\u7F6E\u8981\u6C42"},{"level":2,"title":"\u9879\u76EE\u7279\u70B9","slug":"\u9879\u76EE\u7279\u70B9"},{"level":2,"title":"\u68C0\u6D4B\u73AF\u5883","slug":"\u68C0\u6D4B\u73AF\u5883"}],"relativePath":"en_US/guide/lxd_precheck.md","lastUpdated":1687182420000}',a={},l=r("",10),o=[l];function c(d,s,n,p,h,_){return i(),t("div",null,o)}var f=e(a,[["render",c]]);export{b as __pageData,f as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_lxd_qa.md.e15607c8.js b/docs/.vitepress/dist/assets/en_US_guide_lxd_qa.md.e15607c8.js new file mode 100644 index 0000000000..099b88a0a0 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_lxd_qa.md.e15607c8.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as r,a as t}from"./app.8fc4a373.js";const v='{"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u53EF\u5F00\u5E26\u72EC\u7ACBIPV6\u5730\u5740\u5BB9\u5668\u7684VPS\u5546\u5BB6","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u53EF\u5F00\u5E26\u72EC\u7ACBIPV6\u5730\u5740\u5BB9\u5668\u7684VPS\u5546\u5BB6","slug":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u53EF\u5F00\u5E26\u72EC\u7ACBipv6\u5730\u5740\u5BB9\u5668\u7684vps\u5546\u5BB6"}],"relativePath":"en_US/guide/lxd_qa.md","lastUpdated":1687182420000}',p={},o=t('

\u76EE\u524D\u5DF2\u9A8C\u8BC1\u53EF\u5F00\u5E26\u72EC\u7ACBIPV6\u5730\u5740\u5BB9\u5668\u7684VPS\u5546\u5BB6

kuroit \u4E2D\u7684 \u7F8E\u56FD\u51E4\u51F0\u57CE regular

datalix \u4E2D\u7684 \u5FB7\u56FDAMD \u4FC3\u9500\u6B3E

luxvps \u4E2D\u7684 \u5FB7\u56FDAMD \u4FC3\u9500\u6B3E

',4),_=[o];function n(s,l,i,d,f,c){return r(),a("div",null,_)}var u=e(p,[["render",n]]);export{v as __pageData,u as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_lxd_qa.md.e15607c8.lean.js b/docs/.vitepress/dist/assets/en_US_guide_lxd_qa.md.e15607c8.lean.js new file mode 100644 index 0000000000..98776281ee --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_lxd_qa.md.e15607c8.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as r,a as t}from"./app.8fc4a373.js";const v='{"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u53EF\u5F00\u5E26\u72EC\u7ACBIPV6\u5730\u5740\u5BB9\u5668\u7684VPS\u5546\u5BB6","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u53EF\u5F00\u5E26\u72EC\u7ACBIPV6\u5730\u5740\u5BB9\u5668\u7684VPS\u5546\u5BB6","slug":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u53EF\u5F00\u5E26\u72EC\u7ACBipv6\u5730\u5740\u5BB9\u5668\u7684vps\u5546\u5BB6"}],"relativePath":"en_US/guide/lxd_qa.md","lastUpdated":1687182420000}',p={},o=t("",4),_=[o];function n(s,l,i,d,f,c){return r(),a("div",null,_)}var u=e(p,[["render",n]]);export{v as __pageData,u as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_lxd_thanks.md.2fce219f.js b/docs/.vitepress/dist/assets/en_US_guide_lxd_thanks.md.2fce219f.js new file mode 100644 index 0000000000..d6d0dd140b --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_lxd_thanks.md.2fce219f.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as t,a as n}from"./app.8fc4a373.js";const f='{"title":"\u81F4\u8C22","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u81F4\u8C22","slug":"\u81F4\u8C22"}],"relativePath":"en_US/guide/lxd_thanks.md","lastUpdated":1687182420000}',o={},a=n('

\u81F4\u8C22

https://github.com/lxc/lxd

https://lxdware.com/

https://discuss.linuxcontainers.org/

https://discuss.linuxcontainers.org/t/how-to-run-docker-inside-lxc-container/13017/4

https://discuss.linuxcontainers.org/t/error-seccomp-notify-not-supported-on-container-start/15038/3

https://discuss.linuxcontainers.org/t/how-do-i-assign-a-public-ipv6-address-to-a-lxc-container/6028

https://github.com/turtle0x1/LxdMosaic

https://openzfs.github.io/openzfs-docs/Getting Started/Debian/index.html

\u611F\u8C22 @Ella-Alinda @fscarmen \u63D0\u4F9B\u7684\u6307\u5BFC

',10),s=[a];function i(p,c,l,d,h,u){return t(),r("div",null,s)}var g=e(o,[["render",i]]);export{f as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_lxd_thanks.md.2fce219f.lean.js b/docs/.vitepress/dist/assets/en_US_guide_lxd_thanks.md.2fce219f.lean.js new file mode 100644 index 0000000000..c82ec7488c --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_lxd_thanks.md.2fce219f.lean.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as t,a as n}from"./app.8fc4a373.js";const f='{"title":"\u81F4\u8C22","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u81F4\u8C22","slug":"\u81F4\u8C22"}],"relativePath":"en_US/guide/lxd_thanks.md","lastUpdated":1687182420000}',o={},a=n("",10),s=[a];function i(p,c,l,d,h,u){return t(),r("div",null,s)}var g=e(o,[["render",i]]);export{f as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_pve_install.md.ca0fd343.js b/docs/.vitepress/dist/assets/en_US_guide_pve_install.md.ca0fd343.js new file mode 100644 index 0000000000..d16912ec60 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_pve_install.md.ca0fd343.js @@ -0,0 +1,7 @@ +import{_ as s,c as e,o as a,a as t}from"./app.8fc4a373.js";const k='{"title":"\u4E00\u952E\u5B89\u88C5PVE","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u4E00\u952E\u5B89\u88C5PVE","slug":"\u4E00\u952E\u5B89\u88C5pve"},{"level":2,"title":"\u9884\u914D\u7F6E\u73AF\u5883","slug":"\u9884\u914D\u7F6E\u73AF\u5883"},{"level":3,"title":"\u81EA\u52A8\u914D\u7F6E\u5BBF\u4E3B\u673A\u7684\u7F51\u5173","slug":"\u81EA\u52A8\u914D\u7F6E\u5BBF\u4E3B\u673A\u7684\u7F51\u5173"}],"relativePath":"en_US/guide/pve_install.md","lastUpdated":1687182420000}',n={},c=t(`

\u4E00\u952E\u5B89\u88C5PVE

  • \u5B89\u88C5\u7684\u662F\u5F53\u4E0Bapt\u6E90\u6700\u65B0\u7684PVE
  • \u6BD4\u5982debian10\u5219\u662Fpve6.4\uFF0Cdebian11\u5219\u662Fpve7.x\uFF0Cdebian12\u5219\u662Fpve8.x

TIP

\u5EFA\u8BAEdebian11\u800C\u4E0D\u662Fdebian12\uFF0C\u56E0\u4E3A\u540E\u8005\u662Fbeta\u7248\u672C\uFF0Cdebian11\u5B89\u88C5\u7684\u624D\u662F\u7A33\u5B9A\u7248

  • /etc/hosts\u6587\u4EF6\u4FEE\u6539(\u4FEE\u6B63\u5546\u5BB6hostname\u8BBE\u7F6E\u9519\u8BEF\u4EE5\u53CA\u65B0\u589EPVE\u6240\u9700\u7684\u5185\u5BB9)
  • \u5DF2\u8BBE\u7F6E/etc/hosts\u4E3A\u53EA\u8BFB\u6A21\u5F0F\uFF0C\u907F\u514D\u91CD\u542F\u540E\u6587\u4EF6\u88AB\u8986\u5199\uFF0C\u5982\u9700\u4FEE\u6539\u8BF7\u4F7F\u7528chattr -i /etc/hosts\u53D6\u6D88\u53EA\u8BFB\u9501\u5B9A\uFF0C\u4FEE\u6539\u5B8C\u6BD5\u8BF7\u6267\u884Cchattr +i /etc/hosts\u53EA\u8BFB\u9501\u5B9A
  • \u68C0\u6D4B/etc/cloud/cloud.cfg\u5982\u679C\u53D1\u73B0preserve_hostname\u662Ffalse\uFF0C\u5219\u6539\u4E3Atrue\uFF0C\u540C\u4E0A\uFF0C\u4E5F\u7528chattr\u547D\u4EE4\u8FDB\u884C\u4E86\u6587\u4EF6\u9501\u5B9A\u907F\u514D\u91CD\u542F\u8986\u76D6\u8BBE\u7F6E
  • \u68C0\u6D4B\u662F\u5426\u4E3A\u4E2D\u56FDIP\uFF0C\u5982\u679C\u4E3A\u4E2D\u56FDIP\u4F7F\u7528\u6E05\u534E\u955C\u50CF\u6E90\uFF0C\u5426\u5219\u4F7F\u7528\u5B98\u65B9\u6E90
  • \u5B89\u88C5PVE\u5F00\u865A\u62DF\u673A\u9700\u8981\u7684\u5FC5\u5907\u5DE5\u5177\u5305
  • \u66FF\u6362apt\u6E90\u4E2D\u7684\u4F01\u4E1A\u8BA2\u9605\u4E3A\u793E\u533A\u6E90
  • \u6253\u5370\u67E5\u8BE2Linux\u7CFB\u7EDF\u5185\u6838\u548CPVE\u5185\u6838\u662F\u5426\u5DF2\u5B89\u88C5
  • \u68C0\u6D4B/etc/resolv.conf\u662F\u5426\u4E3A\u7A7A\uFF0C\u4E3A\u7A7A\u5219\u8BBE\u7F6E\u68C0\u6D4B8.8.8.8\u7684\u5F00\u673A\u81EA\u542F\u6DFB\u52A0DNS\u7684systemd\u670D\u52A1
  • \u65B0\u589EPVE\u7684APT\u6E90\u94FE\u63A5\u540E\uFF0C\u4E0B\u8F7DPVE\u5E76\u6253\u5370\u8F93\u51FA\u767B\u9646\u4FE1\u606F

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/install_pve.sh -o install_pve.sh && chmod +x install_pve.sh && bash install_pve.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/install_pve.sh -o install_pve.sh && chmod +x install_pve.sh && bash install_pve.sh
+

\u9884\u914D\u7F6E\u73AF\u5883

  • \u521B\u5EFA\u8D44\u6E90\u6C60mypool
  • \u79FB\u9664\u8BA2\u9605\u5F39\u7A97
  • \u5C1D\u8BD5\u5F00\u542F\u786C\u4EF6\u76F4\u901A
  • \u68C0\u6D4BAppArmor\u6A21\u5757\u5E76\u8BD5\u56FE\u5B89\u88C5
  • \u91CD\u542F\u7CFB\u7EDF\u524D\u63A8\u8350\u6302\u4E0Anezha\u63A2\u9488\u65B9\u4FBF\u5728\u540E\u53F0\u4E0D\u901A\u8FC7SSH\u4F7F\u7528\u547D\u4EE4\u884C\uFF0C\u907F\u514DSSH\u53EF\u80FD\u56E0\u4E3A\u5546\u5BB6\u5947\u8469\u7684\u9884\u8BBE\u5BFC\u81F4\u91CD\u542F\u540Eroot\u5BC6\u7801\u4E22\u5931
  • \u6267\u884C\u5B8C\u6BD5\u5EFA\u8BAE\u7B49\u5F85\u51E0\u5206\u949F\u540E\u518D\u91CD\u542F\u670D\u52A1\u5668\uFF0C\u6267\u884Creboot\u524D\u9700\u8981\u7B49\u5F85\u540E\u53F0\u4EFB\u52A1\u6267\u884C\u5B8C\u6BD5\uFF0C\u4E00\u4E9B\u5BBF\u4E3B\u673A\u7684\u7CFB\u7EDFapt\u547D\u4EE4\u6267\u884C\u5F88\u6162\uFF0C\u5F97\u7B49\u4E00\u4F1A\u624D\u80FD\u6267\u884C\u5B8C\u6BD5

\u56FD\u9645

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_backend.sh)
+

\u56FD\u5185

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_backend.sh)
+

\u81EA\u52A8\u914D\u7F6E\u5BBF\u4E3B\u673A\u7684\u7F51\u5173

WARNING

\u4F7F\u7528\u524D\u8BF7\u4FDD\u8BC1\u91CD\u542F\u8FC7\u670D\u52A1\u5668\u4E14\u6B64\u65F6PVE\u80FD\u6B63\u5E38\u4F7F\u7528WEB\u7AEF\u518D\u6267\u884C\uFF0C\u91CD\u542F\u673A\u5668\u540E\u4E0D\u8981\u7ACB\u5373\u6267\u884C\u6B64\u547D\u4EE4\uFF0C\u5F85WEB\u7AEF\u542F\u52A8\u6210\u529F\u540E\u81F3\u5C11\u7B495\u5206\u949F\u518D\u6267\u884C\u672C\u547D\u4EE4

TIP

\u8FD9\u4E00\u6B65\u662F\u6700\u5BB9\u6613\u9020\u6210SSH\u65AD\u5F00\u7684\uFF0C\u539F\u56E0\u662F\u672A\u7B49\u5F85PVE\u5185\u6838\u542F\u52A8\u5C31\u4FEE\u6539\u7F51\u7EDC\u4F1A\u9020\u6210\u8BBE\u7F6E\u51B2\u7A81\uFF0C\u6240\u4EE5\u81F3\u5C11\u7B49\u51E0\u5206\u949F\u5F85\u5185\u6838\u542F\u52A8\u4E5F\u5C31\u662FWEB\u7AEF\u542F\u52A8\u6210\u529F\u540E\u518D\u6267\u884C

  • \u521B\u5EFAvmbr0\uFF0C\u6BCD\u9E21\u5141\u8BB8addr\u548Cgateway\u4E3A\u5185\u7F51IP\u6216\u5916\u7F51IP\uFF0C\u5DF2\u81EA\u52A8\u8BC6\u522B
  • vmbr0\u521B\u5EFA\u652F\u6301\u7EAFIPV4\u6216\u53CC\u6808\u670D\u52A1\u5668\uFF0C\u81EA\u52A8\u8BC6\u522BIPV4\u5730\u5740\u548CIPV6\u5730\u5740\uFF0C\u81EA\u52A8\u8BC6\u522B\u5BF9\u5E94\u7684IP\u533A\u95F4
  • \u521B\u5EFAvmbr1(NAT\u7F51\u5173)
  • \u5F00NAT\u865A\u62DF\u673A\u65F6\u7F51\u5173\uFF08IPV4\uFF09\u4F7F\u7528172.16.1.1\uFF0CIPV4/CIDR\u4F7F\u7528172.16.1.x/24\uFF0C\u8FD9\u91CC\u7684x\u4E0D\u80FD\u662F1\uFF0C\u5F53\u7136\u5982\u679C\u540E\u7EED\u4F7F\u7528\u672C\u5957\u811A\u672C\u65E0\u9700\u5173\u6CE8\u8FD9\u70B9\u7EC6\u679D\u672B\u8282\u7684\u4E1C\u897F
  • \u60F3\u67E5\u770B\u5B8C\u6574\u8BBE\u7F6E\u53EF\u4EE5\u6267\u884Ccat /etc/network/interfaces\u67E5\u770B
  • \u52A0\u8F7Diptables\u5E76\u8BBE\u7F6E\u56DE\u6E90\u4E14\u5141\u8BB8NAT\u7AEF\u53E3\u8F6C\u53D1

\u56FD\u9645

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_nat_network.sh)
+

\u56FD\u5185

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_nat_network.sh)
+
`,22),o=[c];function p(i,l,r,d,h,u){return a(),e("div",null,o)}var m=s(n,[["render",p]]);export{k as __pageData,m as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_pve_install.md.ca0fd343.lean.js b/docs/.vitepress/dist/assets/en_US_guide_pve_install.md.ca0fd343.lean.js new file mode 100644 index 0000000000..edfacd7dd1 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_pve_install.md.ca0fd343.lean.js @@ -0,0 +1 @@ +import{_ as s,c as e,o as a,a as t}from"./app.8fc4a373.js";const k='{"title":"\u4E00\u952E\u5B89\u88C5PVE","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u4E00\u952E\u5B89\u88C5PVE","slug":"\u4E00\u952E\u5B89\u88C5pve"},{"level":2,"title":"\u9884\u914D\u7F6E\u73AF\u5883","slug":"\u9884\u914D\u7F6E\u73AF\u5883"},{"level":3,"title":"\u81EA\u52A8\u914D\u7F6E\u5BBF\u4E3B\u673A\u7684\u7F51\u5173","slug":"\u81EA\u52A8\u914D\u7F6E\u5BBF\u4E3B\u673A\u7684\u7F51\u5173"}],"relativePath":"en_US/guide/pve_install.md","lastUpdated":1687182420000}',n={},c=t("",22),o=[c];function p(i,l,r,d,h,u){return a(),e("div",null,o)}var m=s(n,[["render",p]]);export{k as __pageData,m as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_pve_kvm.md.036cbd27.js b/docs/.vitepress/dist/assets/en_US_guide_pve_kvm.md.036cbd27.js new file mode 100644 index 0000000000..b3c35ca6be --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_pve_kvm.md.036cbd27.js @@ -0,0 +1,27 @@ +import{_ as s,c as a,o as e,a as n}from"./app.8fc4a373.js";const v='{"title":"\u90E8\u5206\u6CE8\u610F\u4E8B\u9879","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u90E8\u5206\u6CE8\u610F\u4E8B\u9879","slug":"\u90E8\u5206\u6CE8\u610F\u4E8B\u9879"},{"level":3,"title":"\u5355\u72EC\u5F00\u8BBEKVM\u865A\u62DF\u5316\u7684VM","slug":"\u5355\u72EC\u5F00\u8BBEkvm\u865A\u62DF\u5316\u7684vm"},{"level":3,"title":"\u6279\u91CF\u5F00\u8BBENAT\u7684KVM\u865A\u62DF\u5316\u7684VM","slug":"\u6279\u91CF\u5F00\u8BBEnat\u7684kvm\u865A\u62DF\u5316\u7684vm"},{"level":3,"title":"\u5F00\u8BBE\u72EC\u7ACBIPV4\u5730\u5740\u7684VM","slug":"\u5F00\u8BBE\u72EC\u7ACBipv4\u5730\u5740\u7684vm"},{"level":3,"title":"\u5220\u9664\u793A\u4F8B","slug":"\u5220\u9664\u793A\u4F8B-1"}],"relativePath":"en_US/guide/pve_kvm.md","lastUpdated":1687182420000}',t={},p=n(`

\u90E8\u5206\u6CE8\u610F\u4E8B\u9879

\u6267\u884C\u672C\u9879\u76EE\u7684\u7B2C\u4E00\u4E2A\u68C0\u6D4B\u73AF\u5883\u7684\u547D\u4EE4\uFF0C\u5C55\u793A\u5982\u4E0B


![coode](./images/pve_kvm/pve_kvm_1.png)

\u67E5\u8BE2\u5982\u4E0A\u7684\u53EA\u9700\u4F7F\u7528\u4E0B\u9762\u7684\u4E00\u952E\u811A\u672C\u81EA\u52A8\u521B\u5EFA\u865A\u62DF\u673A\u5373\u53EF\uFF0C\u65E0\u9700\u624B\u52A8\u518D\u4FEE\u6539WEB\u7AEF\u8BBE\u7F6E


![coode](./images/pve_kvm/pve_kvm_2.png)

\u67E5\u8BE2\u5982\u4E0A\u7684\u5728\u4F7F\u7528\u540E\u7EED\u811A\u672C\u521B\u5EFA\u4E86\u865A\u62DF\u673A\u540E\uFF0C\u53EF\u80FD\u9700\u8981\u624B\u52A8\u4FEE\u6539WEB\u7AEF\u8BBE\u7F6E\uFF0C\u9700\u8981\u5173\u95ED\u5BF9\u5E94\u6BCF\u4E2A\u865A\u62DF\u673A\u7684\u786C\u4EF6\u5D4C\u5957\u865A\u62DF\u5316\uFF0C\u5982\u4E0B\u56FE


![coode](./images/pve_kvm/pve_kvm_3.png)

\u5148\u505C\u6B62\u865A\u62DF\u673A\u518D\u4FEE\u6539\uFF0C\u4FEE\u6539\u5B8C\u540E\u518D\u5F00\u673A\u624D\u80FD\u4F7F\u7528NOVNC\uFF0C\u4E0D\u5173\u95ED\u53EF\u80FD\u5BFC\u81F4\u8FD9\u4E2A\u865A\u62DF\u673A\u6709BUG\u65E0\u6CD5\u4F7F\u7528

\u5982\u679C\u5F3A\u884C\u5B89\u88C5PVE\u5F00KVM\uFF0C\u542F\u52A8\u4E0D\u4E86\u7684\u4E5F\u53EF\u4EE5\u5173\u95ED\u8FD9\u4E2A\u9009\u9879\u8BD5\u8BD5\u80FD\u4E0D\u80FD\u542F\u52A8\u865A\u62DF\u673A

\u5355\u72EC\u5F00\u8BBEKVM\u865A\u62DF\u5316\u7684VM

  • \u81EA\u52A8\u5F00\u8BBENAT\u670D\u52A1\u5668\uFF0C\u9ED8\u8BA4\u4F7F\u7528Debian10\u955C\u50CF\uFF0C\u56E0\u4E3A\u8BE5\u955C\u50CF\u5360\u7528\u6700\u5C0F
  • \u53EF\u5728\u547D\u4EE4\u4E2D\u81EA\u5B9A\u4E49\u9700\u8981\u4F7F\u7528\u7684\u955C\u50CF\uFF0C\u8FD9\u91CC\u6709\u7ED9\u51FA\u914D\u7F6E\u597D\u7684\u955C\u50CF\uFF0C\u955C\u50CF\u81EA\u5E26\u7A7A\u95F4\u8BBE\u7F6E\u662F2~10G\u786C\u76D8\uFF0C\u65E5\u5E38\u4F7F\u7528\u81F3\u5C1110G\u4EE5\u4E0A\u5373\u53EF\uFF0C\u9664\u975E\u67D0\u4E9B\u955C\u50CF\u5F00\u4E0D\u8D77\u6765\u518D\u589E\u52A0\u786C\u76D8\u5927\u5C0F
  • \u53EF\u5728\u547D\u4EE4\u4E2D\u6307\u5B9A\u5B58\u50A8\u76D8\u4F4D\u7F6E\uFF0C\u9ED8\u8BA4\u4E0D\u6307\u5B9A\u65F6\u4E3Alocal\u76D8\u5373\u7CFB\u7EDF\u76D8\uFF0C\u53EF\u6307\u5B9A\u4E3APVE\u4E2D\u663E\u793A\u7684\u6302\u8F7D\u76D8
  • \u81EA\u5B9A\u4E49\u5185\u5B58\u5927\u5C0F\u63A8\u8350512MB\u5185\u5B58

TIP

\u9700\u8981\u6CE8\u610F\u7684\u662F\u5BBF\u4E3B\u673A\u5185\u5B58\u8BB0\u5F97\u5F00\u70B9swap\u514D\u5F97\u673A\u5668\u70B8\u4E86\u5F00SWAP\u70B9\u6211\u8DF3\u8F6C

  • \u81EA\u52A8\u8FDB\u884C\u5185\u5916\u7F51\u7AEF\u53E3\u6620\u5C04\uFF0C\u542B22\uFF0C80\uFF0C443\u7AEF\u53E3\u4EE5\u53CA\u5176\u4ED625\u4E2A\u5185\u5916\u7F51\u7AEF\u53E3\u53F7\u4E00\u6837\u7684\u7AEF\u53E3
  • \u751F\u6210\u540E\u9700\u8981\u7B49\u5F85\u4E00\u6BB5\u65F6\u95F4\u865A\u62DF\u673A\u5185\u90E8\u7684cloud-init\u914D\u7F6E\u597D\u7F51\u7EDC\u4EE5\u53CA\u767B\u9646\u4FE1\u606F\uFF0C\u5927\u6982\u9700\u89815\u5206\u949F
  • \u865A\u62DF\u673A\u7684\u76F8\u5173\u4FE1\u606F\u5C06\u4F1A\u5B58\u50A8\u5230WEB\u7AEF\u5BF9\u5E94VM\u7684NOTES\u4E2D\uFF0C\u53EF\u5728WEB\u7AEF\u67E5\u770B

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm.sh -o buildvm.sh && chmod +x buildvm.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm.sh -o buildvm.sh && chmod +x buildvm.sh
+

\u4F7F\u7528\u65B9\u6CD5

  • \u7CFB\u7EDF\u652F\u6301\uFF1A\u8BE6\u89C1 \u8DF3\u8F6C \u4E2D\u5217\u51FA\u7684\u7CFB\u7EDF\uFF0C\u4F7F\u7528\u65F6\u53EA\u9700\u5199\u6587\u4EF6\u540D\u5B57\uFF0C\u4E0D\u9700\u8981.qcow2\u5C3E\u7F00

TIP

\u6CE8\u610F\u8FD9\u91CC\u7684\u7528\u6237\u540D\u4E0D\u80FD\u662F\u7EAF\u6570\u5B57\uFF0C\u4F1A\u9020\u6210cloudinit\u51FA\u95EE\u9898\uFF0C\u6700\u597D\u662F\u7EAF\u82F1\u6587\u6216\u82F1\u6587\u5F00\u5934

./buildvm.sh VMID \u7528\u6237\u540D \u5BC6\u7801 CPU\u6838\u6570 \u5185\u5B58 \u786C\u76D8 SSH\u7AEF\u53E3 80\u7AEF\u53E3 443\u7AEF\u53E3 \u5916\u7F51\u7AEF\u53E3\u8D77 \u5916\u7F51\u7AEF\u53E3\u6B62 \u7CFB\u7EDF \u5B58\u50A8\u76D8
+

\u6D4B\u8BD5\u793A\u4F8B

  • \u4EE5\u4E0B\u4E3A\u5F00\u8BBE\u7684\u793A\u4F8BVM\u7684\u4FE1\u606F\uFF1A
    VMID - 102 SSH\u767B\u5F55\u7684\u7528\u6237\u540D - test1 SSH\u767B\u5F55\u7684\u5BC6\u7801 - 1234567 CPU\u6838\u6570 - 1
    \u5185\u5B58\u5927\u5C0F - 512MB \u78C1\u76D8\u5927\u5C0F - 10G
    SSH\u7AEF\u53E3 - 40001 80\u7AEF\u53E3 - 40002 443\u7AEF\u53E3 - 40003 \u5185\u5916\u7F51\u6620\u5C04\u7AEF\u53E3\u4E00\u81F4\u7684\u533A\u95F4 - 50000\u523050025 \u7CFB\u7EDF - ubuntu20 \u5BBF\u4E3B\u673A\u7684\u5B58\u50A8\u76D8 - local
./buildvm.sh 102 test1 1234567 1 512 10 40001 40002 40003 50000 50025 ubuntu20 local
+

\u5F00\u8BBE\u5B8C\u6BD5\u53EF\u6267\u884Ccat vm102\u67E5\u770B\u4FE1\u606F\uFF0C\u6216\u5230WEB\u7AEF\u5BF9\u5E94VM\u7684NOTES\u4E2D\u67E5\u770B

\u5220\u9664\u793A\u4F8B

  • \u505C\u6B62VM
  • \u5220\u9664VM
  • \u5220\u9664\u7AEF\u53E3\u6620\u5C04
  • \u91CD\u542F\u7F51\u7EDC
  • \u5220\u9664log\u6587\u4EF6
qm stop 102
+qm destroy 102
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+rm -rf vm102
+

\u76F8\u5173qcow2\u955C\u50CF

  • \u5DF2\u9884\u5B89\u88C5\u5F00\u542Fcloudinit\uFF0C\u5F00\u542FSSH\u767B\u9646\uFF0C\u9884\u8BBE\u503CSSH\u76D1\u542CV4\u548CV6\u768422\u7AEF\u53E3\uFF0C\u5F00\u542F\u5141\u8BB8\u5BC6\u7801\u9A8C\u8BC1\u767B\u9646\uFF0C\u5F00\u542F\u5141\u8BB8ROOT\u767B\u9646

\u76EE\u524D\u4F7F\u7528\u7684\u955C\u50CF\u5217\u8868\u4E3A

https://github.com/spiritLHLS/Images/releases/tag/v1.0

\u6279\u91CF\u5F00\u8BBENAT\u7684KVM\u865A\u62DF\u5316\u7684VM

WARNING

\u521D\u6B21\u4F7F\u7528\u524D\u9700\u8981\u4FDD\u8BC1\u5F53\u524DPVE\u7EAF\u51C0\u4E14\u5BBF\u4E3B\u673A\u672A\u8FDB\u884C\u8FC7\u4EFB\u4F55\u7AEF\u53E3\u6620\u5C04\uFF0C\u5426\u5219\u8BBE\u7F6E\u51B2\u7A81\u53EF\u80FD\u51FA\u73B0BUG \u5F00\u8BBE\u524D\u8BF7\u4F7F\u7528screen\u6302\u8D77\u6267\u884C\uFF0C\u907F\u514D\u6279\u91CF\u5F00\u8BBE\u65F6\u95F4\u8FC7\u957F\uFF0CSSH\u4E0D\u7A33\u5B9A\u5BFC\u81F4\u4E2D\u95F4\u6267\u884C\u4E2D\u65AD

  • \u53EF\u591A\u6B21\u8FD0\u884C\u6279\u91CF\u751F\u6210VM
  • \u81EA\u52A8\u5F00\u8BBENAT\u670D\u52A1\u5668\uFF0C\u9009\u9879\u7559\u7A7A\u9ED8\u8BA4\u4F7F\u7528debian11\u955C\u50CF\uFF0C\u53EF\u81EA\u5B9A\u4E49\u4F7F\u7528\u955C\u50CF\u540D\u5B57\uFF0C\u652F\u6301\u7684\u7CFB\u7EDF\u540D\u5B57\u8BE6\u89C1\u4E0A\u6587\u652F\u6301\u7684\u955C\u50CF\u5217\u8868
  • \u81EA\u52A8\u8FDB\u884C\u5185\u5916\u7F51\u7AEF\u53E3\u6620\u5C04\uFF0C\u542B22\uFF0C80\uFF0C443\u7AEF\u53E3\u4EE5\u53CA\u5176\u4ED625\u4E2A\u5185\u5916\u7F51\u7AEF\u53E3\u53F7\u4E00\u6837\u7684\u7AEF\u53E3
  • \u751F\u6210\u540E\u9700\u8981\u7B49\u5F85\u4E00\u6BB5\u65F6\u95F4\u865A\u62DF\u673A\u5185\u90E8\u7684cloudinit\u914D\u7F6E\u597D\u7F51\u7EDC\u4EE5\u53CA\u767B\u9646\u4FE1\u606F\uFF0C\u5927\u6982\u9700\u89815\u5206\u949F\uFF0C\u6BCF\u4E2A\u865A\u62DF\u673A\u521B\u5EFA\u4E4B\u95F4\u6709\u95F4\u9694\u7B49\u5F8560\u79D2\u907F\u514D\u7A81\u53D1\u6027\u80FD\u4E0D\u8DB3
  • \u9ED8\u8BA4\u6279\u91CF\u5F00\u8BBE\u7684\u865A\u62DF\u673A\u7F51\u7EDC\u914D\u7F6E\u4E3A\uFF1A22\uFF0C80\uFF0C443\u7AEF\u53E3\u53CA\u4E00\u4E2A25\u4E2A\u7AEF\u53E3\u533A\u95F4\u7684\u5185\u5916\u7F51\u6620\u5C04
  • \u53EF\u81EA\u5B9A\u4E49\u6279\u91CF\u5F00\u8BBE\u7684\u6838\u5FC3\u6570\uFF0C\u5185\u5B58\u5927\u5C0F\uFF0C\u786C\u76D8\u5927\u5C0F\uFF0C\u4F7F\u7528\u5BBF\u4E3B\u673A\u54EA\u4E2A\u5B58\u50A8\u76D8\uFF0C\u8BB0\u5F97\u81EA\u5DF1\u8BA1\u7B97\u597D\u7A7A\u95F2\u8D44\u6E90\u5F00\u8BBE
  • \u865A\u62DF\u673A\u7684\u76F8\u5173\u4FE1\u606F\u5C06\u4F1A\u5B58\u50A8\u5230WEB\u7AEF\u5BF9\u5E94VM\u7684NOTES\u4E2D\uFF0C\u53EF\u5728WEB\u7AEF\u67E5\u770B

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_vm.sh -o create_vm.sh && chmod +x create_vm.sh && bash create_vm.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_vm.sh -o create_vm.sh && chmod +x create_vm.sh && bash create_vm.sh
+

\u5F00\u8BBE\u5B8C\u6BD5\u53EF\u6267\u884Ccat vmlog\u67E5\u770B\u4FE1\u606F\uFF0C\u6216\u5230WEB\u7AEF\u5BF9\u5E94VM\u7684NOTES\u4E2D\u67E5\u770B

\u5220\u9664\u6240\u6709VM

  • \u5220\u9664\u6240\u6709VM
  • \u5220\u9664\u6240\u6709nat\u7684\u7AEF\u53E3\u6620\u5C04
  • \u91CD\u542F\u7F51\u7EDC
  • \u5220\u9664log\u6587\u4EF6
for vmid in $(qm list | awk '{if(NR>1) print $1}'); do qm stop $vmid; qm destroy $vmid; rm -rf /var/lib/vz/images/$vmid*; done
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+rm -rf vmlog
+

TIP

PVE\u4FEE\u6539VM\u914D\u7F6E\u524D\u90FD\u5F97\u505C\u673A\u5148\uFF0C\u518D\u4FEE\u6539\u914D\u7F6E\uFF0C\u4FEE\u6539\u5B8C\u518D\u542F\u52A8\uFF0C\u514D\u5F97\u51FA\u73B0\u914D\u7F6E\u91CD\u8F7D\u9519\u8BEF

\u5F00\u8BBE\u72EC\u7ACBIPV4\u5730\u5740\u7684VM

WARNING

\u4F7F\u7528\u524D\u9700\u8981\u4FDD\u8BC1\u5F53\u524D\u5BBF\u4E3B\u673A\u7684IP\u6BB5\u5E26\u4E86\u81F3\u5C112\u4E2AIP\uFF0C\u4E14\u6709\u7A7A\u4F59\u7684IP\u672A\u914D\u7F6E\uFF0C\u8BE5\u7A7A\u4F59\u7684IP\u672A\u7ED1\u5B9A\u5BBF\u4E3B\u673A \u5F00\u8BBE\u524D\u8BF7\u4F7F\u7528screen\u6302\u8D77\u6267\u884C\uFF0C\u907F\u514D\u5F00\u8BBE\u65F6\u95F4\u8FC7\u957F\uFF0CSSH\u4E0D\u7A33\u5B9A\u5BFC\u81F4\u4E2D\u95F4\u6267\u884C\u4E2D\u65AD

  • \u81EA\u52A8\u68C0\u6D4B\u53EF\u7528\u7684IP\u533A\u95F4\uFF0C\u901A\u8FC7ping\u68C0\u6D4B\u7A7A\u4F59\u53EF\u4F7F\u7528\u7684IP\uFF0C\u9009\u53D6\u5176\u4E2D\u4E4B\u4E00\u7ED1\u5B9A\u5230\u865A\u62DF\u673A\u4E0A
  • \u7CFB\u7EDF\u7684\u76F8\u5173\u4FE1\u606F\u5C06\u4F1A\u5B58\u50A8\u5230\u5BF9\u5E94\u7684\u865A\u62DF\u673A\u7684NOTE\u4E2D\uFF0C\u53EF\u5728WEB\u7AEF\u67E5\u770B

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm_extraip.sh -o buildvm_extraip.sh && chmod +x buildvm_extraip.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm_extraip.sh -o buildvm_extraip.sh && chmod +x buildvm_extraip.sh
+

\u521B\u5EFA\u793A\u4F8B

./buildvm_extraip.sh VMID \u7528\u6237\u540D \u5BC6\u7801 CPU\u6838\u6570 \u5185\u5B58\u5927\u5C0F\u4EE5MB\u8BA1\u7B97 \u786C\u76D8\u5927\u5C0F\u4EE5GB\u8BA1\u7B97 \u7CFB\u7EDF \u5B58\u50A8\u76D8
+
./buildvm_extraip.sh 152 test1 1234567 1 1024 10 ubuntu20 local
+

\u4E0A\u8FF0\u547D\u4EE4\u610F\u4E49\u4E3A\u5F00\u8BBE\u4E00\u4E2A\u5E26\u72EC\u7ACBIPV4\u5730\u5740\u7684\u865A\u62DF\u673A\uFF0CVMID\u662F152\uFF0C\u7528\u6237\u540D\u662Ftest1\uFF0C\u5BC6\u7801\u662F1234567\uFF0CCPU\u662F1\u6838\uFF0C\u5185\u5B58\u662F1024MB\uFF0C\u786C\u76D8\u662F10G\uFF0C\u7CFB\u7EDF\u662FUbuntu20\uFF0C\u5B58\u50A8\u76D8\u662Flocal\u76D8\u4E5F\u5C31\u662F\u7CFB\u7EDF\u76D8

\u5220\u9664\u793A\u4F8B

qm stop 152
+qm destroy 152
+rm -rf vm152
+
`,63),l=[p];function o(i,c,r,d,u,m){return e(),a("div",null,l)}var k=s(t,[["render",o]]);export{v as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_pve_kvm.md.036cbd27.lean.js b/docs/.vitepress/dist/assets/en_US_guide_pve_kvm.md.036cbd27.lean.js new file mode 100644 index 0000000000..e645766149 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_pve_kvm.md.036cbd27.lean.js @@ -0,0 +1 @@ +import{_ as s,c as a,o as e,a as n}from"./app.8fc4a373.js";const v='{"title":"\u90E8\u5206\u6CE8\u610F\u4E8B\u9879","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u90E8\u5206\u6CE8\u610F\u4E8B\u9879","slug":"\u90E8\u5206\u6CE8\u610F\u4E8B\u9879"},{"level":3,"title":"\u5355\u72EC\u5F00\u8BBEKVM\u865A\u62DF\u5316\u7684VM","slug":"\u5355\u72EC\u5F00\u8BBEkvm\u865A\u62DF\u5316\u7684vm"},{"level":3,"title":"\u6279\u91CF\u5F00\u8BBENAT\u7684KVM\u865A\u62DF\u5316\u7684VM","slug":"\u6279\u91CF\u5F00\u8BBEnat\u7684kvm\u865A\u62DF\u5316\u7684vm"},{"level":3,"title":"\u5F00\u8BBE\u72EC\u7ACBIPV4\u5730\u5740\u7684VM","slug":"\u5F00\u8BBE\u72EC\u7ACBipv4\u5730\u5740\u7684vm"},{"level":3,"title":"\u5220\u9664\u793A\u4F8B","slug":"\u5220\u9664\u793A\u4F8B-1"}],"relativePath":"en_US/guide/pve_kvm.md","lastUpdated":1687182420000}',t={},p=n("",63),l=[p];function o(i,c,r,d,u,m){return e(),a("div",null,l)}var k=s(t,[["render",o]]);export{v as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_pve_lxc.md.889c2001.js b/docs/.vitepress/dist/assets/en_US_guide_pve_lxc.md.889c2001.js new file mode 100644 index 0000000000..5ee4d314b2 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_pve_lxc.md.889c2001.js @@ -0,0 +1,20 @@ +import{_ as s,c as a,o as e,a as n}from"./app.8fc4a373.js";const m='{"title":"\u5355\u72EC\u5F00\u8BBELXC\u865A\u62DF\u5316\u7684CT","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u5355\u72EC\u5F00\u8BBELXC\u865A\u62DF\u5316\u7684CT","slug":"\u5355\u72EC\u5F00\u8BBElxc\u865A\u62DF\u5316\u7684ct"},{"level":2,"title":"\u6279\u91CF\u5F00\u8BBENAT\u7684LXC\u865A\u62DF\u5316\u7684CT","slug":"\u6279\u91CF\u5F00\u8BBEnat\u7684lxc\u865A\u62DF\u5316\u7684ct"}],"relativePath":"en_US/guide/pve_lxc.md","lastUpdated":1687182420000}',t={},c=n(`

\u5355\u72EC\u5F00\u8BBELXC\u865A\u62DF\u5316\u7684CT

WARNING

\u521D\u6B21\u4F7F\u7528\u524D\u9700\u8981\u4FDD\u8BC1\u5F53\u524DPVE\u7EAF\u51C0\u4E14\u5BBF\u4E3B\u673A\u672A\u8FDB\u884C\u8FC7\u4EFB\u4F55\u7AEF\u53E3\u6620\u5C04\uFF0C\u5426\u5219\u8BBE\u7F6E\u51B2\u7A81\u53EF\u80FD\u51FA\u73B0BUG \u5F00\u8BBE\u524D\u8BF7\u4F7F\u7528screen\u6302\u8D77\u6267\u884C\uFF0C\u907F\u514D\u6279\u91CF\u5F00\u8BBE\u65F6\u95F4\u8FC7\u957F\uFF0CSSH\u4E0D\u7A33\u5B9A\u5BFC\u81F4\u4E2D\u95F4\u6267\u884C\u4E2D\u65AD

  • \u81EA\u52A8\u5F00\u8BBENAT\u670D\u52A1\u5668\uFF0C\u9ED8\u8BA4\u4F7F\u7528Debian11\u955C\u50CF\uFF0C\u4E5F\u53EF\u81EA\u5B9A\u4E49\u7CFB\u7EDF
  • \u81EA\u52A8\u8FDB\u884C\u5185\u5916\u7F51\u7AEF\u53E3\u6620\u5C04\uFF0C\u542B22\uFF0C80\uFF0C443\u7AEF\u53E3\u4EE5\u53CA\u5176\u4ED625\u4E2A\u5185\u5916\u7F51\u7AEF\u53E3\u53F7\u4E00\u6837\u7684\u7AEF\u53E3
  • \u751F\u6210\u540E\u9700\u8981\u7B49\u5F85\u4E00\u6BB5\u65F6\u95F4\u865A\u62DF\u673A\u5185\u90E8\u914D\u7F6E\u597D\u7F51\u7EDC\u4EE5\u53CA\u767B\u9646\u4FE1\u606F\uFF0C\u5927\u6982\u9700\u89813\u5206\u949F
  • \u9ED8\u8BA4\u5F00\u8BBE\u7684\u7F51\u7EDC\u914D\u7F6E\u4E3A\uFF1A22\uFF0C80\uFF0C443\u7AEF\u53E3\u53CA\u4E00\u4E2A25\u4E2A\u7AEF\u53E3\u533A\u95F4\u7684\u5185\u5916\u7F51\u6620\u5C04
  • \u53EF\u81EA\u5B9A\u4E49\u5F00\u8BBE\u7684\u6838\u5FC3\u6570\uFF0C\u5185\u5B58\u5927\u5C0F\uFF0C\u786C\u76D8\u5927\u5C0F\uFF0C\u4F7F\u7528\u5BBF\u4E3B\u673A\u54EA\u4E2A\u5B58\u50A8\u76D8\uFF0C\u8BB0\u5F97\u81EA\u5DF1\u8BA1\u7B97\u597D\u7A7A\u95F2\u8D44\u6E90\u5F00\u8BBE
  • \u53EF\u5728\u547D\u4EE4\u4E2D\u6307\u5B9A\u5B58\u50A8\u76D8\u4F4D\u7F6E\uFF0C\u9ED8\u8BA4\u4E0D\u6307\u5B9A\u65F6\u4E3Alocal\u76D8\u5373\u7CFB\u7EDF\u76D8\uFF0C\u53EF\u6307\u5B9A\u4E3APVE\u4E2D\u663E\u793A\u7684\u6302\u8F7D\u76D8
  • \u5F00\u8BBE\u7684CT\u9ED8\u8BA4\u5DF2\u542F\u7528SSH\u4E14\u5141\u8BB8root\u767B\u9646\uFF0C\u4E14\u5DF2\u8BBE\u7F6E\u652F\u6301\u4F7F\u7528docker\u7684\u5D4C\u5957\u865A\u62DF\u5316
  • \u5BB9\u5668\u7684\u76F8\u5173\u4FE1\u606F\u5C06\u4F1A\u5B58\u50A8\u5230\u5BF9\u5E94\u7684\u5BB9\u5668\u7684NOTE\u4E2D\uFF0C\u53EF\u5728WEB\u7AEF\u67E5\u770B

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildct.sh -o buildct.sh && chmod +x buildct.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildct.sh -o buildct.sh && chmod +x buildct.sh
+

\u4F7F\u7528\u65B9\u6CD5

  • \u7CFB\u7EDF\u652F\u6301\uFF1Adebian10\uFF0Cdebian11\uFF0Cubuntu18\uFF0Cubuntu20\uFF0Cubuntu22\uFF0Ccentos8\uFF0Calmalinux9\u7B49
  • \u7CFB\u7EDF\u53C2\u6570\u4E00\u5F8B\u662F\u5C0F\u5199\u7684\u7CFB\u7EDF\u540D\u5B57\u62FC\u63A5\u7248\u672C\u53F7\uFF0C\u5177\u4F53\u53EF\u6267\u884Cpveam available --section system\u67E5\u770B\u53EF\u7528\u7684\u7CFB\u7EDF\u540D\u5B57\u548C\u7248\u672C\u53F7(\u6CE8\u610F\u811A\u672C\u4F7F\u7528\u7684\u53C2\u6570\u53EA\u6709\u5C0F\u5199\u7684\u82F1\u6587\u7CFB\u7EDF\u540D\u5B57\u62FC\u63A5\u7248\u672C\u53F7)
  • \u5176\u4ED6\u7CFB\u7EDF\u53EF\u80FD\u652F\u6301\u53EF\u80FD\u4E0D\u652F\u6301\uFF0C\u81EA\u884C\u6D4B\u8BD5
  • \u9ED8\u8BA4\u7528\u6237\u540D\u662Froot
./buildct.sh CTID \u5BC6\u7801 CPU\u6838\u6570 \u5185\u5B58 \u786C\u76D8 SSH\u7AEF\u53E3 80\u7AEF\u53E3 443\u7AEF\u53E3 \u5916\u7F51\u7AEF\u53E3\u8D77 \u5916\u7F51\u7AEF\u53E3\u6B62 \u7CFB\u7EDF \u5B58\u50A8\u76D8
+

\u6D4B\u8BD5\u793A\u4F8B

  • \u4EE5\u4E0B\u4E3A\u5F00\u8BBE\u7684\u793A\u4F8BCT\u7684\u4FE1\u606F\uFF1A
    VMID - 102 SSH\u767B\u5F55\u7684\u7528\u6237\u540D - root SSH\u767B\u5F55\u7684\u5BC6\u7801 - 1234567 CPU\u6838\u6570 - 1
    \u5185\u5B58\u5927\u5C0F - 512MB \u78C1\u76D8\u5927\u5C0F - 5G
    SSH\u7AEF\u53E3 - 20001 80\u7AEF\u53E3 - 20002 443\u7AEF\u53E3 - 20003 \u5185\u5916\u7F51\u6620\u5C04\u7AEF\u53E3\u4E00\u81F4\u7684\u533A\u95F4 - 30000\u523030025 \u7CFB\u7EDF - debian11 \u5BBF\u4E3B\u673A\u7684\u5B58\u50A8\u76D8 - local
./buildct.sh 102 1234567 1 512 5 20001 20002 20003 30000 30025 debian11 local
+

\u5F00\u8BBE\u5B8C\u6BD5\u53EF\u6267\u884Ccat ct102\u67E5\u770B\u4FE1\u606F\uFF0C\u6216\u5728web\u7AEF\u7684NOTES\u67E5\u770B

\u5220\u9664\u793A\u4F8B

  • \u505C\u6B62CT
  • \u5220\u9664CT
  • \u5220\u9664\u7AEF\u53E3\u6620\u5C04
  • \u91CD\u542F\u7F51\u7EDC
  • \u5220\u9664log\u6587\u4EF6
pct stop 102
+pct destroy 102
+rm -rf ct102
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+

\u6279\u91CF\u5F00\u8BBENAT\u7684LXC\u865A\u62DF\u5316\u7684CT

WARNING

\u521D\u6B21\u4F7F\u7528\u524D\u9700\u8981\u4FDD\u8BC1\u5F53\u524DPVE\u7EAF\u51C0\u4E14\u5BBF\u4E3B\u673A\u672A\u8FDB\u884C\u8FC7\u4EFB\u4F55\u7AEF\u53E3\u6620\u5C04\uFF0C\u5426\u5219\u8BBE\u7F6E\u51B2\u7A81\u53EF\u80FD\u51FA\u73B0BUG \u5F00\u8BBE\u524D\u8BF7\u4F7F\u7528screen\u6302\u8D77\u6267\u884C\uFF0C\u907F\u514D\u6279\u91CF\u5F00\u8BBE\u65F6\u95F4\u8FC7\u957F\uFF0CSSH\u4E0D\u7A33\u5B9A\u5BFC\u81F4\u4E2D\u95F4\u6267\u884C\u4E2D\u65AD

  • \u53EF\u591A\u6B21\u8FD0\u884C\u6279\u91CF\u751F\u6210CT\u5BB9\u5668\uFF0C\u4F46\u9700\u8981\u6CE8\u610F\u7684\u662F\u6BCD\u9E21\u5185\u5B58\u8BB0\u5F97\u5F00\u70B9swap\u514D\u5F97\u673A\u5668\u70B8\u4E86\u5F00SWAP\u70B9\u6211\u8DF3\u8F6C
  • \u6BCF\u4E2A\u5BB9\u5668\u521B\u5EFA\u4E4B\u95F4\u6709\u95F4\u9694\u7B49\u5F8560\u79D2\u907F\u514D\u7A81\u53D1\u6027\u80FD\u4E0D\u8DB3
  • \u53EF\u81EA\u5B9A\u4E49\u6279\u91CF\u5F00\u8BBE\u7684\u6838\u5FC3\u6570\uFF0C\u5185\u5B58\u5927\u5C0F\uFF0C\u786C\u76D8\u5927\u5C0F\uFF0C\u4F7F\u7528\u5BBF\u4E3B\u673A\u54EA\u4E2A\u5B58\u50A8\u76D8\uFF0C\u8BB0\u5F97\u81EA\u5DF1\u8BA1\u7B97\u597D\u7A7A\u95F2\u8D44\u6E90\u5F00\u8BBE
  • \u5F00\u8BBE\u7684CT\u9ED8\u8BA4\u5DF2\u542F\u7528SSH\u4E14\u5141\u8BB8root\u767B\u9646\uFF0C\u4E14\u5DF2\u8BBE\u7F6E\u652F\u6301\u4F7F\u7528docker\u7684\u5D4C\u5957\u865A\u62DF\u5316
  • \u5BB9\u5668\u7684\u76F8\u5173\u4FE1\u606F\u5C06\u4F1A\u5B58\u50A8\u5230\u5BF9\u5E94\u7684\u5BB9\u5668\u7684NOTE\u4E2D\uFF0C\u53EF\u5728WEB\u7AEF\u67E5\u770B

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_ct.sh -o create_ct.sh && chmod +x create_ct.sh && bash create_ct.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_ct.sh -o create_ct.sh && chmod +x create_ct.sh && bash create_ct.sh
+

\u5F00\u8BBE\u5B8C\u6BD5\u53EF\u6267\u884Ccat ctlog\u67E5\u770B\u4FE1\u606F\uFF0C\u6216\u5728web\u7AEF\u7684NOTES\u67E5\u770B

\u5220\u9664\u6240\u6709CT

  • \u5220\u9664\u6240\u6709CT
  • \u5220\u9664\u6240\u6709nat\u7684\u7AEF\u53E3\u6620\u5C04
  • \u91CD\u542F\u7F51\u7EDC
  • \u5220\u9664log\u6587\u4EF6
pct list | awk 'NR>1{print $1}' | xargs -I {} sh -c 'pct stop {}; pct destroy {}'
+rm -rf ct*
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+
`,28),l=[c];function o(p,i,r,d,u,h){return e(),a("div",null,l)}var k=s(t,[["render",o]]);export{m as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_pve_lxc.md.889c2001.lean.js b/docs/.vitepress/dist/assets/en_US_guide_pve_lxc.md.889c2001.lean.js new file mode 100644 index 0000000000..f08bf6d8e6 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_pve_lxc.md.889c2001.lean.js @@ -0,0 +1 @@ +import{_ as s,c as a,o as e,a as n}from"./app.8fc4a373.js";const m='{"title":"\u5355\u72EC\u5F00\u8BBELXC\u865A\u62DF\u5316\u7684CT","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u5355\u72EC\u5F00\u8BBELXC\u865A\u62DF\u5316\u7684CT","slug":"\u5355\u72EC\u5F00\u8BBElxc\u865A\u62DF\u5316\u7684ct"},{"level":2,"title":"\u6279\u91CF\u5F00\u8BBENAT\u7684LXC\u865A\u62DF\u5316\u7684CT","slug":"\u6279\u91CF\u5F00\u8BBEnat\u7684lxc\u865A\u62DF\u5316\u7684ct"}],"relativePath":"en_US/guide/pve_lxc.md","lastUpdated":1687182420000}',t={},c=n("",28),l=[c];function o(p,i,r,d,u,h){return e(),a("div",null,l)}var k=s(t,[["render",o]]);export{m as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_pve_precheck.md.48e39e16.js b/docs/.vitepress/dist/assets/en_US_guide_pve_precheck.md.48e39e16.js new file mode 100644 index 0000000000..59caec824b --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_pve_precheck.md.48e39e16.js @@ -0,0 +1,3 @@ +import{_ as e,c as a,o as t,a as i}from"./app.8fc4a373.js";const u='{"title":"\u7CFB\u7EDF\u8981\u6C42\u4E0E\u914D\u7F6E","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u5404\u79CD\u8981\u6C42","slug":"\u5404\u79CD\u8981\u6C42"},{"level":2,"title":"\u68C0\u6D4B\u73AF\u5883","slug":"\u68C0\u6D4B\u73AF\u5883"}],"relativePath":"en_US/guide/pve_precheck.md","lastUpdated":1687182420000}',r={},n=i(`

\u7CFB\u7EDF\u8981\u6C42\u4E0E\u914D\u7F6E

\u5404\u79CD\u8981\u6C42

\u5EFA\u8BAEdebian\u5728\u4F7F\u7528\u524D\u5C3D\u91CF\u4F7F\u7528\u6700\u65B0\u7684\u7A33\u5B9A\u7248\u672C\u7684\u7CFB\u7EDF

\u975Edebian11\u53EF\u4F7F\u7528 debian\u4E00\u952E\u5347\u7EA7 \u6765\u5347\u7EA7\u7CFB\u7EDF

\u672C\u9879\u76EE\u53EA\u9002\u914DDebian\u7CFB\u7EDF(\u975EDebian\u65E0\u6CD5\u901A\u8FC7APT\u6E90\u5B89\u88C5\uFF0C\u5B98\u65B9\u53EA\u7ED9\u4E86Debian\u7684\u955C\u50CF\uFF0C\u5176\u4ED6\u7CFB\u7EDF\u53EA\u80FD\u4F7F\u7528ISO\u5B89\u88C5)

  • \u7CFB\u7EDF\u8981\u6C42\uFF1ADebian 8+ ::tip \u5EFA\u8BAEdebian11\u800C\u4E0D\u662Fdebian12\uFF0C\u56E0\u4E3A\u540E\u8005\u662Fbeta\u7248\u672C\uFF0Cdebian11\u5B89\u88C5\u7684\u624D\u662F\u7A33\u5B9A\u7248 ::
  • \u786C\u4EF6\u8981\u6C42\uFF1A2\u68382G\u5185\u5B58x86_64\u67B6\u6784\u670D\u52A1\u5668\u786C\u76D8\u81F3\u5C1120G ::warning \u5185\u5B58\u5F00\u70B9swap\u514D\u5F97\u673A\u5668\u70B8\u4E86\u5F00SWAP\u70B9\u6211\u8DF3\u8F6C ::
  • \u53EF\u5F00KVM\u7684\u786C\u4EF6\u8981\u6C42\uFF1AVM-X\u6216AMD-V\u652F\u6301 (\u90E8\u5206VPS\u548C\u5168\u90E8\u72EC\u670D\u652F\u6301)
  • \u5982\u679C\u786C\u4EF6\u6216\u7CFB\u7EDF\u9700\u6C42\u4E0D\u6EE1\u8DB3\uFF0C\u53EF\u4F7F\u7528LXD\u6279\u91CF\u5F00LXC\u5BB9\u5668\u8DF3\u8F6C

\u9047\u5230\u9009\u9879\u4E0D\u4F1A\u9009\u7684\u53EF\u65E0\u8111\u56DE\u8F66\u5B89\u88C5\uFF0C\u672C\u9879\u76EE\u6240\u6709\u811A\u672C\u5185\u7F6E\u56FD\u5185\u5916IP\u81EA\u52A8\u5224\u65AD\uFF0C\u4F7F\u7528\u7684\u662F\u4E0D\u540C\u7684\u5B89\u88C5\u6E90\u4E0E\u914D\u7F6E\u6587\u4EF6\uFF0C\u6709\u4F7F\u7528CDN\u52A0\u901F\u955C\u50CF\u4E0B\u8F7D

\u68C0\u6D4B\u73AF\u5883

  • \u672C\u9879\u76EE\u76F8\u5173\u811A\u672C\u6267\u884C\u524D\u52A1\u5FC5\u6267\u884C\u672C\u811A\u672C\u68C0\u6D4B\u73AF\u5883\uFF0C\u5982\u679C\u4E0D\u7B26\u5408\u5B89\u88C5PVE\u7684\u8981\u6C42\u5219\u65E0\u6CD5\u4F7F\u7528\u540E\u7EED\u7684\u811A\u672C
  • \u68C0\u6D4B\u786C\u4EF6\u914D\u7F6E\u662F\u5426\u6EE1\u8DB3\u6700\u4F4E\u8981\u6C42
  • \u68C0\u6D4B\u786C\u4EF6\u73AF\u5883\u662F\u5426\u53EF\u5D4C\u5957\u865A\u62DF\u5316KVM\u7C7B\u578B\u7684\u670D\u52A1\u5668
  • \u68C0\u6D4B\u7CFB\u7EDF\u73AF\u5883\u662F\u5426\u53EF\u5D4C\u5957\u865A\u62DF\u5316KVM\u7C7B\u578B\u7684\u670D\u52A1\u5668
  • \u4E0D\u53EF\u5D4C\u5957\u865A\u62DF\u5316KVM\u7C7B\u578B\u7684\u670D\u52A1\u5668\u4E5F\u53EF\u4EE5\u5F00LXC\u865A\u62DF\u5316\u7684\u670D\u52A1\u5668\uFF0C\u4F46\u4E0D\u63A8\u8350\u5B89\u88C5PVE\uFF0C\u4E0D\u5982\u4F7F\u7528LXD

\u56FD\u9645

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/check_kernal.sh)
+

\u56FD\u5185

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/check_kernal.sh)
+
`,13),l=[n];function c(s,p,o,h,d,_){return t(),a("div",null,l)}var g=e(r,[["render",c]]);export{u as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_pve_precheck.md.48e39e16.lean.js b/docs/.vitepress/dist/assets/en_US_guide_pve_precheck.md.48e39e16.lean.js new file mode 100644 index 0000000000..2a8961e60b --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_pve_precheck.md.48e39e16.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as t,a as i}from"./app.8fc4a373.js";const u='{"title":"\u7CFB\u7EDF\u8981\u6C42\u4E0E\u914D\u7F6E","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u5404\u79CD\u8981\u6C42","slug":"\u5404\u79CD\u8981\u6C42"},{"level":2,"title":"\u68C0\u6D4B\u73AF\u5883","slug":"\u68C0\u6D4B\u73AF\u5883"}],"relativePath":"en_US/guide/pve_precheck.md","lastUpdated":1687182420000}',r={},n=i("",13),l=[n];function c(s,p,o,h,d,_){return t(),a("div",null,l)}var g=e(r,[["render",c]]);export{u as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_pve_qa.md.8543b407.js b/docs/.vitepress/dist/assets/en_US_guide_pve_qa.md.8543b407.js new file mode 100644 index 0000000000..d49bfd24f2 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_pve_qa.md.8543b407.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as a,a as t}from"./app.8fc4a373.js";const u='{"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u7684VPS\u5546\u5BB6","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u7684VPS\u5546\u5BB6","slug":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u7684vps\u5546\u5BB6"},{"level":3,"title":"\u53EF\u5F00\u8BBEKVM\u865A\u62DF\u5316\u7684NAT\u7684\u5546\u5BB6","slug":"\u53EF\u5F00\u8BBEkvm\u865A\u62DF\u5316\u7684nat\u7684\u5546\u5BB6"},{"level":3,"title":"\u53EA\u53EF\u5F00\u8BBELXC\u865A\u62DF\u5316\u7684NAT\u7684\u5546\u5BB6","slug":"\u53EA\u53EF\u5F00\u8BBElxc\u865A\u62DF\u5316\u7684nat\u7684\u5546\u5BB6"},{"level":3,"title":"\u5DF2\u77E5\u65E0\u6CD5\u76F4\u63A5\u5B89\u88C5PVE\u7684\u5546\u5BB6","slug":"\u5DF2\u77E5\u65E0\u6CD5\u76F4\u63A5\u5B89\u88C5pve\u7684\u5546\u5BB6"}],"relativePath":"en_US/guide/pve_qa.md","lastUpdated":1687182420000}',n={},o=t('

\u76EE\u524D\u5DF2\u9A8C\u8BC1\u7684VPS\u5546\u5BB6

\u53EF\u5F00\u8BBEKVM\u865A\u62DF\u5316\u7684NAT\u7684\u5546\u5BB6

nocix \u4E2D\u7684\u7279\u4EF7\u6700\u4F4E\u914D15\u7F8E\u5143\u72EC\u670D (IPV6\u4E0D\u81EA\u5E26\uFF0C\u9700\u8981\u627E\u5BA2\u670D\u8981)

amhost \u4E2D\u7684\u6D4B\u8BD5\u6B3E

digitalocean \u4E2D\u7684 Perminu Intel \u548C Regular 4\u6838\u6B3E

skrime \u4E2D\u7684 AMD Ryzen KVM Server \u6700\u4F4E\u914D\u6B3E

webdock \u4E2D\u7684 AMD KVM Server

4vps \u4E2D\u7684 \u4FC4\u7F57\u65AF\u548C\u5E0C\u814A \u6D4B\u8BD5\u6B3E

hostaris \u4E2D\u7684 \u5FB7\u56FD\u6B3E (\u5546\u5BB6\u7684\u7CFB\u7EDF\u6A21\u677F\u6709\u95EE\u9898\uFF0CIPV6\u5DF2\u5931\u6548\u548CGithub\u7684\u8FDE\u901A\u7A33\u5B9A\u6027\u5F88\u5DEE)

\u53EA\u53EF\u5F00\u8BBELXC\u865A\u62DF\u5316\u7684NAT\u7684\u5546\u5BB6

\u817E\u8BAF\u4E91 \u4E2D\u7684\u65E0\u5FE7\u6B3E\u548C\u7279\u60E0\u6B3E(\u5B66\u751F\u673A)

spectraip \u4E2D\u7684KVM\u670D\u52A1\u5668

\u5DF2\u77E5\u65E0\u6CD5\u76F4\u63A5\u5B89\u88C5PVE\u7684\u5546\u5BB6

hetzner \u9700\u8981\u6551\u63F4\u7CFB\u7EDF\u5B89\u88C5\u7EAF\u51C0\u7684Debian\uFF0C\u9ED8\u8BA4\u7F51\u7EDC\u8BBE\u7F6E\u6709\u51B2\u7A81

hosthatch \u9ED8\u8BA4\u7F51\u7EDC\u8BBE\u7F6E\u6709\u95EE\u9898

',15),p=[o];function h(l,s,c,i,d,f){return a(),r("div",null,p)}var v=e(n,[["render",h]]);export{u as __pageData,v as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_pve_qa.md.8543b407.lean.js b/docs/.vitepress/dist/assets/en_US_guide_pve_qa.md.8543b407.lean.js new file mode 100644 index 0000000000..11120a1447 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_pve_qa.md.8543b407.lean.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as a,a as t}from"./app.8fc4a373.js";const u='{"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u7684VPS\u5546\u5BB6","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u7684VPS\u5546\u5BB6","slug":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u7684vps\u5546\u5BB6"},{"level":3,"title":"\u53EF\u5F00\u8BBEKVM\u865A\u62DF\u5316\u7684NAT\u7684\u5546\u5BB6","slug":"\u53EF\u5F00\u8BBEkvm\u865A\u62DF\u5316\u7684nat\u7684\u5546\u5BB6"},{"level":3,"title":"\u53EA\u53EF\u5F00\u8BBELXC\u865A\u62DF\u5316\u7684NAT\u7684\u5546\u5BB6","slug":"\u53EA\u53EF\u5F00\u8BBElxc\u865A\u62DF\u5316\u7684nat\u7684\u5546\u5BB6"},{"level":3,"title":"\u5DF2\u77E5\u65E0\u6CD5\u76F4\u63A5\u5B89\u88C5PVE\u7684\u5546\u5BB6","slug":"\u5DF2\u77E5\u65E0\u6CD5\u76F4\u63A5\u5B89\u88C5pve\u7684\u5546\u5BB6"}],"relativePath":"en_US/guide/pve_qa.md","lastUpdated":1687182420000}',n={},o=t("",15),p=[o];function h(l,s,c,i,d,f){return a(),r("div",null,p)}var v=e(n,[["render",h]]);export{u as __pageData,v as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_pve_thanks.md.19b79e33.js b/docs/.vitepress/dist/assets/en_US_guide_pve_thanks.md.19b79e33.js new file mode 100644 index 0000000000..aff766059b --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_pve_thanks.md.19b79e33.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as t,a}from"./app.8fc4a373.js";const b='{"title":"\u81F4\u8C22","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u81F4\u8C22","slug":"\u81F4\u8C22"}],"relativePath":"en_US/guide/pve_thanks.md","lastUpdated":1687182420000}',o={},n=a('

\u81F4\u8C22

https://blog.ilolicon.com/archives/615

https://github.com/Ella-Alinda/somescripts/blob/main/nat.sh

https://pve.proxmox.com/pve-docs/qm.1.html

https://down.idc.wiki/Image/realServer-Template/

https://mirrors.tuna.tsinghua.edu.cn/proxmox/

https://github.com/roacn/pve/blob/main/pve.sh

https://github.com/spiritLHLS/lxc

\u611F\u8C22 @Ella-Alinda \u63D0\u4F9B\u7684PVE\u6307\u5BFC

',9),p=[n];function l(s,i,h,c,_,m){return t(),r("div",null,p)}var f=e(o,[["render",l]]);export{b as __pageData,f as default}; diff --git a/docs/.vitepress/dist/assets/en_US_guide_pve_thanks.md.19b79e33.lean.js b/docs/.vitepress/dist/assets/en_US_guide_pve_thanks.md.19b79e33.lean.js new file mode 100644 index 0000000000..7017c07ea2 --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_guide_pve_thanks.md.19b79e33.lean.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as t,a}from"./app.8fc4a373.js";const b='{"title":"\u81F4\u8C22","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u81F4\u8C22","slug":"\u81F4\u8C22"}],"relativePath":"en_US/guide/pve_thanks.md","lastUpdated":1687182420000}',o={},n=a("",9),p=[n];function l(s,i,h,c,_,m){return t(),r("div",null,p)}var f=e(o,[["render",l]]);export{b as __pageData,f as default}; diff --git a/docs/.vitepress/dist/assets/en_US_index.md.7d81af26.js b/docs/.vitepress/dist/assets/en_US_index.md.7d81af26.js new file mode 100644 index 0000000000..ff91a77bda --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_index.md.7d81af26.js @@ -0,0 +1 @@ +import{_ as a,c as n,o as i,b as e,d as t}from"./app.8fc4a373.js";const _='{"title":"Home","description":"","frontmatter":{"home":true,"heroImage":"https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png","heroText":"One Click Virtualization Project","tagline":"Open source, easy to use server virtualization project","actionText":"Learn More \u2192","actionLink":"/en_US/guide/dashboard","features":[{"title":"One Click Use","details":"Support one-click script installation and use to easily create virtual machines/containers on servers using each virtualization"},{"title":"Based on mainstream systems development","details":"Based on Debian, Ubuntu long-term maintenance version, if you want to use it, please try to ensure that the host system and the development environment are the same"},{"title":"Comes with internal and external port forwarding","details":"Support automatic intranet port forwarding, including TCP and UDP protocols, without manual management"},{"title":"Batch Virtualization","details":"Support for KVM, LXC, Docker virtualization batch opening of virtual machines/containers"},{"title":"Multisystem support","details":"Virtual machines/containers already support multiple systems, covering almost all major systems"},{"title":"Self-limiting abuse","details":"Partially virtual machines/containers have been masked and loaded with restrictions to avoid being used for abuse"}],"footer":"Copyright \xA9 2023-present oneclickvirt"},"headers":[],"relativePath":"en_US/index.md","lastUpdated":1687182420000}',o={},s=e("p",null,"Documentation has not been translated yet, waiting for translation.",-1),r=e("p",null,[e("br"),t("This work is licensed under a "),e("a",{rel:"license",href:"http://creativecommons.org/licenses/by-nc-sa/4.0/"},"Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License"),t(".")],-1),l=[s,r];function c(d,u,m,p,h,g){return i(),n("div",null,l)}var f=a(o,[["render",c]]);export{_ as __pageData,f as default}; diff --git a/docs/.vitepress/dist/assets/en_US_index.md.7d81af26.lean.js b/docs/.vitepress/dist/assets/en_US_index.md.7d81af26.lean.js new file mode 100644 index 0000000000..ff91a77bda --- /dev/null +++ b/docs/.vitepress/dist/assets/en_US_index.md.7d81af26.lean.js @@ -0,0 +1 @@ +import{_ as a,c as n,o as i,b as e,d as t}from"./app.8fc4a373.js";const _='{"title":"Home","description":"","frontmatter":{"home":true,"heroImage":"https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png","heroText":"One Click Virtualization Project","tagline":"Open source, easy to use server virtualization project","actionText":"Learn More \u2192","actionLink":"/en_US/guide/dashboard","features":[{"title":"One Click Use","details":"Support one-click script installation and use to easily create virtual machines/containers on servers using each virtualization"},{"title":"Based on mainstream systems development","details":"Based on Debian, Ubuntu long-term maintenance version, if you want to use it, please try to ensure that the host system and the development environment are the same"},{"title":"Comes with internal and external port forwarding","details":"Support automatic intranet port forwarding, including TCP and UDP protocols, without manual management"},{"title":"Batch Virtualization","details":"Support for KVM, LXC, Docker virtualization batch opening of virtual machines/containers"},{"title":"Multisystem support","details":"Virtual machines/containers already support multiple systems, covering almost all major systems"},{"title":"Self-limiting abuse","details":"Partially virtual machines/containers have been masked and loaded with restrictions to avoid being used for abuse"}],"footer":"Copyright \xA9 2023-present oneclickvirt"},"headers":[],"relativePath":"en_US/index.md","lastUpdated":1687182420000}',o={},s=e("p",null,"Documentation has not been translated yet, waiting for translation.",-1),r=e("p",null,[e("br"),t("This work is licensed under a "),e("a",{rel:"license",href:"http://creativecommons.org/licenses/by-nc-sa/4.0/"},"Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License"),t(".")],-1),l=[s,r];function c(d,u,m,p,h,g){return i(),n("div",null,l)}var f=a(o,[["render",c]]);export{_ as __pageData,f as default}; diff --git a/docs/.vitepress/dist/assets/guide_dashboard.md.84ccffb0.js b/docs/.vitepress/dist/assets/guide_dashboard.md.84ccffb0.js new file mode 100644 index 0000000000..35308ea8cb --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_dashboard.md.84ccffb0.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a,a as r}from"./app.8fc4a373.js";const b='{"title":"\u51C6\u5907\u5DE5\u4F5C","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u51C6\u5907\u5DE5\u4F5C","slug":"\u51C6\u5907\u5DE5\u4F5C"},{"level":2,"title":"\u9879\u76EE\u4ED3\u5E93","slug":"\u9879\u76EE\u4ED3\u5E93"},{"level":3,"title":"PVE\u76F8\u5173\u7684\u5404\u79CD\u4E00\u952E\u811A\u672C","slug":"pve\u76F8\u5173\u7684\u5404\u79CD\u4E00\u952E\u811A\u672C"},{"level":3,"title":"\u901A\u8FC7LXD/LXC\u547D\u4EE4\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBENAT\u670D\u52A1\u5668\u4EE5\u53CA\u7EF4\u62A4","slug":"\u901A\u8FC7lxd-lxc\u547D\u4EE4\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBEnat\u670D\u52A1\u5668\u4EE5\u53CA\u7EF4\u62A4"},{"level":3,"title":"\u901A\u8FC7docker\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBENAT\u670D\u52A1\u5668","slug":"\u901A\u8FC7docker\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBEnat\u670D\u52A1\u5668"}],"relativePath":"guide/dashboard.md","lastUpdated":1687182420000}',i={},l=r('

\u51C6\u5907\u5DE5\u4F5C

\u9700\u8981\u865A\u62DF\u5316\u51FA\u670D\u52A1\u5668\uFF0C\u4F60\u9700\u8981\uFF1A

  1. \u4E00\u53F0\u53EF\u4EE5\u8FDE\u63A5\u516C\u7F51\u7684\u670D\u52A1\u5668( VPS \u6216 Dedicated Server)\uFF0C\u6700\u597D\u80FD\u5B8C\u7F8E\u8BBF\u95EE Github \u7684 RAW \u9875\u9762\uFF0C\u90E8\u5206\u9879\u76EE\u90E8\u5206\u7EC4\u4EF6\u53EF\u80FD\u672A\u4F7F\u7528 CDN \u52A0\u901F

TIP

\u5982\u679C\u60A8\u4F4D\u4E8E\u4E2D\u56FD\u5927\u9646\uFF0C\u8BBF\u95EE Github \u6709\u56F0\u96BE\uFF0C\u8BF7\u6CE8\u610F\u914D\u5957\u811A\u672C\u548C\u9879\u76EE\u662F\u5426\u6709\u8BF4\u660E\u5DF2\u4F7F\u7528 CDN \u52A0\u901F

  1. \u672C\u5730\u53EF\u4EE5\u7A33\u5B9A\u8FDE\u63A5SSH\uFF0C\u5982\u679C\u4E0D\u80FD\u7A33\u5B9A\u8FDE\u63A5\uFF0C\u8BF7\u4F7F\u7528screen\u547D\u4EE4\u521B\u5EFA\u7A97\u53E3\u540E\uFF0C\u5728\u7A97\u53E3\u5185\u6267\u884C\u547D\u4EE4

TIP

\u4E0D\u4F1A\u7528screen\u547D\u4EE4\u7684\uFF0C\u81EA\u884C\u67E5\u627E\u76F8\u5173\u6559\u7A0B\u5B66\u4E60

  1. \u786E\u4FDD\u670D\u52A1\u5668\u7684\u7CFB\u7EDF\u548C\u786C\u4EF6\u6EE1\u8DB3\u5BF9\u5E94\u9879\u76EE\u7684\u8981\u6C42\uFF0C\u8BE6\u89C1\u5BF9\u5E94\u9879\u76EE\u8BF4\u660E

\u672C\u6587\u6863\u5C06\u4EE5VPS\u4F5C\u4E3A\u8303\u4F8B\uFF0C\u4E14\u8BE5VPS\u7EAF\u51C0\uFF0C\u65E0\u539F\u751F\u73AF\u5883\u95EE\u9898\uFF0C\u5982\u6709\u5FC5\u8981\u8BF7\u91CD\u88C5\u7CFB\u7EDF\u4FDD\u8BC1\u521D\u59CB\u73AF\u5883\u7684\u7EAF\u51C0

WARNING

PVE\u9879\u76EE\u53EF\u80FD\u9020\u6210\u5BBF\u4E3B\u673A\u51FA\u73B0\u95EE\u9898\uFF0C\u5982\u679C\u4F60\u4E0D\u4F1A\u770BBug\u548C\u4FEE\u590D\u7CFB\u7EDF\uFF0C\u90A3\u4E48\u4E0D\u5EFA\u8BAE\u4F60\u5728\u751F\u4EA7\u73AF\u5883\u4E2D\u4F7F\u7528\uFF0C\u4F7F\u7528PVE\u76F8\u5173\u811A\u672C\u8BF7\u786E\u4FDD\u5BBF\u4E3B\u673A\u968F\u65F6\u53EF\u91CD\u88C5\u7CFB\u7EDF

\u9879\u76EE\u4ED3\u5E93

\u6B22\u8FCEStar\u548CFork

PVE\u76F8\u5173\u7684\u5404\u79CD\u4E00\u952E\u811A\u672C

https://github.com/spiritLHLS/pve

\u901A\u8FC7LXD/LXC\u547D\u4EE4\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBENAT\u670D\u52A1\u5668\u4EE5\u53CA\u7EF4\u62A4

https://github.com/spiritLHLS/lxc

\u901A\u8FC7docker\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBENAT\u670D\u52A1\u5668

https://github.com/spiritLHLS/docker



',19),o=[l];function s(c,d,p,n,h,u){return a(),t("div",null,o)}var g=e(i,[["render",s]]);export{b as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/guide_dashboard.md.84ccffb0.lean.js b/docs/.vitepress/dist/assets/guide_dashboard.md.84ccffb0.lean.js new file mode 100644 index 0000000000..48cb62c4cd --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_dashboard.md.84ccffb0.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a,a as r}from"./app.8fc4a373.js";const b='{"title":"\u51C6\u5907\u5DE5\u4F5C","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u51C6\u5907\u5DE5\u4F5C","slug":"\u51C6\u5907\u5DE5\u4F5C"},{"level":2,"title":"\u9879\u76EE\u4ED3\u5E93","slug":"\u9879\u76EE\u4ED3\u5E93"},{"level":3,"title":"PVE\u76F8\u5173\u7684\u5404\u79CD\u4E00\u952E\u811A\u672C","slug":"pve\u76F8\u5173\u7684\u5404\u79CD\u4E00\u952E\u811A\u672C"},{"level":3,"title":"\u901A\u8FC7LXD/LXC\u547D\u4EE4\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBENAT\u670D\u52A1\u5668\u4EE5\u53CA\u7EF4\u62A4","slug":"\u901A\u8FC7lxd-lxc\u547D\u4EE4\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBEnat\u670D\u52A1\u5668\u4EE5\u53CA\u7EF4\u62A4"},{"level":3,"title":"\u901A\u8FC7docker\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBENAT\u670D\u52A1\u5668","slug":"\u901A\u8FC7docker\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBEnat\u670D\u52A1\u5668"}],"relativePath":"guide/dashboard.md","lastUpdated":1687182420000}',i={},l=r("",19),o=[l];function s(c,d,p,n,h,u){return a(),t("div",null,o)}var g=e(i,[["render",s]]);export{b as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/guide_dashboardq.md.10023dc6.js b/docs/.vitepress/dist/assets/guide_dashboardq.md.10023dc6.js new file mode 100644 index 0000000000..bd60da3bbd --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_dashboardq.md.10023dc6.js @@ -0,0 +1,2 @@ +import{_ as t,c as o,o as a,b as e}from"./app.8fc4a373.js";const k='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/guide/dashboardq.md","lastUpdated":1687182420000}',s={},n=e("p",null,"Give me a cup of coffee.",-1),r=e("p",null,[e("a",{href:"https://ko-fi.com/spiritlhl",target:"_blank",rel:"noopener noreferrer"},"https://ko-fi.com/spiritlhl")],-1),c=e("p",null,"USDT-TRC20",-1),l=e("div",{class:"language-bash"},[e("pre",null,[e("code",null,`TZ7nf8XAL9zQUo63xokazaBdCPeCgPfcwd +`)])],-1),d=[n,r,c,l];function i(_,p,f,h,u,m){return a(),o("div",null,d)}var b=t(s,[["render",i]]);export{k as __pageData,b as default}; diff --git a/docs/.vitepress/dist/assets/guide_dashboardq.md.10023dc6.lean.js b/docs/.vitepress/dist/assets/guide_dashboardq.md.10023dc6.lean.js new file mode 100644 index 0000000000..bd60da3bbd --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_dashboardq.md.10023dc6.lean.js @@ -0,0 +1,2 @@ +import{_ as t,c as o,o as a,b as e}from"./app.8fc4a373.js";const k='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/guide/dashboardq.md","lastUpdated":1687182420000}',s={},n=e("p",null,"Give me a cup of coffee.",-1),r=e("p",null,[e("a",{href:"https://ko-fi.com/spiritlhl",target:"_blank",rel:"noopener noreferrer"},"https://ko-fi.com/spiritlhl")],-1),c=e("p",null,"USDT-TRC20",-1),l=e("div",{class:"language-bash"},[e("pre",null,[e("code",null,`TZ7nf8XAL9zQUo63xokazaBdCPeCgPfcwd +`)])],-1),d=[n,r,c,l];function i(_,p,f,h,u,m){return a(),o("div",null,d)}var b=t(s,[["render",i]]);export{k as __pageData,b as default}; diff --git a/docs/.vitepress/dist/assets/guide_docker_build.md.eaa03d4b.js b/docs/.vitepress/dist/assets/guide_docker_build.md.eaa03d4b.js new file mode 100644 index 0000000000..a44c108b8c --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_docker_build.md.eaa03d4b.js @@ -0,0 +1,18 @@ +import{_ as s,c as e,o as a,a as n}from"./app.8fc4a373.js";const m='{"title":"\u5355\u72EC\u5F00\u8BBE","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u5355\u72EC\u5F00\u8BBE","slug":"\u5355\u72EC\u5F00\u8BBE"},{"level":3,"title":"\u793A\u4F8B","slug":"\u793A\u4F8B"},{"level":3,"title":"\u67E5\u8BE2\u4FE1\u606F","slug":"\u67E5\u8BE2\u4FE1\u606F"},{"level":2,"title":"\u6279\u91CF\u5F00\u8BBE","slug":"\u6279\u91CF\u5F00\u8BBE"},{"level":2,"title":"\u67E5\u8BE2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F","slug":"\u67E5\u8BE2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F"},{"level":2,"title":"\u5378\u8F7D\u6240\u6709docker\u5BB9\u5668\u548C\u955C\u50CF","slug":"\u5378\u8F7D\u6240\u6709docker\u5BB9\u5668\u548C\u955C\u50CF"}],"relativePath":"guide/docker_build.md","lastUpdated":1687182420000}',o={},c=n(`

\u5355\u72EC\u5F00\u8BBE

\u4E0B\u8F7D\u811A\u672C

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/onedocker.sh -o onedocker.sh && chmod +x onedocker.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/onedocker.sh -o onedocker.sh && chmod +x onedocker.sh
+

\u8FD0\u884C

./onedocker.sh name cpu memory password sshport startport endport system
+

\u76EE\u524Dsystem\u4EC5\u652F\u6301\u9009\u62E9alpine\u6216debian\uFF0C\u9ED8\u8BA4\u662Fdebian

\u793A\u4F8B

  • \u4EE5\u4E0B\u4E3A\u5F00\u8BBE\u7684\u793A\u4F8B\u5BB9\u5668\u7684\u4FE1\u606F\uFF1A
    \u5BB9\u5668\u540D\u5B57 - test SSH\u767B\u5F55\u7684\u7528\u6237\u540D - root SSH\u767B\u5F55\u7684\u5BC6\u7801 - 123456 CPU\u6838\u6570 - 1
    \u5185\u5B58\u5927\u5C0F - 512MB SSH\u7AEF\u53E3 - 25000 \u5185\u5916\u7F51\u6620\u5C04\u7AEF\u53E3\u4E00\u81F4\u7684\u533A\u95F4 - 34975\u523035000 \u7CFB\u7EDF - debian
./onedocker.sh test 1 512 123456 25000 34975 35000 debian
+

\u5220\u9664\u793A\u4F8B

docker rm -f test
+rm -rf test
+ls
+

\u8FDB\u5165\u793A\u4F8B

docker exec -it test /bin/bash
+

\u8981\u9000\u51FA\u5BB9\u5668\u5C31\u6267\u884Cexit\u9000\u51FA\u3002

\u67E5\u8BE2\u4FE1\u606F

cat \u5BB9\u5668\u540D\u5B57
+

\u8F93\u51FA\u683C\u5F0F

\u5BB9\u5668\u540D\u5B57 SSH\u7AEF\u53E3 \u767B\u9646\u7684root\u5BC6\u7801 \u6838\u6570 \u5185\u5B58 \u5916\u7F51\u7AEF\u53E3\u8D77 \u5916\u7F51\u7AEF\u53E3\u6B62 
+

\u6279\u91CF\u5F00\u8BBE

  • \u6279\u91CF\u591A\u6B21\u8FD0\u884C\u7EE7\u627F\u914D\u7F6E\u751F\u6210
  • \u751F\u6210\u591A\u4E2A\u65F6\u4E3A\u907F\u514DSSH\u8FDE\u63A5\u4E2D\u65AD\u5EFA\u8BAE\u5728screen\u4E2D\u6267\u884C

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/dockers.sh -o dockers.sh && chmod +x dockers.sh && bash dockers.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/onedocker.sh -o onedocker.sh && chmod +x onedocker.sh
+

\u67E5\u8BE2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F

cat dclog
+

\u8F93\u51FA\u683C\u5F0F

\u5BB9\u5668\u540D\u5B57 SSH\u7AEF\u53E3 \u767B\u9646\u7684root\u5BC6\u7801 \u6838\u6570 \u5185\u5B58 \u5916\u7F51\u7AEF\u53E3\u8D77 \u5916\u7F51\u7AEF\u53E3\u6B62 
+

\u4E00\u884C\u4E00\u4E2A\u5BB9\u5668\u5BF9\u5E94\u7684\u4FE1\u606F

\u5378\u8F7D\u6240\u6709docker\u5BB9\u5668\u548C\u955C\u50CF

docker rm -f $(docker ps -aq); docker rmi $(docker images -aq)
+rm -rf dclog
+ls
+
`,34),p=[c];function t(r,l,d,i,u,h){return a(),e("div",null,p)}var g=s(o,[["render",t]]);export{m as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/guide_docker_build.md.eaa03d4b.lean.js b/docs/.vitepress/dist/assets/guide_docker_build.md.eaa03d4b.lean.js new file mode 100644 index 0000000000..c51fe93837 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_docker_build.md.eaa03d4b.lean.js @@ -0,0 +1 @@ +import{_ as s,c as e,o as a,a as n}from"./app.8fc4a373.js";const m='{"title":"\u5355\u72EC\u5F00\u8BBE","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u5355\u72EC\u5F00\u8BBE","slug":"\u5355\u72EC\u5F00\u8BBE"},{"level":3,"title":"\u793A\u4F8B","slug":"\u793A\u4F8B"},{"level":3,"title":"\u67E5\u8BE2\u4FE1\u606F","slug":"\u67E5\u8BE2\u4FE1\u606F"},{"level":2,"title":"\u6279\u91CF\u5F00\u8BBE","slug":"\u6279\u91CF\u5F00\u8BBE"},{"level":2,"title":"\u67E5\u8BE2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F","slug":"\u67E5\u8BE2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F"},{"level":2,"title":"\u5378\u8F7D\u6240\u6709docker\u5BB9\u5668\u548C\u955C\u50CF","slug":"\u5378\u8F7D\u6240\u6709docker\u5BB9\u5668\u548C\u955C\u50CF"}],"relativePath":"guide/docker_build.md","lastUpdated":1687182420000}',o={},c=n("",34),p=[c];function t(r,l,d,i,u,h){return a(),e("div",null,p)}var g=s(o,[["render",t]]);export{m as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/guide_docker_install.md.7ec90acb.js b/docs/.vitepress/dist/assets/guide_docker_install.md.7ec90acb.js new file mode 100644 index 0000000000..f9c2f8abb5 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_docker_install.md.7ec90acb.js @@ -0,0 +1,3 @@ +import{_ as s,c as a,o as e,a as n}from"./app.8fc4a373.js";const m='{"title":"\u73AF\u5883\u9884\u8BBE","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u73AF\u5883\u9884\u8BBE","slug":"\u73AF\u5883\u9884\u8BBE"}],"relativePath":"en_US/guide/docker_install.md","lastUpdated":1687182420000}',t={},p=n(`

\u73AF\u5883\u9884\u8BBE

  • \u68C0\u6D4B\u73AF\u5883
  • \u5B89\u88C5docker
  • \u4E0B\u8F7D\u9884\u5236\u811A\u672C

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/pre_build.sh -o pre_build.sh && chmod +x pre_build.sh && bash pre_build.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/pre_build.sh -o pre_build.sh && chmod +x pre_build.sh && bash pre_build.sh
+
`,6),o=[p];function r(c,i,l,d,_,u){return e(),a("div",null,o)}var k=s(t,[["render",r]]);export{m as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/guide_docker_install.md.7ec90acb.lean.js b/docs/.vitepress/dist/assets/guide_docker_install.md.7ec90acb.lean.js new file mode 100644 index 0000000000..42142673f2 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_docker_install.md.7ec90acb.lean.js @@ -0,0 +1 @@ +import{_ as s,c as a,o as e,a as n}from"./app.8fc4a373.js";const m='{"title":"\u73AF\u5883\u9884\u8BBE","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u73AF\u5883\u9884\u8BBE","slug":"\u73AF\u5883\u9884\u8BBE"}],"relativePath":"en_US/guide/docker_install.md","lastUpdated":1687182420000}',t={},p=n("",6),o=[p];function r(c,i,l,d,_,u){return e(),a("div",null,o)}var k=s(t,[["render",r]]);export{m as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/guide_docker_precheck.md.2257993a.js b/docs/.vitepress/dist/assets/guide_docker_precheck.md.2257993a.js new file mode 100644 index 0000000000..9371020afb --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_docker_precheck.md.2257993a.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as t,a}from"./app.8fc4a373.js";const f='{"title":"\u9879\u76EE\u7279\u70B9","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u9879\u76EE\u7279\u70B9","slug":"\u9879\u76EE\u7279\u70B9"},{"level":2,"title":"\u914D\u7F6E\u8981\u6C42","slug":"\u914D\u7F6E\u8981\u6C42"}],"relativePath":"en_US/guide/docker_precheck.md","lastUpdated":1687182420000}',o={},p=a('

\u9879\u76EE\u7279\u70B9

\u901A\u8FC7docker\u6279\u91CF\u6216\u5355\u72EC\u5F00\u8BBENAT\u670D\u52A1\u5668(Bulk or individual NAT server provisioning via docker)

\u9ED8\u8BA4\u4F7F\u7528debian\u7CFB\u7EDF\uFF0C\u6BCF\u4E2A\u5BB9\u5668\u81EA\u5E261\u4E2A\u5916\u7F51ssh\u7AEF\u53E3\uFF0C25\u4E2A\u5185\u5916\u7F51\u4E00\u81F4\u7AEF\u53E3

\u9ED8\u8BA4\u521B\u5EFA\u7684\u662F\u975E\u7279\u6743\u5BB9\u5668\uFF0C\u4E14\u4E0D\u6302\u8F7D\u4E0E\u5BBF\u4E3B\u673A\u7684docker\u7684\u5B88\u62A4\u8FDB\u7A0B\u4E4B\u95F4\u7684\u901A\u4FE1\uFF0C\u6240\u4EE5\u5BBF\u4E3B\u673A\u521B\u5EFA\u7684docker\u865A\u62DF\u5316\u7684NAT\u670D\u52A1\u5668\u5185\u65E0\u6CD5\u518D\u5D4C\u5957\u865A\u62DF\u5316docker

\u7531\u4E8E\u53EA\u662F\u5728\u5BBF\u4E3B\u673A\u8FDB\u884C\u4E86CPU\u548C\u5185\u5B58\u7684\u9650\u5236\u672A\u5728\u5BB9\u5668\u5185\u4F7F\u7528cgroup\u9A71\u52A8\uFF0C\u6240\u4EE5\u5728\u5BB9\u5668\u5185\u4F7F\u7528\u670D\u52A1\u5668\u6D4B\u8BD5\u811A\u672C\u68C0\u6D4B\u5BB9\u5668\u7684\u53EF\u7528\u8D44\u6E90\u662F\u65E0\u6548\u7684\uFF0C\u663E\u793A\u7684\u4F1A\u662F\u5BBF\u4E3B\u673A\u7684\u8D44\u6E90

\u7531\u4E8E\u5927\u90E8\u5206\u4E91\u670D\u52A1\u5668xfs\u6587\u4EF6\u7CFB\u7EDF\u4E0D\u542F\u7528pquota\u9009\u9879\uFF0C\u6240\u4EE5\u9ED8\u8BA4\u5171\u4EAB\u5BBF\u4E3B\u673A\u786C\u76D8\uFF0C\u65E0\u6CD5\u9650\u5236\u6BCF\u4E2A\u5BB9\u5668\u7684\u78C1\u76D8\u5927\u5C0F

\u914D\u7F6E\u8981\u6C42

\u7CFB\u7EDF\u53EF\u5B89\u88C5docker\u5373\u53EF\u7528\uFF0C\u7F51\u7EDC\u80FD\u8FDE\u63A5Github\u7684raw\u754C\u9762\u5C31\u80FD\u7528\uFF0C\u786C\u4EF6\u914D\u7F6E\u53EA\u8981\u4E0D\u62C9\u8DE8\u5C31\u884C\uFF0C\u7A7A\u95F2\u786C\u76D8\u67093G\u5C31\u884C

\u63A8\u8350\u5728\u5F00\u8BBENAT\u670D\u52A1\u5668\u524D\u5148\u589E\u52A0\u90E8\u5206SWAP\u865A\u62DF\u5185\u5B58\uFF0C\u907F\u514D\u7A81\u53D1\u7684\u5185\u5B58\u5360\u7528\u5BFC\u81F4\u6BCD\u9E21\u5361\u6B7B \u8DF3\u8F6C

PS: \u5982\u679C\u786C\u4EF6\u8D44\u6E90\u53EA\u662F\u597D\u4E86\u4E00\u70B9\uFF0C\u9700\u8981\u9650\u5236\u66F4\u591A\u4E1C\u897F\u5E76\u9700\u8981\u914D\u7F6EIPV6\u72EC\u7ACB\u5730\u5740\u548C\u9650\u5236\u786C\u76D8\u5927\u5C0F\uFF0C\u53EF\u4F7F\u7528LXD\u6279\u91CF\u5F00LXC\u865A\u62DF\u5316\u7684\u5BB9\u5668 \u8DF3\u8F6C

PS: \u5982\u679C\u786C\u4EF6\u975E\u5E38\u597D\u8D44\u6E90\u5F88\u591A\uFF0C\u53EF\u4F7F\u7528PVE\u6279\u91CF\u5F00KVM\u865A\u62DF\u5316\u7684\u865A\u62DF\u673A \u8DF3\u8F6C

',11),n=[p];function s(i,c,d,_,h,l){return t(),r("div",null,n)}var g=e(o,[["render",s]]);export{f as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/guide_docker_precheck.md.2257993a.lean.js b/docs/.vitepress/dist/assets/guide_docker_precheck.md.2257993a.lean.js new file mode 100644 index 0000000000..8e92dabec4 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_docker_precheck.md.2257993a.lean.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as t,a}from"./app.8fc4a373.js";const f='{"title":"\u9879\u76EE\u7279\u70B9","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u9879\u76EE\u7279\u70B9","slug":"\u9879\u76EE\u7279\u70B9"},{"level":2,"title":"\u914D\u7F6E\u8981\u6C42","slug":"\u914D\u7F6E\u8981\u6C42"}],"relativePath":"en_US/guide/docker_precheck.md","lastUpdated":1687182420000}',o={},p=a("",11),n=[p];function s(i,c,d,_,h,l){return t(),r("div",null,n)}var g=e(o,[["render",s]]);export{f as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/guide_docker_qa.md.530544e0.js b/docs/.vitepress/dist/assets/guide_docker_qa.md.530544e0.js new file mode 100644 index 0000000000..45cc572e85 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_docker_qa.md.530544e0.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a}from"./app.8fc4a373.js";const f='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/guide/docker_qa.md","lastUpdated":1687182420000}',r={};function o(c,s,n,_,d,p){return a(),t("div")}var l=e(r,[["render",o]]);export{f as __pageData,l as default}; diff --git a/docs/.vitepress/dist/assets/guide_docker_qa.md.530544e0.lean.js b/docs/.vitepress/dist/assets/guide_docker_qa.md.530544e0.lean.js new file mode 100644 index 0000000000..45cc572e85 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_docker_qa.md.530544e0.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a}from"./app.8fc4a373.js";const f='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/guide/docker_qa.md","lastUpdated":1687182420000}',r={};function o(c,s,n,_,d,p){return a(),t("div")}var l=e(r,[["render",o]]);export{f as __pageData,l as default}; diff --git a/docs/.vitepress/dist/assets/guide_docker_thanks.md.f5243d12.js b/docs/.vitepress/dist/assets/guide_docker_thanks.md.f5243d12.js new file mode 100644 index 0000000000..45cc572e85 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_docker_thanks.md.f5243d12.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a}from"./app.8fc4a373.js";const f='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/guide/docker_qa.md","lastUpdated":1687182420000}',r={};function o(c,s,n,_,d,p){return a(),t("div")}var l=e(r,[["render",o]]);export{f as __pageData,l as default}; diff --git a/docs/.vitepress/dist/assets/guide_docker_thanks.md.f5243d12.lean.js b/docs/.vitepress/dist/assets/guide_docker_thanks.md.f5243d12.lean.js new file mode 100644 index 0000000000..45cc572e85 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_docker_thanks.md.f5243d12.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a}from"./app.8fc4a373.js";const f='{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/guide/docker_qa.md","lastUpdated":1687182420000}',r={};function o(c,s,n,_,d,p){return a(),t("div")}var l=e(r,[["render",o]]);export{f as __pageData,l as default}; diff --git a/docs/.vitepress/dist/assets/guide_lxd_extra_config.md.2ee15fd0.js b/docs/.vitepress/dist/assets/guide_lxd_extra_config.md.2ee15fd0.js new file mode 100644 index 0000000000..a8fd2ad7a1 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_lxd_extra_config.md.2ee15fd0.js @@ -0,0 +1,25 @@ +import{_ as s,c as a,o as n,a as e}from"./app.8fc4a373.js";const k='{"title":"\u5176\u4ED6\u81EA\u5B9A\u4E49\u914D\u7F6E","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u81EA\u52A8\u914D\u7F6EIPV6\u5730\u5740","slug":"\u81EA\u52A8\u914D\u7F6Eipv6\u5730\u5740"},{"level":2,"title":"\u5C4F\u853D\u5BB9\u6613\u88AB\u6EE5\u7528\u7684\u7AEF\u53E3\u7684\u51FA\u5165\u6D41\u91CF\u4EE5\u5C4F\u853D\u7AEF\u53E3\u548C\u5C4F\u853D\u6EE5\u7528\u5DE5\u5177\u5305","slug":"\u5C4F\u853D\u5BB9\u6613\u88AB\u6EE5\u7528\u7684\u7AEF\u53E3\u7684\u51FA\u5165\u6D41\u91CF\u4EE5\u5C4F\u853D\u7AEF\u53E3\u548C\u5C4F\u853D\u6EE5\u7528\u5DE5\u5177\u5305"},{"level":2,"title":"\u4F7F\u7528screen\u914D\u7F6E\u76D1\u63A7\u5C4F\u853D\u67D0\u4E9B\u8FDB\u7A0B\u7684\u6267\u884C\u9047\u5230\u67D0\u4E9B\u8FDB\u7A0B\u7684\u51FA\u73B0\u76F4\u63A5\u5173\u95ED\u5BB9\u5668","slug":"\u4F7F\u7528screen\u914D\u7F6E\u76D1\u63A7\u5C4F\u853D\u67D0\u4E9B\u8FDB\u7A0B\u7684\u6267\u884C\u9047\u5230\u67D0\u4E9B\u8FDB\u7A0B\u7684\u51FA\u73B0\u76F4\u63A5\u5173\u95ED\u5BB9\u5668"},{"level":2,"title":"\u4E00\u952E\u5B89\u88C5\u5F00lxd\u6BCD\u9E21\u6240\u9700\u8981\u7684\u5E26vnstat\u73AF\u5883\u7684\u5E38\u7528\u9884\u914D\u7F6E\u73AF\u5883","slug":"\u4E00\u952E\u5B89\u88C5\u5F00lxd\u6BCD\u9E21\u6240\u9700\u8981\u7684\u5E26vnstat\u73AF\u5883\u7684\u5E38\u7528\u9884\u914D\u7F6E\u73AF\u5883"},{"level":2,"title":"\u4E00\u952E\u5B89\u88C5\u6BCD\u9E21\u53EF\u89C6\u5316\u64CD\u4F5C\u7684\u9762\u677F","slug":"\u4E00\u952E\u5B89\u88C5\u6BCD\u9E21\u53EF\u89C6\u5316\u64CD\u4F5C\u7684\u9762\u677F"}],"relativePath":"guide/lxd_extra_config.md","lastUpdated":1687182420000}',t={},o=e(`

\u5176\u4ED6\u81EA\u5B9A\u4E49\u914D\u7F6E

TIP

\u4EE5\u4E0B\u7684\u914D\u7F6E\u5B89\u88C5\u4F1A\u52A0\u91CD\u6BCD\u9E21\u7684\u8D1F\u62C5\uFF0C\u975E\u5FC5\u8981\u4E0D\u8981\u5B89\u88C5

TIP

\u5982\u679C\u662F\u4E2A\u4EBA\u4F7F\u7528\uFF0C\u53EF\u5FFD\u7565\u9632\u6EE5\u7528\u90E8\u5206\u811A\u672C\u7684\u5B89\u88C5

\u81EA\u52A8\u914D\u7F6EIPV6\u5730\u5740

  • (\u975E\u5FC5\u987B\uFF0C\u4E0D\u4F7F\u7528\u7684\u4E5F\u6CA1\u95EE\u9898)
  • \u8BE5\u811A\u672C\u4EC5\u9002\u7528\u4E8E\u6BCD\u9E21\u6709\u7ED9IPV6\u5B50\u7F51\u4E14\u662F/64\u7684\uFF0C\u4E14\u6BCD\u9E21\u7ED1\u5B9A\u4E86\u5B50\u7F51\u7684\u7B2C\u4E00\u4E2AIP\u505A\u6BCD\u9E21\u7684IPV6\u5730\u5740\u6216IPV6\u7684gateway
  • \u81EA\u52A8\u4E3ALXD\u521B\u5EFA\u7684LXC\u5BB9\u5668\u914D\u7F6EIPV6\u5730\u5740
  • \u5DF2\u96C6\u6210\u5230buildone.sh\u4E2D\u53EF\u4F7F\u7528\u53D8\u91CF\u63A7\u5236\u4E14\u65E0\u9700\u4E8B\u5148\u4E0B\u8F7D\uFF0C\u8BE5\u811A\u672C\u53EF\u4E0D\u624B\u52A8\u4F7F\u7528\uFF0C\u5728\u4F7F\u7528buildone.sh\u65F6\u914D\u7F6EY\u5F00\u542F\u5373\u53EF

\u4E0B\u8F7D\u811A\u672C

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_ipv6_network.sh -o build_ipv6_network.sh && chmod +x build_ipv6_network.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_ipv6_network.sh -o build_ipv6_network.sh && chmod +x build_ipv6_network.sh
+

\u81EA\u52A8\u4E3A\u5BB9\u5668\u914D\u7F6EIPV6\u6620\u5C04\u5730\u5740

bash build_ipv6_network.sh \u5BB9\u5668\u540D\u79F0
+

\u6620\u5C04\u5B8C\u6BD5\u4F1A\u6253\u5370\u4FE1\u606F

\u793A\u4F8B(\u7ED9test\u5BB9\u5668\u81EA\u52A8\u914D\u7F6EIPV6\u5730\u5740\uFF0C\u914D\u7F6E\u5B8C\u6210\u4F1A\u5199\u5165\u4E00\u4E2Atest_v6\u7684\u6587\u4EF6\u4FE1\u606F)

bash build_ipv6_network.sh test
+

\u5220\u9664\u6240\u6709IPV6\u5DF2\u6620\u5C04\u7684\u89C4\u5219

ip6tables -t nat -F PREROUTING
+ip6tables-legacy -t nat -F PREROUTING
+ip6tables-save > /etc/iptables/rules.v6
+netfilter-persistent save
+netfilter-persistent reload
+service netfilter-persistent restart
+

\u5378\u8F7DIPV6\u5730\u5740\u7ED1\u5B9A\u7684\u5B88\u62A4\u8FDB\u7A0B\u548C\u5BF9\u5E94\u7684\u6587\u4EF6

systemctl stop add-ipv6.service
+systemctl disable add-ipv6.service
+rm /etc/systemd/system/add-ipv6.service
+systemctl daemon-reload
+rm /usr/local/bin/add-ipv6.sh
+

\u5C4F\u853D\u5BB9\u6613\u88AB\u6EE5\u7528\u7684\u7AEF\u53E3\u7684\u51FA\u5165\u6D41\u91CF\u4EE5\u5C4F\u853D\u7AEF\u53E3\u548C\u5C4F\u853D\u6EE5\u7528\u5DE5\u5177\u5305

  • (\u975E\u5FC5\u987B\uFF0C\u8BE5\u811A\u672C\u4EC5\u4EC5\u662F\u4E3A\u4E86\u9632\u6B62\u5BB9\u5668\u6EE5\u7528\u65B9\u4FBF\uFF0C\u4E0D\u88C5\u7684\u4E5F\u6CA1\u95EE\u9898)
  • \u4E8B\u524D\u9884\u9632

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/rules.sh -o rules.sh && chmod +x rules.sh && bash rules.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/rules.sh -o rules.sh && chmod +x rules.sh && bash rules.sh
+

\u4F7F\u7528screen\u914D\u7F6E\u76D1\u63A7\u5C4F\u853D\u67D0\u4E9B\u8FDB\u7A0B\u7684\u6267\u884C\u9047\u5230\u67D0\u4E9B\u8FDB\u7A0B\u7684\u51FA\u73B0\u76F4\u63A5\u5173\u95ED\u5BB9\u5668

  • \u5982\u9700\u505C\u6B62\u76D1\u63A7\u53EF\u4F7F\u7528screen\u547D\u4EE4\u505C\u6B62lxc_moniter\u8FD9\u4E2A\u540D\u5B57\u7684\u7A97\u53E3\u5E76\u5220\u9664
  • (\u975E\u5FC5\u987B\uFF0C\u8BE5\u811A\u672C\u4EC5\u4EC5\u662F\u4E3A\u4E86\u9632\u6B62\u5BB9\u5668\u6EE5\u7528\u65B9\u4FBF\uFF0C\u4E0D\u88C5\u7684\u4E5F\u6CA1\u95EE\u9898)
  • \u4E8B\u540E\u505C\u673A

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_monitor.sh -o build_monitor.sh && chmod +x build_monitor.sh && bash build_monitor.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_monitor.sh -o build_monitor.sh && chmod +x build_monitor.sh && bash build_monitor.sh
+

\u4E00\u952E\u5B89\u88C5\u5F00lxd\u6BCD\u9E21\u6240\u9700\u8981\u7684\u5E26vnstat\u73AF\u5883\u7684\u5E38\u7528\u9884\u914D\u7F6E\u73AF\u5883

  • (\u975E\u5FC5\u987B\uFF0C\u8BE5\u811A\u672C\u4EC5\u4EC5\u662F\u4E3A\u4E86\u7AD9\u70B9\u5BF9\u63A5\u76D1\u63A7\u65B9\u4FBF\uFF0C\u4E0D\u88C5\u7684\u4E5F\u6CA1\u95EE\u9898)

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/backend.sh -o backend.sh && chmod +x backend.sh && bash backend.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/backend.sh -o backend.sh && chmod +x backend.sh && bash backend.sh
+

\u4E00\u952E\u5B89\u88C5\u6BCD\u9E21\u53EF\u89C6\u5316\u64CD\u4F5C\u7684\u9762\u677F

  • (\u975E\u5FC5\u987B\uFF0C\u8BE5\u9762\u677F\u53EA\u662F\u4E3A\u4E86\u65B9\u4FBF\u53EF\u89C6\u5316\u64CD\u4F5C\uFF0C\u6CA1\u6709\u4E5F\u6CA1\u95EE\u9898)
  • \u539F\u4F5C\u8005\u4ED3\u5E93\uFF1A\u8DF3\u8F6C
lxc config set core.https_address [::]
+lxc config set core.trust_password some-secret-string
+snap install lxdmosaic
+

\u5B89\u88C5\u5B8C\u6BD5\u540E\u6253\u5F00\u6BCD\u9E21IP\u5730\u5740\uFF0C\u6309\u7167\u63D0\u793A\u8BBE\u7F6Eadmin\u7684\u5BC6\u7801\uFF0C\u5176\u4ED6\u4E00\u8DEF\u9ED8\u8BA4\u5C31\u80FD\u4F7F\u7528\u9762\u677F\u4E86

`,41),p=[o];function c(l,i,r,d,u,h){return n(),a("div",null,p)}var b=s(t,[["render",c]]);export{k as __pageData,b as default}; diff --git a/docs/.vitepress/dist/assets/guide_lxd_extra_config.md.2ee15fd0.lean.js b/docs/.vitepress/dist/assets/guide_lxd_extra_config.md.2ee15fd0.lean.js new file mode 100644 index 0000000000..91f9c968d0 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_lxd_extra_config.md.2ee15fd0.lean.js @@ -0,0 +1 @@ +import{_ as s,c as a,o as n,a as e}from"./app.8fc4a373.js";const k='{"title":"\u5176\u4ED6\u81EA\u5B9A\u4E49\u914D\u7F6E","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u81EA\u52A8\u914D\u7F6EIPV6\u5730\u5740","slug":"\u81EA\u52A8\u914D\u7F6Eipv6\u5730\u5740"},{"level":2,"title":"\u5C4F\u853D\u5BB9\u6613\u88AB\u6EE5\u7528\u7684\u7AEF\u53E3\u7684\u51FA\u5165\u6D41\u91CF\u4EE5\u5C4F\u853D\u7AEF\u53E3\u548C\u5C4F\u853D\u6EE5\u7528\u5DE5\u5177\u5305","slug":"\u5C4F\u853D\u5BB9\u6613\u88AB\u6EE5\u7528\u7684\u7AEF\u53E3\u7684\u51FA\u5165\u6D41\u91CF\u4EE5\u5C4F\u853D\u7AEF\u53E3\u548C\u5C4F\u853D\u6EE5\u7528\u5DE5\u5177\u5305"},{"level":2,"title":"\u4F7F\u7528screen\u914D\u7F6E\u76D1\u63A7\u5C4F\u853D\u67D0\u4E9B\u8FDB\u7A0B\u7684\u6267\u884C\u9047\u5230\u67D0\u4E9B\u8FDB\u7A0B\u7684\u51FA\u73B0\u76F4\u63A5\u5173\u95ED\u5BB9\u5668","slug":"\u4F7F\u7528screen\u914D\u7F6E\u76D1\u63A7\u5C4F\u853D\u67D0\u4E9B\u8FDB\u7A0B\u7684\u6267\u884C\u9047\u5230\u67D0\u4E9B\u8FDB\u7A0B\u7684\u51FA\u73B0\u76F4\u63A5\u5173\u95ED\u5BB9\u5668"},{"level":2,"title":"\u4E00\u952E\u5B89\u88C5\u5F00lxd\u6BCD\u9E21\u6240\u9700\u8981\u7684\u5E26vnstat\u73AF\u5883\u7684\u5E38\u7528\u9884\u914D\u7F6E\u73AF\u5883","slug":"\u4E00\u952E\u5B89\u88C5\u5F00lxd\u6BCD\u9E21\u6240\u9700\u8981\u7684\u5E26vnstat\u73AF\u5883\u7684\u5E38\u7528\u9884\u914D\u7F6E\u73AF\u5883"},{"level":2,"title":"\u4E00\u952E\u5B89\u88C5\u6BCD\u9E21\u53EF\u89C6\u5316\u64CD\u4F5C\u7684\u9762\u677F","slug":"\u4E00\u952E\u5B89\u88C5\u6BCD\u9E21\u53EF\u89C6\u5316\u64CD\u4F5C\u7684\u9762\u677F"}],"relativePath":"guide/lxd_extra_config.md","lastUpdated":1687182420000}',t={},o=e("",41),p=[o];function c(l,i,r,d,u,h){return n(),a("div",null,p)}var b=s(t,[["render",c]]);export{k as __pageData,b as default}; diff --git a/docs/.vitepress/dist/assets/guide_lxd_install.md.87f65c61.js b/docs/.vitepress/dist/assets/guide_lxd_install.md.87f65c61.js new file mode 100644 index 0000000000..464c4e4be6 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_lxd_install.md.87f65c61.js @@ -0,0 +1,15 @@ +import{_ as a,c as s,o as n,a as p}from"./app.8fc4a373.js";const k='{"title":"LXD\u4E3B\u4F53\u5B89\u88C5","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u624B\u52A8\u5B89\u88C5","slug":"\u624B\u52A8\u5B89\u88C5"},{"level":3,"title":"\u5173\u95ED\u9632\u706B\u5899","slug":"\u5173\u95ED\u9632\u706B\u5899"},{"level":3,"title":"\u5F00\u8BBE\u865A\u62DF\u5185\u5B58SWAP","slug":"\u5F00\u8BBE\u865A\u62DF\u5185\u5B58swap"},{"level":3,"title":"\u5B89\u88C5LXD","slug":"\u5B89\u88C5lxd"},{"level":2,"title":"\u4E00\u952E\u5B89\u88C5","slug":"\u4E00\u952E\u5B89\u88C5"}],"relativePath":"guide/lxd_install.md","lastUpdated":1687182420000}',e={},t=p(`

LXD\u4E3B\u4F53\u5B89\u88C5

\u624B\u52A8\u5B89\u88C5

\u65B0\u624B\u63A8\u8350\uFF0C\u907F\u514D\u6709bug\u4E0D\u77E5\u9053\u600E\u4E48\u4FEE\uFF0C\u5F53\u7136\u5982\u679C\u53EA\u662F\u56FE\u65B9\u4FBF\u53C8\u662F\u8001\u624B\u61C2\u6392\u67E5BUG\uFF0C\u7528\u540E\u9762\u7684\u4E00\u952E\u5B89\u88C5\u4E5F\u884C

\u5173\u95ED\u9632\u706B\u5899

apt update
+apt install curl wget sudo dos2unix ufw jq -y
+ufw disable
+

\u5F00\u8BBE\u865A\u62DF\u5185\u5B58SWAP

\u5185\u5B58\u770B\u4F60\u5F00\u591A\u5C11\u5C0F\u9E21\uFF0C\u8FD9\u91CC\u5982\u679C\u8981\u5F008\u4E2A\uFF0C\u6362\u7B97\u9700\u89812G\u5185\u5B58\uFF0C\u5B9E\u9645\u5185\u5B58\u5982\u679C\u662F512MB\u5185\u5B58\uFF0C\u8FD8\u9700\u8981\u5F001.5G\uFF0C\u4FDD\u5B88\u70B9\u5F002G\u865A\u62DF\u5185\u5B58\u5373\u53EF

\u6267\u884C\u4E0B\u9762\u547D\u4EE4\uFF0C\u8F93\u51651\uFF0C\u518D\u8F93\u51652048\uFF0C\u4EE3\u8868\u5F002G\u865A\u62DF\u5185\u5B58

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/swap.sh -o swap.sh && chmod +x swap.sh && bash swap.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/swap.sh -o swap.sh && chmod +x swap.sh && bash swap.sh
+

\u5B89\u88C5LXD

\u5B9E\u9645swap\u5F00\u7684\u865A\u62DF\u5185\u5B58\u5E94\u8BE5\u662F\u5B9E\u9645\u5185\u5B58\u76842\u500D\uFF0C\u4E5F\u5C31\u662F\u5F001G\u662F\u5408\u7406\u7684\uFF0C\u4E0A\u9762\u6211\u63CF\u8FF0\u7684\u60C5\u51B5\u5C5E\u4E8E\u8D85\u5F00\u4E86

apt install snapd -y
+snap install lxd
+/snap/bin/lxd init
+

\u5982\u679C\u4E0A\u9762\u7684\u547D\u4EE4\u4E2D\u51FA\u73B0\u4E0B\u9762\u7684\u9519\u8BEF

(snap "lxd" assumes unsupported features: snapd2.39 (try to update snapd and refresh the core snap))

\u4F7F\u7528\u547D\u4EE4\u4FEE\u8865\u540E\u518D\u8FDB\u884Clxd\u7684\u5B89\u88C5

snap install core
+

\u5982\u679C\u65E0\u5F02\u5E38\uFF0C\u4E0A\u9762\u4E09\u884C\u547D\u4EE4\u6267\u884C\u7ED3\u679C\u5982\u4E0B

\u4E00\u822C\u7684\u9009\u9879\u56DE\u8F66\u9ED8\u8BA4\u5373\u53EF

\u9009\u62E9\u914D\u7F6E\u7269\u7406\u76D8\u5927\u5C0F(\u63D0\u793A\u9ED8\u8BA4\u6700\u5C0F1GB\u90A3\u4E2A\u9009\u9879)\uFF0C\u4E00\u822C\u6211\u586B\u7A7A\u95F2\u78C1\u76D8\u5927\u5C0F\u51CF\u53BB\u5185\u5B58\u5927\u5C0F\u540E\u4E58\u4EE50.95\u5E76\u5411\u4E0B\u53D6\u6574\uFF0C\u8FD9\u91CC\u6211\u586B\u4E8610GB

\u63D0\u793A\u5E26auto\u7684\u66F4\u65B0image\u7684\u9009\u9879\u8BB0\u5F97\u9009no\uFF0C\u907F\u514D\u66F4\u65B0\u5360\u7528\u7CFB\u7EDF

\u6D4B\u8BD5lxc\u6709\u6CA1\u6709\u8F6F\u8FDE\u63A5\u4E0A

lxc -h
+

\u5982\u679C\u62A5\u9519\u5219\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u8F6F\u8FDE\u63A5lxc\u547D\u4EE4

! lxc -h >/dev/null 2>&1 && echo 'alias lxc="/snap/bin/lxc"' >> /root/.bashrc && source /root/.bashrc
+export PATH=$PATH:/snap/bin
+

\u8FDE\u63A5\u540E\u518D\u6D4B\u8BD5lxc\u547D\u4EE4\u662F\u5426\u6709\u62A5\u9519\u627E\u4E0D\u5230

\u4E00\u952E\u5B89\u88C5

WARNING

\u5982\u679C\u662F\u5168\u65B0\u7684\u670D\u52A1\u5668\uFF0C\u52A1\u5FC5\u4FDD\u8BC1apt update\u548Capt install curl\u90FD\u65E0\u95EE\u9898\u518D\u6267\u884C\u672C\u811A\u672C

TIP

\u4E14\u81EA\u5F00\u673A\u8D77\u6700\u597D\u7B49\u5F855\u5206\u949F\u540E\u518D\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\uFF0C\u907F\u514D\u7CFB\u7EDF\u9ED8\u8BA4\u8BBE\u7F6E\u4E2D\u5C31\u6267\u884C\u4E86\u672C\u811A\u672C\u5BFC\u81F4apt\u6E90\u5361\u6B7B

  • \u73AF\u5883\u8981\u6C42\uFF1AUbuntu 18+(\u63A8\u8350)\uFF0CDebian 8+(\u4EC5\u9650x86_64\u67B6\u6784)

\u5982\u679C\u662FDebian\u7CFB\u7684\u5BBF\u4E3B\u673A\uFF0C\u52A1\u5FC5\u5728screen\u4E2D\u6267\u884C\u672C\u811A\u672C\uFF0C\u907F\u514D\u957F\u671F\u8FD0\u884C\u65F6SSH\u4E2D\u65AD\u5BFC\u81F4ZFS\u7F16\u8BD1\u5B89\u88C5\u5931\u8D25

\u8FD9\u91CC\u7684\u865A\u62DF\u5185\u5B58\u662F\u8BF4\u8981\u5F00\u7684SWAP\u5927\u5C0F\uFF0C\u5B58\u50A8\u6C60\u5219\u662F\u4F60\u6240\u6709\u8981\u5F00\u7684\u5C0F\u9E21\u5360\u7684\u76D8\u7684\u5927\u5C0F\u7684\u603B\u548C

\u73AF\u5883\u5B89\u88C5\u8FC7\u7A0B\u4E2D\u53EF\u80FD\u9700\u8981\u91CD\u542F\u670D\u52A1\u5668\u518D\u6B21\u6267\u884C\u4EE5\u52A0\u8F7D\u542Bzfs\u7684\u5185\u6838\uFF0C\u4E00\u5207\u4EE5\u8FD0\u884C\u540E\u547D\u4EE4\u884C\u7684\u63D0\u793A\u4E3A\u51C6

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/lxdinstall.sh -o lxdinstall.sh && chmod +x lxdinstall.sh && bash lxdinstall.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/lxdinstall.sh -o lxdinstall.sh && chmod +x lxdinstall.sh && bash lxdinstall.sh
+

\u4F8B\u5B50\uFF1A

\u5982\u679C\u7CFB\u7EDF\u76D8\u9664\u53BB\u5DF2\u5360\u7528\u7A7A\u95F4\u8FD8\u670918G\u786C\u76D8\u7A7A\u4F59\uFF0C\u60F3\u5F002G\u865A\u62DF\u5185\u5B58(2048MB\u7684SWAP)\uFF0C15G\u7684\u5B58\u50A8\u6C60\uFF0C\u6309\u7167\u547D\u4EE4\u884C\u7684\u63D0\u793A\u5219\u4F9D\u6B21\u8F93\u51652048\u548C15

`,42),l=[t];function o(c,i,r,d,h,u){return n(),s("div",null,l)}var x=a(e,[["render",o]]);export{k as __pageData,x as default}; diff --git a/docs/.vitepress/dist/assets/guide_lxd_install.md.87f65c61.lean.js b/docs/.vitepress/dist/assets/guide_lxd_install.md.87f65c61.lean.js new file mode 100644 index 0000000000..1792a7e4dd --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_lxd_install.md.87f65c61.lean.js @@ -0,0 +1 @@ +import{_ as a,c as s,o as n,a as p}from"./app.8fc4a373.js";const k='{"title":"LXD\u4E3B\u4F53\u5B89\u88C5","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u624B\u52A8\u5B89\u88C5","slug":"\u624B\u52A8\u5B89\u88C5"},{"level":3,"title":"\u5173\u95ED\u9632\u706B\u5899","slug":"\u5173\u95ED\u9632\u706B\u5899"},{"level":3,"title":"\u5F00\u8BBE\u865A\u62DF\u5185\u5B58SWAP","slug":"\u5F00\u8BBE\u865A\u62DF\u5185\u5B58swap"},{"level":3,"title":"\u5B89\u88C5LXD","slug":"\u5B89\u88C5lxd"},{"level":2,"title":"\u4E00\u952E\u5B89\u88C5","slug":"\u4E00\u952E\u5B89\u88C5"}],"relativePath":"guide/lxd_install.md","lastUpdated":1687182420000}',e={},t=p("",42),l=[t];function o(c,i,r,d,h,u){return n(),s("div",null,l)}var x=a(e,[["render",o]]);export{k as __pageData,x as default}; diff --git a/docs/.vitepress/dist/assets/guide_lxd_lxc.md.fe473a65.js b/docs/.vitepress/dist/assets/guide_lxd_lxc.md.fe473a65.js new file mode 100644 index 0000000000..4d88a34f52 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_lxd_lxc.md.fe473a65.js @@ -0,0 +1,34 @@ +import{_ as s,c as a,o as n,a as e}from"./app.8fc4a373.js";const g='{"title":"LXC\u865A\u62DF\u5316","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u666E\u901A\u7248\u672C\u6279\u91CF\u751F\u6210","slug":"\u666E\u901A\u7248\u672C\u6279\u91CF\u751F\u6210"},{"level":2,"title":"\u7EAFSSH\u7AEF\u53E3\u7248\u672C\u6279\u91CF\u751F\u6210","slug":"\u7EAFssh\u7AEF\u53E3\u7248\u672C\u6279\u91CF\u751F\u6210"},{"level":2,"title":"\u81EA\u5B9A\u4E49\u7248\u672C\u6279\u91CF\u751F\u6210","slug":"\u81EA\u5B9A\u4E49\u7248\u672C\u6279\u91CF\u751F\u6210"},{"level":2,"title":"\u67E5\u770B\u5DF2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F","slug":"\u67E5\u770B\u5DF2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F"},{"level":2,"title":"\u90E8\u5206\u5E38\u7528LXD\u547D\u4EE4","slug":"\u90E8\u5206\u5E38\u7528lxd\u547D\u4EE4"},{"level":2,"title":"\u5355\u72EC\u751F\u6210\u4E00\u4E2ANAT\u670D\u52A1\u5668","slug":"\u5355\u72EC\u751F\u6210\u4E00\u4E2Anat\u670D\u52A1\u5668"},{"level":3,"title":"\u4F7F\u7528\u65B9\u6CD5","slug":"\u4F7F\u7528\u65B9\u6CD5"}],"relativePath":"guide/lxd_lxc.md","lastUpdated":1687182420000}',p={},o=e(`

LXC\u865A\u62DF\u5316

\u666E\u901A\u7248\u672C\u6279\u91CF\u751F\u6210

\u5F00\u51FA\u7684\u5C0F\u9E21\u914D\u7F6E\uFF1A

  • 1\u6838256MB\u5185\u5B581GB\u786C\u76D8\u9650\u901F250Mbps\u5E26\u5BBD
  • \u5E261\u4E2ASSH\u7AEF\u53E3\uFF0C25\u4E2A\u5916\u7F51\u7AEF\u53E3
  • \u9ED8\u8BA4\u5185\u5B58\u548C\u786C\u76D8\u5927\u5C0F

TIP

lxc\u82E5\u547D\u4EE4\u65E0\u95EE\u9898\uFF0C\u6267\u884C\u521D\u59CB\u5316\u5F00\u5C0F\u9E21\uFF0C\u8FD9\u4E00\u6B65\u6700\u597D\u653Escreen\u4E2D\u540E\u53F0\u6302\u8D77\u6267\u884C\uFF0C\u5F00\u5C0F\u9E21\u65F6\u957F\u4E0E\u4F60\u5F00\u51E0\u4E2A\u548C\u6BCD\u9E21\u914D\u7F6E\u76F8\u5173

\u6267\u884C\u4E0B\u9762\u547D\u4EE4\u52A0\u8F7D\u5F00\u673A\u811A\u672C

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/init.sh -o init.sh && chmod +x init.sh && dos2unix init.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/init.sh -o init.sh && chmod +x init.sh && dos2unix init.sh
+

\u4E0B\u9762\u547D\u4EE4\u4E3A\u5F00\u5C0F\u9E21\u540D\u5B57\u524D\u7F00\u4E3Atj\u768410\u4E2A\u5C0F\u9E21

./init.sh tj 10
+

\u6709\u65F6\u5019init.sh\u7684\u8FD0\u884C\u8DEF\u5F84\u6709\u95EE\u9898\uFF0C\u6B64\u65F6\u5EFA\u8BAE\u524D\u9762\u52A0\u4E0Asudo\u5F3A\u5236\u6839\u76EE\u5F55\u6267\u884C

\u7EAFSSH\u7AEF\u53E3\u7248\u672C\u6279\u91CF\u751F\u6210

\u5F00\u51FA\u7684\u5C0F\u9E21\u914D\u7F6E\uFF1A

  • 1\u6838128MB\u5185\u5B58300MB\u786C\u76D8\u9650\u901F200Mbps\u5E26\u5BBD
  • \u53EA\u6709\u4E00\u4E2ASSH\u7AEF\u53E3
  • \u65E0\u6CD5\u6302\u8F7Dwarp

TIP

lxc\u82E5\u547D\u4EE4\u65E0\u95EE\u9898\uFF0C\u6267\u884C\u521D\u59CB\u5316\u5F00\u5C0F\u9E21\uFF0C\u8FD9\u4E00\u6B65\u6700\u597D\u653Escreen\u4E2D\u540E\u53F0\u6302\u8D77\u6267\u884C\uFF0C\u5F00\u5C0F\u9E21\u65F6\u957F\u4E0E\u4F60\u5F00\u51E0\u4E2A\u548C\u6BCD\u9E21\u914D\u7F6E\u76F8\u5173

\u52A0\u8F7D\u5F00\u673A\u811A\u672C

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/least.sh -o least.sh && chmod +x least.sh && dos2unix least.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/least.sh -o least.sh && chmod +x least.sh && dos2unix least.sh
+

\u4E0B\u5217\u547D\u4EE4\u6700\u540E\u4E00\u884C\u4E3A\u5F00\u5C0F\u9E21\u540D\u5B57\u524D\u7F00\u4E3Atj\u768410\u4E2A\u5C0F\u9E21

./least.sh tj 10
+

\u6709\u65F6\u5019least.sh\u7684\u8FD0\u884C\u8DEF\u5F84\u6709\u95EE\u9898\uFF0C\u6B64\u65F6\u5EFA\u8BAE\u524D\u9762\u52A0\u4E0Asudo\u5F3A\u5236\u6839\u76EE\u5F55\u6267\u884C

\u81EA\u5B9A\u4E49\u7248\u672C\u6279\u91CF\u751F\u6210

  • \u53EF\u81EA\u5B9A\u4E49\u5185\u5B58\u548C\u786C\u76D8\u5927\u5C0F
  • \u6709\u6267\u884C\u8FC7\u4E0A\u9762\u7684\u624B\u52A8\u6279\u91CF\u751F\u6210\u8FC7\u4E5F\u6CA1\u95EE\u9898\uFF0C\u914D\u7F6E\u662F\u7EE7\u627F\u7684\u4E0D\u8986\u76D6

\u5982\u679C\u9700\u8981\u591A\u6B21\u6279\u91CF\u751F\u6210\u5C0F\u9E21\uFF0C\u53EF\u4F7F\u7528

\u56FD\u9645

curl -L https://github.com/spiritLHLS/lxc/raw/main/scripts/add_more.sh -o add_more.sh && chmod +x add_more.sh && bash add_more.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://github.com/spiritLHLS/lxc/raw/main/scripts/add_more.sh -o add_more.sh && chmod +x add_more.sh && bash add_more.sh
+

\u53EF\u591A\u6B21\u8FD0\u884C\u6279\u91CF\u751F\u6210\u5C0F\u9E21\uFF0C\u4E14\u7EE7\u627F\u524D\u9762\u5DF2\u751F\u6210\u7684\u90E8\u5206\u5728\u540E\u9762\u6DFB\u52A0\uFF0C\u53EF\u81EA\u5B9A\u4E49\u5185\u5B58\u548C\u786C\u76D8\u5927\u5C0F

\u67E5\u770B\u5DF2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F

\u5F00\u5B8C\u5C0F\u9E21\u540E\uFF0C\u5177\u4F53\u4FE1\u606F\u4F1A\u751F\u6210\u5728\u5F53\u524D\u76EE\u5F55\u4E0B\u7684log\u6587\u4EF6\u4E2D\uFF0C\u683C\u5F0F\u5982\u4E0B

1\u53F7\u670D\u52A1\u5668\u540D\u79F0 \u5BC6\u7801 ssh\u7AEF\u53E3 \u5916\u7F51\u7AEF\u53E3\u8D77\u59CB \u5916\u7F51\u7AEF\u53E3\u7EC8\u6B62
+2\u53F7\u670D\u52A1\u5668\u540D\u79F0 \u5BC6\u7801 ssh\u7AEF\u53E3 \u5916\u7F51\u7AEF\u53E3\u8D77\u59CB \u5916\u7F51\u7AEF\u53E3\u7EC8\u6B62
+

\u5982\u679C\u60F3\u8981\u67E5\u770B\uFF0C\u53EA\u9700\u5728\u5F53\u524D\u76EE\u5F55\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u6253\u5370log\u6587\u4EF6\u5373\u53EF

cat log
+

WARNING

\u4E0D\u8981\u62FF\u8BE5\u811A\u672C\u5F00\u51FA\u7684\u5C0F\u9E21\u5F53\u751F\u4EA7\u73AF\u5883\uFF0CLXC\u865A\u62DF\u5316\u4E0D\u652F\u6301\u6362\u5185\u6838\uFF0Cdd\uFF0C\u5F00\u542Fbbr\u7B49\u64CD\u4F5C

\u90E8\u5206\u5E38\u7528LXD\u547D\u4EE4

\u67E5\u770B\u6240\u6709

lxc list
+

\u67E5\u770B\u4E2A\u4F8B

lxc info \u670D\u52A1\u5668\u540D\u5B57
+

\u542F\u52A8\u4E2A\u4F8B

lxc start \u670D\u52A1\u5668\u540D\u5B57
+

\u505C\u6B62\u4E2A\u4F8B

lxc stop \u670D\u52A1\u5668\u540D\u5B57
+

\u5220\u9664\u4E2A\u4F8B

lxc delete -f \u670D\u52A1\u5668\u540D\u5B57
+

\u8FDB\u5165\u5185\u90E8

lxc exec \u670D\u52A1\u5668\u540D\u5B57 /bin/bash
+

\u9000\u51FA\u5219\u8F93\u5165exit\u56DE\u8F66\u5373\u53EF

\u5220\u9664\u6240\u6709LXC\u5BB9\u5668

lxc list | awk '{print $2}' | grep -v "^$" | xargs -I {} lxc delete -f {}
+

\u5728\u5BB9\u5668\u5185\u6267\u884C\u5220\u9664\u65E0\u7528\u65E5\u5FD7

sudo apt-get autoremove
+sudo apt-get clean
+sudo find /var/log -type f -delete
+sudo find /var/tmp -type f -delete
+sudo find /tmp -type f -delete
+sudo find /var/cache/apt/archives -type f -delete
+

\u5355\u72EC\u751F\u6210\u4E00\u4E2ANAT\u670D\u52A1\u5668

  • \u53EA\u751F\u6210\u4E00\u4E2ANAT\u670D\u52A1\u5668\uFF0C\u53EF\u81EA\u5B9A\u4E49\u9650\u5236\u6240\u6709\u5185\u5BB9

\u4E0B\u8F7D\u5F00\u673A\u811A\u672C\u662F\u975E\u5FC5\u987B\u7684\uFF0C\u5982\u679C\u4F60\u4F7F\u7528\u8FC7\u4E00\u952E\u5B89\u88C5LXD\u7684\u547D\u4EE4\uFF0C\u81EA\u52A8\u5DF2\u4E0B\u8F7D\u5BF9\u5E94\u7684\u5F00\u673A\u811A\u672C\uFF0C\u4E0D\u7528\u4E0B\u8F7D\u8BE5\u811A\u672C

\u56FD\u9645

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/buildone.sh -o buildone.sh && chmod +x buildone.sh && dos2unix buildone.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/buildone.sh -o buildone.sh && chmod +x buildone.sh && dos2unix buildone.sh
+

\u4F7F\u7528\u65B9\u6CD5

\u5185\u5B58\u5927\u5C0F\u4EE5MB\u8BA1\u7B97\uFF0C\u786C\u76D8\u5927\u5C0F\u4EE5GB\u8BA1\u7B97\uFF0C\u4E0B\u8F7D\u901F\u5EA6\u4E0A\u4F20\u901F\u5EA6\u4EE5Mbit\u8BA1\u7B97\uFF0C\u662F\u5426\u542F\u7528IPV6\u4E0D\u4E00\u5B9A\u8981\u586BY\u6216\u8005N\uFF0C\u6CA1\u6709\u8FD9\u4E2A\u53C2\u6570\u4E5F\u884C

\u5982\u679C\u5916\u7F51\u8D77\u7AEF\u53E3\u548C\u5916\u7F51\u6B62\u7AEF\u53E3\u90FD\u8BBE\u7F6E\u4E3A0\u5219\u4E0D\u505A\u533A\u95F4\u5916\u7F51\u7AEF\u53E3\u6620\u5C04\u4E86\uFF0C\u53EA\u6620\u5C04\u57FA\u7840\u7684SSH\u7AEF\u53E3\uFF0C\u6CE8\u610F\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u4E0D\u8FDB\u884C\u6620\u5C04\u9700\u8981\u8BBE\u7F6E\u4E3A0

\u652F\u6301\u81EA\u5B9A\u4E49\u5C0F\u9E21\u7684\u7CFB\u7EDF\uFF0C\u6CE8\u610F\u4F20\u5165\u53C2\u6570\u4E3A\u7CFB\u7EDF\u540D\u5B57+\u7248\u672C\u53F7\uFF0C\u5982\uFF1Adebian11\u3001ubuntu20\uFF0Ccentos8\uFF0C\u6CE8\u610F\u90FD\u662F\u5C0F\u5199\u5B57\u6BCD+\u6570\u5B57\u7684\u7EC4\u5408

./buildone.sh \u5C0F\u9E21\u540D\u79F0 \u5185\u5B58\u5927\u5C0F \u786C\u76D8\u5927\u5C0F SSH\u7AEF\u53E3 \u5916\u7F51\u8D77\u7AEF\u53E3 \u5916\u7F51\u6B62\u7AEF\u53E3 \u4E0B\u8F7D\u901F\u5EA6 \u4E0A\u4F20\u901F\u5EA6 \u662F\u5426\u542F\u7528IPV6(Y or N) \u7CFB\u7EDF(\u7559\u7A7A\u5219\u4E3Adebian11)
+

\u793A\u4F8B

./buildone.sh test 256 2 20001 20002 20025 300 300 N
+
  • \u4EE5\u4E0B\u4E3A\u5F00\u8BBE\u7684\u793A\u4F8B\u5C0F\u9E21\u7684\u4FE1\u606F\uFF1A
    \u5C0F\u9E21\u540D\u5B57 - test SSH\u767B\u5F55\u7684\u7528\u6237\u540D - root SSH\u767B\u5F55\u7684\u5BC6\u7801 - \u968F\u673A\u751F\u6210 CPU\u6838\u6570 - 1
    \u5185\u5B58\u5927\u5C0F - 256MB \u78C1\u76D8\u5927\u5C0F - 2G
    \u5185\u5916\u7F51\u6620\u5C04\u7AEF\u53E3\u4E00\u81F4\u7684\u533A\u95F4 - 20002\u523020025 \u4E0A\u4F20\u5E26\u5BBD - 300Mbit \u4E0B\u8F7D\u5E26\u5BBD - 300Mbit \u81EA\u52A8\u8BBE\u7F6E\u5916\u7F51IPV6\u5730\u5740 - N \u7CFB\u7EDF - debian11

\u9700\u8981\u67E5\u770B\u4FE1\u606F\u5219\u6267\u884C

cat \u5C0F\u9E21\u540D\u5B57
+

\u6BD4\u5982\u67E5\u8BE2\u793A\u4F8B\u7684\u4FE1\u606F\u5C31\u662F

cat test
+

\u5982\u679C\u5DF2\u901A\u8FC7\u4EE5\u4E0A\u65B9\u6CD5\u751F\u6210\u8FC7\u5C0F\u9E21\uFF0C\u8FD8\u9700\u8981\u6279\u91CF\u751F\u6210\u5C0F\u9E21\uFF0C\u53EF\u4F7F\u7528\u624B\u52A8\u5B89\u88C5\u90E8\u5206\u7684\u811A\u672C\uFF0C\u4F46\u6CE8\u610F\u5148\u5220\u9664\u6D4B\u8BD5\u5C0F\u9E21\u518D\u8FDB\u884C\u6279\u91CF\u751F\u6210\u5C0F\u9E21

\u5220\u9664\u6D4B\u8BD5\u5C0F\u9E21

lxc delete -f test
+rm -rf test
+ls
+
`,79),t=[o];function c(l,i,d,r,u,h){return n(),a("div",null,t)}var k=s(p,[["render",c]]);export{g as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/guide_lxd_lxc.md.fe473a65.lean.js b/docs/.vitepress/dist/assets/guide_lxd_lxc.md.fe473a65.lean.js new file mode 100644 index 0000000000..3ffc19ec34 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_lxd_lxc.md.fe473a65.lean.js @@ -0,0 +1 @@ +import{_ as s,c as a,o as n,a as e}from"./app.8fc4a373.js";const g='{"title":"LXC\u865A\u62DF\u5316","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u666E\u901A\u7248\u672C\u6279\u91CF\u751F\u6210","slug":"\u666E\u901A\u7248\u672C\u6279\u91CF\u751F\u6210"},{"level":2,"title":"\u7EAFSSH\u7AEF\u53E3\u7248\u672C\u6279\u91CF\u751F\u6210","slug":"\u7EAFssh\u7AEF\u53E3\u7248\u672C\u6279\u91CF\u751F\u6210"},{"level":2,"title":"\u81EA\u5B9A\u4E49\u7248\u672C\u6279\u91CF\u751F\u6210","slug":"\u81EA\u5B9A\u4E49\u7248\u672C\u6279\u91CF\u751F\u6210"},{"level":2,"title":"\u67E5\u770B\u5DF2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F","slug":"\u67E5\u770B\u5DF2\u6279\u91CF\u5F00\u8BBE\u7684\u4FE1\u606F"},{"level":2,"title":"\u90E8\u5206\u5E38\u7528LXD\u547D\u4EE4","slug":"\u90E8\u5206\u5E38\u7528lxd\u547D\u4EE4"},{"level":2,"title":"\u5355\u72EC\u751F\u6210\u4E00\u4E2ANAT\u670D\u52A1\u5668","slug":"\u5355\u72EC\u751F\u6210\u4E00\u4E2Anat\u670D\u52A1\u5668"},{"level":3,"title":"\u4F7F\u7528\u65B9\u6CD5","slug":"\u4F7F\u7528\u65B9\u6CD5"}],"relativePath":"guide/lxd_lxc.md","lastUpdated":1687182420000}',p={},o=e("",79),t=[o];function c(l,i,d,r,u,h){return n(),a("div",null,t)}var k=s(p,[["render",c]]);export{g as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/guide_lxd_precheck.md.c67a5395.js b/docs/.vitepress/dist/assets/guide_lxd_precheck.md.c67a5395.js new file mode 100644 index 0000000000..cb95220b43 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_lxd_precheck.md.c67a5395.js @@ -0,0 +1,3 @@ +import{_ as e,c as t,o as r,a as i}from"./app.8fc4a373.js";const g='{"title":"\u7CFB\u7EDF\u4E0E\u786C\u4EF6\u914D\u7F6E\u8981\u6C42","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u8981\u6C42","slug":"\u8981\u6C42"},{"level":2,"title":"\u9879\u76EE\u7279\u70B9","slug":"\u9879\u76EE\u7279\u70B9"},{"level":2,"title":"\u68C0\u6D4B\u73AF\u5883","slug":"\u68C0\u6D4B\u73AF\u5883"}],"relativePath":"guide/lxd_precheck.md","lastUpdated":1687182420000}',a={},c=i(`

\u7CFB\u7EDF\u4E0E\u786C\u4EF6\u914D\u7F6E\u8981\u6C42

\u8981\u6C42

\u786C\u4EF6\u8981\u6C42:

  • \u7CFB\u7EDF\uFF1ADebian 8+, Ubuntu 18+(\u63A8\u8350)\uFF0C\u7CFB\u7EDF\u8D8A\u65B0\u8D8A\u597D
  • \u865A\u62DF\u5316\uFF1A\u63A8\u8350KVM\u3001VMWARE\u865A\u62DF\u5316
  • \u5185\u5B58\uFF1A\u5185\u5B58\u81F3\u5C11512MB
  • \u786C\u76D8\uFF1A\u786C\u76D8(\u7CFB\u7EDF\u76D8)\u81F3\u5C1110G
  • \u7F51\u7EDC\uFF1A\u72EC\u7ACB\u7684IPV4\u5730\u5740\uFF0CIPV6\u53EF\u6709\u53EF\u65E0\uFF0C\u5E26\u5BBD\u80FD\u4E0B\u8F7D\u811A\u672C\u5C31\u884C\uFF0C\u7F51\u7EDC\u80FD\u8FDE\u63A5Github\u7684raw\u9875\u9762\u5C31\u884C

PS: \u5982\u679C\u786C\u4EF6\u975E\u5E38\u597D\u8D44\u6E90\u5F88\u591A\uFF0C\u53EF\u4F7F\u7528PVE\u6279\u91CF\u5F00KVM\u865A\u62DF\u5316\u7684\u865A\u62DF\u673A \u8DF3\u8F6C

PS: \u5982\u679C\u786C\u4EF6\u8D44\u6E90\u66F4\u70C2\uFF0C\u865A\u62DF\u5316\u4E0D\u652F\u6301\uFF0C\u53EF\u4F7F\u7528docker\u7248\u672C\u7684\uFF0C\u9002\u914D\u9762\u66F4\u5E7F \u8DF3\u8F6C

\u9879\u76EE\u7279\u70B9

  • \u672C\u5957\u811A\u672C\u5F00\u53D1\u4F7F\u7528\u7684Ubuntu20\uFF0CUbuntu\u522B\u7684\u957F\u671F\u7EF4\u62A4\u7248\u672C\u5E94\u8BE5\u4E5F\u6CA1\u95EE\u9898\uFF0CDebian\u65E0\u6CD5\u4F7F\u7528zfs\u65F6\u81EA\u52A8\u5207\u6362\u522B\u7684\u5B58\u50A8\u7C7B\u578B

  • \u5DF2\u8BBE\u7F6E\u540C\u65F6\u8FDB\u884CTCP\u548CUDP\u8F6C\u53D1\uFF0C\u9664\u4E86SSH\u7AEF\u53E3\u5176\u4ED6\u7684\u6620\u5C04\u5185\u7F51\u5916\u7F51\u7AEF\u53E3\u4E00\u81F4

  • \u5DF2\u8BBE\u7F6E\u652F\u6301\u5F00\u51FA\u7684LXC\u5BB9\u5668\u8FDB\u884Cdocker\u5D4C\u5957\u865A\u62DF\uFF0C\u9ED8\u8BA4\u666E\u901A\u7248\u672C\u548C\u7EAF\u63A2\u9488\u7248\u672C\u4F7F\u7528debian11\u7CFB\u7EDF

  • \u5DF2\u5C4F\u853D\u5BB9\u5668\u5185\u53EF\u80FD\u7528\u4E8E\u6EE5\u7528\u7684\u5DE5\u5177\u5305\u548CIPV4\u7F51\u7EDC\u7684TCP/UDP\u534F\u8BAE\u7684\u7AEF\u53E3( 3389 8888 54321 65432 )\uFF0C\u4EE5\u9632\u6B62\u5BB9\u5668\u88AB\u7528\u4E8E\u626B\u63CF\u548C\u7206\u7834\uFF0C\u4E14\u53EF\u5916\u7F6E\u8FDB\u7A0B\u68C0\u67E5\u6709\u95EE\u9898\u81EA\u52A8\u505C\u673A

  • \u5DF2\u652F\u6301\u4E00\u952E\u4E3ALXC\u5BB9\u5668\u914D\u7F6EIPV6\u5730\u5740(\u524D\u63D0\u662F\u6BCD\u9E21\u6709IPV6\u5B50\u7F51\uFF0C\u65E0IPV6\u5730\u5740\u5219\u4E0D\u914D\u7F6E)

  • \u4E00\u5B9A\u8981\u5728 /root \u7684\u8DEF\u5F84\u4E0B\u8FD0\u884C\u672C\u4ED3\u5E93\u811A\u672C\uFF0C\u4E14\u4F7F\u7528\u4E00\u952E\u811A\u672C\u7684\u4E0D\u8981\u5220\u9664\u8DEF\u5F84\u4E0B\u7684ssh.sh\u548Cconfig.sh\u6587\u4EF6

  • \u4FDD\u8BC1\u4F60\u8981\u5F00\u7684\u76D8\u4E3A\u9ED8\u8BA4\u7684\u7CFB\u7EDF\u76D8(sda\u6216\u8005sda1)\u800C\u4E0D\u662F\u6302\u8F7D\u7684\u76D8(sdb\u4E4B\u7C7B\u7684)\uFF0C\u4E0D\u786E\u5B9A\u7684\u4F7F\u7528fdisk -l\u548Cdf\u67E5\u770B

  • \u6302\u8F7D\u5176\u4ED6\u76D8\u7684\u8BE6\u770B \u5176\u4ED6\u8BF4\u660E

  • \u4E00\u952E\u811A\u672C\u652F\u6301\u81EA\u5B9A\u4E49\u9650\u5236\u6240\u6709\u5185\u5BB9\uFF0C\u666E\u901A\u7248\u672C\u652F\u6301\u591A\u6B21\u8FD0\u884C\u6279\u91CF\u751F\u6210\u4E0D\u8986\u76D6\u5148\u524D\u751F\u6210\u7684\u914D\u7F6E

\u68C0\u6D4B\u73AF\u5883

\u4F7F\u7528\u540E\u7EED\u811A\u672C\u7684\u52A1\u5FC5\u6267\u884C\u672C\u547D\u4EE4\u68C0\u6D4B\u6BCD\u9E21\u662F\u5426\u7B26\u5408\u8981\u6C42

\u56FD\u9645

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/pre_check.sh)
+

\u56FD\u5185

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/pre_check.sh)
+
`,14),l=[c];function o(s,p,d,n,h,_){return r(),t("div",null,l)}var b=e(a,[["render",o]]);export{g as __pageData,b as default}; diff --git a/docs/.vitepress/dist/assets/guide_lxd_precheck.md.c67a5395.lean.js b/docs/.vitepress/dist/assets/guide_lxd_precheck.md.c67a5395.lean.js new file mode 100644 index 0000000000..d226cad40d --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_lxd_precheck.md.c67a5395.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as r,a as i}from"./app.8fc4a373.js";const g='{"title":"\u7CFB\u7EDF\u4E0E\u786C\u4EF6\u914D\u7F6E\u8981\u6C42","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u8981\u6C42","slug":"\u8981\u6C42"},{"level":2,"title":"\u9879\u76EE\u7279\u70B9","slug":"\u9879\u76EE\u7279\u70B9"},{"level":2,"title":"\u68C0\u6D4B\u73AF\u5883","slug":"\u68C0\u6D4B\u73AF\u5883"}],"relativePath":"guide/lxd_precheck.md","lastUpdated":1687182420000}',a={},c=i("",14),l=[c];function o(s,p,d,n,h,_){return r(),t("div",null,l)}var b=e(a,[["render",o]]);export{g as __pageData,b as default}; diff --git a/docs/.vitepress/dist/assets/guide_lxd_qa.md.9de3e5ac.js b/docs/.vitepress/dist/assets/guide_lxd_qa.md.9de3e5ac.js new file mode 100644 index 0000000000..099b88a0a0 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_lxd_qa.md.9de3e5ac.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as r,a as t}from"./app.8fc4a373.js";const v='{"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u53EF\u5F00\u5E26\u72EC\u7ACBIPV6\u5730\u5740\u5BB9\u5668\u7684VPS\u5546\u5BB6","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u53EF\u5F00\u5E26\u72EC\u7ACBIPV6\u5730\u5740\u5BB9\u5668\u7684VPS\u5546\u5BB6","slug":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u53EF\u5F00\u5E26\u72EC\u7ACBipv6\u5730\u5740\u5BB9\u5668\u7684vps\u5546\u5BB6"}],"relativePath":"en_US/guide/lxd_qa.md","lastUpdated":1687182420000}',p={},o=t('

\u76EE\u524D\u5DF2\u9A8C\u8BC1\u53EF\u5F00\u5E26\u72EC\u7ACBIPV6\u5730\u5740\u5BB9\u5668\u7684VPS\u5546\u5BB6

kuroit \u4E2D\u7684 \u7F8E\u56FD\u51E4\u51F0\u57CE regular

datalix \u4E2D\u7684 \u5FB7\u56FDAMD \u4FC3\u9500\u6B3E

luxvps \u4E2D\u7684 \u5FB7\u56FDAMD \u4FC3\u9500\u6B3E

',4),_=[o];function n(s,l,i,d,f,c){return r(),a("div",null,_)}var u=e(p,[["render",n]]);export{v as __pageData,u as default}; diff --git a/docs/.vitepress/dist/assets/guide_lxd_qa.md.9de3e5ac.lean.js b/docs/.vitepress/dist/assets/guide_lxd_qa.md.9de3e5ac.lean.js new file mode 100644 index 0000000000..98776281ee --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_lxd_qa.md.9de3e5ac.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as r,a as t}from"./app.8fc4a373.js";const v='{"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u53EF\u5F00\u5E26\u72EC\u7ACBIPV6\u5730\u5740\u5BB9\u5668\u7684VPS\u5546\u5BB6","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u53EF\u5F00\u5E26\u72EC\u7ACBIPV6\u5730\u5740\u5BB9\u5668\u7684VPS\u5546\u5BB6","slug":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u53EF\u5F00\u5E26\u72EC\u7ACBipv6\u5730\u5740\u5BB9\u5668\u7684vps\u5546\u5BB6"}],"relativePath":"en_US/guide/lxd_qa.md","lastUpdated":1687182420000}',p={},o=t("",4),_=[o];function n(s,l,i,d,f,c){return r(),a("div",null,_)}var u=e(p,[["render",n]]);export{v as __pageData,u as default}; diff --git a/docs/.vitepress/dist/assets/guide_lxd_thanks.md.4fca498d.js b/docs/.vitepress/dist/assets/guide_lxd_thanks.md.4fca498d.js new file mode 100644 index 0000000000..d6d0dd140b --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_lxd_thanks.md.4fca498d.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as t,a as n}from"./app.8fc4a373.js";const f='{"title":"\u81F4\u8C22","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u81F4\u8C22","slug":"\u81F4\u8C22"}],"relativePath":"en_US/guide/lxd_thanks.md","lastUpdated":1687182420000}',o={},a=n('

\u81F4\u8C22

https://github.com/lxc/lxd

https://lxdware.com/

https://discuss.linuxcontainers.org/

https://discuss.linuxcontainers.org/t/how-to-run-docker-inside-lxc-container/13017/4

https://discuss.linuxcontainers.org/t/error-seccomp-notify-not-supported-on-container-start/15038/3

https://discuss.linuxcontainers.org/t/how-do-i-assign-a-public-ipv6-address-to-a-lxc-container/6028

https://github.com/turtle0x1/LxdMosaic

https://openzfs.github.io/openzfs-docs/Getting Started/Debian/index.html

\u611F\u8C22 @Ella-Alinda @fscarmen \u63D0\u4F9B\u7684\u6307\u5BFC

',10),s=[a];function i(p,c,l,d,h,u){return t(),r("div",null,s)}var g=e(o,[["render",i]]);export{f as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/guide_lxd_thanks.md.4fca498d.lean.js b/docs/.vitepress/dist/assets/guide_lxd_thanks.md.4fca498d.lean.js new file mode 100644 index 0000000000..c82ec7488c --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_lxd_thanks.md.4fca498d.lean.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as t,a as n}from"./app.8fc4a373.js";const f='{"title":"\u81F4\u8C22","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u81F4\u8C22","slug":"\u81F4\u8C22"}],"relativePath":"en_US/guide/lxd_thanks.md","lastUpdated":1687182420000}',o={},a=n("",10),s=[a];function i(p,c,l,d,h,u){return t(),r("div",null,s)}var g=e(o,[["render",i]]);export{f as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/guide_pve_install.md.7fcfd8d3.js b/docs/.vitepress/dist/assets/guide_pve_install.md.7fcfd8d3.js new file mode 100644 index 0000000000..2cf342c71b --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_pve_install.md.7fcfd8d3.js @@ -0,0 +1,7 @@ +import{_ as s,c as a,o as e,a as t}from"./app.8fc4a373.js";const k='{"title":"PVE\u4E3B\u4F53\u5B89\u88C5","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u4E00\u952E\u5B89\u88C5PVE","slug":"\u4E00\u952E\u5B89\u88C5pve"},{"level":2,"title":"\u9884\u914D\u7F6E\u73AF\u5883","slug":"\u9884\u914D\u7F6E\u73AF\u5883"},{"level":2,"title":"\u81EA\u52A8\u914D\u7F6E\u5BBF\u4E3B\u673A\u7684\u7F51\u5173","slug":"\u81EA\u52A8\u914D\u7F6E\u5BBF\u4E3B\u673A\u7684\u7F51\u5173"}],"relativePath":"guide/pve_install.md","lastUpdated":1687182420000}',n={},c=t(`

PVE\u4E3B\u4F53\u5B89\u88C5

\u4E00\u952E\u5B89\u88C5PVE

  • \u5B89\u88C5\u7684\u662F\u5F53\u4E0Bapt\u6E90\u6700\u65B0\u7684PVE
  • \u6BD4\u5982debian10\u5219\u662Fpve6.4\uFF0Cdebian11\u5219\u662Fpve7.x\uFF0Cdebian12\u5219\u662Fpve8.x

TIP

\u5EFA\u8BAEdebian11\u800C\u4E0D\u662Fdebian12\uFF0C\u56E0\u4E3A\u540E\u8005\u662Fbeta\u7248\u672C\uFF0Cdebian11\u5B89\u88C5\u7684\u624D\u662F\u7A33\u5B9A\u7248

  • /etc/hosts\u6587\u4EF6\u4FEE\u6539(\u4FEE\u6B63\u5546\u5BB6hostname\u8BBE\u7F6E\u9519\u8BEF\u4EE5\u53CA\u65B0\u589EPVE\u6240\u9700\u7684\u5185\u5BB9)
  • \u5DF2\u8BBE\u7F6E/etc/hosts\u4E3A\u53EA\u8BFB\u6A21\u5F0F\uFF0C\u907F\u514D\u91CD\u542F\u540E\u6587\u4EF6\u88AB\u8986\u5199\uFF0C\u5982\u9700\u4FEE\u6539\u8BF7\u4F7F\u7528chattr -i /etc/hosts\u53D6\u6D88\u53EA\u8BFB\u9501\u5B9A\uFF0C\u4FEE\u6539\u5B8C\u6BD5\u8BF7\u6267\u884Cchattr +i /etc/hosts\u53EA\u8BFB\u9501\u5B9A
  • \u68C0\u6D4B/etc/cloud/cloud.cfg\u5982\u679C\u53D1\u73B0preserve_hostname\u662Ffalse\uFF0C\u5219\u6539\u4E3Atrue\uFF0C\u540C\u4E0A\uFF0C\u4E5F\u7528chattr\u547D\u4EE4\u8FDB\u884C\u4E86\u6587\u4EF6\u9501\u5B9A\u907F\u514D\u91CD\u542F\u8986\u76D6\u8BBE\u7F6E
  • \u68C0\u6D4B\u662F\u5426\u4E3A\u4E2D\u56FDIP\uFF0C\u5982\u679C\u4E3A\u4E2D\u56FDIP\u4F7F\u7528\u6E05\u534E\u955C\u50CF\u6E90\uFF0C\u5426\u5219\u4F7F\u7528\u5B98\u65B9\u6E90
  • \u5B89\u88C5PVE\u5F00\u865A\u62DF\u673A\u9700\u8981\u7684\u5FC5\u5907\u5DE5\u5177\u5305
  • \u66FF\u6362apt\u6E90\u4E2D\u7684\u4F01\u4E1A\u8BA2\u9605\u4E3A\u793E\u533A\u6E90
  • \u6253\u5370\u67E5\u8BE2Linux\u7CFB\u7EDF\u5185\u6838\u548CPVE\u5185\u6838\u662F\u5426\u5DF2\u5B89\u88C5
  • \u68C0\u6D4B/etc/resolv.conf\u662F\u5426\u4E3A\u7A7A\uFF0C\u4E3A\u7A7A\u5219\u8BBE\u7F6E\u68C0\u6D4B8.8.8.8\u7684\u5F00\u673A\u81EA\u542F\u6DFB\u52A0DNS\u7684systemd\u670D\u52A1
  • \u65B0\u589EPVE\u7684APT\u6E90\u94FE\u63A5\u540E\uFF0C\u4E0B\u8F7DPVE\u5E76\u6253\u5370\u8F93\u51FA\u767B\u9646\u4FE1\u606F

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/install_pve.sh -o install_pve.sh && chmod +x install_pve.sh && bash install_pve.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/install_pve.sh -o install_pve.sh && chmod +x install_pve.sh && bash install_pve.sh
+

\u9884\u914D\u7F6E\u73AF\u5883

  • \u521B\u5EFA\u8D44\u6E90\u6C60mypool
  • \u79FB\u9664\u8BA2\u9605\u5F39\u7A97
  • \u5C1D\u8BD5\u5F00\u542F\u786C\u4EF6\u76F4\u901A
  • \u68C0\u6D4BAppArmor\u6A21\u5757\u5E76\u8BD5\u56FE\u5B89\u88C5
  • \u91CD\u542F\u7CFB\u7EDF\u524D\u63A8\u8350\u6302\u4E0Anezha\u63A2\u9488\u65B9\u4FBF\u5728\u540E\u53F0\u4E0D\u901A\u8FC7SSH\u4F7F\u7528\u547D\u4EE4\u884C\uFF0C\u907F\u514DSSH\u53EF\u80FD\u56E0\u4E3A\u5546\u5BB6\u5947\u8469\u7684\u9884\u8BBE\u5BFC\u81F4\u91CD\u542F\u540Eroot\u5BC6\u7801\u4E22\u5931
  • \u6267\u884C\u5B8C\u6BD5\u5EFA\u8BAE\u7B49\u5F85\u51E0\u5206\u949F\u540E\u518D\u91CD\u542F\u670D\u52A1\u5668\uFF0C\u6267\u884Creboot\u524D\u9700\u8981\u7B49\u5F85\u540E\u53F0\u4EFB\u52A1\u6267\u884C\u5B8C\u6BD5\uFF0C\u4E00\u4E9B\u5BBF\u4E3B\u673A\u7684\u7CFB\u7EDFapt\u547D\u4EE4\u6267\u884C\u5F88\u6162\uFF0C\u5F97\u7B49\u4E00\u4F1A\u624D\u80FD\u6267\u884C\u5B8C\u6BD5

\u56FD\u9645

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_backend.sh)
+

\u56FD\u5185

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_backend.sh)
+

\u81EA\u52A8\u914D\u7F6E\u5BBF\u4E3B\u673A\u7684\u7F51\u5173

WARNING

\u4F7F\u7528\u524D\u8BF7\u4FDD\u8BC1\u91CD\u542F\u8FC7\u670D\u52A1\u5668\u4E14\u6B64\u65F6PVE\u80FD\u6B63\u5E38\u4F7F\u7528WEB\u7AEF\u518D\u6267\u884C\uFF0C\u91CD\u542F\u673A\u5668\u540E\u4E0D\u8981\u7ACB\u5373\u6267\u884C\u6B64\u547D\u4EE4\uFF0C\u5F85WEB\u7AEF\u542F\u52A8\u6210\u529F\u540E\u81F3\u5C11\u7B495\u5206\u949F\u518D\u6267\u884C\u672C\u547D\u4EE4

TIP

\u8FD9\u4E00\u6B65\u662F\u6700\u5BB9\u6613\u9020\u6210SSH\u65AD\u5F00\u7684\uFF0C\u539F\u56E0\u662F\u672A\u7B49\u5F85PVE\u5185\u6838\u542F\u52A8\u5C31\u4FEE\u6539\u7F51\u7EDC\u4F1A\u9020\u6210\u8BBE\u7F6E\u51B2\u7A81\uFF0C\u6240\u4EE5\u81F3\u5C11\u7B49\u51E0\u5206\u949F\u5F85\u5185\u6838\u542F\u52A8\u4E5F\u5C31\u662FWEB\u7AEF\u542F\u52A8\u6210\u529F\u540E\u518D\u6267\u884C

  • \u521B\u5EFAvmbr0\uFF0C\u6BCD\u9E21\u5141\u8BB8addr\u548Cgateway\u4E3A\u5185\u7F51IP\u6216\u5916\u7F51IP\uFF0C\u5DF2\u81EA\u52A8\u8BC6\u522B
  • vmbr0\u521B\u5EFA\u652F\u6301\u7EAFIPV4\u6216\u53CC\u6808\u670D\u52A1\u5668\uFF0C\u81EA\u52A8\u8BC6\u522BIPV4\u5730\u5740\u548CIPV6\u5730\u5740\uFF0C\u81EA\u52A8\u8BC6\u522B\u5BF9\u5E94\u7684IP\u533A\u95F4
  • \u521B\u5EFAvmbr1(NAT\u7F51\u5173)
  • \u5F00NAT\u865A\u62DF\u673A\u65F6\u7F51\u5173\uFF08IPV4\uFF09\u4F7F\u7528172.16.1.1\uFF0CIPV4/CIDR\u4F7F\u7528172.16.1.x/24\uFF0C\u8FD9\u91CC\u7684x\u4E0D\u80FD\u662F1\uFF0C\u5F53\u7136\u5982\u679C\u540E\u7EED\u4F7F\u7528\u672C\u5957\u811A\u672C\u65E0\u9700\u5173\u6CE8\u8FD9\u70B9\u7EC6\u679D\u672B\u8282\u7684\u4E1C\u897F
  • \u60F3\u67E5\u770B\u5B8C\u6574\u8BBE\u7F6E\u53EF\u4EE5\u6267\u884Ccat /etc/network/interfaces\u67E5\u770B
  • \u52A0\u8F7Diptables\u5E76\u8BBE\u7F6E\u56DE\u6E90\u4E14\u5141\u8BB8NAT\u7AEF\u53E3\u8F6C\u53D1

\u56FD\u9645

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_nat_network.sh)
+

\u56FD\u5185

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_nat_network.sh)
+
`,23),o=[c];function p(i,l,r,d,h,u){return e(),a("div",null,o)}var m=s(n,[["render",p]]);export{k as __pageData,m as default}; diff --git a/docs/.vitepress/dist/assets/guide_pve_install.md.7fcfd8d3.lean.js b/docs/.vitepress/dist/assets/guide_pve_install.md.7fcfd8d3.lean.js new file mode 100644 index 0000000000..2f7e1fef99 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_pve_install.md.7fcfd8d3.lean.js @@ -0,0 +1 @@ +import{_ as s,c as a,o as e,a as t}from"./app.8fc4a373.js";const k='{"title":"PVE\u4E3B\u4F53\u5B89\u88C5","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u4E00\u952E\u5B89\u88C5PVE","slug":"\u4E00\u952E\u5B89\u88C5pve"},{"level":2,"title":"\u9884\u914D\u7F6E\u73AF\u5883","slug":"\u9884\u914D\u7F6E\u73AF\u5883"},{"level":2,"title":"\u81EA\u52A8\u914D\u7F6E\u5BBF\u4E3B\u673A\u7684\u7F51\u5173","slug":"\u81EA\u52A8\u914D\u7F6E\u5BBF\u4E3B\u673A\u7684\u7F51\u5173"}],"relativePath":"guide/pve_install.md","lastUpdated":1687182420000}',n={},c=t("",23),o=[c];function p(i,l,r,d,h,u){return e(),a("div",null,o)}var m=s(n,[["render",p]]);export{k as __pageData,m as default}; diff --git a/docs/.vitepress/dist/assets/guide_pve_kvm.md.c79c334f.js b/docs/.vitepress/dist/assets/guide_pve_kvm.md.c79c334f.js new file mode 100644 index 0000000000..a596fc9c26 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_pve_kvm.md.c79c334f.js @@ -0,0 +1,27 @@ +import{_ as s,c as a,o as e,a as n}from"./app.8fc4a373.js";const v='{"title":"KVM\u865A\u62DF\u5316","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u90E8\u5206\u6CE8\u610F\u4E8B\u9879","slug":"\u90E8\u5206\u6CE8\u610F\u4E8B\u9879"},{"level":2,"title":"\u5355\u72EC\u5F00\u8BBEKVM\u865A\u62DF\u5316\u7684VM","slug":"\u5355\u72EC\u5F00\u8BBEkvm\u865A\u62DF\u5316\u7684vm"},{"level":3,"title":"\u4F7F\u7528\u65B9\u6CD5","slug":"\u4F7F\u7528\u65B9\u6CD5"},{"level":3,"title":"\u6D4B\u8BD5\u793A\u4F8B","slug":"\u6D4B\u8BD5\u793A\u4F8B"},{"level":3,"title":"\u5220\u9664\u793A\u4F8B","slug":"\u5220\u9664\u793A\u4F8B"},{"level":2,"title":"\u76F8\u5173qcow2\u955C\u50CF","slug":"\u76F8\u5173qcow2\u955C\u50CF"},{"level":2,"title":"\u6279\u91CF\u5F00\u8BBENAT\u7684KVM\u865A\u62DF\u5316\u7684VM","slug":"\u6279\u91CF\u5F00\u8BBEnat\u7684kvm\u865A\u62DF\u5316\u7684vm"},{"level":2,"title":"\u5220\u9664\u6240\u6709VM","slug":"\u5220\u9664\u6240\u6709vm"},{"level":2,"title":"\u5F00\u8BBE\u72EC\u7ACBIPV4\u5730\u5740\u7684VM","slug":"\u5F00\u8BBE\u72EC\u7ACBipv4\u5730\u5740\u7684vm"},{"level":3,"title":"\u521B\u5EFA\u793A\u4F8B","slug":"\u521B\u5EFA\u793A\u4F8B"},{"level":3,"title":"\u5220\u9664\u793A\u4F8B","slug":"\u5220\u9664\u793A\u4F8B-1"}],"relativePath":"guide/pve_kvm.md","lastUpdated":1687182420000}',t={},l=n(`

KVM\u865A\u62DF\u5316

\u90E8\u5206\u6CE8\u610F\u4E8B\u9879

\u6267\u884C\u672C\u9879\u76EE\u7684\u7B2C\u4E00\u4E2A\u68C0\u6D4B\u73AF\u5883\u7684\u547D\u4EE4\uFF0C\u5C55\u793A\u5982\u4E0B

\u67E5\u8BE2\u5982\u4E0A\u7684\u53EA\u9700\u4F7F\u7528\u4E0B\u9762\u7684\u4E00\u952E\u811A\u672C\u81EA\u52A8\u521B\u5EFA\u865A\u62DF\u673A\u5373\u53EF\uFF0C\u65E0\u9700\u624B\u52A8\u518D\u4FEE\u6539WEB\u7AEF\u8BBE\u7F6E

\u67E5\u8BE2\u5982\u4E0A\u7684\u5728\u4F7F\u7528\u540E\u7EED\u811A\u672C\u521B\u5EFA\u4E86\u865A\u62DF\u673A\u540E\uFF0C\u53EF\u80FD\u9700\u8981\u624B\u52A8\u4FEE\u6539WEB\u7AEF\u8BBE\u7F6E\uFF0C\u9700\u8981\u5173\u95ED\u5BF9\u5E94\u6BCF\u4E2A\u865A\u62DF\u673A\u7684\u786C\u4EF6\u5D4C\u5957\u865A\u62DF\u5316\uFF0C\u5982\u4E0B\u56FE

\u5148\u505C\u6B62\u865A\u62DF\u673A\u518D\u4FEE\u6539\uFF0C\u4FEE\u6539\u5B8C\u540E\u518D\u5F00\u673A\u624D\u80FD\u4F7F\u7528NOVNC\uFF0C\u4E0D\u5173\u95ED\u53EF\u80FD\u5BFC\u81F4\u8FD9\u4E2A\u865A\u62DF\u673A\u6709BUG\u65E0\u6CD5\u4F7F\u7528

\u5982\u679C\u5F3A\u884C\u5B89\u88C5PVE\u5F00KVM\uFF0C\u542F\u52A8\u4E0D\u4E86\u7684\u4E5F\u53EF\u4EE5\u5173\u95ED\u8FD9\u4E2A\u9009\u9879\u8BD5\u8BD5\u80FD\u4E0D\u80FD\u542F\u52A8\u865A\u62DF\u673A

\u5355\u72EC\u5F00\u8BBEKVM\u865A\u62DF\u5316\u7684VM

  • \u81EA\u52A8\u5F00\u8BBENAT\u670D\u52A1\u5668\uFF0C\u9ED8\u8BA4\u4F7F\u7528Debian10\u955C\u50CF\uFF0C\u56E0\u4E3A\u8BE5\u955C\u50CF\u5360\u7528\u6700\u5C0F
  • \u53EF\u5728\u547D\u4EE4\u4E2D\u81EA\u5B9A\u4E49\u9700\u8981\u4F7F\u7528\u7684\u955C\u50CF\uFF0C\u8FD9\u91CC\u6709\u7ED9\u51FA\u914D\u7F6E\u597D\u7684\u955C\u50CF\uFF0C\u955C\u50CF\u81EA\u5E26\u7A7A\u95F4\u8BBE\u7F6E\u662F2~10G\u786C\u76D8\uFF0C\u65E5\u5E38\u4F7F\u7528\u81F3\u5C1110G\u4EE5\u4E0A\u5373\u53EF\uFF0C\u9664\u975E\u67D0\u4E9B\u955C\u50CF\u5F00\u4E0D\u8D77\u6765\u518D\u589E\u52A0\u786C\u76D8\u5927\u5C0F
  • \u53EF\u5728\u547D\u4EE4\u4E2D\u6307\u5B9A\u5B58\u50A8\u76D8\u4F4D\u7F6E\uFF0C\u9ED8\u8BA4\u4E0D\u6307\u5B9A\u65F6\u4E3Alocal\u76D8\u5373\u7CFB\u7EDF\u76D8\uFF0C\u53EF\u6307\u5B9A\u4E3APVE\u4E2D\u663E\u793A\u7684\u6302\u8F7D\u76D8
  • \u81EA\u5B9A\u4E49\u5185\u5B58\u5927\u5C0F\u63A8\u8350512MB\u5185\u5B58

TIP

\u9700\u8981\u6CE8\u610F\u7684\u662F\u5BBF\u4E3B\u673A\u5185\u5B58\u8BB0\u5F97\u5F00\u70B9swap\u514D\u5F97\u673A\u5668\u70B8\u4E86\u5F00SWAP\u70B9\u6211\u8DF3\u8F6C

  • \u81EA\u52A8\u8FDB\u884C\u5185\u5916\u7F51\u7AEF\u53E3\u6620\u5C04\uFF0C\u542B22\uFF0C80\uFF0C443\u7AEF\u53E3\u4EE5\u53CA\u5176\u4ED625\u4E2A\u5185\u5916\u7F51\u7AEF\u53E3\u53F7\u4E00\u6837\u7684\u7AEF\u53E3
  • \u751F\u6210\u540E\u9700\u8981\u7B49\u5F85\u4E00\u6BB5\u65F6\u95F4\u865A\u62DF\u673A\u5185\u90E8\u7684cloud-init\u914D\u7F6E\u597D\u7F51\u7EDC\u4EE5\u53CA\u767B\u9646\u4FE1\u606F\uFF0C\u5927\u6982\u9700\u89815\u5206\u949F
  • \u865A\u62DF\u673A\u7684\u76F8\u5173\u4FE1\u606F\u5C06\u4F1A\u5B58\u50A8\u5230WEB\u7AEF\u5BF9\u5E94VM\u7684NOTES\u4E2D\uFF0C\u53EF\u5728WEB\u7AEF\u67E5\u770B

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm.sh -o buildvm.sh && chmod +x buildvm.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm.sh -o buildvm.sh && chmod +x buildvm.sh
+

\u4F7F\u7528\u65B9\u6CD5

  • \u7CFB\u7EDF\u652F\u6301\uFF1A\u8BE6\u89C1 \u8DF3\u8F6C \u4E2D\u5217\u51FA\u7684\u7CFB\u7EDF\uFF0C\u4F7F\u7528\u65F6\u53EA\u9700\u5199\u6587\u4EF6\u540D\u5B57\uFF0C\u4E0D\u9700\u8981.qcow2\u5C3E\u7F00

TIP

\u6CE8\u610F\u8FD9\u91CC\u7684\u7528\u6237\u540D\u4E0D\u80FD\u662F\u7EAF\u6570\u5B57\uFF0C\u4F1A\u9020\u6210cloudinit\u51FA\u95EE\u9898\uFF0C\u6700\u597D\u662F\u7EAF\u82F1\u6587\u6216\u82F1\u6587\u5F00\u5934

./buildvm.sh VMID \u7528\u6237\u540D \u5BC6\u7801 CPU\u6838\u6570 \u5185\u5B58 \u786C\u76D8 SSH\u7AEF\u53E3 80\u7AEF\u53E3 443\u7AEF\u53E3 \u5916\u7F51\u7AEF\u53E3\u8D77 \u5916\u7F51\u7AEF\u53E3\u6B62 \u7CFB\u7EDF \u5B58\u50A8\u76D8
+

\u6D4B\u8BD5\u793A\u4F8B

  • \u4EE5\u4E0B\u4E3A\u5F00\u8BBE\u7684\u793A\u4F8BVM\u7684\u4FE1\u606F\uFF1A
    VMID - 102 SSH\u767B\u5F55\u7684\u7528\u6237\u540D - test1 SSH\u767B\u5F55\u7684\u5BC6\u7801 - 1234567 CPU\u6838\u6570 - 1
    \u5185\u5B58\u5927\u5C0F - 512MB \u78C1\u76D8\u5927\u5C0F - 10G
    SSH\u7AEF\u53E3 - 40001 80\u7AEF\u53E3 - 40002 443\u7AEF\u53E3 - 40003 \u5185\u5916\u7F51\u6620\u5C04\u7AEF\u53E3\u4E00\u81F4\u7684\u533A\u95F4 - 50000\u523050025 \u7CFB\u7EDF - ubuntu20 \u5BBF\u4E3B\u673A\u7684\u5B58\u50A8\u76D8 - local
./buildvm.sh 102 test1 1234567 1 512 10 40001 40002 40003 50000 50025 ubuntu20 local
+

\u5F00\u8BBE\u5B8C\u6BD5\u53EF\u6267\u884Ccat vm102\u67E5\u770B\u4FE1\u606F\uFF0C\u6216\u5230WEB\u7AEF\u5BF9\u5E94VM\u7684NOTES\u4E2D\u67E5\u770B

\u5220\u9664\u793A\u4F8B

  • \u505C\u6B62VM
  • \u5220\u9664VM
  • \u5220\u9664\u7AEF\u53E3\u6620\u5C04
  • \u91CD\u542F\u7F51\u7EDC
  • \u5220\u9664log\u6587\u4EF6
qm stop 102
+qm destroy 102
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+rm -rf vm102
+

\u76F8\u5173qcow2\u955C\u50CF

  • \u5DF2\u9884\u5B89\u88C5\u5F00\u542Fcloudinit\uFF0C\u5F00\u542FSSH\u767B\u9646\uFF0C\u9884\u8BBE\u503CSSH\u76D1\u542CV4\u548CV6\u768422\u7AEF\u53E3\uFF0C\u5F00\u542F\u5141\u8BB8\u5BC6\u7801\u9A8C\u8BC1\u767B\u9646\uFF0C\u5F00\u542F\u5141\u8BB8ROOT\u767B\u9646

\u76EE\u524D\u4F7F\u7528\u7684\u955C\u50CF\u5217\u8868\u4E3A

https://github.com/spiritLHLS/Images/releases/tag/v1.0

\u6279\u91CF\u5F00\u8BBENAT\u7684KVM\u865A\u62DF\u5316\u7684VM

WARNING

\u521D\u6B21\u4F7F\u7528\u524D\u9700\u8981\u4FDD\u8BC1\u5F53\u524DPVE\u7EAF\u51C0\u4E14\u5BBF\u4E3B\u673A\u672A\u8FDB\u884C\u8FC7\u4EFB\u4F55\u7AEF\u53E3\u6620\u5C04\uFF0C\u5426\u5219\u8BBE\u7F6E\u51B2\u7A81\u53EF\u80FD\u51FA\u73B0BUG

TIP

\u5F00\u8BBE\u524D\u8BF7\u4F7F\u7528screen\u6302\u8D77\u6267\u884C\uFF0C\u907F\u514D\u6279\u91CF\u5F00\u8BBE\u65F6\u95F4\u8FC7\u957F\uFF0CSSH\u4E0D\u7A33\u5B9A\u5BFC\u81F4\u4E2D\u95F4\u6267\u884C\u4E2D\u65AD

  • \u53EF\u591A\u6B21\u8FD0\u884C\u6279\u91CF\u751F\u6210VM
  • \u81EA\u52A8\u5F00\u8BBENAT\u670D\u52A1\u5668\uFF0C\u9009\u9879\u7559\u7A7A\u9ED8\u8BA4\u4F7F\u7528debian11\u955C\u50CF\uFF0C\u53EF\u81EA\u5B9A\u4E49\u4F7F\u7528\u955C\u50CF\u540D\u5B57\uFF0C\u652F\u6301\u7684\u7CFB\u7EDF\u540D\u5B57\u8BE6\u89C1\u4E0A\u6587\u652F\u6301\u7684\u955C\u50CF\u5217\u8868
  • \u81EA\u52A8\u8FDB\u884C\u5185\u5916\u7F51\u7AEF\u53E3\u6620\u5C04\uFF0C\u542B22\uFF0C80\uFF0C443\u7AEF\u53E3\u4EE5\u53CA\u5176\u4ED625\u4E2A\u5185\u5916\u7F51\u7AEF\u53E3\u53F7\u4E00\u6837\u7684\u7AEF\u53E3
  • \u751F\u6210\u540E\u9700\u8981\u7B49\u5F85\u4E00\u6BB5\u65F6\u95F4\u865A\u62DF\u673A\u5185\u90E8\u7684cloudinit\u914D\u7F6E\u597D\u7F51\u7EDC\u4EE5\u53CA\u767B\u9646\u4FE1\u606F\uFF0C\u5927\u6982\u9700\u89815\u5206\u949F\uFF0C\u6BCF\u4E2A\u865A\u62DF\u673A\u521B\u5EFA\u4E4B\u95F4\u6709\u95F4\u9694\u7B49\u5F8560\u79D2\u907F\u514D\u7A81\u53D1\u6027\u80FD\u4E0D\u8DB3
  • \u9ED8\u8BA4\u6279\u91CF\u5F00\u8BBE\u7684\u865A\u62DF\u673A\u7F51\u7EDC\u914D\u7F6E\u4E3A\uFF1A22\uFF0C80\uFF0C443\u7AEF\u53E3\u53CA\u4E00\u4E2A25\u4E2A\u7AEF\u53E3\u533A\u95F4\u7684\u5185\u5916\u7F51\u6620\u5C04
  • \u53EF\u81EA\u5B9A\u4E49\u6279\u91CF\u5F00\u8BBE\u7684\u6838\u5FC3\u6570\uFF0C\u5185\u5B58\u5927\u5C0F\uFF0C\u786C\u76D8\u5927\u5C0F\uFF0C\u4F7F\u7528\u5BBF\u4E3B\u673A\u54EA\u4E2A\u5B58\u50A8\u76D8\uFF0C\u8BB0\u5F97\u81EA\u5DF1\u8BA1\u7B97\u597D\u7A7A\u95F2\u8D44\u6E90\u5F00\u8BBE
  • \u865A\u62DF\u673A\u7684\u76F8\u5173\u4FE1\u606F\u5C06\u4F1A\u5B58\u50A8\u5230WEB\u7AEF\u5BF9\u5E94VM\u7684NOTES\u4E2D\uFF0C\u53EF\u5728WEB\u7AEF\u67E5\u770B

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_vm.sh -o create_vm.sh && chmod +x create_vm.sh && bash create_vm.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_vm.sh -o create_vm.sh && chmod +x create_vm.sh && bash create_vm.sh
+

\u5F00\u8BBE\u5B8C\u6BD5\u53EF\u6267\u884Ccat vmlog\u67E5\u770B\u4FE1\u606F\uFF0C\u6216\u5230WEB\u7AEF\u5BF9\u5E94VM\u7684NOTES\u4E2D\u67E5\u770B

\u5220\u9664\u6240\u6709VM

  • \u5220\u9664\u6240\u6709VM
  • \u5220\u9664\u6240\u6709nat\u7684\u7AEF\u53E3\u6620\u5C04
  • \u91CD\u542F\u7F51\u7EDC
  • \u5220\u9664log\u6587\u4EF6
for vmid in $(qm list | awk '{if(NR>1) print $1}'); do qm stop $vmid; qm destroy $vmid; rm -rf /var/lib/vz/images/$vmid*; done
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+rm -rf vmlog
+

TIP

PVE\u4FEE\u6539VM\u914D\u7F6E\u524D\u90FD\u5F97\u505C\u673A\u5148\uFF0C\u518D\u4FEE\u6539\u914D\u7F6E\uFF0C\u4FEE\u6539\u5B8C\u518D\u542F\u52A8\uFF0C\u514D\u5F97\u51FA\u73B0\u914D\u7F6E\u91CD\u8F7D\u9519\u8BEF

\u5F00\u8BBE\u72EC\u7ACBIPV4\u5730\u5740\u7684VM

WARNING

\u4F7F\u7528\u524D\u9700\u8981\u4FDD\u8BC1\u5F53\u524D\u5BBF\u4E3B\u673A\u7684IP\u6BB5\u5E26\u4E86\u81F3\u5C112\u4E2AIP\uFF0C\u4E14\u6709\u7A7A\u4F59\u7684IP\u672A\u914D\u7F6E\uFF0C\u8BE5\u7A7A\u4F59\u7684IP\u672A\u7ED1\u5B9A\u5BBF\u4E3B\u673A \u5F00\u8BBE\u524D\u8BF7\u4F7F\u7528screen\u6302\u8D77\u6267\u884C\uFF0C\u907F\u514D\u5F00\u8BBE\u65F6\u95F4\u8FC7\u957F\uFF0CSSH\u4E0D\u7A33\u5B9A\u5BFC\u81F4\u4E2D\u95F4\u6267\u884C\u4E2D\u65AD

  • \u81EA\u52A8\u68C0\u6D4B\u53EF\u7528\u7684IP\u533A\u95F4\uFF0C\u901A\u8FC7ping\u68C0\u6D4B\u7A7A\u4F59\u53EF\u4F7F\u7528\u7684IP\uFF0C\u9009\u53D6\u5176\u4E2D\u4E4B\u4E00\u7ED1\u5B9A\u5230\u865A\u62DF\u673A\u4E0A
  • \u7CFB\u7EDF\u7684\u76F8\u5173\u4FE1\u606F\u5C06\u4F1A\u5B58\u50A8\u5230\u5BF9\u5E94\u7684\u865A\u62DF\u673A\u7684NOTE\u4E2D\uFF0C\u53EF\u5728WEB\u7AEF\u67E5\u770B

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm_extraip.sh -o buildvm_extraip.sh && chmod +x buildvm_extraip.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm_extraip.sh -o buildvm_extraip.sh && chmod +x buildvm_extraip.sh
+

\u521B\u5EFA\u793A\u4F8B

./buildvm_extraip.sh VMID \u7528\u6237\u540D \u5BC6\u7801 CPU\u6838\u6570 \u5185\u5B58\u5927\u5C0F\u4EE5MB\u8BA1\u7B97 \u786C\u76D8\u5927\u5C0F\u4EE5GB\u8BA1\u7B97 \u7CFB\u7EDF \u5B58\u50A8\u76D8
+
./buildvm_extraip.sh 152 test1 1234567 1 1024 10 ubuntu20 local
+

\u4E0A\u8FF0\u547D\u4EE4\u610F\u4E49\u4E3A\u5F00\u8BBE\u4E00\u4E2A\u5E26\u72EC\u7ACBIPV4\u5730\u5740\u7684\u865A\u62DF\u673A\uFF0CVMID\u662F152\uFF0C\u7528\u6237\u540D\u662Ftest1\uFF0C\u5BC6\u7801\u662F1234567\uFF0CCPU\u662F1\u6838\uFF0C\u5185\u5B58\u662F1024MB\uFF0C\u786C\u76D8\u662F10G\uFF0C\u7CFB\u7EDF\u662FUbuntu20\uFF0C\u5B58\u50A8\u76D8\u662Flocal\u76D8\u4E5F\u5C31\u662F\u7CFB\u7EDF\u76D8

\u5220\u9664\u793A\u4F8B

qm stop 152
+qm destroy 152
+rm -rf vm152
+
`,59),i=[l];function p(c,o,r,d,u,m){return e(),a("div",null,i)}var k=s(t,[["render",p]]);export{v as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/guide_pve_kvm.md.c79c334f.lean.js b/docs/.vitepress/dist/assets/guide_pve_kvm.md.c79c334f.lean.js new file mode 100644 index 0000000000..19c3ad3ad8 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_pve_kvm.md.c79c334f.lean.js @@ -0,0 +1 @@ +import{_ as s,c as a,o as e,a as n}from"./app.8fc4a373.js";const v='{"title":"KVM\u865A\u62DF\u5316","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u90E8\u5206\u6CE8\u610F\u4E8B\u9879","slug":"\u90E8\u5206\u6CE8\u610F\u4E8B\u9879"},{"level":2,"title":"\u5355\u72EC\u5F00\u8BBEKVM\u865A\u62DF\u5316\u7684VM","slug":"\u5355\u72EC\u5F00\u8BBEkvm\u865A\u62DF\u5316\u7684vm"},{"level":3,"title":"\u4F7F\u7528\u65B9\u6CD5","slug":"\u4F7F\u7528\u65B9\u6CD5"},{"level":3,"title":"\u6D4B\u8BD5\u793A\u4F8B","slug":"\u6D4B\u8BD5\u793A\u4F8B"},{"level":3,"title":"\u5220\u9664\u793A\u4F8B","slug":"\u5220\u9664\u793A\u4F8B"},{"level":2,"title":"\u76F8\u5173qcow2\u955C\u50CF","slug":"\u76F8\u5173qcow2\u955C\u50CF"},{"level":2,"title":"\u6279\u91CF\u5F00\u8BBENAT\u7684KVM\u865A\u62DF\u5316\u7684VM","slug":"\u6279\u91CF\u5F00\u8BBEnat\u7684kvm\u865A\u62DF\u5316\u7684vm"},{"level":2,"title":"\u5220\u9664\u6240\u6709VM","slug":"\u5220\u9664\u6240\u6709vm"},{"level":2,"title":"\u5F00\u8BBE\u72EC\u7ACBIPV4\u5730\u5740\u7684VM","slug":"\u5F00\u8BBE\u72EC\u7ACBipv4\u5730\u5740\u7684vm"},{"level":3,"title":"\u521B\u5EFA\u793A\u4F8B","slug":"\u521B\u5EFA\u793A\u4F8B"},{"level":3,"title":"\u5220\u9664\u793A\u4F8B","slug":"\u5220\u9664\u793A\u4F8B-1"}],"relativePath":"guide/pve_kvm.md","lastUpdated":1687182420000}',t={},l=n("",59),i=[l];function p(c,o,r,d,u,m){return e(),a("div",null,i)}var k=s(t,[["render",p]]);export{v as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/guide_pve_lxc.md.0d083a46.js b/docs/.vitepress/dist/assets/guide_pve_lxc.md.0d083a46.js new file mode 100644 index 0000000000..0ba57ce231 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_pve_lxc.md.0d083a46.js @@ -0,0 +1,20 @@ +import{_ as s,c as a,o as e,a as n}from"./app.8fc4a373.js";const m='{"title":"LXC\u865A\u62DF\u5316","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u5355\u72EC\u5F00\u8BBELXC\u865A\u62DF\u5316\u7684CT","slug":"\u5355\u72EC\u5F00\u8BBElxc\u865A\u62DF\u5316\u7684ct"},{"level":2,"title":"\u6279\u91CF\u5F00\u8BBENAT\u7684LXC\u865A\u62DF\u5316\u7684CT","slug":"\u6279\u91CF\u5F00\u8BBEnat\u7684lxc\u865A\u62DF\u5316\u7684ct"}],"relativePath":"guide/pve_lxc.md","lastUpdated":1687182420000}',t={},c=n(`

LXC\u865A\u62DF\u5316

\u5355\u72EC\u5F00\u8BBELXC\u865A\u62DF\u5316\u7684CT

WARNING

\u521D\u6B21\u4F7F\u7528\u524D\u9700\u8981\u4FDD\u8BC1\u5F53\u524DPVE\u7EAF\u51C0\u4E14\u5BBF\u4E3B\u673A\u672A\u8FDB\u884C\u8FC7\u4EFB\u4F55\u7AEF\u53E3\u6620\u5C04\uFF0C\u5426\u5219\u8BBE\u7F6E\u51B2\u7A81\u53EF\u80FD\u51FA\u73B0BUG

TIP

\u5F00\u8BBE\u524D\u8BF7\u4F7F\u7528screen\u6302\u8D77\u6267\u884C\uFF0C\u907F\u514D\u6279\u91CF\u5F00\u8BBE\u65F6\u95F4\u8FC7\u957F\uFF0CSSH\u4E0D\u7A33\u5B9A\u5BFC\u81F4\u4E2D\u95F4\u6267\u884C\u4E2D\u65AD

  • \u81EA\u52A8\u5F00\u8BBENAT\u670D\u52A1\u5668\uFF0C\u9ED8\u8BA4\u4F7F\u7528Debian11\u955C\u50CF\uFF0C\u4E5F\u53EF\u81EA\u5B9A\u4E49\u7CFB\u7EDF
  • \u81EA\u52A8\u8FDB\u884C\u5185\u5916\u7F51\u7AEF\u53E3\u6620\u5C04\uFF0C\u542B22\uFF0C80\uFF0C443\u7AEF\u53E3\u4EE5\u53CA\u5176\u4ED625\u4E2A\u5185\u5916\u7F51\u7AEF\u53E3\u53F7\u4E00\u6837\u7684\u7AEF\u53E3
  • \u751F\u6210\u540E\u9700\u8981\u7B49\u5F85\u4E00\u6BB5\u65F6\u95F4\u865A\u62DF\u673A\u5185\u90E8\u914D\u7F6E\u597D\u7F51\u7EDC\u4EE5\u53CA\u767B\u9646\u4FE1\u606F\uFF0C\u5927\u6982\u9700\u89813\u5206\u949F
  • \u9ED8\u8BA4\u5F00\u8BBE\u7684\u7F51\u7EDC\u914D\u7F6E\u4E3A\uFF1A22\uFF0C80\uFF0C443\u7AEF\u53E3\u53CA\u4E00\u4E2A25\u4E2A\u7AEF\u53E3\u533A\u95F4\u7684\u5185\u5916\u7F51\u6620\u5C04
  • \u53EF\u81EA\u5B9A\u4E49\u5F00\u8BBE\u7684\u6838\u5FC3\u6570\uFF0C\u5185\u5B58\u5927\u5C0F\uFF0C\u786C\u76D8\u5927\u5C0F\uFF0C\u4F7F\u7528\u5BBF\u4E3B\u673A\u54EA\u4E2A\u5B58\u50A8\u76D8\uFF0C\u8BB0\u5F97\u81EA\u5DF1\u8BA1\u7B97\u597D\u7A7A\u95F2\u8D44\u6E90\u5F00\u8BBE
  • \u53EF\u5728\u547D\u4EE4\u4E2D\u6307\u5B9A\u5B58\u50A8\u76D8\u4F4D\u7F6E\uFF0C\u9ED8\u8BA4\u4E0D\u6307\u5B9A\u65F6\u4E3Alocal\u76D8\u5373\u7CFB\u7EDF\u76D8\uFF0C\u53EF\u6307\u5B9A\u4E3APVE\u4E2D\u663E\u793A\u7684\u6302\u8F7D\u76D8
  • \u5F00\u8BBE\u7684CT\u9ED8\u8BA4\u5DF2\u542F\u7528SSH\u4E14\u5141\u8BB8root\u767B\u9646\uFF0C\u4E14\u5DF2\u8BBE\u7F6E\u652F\u6301\u4F7F\u7528docker\u7684\u5D4C\u5957\u865A\u62DF\u5316
  • \u5BB9\u5668\u7684\u76F8\u5173\u4FE1\u606F\u5C06\u4F1A\u5B58\u50A8\u5230\u5BF9\u5E94\u7684\u5BB9\u5668\u7684NOTE\u4E2D\uFF0C\u53EF\u5728WEB\u7AEF\u67E5\u770B

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildct.sh -o buildct.sh && chmod +x buildct.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildct.sh -o buildct.sh && chmod +x buildct.sh
+

\u4F7F\u7528\u65B9\u6CD5

  • \u7CFB\u7EDF\u652F\u6301\uFF1Adebian10\uFF0Cdebian11\uFF0Cubuntu18\uFF0Cubuntu20\uFF0Cubuntu22\uFF0Ccentos8\uFF0Calmalinux9\u7B49
  • \u7CFB\u7EDF\u53C2\u6570\u4E00\u5F8B\u662F\u5C0F\u5199\u7684\u7CFB\u7EDF\u540D\u5B57\u62FC\u63A5\u7248\u672C\u53F7\uFF0C\u5177\u4F53\u53EF\u6267\u884Cpveam available --section system\u67E5\u770B\u53EF\u7528\u7684\u7CFB\u7EDF\u540D\u5B57\u548C\u7248\u672C\u53F7(\u6CE8\u610F\u811A\u672C\u4F7F\u7528\u7684\u53C2\u6570\u53EA\u6709\u5C0F\u5199\u7684\u82F1\u6587\u7CFB\u7EDF\u540D\u5B57\u62FC\u63A5\u7248\u672C\u53F7)
  • \u5176\u4ED6\u7CFB\u7EDF\u53EF\u80FD\u652F\u6301\u53EF\u80FD\u4E0D\u652F\u6301\uFF0C\u81EA\u884C\u6D4B\u8BD5
  • \u9ED8\u8BA4\u7528\u6237\u540D\u662Froot
./buildct.sh CTID \u5BC6\u7801 CPU\u6838\u6570 \u5185\u5B58 \u786C\u76D8 SSH\u7AEF\u53E3 80\u7AEF\u53E3 443\u7AEF\u53E3 \u5916\u7F51\u7AEF\u53E3\u8D77 \u5916\u7F51\u7AEF\u53E3\u6B62 \u7CFB\u7EDF \u5B58\u50A8\u76D8
+

\u6D4B\u8BD5\u793A\u4F8B

  • \u4EE5\u4E0B\u4E3A\u5F00\u8BBE\u7684\u793A\u4F8BCT\u7684\u4FE1\u606F\uFF1A
    VMID - 102 SSH\u767B\u5F55\u7684\u7528\u6237\u540D - root SSH\u767B\u5F55\u7684\u5BC6\u7801 - 1234567 CPU\u6838\u6570 - 1
    \u5185\u5B58\u5927\u5C0F - 512MB \u78C1\u76D8\u5927\u5C0F - 5G
    SSH\u7AEF\u53E3 - 20001 80\u7AEF\u53E3 - 20002 443\u7AEF\u53E3 - 20003 \u5185\u5916\u7F51\u6620\u5C04\u7AEF\u53E3\u4E00\u81F4\u7684\u533A\u95F4 - 30000\u523030025 \u7CFB\u7EDF - debian11 \u5BBF\u4E3B\u673A\u7684\u5B58\u50A8\u76D8 - local
./buildct.sh 102 1234567 1 512 5 20001 20002 20003 30000 30025 debian11 local
+

\u5F00\u8BBE\u5B8C\u6BD5\u53EF\u6267\u884Ccat ct102\u67E5\u770B\u4FE1\u606F\uFF0C\u6216\u5728web\u7AEF\u7684NOTES\u67E5\u770B

\u5220\u9664\u793A\u4F8B

  • \u505C\u6B62CT
  • \u5220\u9664CT
  • \u5220\u9664\u7AEF\u53E3\u6620\u5C04
  • \u91CD\u542F\u7F51\u7EDC
  • \u5220\u9664log\u6587\u4EF6
pct stop 102
+pct destroy 102
+rm -rf ct102
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+

\u6279\u91CF\u5F00\u8BBENAT\u7684LXC\u865A\u62DF\u5316\u7684CT

WARNING

\u521D\u6B21\u4F7F\u7528\u524D\u9700\u8981\u4FDD\u8BC1\u5F53\u524DPVE\u7EAF\u51C0\u4E14\u5BBF\u4E3B\u673A\u672A\u8FDB\u884C\u8FC7\u4EFB\u4F55\u7AEF\u53E3\u6620\u5C04\uFF0C\u5426\u5219\u8BBE\u7F6E\u51B2\u7A81\u53EF\u80FD\u51FA\u73B0BUG \u5F00\u8BBE\u524D\u8BF7\u4F7F\u7528screen\u6302\u8D77\u6267\u884C\uFF0C\u907F\u514D\u6279\u91CF\u5F00\u8BBE\u65F6\u95F4\u8FC7\u957F\uFF0CSSH\u4E0D\u7A33\u5B9A\u5BFC\u81F4\u4E2D\u95F4\u6267\u884C\u4E2D\u65AD

  • \u53EF\u591A\u6B21\u8FD0\u884C\u6279\u91CF\u751F\u6210CT\u5BB9\u5668\uFF0C\u4F46\u9700\u8981\u6CE8\u610F\u7684\u662F\u6BCD\u9E21\u5185\u5B58\u8BB0\u5F97\u5F00\u70B9swap\u514D\u5F97\u673A\u5668\u70B8\u4E86\u5F00SWAP\u70B9\u6211\u8DF3\u8F6C
  • \u6BCF\u4E2A\u5BB9\u5668\u521B\u5EFA\u4E4B\u95F4\u6709\u95F4\u9694\u7B49\u5F8560\u79D2\u907F\u514D\u7A81\u53D1\u6027\u80FD\u4E0D\u8DB3
  • \u53EF\u81EA\u5B9A\u4E49\u6279\u91CF\u5F00\u8BBE\u7684\u6838\u5FC3\u6570\uFF0C\u5185\u5B58\u5927\u5C0F\uFF0C\u786C\u76D8\u5927\u5C0F\uFF0C\u4F7F\u7528\u5BBF\u4E3B\u673A\u54EA\u4E2A\u5B58\u50A8\u76D8\uFF0C\u8BB0\u5F97\u81EA\u5DF1\u8BA1\u7B97\u597D\u7A7A\u95F2\u8D44\u6E90\u5F00\u8BBE
  • \u5F00\u8BBE\u7684CT\u9ED8\u8BA4\u5DF2\u542F\u7528SSH\u4E14\u5141\u8BB8root\u767B\u9646\uFF0C\u4E14\u5DF2\u8BBE\u7F6E\u652F\u6301\u4F7F\u7528docker\u7684\u5D4C\u5957\u865A\u62DF\u5316
  • \u5BB9\u5668\u7684\u76F8\u5173\u4FE1\u606F\u5C06\u4F1A\u5B58\u50A8\u5230\u5BF9\u5E94\u7684\u5BB9\u5668\u7684NOTE\u4E2D\uFF0C\u53EF\u5728WEB\u7AEF\u67E5\u770B

\u56FD\u9645

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_ct.sh -o create_ct.sh && chmod +x create_ct.sh && bash create_ct.sh
+

\u56FD\u5185

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_ct.sh -o create_ct.sh && chmod +x create_ct.sh && bash create_ct.sh
+

\u5F00\u8BBE\u5B8C\u6BD5\u53EF\u6267\u884Ccat ctlog\u67E5\u770B\u4FE1\u606F\uFF0C\u6216\u5728web\u7AEF\u7684NOTES\u67E5\u770B

\u5220\u9664\u6240\u6709CT

  • \u5220\u9664\u6240\u6709CT
  • \u5220\u9664\u6240\u6709nat\u7684\u7AEF\u53E3\u6620\u5C04
  • \u91CD\u542F\u7F51\u7EDC
  • \u5220\u9664log\u6587\u4EF6
pct list | awk 'NR>1{print $1}' | xargs -I {} sh -c 'pct stop {}; pct destroy {}'
+rm -rf ct*
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+
`,30),l=[c];function o(i,p,r,d,u,h){return e(),a("div",null,l)}var k=s(t,[["render",o]]);export{m as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/guide_pve_lxc.md.0d083a46.lean.js b/docs/.vitepress/dist/assets/guide_pve_lxc.md.0d083a46.lean.js new file mode 100644 index 0000000000..f8ad5b0f7b --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_pve_lxc.md.0d083a46.lean.js @@ -0,0 +1 @@ +import{_ as s,c as a,o as e,a as n}from"./app.8fc4a373.js";const m='{"title":"LXC\u865A\u62DF\u5316","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u5355\u72EC\u5F00\u8BBELXC\u865A\u62DF\u5316\u7684CT","slug":"\u5355\u72EC\u5F00\u8BBElxc\u865A\u62DF\u5316\u7684ct"},{"level":2,"title":"\u6279\u91CF\u5F00\u8BBENAT\u7684LXC\u865A\u62DF\u5316\u7684CT","slug":"\u6279\u91CF\u5F00\u8BBEnat\u7684lxc\u865A\u62DF\u5316\u7684ct"}],"relativePath":"guide/pve_lxc.md","lastUpdated":1687182420000}',t={},c=n("",30),l=[c];function o(i,p,r,d,u,h){return e(),a("div",null,l)}var k=s(t,[["render",o]]);export{m as __pageData,k as default}; diff --git a/docs/.vitepress/dist/assets/guide_pve_precheck.md.52753d86.js b/docs/.vitepress/dist/assets/guide_pve_precheck.md.52753d86.js new file mode 100644 index 0000000000..cae6688372 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_pve_precheck.md.52753d86.js @@ -0,0 +1,3 @@ +import{_ as e,c as t,o as a,a as i}from"./app.8fc4a373.js";const u='{"title":"\u7CFB\u7EDF\u548C\u786C\u4EF6\u914D\u7F6E\u8981\u6C42","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u5404\u79CD\u8981\u6C42","slug":"\u5404\u79CD\u8981\u6C42"},{"level":2,"title":"\u68C0\u6D4B\u73AF\u5883","slug":"\u68C0\u6D4B\u73AF\u5883"}],"relativePath":"guide/pve_precheck.md","lastUpdated":1687182420000}',r={},l=i(`

\u7CFB\u7EDF\u548C\u786C\u4EF6\u914D\u7F6E\u8981\u6C42

\u5404\u79CD\u8981\u6C42

\u5EFA\u8BAEdebian\u5728\u4F7F\u7528\u524D\u5C3D\u91CF\u4F7F\u7528\u6700\u65B0\u7684\u7A33\u5B9A\u7248\u672C\u7684\u7CFB\u7EDF

\u975Edebian11\u53EF\u4F7F\u7528 debian\u4E00\u952E\u5347\u7EA7 \u6765\u5347\u7EA7\u7CFB\u7EDF

\u672C\u9879\u76EE\u53EA\u9002\u914DDebian\u7CFB\u7EDF(\u975EDebian\u65E0\u6CD5\u901A\u8FC7APT\u6E90\u5B89\u88C5\uFF0C\u5B98\u65B9\u53EA\u7ED9\u4E86Debian\u7684\u955C\u50CF\uFF0C\u5176\u4ED6\u7CFB\u7EDF\u53EA\u80FD\u4F7F\u7528ISO\u5B89\u88C5)

  • \u7CFB\u7EDF\u8981\u6C42\uFF1ADebian 8+

TIP

\u5EFA\u8BAEdebian11\u800C\u4E0D\u662Fdebian12\uFF0C\u56E0\u4E3A\u540E\u8005\u662Fbeta\u7248\u672C\uFF0Cdebian11\u5B89\u88C5\u7684\u624D\u662F\u7A33\u5B9A\u7248

  • \u786C\u4EF6\u8981\u6C42\uFF1A2\u68382G\u5185\u5B58x86_64\u67B6\u6784\u670D\u52A1\u5668\u786C\u76D8\u81F3\u5C1120G

WARNING

\u5185\u5B58\u5F00\u70B9swap\u514D\u5F97\u673A\u5668\u70B8\u4E86\u5F00SWAP\u70B9\u6211\u8DF3\u8F6C

  • \u53EF\u5F00KVM\u7684\u786C\u4EF6\u8981\u6C42\uFF1AVM-X\u6216AMD-V\u652F\u6301 (\u90E8\u5206VPS\u548C\u5168\u90E8\u72EC\u670D\u652F\u6301)
  • \u5982\u679C\u786C\u4EF6\u6216\u7CFB\u7EDF\u9700\u6C42\u4E0D\u6EE1\u8DB3\uFF0C\u53EF\u4F7F\u7528LXD\u6279\u91CF\u5F00LXC\u5BB9\u5668\u8DF3\u8F6C

\u9047\u5230\u9009\u9879\u4E0D\u4F1A\u9009\u7684\u53EF\u65E0\u8111\u56DE\u8F66\u5B89\u88C5\uFF0C\u672C\u9879\u76EE\u6240\u6709\u811A\u672C\u5185\u7F6E\u56FD\u5185\u5916IP\u81EA\u52A8\u5224\u65AD\uFF0C\u4F7F\u7528\u7684\u662F\u4E0D\u540C\u7684\u5B89\u88C5\u6E90\u4E0E\u914D\u7F6E\u6587\u4EF6\uFF0C\u6709\u4F7F\u7528CDN\u52A0\u901F\u955C\u50CF\u4E0B\u8F7D

\u68C0\u6D4B\u73AF\u5883

  • \u672C\u9879\u76EE\u76F8\u5173\u811A\u672C\u6267\u884C\u524D\u52A1\u5FC5\u6267\u884C\u672C\u811A\u672C\u68C0\u6D4B\u73AF\u5883\uFF0C\u5982\u679C\u4E0D\u7B26\u5408\u5B89\u88C5PVE\u7684\u8981\u6C42\u5219\u65E0\u6CD5\u4F7F\u7528\u540E\u7EED\u7684\u811A\u672C
  • \u68C0\u6D4B\u786C\u4EF6\u914D\u7F6E\u662F\u5426\u6EE1\u8DB3\u6700\u4F4E\u8981\u6C42
  • \u68C0\u6D4B\u786C\u4EF6\u73AF\u5883\u662F\u5426\u53EF\u5D4C\u5957\u865A\u62DF\u5316KVM\u7C7B\u578B\u7684\u670D\u52A1\u5668
  • \u68C0\u6D4B\u7CFB\u7EDF\u73AF\u5883\u662F\u5426\u53EF\u5D4C\u5957\u865A\u62DF\u5316KVM\u7C7B\u578B\u7684\u670D\u52A1\u5668
  • \u4E0D\u53EF\u5D4C\u5957\u865A\u62DF\u5316KVM\u7C7B\u578B\u7684\u670D\u52A1\u5668\u4E5F\u53EF\u4EE5\u5F00LXC\u865A\u62DF\u5316\u7684\u670D\u52A1\u5668\uFF0C\u4F46\u4E0D\u63A8\u8350\u5B89\u88C5PVE\uFF0C\u4E0D\u5982\u4F7F\u7528LXD

\u56FD\u9645

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/check_kernal.sh)
+

\u56FD\u5185

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/check_kernal.sh)
+


`,19),c=[l];function n(s,p,o,d,h,_){return a(),t("div",null,c)}var g=e(r,[["render",n]]);export{u as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/guide_pve_precheck.md.52753d86.lean.js b/docs/.vitepress/dist/assets/guide_pve_precheck.md.52753d86.lean.js new file mode 100644 index 0000000000..47e86aedec --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_pve_precheck.md.52753d86.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a,a as i}from"./app.8fc4a373.js";const u='{"title":"\u7CFB\u7EDF\u548C\u786C\u4EF6\u914D\u7F6E\u8981\u6C42","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u5404\u79CD\u8981\u6C42","slug":"\u5404\u79CD\u8981\u6C42"},{"level":2,"title":"\u68C0\u6D4B\u73AF\u5883","slug":"\u68C0\u6D4B\u73AF\u5883"}],"relativePath":"guide/pve_precheck.md","lastUpdated":1687182420000}',r={},l=i("",19),c=[l];function n(s,p,o,d,h,_){return a(),t("div",null,c)}var g=e(r,[["render",n]]);export{u as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/guide_pve_qa.md.368f4953.js b/docs/.vitepress/dist/assets/guide_pve_qa.md.368f4953.js new file mode 100644 index 0000000000..d49bfd24f2 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_pve_qa.md.368f4953.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as a,a as t}from"./app.8fc4a373.js";const u='{"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u7684VPS\u5546\u5BB6","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u7684VPS\u5546\u5BB6","slug":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u7684vps\u5546\u5BB6"},{"level":3,"title":"\u53EF\u5F00\u8BBEKVM\u865A\u62DF\u5316\u7684NAT\u7684\u5546\u5BB6","slug":"\u53EF\u5F00\u8BBEkvm\u865A\u62DF\u5316\u7684nat\u7684\u5546\u5BB6"},{"level":3,"title":"\u53EA\u53EF\u5F00\u8BBELXC\u865A\u62DF\u5316\u7684NAT\u7684\u5546\u5BB6","slug":"\u53EA\u53EF\u5F00\u8BBElxc\u865A\u62DF\u5316\u7684nat\u7684\u5546\u5BB6"},{"level":3,"title":"\u5DF2\u77E5\u65E0\u6CD5\u76F4\u63A5\u5B89\u88C5PVE\u7684\u5546\u5BB6","slug":"\u5DF2\u77E5\u65E0\u6CD5\u76F4\u63A5\u5B89\u88C5pve\u7684\u5546\u5BB6"}],"relativePath":"en_US/guide/pve_qa.md","lastUpdated":1687182420000}',n={},o=t('

\u76EE\u524D\u5DF2\u9A8C\u8BC1\u7684VPS\u5546\u5BB6

\u53EF\u5F00\u8BBEKVM\u865A\u62DF\u5316\u7684NAT\u7684\u5546\u5BB6

nocix \u4E2D\u7684\u7279\u4EF7\u6700\u4F4E\u914D15\u7F8E\u5143\u72EC\u670D (IPV6\u4E0D\u81EA\u5E26\uFF0C\u9700\u8981\u627E\u5BA2\u670D\u8981)

amhost \u4E2D\u7684\u6D4B\u8BD5\u6B3E

digitalocean \u4E2D\u7684 Perminu Intel \u548C Regular 4\u6838\u6B3E

skrime \u4E2D\u7684 AMD Ryzen KVM Server \u6700\u4F4E\u914D\u6B3E

webdock \u4E2D\u7684 AMD KVM Server

4vps \u4E2D\u7684 \u4FC4\u7F57\u65AF\u548C\u5E0C\u814A \u6D4B\u8BD5\u6B3E

hostaris \u4E2D\u7684 \u5FB7\u56FD\u6B3E (\u5546\u5BB6\u7684\u7CFB\u7EDF\u6A21\u677F\u6709\u95EE\u9898\uFF0CIPV6\u5DF2\u5931\u6548\u548CGithub\u7684\u8FDE\u901A\u7A33\u5B9A\u6027\u5F88\u5DEE)

\u53EA\u53EF\u5F00\u8BBELXC\u865A\u62DF\u5316\u7684NAT\u7684\u5546\u5BB6

\u817E\u8BAF\u4E91 \u4E2D\u7684\u65E0\u5FE7\u6B3E\u548C\u7279\u60E0\u6B3E(\u5B66\u751F\u673A)

spectraip \u4E2D\u7684KVM\u670D\u52A1\u5668

\u5DF2\u77E5\u65E0\u6CD5\u76F4\u63A5\u5B89\u88C5PVE\u7684\u5546\u5BB6

hetzner \u9700\u8981\u6551\u63F4\u7CFB\u7EDF\u5B89\u88C5\u7EAF\u51C0\u7684Debian\uFF0C\u9ED8\u8BA4\u7F51\u7EDC\u8BBE\u7F6E\u6709\u51B2\u7A81

hosthatch \u9ED8\u8BA4\u7F51\u7EDC\u8BBE\u7F6E\u6709\u95EE\u9898

',15),p=[o];function h(l,s,c,i,d,f){return a(),r("div",null,p)}var v=e(n,[["render",h]]);export{u as __pageData,v as default}; diff --git a/docs/.vitepress/dist/assets/guide_pve_qa.md.368f4953.lean.js b/docs/.vitepress/dist/assets/guide_pve_qa.md.368f4953.lean.js new file mode 100644 index 0000000000..11120a1447 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_pve_qa.md.368f4953.lean.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as a,a as t}from"./app.8fc4a373.js";const u='{"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u7684VPS\u5546\u5BB6","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u7684VPS\u5546\u5BB6","slug":"\u76EE\u524D\u5DF2\u9A8C\u8BC1\u7684vps\u5546\u5BB6"},{"level":3,"title":"\u53EF\u5F00\u8BBEKVM\u865A\u62DF\u5316\u7684NAT\u7684\u5546\u5BB6","slug":"\u53EF\u5F00\u8BBEkvm\u865A\u62DF\u5316\u7684nat\u7684\u5546\u5BB6"},{"level":3,"title":"\u53EA\u53EF\u5F00\u8BBELXC\u865A\u62DF\u5316\u7684NAT\u7684\u5546\u5BB6","slug":"\u53EA\u53EF\u5F00\u8BBElxc\u865A\u62DF\u5316\u7684nat\u7684\u5546\u5BB6"},{"level":3,"title":"\u5DF2\u77E5\u65E0\u6CD5\u76F4\u63A5\u5B89\u88C5PVE\u7684\u5546\u5BB6","slug":"\u5DF2\u77E5\u65E0\u6CD5\u76F4\u63A5\u5B89\u88C5pve\u7684\u5546\u5BB6"}],"relativePath":"en_US/guide/pve_qa.md","lastUpdated":1687182420000}',n={},o=t("",15),p=[o];function h(l,s,c,i,d,f){return a(),r("div",null,p)}var v=e(n,[["render",h]]);export{u as __pageData,v as default}; diff --git a/docs/.vitepress/dist/assets/guide_pve_thanks.md.ef91f2a2.js b/docs/.vitepress/dist/assets/guide_pve_thanks.md.ef91f2a2.js new file mode 100644 index 0000000000..aff766059b --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_pve_thanks.md.ef91f2a2.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as t,a}from"./app.8fc4a373.js";const b='{"title":"\u81F4\u8C22","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u81F4\u8C22","slug":"\u81F4\u8C22"}],"relativePath":"en_US/guide/pve_thanks.md","lastUpdated":1687182420000}',o={},n=a('

\u81F4\u8C22

https://blog.ilolicon.com/archives/615

https://github.com/Ella-Alinda/somescripts/blob/main/nat.sh

https://pve.proxmox.com/pve-docs/qm.1.html

https://down.idc.wiki/Image/realServer-Template/

https://mirrors.tuna.tsinghua.edu.cn/proxmox/

https://github.com/roacn/pve/blob/main/pve.sh

https://github.com/spiritLHLS/lxc

\u611F\u8C22 @Ella-Alinda \u63D0\u4F9B\u7684PVE\u6307\u5BFC

',9),p=[n];function l(s,i,h,c,_,m){return t(),r("div",null,p)}var f=e(o,[["render",l]]);export{b as __pageData,f as default}; diff --git a/docs/.vitepress/dist/assets/guide_pve_thanks.md.ef91f2a2.lean.js b/docs/.vitepress/dist/assets/guide_pve_thanks.md.ef91f2a2.lean.js new file mode 100644 index 0000000000..7017c07ea2 --- /dev/null +++ b/docs/.vitepress/dist/assets/guide_pve_thanks.md.ef91f2a2.lean.js @@ -0,0 +1 @@ +import{_ as e,c as r,o as t,a}from"./app.8fc4a373.js";const b='{"title":"\u81F4\u8C22","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u81F4\u8C22","slug":"\u81F4\u8C22"}],"relativePath":"en_US/guide/pve_thanks.md","lastUpdated":1687182420000}',o={},n=a("",9),p=[n];function l(s,i,h,c,_,m){return t(),r("div",null,p)}var f=e(o,[["render",l]]);export{b as __pageData,f as default}; diff --git a/docs/.vitepress/dist/assets/index.md.3f1005ea.js b/docs/.vitepress/dist/assets/index.md.3f1005ea.js new file mode 100644 index 0000000000..0abf55f91b --- /dev/null +++ b/docs/.vitepress/dist/assets/index.md.3f1005ea.js @@ -0,0 +1 @@ +import{_ as a,c as i,o,b as e,d as t}from"./app.8fc4a373.js";const f='{"title":"Home","description":"","frontmatter":{"home":true,"heroImage":"https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png","heroText":"\u4E00\u952E\u865A\u62DF\u5316\u9879\u76EE","tagline":"\u5F00\u6E90\u3001\u6613\u4E8E\u4F7F\u7528\u7684\u670D\u52A1\u5668\u865A\u62DF\u5316\u9879\u76EE","actionText":"\u5F00\u59CB\u4F7F\u7528 \u2192","actionLink":"/guide/dashboard","features":[{"title":"\u4E00\u952E\u4F7F\u7528","details":"\u652F\u6301\u4E00\u952E\u811A\u672C\u5B89\u88C5\u4F7F\u7528\uFF0C\u8F7B\u677E\u4F7F\u7528\u5404\u865A\u62DF\u5316\u5728\u670D\u52A1\u5668\u4E0A\u521B\u5EFA\u865A\u62DF\u673A/\u5BB9\u5668"},{"title":"\u57FA\u4E8E\u4E3B\u6D41\u7CFB\u7EDF\u5F00\u53D1","details":"\u57FA\u4E8E Debian\u3001Ubuntu \u7684\u957F\u671F\u7EF4\u62A4\u7248\u672C\u5F00\u53D1\uFF0C\u5982\u9700\u4F7F\u7528\u8BF7\u5C3D\u91CF\u4FDD\u8BC1\u5BBF\u4E3B\u673A\u7CFB\u7EDF\u4E0E\u5F00\u53D1\u73AF\u5883\u4E00\u81F4"},{"title":"\u81EA\u5E26\u5185\u5916\u7F51\u7AEF\u53E3\u8F6C\u53D1","details":"\u652F\u6301\u81EA\u52A8\u7684\u5185\u7F51\u7AEF\u53E3\u8F6C\u53D1\uFF0C\u542BTCP\u3001UDP\u534F\u8BAE\uFF0C\u65E0\u9700\u4EBA\u5DE5\u7BA1\u7406"},{"title":"\u6279\u91CF\u865A\u62DF\u5316","details":"\u652F\u6301 KVM\u3001LXC\u3001Docker \u865A\u62DF\u5316\u6279\u91CF\u5F00\u8BBE\u5BB9\u5668/\u865A\u62DF\u673A"},{"title":"\u591A\u7CFB\u7EDF\u652F\u6301","details":"\u5F00\u8BBE\u51FA\u7684\u5BB9\u5668/\u865A\u62DF\u673A\u5DF2\u652F\u6301\u591A\u7CFB\u7EDF\uFF0C\u6DB5\u76D6\u51E0\u4E4E\u6240\u6709\u4E3B\u6D41\u7CFB\u7EDF"},{"title":"\u81EA\u9650\u5236\u6EE5\u7528","details":"\u90E8\u5206\u865A\u62DF\u5316\u5F00\u8BBE\u7684\u5BB9\u5668/\u865A\u62DF\u673A\u5DF2\u5C4F\u853D\u548C\u88C5\u8F7D\u9650\u5236\uFF0C\u907F\u514D\u88AB\u7528\u4E8E\u6EE5\u7528"}],"footer":"Copyright \xA9 2023-present oneclickvirt"},"headers":[],"relativePath":"index.md","lastUpdated":1687182420000}',s={},r=e("p",null,[e("br"),t("\u672C\u9879\u76EE\u91C7\u7528 "),e("a",{rel:"license",href:"http://creativecommons.org/licenses/by-nc-sa/4.0/"},"\u77E5\u8BC6\u5171\u4EAB\u7F72\u540D-\u975E\u5546\u4E1A\u6027\u4F7F\u7528-\u76F8\u540C\u65B9\u5F0F\u5171\u4EAB 4.0 \u56FD\u9645\u8BB8\u53EF\u534F\u8BAE"),t(" \u8FDB\u884C\u8BB8\u53EF\u3002")],-1),n=[r];function l(c,d,p,h,_,m){return o(),i("div",null,n)}var g=a(s,[["render",l]]);export{f as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/index.md.3f1005ea.lean.js b/docs/.vitepress/dist/assets/index.md.3f1005ea.lean.js new file mode 100644 index 0000000000..0abf55f91b --- /dev/null +++ b/docs/.vitepress/dist/assets/index.md.3f1005ea.lean.js @@ -0,0 +1 @@ +import{_ as a,c as i,o,b as e,d as t}from"./app.8fc4a373.js";const f='{"title":"Home","description":"","frontmatter":{"home":true,"heroImage":"https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png","heroText":"\u4E00\u952E\u865A\u62DF\u5316\u9879\u76EE","tagline":"\u5F00\u6E90\u3001\u6613\u4E8E\u4F7F\u7528\u7684\u670D\u52A1\u5668\u865A\u62DF\u5316\u9879\u76EE","actionText":"\u5F00\u59CB\u4F7F\u7528 \u2192","actionLink":"/guide/dashboard","features":[{"title":"\u4E00\u952E\u4F7F\u7528","details":"\u652F\u6301\u4E00\u952E\u811A\u672C\u5B89\u88C5\u4F7F\u7528\uFF0C\u8F7B\u677E\u4F7F\u7528\u5404\u865A\u62DF\u5316\u5728\u670D\u52A1\u5668\u4E0A\u521B\u5EFA\u865A\u62DF\u673A/\u5BB9\u5668"},{"title":"\u57FA\u4E8E\u4E3B\u6D41\u7CFB\u7EDF\u5F00\u53D1","details":"\u57FA\u4E8E Debian\u3001Ubuntu \u7684\u957F\u671F\u7EF4\u62A4\u7248\u672C\u5F00\u53D1\uFF0C\u5982\u9700\u4F7F\u7528\u8BF7\u5C3D\u91CF\u4FDD\u8BC1\u5BBF\u4E3B\u673A\u7CFB\u7EDF\u4E0E\u5F00\u53D1\u73AF\u5883\u4E00\u81F4"},{"title":"\u81EA\u5E26\u5185\u5916\u7F51\u7AEF\u53E3\u8F6C\u53D1","details":"\u652F\u6301\u81EA\u52A8\u7684\u5185\u7F51\u7AEF\u53E3\u8F6C\u53D1\uFF0C\u542BTCP\u3001UDP\u534F\u8BAE\uFF0C\u65E0\u9700\u4EBA\u5DE5\u7BA1\u7406"},{"title":"\u6279\u91CF\u865A\u62DF\u5316","details":"\u652F\u6301 KVM\u3001LXC\u3001Docker \u865A\u62DF\u5316\u6279\u91CF\u5F00\u8BBE\u5BB9\u5668/\u865A\u62DF\u673A"},{"title":"\u591A\u7CFB\u7EDF\u652F\u6301","details":"\u5F00\u8BBE\u51FA\u7684\u5BB9\u5668/\u865A\u62DF\u673A\u5DF2\u652F\u6301\u591A\u7CFB\u7EDF\uFF0C\u6DB5\u76D6\u51E0\u4E4E\u6240\u6709\u4E3B\u6D41\u7CFB\u7EDF"},{"title":"\u81EA\u9650\u5236\u6EE5\u7528","details":"\u90E8\u5206\u865A\u62DF\u5316\u5F00\u8BBE\u7684\u5BB9\u5668/\u865A\u62DF\u673A\u5DF2\u5C4F\u853D\u548C\u88C5\u8F7D\u9650\u5236\uFF0C\u907F\u514D\u88AB\u7528\u4E8E\u6EE5\u7528"}],"footer":"Copyright \xA9 2023-present oneclickvirt"},"headers":[],"relativePath":"index.md","lastUpdated":1687182420000}',s={},r=e("p",null,[e("br"),t("\u672C\u9879\u76EE\u91C7\u7528 "),e("a",{rel:"license",href:"http://creativecommons.org/licenses/by-nc-sa/4.0/"},"\u77E5\u8BC6\u5171\u4EAB\u7F72\u540D-\u975E\u5546\u4E1A\u6027\u4F7F\u7528-\u76F8\u540C\u65B9\u5F0F\u5171\u4EAB 4.0 \u56FD\u9645\u8BB8\u53EF\u534F\u8BAE"),t(" \u8FDB\u884C\u8BB8\u53EF\u3002")],-1),n=[r];function l(c,d,p,h,_,m){return o(),i("div",null,n)}var g=a(s,[["render",l]]);export{f as __pageData,g as default}; diff --git a/docs/.vitepress/dist/assets/style.0b9f658b.css b/docs/.vitepress/dist/assets/style.0b9f658b.css new file mode 100644 index 0000000000..4c0853917b --- /dev/null +++ b/docs/.vitepress/dist/assets/style.0b9f658b.css @@ -0,0 +1 @@ +:root{--c-white: #ffffff;--c-white-dark: #f8f8f8;--c-black: #000000;--c-divider-light: rgba(60, 60, 67, .12);--c-divider-dark: rgba(84, 84, 88, .48);--c-text-light-1: #2c3e50;--c-text-light-2: #476582;--c-text-light-3: #90a4b7;--c-brand: #3eaf7c;--c-brand-light: #4abf8a;--font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;--font-family-mono: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;--z-index-navbar: 10;--z-index-sidebar: 6;--shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .06);--shadow-2: 0 3px 12px rgba(0, 0, 0, .07), 0 1px 4px rgba(0, 0, 0, .07);--shadow-3: 0 12px 32px rgba(0, 0, 0, .1), 0 2px 6px rgba(0, 0, 0, .08);--shadow-4: 0 14px 44px rgba(0, 0, 0, .12), 0 3px 9px rgba(0, 0, 0, .12);--shadow-5: 0 18px 56px rgba(0, 0, 0, .16), 0 4px 12px rgba(0, 0, 0, .16);--header-height: 3.6rem}:root{--c-divider: var(--c-divider-light);--c-text: var(--c-text-light-1);--c-text-light: var(--c-text-light-2);--c-text-lighter: var(--c-text-light-3);--c-bg: var(--c-white);--c-bg-accent: var(--c-white-dark);--code-line-height: 24px;--code-font-family: var(--font-family-mono);--code-font-size: 14px;--code-inline-bg-color: rgba(27, 31, 35, .05);--code-bg-color: #282c34}*,:before,:after{box-sizing:border-box}html{line-height:1.4;font-size:16px;-webkit-text-size-adjust:100%}body{margin:0;width:100%;min-width:320px;min-height:100vh;line-height:1.4;font-family:var(--font-family-base);font-size:16px;font-weight:400;color:var(--c-text);background-color:var(--c-bg);direction:ltr;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}main{display:block}h1,h2,h3,h4,h5,h6{margin:0;line-height:1.25}h1,h2,h3,h4,h5,h6,strong,b{font-weight:600}h1:hover .header-anchor,h1:focus .header-anchor,h2:hover .header-anchor,h2:focus .header-anchor,h3:hover .header-anchor,h3:focus .header-anchor,h4:hover .header-anchor,h4:focus .header-anchor,h5:hover .header-anchor,h5:focus .header-anchor,h6:hover .header-anchor,h6:focus .header-anchor{opacity:1}h1{margin-top:1.5rem;font-size:1.9rem}@media screen and (min-width: 420px){h1{font-size:2.2rem}}h2{margin-top:2.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--c-divider);padding-bottom:.3rem;line-height:1.25;font-size:1.65rem}h2+h3{margin-top:1.5rem}h3{margin-top:2rem;font-size:1.35rem}h4{font-size:1.15rem}p,ol,ul{margin:1rem 0;line-height:1.7}a,area,button,[role=button],input,label,select,summary,textarea{touch-action:manipulation}a{text-decoration:none;color:var(--c-brand)}a:hover{text-decoration:underline}a.header-anchor{float:left;margin-top:.125em;margin-left:-.87em;padding-right:.23em;font-size:.85em;opacity:0}a.header-anchor:hover,a.header-anchor:focus{text-decoration:none}figure{margin:0}img{max-width:100%}ul,ol{padding-left:1.25em}li>ul,li>ol{margin:0}table{display:block;border-collapse:collapse;margin:1rem 0;overflow-x:auto}tr{border-top:1px solid #dfe2e5}tr:nth-child(2n){background-color:#f6f8fa}th,td{border:1px solid #dfe2e5;padding:.6em 1em}blockquote{margin:1rem 0;border-left:.2rem solid #dfe2e5;padding:.25rem 0 .25rem 1rem;font-size:1rem;color:#999}blockquote>p{margin:0}form{margin:0}.theme.sidebar-open .sidebar-mask{display:block}.theme.no-navbar>h1,.theme.no-navbar>h2,.theme.no-navbar>h3,.theme.no-navbar>h4,.theme.no-navbar>h5,.theme.no-navbar>h6{margin-top:1.5rem;padding-top:0}.theme.no-navbar aside{top:0}@media screen and (min-width: 720px){.theme.no-sidebar aside{display:none}.theme.no-sidebar main{margin-left:0}}.sidebar-mask{position:fixed;z-index:2;display:none;width:100vw;height:100vh}code{margin:0;border-radius:3px;padding:.25rem .5rem;font-family:var(--code-font-family);font-size:.85em;color:var(--c-text-light);background-color:var(--code-inline-bg-color)}code .token.deleted{color:#ec5975}code .token.inserted{color:var(--c-brand)}div[class*=language-]{position:relative;margin:1rem -1.5rem;background-color:var(--code-bg-color);overflow-x:auto}li>div[class*=language-]{border-radius:6px 0 0 6px;margin:1rem -1.5rem 1rem -1.25rem;line-height:initial}@media (min-width: 420px){div[class*=language-]{margin:1rem 0;border-radius:6px}li>div[class*=language-]{margin:1rem 0 1rem 0rem;border-radius:6px}}[class*=language-] pre,[class*=language-] code{text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;background:transparent}[class*=language-] pre{position:relative;z-index:1;margin:0;padding:1.25rem 1.5rem;overflow-x:auto}[class*=language-] code{padding:0;line-height:var(--code-line-height);font-size:var(--code-font-size);color:#eee}.highlight-lines{position:absolute;top:0;bottom:0;left:0;padding:1.25rem 0;width:100%;line-height:var(--code-line-height);font-family:var(--code-font-family);font-size:var(--code-font-size);user-select:none;overflow:hidden}.highlight-lines .highlighted{background-color:#000000a8}div[class*=language-].line-numbers-mode{padding-left:3.5rem}.line-numbers-wrapper{position:absolute;top:0;bottom:0;left:0;z-index:3;border-right:1px solid rgba(0,0,0,.5);padding:1.25rem 0;width:3.5rem;text-align:center;line-height:var(--code-line-height);font-family:var(--code-font-family);font-size:var(--code-font-size);color:#888}div[class*=language-]:before{position:absolute;top:.6em;right:1em;z-index:2;font-size:.8rem;color:#888}div[class~=language-html]:before,div[class~=language-markup]:before{content:"html"}div[class~=language-md]:before,div[class~=language-markdown]:before{content:"md"}div[class~=language-css]:before{content:"css"}div[class~=language-sass]:before{content:"sass"}div[class~=language-scss]:before{content:"scss"}div[class~=language-less]:before{content:"less"}div[class~=language-stylus]:before{content:"styl"}div[class~=language-js]:before,div[class~=language-javascript]:before{content:"js"}div[class~=language-ts]:before,div[class~=language-typescript]:before{content:"ts"}div[class~=language-json]:before{content:"json"}div[class~=language-rb]:before,div[class~=language-ruby]:before{content:"rb"}div[class~=language-py]:before,div[class~=language-python]:before{content:"py"}div[class~=language-sh]:before,div[class~=language-bash]:before{content:"sh"}div[class~=language-php]:before{content:"php"}div[class~=language-go]:before{content:"go"}div[class~=language-rust]:before{content:"rust"}div[class~=language-java]:before{content:"java"}div[class~=language-c]:before{content:"c"}div[class~=language-yaml]:before{content:"yaml"}div[class~=language-dockerfile]:before{content:"dockerfile"}div[class~=language-vue]:before{content:"vue"}.token.comment,.token.block-comment,.token.prolog,.token.doctype,.token.cdata{color:#999}.token.punctuation{color:#ccc}.token.tag,.token.attr-name,.token.namespace,.token.deleted{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.number,.token.function{color:#f08d49}.token.property,.token.class-name,.token.constant,.token.symbol{color:#f8c555}.token.selector,.token.important,.token.atrule,.token.keyword,.token.builtin{color:#cc99cd}.token.string,.token.char,.token.attr-value,.token.regex,.token.variable{color:#7ec699}.token.operator,.token.entity,.token.url{color:#67cdcc}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}.custom-block.tip,.custom-block.info,.custom-block.warning,.custom-block.danger{margin:1rem 0;border-left:.5rem solid;padding:.1rem 1.5rem;overflow-x:auto}.custom-block.tip{background-color:#f3f5f7;border-color:var(--c-brand)}.custom-block.info{background-color:#f3f5f7;border-color:var(--c-text-light-2)}.custom-block.warning{border-color:#e7c000;color:#6b5900;background-color:#ffe5644d}.custom-block.warning .custom-block-title{color:#b29400}.custom-block.warning a{color:var(--c-text)}.custom-block.danger{border-color:#c00;color:#4d0000;background-color:#ffe6e6}.custom-block.danger .custom-block-title{color:#900}.custom-block.danger a{color:var(--c-text)}.custom-block.details{position:relative;display:block;border-radius:2px;margin:1.6em 0;padding:1.6em;background-color:#eee}.custom-block.details h4{margin-top:0}.custom-block.details figure:last-child,.custom-block.details p:last-child{margin-bottom:0;padding-bottom:0}.custom-block.details summary{outline:none;cursor:pointer}.custom-block-title{margin-bottom:-.4rem;font-weight:600}.sidebar-links{margin:0;padding:0;list-style:none}.sidebar-link-item{display:block;margin:0;border-left:.25rem solid transparent;color:var(--c-text)}a.sidebar-link-item:hover{text-decoration:none;color:var(--c-brand)}a.sidebar-link-item.active{color:var(--c-brand)}.sidebar>.sidebar-links{padding:.75rem 0 5rem}@media (min-width: 720px){.sidebar>.sidebar-links{padding:1.5rem 0}}.sidebar>.sidebar-links>.sidebar-link+.sidebar-link{padding-top:.5rem}@media (min-width: 720px){.sidebar>.sidebar-links>.sidebar-link+.sidebar-link{padding-top:1.25rem}}.sidebar>.sidebar-links>.sidebar-link>.sidebar-link-item{padding:.35rem 1.5rem .35rem 1.25rem;font-size:1.1rem;font-weight:700}.sidebar>.sidebar-links>.sidebar-link>a.sidebar-link-item.active{border-left-color:var(--c-brand);font-weight:600}.sidebar>.sidebar-links>.sidebar-link>.sidebar-links>.sidebar-link>.sidebar-link-item{display:block;padding:.35rem 1.5rem .35rem 2rem;line-height:1.4;font-size:1rem;font-weight:400}.sidebar>.sidebar-links>.sidebar-link>.sidebar-links>.sidebar-link>a.sidebar-link-item.active{border-left-color:var(--c-brand);font-weight:600}.sidebar>.sidebar-links>.sidebar-link>.sidebar-links>.sidebar-link>.sidebar-links>.sidebar-link>.sidebar-link-item{display:block;padding:.3rem 1.5rem .3rem 3rem;line-height:1.4;font-size:.9rem;font-weight:400}.sidebar>.sidebar-links>.sidebar-link>.sidebar-links>.sidebar-link>.sidebar-links>.sidebar-link>.sidebar-links>.sidebar-link>.sidebar-link-item{display:block;padding:.3rem 1.5rem .3rem 4rem;line-height:1.4;font-size:.9rem;font-weight:400}.debug[data-v-bf835584]{box-sizing:border-box;position:fixed;right:8px;bottom:8px;z-index:9999;border-radius:4px;width:74px;height:32px;color:#eee;overflow:hidden;cursor:pointer;background-color:#000000d9;transition:all .15s ease}.debug[data-v-bf835584]:hover{background-color:#000000bf}.debug.open[data-v-bf835584]{right:0;bottom:0;width:100%;height:100%;margin-top:0;border-radius:0;padding:0;overflow:scroll}@media (min-width: 512px){.debug.open[data-v-bf835584]{width:512px}}.debug.open[data-v-bf835584]:hover{background-color:#000000d9}.title[data-v-bf835584]{margin:0;padding:6px 16px;line-height:20px;font-size:13px}.block[data-v-bf835584]{margin:2px 0 0;border-top:1px solid rgba(255,255,255,.16);padding:8px 16px;font-family:Hack,monospace;font-size:13px}.block+.block[data-v-bf835584]{margin-top:8px}.icon.outbound{position:relative;top:-1px;display:inline-block;vertical-align:middle;color:var(--c-text-lighter)}.item[data-v-b8818f8c]{display:block;padding:0 1.5rem;line-height:36px;font-size:1rem;font-weight:600;color:var(--c-text);white-space:nowrap}.item[data-v-b8818f8c]:hover,.item.active[data-v-b8818f8c]{text-decoration:none;color:var(--c-brand)}.item.external[data-v-b8818f8c]:hover{border-bottom-color:transparent;color:var(--c-text)}@media (min-width: 720px){.item[data-v-b8818f8c]{border-bottom:2px solid transparent;padding:0;line-height:24px;font-size:.9rem;font-weight:500}.item[data-v-b8818f8c]:hover,.item.active[data-v-b8818f8c]{border-bottom-color:var(--c-brand);color:var(--c-text)}}.home-hero[data-v-370f18c0]{margin:2.5rem 0 2.75rem;padding:0 1.5rem;text-align:center}@media (min-width: 420px){.home-hero[data-v-370f18c0]{margin:3.5rem 0}}@media (min-width: 720px){.home-hero[data-v-370f18c0]{margin:4rem 0 4.25rem}}.figure[data-v-370f18c0]{padding:0 1.5rem}.image[data-v-370f18c0]{display:block;margin:0 auto;width:auto;max-width:100%;max-height:280px}.title[data-v-370f18c0]{margin-top:1.5rem;font-size:2rem}@media (min-width: 420px){.title[data-v-370f18c0]{font-size:3rem}}@media (min-width: 720px){.title[data-v-370f18c0]{margin-top:2rem}}.tagline[data-v-370f18c0]{margin:0;margin-top:.25rem;line-height:1.3;font-size:1.2rem;color:var(--c-text-light)}@media (min-width: 420px){.tagline[data-v-370f18c0]{line-height:1.2;font-size:1.6rem}}.action[data-v-370f18c0]{margin-top:1.5rem;display:inline-block}.action.alt[data-v-370f18c0]{margin-left:1.5rem}@media (min-width: 420px){.action[data-v-370f18c0]{margin-top:2rem;display:inline-block}}.action[data-v-370f18c0] .item{display:inline-block;border-radius:6px;padding:0 20px;line-height:44px;font-size:1rem;font-weight:500;color:var(--c-bg);background-color:var(--c-brand);border:2px solid var(--c-brand);transition:background-color .1s ease}.action.alt[data-v-370f18c0] .item{background-color:var(--c-bg);color:var(--c-brand)}.action[data-v-370f18c0] .item:hover{text-decoration:none;color:var(--c-bg);background-color:var(--c-brand-light)}@media (min-width: 420px){.action[data-v-370f18c0] .item{padding:0 24px;line-height:52px;font-size:1.2rem;font-weight:500}}.home-features[data-v-e39c13e0]{margin:0 auto;padding:2.5rem 0 2.75rem;max-width:960px}.home-hero+.home-features[data-v-e39c13e0]{padding-top:0}@media (min-width: 420px){.home-features[data-v-e39c13e0]{padding:3.25rem 0 3.5rem}.home-hero+.home-features[data-v-e39c13e0]{padding-top:0}}@media (min-width: 720px){.home-features[data-v-e39c13e0]{padding-right:1.5rem;padding-left:1.5rem}}.wrapper[data-v-e39c13e0]{padding:0 1.5rem}.home-hero+.home-features .wrapper[data-v-e39c13e0]{border-top:1px solid var(--c-divider);padding-top:2.5rem}@media (min-width: 420px){.home-hero+.home-features .wrapper[data-v-e39c13e0]{padding-top:3.25rem}}@media (min-width: 720px){.wrapper[data-v-e39c13e0]{padding-right:0;padding-left:0}}.container[data-v-e39c13e0]{margin:0 auto;max-width:392px}@media (min-width: 720px){.container[data-v-e39c13e0]{max-width:960px}}.features[data-v-e39c13e0]{display:flex;flex-wrap:wrap;margin:-20px -24px}.feature[data-v-e39c13e0]{flex-shrink:0;padding:20px 24px;width:100%}@media (min-width: 720px){.feature[data-v-e39c13e0]{width:calc(100% / 3)}}.title[data-v-e39c13e0]{margin:0;border-bottom:0;line-height:1.4;font-size:1.25rem;font-weight:500}@media (min-width: 420px){.title[data-v-e39c13e0]{font-size:1.4rem}}.details[data-v-e39c13e0]{margin:0;line-height:1.6;font-size:1rem;color:var(--c-text-light)}.title+.details[data-v-e39c13e0]{padding-top:.25rem}.footer[data-v-30918238]{margin:0 auto;max-width:960px}@media (min-width: 720px){.footer[data-v-30918238]{padding:0 1.5rem}}.container[data-v-30918238]{padding:2rem 1.5rem 2.25rem}.home-hero+.footer .container[data-v-30918238],.home-features+.footer .container[data-v-30918238],.home-content+.footer .container[data-v-30918238]{border-top:1px solid var(--c-divider)}@media (min-width: 420px){.container[data-v-30918238]{padding:3rem 1.5rem 3.25rem}}.text[data-v-30918238]{margin:0;text-align:center;line-height:1.4;font-size:.9rem;color:var(--c-text-light)}.home[data-v-10122c92]{padding-top:var(--header-height)}.home-content[data-v-10122c92]{max-width:960px;margin:0 auto;padding:0 1.5rem}.nav-bar-title[data-v-cc01ef16]{font-size:1.3rem;font-weight:600;color:var(--c-text);display:flex;justify-content:center;align-items:center}.nav-bar-title[data-v-cc01ef16]:hover{text-decoration:none}.logo[data-v-cc01ef16]{margin-right:.75rem;height:1.3rem;vertical-align:bottom}.item[data-v-bbc27490]{display:block;padding:0 1.5rem 0 2.5rem;line-height:32px;font-size:.9rem;font-weight:500;color:var(--c-text);white-space:nowrap}@media (min-width: 720px){.item[data-v-bbc27490]{padding:0 24px 0 12px;line-height:32px;font-size:.85rem;font-weight:500;color:var(--c-text);white-space:nowrap}.item.active .arrow[data-v-bbc27490]{opacity:1}}.item[data-v-bbc27490]:hover,.item.active[data-v-bbc27490]{text-decoration:none;color:var(--c-brand)}.item.external[data-v-bbc27490]:hover{border-bottom-color:transparent;color:var(--c-text)}@media (min-width: 720px){.arrow[data-v-bbc27490]{display:inline-block;margin-right:8px;border-top:6px solid #ccc;border-right:4px solid transparent;border-bottom:0;border-left:4px solid transparent;vertical-align:middle;opacity:0;transform:translateY(-2px) rotate(-90deg)}}.nav-dropdown-link[data-v-56bf3a3f]{position:relative;height:36px;overflow:hidden;cursor:pointer}@media (min-width: 720px){.nav-dropdown-link[data-v-56bf3a3f]{height:auto;overflow:visible}.nav-dropdown-link:hover .dialog[data-v-56bf3a3f]{display:block}}.nav-dropdown-link.open[data-v-56bf3a3f]{height:auto}.button[data-v-56bf3a3f]{display:block;border:0;padding:0 1.5rem;width:100%;text-align:left;line-height:36px;font-family:var(--font-family-base);font-size:1rem;font-weight:600;color:var(--c-text);white-space:nowrap;background-color:transparent;cursor:pointer}.button[data-v-56bf3a3f]:focus{outline:0}@media (min-width: 720px){.button[data-v-56bf3a3f]{border-bottom:2px solid transparent;padding:0;line-height:24px;font-size:.9rem;font-weight:500}}.button-arrow[data-v-56bf3a3f]{display:inline-block;margin-top:-1px;margin-left:8px;border-top:6px solid #ccc;border-right:4px solid transparent;border-bottom:0;border-left:4px solid transparent;vertical-align:middle}.button-arrow.right[data-v-56bf3a3f]{transform:rotate(-90deg)}@media (min-width: 720px){.button-arrow.right[data-v-56bf3a3f]{transform:rotate(0)}}.dialog[data-v-56bf3a3f]{margin:0;padding:0;list-style:none}@media (min-width: 720px){.dialog[data-v-56bf3a3f]{display:none;position:absolute;top:26px;right:-8px;border-radius:6px;padding:12px 0;min-width:128px;background-color:var(--c-bg);box-shadow:var(--shadow-3)}}.nav-links[data-v-eab3edfe]{padding:.75rem 0;border-bottom:1px solid var(--c-divider)}@media (min-width: 720px){.nav-links[data-v-eab3edfe]{display:flex;padding:6px 0 0;align-items:center;border-bottom:0}.item+.item[data-v-eab3edfe]{padding-left:24px}}.sidebar-button{position:absolute;top:.6rem;left:1rem;display:none;padding:.6rem;cursor:pointer}.sidebar-button .icon{display:block;width:1.25rem;height:1.25rem}@media screen and (max-width: 719px){.sidebar-button{display:block}}.nav-bar[data-v-675d8756]{position:fixed;top:0;right:0;left:0;z-index:var(--z-index-navbar);display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--c-divider);padding:.7rem 1.5rem .7rem 4rem;height:var(--header-height);background-color:var(--c-bg)}@media (min-width: 720px){.nav-bar[data-v-675d8756]{padding:.7rem 1.5rem}}.flex-grow[data-v-675d8756]{flex-grow:1}.nav[data-v-675d8756]{display:none}@media (min-width: 720px){.nav[data-v-675d8756]{display:block}}.sidebar[data-v-83e92a68]{position:fixed;top:var(--header-height);bottom:0;left:0;z-index:var(--z-index-sidebar);border-right:1px solid var(--c-divider);width:16.4rem;background-color:var(--c-bg);overflow-y:auto;transform:translate(-100%);transition:transform .25s ease}@media (min-width: 720px){.sidebar[data-v-83e92a68]{transform:translate(0)}}@media (min-width: 960px){.sidebar[data-v-83e92a68]{width:20rem}}.sidebar.open[data-v-83e92a68]{transform:translate(0)}.nav[data-v-83e92a68]{display:block}@media (min-width: 720px){.nav[data-v-83e92a68]{display:none}}.link[data-v-1ed99556]{display:inline-block;font-size:1rem;font-weight:500;color:var(--c-text-light)}.link[data-v-1ed99556]:hover{text-decoration:none;color:var(--c-brand)}.icon[data-v-1ed99556]{margin-left:4px}.last-updated[data-v-abce3432]{display:inline-block;margin:0;line-height:1.4;font-size:.9rem;color:var(--c-text-light)}@media (min-width: 960px){.last-updated[data-v-abce3432]{font-size:1rem}}.prefix[data-v-abce3432]{display:inline-block;font-weight:500}.datetime[data-v-abce3432]{display:inline-block;margin-left:6px;font-weight:400}.page-footer[data-v-07c132fc]{padding-top:1rem;padding-bottom:1rem;overflow:auto}@media (min-width: 960px){.page-footer[data-v-07c132fc]{display:flex;justify-content:space-between;align-items:center}}.updated[data-v-07c132fc]{padding-top:4px}@media (min-width: 960px){.updated[data-v-07c132fc]{padding-top:0}}.next-and-prev-link[data-v-38ede35f]{padding-top:1rem}.container[data-v-38ede35f]{display:flex;justify-content:space-between;border-top:1px solid var(--c-divider);padding-top:1rem}.prev[data-v-38ede35f],.next[data-v-38ede35f]{display:flex;flex-shrink:0;width:50%}.prev[data-v-38ede35f]{justify-content:flex-start;padding-right:12px}.next[data-v-38ede35f]{justify-content:flex-end;padding-left:12px}.link[data-v-38ede35f]{display:inline-flex;align-items:center;max-width:100%;font-size:1rem;font-weight:500}.text[data-v-38ede35f]{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.icon[data-v-38ede35f]{display:block;flex-shrink:0;width:16px;height:16px;fill:var(--c-text);transform:translateY(1px)}.icon-prev[data-v-38ede35f]{margin-right:8px}.icon-next[data-v-38ede35f]{margin-left:8px}.page[data-v-7eddb2c4]{padding-top:var(--header-height)}@media (min-width: 720px){.page[data-v-7eddb2c4]{margin-left:16.4rem}}@media (min-width: 960px){.page[data-v-7eddb2c4]{margin-left:20rem}}.container[data-v-7eddb2c4]{margin:0 auto;padding:0 1.5rem 4rem;max-width:48rem}.content[data-v-7eddb2c4]{padding-bottom:1.5rem}@media (max-width: 420px){.content[data-v-7eddb2c4]{clear:both}}#ads-container{margin:0 auto}@media (min-width: 420px){#ads-container{position:relative;right:0;float:right;margin:-8px -8px 24px 24px;width:146px}}@media (max-width: 420px){#ads-container{height:105px;margin:1.75rem 0}}@media (min-width: 1400px){#ads-container{position:fixed;right:8px;bottom:8px}}body.dark{--c-divider: var(--c-divider-dark);--c-text: var(--c-text-dark-1);--c-text-light: var(--c-text-dark-2);--c-text-lighter: var(--c-text-dark-3);--c-bg: var(--c-white);--c-bg-accent: var(--c-white-light);--code-font-family: var(--font-family-mono);--code-inline-bg-color: rgba(27, 31, 35, .05);--code-bg-color: #282c34;--c-white: var(--c-black);--c-white-dark: #f8f8f8;--c-black: #1a1a1a;--c-divider-light: rgba(60, 60, 67, .12);--c-divider-dark: rgba(84, 84, 88, .48);--c-text-light-1: #2c3e50;--c-text-light-2: #476582;--c-text-light-3: #90a4b7;--c-text-dark-1: #fff;--c-text-dark-2: #607385;--c-text-dark-3: #445666;--c-brand: #3eaf7c;--c-brand-light: #4abf8a;--shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .06);--shadow-2: 0 3px 12px rgba(0, 0, 0, .07), 0 1px 4px rgba(0, 0, 0, .07);--shadow-3: 0 12px 32px rgba(0, 0, 0, .1), 0 2px 6px rgba(0, 0, 0, .08);--shadow-4: 0 14px 44px rgba(0, 0, 0, .12), 0 3px 9px rgba(0, 0, 0, .12);--shadow-5: 0 18px 56px rgba(0, 0, 0, .16), 0 4px 12px rgba(0, 0, 0, .16);--header-height: 3.6rem;--docsearch-searchbox-focus-background: #242424;--docsearch-container-background: rgba(101, 108, 133, .8);--docsearch-modal-background: #242424;--docsearch-modal-shadow: inset 1px 1px 0 0 hsla(0, 0%, 100%, .5), 0 3px 8px 0 #555a64;--docsearch-searchbox-background: #ebedf0;--docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-hit-color: #444950;--docsearch-hit-active-color: #333;--docsearch-hit-background: #333;--docsearch-hit-shadow: 0 1px 3px 0 #d4d9e1;--docsearch-key-gradient: linear-gradient(-225deg, #d5dbe4, #f8f8f8);--docsearch-key-shadow: inset 0 -2px 0 0 #cdcde6, inset 0 0 1px 1px #333, 0 1px 2px 1px rgba(30, 35, 90, .4);--docsearch-footer-background: #333;--docsearch-footer-shadow: 0 -1px 0 0 #e0e3e8, 0 -3px 6px 0 rgba(69, 98, 155, .12)}body.dark tr:nth-child(2n){background-color:#2a2a2a}body.dark .DocSearch{--docsearch-primary-color: var(--c-brand);--docsearch-highlight-color: var(--docsearch-primary-color);--docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-text-color: var(--c-text-light);--docsearch-muted-color: var(--c-text-lighter);--docsearch-searchbox-background: #333}body.dark .DocSearch-Button:hover{box-shadow:var(--docsearch-searchbox-shadow);color:var(--docsearch-text-color);outline:none}body.dark .custom-block.details,body.dark .custom-block.info,body.dark .custom-block.tip{background-color:#2f2f2f}body.dark .custom-block.warning{background-color:#ffe56436;color:#ccc18c}body.dark .custom-block.danger{background-color:#6e4f4fd2;color:#f5d3d3}body.dark .custom-block.danger .custom-block-title{color:#f6b9b9}/*! @docsearch/css 3.0.0 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */:root{--docsearch-primary-color:#5468ff;--docsearch-text-color:#1c1e21;--docsearch-spacing:12px;--docsearch-icon-stroke-width:1.4;--docsearch-highlight-color:var(--docsearch-primary-color);--docsearch-muted-color:#969faf;--docsearch-container-background:rgba(101,108,133,.8);--docsearch-logo-color:#5468ff;--docsearch-modal-width:560px;--docsearch-modal-height:600px;--docsearch-modal-background:#f5f6f7;--docsearch-modal-shadow:inset 1px 1px 0 0 hsla(0,0%,100%,.5),0 3px 8px 0 #555a64;--docsearch-searchbox-height:56px;--docsearch-searchbox-background:#ebedf0;--docsearch-searchbox-focus-background:#fff;--docsearch-searchbox-shadow:inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-hit-height:56px;--docsearch-hit-color:#444950;--docsearch-hit-active-color:#fff;--docsearch-hit-background:#fff;--docsearch-hit-shadow:0 1px 3px 0 #d4d9e1;--docsearch-key-gradient:linear-gradient(-225deg,#d5dbe4,#f8f8f8);--docsearch-key-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 2px 1px rgba(30,35,90,.4);--docsearch-footer-height:44px;--docsearch-footer-background:#fff;--docsearch-footer-shadow:0 -1px 0 0 #e0e3e8,0 -3px 6px 0 rgba(69,98,155,.12)}html[data-theme=dark]{--docsearch-text-color:#f5f6f7;--docsearch-container-background:rgba(9,10,17,.8);--docsearch-modal-background:#15172a;--docsearch-modal-shadow:inset 1px 1px 0 0 #2c2e40,0 3px 8px 0 #000309;--docsearch-searchbox-background:#090a11;--docsearch-searchbox-focus-background:#000;--docsearch-hit-color:#bec3c9;--docsearch-hit-shadow:none;--docsearch-hit-background:#090a11;--docsearch-key-gradient:linear-gradient(-26.5deg,#565872,#31355b);--docsearch-key-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 2px 2px 0 rgba(3,4,9,.3);--docsearch-footer-background:#1e2136;--docsearch-footer-shadow:inset 0 1px 0 0 rgba(73,76,106,.5),0 -4px 8px 0 rgba(0,0,0,.2);--docsearch-logo-color:#fff;--docsearch-muted-color:#7f8497}.DocSearch-Button{align-items:center;background:var(--docsearch-searchbox-background);border:0;border-radius:40px;color:var(--docsearch-muted-color);cursor:pointer;display:flex;font-weight:500;height:36px;justify-content:space-between;margin:0 0 0 16px;padding:0 8px;user-select:none}.DocSearch-Button:active,.DocSearch-Button:focus,.DocSearch-Button:hover{background:var(--docsearch-searchbox-focus-background);box-shadow:var(--docsearch-searchbox-shadow);color:var(--docsearch-text-color);outline:none}.DocSearch-Button-Container{align-items:center;display:flex}.DocSearch-Search-Icon{stroke-width:1.6}.DocSearch-Button .DocSearch-Search-Icon{color:var(--docsearch-text-color)}.DocSearch-Button-Placeholder{font-size:1rem;padding:0 12px 0 6px}.DocSearch-Button-Keys{display:flex;min-width:calc(40px + .8em)}.DocSearch-Button-Key{align-items:center;background:var(--docsearch-key-gradient);border-radius:3px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;padding-bottom:2px;position:relative;top:-1px;width:20px}@media (max-width:750px){.DocSearch-Button-Keys,.DocSearch-Button-Placeholder{display:none}}.DocSearch--active{overflow:hidden!important}.DocSearch-Container,.DocSearch-Container *{box-sizing:border-box}.DocSearch-Container{background-color:var(--docsearch-container-background);height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:200}.DocSearch-Container a{text-decoration:none}.DocSearch-Link{appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;font:inherit;margin:0;padding:0}.DocSearch-Modal{background:var(--docsearch-modal-background);border-radius:6px;box-shadow:var(--docsearch-modal-shadow);flex-direction:column;margin:60px auto auto;max-width:var(--docsearch-modal-width);position:relative}.DocSearch-SearchBar{display:flex;padding:var(--docsearch-spacing) var(--docsearch-spacing) 0}.DocSearch-Form{align-items:center;background:var(--docsearch-searchbox-focus-background);border-radius:4px;box-shadow:var(--docsearch-searchbox-shadow);display:flex;height:var(--docsearch-searchbox-height);margin:0;padding:0 var(--docsearch-spacing);position:relative;width:100%}.DocSearch-Input{appearance:none;background:transparent;border:0;color:var(--docsearch-text-color);flex:1;font:inherit;font-size:1.2em;height:100%;outline:none;padding:0 0 0 8px;width:80%}.DocSearch-Input::placeholder{color:var(--docsearch-muted-color);opacity:1}.DocSearch-Input::-webkit-search-cancel-button,.DocSearch-Input::-webkit-search-decoration,.DocSearch-Input::-webkit-search-results-button,.DocSearch-Input::-webkit-search-results-decoration{display:none}.DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{margin:0;padding:0}.DocSearch-MagnifierLabel,.DocSearch-Reset{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}.DocSearch-Container--Stalled .DocSearch-MagnifierLabel,.DocSearch-LoadingIndicator{display:none}.DocSearch-Container--Stalled .DocSearch-LoadingIndicator{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Reset{animation:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;right:0;stroke-width:var(--docsearch-icon-stroke-width)}}.DocSearch-Reset{animation:fade-in .1s ease-in forwards;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;padding:2px;right:0;stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Reset[hidden]{display:none}.DocSearch-Reset:focus{outline:none}.DocSearch-Reset:hover{color:var(--docsearch-highlight-color)}.DocSearch-LoadingIndicator svg,.DocSearch-MagnifierLabel svg{height:24px;width:24px}.DocSearch-Cancel{display:none}.DocSearch-Dropdown{max-height:calc(var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height));min-height:var(--docsearch-spacing);overflow-y:auto;overflow-y:overlay;padding:0 var(--docsearch-spacing);scrollbar-color:var(--docsearch-muted-color) var(--docsearch-modal-background);scrollbar-width:thin}.DocSearch-Dropdown::-webkit-scrollbar{width:12px}.DocSearch-Dropdown::-webkit-scrollbar-track{background:transparent}.DocSearch-Dropdown::-webkit-scrollbar-thumb{background-color:var(--docsearch-muted-color);border:3px solid var(--docsearch-modal-background);border-radius:20px}.DocSearch-Dropdown ul{list-style:none;margin:0;padding:0}.DocSearch-Label{font-size:.75em;line-height:1.6em}.DocSearch-Help,.DocSearch-Label{color:var(--docsearch-muted-color)}.DocSearch-Help{font-size:.9em;margin:0;user-select:none}.DocSearch-Title{font-size:1.2em}.DocSearch-Logo a{display:flex}.DocSearch-Logo svg{color:var(--docsearch-logo-color);margin-left:8px}.DocSearch-Hits:last-of-type{margin-bottom:24px}.DocSearch-Hits mark{background:none;color:var(--docsearch-highlight-color)}.DocSearch-HitsFooter{color:var(--docsearch-muted-color);display:flex;font-size:.85em;justify-content:center;margin-bottom:var(--docsearch-spacing);padding:var(--docsearch-spacing)}.DocSearch-HitsFooter a{border-bottom:1px solid;color:inherit}.DocSearch-Hit{border-radius:4px;display:flex;padding-bottom:4px;position:relative}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--deleting{transition:none}}.DocSearch-Hit--deleting{opacity:0;transition:all .25s linear}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--favoriting{transition:none}}.DocSearch-Hit--favoriting{transform:scale(0);transform-origin:top center;transition:all .25s linear;transition-delay:.25s}.DocSearch-Hit a{background:var(--docsearch-hit-background);border-radius:4px;box-shadow:var(--docsearch-hit-shadow);display:block;padding-left:var(--docsearch-spacing);width:100%}.DocSearch-Hit-source{background:var(--docsearch-modal-background);color:var(--docsearch-highlight-color);font-size:.85em;font-weight:600;line-height:32px;margin:0 -4px;padding:8px 4px 0;position:sticky;top:0;z-index:10}.DocSearch-Hit-Tree{color:var(--docsearch-muted-color);height:var(--docsearch-hit-height);opacity:.5;stroke-width:var(--docsearch-icon-stroke-width);width:24px}.DocSearch-Hit[aria-selected=true] a{background-color:var(--docsearch-highlight-color)}.DocSearch-Hit[aria-selected=true] mark{text-decoration:underline}.DocSearch-Hit-Container{align-items:center;color:var(--docsearch-hit-color);display:flex;flex-direction:row;height:var(--docsearch-hit-height);padding:0 var(--docsearch-spacing) 0 0}.DocSearch-Hit-icon{height:20px;width:20px}.DocSearch-Hit-action,.DocSearch-Hit-icon{color:var(--docsearch-muted-color);stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Hit-action{align-items:center;display:flex;height:22px;width:22px}.DocSearch-Hit-action svg{display:block;height:18px;width:18px}.DocSearch-Hit-action+.DocSearch-Hit-action{margin-left:6px}.DocSearch-Hit-action-button{appearance:none;background:none;border:0;border-radius:50%;color:inherit;cursor:pointer;padding:2px}svg.DocSearch-Hit-Select-Icon{display:none}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Select-Icon{display:block}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:rgba(0,0,0,.2);transition:background-color .1s ease-in}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{transition:none}}.DocSearch-Hit-action-button:focus path,.DocSearch-Hit-action-button:hover path{fill:#fff}.DocSearch-Hit-content-wrapper{display:flex;flex:1 1 auto;flex-direction:column;font-weight:500;justify-content:center;line-height:1.2em;margin:0 8px;overflow-x:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:80%}.DocSearch-Hit-title{font-size:.9em}.DocSearch-Hit-path{color:var(--docsearch-muted-color);font-size:.75em}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-action,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-icon,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-path,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-text,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-title,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Tree,.DocSearch-Hit[aria-selected=true] mark{color:var(--docsearch-hit-active-color)!important}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:rgba(0,0,0,.2);transition:none}}.DocSearch-ErrorScreen,.DocSearch-NoResults,.DocSearch-StartScreen{font-size:.9em;margin:0 auto;padding:36px 0;text-align:center;width:80%}.DocSearch-Screen-Icon{color:var(--docsearch-muted-color);padding-bottom:12px}.DocSearch-NoResults-Prefill-List{display:inline-block;padding-bottom:24px;text-align:left}.DocSearch-NoResults-Prefill-List ul{display:inline-block;padding:8px 0 0}.DocSearch-NoResults-Prefill-List li{list-style-position:inside;list-style-type:"\bb "}.DocSearch-Prefill{appearance:none;background:none;border:0;border-radius:1em;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;font-size:1em;font-weight:700;padding:0}.DocSearch-Prefill:focus,.DocSearch-Prefill:hover{outline:none;text-decoration:underline}.DocSearch-Footer{align-items:center;background:var(--docsearch-footer-background);border-radius:0 0 8px 8px;box-shadow:var(--docsearch-footer-shadow);display:flex;flex-direction:row-reverse;flex-shrink:0;height:var(--docsearch-footer-height);justify-content:space-between;padding:0 var(--docsearch-spacing);position:relative;user-select:none;width:100%;z-index:300}.DocSearch-Commands{color:var(--docsearch-muted-color);display:flex;list-style:none;margin:0;padding:0}.DocSearch-Commands li{align-items:center;display:flex}.DocSearch-Commands li:not(:last-of-type){margin-right:.8em}.DocSearch-Commands-Key{align-items:center;background:var(--docsearch-key-gradient);border-radius:2px;box-shadow:var(--docsearch-key-shadow);display:flex;height:18px;justify-content:center;margin-right:.4em;padding-bottom:1px;width:20px}@media (max-width:750px){:root{--docsearch-spacing:10px;--docsearch-footer-height:40px}.DocSearch-Dropdown{height:100%}.DocSearch-Container{height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);position:absolute}.DocSearch-Footer{border-radius:0;bottom:0;position:absolute}.DocSearch-Hit-content-wrapper{display:flex;position:relative;width:80%}.DocSearch-Modal{border-radius:0;box-shadow:none;height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);margin:0;max-width:100%;width:100%}.DocSearch-Dropdown{max-height:calc(var(--docsearch-vh, 1vh)*100 - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height))}.DocSearch-Cancel{appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;flex:none;font:inherit;font-size:1em;font-weight:500;margin-left:var(--docsearch-spacing);outline:none;overflow:hidden;padding:0;user-select:none;white-space:nowrap}.DocSearch-Commands,.DocSearch-Hit-Tree{display:none}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.algolia-search-box{padding-top:1px}@media (min-width: 720px){.algolia-search-box{padding-left:8px}}@media (min-width: 751px){.algolia-search-box{min-width:176.3px}.algolia-search-box .DocSearch-Button-Placeholder{padding-left:8px;font-size:.9rem;font-weight:500}}.DocSearch{--docsearch-primary-color: var(--c-brand);--docsearch-highlight-color: var(--docsearch-primary-color);--docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-text-color: var(--c-text-light);--docsearch-muted-color: var(--c-text-lighter);--docsearch-searchbox-background: #f2f2f2} diff --git a/docs/.vitepress/dist/case/case1.html b/docs/.vitepress/dist/case/case1.html new file mode 100644 index 0000000000..0bbb751e8c --- /dev/null +++ b/docs/.vitepress/dist/case/case1.html @@ -0,0 +1,67 @@ + + + + + + 仓库 | 一键虚拟化项目 + + + + + + + + + + +

仓库

https://github.com/spiritLHLS/one-click-installation-script

前言

所有脚本如需在国内服务器使用,请在链接前加上https://ghproxy.com/确保命令可以下载本仓库的shell脚本执行

目录

一键修复脚本

运行所有一键修复脚本前注意看说明,以及保证服务器无重要数据,运行后造成的一切后果作者不负任何责任,自行评判风险!

一键尝试修复apt源

  • 支持系统:Ubuntu 12+,Debian 6+
  • 修复apt下载包进程意外退出导致的源锁死
  • 修复apt源broken损坏
  • 修复apt源多进程占用锁死
  • 修复apt源公钥缺失
  • 修复替换系统可用的apt源列表,国内用阿里源,国外用官方源
  • 修复本机的Ubuntu系统是EOL非长期维护的版本(奇数或陈旧的偶数版本),将替换为Ubuntu官方的old-releases仓库以支持apt的使用
  • 修复只保证apt update不会报错,其他命令报错未修复
  • 如若修复后install还有问题,重启服务器解决问题
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/package.sh -o package.sh && chmod +x package.sh && bash package.sh
+

一键尝试修复系统时间

  • 支持系统:Ubuntu 18+,Debian 8+,centos 7+,Fedora,Almalinux 8.5+
  • 由于系统时间不准确都是未进行时区时间同步造成的,使用chronyd进行时区时间同步后应当解决了问题
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/modify_time.sh -o modify_time.sh && chmod +x modify_time.sh && bash modify_time.sh
+

一键尝试修复sudo警告

  • 一键尝试修复sudo: unable to resolve host xxx: Name or service not known警告(爆错)

不要在生产环境上使用该脚本,否则容易造成网络hosts配置错误,配置的host名字不在外网IP上反而在内网IP(127.0.0.1)上

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/check_sudo.sh -o check_sudo.sh && chmod +x check_sudo.sh && bash check_sudo.sh
+

一键修改系统自带的journal日志记录大小释放系统盘空间

  • 支持系统:Ubuntu 18+,Debian 8+,centos 7+,Fedora,Almalinux 8.5+
  • 1.自定义修改大小,单位为MB,一般500或者1000即可,有的系统日志默认给了5000甚至更多,不是做站啥的没必要
    • 请注意,修改journal目录大小会影响系统日志的记录,因此,在修改journal目录大小之前如果需要之前的日志,建议先备份系统日志到本地
  • 2.自定义修改设置系统日志保留日期时长,超过日期时长的日志将被清除
  • 3.默认修改日志只记录warning等级(无法自定义)
  • 4.以后日志的产生将受到日志文件大小,日志保留时间,日志保留等级的限制
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/resize_journal.sh -o resize_journal.sh && chmod +x resize_journal.sh && bash resize_journal.sh
+

一键尝试修复网络

该脚本轻易勿要使用,请确保运行时服务器无重要文件或程序,出现运行bug后续可能需要重装系统

一定要在screen中执行该脚本,否则可能导致修改过程中ssh断链接而修改失败卡住最终SSH无法连接!不在screen中执行后果自负!

  • 支持系统:Ubuntu 18+,Debian 8+,centos 7+,Fedora,Almalinux 8.5+
  • 尝试修复nameserver为google源或cloudflare源
  • 尝试修复为IP类型对应的网络优先级(默认IPV4类型,纯V6类型再替换为IPV6类型)
curl -L https://cdn.spiritlhl.workers.dev/https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/network.sh -o network.sh && chmod +x network.sh && bash network.sh
+

如果是纯V6的也可以不使用上面脚本的nat64,使用warp添加V4网络

比如:https://github.com/fscarmen/warp

wget -N https://raw.githubusercontent.com/fscarmen/warp/main/menu.sh && bash menu.sh [option] [lisence]
+

非纯V6的,带V4切换优先级到IPV4可用以下命令

sudo sed -i 's/.*precedence ::ffff:0:0\/96.*/precedence ::ffff:0:0\/96  100/g' /etc/gai.conf && sudo systemctl restart networking
+

一键环境安装脚本

只推荐在新服务器上安装,环境不纯净不保证不出bug

运行所有一键环境安装脚本前注意看说明,以及保证服务器无重要数据,运行后造成的一切后果作者不负任何责任,自行评判风险!

一键安装jupyter环境

  • 本脚本尝试使用Miniconda3安装虚拟环境jupyter-env再进行jupyter和jupyterlab的安装,如若安装机器不纯净勿要轻易使用本脚本!
  • 本脚本为实验性脚本可能会有各种bug,勿要轻易尝试!
  • 安装前需要保证 sudo wget curl 已安装
  • 验证已支持的系统:
    • Ubuntu 18/20/22 - 推荐,脚本自动挂起到后台
    • Debian 9/10/11 - 还行,需要手动挂起到后台,详看脚本运行安装完毕的后续提示
  • 可能支持的系统(未验证):centos 7+,Fedora,Almalinux 8.5+
  • 执行脚本,之前有用本脚本安装过则直接打印设置的登陆信息,没安装过则进行安装再打印信息,如果已安装但未启动则自动启动后再打印信息
  • 如果是初次安装无脑输入y回车即可,按照提示进行操作即可,安装完毕将在后台常驻运行
  • 安装完毕后,如果需要在lab中安装第三方库需要在lab中使用terminal并使用conda进行下载而不是pip下载,这是需要注意的

原始用途是方便快捷的在按小时计费的超大型服务器上部署python环境进行科学计算,充分利用时间别浪费在构建环境上。

curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/jupyter.sh -o jupyter.sh && chmod +x jupyter.sh && bash jupyter.sh
+

安装后记得开放 13692 端口

apt install ufw -y
+ufw allow 13692
+

一键安装R语言环境

  • 安装前需使用Miniconda3安装虚拟环境jupyter-env,然后进行jupyter和jupyterlab的安装,再然后才能安装本内核
  • 简单的说,需要执行本仓库对应的jupyter安装脚本再运行本脚本安装R语言环境,会自动安装R环境内核和图形设备支持库
  • x11可能需要手动启动一下,执行sudo /usr/bin/Xorg
  • 可能支持的系统(未验证):centos 7+,Fedora,Almalinux 8.5+
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/R.sh -o R.sh && chmod +x R.sh && bash R.sh
+

一键安装rust环境

  • 支持系统:Ubuntu 18+,Debian 8+,centos 7+,Fedora,Almalinux 8.5+
  • 加载官方脚本安装,前置条件适配系统以及后置条件判断安装的版本
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/rust.sh -o rust.sh && chmod +x rust.sh && bash rust.sh 
+

一键安装C环境

  • 一键安装C++环境
  • 支持系统:使用apt或者yum作为包管理器的系统
  • 如果未安装则安装,如果有安装则提示升级
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/cplusplus.sh -o cplusplus.sh && chmod +x cplusplus.sh && bash cplusplus.sh 
+

一键安装vnstat环境

  • 支持系统:Ubuntu 18+,Debian 8+,centos 7+,Fedora,Almalinux 8.5+
  • 加载官方文件编译安装,前置条件适配系统以及后置条件判断安装的版本
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/vnstat.sh -o vnstat.sh && chmod +x vnstat.sh && bash vnstat.sh 
+

一键升级低版本debian为debian11

  • 支持系统:debian 6+
  • 升级后需要重启系统加载内核,升级过程中需要选择的都无脑按回车即可
  • 升级是一个版本迭代一个版本,所以如果版本低,每执行一次升级一个版本,直至升级到debian11
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/todebian11.sh -o todebian11.sh && chmod +x todebian11.sh && bash todebian11.sh
+

一键升级低版本ubuntu为ubuntu22

  • 支持系统:Ubuntu 16+
  • 升级后需要重启系统加载内核,升级过程中需要选择的都无脑按回车即可
  • 升级是一个版本迭代一个版本,所以如果版本低,每执行一次升级一个版本,直至升级到ubuntu22
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/toubuntu22.sh -o toubuntu22.sh && chmod +x toubuntu22.sh && bash toubuntu22.sh
+

一键安装zipline平台

  • 应该支持的系统:Ubuntu 18+,Debian 8+,centos 7+,Fedora,Almalinux 8.5+
  • 暂时只在Ubuntu上验证无问题
  • 如若要设置反向代理绑定域名,安装前请保证原服务器未安装过nginx,如若已安装过nginx,请自行配置反向代理本机的3000端口
  • 默认一路回车是不启用反代不安装nginx的,自行选择,如需通过本脚本配置反代系统一定要未安装过nginx并在填写y或Y开启安装
  • zipline 平台功能: ShareX,自定义短链接,文件上传分享,多用户校验,高亮显示,阅后即焚,设置简单 (含pastebin)
  • 自动安装docker,docker-compose,如若已安装zipline在/root目录下,则自动更新
  • 反向代理如若已设置成功,还需要在面板设置中填写域名,绑定启用
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/zipline.sh -o zipline.sh && chmod +x zipline.sh && bash zipline.sh
+

如果需要删除0字节文件,打开/root/zipline文件夹,执行

docker-compose exec zipline yarn scripts:clear-zero-byte
+

按照提示操作

一键安装filebrowser平台

  • 端口设置为3030了,其他登陆信息详见提示
  • filebrowser平台支持下载上传文件到服务器,批量下载多个文件(自定义压缩格式),构建文件分享链接,设置分享时长
  • 如果本地有启用IPV6优先级可能绑定到V6去了,使用lsof -i:3030查看绑定情况,切换优先级后再安装就正常了
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/filebrowser.sh -o filebrowser.sh && chmod +x filebrowser.sh && bash filebrowser.sh
+

一键删除平台监控

  • 一键移除大多数云服务器监控
  • 涵盖阿里云、腾讯云、华为云、UCLOUD、甲骨文云、京东云
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/dlm.sh -o dlm.sh && chmod +x dlm.shh && bash dlm.sh
+

部分手动命令

一键开启root登陆并替换密码

bash <(curl -sSL https://raw.githubusercontent.com/fscarmen/tools/main/root.sh) [PASSWORD]
+

一键屏蔽邮件端口避免被恶意程序使用

iptables -A INPUT -p tcp --dport 25 -j DROP
+iptables -A OUTPUT -p tcp --dport 25 -j DROP
+/sbin/iptables-save
+

设置语言包

sudo apt-get update
+sudo apt-get install language-pack-en-base
+sudo locale-gen en_US.UTF-8
+

下载UTF-8的环境,生成UTF-8的包,然后重启服务器

locale -a
+export LC_ALL=en_US.UTF-8
+

查看并设置语言包

language-pack-en-base 在debian中好像没有,只有Ubuntu有好像,不知道是不是个例,有问题再说

ubuntu更新源被锁

sudo rm -rf /var/cache/apt/archives/lock
+sudo pkill apt
+sudo rm /var/lib/dpkg/lock-frontend
+sudo rm /var/lib/apt/lists/lock
+sudo rm /var/cache/apt/archives/lock
+sudo rm /var/lib/dpkg/lock
+sudo dpkg --configure -a
+

然后重启系统

debian缺失公钥

apt-get install debian-keyring debian-archive-keyring -y
+

ubuntu或debian缺失公钥

后续这块有计划整理为一个一键脚本

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 公钥
+

centos换源

sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
+sudo sed -i 's/^mirrorlist=http/mirrorlist=https/' /etc/yum.repos.d/CentOS-Base.repo
+

安装gitea

Ubuntu 20无问题,Ubuntu 22好像不行

https://gitlab.com/packaging/gitea

卸载aapanel

apt install sysv-rc-conf -y && service bt stop && sysv-rc-conf bt off && rm -f /etc/init.d/bt && rm -rf /www/server/panel
+

安装docker和docker-compose

curl -sSL https://get.docker.com/ | sh
+curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m)" -o /usr/local/bin/docker-compose
+chmod +x /usr/local/bin/docker-compose
+docker-compose --version
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/case/case2.html b/docs/.vitepress/dist/case/case2.html new file mode 100644 index 0000000000..3fdce26a5f --- /dev/null +++ b/docs/.vitepress/dist/case/case2.html @@ -0,0 +1,31 @@ + + + + + + 仓库 | 一键虚拟化项目 + + + + + + + + + + +

仓库

https://github.com/spiritLHLS/ecs

前言

支持系统:

Ubuntu 18+, Debian 8+, centos 7+, Fedora 22+, Almalinux 8.5+, OracleLinux 8+, RockyLinux 8+, AstraLinux CE, Arch, FreeBSD(前提已执行pkg install -y curl bash)

目录

融合怪测评脚本

交互形式

curl -L https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh
+

curl -L https://github.com/spiritLHLS/ecs/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh
+

bash <(wget -qO- bash.spiritlhl.net/ecs)
+

无交互形式

echo 1 | bash <(wget -qO- --no-check-certificate https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh)
+

echo 1 | bash <(wget -qO- --no-check-certificate https://github.com/spiritLHLS/ecs/raw/main/ecs.sh)
+

echo 1 | bash <(wget -qO- bash.spiritlhl.net/ecs)
+

说明

融合怪的执行结果保存在当前路径下的test_result.txt中,运行完毕可用cat test_result.txt查看记录

融合怪的完整版和精简版运行完毕自动上传结果到pastebin并回传分享链接

有时候想要测一些配置极其拉跨的机器时,推荐使用screen命令挂起执行选项1的融合怪,然后你可以关闭SSH连接,等待一段时间后使用cat test_result.txt查看运行的实时状况,这样可以避免IO或者CPU过于垃圾导致的测试过程中的SSH连接中断,就不会测一半啥都没了

最烂机器测试的例子(跑了47分钟一样测完):跳转

使用CDN加速已支持国内国外服务器测试,但国内受CDN连通性或国内机器带宽大小的限制加载会慢很多

融合怪测试说明以及部分测试结果的内容解释(初次使用推荐查看):

除了已标注的原创内容,其余所有分区均为借鉴并进行优化修改后的版本,与原始对应的脚本不一样

系统基础信息测试融合了三家还有我自己修补的部分检测(systl、virt、NAT类型检测等),应该是目前最全面的了

CPU测试使用sysbench测试得分,不是yabs的gb4或gb5,前者只是简单的计算质数测试速度快,后者geekbench是综合测试系统算加权得分,不是同一种东西,别互相比较了,没有任何用处

CPU测试单核得分在5000以上的可以算第一梯队,4000到5000分算第二梯队,每1000分算一档,自己看看自己在哪个档位吧

AMD 7950x单核满血性能得分在6500左右,AMD 5950x单核满血性能得分5700左右,Intel普通的CPU(E5之类的)在1000~800左右,低于500的单核CPU可以算是比较烂的了

IO测试收录了两种,来源于lemonbench的dd磁盘测试和yabs的fio磁盘测试,综合来看会比较好,前者可能误差偏大但测试速度快无硬盘大小限制,后者真实一点但测试速度慢有硬盘以及内存大小限制

流媒体测试收录了两种,一个是go编译的二进制文件和一个shell脚本版本,二者各有优劣,互相对比看即可

tiktok测试有superbench和lmc999两种版本,哪个失效了随时可能更新为其中一种版本,以最新的脚本为准

回程路由测试选用的GO编译的二进制版本和朋友PR的版本,本人做了优化适配多个IP列表以及融合部分查询

IP质量检测纯原创,如有bug或者更多数据库来源可在issues中提出,日常看IP2Location数据库的IP类型即可

融合怪的IP质量检测是简化过的,没有查询Cloudflare的威胁得分,个人原创区的IP质量检测才是完整版(或者仓库说明中列出的那个IP质量检测的命令也是完整版)

三网测速使用自写的测速脚本,尽量使用最新节点最新组件进行测速,且有备用go版本测速,做到自更新测速节点列表,自适应系统环境测速

其他第三方脚本归纳到了第三方脚本区,里面有同类型脚本不同作者的各种竞品脚本,如果融合怪不能使你满意或者有错误,可以看看那部分

原创脚本区是个人原创的部分,有事没事也可以看看,可能会更新某些偏门或者独到的脚本

VPS测试,VPS测速,VPS综合性能测试,VPS回程线路测试,VPS流媒体测试等所有测试融合的脚本,本脚本能融合的都融合了

纯测IP质量

  • IP黑 OR
  • 含IPV4 AND IPV6
bash <(wget -qO- --no-check-certificate https://gitlab.com/spiritysdx/za/-/raw/main/qzcheck.sh)
+

bash <(wget -qO- bash.spiritlhl.net/ecs-ipcheck)
+

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/ecs/main/qzcheck.sh)
+

功能

  • [x] 自由组合测试方向和单项测试以及合集收录第三方脚本
  • [x] 基础系统信息--感谢teddysun和superbench和yabs开源,本人整理修改优化
  • [x] CPU测试--感谢lemonbench开源,本人整理修改优化
  • [x] 内存测试--感谢lemonbench开源,本人整理修改优化
  • [x] 磁盘dd读写测试--感谢lemonbench开源,本人整理修改优化
  • [x] 硬盘fio读写测试--感谢yabs开源项目,本人整理修改优化
  • [x] 御三家流媒体解锁测试--感谢sjlleo的二进制文件,本人修改整理优化
  • [x] 常用流媒体解锁测试--感谢RegionRestrictionCheck的项目,本人整理修改优化
  • [x] Tiktok解锁--感谢lmc999的项目,本人整理修改优化
  • [x] 三网回程以及路由延迟--感谢zhanghanyun/backtrace开源项目,本人整理修改
  • [x] 回程路由以及带宽类型检测(商宽/家宽/数据中心)--由fscarmen的PR以及本人的技术思路提供,本人整理修改优化
  • [x] IP质量检测(检测IP白不白)(含IPV4和IPV6)--本脚本独创,感谢互联网提供的查询资源
  • [x] speedtest测速--使用自写ecsspeed仓库,自动更新测速服务器ID,一劳永逸解决老是要手动更新测速ID的问题

脚本概况

主界面:

选项1融合怪完全体:

选项6原创区:

致谢

感谢 ipinfo.io ip.sb ipip.net cip.cc cheervision.co 等网站提供的检测API

感谢所有开源项目提供的原始测试脚本

同时感谢以下平台提供编辑和测试支持

+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/case/case3.html b/docs/.vitepress/dist/case/case3.html new file mode 100644 index 0000000000..464b72eb3c --- /dev/null +++ b/docs/.vitepress/dist/case/case3.html @@ -0,0 +1,31 @@ + + + + + + 仓库 | 一键虚拟化项目 + + + + + + + + + + +

仓库

https://github.com/spiritLHLS/ecsspeed

ecsspeed

自动更新测速服务器节点列表的网络基准测试脚本

Network benchmarking script that automatically updates the list of speed measurement server nodes

说明

所有组件以及数据均来源于平台或已有的开源项目,无非开源部分,放心食用

对应 speedtest.net 的自动更新测速服务器ID的测速脚本

日常推荐使用

bash <(wget -qO- bash.spiritlhl.net/ecs-net)
+

bash <(wget -qO- --no-check-certificate https://github.com/spiritLHLS/ecsspeed/raw/main/script/ecsspeed-net.sh)
+

或国内用

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/ecsspeed/main/script/ecsspeed-net.sh)
+

支持测速的架构:i386, x86_64, amd64, arm64, s390x, riscv64, ppc64le, ppc64

涵盖中国三大运营商、香港、台湾的测速节点,默认的三网测速每个运营商选择本机ping值最低的两个节点测速,详情三网测速才是全测,节点列表大概每7天自动更新一次。

支持国内服务器测试(有判断是否为国内机器),但由于国内服务器带宽过小,会很慢,详见初次运行的显示

当官方CLI安装失败(如罕见的架构或者官方网站访问失败时)自动使用 speedtest-go 作为替代品测速

对应 speedtest.cn 的自动更新测速服务器ID的测速脚本

单线程测速

bash <(wget -qO- bash.spiritlhl.net/ecs-cn)
+

bash <(wget -qO- --no-check-certificate https://github.com/spiritLHLS/ecsspeed/raw/main/script/ecsspeed-cn.sh)
+

或国内用

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/ecsspeed/main/script/ecsspeed-cn.sh)
+

支持测速的架构:i386, x86_64, amd64, arm64, s390x, riscv64, ppc64le, ppc64

涵盖中国三大运营商、香港、台湾的测速节点,默认的三网测速每个运营商选择本机ping值最低的两个节点测速,详情三网测速才是全测,节点列表每天自动更新一次。

支持国内服务器测试(有判断是否为国内机器),但由于国内服务器带宽过小,会很慢,详见初次运行的显示

自动更新测试服务器列表的三网延迟测试脚本

平均耗时10~15秒

bash <(wget -qO- bash.spiritlhl.net/ecs-ping)
+

bash <(wget -qO- --no-check-certificate https://github.com/spiritLHLS/ecsspeed/raw/main/script/ecsspeed-ping.sh)
+

或国内用

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/ecsspeed/main/script/ecsspeed-ping.sh)
+

效果图

功能

  • [x] 自动抓取 speedtest.cn 节点信息结合已有信息去重并更新列表数据
  • [x] 自动抓取 speedtest.net 节点信息结合已有信息去重并更新列表数据
  • [x] 对应 speedtest.net 的自动更新测速服务器列表的测速脚本
  • [x] 对应 speedtest.cn 的自动更新测速服务器列表的测速脚本
  • [x] 自动更新测试服务器列表的三网Ping值测试脚本

.cn数据

仓库:https://github.com/spiritLHLS/speedtest.cn-CN-ID

.net数据

仓库:https://github.com/spiritLHLS/speedtest.net-CN-ID

交流

admin@spiritlhl.net

致谢

感谢 @fscarmen 提供的并发测ping支持

感谢 speedtest-go 提供的第三方测速内核

感谢 speedtest.netspeedtest.cn 提供的测速服务器

+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/case/case4.html b/docs/.vitepress/dist/case/case4.html new file mode 100644 index 0000000000..cb8ee8179b --- /dev/null +++ b/docs/.vitepress/dist/case/case4.html @@ -0,0 +1,25 @@ + + + + + + 仓库 | 一键虚拟化项目 + + + + + + + + + + +

仓库

https://github.com/spiritLHLS/Oracle-server-keep-alive-script

Oracle-server-keep-alive-script

实际不止可以在甲骨文服务器上使用,也可以使用在任意ARM或X86_64架构的系统,用作资源占用

甲骨文服务器保活脚本

适配系统:已在Ubuntu 20+,Debian 10+, Centos 7+, Oracle linux 8+,AlmaLinux 8.5+

上述系统验证无问题,别的主流系统应该也没有问题

可选占用:CPU,内存,带宽

安装完毕后如果有问题请卸载脚本反馈问题(重复卸载也没问题)

所有资源(除了CPU)可选默认配置则动态占用,实时调整,避免服务器有别的任何资源已经超过限额了仍然再占用资源

为避免GitHub的CDN抽风加载不了新内容,所有新更新已使用Gitlab仓库

由于speedtest-go的release依赖于GitHub,所以请检查 www.githubstatus.com ,有问题时无法安装带宽占用

基础开发完毕,测试中,有问题请在issues中反馈

选项1安装,选项2卸载,选项3更新安装引导脚本,选项4退出脚本

安装过程中无脑回车则全部可选的占用都占用,不需要什么占用输入n再回车

如果选择带宽占用,会询问使用speedtest-go占用还是使用wget占用,按照提示进行选择即可

有询问是否需要带宽占用的参数自定义,这时候默认选项就是n,回车就使用默认配置,输入y再回车则需要按照提示自定义参数

curl -L https://gitlab.com/spiritysdx/Oracle-server-keep-alive-script/-/raw/main/oalive.sh -o oalive.sh && chmod +x oalive.sh && bash oalive.sh
+

bash oalive.sh
+

bash <(wget -qO- --no-check-certificate https://gitlab.com/spiritysdx/Oracle-server-keep-alive-script/-/raw/main/oalive.sh)
+

说明

  • 提供两种CPU占用模式:DD模拟占用和科学计算模式,用户可以自由选择,占用范围设置在15%至25%之间,更推荐DD模拟占用
  • DD模拟占用在守护进程中设置了CPU占用的最高限制
  • 默认情况下,CPU占用设置为25%最高值,计算方法是核数乘以12%,如果计算结果低于25%,则设置为该值;如果计算结果高于25%,则按照计算结果的比例进行设置。
  • 内存占用设置为占用总内存的20%,占用时间为300秒,休息时间为300秒。
  • 每300秒检测一次内存占用情况,并根据需要动态调整占用大小。如果内存占用已经大于20%,则不增加占用。
  • 在占用过程中,使用守护进程和开机自启服务,以确保占用任务持续且有效。
  • 默认选项的带宽占用每45分钟下载一次大小在1G至10G之间的文件,只进行下载而不保存。在下载过程中会占用硬盘空间,但在下载完成后会自动释放。
  • 默认选项的带宽占用动态调整实际下载的带宽/速率,限制每次下载的最长时长为6分钟。在每次下载之前,会测试最大可用带宽,并根据实时结果将下载速率设置为30%的带宽。
  • 带宽占用测试使用了speedtest-cli和speedtest-go两种工具,以防其中之一不可用时使用第二种工具,用户可以自定义设置带宽占用,此时详见设置提示。
  • 提供一键卸载所有占用服务的选项,卸载将删除所有脚本、服务、任务、守护进程和开机自启设置。
  • 提供一键检查更新的功能,更新范围仅限于脚本更新。请在更新后重新设置占用服务
  • 对所有进程执行增加唯一性检测,避免重复运行,使用PID文件进行判断。

如若不希望一键的,希望自定义设置时间的,请查看README_CRON.md自行设置定时任务

+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/case/case5.html b/docs/.vitepress/dist/case/case5.html new file mode 100644 index 0000000000..613bf711c5 --- /dev/null +++ b/docs/.vitepress/dist/case/case5.html @@ -0,0 +1,23 @@ + + + + + + 仓库 | 一键虚拟化项目 + + + + + + + + + + +

仓库

https://github.com/spiritLHLS/convoypanel-scripts

convoypanel-scripts

One-click installation of convoy panel

Prerequisites for installation:

  • PVE is installed
  • System is debian 11
  • CPU at least 2 cores, hard disk at least 20G, memory at least 4G (memory covers swap)

I don't guarantee that this script is error-free, it's just for my own amusement.

curl -L https://github.com/spiritLHLS/convoypanel-scripts/raw/main/installconvoy.sh -o installconvoy.sh && chmod +x installconvoy.sh && bash installconvoy.sh
+

Thanks

Base on https://github.com/spiritLHLS/pve

Base on https://docs.convoypanel.com/guide/deployment/#installation

Base on https://github.com/ConvoyPanel/panel

+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/case/index.html b/docs/.vitepress/dist/case/index.html new file mode 100644 index 0000000000..f457808a86 --- /dev/null +++ b/docs/.vitepress/dist/case/index.html @@ -0,0 +1,22 @@ + + + + + + 一键虚拟化项目 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/developer/index.html b/docs/.vitepress/dist/developer/index.html new file mode 100644 index 0000000000..3f88065952 --- /dev/null +++ b/docs/.vitepress/dist/developer/index.html @@ -0,0 +1,22 @@ + + + + + + 一键虚拟化项目 + + + + + + + + + + +

开发手册

欢迎使用一键虚拟化项目开发手册,欢迎你提出高质量的Pull Request,帮助一键虚拟化项目变得更好!

Copyright © 2023-present oneclickvirt

+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/developer/l10n.html b/docs/.vitepress/dist/developer/l10n.html new file mode 100644 index 0000000000..718ffcf534 --- /dev/null +++ b/docs/.vitepress/dist/developer/l10n.html @@ -0,0 +1,22 @@ + + + + + + 介绍 | 一键虚拟化项目 + + + + + + + + + + +

你可以在开发新功能时遵循以下步骤来支持本地化

介绍

  1. 你可以直接使用 /resource/l10n/zh-CN.toml 中已有的文本配置来替换新功能中的文本
  2. 如果新功能中有新增文本,请参考 zh-CN.toml 的配置文本,将新文本拉取到 zh-CN.toml 等其他语言的配置文件中,并添加翻译

新本地化文本的添加

  1. /resource/l10n/ 中添加新的语言文本配置
  2. 在新的语言文本配置中拉取其他语言已有的文本配置
  3. 为新的语言文本配置添加翻译
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/developer/index.html b/docs/.vitepress/dist/en_US/developer/index.html new file mode 100644 index 0000000000..52a7ff11ca --- /dev/null +++ b/docs/.vitepress/dist/en_US/developer/index.html @@ -0,0 +1,22 @@ + + + + + + One Click Virtualization Project + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/developer/l10n.html b/docs/.vitepress/dist/en_US/developer/l10n.html new file mode 100644 index 0000000000..d7830c7ac3 --- /dev/null +++ b/docs/.vitepress/dist/en_US/developer/l10n.html @@ -0,0 +1,22 @@ + + + + + + Introduction | One Click Virtualization Project + + + + + + + + + + +

You can follow these steps to support localization when developing new features

Introduction

  1. You can directly use the text configuration already available in /resource/l10n/en-US.toml to replace the text in the new feature.
  2. If there is new text in the new feature, please refer to the configuration text in en-US.toml, pull the new text into the configuration files of other languages such as en-US.toml, and add translations.

Adding a new localized text file

  1. Add a new language text configuration in /resource/l10n/.
  2. Pull existing text configurations from other languages in the new language text configuration.
  3. Add translations for the new language text configuration.
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/dashboard.html b/docs/.vitepress/dist/en_US/guide/dashboard.html new file mode 100644 index 0000000000..00dc35b966 --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/dashboard.html @@ -0,0 +1,22 @@ + + + + + + 准备工作 | One Click Virtualization Project + + + + + + + + + + +

准备工作

需要虚拟化出服务器,你需要:

  1. 一台可以连接公网的服务器( VPS 或 Dedicated Server),最好能完美访问 Github 的 RAW 页面,部分项目部分组件可能未使用 CDN 加速

TIP

如果您位于中国大陆,访问 Github 有困难,请注意配套脚本和项目是否有说明已使用 CDN 加速

  1. 本地可以稳定连接SSH,如果不能稳定连接,请使用screen命令创建窗口后,在窗口内执行命令

TIP

不会用screen命令的,自行查找相关教程学习

  1. 确保服务器的系统和硬件满足对应项目的要求,详见对应项目说明

本文档将以VPS作为范例,且该VPS纯净,无原生环境问题,如有必要请重装系统保证初始环境的纯净

WARNING

PVE项目可能造成宿主机出现问题,如果你不会看Bug和修复系统,那么不建议你在生产环境中使用,使用PVE相关脚本请确保宿主机随时可重装系统

项目仓库

欢迎Star和Fork,如有问题,对应仓库的issues提出,有空会看看与解决,当然仅限脚本相关问题

PVE相关的各种一键脚本

https://github.com/spiritLHLS/pve

通过LXD/LXC命令批量或单独开设NAT服务器以及维护

https://github.com/spiritLHLS/lxc

通过docker批量或单独开设NAT服务器

https://github.com/spiritLHLS/docker



+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/dashboardq.html b/docs/.vitepress/dist/en_US/guide/dashboardq.html new file mode 100644 index 0000000000..af947adbe4 --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/dashboardq.html @@ -0,0 +1,23 @@ + + + + + + One Click Virtualization Project + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/docker_build.html b/docs/.vitepress/dist/en_US/guide/docker_build.html new file mode 100644 index 0000000000..a319a2051d --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/docker_build.html @@ -0,0 +1,39 @@ + + + + + + Docker虚拟化 | One Click Virtualization Project + + + + + + + + + + +

Docker虚拟化

单独开设

下载脚本

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/onedocker.sh -o onedocker.sh && chmod +x onedocker.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/onedocker.sh -o onedocker.sh && chmod +x onedocker.sh
+

运行

./onedocker.sh name cpu memory password sshport startport endport system
+

目前system仅支持选择alpine或debian,默认是debian

示例

  • 以下为开设的示例容器的信息:
    容器名字 - test SSH登录的用户名 - root SSH登录的密码 - 123456 CPU核数 - 1
    内存大小 - 512MB SSH端口 - 25000 内外网映射端口一致的区间 - 34975到35000 系统 - debian
./onedocker.sh test 1 512 123456 25000 34975 35000 debian
+

删除示例

docker rm -f test
+rm -rf test
+ls
+

进入示例

docker exec -it test /bin/bash
+

要退出容器就执行exit退出。

查询信息

cat 容器名字
+

输出格式

容器名字 SSH端口 登陆的root密码 核数 内存 外网端口起 外网端口止 
+

批量开设

  • 批量多次运行继承配置生成
  • 生成多个时为避免SSH连接中断建议在screen中执行

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/dockers.sh -o dockers.sh && chmod +x dockers.sh && bash dockers.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/onedocker.sh -o onedocker.sh && chmod +x onedocker.sh
+

查询批量开设的信息

cat dclog
+

输出格式

容器名字 SSH端口 登陆的root密码 核数 内存 外网端口起 外网端口止 
+

一行一个容器对应的信息

卸载所有docker容器和镜像

docker rm -f $(docker ps -aq); docker rmi $(docker images -aq)
+rm -rf dclog
+ls
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/docker_install.html b/docs/.vitepress/dist/en_US/guide/docker_install.html new file mode 100644 index 0000000000..f8f785fc7a --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/docker_install.html @@ -0,0 +1,24 @@ + + + + + + 环境预设 | One Click Virtualization Project + + + + + + + + + + +

环境预设

  • 检测环境
  • 安装docker
  • 下载预制脚本

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/pre_build.sh -o pre_build.sh && chmod +x pre_build.sh && bash pre_build.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/pre_build.sh -o pre_build.sh && chmod +x pre_build.sh && bash pre_build.sh
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/docker_precheck.html b/docs/.vitepress/dist/en_US/guide/docker_precheck.html new file mode 100644 index 0000000000..08de681cef --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/docker_precheck.html @@ -0,0 +1,22 @@ + + + + + + 项目特点 | One Click Virtualization Project + + + + + + + + + + +

项目特点

通过docker批量或单独开设NAT服务器(Bulk or individual NAT server provisioning via docker)

默认使用debian系统,每个容器自带1个外网ssh端口,25个内外网一致端口

默认创建的是非特权容器,且不挂载与宿主机的docker的守护进程之间的通信,所以宿主机创建的docker虚拟化的NAT服务器内无法再嵌套虚拟化docker

由于只是在宿主机进行了CPU和内存的限制未在容器内使用cgroup驱动,所以在容器内使用服务器测试脚本检测容器的可用资源是无效的,显示的会是宿主机的资源

由于大部分云服务器xfs文件系统不启用pquota选项,所以默认共享宿主机硬盘,无法限制每个容器的磁盘大小

配置要求

系统可安装docker即可用,网络能连接Github的raw界面就能用,硬件配置只要不拉跨就行,空闲硬盘有3G就行

推荐在开设NAT服务器前先增加部分SWAP虚拟内存,避免突发的内存占用导致母鸡卡死 跳转

PS: 如果硬件资源只是好了一点,需要限制更多东西并需要配置IPV6独立地址和限制硬盘大小,可使用LXD批量开LXC虚拟化的容器 跳转

PS: 如果硬件非常好资源很多,可使用PVE批量开KVM虚拟化的虚拟机 跳转

+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/docker_qa.html b/docs/.vitepress/dist/en_US/guide/docker_qa.html new file mode 100644 index 0000000000..cb5b285111 --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/docker_qa.html @@ -0,0 +1,22 @@ + + + + + + One Click Virtualization Project + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/docker_thanks.html b/docs/.vitepress/dist/en_US/guide/docker_thanks.html new file mode 100644 index 0000000000..20f33fcfe4 --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/docker_thanks.html @@ -0,0 +1,22 @@ + + + + + + One Click Virtualization Project + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/lxd_extra_config.html b/docs/.vitepress/dist/en_US/guide/lxd_extra_config.html new file mode 100644 index 0000000000..b9d757b265 --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/lxd_extra_config.html @@ -0,0 +1,46 @@ + + + + + + 自动配置IPV6地址 | One Click Virtualization Project + + + + + + + + + + +

TIP

以下的配置安装会加重母鸡的负担,非必要不要安装 如果是个人使用,可忽略防滥用部分脚本的安装

自动配置IPV6地址

  • (非必须,不使用的也没问题)
  • 该脚本仅适用于母鸡有给IPV6子网且是/64的,且母鸡绑定了子网的第一个IP母鸡的IPV6地址或IPV6的gateway
  • 自动为LXD创建的LXC容器配置IPV6地址
  • 已集成到buildone.sh中可使用变量控制且无需事先下载,该脚本可不手动使用,在使用buildone.sh时配置Y开启即可

下载脚本

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_ipv6_network.sh -o build_ipv6_network.sh && chmod +x build_ipv6_network.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_ipv6_network.sh -o build_ipv6_network.sh && chmod +x build_ipv6_network.sh
+

自动为容器配置IPV6映射地址

bash build_ipv6_network.sh 容器名称
+

映射完毕会打印信息

示例(给test容器自动配置IPV6地址,配置完成会写入一个test_v6的文件信息)

bash build_ipv6_network.sh test
+

删除所有IPV6已映射的规则

ip6tables -t nat -F PREROUTING
+ip6tables-legacy -t nat -F PREROUTING
+ip6tables-save > /etc/iptables/rules.v6
+netfilter-persistent save
+netfilter-persistent reload
+service netfilter-persistent restart
+

卸载IPV6地址绑定的守护进程和对应的文件

systemctl stop add-ipv6.service
+systemctl disable add-ipv6.service
+rm /etc/systemd/system/add-ipv6.service
+systemctl daemon-reload
+rm /usr/local/bin/add-ipv6.sh
+

屏蔽容易被滥用的端口的出入流量以屏蔽端口和屏蔽滥用工具包

  • (非必须,该脚本仅仅是为了防止容器滥用方便,不装的也没问题)
  • 事前预防

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/rules.sh -o rules.sh && chmod +x rules.sh && bash rules.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/rules.sh -o rules.sh && chmod +x rules.sh && bash rules.sh
+
使用screen配置监控屏蔽某些进程的执行遇到某些进程的出现直接关闭容器
  • 如需停止监控可使用screen命令停止lxc_moniter这个名字的窗口并删除
  • (非必须,该脚本仅仅是为了防止容器滥用方便,不装的也没问题)
  • 事后停机

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_monitor.sh -o build_monitor.sh && chmod +x build_monitor.sh && bash build_monitor.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_monitor.sh -o build_monitor.sh && chmod +x build_monitor.sh && bash build_monitor.sh
+
一键安装开lxd母鸡所需要的带vnstat环境的常用预配置环境
  • (非必须,该脚本仅仅是为了站点对接监控方便,不装的也没问题)

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/backend.sh -o backend.sh && chmod +x backend.sh && bash backend.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/backend.sh -o backend.sh && chmod +x backend.sh && bash backend.sh
+
一键安装母鸡可视化操作的面板
  • (非必须,该面板只是为了方便可视化操作,没有也没问题)
  • 原作者仓库:跳转
lxc config set core.https_address [::]
+lxc config set core.trust_password some-secret-string
+snap install lxdmosaic
+

安装完毕后打开母鸡IP地址,按照提示设置admin的密码,其他一路默认就能使用面板了

+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/lxd_install.html b/docs/.vitepress/dist/en_US/guide/lxd_install.html new file mode 100644 index 0000000000..a2c180a1d5 --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/lxd_install.html @@ -0,0 +1,36 @@ + + + + + + LXD主体安装 | One Click Virtualization Project + + + + + + + + + + +

LXD主体安装

手动安装

新手推荐,避免有bug不知道怎么修,当然如果只是图方便又是老手懂排查BUG,用后面的一键安装也行

关闭防火墙

apt update
+apt install curl wget sudo dos2unix ufw jq -y
+ufw disable
+

开设虚拟内存SWAP

内存看你开多少小鸡,这里如果要开8个,换算需要2G内存,实际内存如果是512MB内存,还需要开1.5G,保守点开2G虚拟内存即可

执行下面命令,输入1,再输入2048,代表开2G虚拟内存

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/swap.sh -o swap.sh && chmod +x swap.sh && bash swap.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/swap.sh -o swap.sh && chmod +x swap.sh && bash swap.sh
+

安装LXD

实际swap开的虚拟内存应该是实际内存的2倍,也就是开1G是合理的,上面我描述的情况属于超开了

apt install snapd -y
+snap install lxd
+/snap/bin/lxd init
+

如果上面的命令中出现下面的错误

(snap "lxd" assumes unsupported features: snapd2.39 (try to update snapd and refresh the core snap))

使用命令修补后再进行lxd的安装

snap install core
+

如果无异常,上面三行命令执行结果如下

一般的选项回车默认即可

选择配置物理盘大小(提示默认最小1GB那个选项),一般我填空闲磁盘大小减去内存大小后乘以0.95并向下取整,这里我填了10GB

提示带auto的更新image的选项记得选no,避免更新占用系统

测试lxc有没有软连接上

lxc -h
+

如果报错则执行以下命令软连接lxc命令

! lxc -h >/dev/null 2>&1 && echo 'alias lxc="/snap/bin/lxc"' >> /root/.bashrc && source /root/.bashrc
+export PATH=$PATH:/snap/bin
+

连接后再测试lxc命令是否有报错找不到

一键安装

TIP

如果是全新的服务器,务必保证apt update和apt install curl都无问题再执行本脚本 且自开机起最好等待5分钟后再执行以下命令,避免系统默认设置中就执行了本脚本导致apt源卡死

  • 环境要求:Ubuntu 18+(推荐),Debian 8+(仅限x86_64架构)

如果是Debian系的宿主机,务必在screen中执行本脚本,避免长期运行时SSH中断导致ZFS编译安装失败

这里的虚拟内存是说要开的SWAP大小,存储池则是你所有要开的小鸡占的盘的大小的总和

环境安装过程中可能需要重启服务器再次执行以加载含zfs的内核,一切以运行后命令行的提示为准

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/lxdinstall.sh -o lxdinstall.sh && chmod +x lxdinstall.sh && bash lxdinstall.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/lxdinstall.sh -o lxdinstall.sh && chmod +x lxdinstall.sh && bash lxdinstall.sh
+

例子:

如果系统盘除去已占用空间还有18G硬盘空余,想开2G虚拟内存(2048MB的SWAP),15G的存储池,按照命令行的提示则依次输入204815

+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/lxd_lxc.html b/docs/.vitepress/dist/en_US/guide/lxd_lxc.html new file mode 100644 index 0000000000..166ca3a4b2 --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/lxd_lxc.html @@ -0,0 +1,53 @@ + + + + + + 普通的批量版本 | One Click Virtualization Project + + + + + + + + + + +

普通的批量版本

开出的小鸡配置:

  • 1核256MB内存1GB硬盘限速250Mbps带宽
  • 带1个SSH端口,25个外网端口
  • 默认内存和硬盘大小

TIP

lxc若命令无问题,执行初始化开小鸡,这一步最好放screen中后台挂起执行,开小鸡时长与你开几个和母鸡配置相关

执行下面命令加载开机脚本

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/init.sh -o init.sh && chmod +x init.sh && dos2unix init.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/init.sh -o init.sh && chmod +x init.sh && dos2unix init.sh
+

下面命令为开小鸡名字前缀为tj10个小鸡

./init.sh tj 10
+

有时候init.sh的运行路径有问题,此时建议前面加上sudo强制根目录执行

只有一个SSH端口的版本

开出的小鸡配置:

  • 1核128MB内存300MB硬盘限速200Mbps带宽
  • 只有一个SSH端口
  • 无法挂载warp

TIP

lxc若命令无问题,执行初始化开小鸡,这一步最好放screen中后台挂起执行,开小鸡时长与你开几个和母鸡配置相关

加载开机脚本

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/least.sh -o least.sh && chmod +x least.sh && dos2unix least.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/least.sh -o least.sh && chmod +x least.sh && dos2unix least.sh
+

下列命令最后一行为开小鸡名字前缀为tj10个小鸡

./least.sh tj 10
+

有时候least.sh的运行路径有问题,此时建议前面加上sudo强制根目录执行

查看已批量开设的信息

开完小鸡后,具体信息会生成在当前目录下的log文件中,格式如下

1号服务器名称 密码 ssh端口 外网端口起始 外网端口终止
+2号服务器名称 密码 ssh端口 外网端口起始 外网端口终止
+

如果想要查看,只需在当前目录执行以下命令打印log文件即可

cat log
+

::warning 不要拿该脚本开出的小鸡当生产环境,LXC虚拟化不支持换内核,dd,开启bbr等操作 ::

部分常用LXD命令

查看所有

lxc list
+

查看个例

lxc info 服务器名字
+

启动个例

lxc start 服务器名字
+

停止个例

lxc stop 服务器名字
+

删除个例

lxc delete -f 服务器名字
+

进入内部

lxc exec 服务器名字 /bin/bash
+

退出则输入exit回车即可

删除所有LXC容器

lxc list | awk '{print $2}' | grep -v "^$" | xargs -I {} lxc delete -f {}
+

在容器内执行删除无用日志

sudo apt-get autoremove
+sudo apt-get clean
+sudo find /var/log -type f -delete
+sudo find /var/tmp -type f -delete
+sudo find /tmp -type f -delete
+sudo find /var/cache/apt/archives -type f -delete
+

一键脚本老手推荐方便快捷

  • 只生成一个NAT服务器,可自定义限制所有内容

只开一个NAT服务器

下载开机脚本

  • (非必须,如果你使用过一键安装LXD的命令,自动已下载对应的开机脚本,不用下载该脚本)

国际

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/buildone.sh -o buildone.sh && chmod +x buildone.sh && dos2unix buildone.sh
+

国内

curl -L https://ghproxy.com/https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/buildone.sh -o buildone.sh && chmod +x buildone.sh && dos2unix buildone.sh
+
开NAT服务器

内存大小以MB计算,硬盘大小以GB计算,下载速度上传速度以Mbit计算,是否启用IPV6不一定要填Y或者N,没有这个参数也行

如果外网起端口外网止端口都设置为0则不做区间外网端口映射了,只映射基础的SSH端口,注意不能为空,不进行映射需要设置为0

支持自定义小鸡的系统,注意传入参数为系统名字+版本号,如:debian11、ubuntu20,centos8,注意都是小写字母+数字的组合

./buildone.sh 小鸡名称 内存大小 硬盘大小 SSH端口 外网起端口 外网止端口 下载速度 上传速度 是否启用IPV6(Y or N) 系统(留空则为debian11)
+

示例

./buildone.sh test 256 2 20001 20002 20025 300 300 N
+
  • 以下为开设的示例小鸡的信息:
    小鸡名字 - test SSH登录的用户名 - root SSH登录的密码 - 随机生成 CPU核数 - 1
    内存大小 - 256MB 磁盘大小 - 2G
    内外网映射端口一致的区间 - 20002到20025 上传带宽 - 300Mbit 下载带宽 - 300Mbit 自动设置外网IPV6地址 - N 系统 - debian11

需要查看信息则执行

cat 小鸡名字
+

比如查询示例的信息就是

cat test
+

如果已通过以上方法生成过小鸡,还需要批量生成小鸡,可使用手动安装部分的脚本,但注意先删除测试小鸡再进行批量生成小鸡

删除测试小鸡

lxc delete -f test
+rm -rf test
+ls
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/lxd_precheck.html b/docs/.vitepress/dist/en_US/guide/lxd_precheck.html new file mode 100644 index 0000000000..e742b3a366 --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/lxd_precheck.html @@ -0,0 +1,23 @@ + + + + + + 配置要求 | One Click Virtualization Project + + + + + + + + + + +

配置要求

硬件要求:

  • 系统:Debian 8+, Ubuntu 18+(推荐),系统越新越好
  • 虚拟化:推荐KVM、VMWARE虚拟化
  • 内存:内存至少512MB
  • 硬盘:硬盘(系统盘)至少10G
  • 网络:独立的IPV4地址,IPV6可有可无,带宽能下载脚本就行,网络能连接Github的raw页面就行

PS: 如果硬件非常好资源很多,可使用PVE批量开KVM虚拟化的虚拟机 跳转

PS: 如果硬件资源更烂,虚拟化不支持,可使用docker版本的,适配面更广 跳转

项目特点

  • 本套脚本开发使用的Ubuntu20,Ubuntu别的长期维护版本应该也没问题,Debian无法使用zfs时自动切换别的存储类型

  • 已设置同时进行TCP和UDP转发,除了SSH端口其他的映射内网外网端口一致

  • 已设置支持开出的LXC容器进行docker嵌套虚拟,默认普通版本和纯探针版本使用debian11系统

  • 已屏蔽容器内可能用于滥用的工具包和IPV4网络的TCP/UDP协议的端口( 3389 8888 54321 65432 ),以防止容器被用于扫描和爆破,且可外置进程检查有问题自动停机

  • 已支持一键为LXC容器配置IPV6地址(前提是母鸡有IPV6子网,无IPV6地址则不配置)

  • 一定要在 /root 的路径下运行本仓库脚本,且使用一键脚本不要删除路径下的ssh.shconfig.sh文件

  • 保证你要开的盘为默认的系统盘(sda或者sda1)而不是挂载的盘(sdb之类的),不确定的使用fdisk -ldf查看

  • 挂载其他盘的详看 其他说明

  • 一键脚本支持自定义限制所有内容,普通版本支持多次运行批量生成不覆盖先前生成的配置

检测环境

使用后续脚本的务必执行本命令检测母鸡是否符合要求

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/pre_check.sh)
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/lxd_qa.html b/docs/.vitepress/dist/en_US/guide/lxd_qa.html new file mode 100644 index 0000000000..b89f7ed5cb --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/lxd_qa.html @@ -0,0 +1,22 @@ + + + + + + 目前已验证可开带独立IPV6地址容器的VPS商家 | One Click Virtualization Project + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/lxd_thanks.html b/docs/.vitepress/dist/en_US/guide/lxd_thanks.html new file mode 100644 index 0000000000..b4ea819656 --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/lxd_thanks.html @@ -0,0 +1,22 @@ + + + + + + 致谢 | One Click Virtualization Project + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/pve_install.html b/docs/.vitepress/dist/en_US/guide/pve_install.html new file mode 100644 index 0000000000..b262bb9f0a --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/pve_install.html @@ -0,0 +1,28 @@ + + + + + + 一键安装PVE | One Click Virtualization Project + + + + + + + + + + +

一键安装PVE

  • 安装的是当下apt源最新的PVE
  • 比如debian10则是pve6.4,debian11则是pve7.x,debian12则是pve8.x

TIP

建议debian11而不是debian12,因为后者是beta版本,debian11安装的才是稳定版

  • /etc/hosts文件修改(修正商家hostname设置错误以及新增PVE所需的内容)
  • 已设置/etc/hosts为只读模式,避免重启后文件被覆写,如需修改请使用chattr -i /etc/hosts取消只读锁定,修改完毕请执行chattr +i /etc/hosts只读锁定
  • 检测/etc/cloud/cloud.cfg如果发现preserve_hostnamefalse,则改为true,同上,也用chattr命令进行了文件锁定避免重启覆盖设置
  • 检测是否为中国IP,如果为中国IP使用清华镜像源,否则使用官方源
  • 安装PVE开虚拟机需要的必备工具包
  • 替换apt源中的企业订阅为社区源
  • 打印查询Linux系统内核和PVE内核是否已安装
  • 检测/etc/resolv.conf是否为空,为空则设置检测8.8.8.8的开机自启添加DNS的systemd服务
  • 新增PVE的APT源链接后,下载PVE并打印输出登陆信息

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/install_pve.sh -o install_pve.sh && chmod +x install_pve.sh && bash install_pve.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/install_pve.sh -o install_pve.sh && chmod +x install_pve.sh && bash install_pve.sh
+

预配置环境

  • 创建资源池mypool
  • 移除订阅弹窗
  • 尝试开启硬件直通
  • 检测AppArmor模块并试图安装
  • 重启系统前推荐挂上nezha探针方便在后台不通过SSH使用命令行,避免SSH可能因为商家奇葩的预设导致重启后root密码丢失
  • 执行完毕建议等待几分钟后再重启服务器,执行reboot前需要等待后台任务执行完毕,一些宿主机的系统apt命令执行很慢,得等一会才能执行完毕

国际

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_backend.sh)
+

国内

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_backend.sh)
+

自动配置宿主机的网关

WARNING

使用前请保证重启过服务器且此时PVE能正常使用WEB端再执行,重启机器后不要立即执行此命令,待WEB端启动成功后至少等5分钟再执行本命令

TIP

这一步是最容易造成SSH断开的,原因是未等待PVE内核启动就修改网络会造成设置冲突,所以至少等几分钟待内核启动也就是WEB端启动成功后再执行

  • 创建vmbr0,母鸡允许addr和gateway为内网IP或外网IP,已自动识别
  • vmbr0创建支持纯IPV4或双栈服务器,自动识别IPV4地址和IPV6地址,自动识别对应的IP区间
  • 创建vmbr1(NAT网关)
  • 开NAT虚拟机时网关(IPV4)使用172.16.1.1,IPV4/CIDR使用172.16.1.x/24,这里的x不能是1,当然如果后续使用本套脚本无需关注这点细枝末节的东西
  • 想查看完整设置可以执行cat /etc/network/interfaces查看
  • 加载iptables并设置回源且允许NAT端口转发

国际

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_nat_network.sh)
+

国内

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_nat_network.sh)
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/pve_kvm.html b/docs/.vitepress/dist/en_US/guide/pve_kvm.html new file mode 100644 index 0000000000..4097a5f25b --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/pve_kvm.html @@ -0,0 +1,48 @@ + + + + + + 部分注意事项 | One Click Virtualization Project + + + + + + + + + + +

部分注意事项

执行本项目的第一个检测环境的命令,展示如下


![coode](./images/pve_kvm/pve_kvm_1.png)

查询如上的只需使用下面的一键脚本自动创建虚拟机即可,无需手动再修改WEB端设置


![coode](./images/pve_kvm/pve_kvm_2.png)

查询如上的在使用后续脚本创建了虚拟机后,可能需要手动修改WEB端设置,需要关闭对应每个虚拟机的硬件嵌套虚拟化,如下图


![coode](./images/pve_kvm/pve_kvm_3.png)

先停止虚拟机再修改,修改完后再开机才能使用NOVNC,不关闭可能导致这个虚拟机有BUG无法使用

如果强行安装PVE开KVM,启动不了的也可以关闭这个选项试试能不能启动虚拟机

单独开设KVM虚拟化的VM

  • 自动开设NAT服务器,默认使用Debian10镜像,因为该镜像占用最小
  • 可在命令中自定义需要使用的镜像,这里有给出配置好的镜像,镜像自带空间设置是2~10G硬盘,日常使用至少10G以上即可,除非某些镜像开不起来再增加硬盘大小
  • 可在命令中指定存储盘位置,默认不指定时为local盘即系统盘,可指定为PVE中显示的挂载盘
  • 自定义内存大小推荐512MB内存

TIP

需要注意的是宿主机内存记得开点swap免得机器炸了开SWAP点我跳转

  • 自动进行内外网端口映射,含22,80,443端口以及其他25个内外网端口号一样的端口
  • 生成后需要等待一段时间虚拟机内部的cloud-init配置好网络以及登陆信息,大概需要5分钟
  • 虚拟机的相关信息将会存储到WEB端对应VM的NOTES中,可在WEB端查看

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm.sh -o buildvm.sh && chmod +x buildvm.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm.sh -o buildvm.sh && chmod +x buildvm.sh
+

使用方法

  • 系统支持:详见 跳转 中列出的系统,使用时只需写文件名字,不需要.qcow2尾缀

TIP

注意这里的用户名不能是纯数字,会造成cloudinit出问题,最好是纯英文或英文开头

./buildvm.sh VMID 用户名 密码 CPU核数 内存 硬盘 SSH端口 80端口 443端口 外网端口起 外网端口止 系统 存储盘
+

测试示例

  • 以下为开设的示例VM的信息:
    VMID - 102 SSH登录的用户名 - test1 SSH登录的密码 - 1234567 CPU核数 - 1
    内存大小 - 512MB 磁盘大小 - 10G
    SSH端口 - 40001 80端口 - 40002 443端口 - 40003 内外网映射端口一致的区间 - 50000到50025 系统 - ubuntu20 宿主机的存储盘 - local
./buildvm.sh 102 test1 1234567 1 512 10 40001 40002 40003 50000 50025 ubuntu20 local
+

开设完毕可执行cat vm102查看信息,或到WEB端对应VM的NOTES中查看

删除示例

  • 停止VM
  • 删除VM
  • 删除端口映射
  • 重启网络
  • 删除log文件
qm stop 102
+qm destroy 102
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+rm -rf vm102
+

相关qcow2镜像

  • 已预安装开启cloudinit,开启SSH登陆,预设值SSH监听V4和V6的22端口,开启允许密码验证登陆,开启允许ROOT登陆

目前使用的镜像列表为

https://github.com/spiritLHLS/Images/releases/tag/v1.0

批量开设NAT的KVM虚拟化的VM

WARNING

初次使用前需要保证当前PVE纯净且宿主机未进行过任何端口映射,否则设置冲突可能出现BUG 开设前请使用screen挂起执行,避免批量开设时间过长,SSH不稳定导致中间执行中断

  • 可多次运行批量生成VM
  • 自动开设NAT服务器,选项留空默认使用debian11镜像,可自定义使用镜像名字,支持的系统名字详见上文支持的镜像列表
  • 自动进行内外网端口映射,含22,80,443端口以及其他25个内外网端口号一样的端口
  • 生成后需要等待一段时间虚拟机内部的cloudinit配置好网络以及登陆信息,大概需要5分钟,每个虚拟机创建之间有间隔等待60秒避免突发性能不足
  • 默认批量开设的虚拟机网络配置为:22,80,443端口及一个25个端口区间的内外网映射
  • 可自定义批量开设的核心数,内存大小,硬盘大小,使用宿主机哪个存储盘,记得自己计算好空闲资源开设
  • 虚拟机的相关信息将会存储到WEB端对应VM的NOTES中,可在WEB端查看

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_vm.sh -o create_vm.sh && chmod +x create_vm.sh && bash create_vm.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_vm.sh -o create_vm.sh && chmod +x create_vm.sh && bash create_vm.sh
+

开设完毕可执行cat vmlog查看信息,或到WEB端对应VM的NOTES中查看

删除所有VM

  • 删除所有VM
  • 删除所有nat的端口映射
  • 重启网络
  • 删除log文件
for vmid in $(qm list | awk '{if(NR>1) print $1}'); do qm stop $vmid; qm destroy $vmid; rm -rf /var/lib/vz/images/$vmid*; done
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+rm -rf vmlog
+

TIP

PVE修改VM配置前都得停机先,再修改配置,修改完再启动,免得出现配置重载错误

开设独立IPV4地址的VM

WARNING

使用前需要保证当前宿主机的IP段带了至少2个IP,且有空余的IP未配置,该空余的IP未绑定宿主机 开设前请使用screen挂起执行,避免开设时间过长,SSH不稳定导致中间执行中断

  • 自动检测可用的IP区间,通过ping检测空余可使用的IP,选取其中之一绑定到虚拟机上
  • 系统的相关信息将会存储到对应的虚拟机的NOTE中,可在WEB端查看

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm_extraip.sh -o buildvm_extraip.sh && chmod +x buildvm_extraip.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm_extraip.sh -o buildvm_extraip.sh && chmod +x buildvm_extraip.sh
+

创建示例

./buildvm_extraip.sh VMID 用户名 密码 CPU核数 内存大小以MB计算 硬盘大小以GB计算 系统 存储盘
+
./buildvm_extraip.sh 152 test1 1234567 1 1024 10 ubuntu20 local
+

上述命令意义为开设一个带独立IPV4地址的虚拟机,VMID是152,用户名是test1,密码是1234567,CPU是1核,内存是1024MB,硬盘是10G,系统是Ubuntu20,存储盘是local盘也就是系统盘

删除示例

qm stop 152
+qm destroy 152
+rm -rf vm152
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/pve_lxc.html b/docs/.vitepress/dist/en_US/guide/pve_lxc.html new file mode 100644 index 0000000000..6aaf3507ea --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/pve_lxc.html @@ -0,0 +1,41 @@ + + + + + + 单独开设LXC虚拟化的CT | One Click Virtualization Project + + + + + + + + + + +

单独开设LXC虚拟化的CT

WARNING

初次使用前需要保证当前PVE纯净且宿主机未进行过任何端口映射,否则设置冲突可能出现BUG 开设前请使用screen挂起执行,避免批量开设时间过长,SSH不稳定导致中间执行中断

  • 自动开设NAT服务器,默认使用Debian11镜像,也可自定义系统
  • 自动进行内外网端口映射,含22,80,443端口以及其他25个内外网端口号一样的端口
  • 生成后需要等待一段时间虚拟机内部配置好网络以及登陆信息,大概需要3分钟
  • 默认开设的网络配置为:22,80,443端口及一个25个端口区间的内外网映射
  • 可自定义开设的核心数,内存大小,硬盘大小,使用宿主机哪个存储盘,记得自己计算好空闲资源开设
  • 可在命令中指定存储盘位置,默认不指定时为local盘即系统盘,可指定为PVE中显示的挂载盘
  • 开设的CT默认已启用SSH且允许root登陆,且已设置支持使用docker的嵌套虚拟化
  • 容器的相关信息将会存储到对应的容器的NOTE中,可在WEB端查看

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildct.sh -o buildct.sh && chmod +x buildct.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildct.sh -o buildct.sh && chmod +x buildct.sh
+

使用方法

  • 系统支持:debian10,debian11,ubuntu18,ubuntu20,ubuntu22,centos8,almalinux9等
  • 系统参数一律是小写的系统名字拼接版本号,具体可执行pveam available --section system查看可用的系统名字和版本号(注意脚本使用的参数只有小写的英文系统名字拼接版本号)
  • 其他系统可能支持可能不支持,自行测试
  • 默认用户名是root
./buildct.sh CTID 密码 CPU核数 内存 硬盘 SSH端口 80端口 443端口 外网端口起 外网端口止 系统 存储盘
+

测试示例

  • 以下为开设的示例CT的信息:
    VMID - 102 SSH登录的用户名 - root SSH登录的密码 - 1234567 CPU核数 - 1
    内存大小 - 512MB 磁盘大小 - 5G
    SSH端口 - 20001 80端口 - 20002 443端口 - 20003 内外网映射端口一致的区间 - 30000到30025 系统 - debian11 宿主机的存储盘 - local
./buildct.sh 102 1234567 1 512 5 20001 20002 20003 30000 30025 debian11 local
+

开设完毕可执行cat ct102查看信息,或在web端的NOTES查看

删除示例

  • 停止CT
  • 删除CT
  • 删除端口映射
  • 重启网络
  • 删除log文件
pct stop 102
+pct destroy 102
+rm -rf ct102
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+

批量开设NAT的LXC虚拟化的CT

WARNING

初次使用前需要保证当前PVE纯净且宿主机未进行过任何端口映射,否则设置冲突可能出现BUG 开设前请使用screen挂起执行,避免批量开设时间过长,SSH不稳定导致中间执行中断

  • 可多次运行批量生成CT容器,但需要注意的是母鸡内存记得开点swap免得机器炸了开SWAP点我跳转
  • 每个容器创建之间有间隔等待60秒避免突发性能不足
  • 可自定义批量开设的核心数,内存大小,硬盘大小,使用宿主机哪个存储盘,记得自己计算好空闲资源开设
  • 开设的CT默认已启用SSH且允许root登陆,且已设置支持使用docker的嵌套虚拟化
  • 容器的相关信息将会存储到对应的容器的NOTE中,可在WEB端查看

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_ct.sh -o create_ct.sh && chmod +x create_ct.sh && bash create_ct.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_ct.sh -o create_ct.sh && chmod +x create_ct.sh && bash create_ct.sh
+

开设完毕可执行cat ctlog查看信息,或在web端的NOTES查看

删除所有CT

  • 删除所有CT
  • 删除所有nat的端口映射
  • 重启网络
  • 删除log文件
pct list | awk 'NR>1{print $1}' | xargs -I {} sh -c 'pct stop {}; pct destroy {}'
+rm -rf ct*
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/pve_precheck.html b/docs/.vitepress/dist/en_US/guide/pve_precheck.html new file mode 100644 index 0000000000..67b5f2074b --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/pve_precheck.html @@ -0,0 +1,24 @@ + + + + + + 系统要求与配置 | One Click Virtualization Project + + + + + + + + + + +

系统要求与配置

各种要求

建议debian在使用前尽量使用最新的稳定版本的系统

非debian11可使用 debian一键升级 来升级系统

本项目只适配Debian系统(非Debian无法通过APT源安装,官方只给了Debian的镜像,其他系统只能使用ISO安装)

  • 系统要求:Debian 8+ ::tip 建议debian11而不是debian12,因为后者是beta版本,debian11安装的才是稳定版 ::
  • 硬件要求:2核2G内存x86_64架构服务器硬盘至少20G ::warning 内存开点swap免得机器炸了开SWAP点我跳转 ::
  • 可开KVM的硬件要求:VM-X或AMD-V支持 (部分VPS和全部独服支持)
  • 如果硬件或系统需求不满足,可使用LXD批量开LXC容器跳转

遇到选项不会选的可无脑回车安装,本项目所有脚本内置国内外IP自动判断,使用的是不同的安装源与配置文件,有使用CDN加速镜像下载

检测环境

  • 本项目相关脚本执行前务必执行本脚本检测环境,如果不符合安装PVE的要求则无法使用后续的脚本
  • 检测硬件配置是否满足最低要求
  • 检测硬件环境是否可嵌套虚拟化KVM类型的服务器
  • 检测系统环境是否可嵌套虚拟化KVM类型的服务器
  • 不可嵌套虚拟化KVM类型的服务器也可以开LXC虚拟化的服务器,但不推荐安装PVE,不如使用LXD

国际

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/check_kernal.sh)
+

国内

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/check_kernal.sh)
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/pve_qa.html b/docs/.vitepress/dist/en_US/guide/pve_qa.html new file mode 100644 index 0000000000..3b04227d23 --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/pve_qa.html @@ -0,0 +1,22 @@ + + + + + + 目前已验证的VPS商家 | One Click Virtualization Project + + + + + + + + + + +

目前已验证的VPS商家

可开设KVM虚拟化的NAT的商家

nocix 中的特价最低配15美元独服 (IPV6不自带,需要找客服要)

amhost 中的测试款

digitalocean 中的 Perminu Intel 和 Regular 4核款

skrime 中的 AMD Ryzen KVM Server 最低配款

webdock 中的 AMD KVM Server

4vps 中的 俄罗斯和希腊 测试款

hostaris 中的 德国款 (商家的系统模板有问题,IPV6已失效和Github的连通稳定性很差)

只可开设LXC虚拟化的NAT的商家

腾讯云 中的无忧款和特惠款(学生机)

spectraip 中的KVM服务器

已知无法直接安装PVE的商家

hetzner 需要救援系统安装纯净的Debian,默认网络设置有冲突

hosthatch 默认网络设置有问题

+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/guide/pve_thanks.html b/docs/.vitepress/dist/en_US/guide/pve_thanks.html new file mode 100644 index 0000000000..7acdbd8b69 --- /dev/null +++ b/docs/.vitepress/dist/en_US/guide/pve_thanks.html @@ -0,0 +1,22 @@ + + + + + + 致谢 | One Click Virtualization Project + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/en_US/index.html b/docs/.vitepress/dist/en_US/index.html new file mode 100644 index 0000000000..7fae44ec59 --- /dev/null +++ b/docs/.vitepress/dist/en_US/index.html @@ -0,0 +1,22 @@ + + + + + + One Click Virtualization Project + + + + + + + + + + +

One Click Virtualization Project

Open source, easy to use server virtualization project

One Click Use

Support one-click script installation and use to easily create virtual machines/containers on servers using each virtualization

Based on mainstream systems development

Based on Debian, Ubuntu long-term maintenance version, if you want to use it, please try to ensure that the host system and the development environment are the same

Comes with internal and external port forwarding

Support automatic intranet port forwarding, including TCP and UDP protocols, without manual management

Batch Virtualization

Support for KVM, LXC, Docker virtualization batch opening of virtual machines/containers

Multisystem support

Virtual machines/containers already support multiple systems, covering almost all major systems

Self-limiting abuse

Partially virtual machines/containers have been masked and loaded with restrictions to avoid being used for abuse

Documentation has not been translated yet, waiting for translation.


This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Copyright © 2023-present oneclickvirt

+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/dashboard.html b/docs/.vitepress/dist/guide/dashboard.html new file mode 100644 index 0000000000..7d2a822da5 --- /dev/null +++ b/docs/.vitepress/dist/guide/dashboard.html @@ -0,0 +1,22 @@ + + + + + + 准备工作 | 一键虚拟化项目 + + + + + + + + + + +

准备工作

需要虚拟化出服务器,你需要:

  1. 一台可以连接公网的服务器( VPS 或 Dedicated Server),最好能完美访问 Github 的 RAW 页面,部分项目部分组件可能未使用 CDN 加速

TIP

如果您位于中国大陆,访问 Github 有困难,请注意配套脚本和项目是否有说明已使用 CDN 加速

  1. 本地可以稳定连接SSH,如果不能稳定连接,请使用screen命令创建窗口后,在窗口内执行命令

TIP

不会用screen命令的,自行查找相关教程学习

  1. 确保服务器的系统和硬件满足对应项目的要求,详见对应项目说明

本文档将以VPS作为范例,且该VPS纯净,无原生环境问题,如有必要请重装系统保证初始环境的纯净

WARNING

PVE项目可能造成宿主机出现问题,如果你不会看Bug和修复系统,那么不建议你在生产环境中使用,使用PVE相关脚本请确保宿主机随时可重装系统

项目仓库

欢迎Star和Fork

PVE相关的各种一键脚本

https://github.com/spiritLHLS/pve

通过LXD/LXC命令批量或单独开设NAT服务器以及维护

https://github.com/spiritLHLS/lxc

通过docker批量或单独开设NAT服务器

https://github.com/spiritLHLS/docker



+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/dashboardq.html b/docs/.vitepress/dist/guide/dashboardq.html new file mode 100644 index 0000000000..0aab7398e6 --- /dev/null +++ b/docs/.vitepress/dist/guide/dashboardq.html @@ -0,0 +1,23 @@ + + + + + + 一键虚拟化项目 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/docker_build.html b/docs/.vitepress/dist/guide/docker_build.html new file mode 100644 index 0000000000..c9545e759b --- /dev/null +++ b/docs/.vitepress/dist/guide/docker_build.html @@ -0,0 +1,39 @@ + + + + + + 单独开设 | 一键虚拟化项目 + + + + + + + + + + +

单独开设

下载脚本

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/onedocker.sh -o onedocker.sh && chmod +x onedocker.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/onedocker.sh -o onedocker.sh && chmod +x onedocker.sh
+

运行

./onedocker.sh name cpu memory password sshport startport endport system
+

目前system仅支持选择alpine或debian,默认是debian

示例

  • 以下为开设的示例容器的信息:
    容器名字 - test SSH登录的用户名 - root SSH登录的密码 - 123456 CPU核数 - 1
    内存大小 - 512MB SSH端口 - 25000 内外网映射端口一致的区间 - 34975到35000 系统 - debian
./onedocker.sh test 1 512 123456 25000 34975 35000 debian
+

删除示例

docker rm -f test
+rm -rf test
+ls
+

进入示例

docker exec -it test /bin/bash
+

要退出容器就执行exit退出。

查询信息

cat 容器名字
+

输出格式

容器名字 SSH端口 登陆的root密码 核数 内存 外网端口起 外网端口止 
+

批量开设

  • 批量多次运行继承配置生成
  • 生成多个时为避免SSH连接中断建议在screen中执行

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/dockers.sh -o dockers.sh && chmod +x dockers.sh && bash dockers.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/onedocker.sh -o onedocker.sh && chmod +x onedocker.sh
+

查询批量开设的信息

cat dclog
+

输出格式

容器名字 SSH端口 登陆的root密码 核数 内存 外网端口起 外网端口止 
+

一行一个容器对应的信息

卸载所有docker容器和镜像

docker rm -f $(docker ps -aq); docker rmi $(docker images -aq)
+rm -rf dclog
+ls
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/docker_install.html b/docs/.vitepress/dist/guide/docker_install.html new file mode 100644 index 0000000000..12e782f37e --- /dev/null +++ b/docs/.vitepress/dist/guide/docker_install.html @@ -0,0 +1,24 @@ + + + + + + 环境预设 | 一键虚拟化项目 + + + + + + + + + + +

环境预设

  • 检测环境
  • 安装docker
  • 下载预制脚本

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/pre_build.sh -o pre_build.sh && chmod +x pre_build.sh && bash pre_build.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/docker/main/scripts/pre_build.sh -o pre_build.sh && chmod +x pre_build.sh && bash pre_build.sh
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/docker_precheck.html b/docs/.vitepress/dist/guide/docker_precheck.html new file mode 100644 index 0000000000..91af272329 --- /dev/null +++ b/docs/.vitepress/dist/guide/docker_precheck.html @@ -0,0 +1,22 @@ + + + + + + 项目特点 | 一键虚拟化项目 + + + + + + + + + + +

项目特点

通过docker批量或单独开设NAT服务器(Bulk or individual NAT server provisioning via docker)

默认使用debian系统,每个容器自带1个外网ssh端口,25个内外网一致端口

默认创建的是非特权容器,且不挂载与宿主机的docker的守护进程之间的通信,所以宿主机创建的docker虚拟化的NAT服务器内无法再嵌套虚拟化docker

由于只是在宿主机进行了CPU和内存的限制未在容器内使用cgroup驱动,所以在容器内使用服务器测试脚本检测容器的可用资源是无效的,显示的会是宿主机的资源

由于大部分云服务器xfs文件系统不启用pquota选项,所以默认共享宿主机硬盘,无法限制每个容器的磁盘大小

配置要求

系统可安装docker即可用,网络能连接Github的raw界面就能用,硬件配置只要不拉跨就行,空闲硬盘有3G就行

推荐在开设NAT服务器前先增加部分SWAP虚拟内存,避免突发的内存占用导致母鸡卡死 跳转

PS: 如果硬件资源只是好了一点,需要限制更多东西并需要配置IPV6独立地址和限制硬盘大小,可使用LXD批量开LXC虚拟化的容器 跳转

PS: 如果硬件非常好资源很多,可使用PVE批量开KVM虚拟化的虚拟机 跳转

+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/docker_qa.html b/docs/.vitepress/dist/guide/docker_qa.html new file mode 100644 index 0000000000..8d05902e13 --- /dev/null +++ b/docs/.vitepress/dist/guide/docker_qa.html @@ -0,0 +1,22 @@ + + + + + + 一键虚拟化项目 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/docker_thanks.html b/docs/.vitepress/dist/guide/docker_thanks.html new file mode 100644 index 0000000000..1fb3a7b9af --- /dev/null +++ b/docs/.vitepress/dist/guide/docker_thanks.html @@ -0,0 +1,22 @@ + + + + + + 一键虚拟化项目 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/lxd_extra_config.html b/docs/.vitepress/dist/guide/lxd_extra_config.html new file mode 100644 index 0000000000..b800f853f3 --- /dev/null +++ b/docs/.vitepress/dist/guide/lxd_extra_config.html @@ -0,0 +1,46 @@ + + + + + + 其他自定义配置 | 一键虚拟化项目 + + + + + + + + + + +

其他自定义配置

TIP

以下的配置安装会加重母鸡的负担,非必要不要安装

TIP

如果是个人使用,可忽略防滥用部分脚本的安装

自动配置IPV6地址

  • (非必须,不使用的也没问题)
  • 该脚本仅适用于母鸡有给IPV6子网且是/64的,且母鸡绑定了子网的第一个IP母鸡的IPV6地址或IPV6的gateway
  • 自动为LXD创建的LXC容器配置IPV6地址
  • 已集成到buildone.sh中可使用变量控制且无需事先下载,该脚本可不手动使用,在使用buildone.sh时配置Y开启即可

下载脚本

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_ipv6_network.sh -o build_ipv6_network.sh && chmod +x build_ipv6_network.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_ipv6_network.sh -o build_ipv6_network.sh && chmod +x build_ipv6_network.sh
+

自动为容器配置IPV6映射地址

bash build_ipv6_network.sh 容器名称
+

映射完毕会打印信息

示例(给test容器自动配置IPV6地址,配置完成会写入一个test_v6的文件信息)

bash build_ipv6_network.sh test
+

删除所有IPV6已映射的规则

ip6tables -t nat -F PREROUTING
+ip6tables-legacy -t nat -F PREROUTING
+ip6tables-save > /etc/iptables/rules.v6
+netfilter-persistent save
+netfilter-persistent reload
+service netfilter-persistent restart
+

卸载IPV6地址绑定的守护进程和对应的文件

systemctl stop add-ipv6.service
+systemctl disable add-ipv6.service
+rm /etc/systemd/system/add-ipv6.service
+systemctl daemon-reload
+rm /usr/local/bin/add-ipv6.sh
+

屏蔽容易被滥用的端口的出入流量以屏蔽端口和屏蔽滥用工具包

  • (非必须,该脚本仅仅是为了防止容器滥用方便,不装的也没问题)
  • 事前预防

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/rules.sh -o rules.sh && chmod +x rules.sh && bash rules.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/rules.sh -o rules.sh && chmod +x rules.sh && bash rules.sh
+

使用screen配置监控屏蔽某些进程的执行遇到某些进程的出现直接关闭容器

  • 如需停止监控可使用screen命令停止lxc_moniter这个名字的窗口并删除
  • (非必须,该脚本仅仅是为了防止容器滥用方便,不装的也没问题)
  • 事后停机

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_monitor.sh -o build_monitor.sh && chmod +x build_monitor.sh && bash build_monitor.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/build_monitor.sh -o build_monitor.sh && chmod +x build_monitor.sh && bash build_monitor.sh
+

一键安装开lxd母鸡所需要的带vnstat环境的常用预配置环境

  • (非必须,该脚本仅仅是为了站点对接监控方便,不装的也没问题)

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/backend.sh -o backend.sh && chmod +x backend.sh && bash backend.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/backend.sh -o backend.sh && chmod +x backend.sh && bash backend.sh
+

一键安装母鸡可视化操作的面板

  • (非必须,该面板只是为了方便可视化操作,没有也没问题)
  • 原作者仓库:跳转
lxc config set core.https_address [::]
+lxc config set core.trust_password some-secret-string
+snap install lxdmosaic
+

安装完毕后打开母鸡IP地址,按照提示设置admin的密码,其他一路默认就能使用面板了

+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/lxd_install.html b/docs/.vitepress/dist/guide/lxd_install.html new file mode 100644 index 0000000000..ccd85e0170 --- /dev/null +++ b/docs/.vitepress/dist/guide/lxd_install.html @@ -0,0 +1,36 @@ + + + + + + LXD主体安装 | 一键虚拟化项目 + + + + + + + + + + +

LXD主体安装

手动安装

新手推荐,避免有bug不知道怎么修,当然如果只是图方便又是老手懂排查BUG,用后面的一键安装也行

关闭防火墙

apt update
+apt install curl wget sudo dos2unix ufw jq -y
+ufw disable
+

开设虚拟内存SWAP

内存看你开多少小鸡,这里如果要开8个,换算需要2G内存,实际内存如果是512MB内存,还需要开1.5G,保守点开2G虚拟内存即可

执行下面命令,输入1,再输入2048,代表开2G虚拟内存

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/swap.sh -o swap.sh && chmod +x swap.sh && bash swap.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/swap.sh -o swap.sh && chmod +x swap.sh && bash swap.sh
+

安装LXD

实际swap开的虚拟内存应该是实际内存的2倍,也就是开1G是合理的,上面我描述的情况属于超开了

apt install snapd -y
+snap install lxd
+/snap/bin/lxd init
+

如果上面的命令中出现下面的错误

(snap "lxd" assumes unsupported features: snapd2.39 (try to update snapd and refresh the core snap))

使用命令修补后再进行lxd的安装

snap install core
+

如果无异常,上面三行命令执行结果如下

一般的选项回车默认即可

选择配置物理盘大小(提示默认最小1GB那个选项),一般我填空闲磁盘大小减去内存大小后乘以0.95并向下取整,这里我填了10GB

提示带auto的更新image的选项记得选no,避免更新占用系统

测试lxc有没有软连接上

lxc -h
+

如果报错则执行以下命令软连接lxc命令

! lxc -h >/dev/null 2>&1 && echo 'alias lxc="/snap/bin/lxc"' >> /root/.bashrc && source /root/.bashrc
+export PATH=$PATH:/snap/bin
+

连接后再测试lxc命令是否有报错找不到

一键安装

WARNING

如果是全新的服务器,务必保证apt update和apt install curl都无问题再执行本脚本

TIP

且自开机起最好等待5分钟后再执行以下命令,避免系统默认设置中就执行了本脚本导致apt源卡死

  • 环境要求:Ubuntu 18+(推荐),Debian 8+(仅限x86_64架构)

如果是Debian系的宿主机,务必在screen中执行本脚本,避免长期运行时SSH中断导致ZFS编译安装失败

这里的虚拟内存是说要开的SWAP大小,存储池则是你所有要开的小鸡占的盘的大小的总和

环境安装过程中可能需要重启服务器再次执行以加载含zfs的内核,一切以运行后命令行的提示为准

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/lxdinstall.sh -o lxdinstall.sh && chmod +x lxdinstall.sh && bash lxdinstall.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/lxdinstall.sh -o lxdinstall.sh && chmod +x lxdinstall.sh && bash lxdinstall.sh
+

例子:

如果系统盘除去已占用空间还有18G硬盘空余,想开2G虚拟内存(2048MB的SWAP),15G的存储池,按照命令行的提示则依次输入204815

+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/lxd_lxc.html b/docs/.vitepress/dist/guide/lxd_lxc.html new file mode 100644 index 0000000000..a708bc8794 --- /dev/null +++ b/docs/.vitepress/dist/guide/lxd_lxc.html @@ -0,0 +1,55 @@ + + + + + + LXC虚拟化 | 一键虚拟化项目 + + + + + + + + + + +

LXC虚拟化

普通版本批量生成

开出的小鸡配置:

  • 1核256MB内存1GB硬盘限速250Mbps带宽
  • 带1个SSH端口,25个外网端口
  • 默认内存和硬盘大小

TIP

lxc若命令无问题,执行初始化开小鸡,这一步最好放screen中后台挂起执行,开小鸡时长与你开几个和母鸡配置相关

执行下面命令加载开机脚本

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/init.sh -o init.sh && chmod +x init.sh && dos2unix init.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/init.sh -o init.sh && chmod +x init.sh && dos2unix init.sh
+

下面命令为开小鸡名字前缀为tj10个小鸡

./init.sh tj 10
+

有时候init.sh的运行路径有问题,此时建议前面加上sudo强制根目录执行

纯SSH端口版本批量生成

开出的小鸡配置:

  • 1核128MB内存300MB硬盘限速200Mbps带宽
  • 只有一个SSH端口
  • 无法挂载warp

TIP

lxc若命令无问题,执行初始化开小鸡,这一步最好放screen中后台挂起执行,开小鸡时长与你开几个和母鸡配置相关

加载开机脚本

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/least.sh -o least.sh && chmod +x least.sh && dos2unix least.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/least.sh -o least.sh && chmod +x least.sh && dos2unix least.sh
+

下列命令最后一行为开小鸡名字前缀为tj10个小鸡

./least.sh tj 10
+

有时候least.sh的运行路径有问题,此时建议前面加上sudo强制根目录执行

自定义版本批量生成

  • 可自定义内存和硬盘大小
  • 有执行过上面的手动批量生成过也没问题,配置是继承的不覆盖

如果需要多次批量生成小鸡,可使用

国际

curl -L https://github.com/spiritLHLS/lxc/raw/main/scripts/add_more.sh -o add_more.sh && chmod +x add_more.sh && bash add_more.sh
+

国内

curl -L https://ghproxy.com/https://github.com/spiritLHLS/lxc/raw/main/scripts/add_more.sh -o add_more.sh && chmod +x add_more.sh && bash add_more.sh
+

可多次运行批量生成小鸡,且继承前面已生成的部分在后面添加,可自定义内存和硬盘大小

查看已批量开设的信息

开完小鸡后,具体信息会生成在当前目录下的log文件中,格式如下

1号服务器名称 密码 ssh端口 外网端口起始 外网端口终止
+2号服务器名称 密码 ssh端口 外网端口起始 外网端口终止
+

如果想要查看,只需在当前目录执行以下命令打印log文件即可

cat log
+

WARNING

不要拿该脚本开出的小鸡当生产环境,LXC虚拟化不支持换内核,dd,开启bbr等操作

部分常用LXD命令

查看所有

lxc list
+

查看个例

lxc info 服务器名字
+

启动个例

lxc start 服务器名字
+

停止个例

lxc stop 服务器名字
+

删除个例

lxc delete -f 服务器名字
+

进入内部

lxc exec 服务器名字 /bin/bash
+

退出则输入exit回车即可

删除所有LXC容器

lxc list | awk '{print $2}' | grep -v "^$" | xargs -I {} lxc delete -f {}
+

在容器内执行删除无用日志

sudo apt-get autoremove
+sudo apt-get clean
+sudo find /var/log -type f -delete
+sudo find /var/tmp -type f -delete
+sudo find /tmp -type f -delete
+sudo find /var/cache/apt/archives -type f -delete
+

单独生成一个NAT服务器

  • 只生成一个NAT服务器,可自定义限制所有内容

下载开机脚本是非必须的,如果你使用过一键安装LXD的命令,自动已下载对应的开机脚本,不用下载该脚本

国际

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/buildone.sh -o buildone.sh && chmod +x buildone.sh && dos2unix buildone.sh
+

国内

curl -L https://ghproxy.com/https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/buildone.sh -o buildone.sh && chmod +x buildone.sh && dos2unix buildone.sh
+

使用方法

内存大小以MB计算,硬盘大小以GB计算,下载速度上传速度以Mbit计算,是否启用IPV6不一定要填Y或者N,没有这个参数也行

如果外网起端口外网止端口都设置为0则不做区间外网端口映射了,只映射基础的SSH端口,注意不能为空,不进行映射需要设置为0

支持自定义小鸡的系统,注意传入参数为系统名字+版本号,如:debian11、ubuntu20,centos8,注意都是小写字母+数字的组合

./buildone.sh 小鸡名称 内存大小 硬盘大小 SSH端口 外网起端口 外网止端口 下载速度 上传速度 是否启用IPV6(Y or N) 系统(留空则为debian11)
+

示例

./buildone.sh test 256 2 20001 20002 20025 300 300 N
+
  • 以下为开设的示例小鸡的信息:
    小鸡名字 - test SSH登录的用户名 - root SSH登录的密码 - 随机生成 CPU核数 - 1
    内存大小 - 256MB 磁盘大小 - 2G
    内外网映射端口一致的区间 - 20002到20025 上传带宽 - 300Mbit 下载带宽 - 300Mbit 自动设置外网IPV6地址 - N 系统 - debian11

需要查看信息则执行

cat 小鸡名字
+

比如查询示例的信息就是

cat test
+

如果已通过以上方法生成过小鸡,还需要批量生成小鸡,可使用手动安装部分的脚本,但注意先删除测试小鸡再进行批量生成小鸡

删除测试小鸡

lxc delete -f test
+rm -rf test
+ls
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/lxd_precheck.html b/docs/.vitepress/dist/guide/lxd_precheck.html new file mode 100644 index 0000000000..6c5df8df29 --- /dev/null +++ b/docs/.vitepress/dist/guide/lxd_precheck.html @@ -0,0 +1,24 @@ + + + + + + 系统与硬件配置要求 | 一键虚拟化项目 + + + + + + + + + + +

系统与硬件配置要求

要求

硬件要求:

  • 系统:Debian 8+, Ubuntu 18+(推荐),系统越新越好
  • 虚拟化:推荐KVM、VMWARE虚拟化
  • 内存:内存至少512MB
  • 硬盘:硬盘(系统盘)至少10G
  • 网络:独立的IPV4地址,IPV6可有可无,带宽能下载脚本就行,网络能连接Github的raw页面就行

PS: 如果硬件非常好资源很多,可使用PVE批量开KVM虚拟化的虚拟机 跳转

PS: 如果硬件资源更烂,虚拟化不支持,可使用docker版本的,适配面更广 跳转

项目特点

  • 本套脚本开发使用的Ubuntu20,Ubuntu别的长期维护版本应该也没问题,Debian无法使用zfs时自动切换别的存储类型

  • 已设置同时进行TCP和UDP转发,除了SSH端口其他的映射内网外网端口一致

  • 已设置支持开出的LXC容器进行docker嵌套虚拟,默认普通版本和纯探针版本使用debian11系统

  • 已屏蔽容器内可能用于滥用的工具包和IPV4网络的TCP/UDP协议的端口( 3389 8888 54321 65432 ),以防止容器被用于扫描和爆破,且可外置进程检查有问题自动停机

  • 已支持一键为LXC容器配置IPV6地址(前提是母鸡有IPV6子网,无IPV6地址则不配置)

  • 一定要在 /root 的路径下运行本仓库脚本,且使用一键脚本不要删除路径下的ssh.shconfig.sh文件

  • 保证你要开的盘为默认的系统盘(sda或者sda1)而不是挂载的盘(sdb之类的),不确定的使用fdisk -ldf查看

  • 挂载其他盘的详看 其他说明

  • 一键脚本支持自定义限制所有内容,普通版本支持多次运行批量生成不覆盖先前生成的配置

检测环境

使用后续脚本的务必执行本命令检测母鸡是否符合要求

国际

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/pre_check.sh)
+

国内

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/lxc/main/scripts/pre_check.sh)
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/lxd_qa.html b/docs/.vitepress/dist/guide/lxd_qa.html new file mode 100644 index 0000000000..b59272c46e --- /dev/null +++ b/docs/.vitepress/dist/guide/lxd_qa.html @@ -0,0 +1,22 @@ + + + + + + 目前已验证可开带独立IPV6地址容器的VPS商家 | 一键虚拟化项目 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/lxd_thanks.html b/docs/.vitepress/dist/guide/lxd_thanks.html new file mode 100644 index 0000000000..7ae217f48c --- /dev/null +++ b/docs/.vitepress/dist/guide/lxd_thanks.html @@ -0,0 +1,22 @@ + + + + + + 致谢 | 一键虚拟化项目 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/pve_install.html b/docs/.vitepress/dist/guide/pve_install.html new file mode 100644 index 0000000000..27a62c3348 --- /dev/null +++ b/docs/.vitepress/dist/guide/pve_install.html @@ -0,0 +1,28 @@ + + + + + + PVE主体安装 | 一键虚拟化项目 + + + + + + + + + + +

PVE主体安装

一键安装PVE

  • 安装的是当下apt源最新的PVE
  • 比如debian10则是pve6.4,debian11则是pve7.x,debian12则是pve8.x

TIP

建议debian11而不是debian12,因为后者是beta版本,debian11安装的才是稳定版

  • /etc/hosts文件修改(修正商家hostname设置错误以及新增PVE所需的内容)
  • 已设置/etc/hosts为只读模式,避免重启后文件被覆写,如需修改请使用chattr -i /etc/hosts取消只读锁定,修改完毕请执行chattr +i /etc/hosts只读锁定
  • 检测/etc/cloud/cloud.cfg如果发现preserve_hostnamefalse,则改为true,同上,也用chattr命令进行了文件锁定避免重启覆盖设置
  • 检测是否为中国IP,如果为中国IP使用清华镜像源,否则使用官方源
  • 安装PVE开虚拟机需要的必备工具包
  • 替换apt源中的企业订阅为社区源
  • 打印查询Linux系统内核和PVE内核是否已安装
  • 检测/etc/resolv.conf是否为空,为空则设置检测8.8.8.8的开机自启添加DNS的systemd服务
  • 新增PVE的APT源链接后,下载PVE并打印输出登陆信息

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/install_pve.sh -o install_pve.sh && chmod +x install_pve.sh && bash install_pve.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/install_pve.sh -o install_pve.sh && chmod +x install_pve.sh && bash install_pve.sh
+

预配置环境

  • 创建资源池mypool
  • 移除订阅弹窗
  • 尝试开启硬件直通
  • 检测AppArmor模块并试图安装
  • 重启系统前推荐挂上nezha探针方便在后台不通过SSH使用命令行,避免SSH可能因为商家奇葩的预设导致重启后root密码丢失
  • 执行完毕建议等待几分钟后再重启服务器,执行reboot前需要等待后台任务执行完毕,一些宿主机的系统apt命令执行很慢,得等一会才能执行完毕

国际

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_backend.sh)
+

国内

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_backend.sh)
+

自动配置宿主机的网关

WARNING

使用前请保证重启过服务器且此时PVE能正常使用WEB端再执行,重启机器后不要立即执行此命令,待WEB端启动成功后至少等5分钟再执行本命令

TIP

这一步是最容易造成SSH断开的,原因是未等待PVE内核启动就修改网络会造成设置冲突,所以至少等几分钟待内核启动也就是WEB端启动成功后再执行

  • 创建vmbr0,母鸡允许addr和gateway为内网IP或外网IP,已自动识别
  • vmbr0创建支持纯IPV4或双栈服务器,自动识别IPV4地址和IPV6地址,自动识别对应的IP区间
  • 创建vmbr1(NAT网关)
  • 开NAT虚拟机时网关(IPV4)使用172.16.1.1,IPV4/CIDR使用172.16.1.x/24,这里的x不能是1,当然如果后续使用本套脚本无需关注这点细枝末节的东西
  • 想查看完整设置可以执行cat /etc/network/interfaces查看
  • 加载iptables并设置回源且允许NAT端口转发

国际

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_nat_network.sh)
+

国内

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/build_nat_network.sh)
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/pve_kvm.html b/docs/.vitepress/dist/guide/pve_kvm.html new file mode 100644 index 0000000000..a72b6a5697 --- /dev/null +++ b/docs/.vitepress/dist/guide/pve_kvm.html @@ -0,0 +1,48 @@ + + + + + + KVM虚拟化 | 一键虚拟化项目 + + + + + + + + + + +

KVM虚拟化

部分注意事项

执行本项目的第一个检测环境的命令,展示如下

查询如上的只需使用下面的一键脚本自动创建虚拟机即可,无需手动再修改WEB端设置

查询如上的在使用后续脚本创建了虚拟机后,可能需要手动修改WEB端设置,需要关闭对应每个虚拟机的硬件嵌套虚拟化,如下图

先停止虚拟机再修改,修改完后再开机才能使用NOVNC,不关闭可能导致这个虚拟机有BUG无法使用

如果强行安装PVE开KVM,启动不了的也可以关闭这个选项试试能不能启动虚拟机

单独开设KVM虚拟化的VM

  • 自动开设NAT服务器,默认使用Debian10镜像,因为该镜像占用最小
  • 可在命令中自定义需要使用的镜像,这里有给出配置好的镜像,镜像自带空间设置是2~10G硬盘,日常使用至少10G以上即可,除非某些镜像开不起来再增加硬盘大小
  • 可在命令中指定存储盘位置,默认不指定时为local盘即系统盘,可指定为PVE中显示的挂载盘
  • 自定义内存大小推荐512MB内存

TIP

需要注意的是宿主机内存记得开点swap免得机器炸了开SWAP点我跳转

  • 自动进行内外网端口映射,含22,80,443端口以及其他25个内外网端口号一样的端口
  • 生成后需要等待一段时间虚拟机内部的cloud-init配置好网络以及登陆信息,大概需要5分钟
  • 虚拟机的相关信息将会存储到WEB端对应VM的NOTES中,可在WEB端查看

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm.sh -o buildvm.sh && chmod +x buildvm.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm.sh -o buildvm.sh && chmod +x buildvm.sh
+

使用方法

  • 系统支持:详见 跳转 中列出的系统,使用时只需写文件名字,不需要.qcow2尾缀

TIP

注意这里的用户名不能是纯数字,会造成cloudinit出问题,最好是纯英文或英文开头

./buildvm.sh VMID 用户名 密码 CPU核数 内存 硬盘 SSH端口 80端口 443端口 外网端口起 外网端口止 系统 存储盘
+

测试示例

  • 以下为开设的示例VM的信息:
    VMID - 102 SSH登录的用户名 - test1 SSH登录的密码 - 1234567 CPU核数 - 1
    内存大小 - 512MB 磁盘大小 - 10G
    SSH端口 - 40001 80端口 - 40002 443端口 - 40003 内外网映射端口一致的区间 - 50000到50025 系统 - ubuntu20 宿主机的存储盘 - local
./buildvm.sh 102 test1 1234567 1 512 10 40001 40002 40003 50000 50025 ubuntu20 local
+

开设完毕可执行cat vm102查看信息,或到WEB端对应VM的NOTES中查看

删除示例

  • 停止VM
  • 删除VM
  • 删除端口映射
  • 重启网络
  • 删除log文件
qm stop 102
+qm destroy 102
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+rm -rf vm102
+

相关qcow2镜像

  • 已预安装开启cloudinit,开启SSH登陆,预设值SSH监听V4和V6的22端口,开启允许密码验证登陆,开启允许ROOT登陆

目前使用的镜像列表为

https://github.com/spiritLHLS/Images/releases/tag/v1.0

批量开设NAT的KVM虚拟化的VM

WARNING

初次使用前需要保证当前PVE纯净且宿主机未进行过任何端口映射,否则设置冲突可能出现BUG

TIP

开设前请使用screen挂起执行,避免批量开设时间过长,SSH不稳定导致中间执行中断

  • 可多次运行批量生成VM
  • 自动开设NAT服务器,选项留空默认使用debian11镜像,可自定义使用镜像名字,支持的系统名字详见上文支持的镜像列表
  • 自动进行内外网端口映射,含22,80,443端口以及其他25个内外网端口号一样的端口
  • 生成后需要等待一段时间虚拟机内部的cloudinit配置好网络以及登陆信息,大概需要5分钟,每个虚拟机创建之间有间隔等待60秒避免突发性能不足
  • 默认批量开设的虚拟机网络配置为:22,80,443端口及一个25个端口区间的内外网映射
  • 可自定义批量开设的核心数,内存大小,硬盘大小,使用宿主机哪个存储盘,记得自己计算好空闲资源开设
  • 虚拟机的相关信息将会存储到WEB端对应VM的NOTES中,可在WEB端查看

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_vm.sh -o create_vm.sh && chmod +x create_vm.sh && bash create_vm.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_vm.sh -o create_vm.sh && chmod +x create_vm.sh && bash create_vm.sh
+

开设完毕可执行cat vmlog查看信息,或到WEB端对应VM的NOTES中查看

删除所有VM

  • 删除所有VM
  • 删除所有nat的端口映射
  • 重启网络
  • 删除log文件
for vmid in $(qm list | awk '{if(NR>1) print $1}'); do qm stop $vmid; qm destroy $vmid; rm -rf /var/lib/vz/images/$vmid*; done
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+rm -rf vmlog
+

TIP

PVE修改VM配置前都得停机先,再修改配置,修改完再启动,免得出现配置重载错误

开设独立IPV4地址的VM

WARNING

使用前需要保证当前宿主机的IP段带了至少2个IP,且有空余的IP未配置,该空余的IP未绑定宿主机 开设前请使用screen挂起执行,避免开设时间过长,SSH不稳定导致中间执行中断

  • 自动检测可用的IP区间,通过ping检测空余可使用的IP,选取其中之一绑定到虚拟机上
  • 系统的相关信息将会存储到对应的虚拟机的NOTE中,可在WEB端查看

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm_extraip.sh -o buildvm_extraip.sh && chmod +x buildvm_extraip.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildvm_extraip.sh -o buildvm_extraip.sh && chmod +x buildvm_extraip.sh
+

创建示例

./buildvm_extraip.sh VMID 用户名 密码 CPU核数 内存大小以MB计算 硬盘大小以GB计算 系统 存储盘
+
./buildvm_extraip.sh 152 test1 1234567 1 1024 10 ubuntu20 local
+

上述命令意义为开设一个带独立IPV4地址的虚拟机,VMID是152,用户名是test1,密码是1234567,CPU是1核,内存是1024MB,硬盘是10G,系统是Ubuntu20,存储盘是local盘也就是系统盘

删除示例

qm stop 152
+qm destroy 152
+rm -rf vm152
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/pve_lxc.html b/docs/.vitepress/dist/guide/pve_lxc.html new file mode 100644 index 0000000000..18fb8307ed --- /dev/null +++ b/docs/.vitepress/dist/guide/pve_lxc.html @@ -0,0 +1,41 @@ + + + + + + LXC虚拟化 | 一键虚拟化项目 + + + + + + + + + + +

LXC虚拟化

单独开设LXC虚拟化的CT

WARNING

初次使用前需要保证当前PVE纯净且宿主机未进行过任何端口映射,否则设置冲突可能出现BUG

TIP

开设前请使用screen挂起执行,避免批量开设时间过长,SSH不稳定导致中间执行中断

  • 自动开设NAT服务器,默认使用Debian11镜像,也可自定义系统
  • 自动进行内外网端口映射,含22,80,443端口以及其他25个内外网端口号一样的端口
  • 生成后需要等待一段时间虚拟机内部配置好网络以及登陆信息,大概需要3分钟
  • 默认开设的网络配置为:22,80,443端口及一个25个端口区间的内外网映射
  • 可自定义开设的核心数,内存大小,硬盘大小,使用宿主机哪个存储盘,记得自己计算好空闲资源开设
  • 可在命令中指定存储盘位置,默认不指定时为local盘即系统盘,可指定为PVE中显示的挂载盘
  • 开设的CT默认已启用SSH且允许root登陆,且已设置支持使用docker的嵌套虚拟化
  • 容器的相关信息将会存储到对应的容器的NOTE中,可在WEB端查看

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildct.sh -o buildct.sh && chmod +x buildct.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/buildct.sh -o buildct.sh && chmod +x buildct.sh
+

使用方法

  • 系统支持:debian10,debian11,ubuntu18,ubuntu20,ubuntu22,centos8,almalinux9等
  • 系统参数一律是小写的系统名字拼接版本号,具体可执行pveam available --section system查看可用的系统名字和版本号(注意脚本使用的参数只有小写的英文系统名字拼接版本号)
  • 其他系统可能支持可能不支持,自行测试
  • 默认用户名是root
./buildct.sh CTID 密码 CPU核数 内存 硬盘 SSH端口 80端口 443端口 外网端口起 外网端口止 系统 存储盘
+

测试示例

  • 以下为开设的示例CT的信息:
    VMID - 102 SSH登录的用户名 - root SSH登录的密码 - 1234567 CPU核数 - 1
    内存大小 - 512MB 磁盘大小 - 5G
    SSH端口 - 20001 80端口 - 20002 443端口 - 20003 内外网映射端口一致的区间 - 30000到30025 系统 - debian11 宿主机的存储盘 - local
./buildct.sh 102 1234567 1 512 5 20001 20002 20003 30000 30025 debian11 local
+

开设完毕可执行cat ct102查看信息,或在web端的NOTES查看

删除示例

  • 停止CT
  • 删除CT
  • 删除端口映射
  • 重启网络
  • 删除log文件
pct stop 102
+pct destroy 102
+rm -rf ct102
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+

批量开设NAT的LXC虚拟化的CT

WARNING

初次使用前需要保证当前PVE纯净且宿主机未进行过任何端口映射,否则设置冲突可能出现BUG 开设前请使用screen挂起执行,避免批量开设时间过长,SSH不稳定导致中间执行中断

  • 可多次运行批量生成CT容器,但需要注意的是母鸡内存记得开点swap免得机器炸了开SWAP点我跳转
  • 每个容器创建之间有间隔等待60秒避免突发性能不足
  • 可自定义批量开设的核心数,内存大小,硬盘大小,使用宿主机哪个存储盘,记得自己计算好空闲资源开设
  • 开设的CT默认已启用SSH且允许root登陆,且已设置支持使用docker的嵌套虚拟化
  • 容器的相关信息将会存储到对应的容器的NOTE中,可在WEB端查看

国际

curl -L https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_ct.sh -o create_ct.sh && chmod +x create_ct.sh && bash create_ct.sh
+

国内

curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/create_ct.sh -o create_ct.sh && chmod +x create_ct.sh && bash create_ct.sh
+

开设完毕可执行cat ctlog查看信息,或在web端的NOTES查看

删除所有CT

  • 删除所有CT
  • 删除所有nat的端口映射
  • 重启网络
  • 删除log文件
pct list | awk 'NR>1{print $1}' | xargs -I {} sh -c 'pct stop {}; pct destroy {}'
+rm -rf ct*
+iptables -t nat -F
+iptables -t filter -F
+service networking restart
+systemctl restart networking.service
+
+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/pve_precheck.html b/docs/.vitepress/dist/guide/pve_precheck.html new file mode 100644 index 0000000000..3fa2295f65 --- /dev/null +++ b/docs/.vitepress/dist/guide/pve_precheck.html @@ -0,0 +1,24 @@ + + + + + + 系统和硬件配置要求 | 一键虚拟化项目 + + + + + + + + + + +

系统和硬件配置要求

各种要求

建议debian在使用前尽量使用最新的稳定版本的系统

非debian11可使用 debian一键升级 来升级系统

本项目只适配Debian系统(非Debian无法通过APT源安装,官方只给了Debian的镜像,其他系统只能使用ISO安装)

  • 系统要求:Debian 8+

TIP

建议debian11而不是debian12,因为后者是beta版本,debian11安装的才是稳定版

  • 硬件要求:2核2G内存x86_64架构服务器硬盘至少20G

WARNING

内存开点swap免得机器炸了开SWAP点我跳转

  • 可开KVM的硬件要求:VM-X或AMD-V支持 (部分VPS和全部独服支持)
  • 如果硬件或系统需求不满足,可使用LXD批量开LXC容器跳转

遇到选项不会选的可无脑回车安装,本项目所有脚本内置国内外IP自动判断,使用的是不同的安装源与配置文件,有使用CDN加速镜像下载

检测环境

  • 本项目相关脚本执行前务必执行本脚本检测环境,如果不符合安装PVE的要求则无法使用后续的脚本
  • 检测硬件配置是否满足最低要求
  • 检测硬件环境是否可嵌套虚拟化KVM类型的服务器
  • 检测系统环境是否可嵌套虚拟化KVM类型的服务器
  • 不可嵌套虚拟化KVM类型的服务器也可以开LXC虚拟化的服务器,但不推荐安装PVE,不如使用LXD

国际

bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/check_kernal.sh)
+

国内

bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/pve/main/scripts/check_kernal.sh)
+


+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/pve_qa.html b/docs/.vitepress/dist/guide/pve_qa.html new file mode 100644 index 0000000000..1190c84237 --- /dev/null +++ b/docs/.vitepress/dist/guide/pve_qa.html @@ -0,0 +1,22 @@ + + + + + + 目前已验证的VPS商家 | 一键虚拟化项目 + + + + + + + + + + +

目前已验证的VPS商家

可开设KVM虚拟化的NAT的商家

nocix 中的特价最低配15美元独服 (IPV6不自带,需要找客服要)

amhost 中的测试款

digitalocean 中的 Perminu Intel 和 Regular 4核款

skrime 中的 AMD Ryzen KVM Server 最低配款

webdock 中的 AMD KVM Server

4vps 中的 俄罗斯和希腊 测试款

hostaris 中的 德国款 (商家的系统模板有问题,IPV6已失效和Github的连通稳定性很差)

只可开设LXC虚拟化的NAT的商家

腾讯云 中的无忧款和特惠款(学生机)

spectraip 中的KVM服务器

已知无法直接安装PVE的商家

hetzner 需要救援系统安装纯净的Debian,默认网络设置有冲突

hosthatch 默认网络设置有问题

+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/guide/pve_thanks.html b/docs/.vitepress/dist/guide/pve_thanks.html new file mode 100644 index 0000000000..d0be240da2 --- /dev/null +++ b/docs/.vitepress/dist/guide/pve_thanks.html @@ -0,0 +1,22 @@ + + + + + + 致谢 | 一键虚拟化项目 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/.vitepress/dist/hashmap.json b/docs/.vitepress/dist/hashmap.json new file mode 100644 index 0000000000..bf6e6a6a24 --- /dev/null +++ b/docs/.vitepress/dist/hashmap.json @@ -0,0 +1 @@ +{"case_case1.md":"2ed77e73","case_case2.md":"d656eaf0","case_case3.md":"d4e43a36","case_case4.md":"b9d23b9c","case_case5.md":"38489a56","case_index.md":"0e4336f3","developer_index.md":"5ec90a44","developer_l10n.md":"df111cbe","en_us_developer_index.md":"cf040c9e","en_us_developer_l10n.md":"a6235dd5","en_us_guide_dashboard.md":"94484359","en_us_guide_dashboardq.md":"00431e49","en_us_guide_docker_build.md":"f6eeb15c","en_us_guide_docker_install.md":"2e3e0949","en_us_guide_docker_precheck.md":"1963a1ba","en_us_guide_docker_qa.md":"552cf73e","en_us_guide_docker_thanks.md":"e5e5ba20","en_us_guide_lxd_extra_config.md":"8bf0f547","en_us_guide_lxd_install.md":"ee14e163","en_us_guide_lxd_lxc.md":"10e4a9d8","en_us_guide_lxd_precheck.md":"0acc8392","en_us_guide_lxd_qa.md":"e15607c8","en_us_guide_lxd_thanks.md":"2fce219f","en_us_guide_pve_install.md":"ca0fd343","en_us_guide_pve_kvm.md":"036cbd27","en_us_guide_pve_lxc.md":"889c2001","en_us_guide_pve_precheck.md":"48e39e16","en_us_guide_pve_qa.md":"8543b407","en_us_guide_pve_thanks.md":"19b79e33","en_us_index.md":"7d81af26","guide_dashboard.md":"84ccffb0","guide_dashboardq.md":"10023dc6","guide_docker_build.md":"eaa03d4b","guide_docker_install.md":"7ec90acb","guide_docker_precheck.md":"2257993a","guide_docker_qa.md":"530544e0","guide_docker_thanks.md":"f5243d12","guide_lxd_extra_config.md":"2ee15fd0","guide_lxd_install.md":"87f65c61","guide_lxd_lxc.md":"fe473a65","guide_lxd_precheck.md":"c67a5395","guide_lxd_qa.md":"9de3e5ac","guide_lxd_thanks.md":"4fca498d","guide_pve_install.md":"7fcfd8d3","guide_pve_kvm.md":"c79c334f","guide_pve_lxc.md":"0d083a46","guide_pve_precheck.md":"52753d86","guide_pve_qa.md":"368f4953","guide_pve_thanks.md":"ef91f2a2","index.md":"3f1005ea"} diff --git a/docs/.vitepress/dist/index.html b/docs/.vitepress/dist/index.html new file mode 100644 index 0000000000..99c07d511a --- /dev/null +++ b/docs/.vitepress/dist/index.html @@ -0,0 +1,22 @@ + + + + + + 一键虚拟化项目 + + + + + + + + + + +

一键虚拟化项目

开源、易于使用的服务器虚拟化项目

一键使用

支持一键脚本安装使用,轻松使用各虚拟化在服务器上创建虚拟机/容器

基于主流系统开发

基于 Debian、Ubuntu 的长期维护版本开发,如需使用请尽量保证宿主机系统与开发环境一致

自带内外网端口转发

支持自动的内网端口转发,含TCP、UDP协议,无需人工管理

批量虚拟化

支持 KVM、LXC、Docker 虚拟化批量开设容器/虚拟机

多系统支持

开设出的容器/虚拟机已支持多系统,涵盖几乎所有主流系统

自限制滥用

部分虚拟化开设的容器/虚拟机已屏蔽和装载限制,避免被用于滥用

Copyright © 2023-present oneclickvirt

+ + + + + \ No newline at end of file diff --git a/docs/.vitepress/theme/DarkLayout.vue b/docs/.vitepress/theme/DarkLayout.vue deleted file mode 100644 index 9edc453d97..0000000000 --- a/docs/.vitepress/theme/DarkLayout.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - diff --git a/docs/.vitepress/theme/dark-theme.css b/docs/.vitepress/theme/dark-theme.css deleted file mode 100644 index 18e237c4d4..0000000000 --- a/docs/.vitepress/theme/dark-theme.css +++ /dev/null @@ -1,89 +0,0 @@ -body.dark { - --c-divider: var(--c-divider-dark); - --c-text: var(--c-text-dark-1); - --c-text-light: var(--c-text-dark-2); - --c-text-lighter: var(--c-text-dark-3); - --c-bg: var(--c-white); - --c-bg-accent: var(--c-white-light); - --code-font-family: var(--font-family-mono); - --code-inline-bg-color: rgba(27, 31, 35, 0.05); - --code-bg-color: #282c34; - --c-white: var(--c-black); - --c-white-dark: #f8f8f8; - --c-black: #1a1a1a; - --c-divider-light: rgba(60, 60, 67, 0.12); - --c-divider-dark: rgba(84, 84, 88, 0.48); - --c-text-light-1: #2c3e50; - --c-text-light-2: #476582; - --c-text-light-3: #90a4b7; - - --c-text-dark-1: #fff; - --c-text-dark-2: #607385; - --c-text-dark-3: #445666; - - --c-brand: #3eaf7c; - --c-brand-light: #4abf8a; - --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06); - --shadow-2: 0 3px 12px rgba(0, 0, 0, 0.07), 0 1px 4px rgba(0, 0, 0, 0.07); - --shadow-3: 0 12px 32px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.08); - --shadow-4: 0 14px 44px rgba(0, 0, 0, 0.12), 0 3px 9px rgba(0, 0, 0, 0.12); - --shadow-5: 0 18px 56px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.16); - --header-height: 3.6rem; - - --docsearch-searchbox-focus-background: #242424; - --docsearch-container-background: rgba(101, 108, 133, 0.8); - --docsearch-modal-background: #242424; - --docsearch-modal-shadow: inset 1px 1px 0 0 hsla(0, 0%, 100%, 0.5), - 0 3px 8px 0 #555a64; - --docsearch-searchbox-background: #ebedf0; - --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color); - --docsearch-hit-color: #444950; - --docsearch-hit-active-color: #333; - --docsearch-hit-background: #333; - --docsearch-hit-shadow: 0 1px 3px 0 #d4d9e1; - --docsearch-key-gradient: linear-gradient(-225deg, #d5dbe4, #f8f8f8); - --docsearch-key-shadow: inset 0 -2px 0 0 #cdcde6, inset 0 0 1px 1px #333, - 0 1px 2px 1px rgba(30, 35, 90, 0.4); - --docsearch-footer-background: #333; - --docsearch-footer-shadow: 0 -1px 0 0 #e0e3e8, - 0 -3px 6px 0 rgba(69, 98, 155, 0.12); -} - -body.dark tr:nth-child(2n) { - background-color: #2a2a2a; -} - -body.dark .DocSearch { - --docsearch-primary-color: var(--c-brand); - --docsearch-highlight-color: var(--docsearch-primary-color); - --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color); - --docsearch-text-color: var(--c-text-light); - --docsearch-muted-color: var(--c-text-lighter); - --docsearch-searchbox-background: #333; -} - -body.dark .DocSearch-Button:hover { - box-shadow: var(--docsearch-searchbox-shadow); - color: var(--docsearch-text-color); - outline: none; -} - -body.dark .custom-block.details, -body.dark .custom-block.info, -body.dark .custom-block.tip { - background-color: #2f2f2f; -} - -body.dark .custom-block.warning { - background-color: #ffe56436; - color: #ccc18c; -} - -body.dark .custom-block.danger { - background-color: #6e4f4fd2; - color: #f5d3d3; -} - -body.dark .custom-block.danger .custom-block-title { - color: #f6b9b9; -} \ No newline at end of file diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts deleted file mode 100644 index 32a7beaf11..0000000000 --- a/docs/.vitepress/theme/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import DefaultTheme from 'vitepress/theme' -import DarkLayout from './DarkLayout.vue' -import DarkStyles from './dark-theme.css' - -export { DarkStyles } - -export default { - ...DefaultTheme, - // override the Layout with a wrapper component that injects the slots - Layout: DarkLayout -} diff --git a/docs/case/index.md b/docs/case/index.md index 0c889fc537..62fbd07713 100644 --- a/docs/case/index.md +++ b/docs/case/index.md @@ -1,12 +1,21 @@ --- -home: true -heroImage: https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png -heroText: Linux相关项目 -tagline: 与Linux相关的一些项目 -actionText: 查看项目 → -actionLink: /case/case1 +layout: home + +title: Linux相关项目 +titleTemplate: 与Linux相关的一些项目 + +hero: + name: Linux相关项目 + text: Linux相关项目 + tagline: 与Linux相关的一些项目 + image: https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png + actions: + - theme: brand + text: 查看项目 → + link: /case/case1 + features: - title: 注意事项 details: 注意每个项目说明,部分项目有可能对系统造成不可修复的错误,需要重装系统,请仔细查看说明 ---- +---
本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。 diff --git a/docs/developer/index.md b/docs/developer/index.md index 6701da5447..b4e8a61e63 100644 --- a/docs/developer/index.md +++ b/docs/developer/index.md @@ -1,10 +1,17 @@ --- -home: true -heroImage: https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png -heroText: 开发手册 -tagline: 欢迎使用一键虚拟化项目开发手册,欢迎你提出高质量的Pull Request,帮助一键虚拟化项目变得更好! -actionText: 开始使用 → -actionLink: /developer/l10n -footer: Copyright © 2023-present oneclickvirt ---- +layout: home + +title: 开发手册 +titleTemplate: 欢迎使用一键虚拟化项目开发手册,欢迎你提出高质量的Pull Request,帮助一键虚拟化项目变得更好! + +hero: + name: 开发手册 + text: 开发手册 + image: https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png + actions: + - theme: brand + text: 开始使用 → + link: /developer/l10n +--- +
本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。 diff --git a/docs/en_US/developer/index.md b/docs/en_US/developer/index.md index 97c7ef6136..c71ef6510b 100644 --- a/docs/en_US/developer/index.md +++ b/docs/en_US/developer/index.md @@ -1,10 +1,17 @@ --- -home: true -heroImage: https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png -heroText: Development Manual -tagline: Welcome to the Nezha Monitoring Development Manual. -actionText: Start Now → -actionLink: /en_US/developer/l10n -footer: Copyright © 2023-present oneclickvirt ---- +layout: home + +title: Development Manual +titleTemplate: Welcome to the oneclickvirt Development Manual. + +hero: + name: Development Manual + text: Development Manual + image: https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png + actions: + - theme: brand + text: Start Now → + link: /en_US/developer/l10n +--- +
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. diff --git a/docs/en_US/index.md b/docs/en_US/index.md index ac0a66dc77..25e7a30c9b 100644 --- a/docs/en_US/index.md +++ b/docs/en_US/index.md @@ -1,10 +1,19 @@ --- -home: true -heroImage: https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png -heroText: One Click Virtualization Project -tagline: Open source, easy to use server virtualization project -actionText: Learn More → -actionLink: /en_US/guide/dashboard +layout: home + +title: One Click Virtualization Project +titleTemplate: Open source, easy to use server virtualization project + +hero: + name: One Click Virtualization Project + text: One Click Virtualization Project + tagline: Open source, easy to use server virtualization project + image: https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png + actions: + - theme: brand + text: Learn More → + link: /en_US/guide/dashboard + features: - title: One Click Use details: Support one-click script installation and use to easily create virtual machines/containers on servers using each virtualization @@ -18,8 +27,7 @@ features: details: Virtual machines/containers already support multiple systems, covering almost all major systems - title: Self-limiting abuse details: Partially virtual machines/containers have been masked and loaded with restrictions to avoid being used for abuse -footer: Copyright © 2023-present oneclickvirt ---- +--- Documentation has not been translated yet, waiting for translation. diff --git a/docs/index.md b/docs/index.md index 17c3253df5..ef32bf5907 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,10 +1,19 @@ --- -home: true -heroImage: https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png -heroText: 一键虚拟化项目 -tagline: 开源、易于使用的服务器虚拟化项目 -actionText: 开始使用 → -actionLink: /guide/dashboard +layout: home + +title: 一键虚拟化项目 +titleTemplate: 开源、易于使用的服务器虚拟化项目 + +hero: + name: 一键虚拟化项目 + text: 一键虚拟化项目 + tagline: 开源、易于使用的服务器虚拟化项目 + image: https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png + actions: + - theme: brand + text: 开始使用 → + link: /guide/dashboard + features: - title: 一键使用 details: 支持一键脚本安装使用,轻松使用各虚拟化在服务器上创建虚拟机/容器 @@ -18,6 +27,6 @@ features: details: 开设出的容器/虚拟机已支持多系统,涵盖几乎所有主流系统 - title: 自限制滥用 details: 部分虚拟化开设的容器/虚拟机已屏蔽和装载限制,避免被用于滥用 -footer: Copyright © 2023-present oneclickvirt ---- +--- +
本项目采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。 diff --git a/node_modules/.bin/esbuild b/node_modules/.bin/esbuild new file mode 120000 index 0000000000..c83ac07079 --- /dev/null +++ b/node_modules/.bin/esbuild @@ -0,0 +1 @@ +../esbuild/bin/esbuild \ No newline at end of file diff --git a/node_modules/.bin/loose-envify b/node_modules/.bin/loose-envify new file mode 120000 index 0000000000..ed9009c5aa --- /dev/null +++ b/node_modules/.bin/loose-envify @@ -0,0 +1 @@ +../loose-envify/cli.js \ No newline at end of file diff --git a/node_modules/.bin/nanoid b/node_modules/.bin/nanoid new file mode 120000 index 0000000000..e2be547bcb --- /dev/null +++ b/node_modules/.bin/nanoid @@ -0,0 +1 @@ +../nanoid/bin/nanoid.cjs \ No newline at end of file diff --git a/node_modules/.bin/parser b/node_modules/.bin/parser new file mode 120000 index 0000000000..ce7bf97efb --- /dev/null +++ b/node_modules/.bin/parser @@ -0,0 +1 @@ +../@babel/parser/bin/babel-parser.js \ No newline at end of file diff --git a/node_modules/.bin/resolve b/node_modules/.bin/resolve new file mode 120000 index 0000000000..b6afda6c75 --- /dev/null +++ b/node_modules/.bin/resolve @@ -0,0 +1 @@ +../resolve/bin/resolve \ No newline at end of file diff --git a/node_modules/.bin/rollup b/node_modules/.bin/rollup new file mode 120000 index 0000000000..5939621caa --- /dev/null +++ b/node_modules/.bin/rollup @@ -0,0 +1 @@ +../rollup/dist/bin/rollup \ No newline at end of file diff --git a/node_modules/.bin/vite b/node_modules/.bin/vite new file mode 120000 index 0000000000..6d1e3beaf6 --- /dev/null +++ b/node_modules/.bin/vite @@ -0,0 +1 @@ +../vite/bin/vite.js \ No newline at end of file diff --git a/node_modules/.bin/vitepress b/node_modules/.bin/vitepress new file mode 120000 index 0000000000..f7e3383ecf --- /dev/null +++ b/node_modules/.bin/vitepress @@ -0,0 +1 @@ +../vitepress/bin/vitepress.js \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000000..46da87d964 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,767 @@ +{ + "name": "oneclickvirt.github.io", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "node_modules/@algolia/autocomplete-core": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.5.2.tgz", + "integrity": "sha512-DY0bhyczFSS1b/CqJlTE/nQRtnTAHl6IemIkBy0nEWnhDzRDdtdx4p5Uuk3vwAFxwEEgi1WqKwgSSMx6DpNL4A==", + "dev": true, + "dependencies": { + "@algolia/autocomplete-shared": "1.5.2" + } + }, + "node_modules/@algolia/autocomplete-preset-algolia": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.5.2.tgz", + "integrity": "sha512-3MRYnYQFJyovANzSX2CToS6/5cfVjbLLqFsZTKcvF3abhQzxbqwwaMBlJtt620uBUOeMzhdfasKhCc40+RHiZw==", + "dev": true, + "dependencies": { + "@algolia/autocomplete-shared": "1.5.2" + }, + "peerDependencies": { + "@algolia/client-search": "^4.9.1", + "algoliasearch": "^4.9.1" + } + }, + "node_modules/@algolia/autocomplete-shared": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@algolia/autocomplete-shared/-/autocomplete-shared-1.5.2.tgz", + "integrity": "sha512-ylQAYv5H0YKMfHgVWX0j0NmL8XBcAeeeVQUmppnnMtzDbDnca6CzhKj3Q8eF9cHCgcdTDdb5K+3aKyGWA0obug==", + "dev": true + }, + "node_modules/@algolia/cache-browser-local-storage": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.13.0.tgz", + "integrity": "sha512-nj1vHRZauTqP/bluwkRIgEADEimqojJgoTRCel5f6q8WCa9Y8QeI4bpDQP28FoeKnDRYa3J5CauDlN466jqRhg==", + "dev": true, + "dependencies": { + "@algolia/cache-common": "4.13.0" + } + }, + "node_modules/@algolia/cache-common": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.13.0.tgz", + "integrity": "sha512-f9mdZjskCui/dA/fA/5a+6hZ7xnHaaZI5tM/Rw9X8rRB39SUlF/+o3P47onZ33n/AwkpSbi5QOyhs16wHd55kA==", + "dev": true + }, + "node_modules/@algolia/cache-in-memory": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.13.0.tgz", + "integrity": "sha512-hHdc+ahPiMM92CQMljmObE75laYzNFYLrNOu0Q3/eyvubZZRtY2SUsEEgyUEyzXruNdzrkcDxFYa7YpWBJYHAg==", + "dev": true, + "dependencies": { + "@algolia/cache-common": "4.13.0" + } + }, + "node_modules/@algolia/client-account": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.13.0.tgz", + "integrity": "sha512-FzFqFt9b0g/LKszBDoEsW+dVBuUe1K3scp2Yf7q6pgHWM1WqyqUlARwVpLxqyc+LoyJkTxQftOKjyFUqddnPKA==", + "dev": true, + "dependencies": { + "@algolia/client-common": "4.13.0", + "@algolia/client-search": "4.13.0", + "@algolia/transporter": "4.13.0" + } + }, + "node_modules/@algolia/client-analytics": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.13.0.tgz", + "integrity": "sha512-klmnoq2FIiiMHImkzOm+cGxqRLLu9CMHqFhbgSy9wtXZrqb8BBUIUE2VyBe7azzv1wKcxZV2RUyNOMpFqmnRZA==", + "dev": true, + "dependencies": { + "@algolia/client-common": "4.13.0", + "@algolia/client-search": "4.13.0", + "@algolia/requester-common": "4.13.0", + "@algolia/transporter": "4.13.0" + } + }, + "node_modules/@algolia/client-common": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.13.0.tgz", + "integrity": "sha512-GoXfTp0kVcbgfSXOjfrxx+slSipMqGO9WnNWgeMmru5Ra09MDjrcdunsiiuzF0wua6INbIpBQFTC2Mi5lUNqGA==", + "dev": true, + "dependencies": { + "@algolia/requester-common": "4.13.0", + "@algolia/transporter": "4.13.0" + } + }, + "node_modules/@algolia/client-personalization": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.13.0.tgz", + "integrity": "sha512-KneLz2WaehJmNfdr5yt2HQETpLaCYagRdWwIwkTqRVFCv4DxRQ2ChPVW9jeTj4YfAAhfzE6F8hn7wkQ/Jfj6ZA==", + "dev": true, + "dependencies": { + "@algolia/client-common": "4.13.0", + "@algolia/requester-common": "4.13.0", + "@algolia/transporter": "4.13.0" + } + }, + "node_modules/@algolia/client-search": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.13.0.tgz", + "integrity": "sha512-blgCKYbZh1NgJWzeGf+caKE32mo3j54NprOf0LZVCubQb3Kx37tk1Hc8SDs9bCAE8hUvf3cazMPIg7wscSxspA==", + "dev": true, + "dependencies": { + "@algolia/client-common": "4.13.0", + "@algolia/requester-common": "4.13.0", + "@algolia/transporter": "4.13.0" + } + }, + "node_modules/@algolia/logger-common": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.13.0.tgz", + "integrity": "sha512-8yqXk7rMtmQJ9wZiHOt/6d4/JDEg5VCk83gJ39I+X/pwUPzIsbKy9QiK4uJ3aJELKyoIiDT1hpYVt+5ia+94IA==", + "dev": true + }, + "node_modules/@algolia/logger-console": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.13.0.tgz", + "integrity": "sha512-YepRg7w2/87L0vSXRfMND6VJ5d6699sFJBRWzZPOlek2p5fLxxK7O0VncYuc/IbVHEgeApvgXx0WgCEa38GVuQ==", + "dev": true, + "dependencies": { + "@algolia/logger-common": "4.13.0" + } + }, + "node_modules/@algolia/requester-browser-xhr": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.13.0.tgz", + "integrity": "sha512-Dj+bnoWR5MotrnjblzGKZ2kCdQi2cK/VzPURPnE616NU/il7Ypy6U6DLGZ/ZYz+tnwPa0yypNf21uqt84fOgrg==", + "dev": true, + "dependencies": { + "@algolia/requester-common": "4.13.0" + } + }, + "node_modules/@algolia/requester-common": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.13.0.tgz", + "integrity": "sha512-BRTDj53ecK+gn7ugukDWOOcBRul59C4NblCHqj4Zm5msd5UnHFjd/sGX+RLOEoFMhetILAnmg6wMrRrQVac9vw==", + "dev": true + }, + "node_modules/@algolia/requester-node-http": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.13.0.tgz", + "integrity": "sha512-9b+3O4QFU4azLhGMrZAr/uZPydvzOR4aEZfSL8ZrpLZ7fbbqTO0S/5EVko+QIgglRAtVwxvf8UJ1wzTD2jvKxQ==", + "dev": true, + "dependencies": { + "@algolia/requester-common": "4.13.0" + } + }, + "node_modules/@algolia/transporter": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.13.0.tgz", + "integrity": "sha512-8tSQYE+ykQENAdeZdofvtkOr5uJ9VcQSWgRhQ9h01AehtBIPAczk/b2CLrMsw5yQZziLs5cZ3pJ3478yI+urhA==", + "dev": true, + "dependencies": { + "@algolia/cache-common": "4.13.0", + "@algolia/logger-common": "4.13.0", + "@algolia/requester-common": "4.13.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.17.12", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.12.tgz", + "integrity": "sha512-FLzHmN9V3AJIrWfOpvRlZCeVg/WLdicSnTMsLur6uDj9TT8ymUlG9XxURdW/XvuygK+2CW0poOJABdA4m/YKxA==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@docsearch/css": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.0.0.tgz", + "integrity": "sha512-1kkV7tkAsiuEd0shunYRByKJe3xQDG2q7wYg24SOw1nV9/2lwEd4WrUYRJC/ukGTl2/kHeFxsaUvtiOy0y6fFA==", + "dev": true + }, + "node_modules/@docsearch/js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@docsearch/js/-/js-3.0.0.tgz", + "integrity": "sha512-j3tUJWlgW3slYqzGB8fm7y05kh2qqrIK1dZOXHeMUm/5gdKE85fiz/ltfCPMDFb/MXF+bLZChJXSMzqY0Ck30Q==", + "dev": true, + "dependencies": { + "@docsearch/react": "3.0.0", + "preact": "^10.0.0" + } + }, + "node_modules/@docsearch/react": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.0.0.tgz", + "integrity": "sha512-yhMacqS6TVQYoBh/o603zszIb5Bl8MIXuOc6Vy617I74pirisDzzcNh0NEaYQt50fVVR3khUbeEhUEWEWipESg==", + "dev": true, + "dependencies": { + "@algolia/autocomplete-core": "1.5.2", + "@algolia/autocomplete-preset-algolia": "1.5.2", + "@docsearch/css": "3.0.0", + "algoliasearch": "^4.0.0" + }, + "peerDependencies": { + "@types/react": ">= 16.8.0 < 18.0.0", + "react": ">= 16.8.0 < 18.0.0", + "react-dom": ">= 16.8.0 < 18.0.0" + } + }, + "node_modules/@types/prop-types": { + "version": "15.7.5", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", + "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==", + "dev": true, + "peer": true + }, + "node_modules/@types/react": { + "version": "17.0.45", + "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.45.tgz", + "integrity": "sha512-YfhQ22Lah2e3CHPsb93tRwIGNiSwkuz1/blk4e6QrWS0jQzCSNbGLtOEYhPg02W0yGTTmpajp7dCTbBAMN3qsg==", + "dev": true, + "peer": true, + "dependencies": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/scheduler": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", + "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==", + "dev": true, + "peer": true + }, + "node_modules/@vitejs/plugin-vue": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-2.3.3.tgz", + "integrity": "sha512-SmQLDyhz+6lGJhPELsBdzXGc+AcaT8stgkbiTFGpXPe8Tl1tJaBw1A6pxDqDuRsVkD8uscrkx3hA7QDOoKYtyw==", + "dev": true, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "vite": "^2.5.10", + "vue": "^3.2.25" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.33.tgz", + "integrity": "sha512-AAmr52ji3Zhk7IKIuigX2osWWsb2nQE5xsdFYjdnmtQ4gymmqXbjLvkSE174+fF3A3kstYrTgGkqgOEbsdLDpw==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.16.4", + "@vue/shared": "3.2.33", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.33.tgz", + "integrity": "sha512-GhiG1C8X98Xz9QUX/RlA6/kgPBWJkjq0Rq6//5XTAGSYrTMBgcLpP9+CnlUg1TFxnnCVughAG+KZl28XJqw8uQ==", + "dev": true, + "dependencies": { + "@vue/compiler-core": "3.2.33", + "@vue/shared": "3.2.33" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.33.tgz", + "integrity": "sha512-H8D0WqagCr295pQjUYyO8P3IejM3vEzeCO1apzByAEaAR/WimhMYczHfZVvlCE/9yBaEu/eu9RdiWr0kF8b71Q==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.16.4", + "@vue/compiler-core": "3.2.33", + "@vue/compiler-dom": "3.2.33", + "@vue/compiler-ssr": "3.2.33", + "@vue/reactivity-transform": "3.2.33", + "@vue/shared": "3.2.33", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7", + "postcss": "^8.1.10", + "source-map": "^0.6.1" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.33.tgz", + "integrity": "sha512-XQh1Xdk3VquDpXsnoCd7JnMoWec9CfAzQDQsaMcSU79OrrO2PNR0ErlIjm/mGq3GmBfkQjzZACV+7GhfRB8xMQ==", + "dev": true, + "dependencies": { + "@vue/compiler-dom": "3.2.33", + "@vue/shared": "3.2.33" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.33.tgz", + "integrity": "sha512-62Sq0mp9/0bLmDuxuLD5CIaMG2susFAGARLuZ/5jkU1FCf9EDbwUuF+BO8Ub3Rbodx0ziIecM/NsmyjardBxfQ==", + "dev": true, + "dependencies": { + "@vue/shared": "3.2.33" + } + }, + "node_modules/@vue/reactivity-transform": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.2.33.tgz", + "integrity": "sha512-4UL5KOIvSQb254aqenW4q34qMXbfZcmEsV/yVidLUgvwYQQ/D21bGX3DlgPUGI3c4C+iOnNmDCkIxkILoX/Pyw==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.16.4", + "@vue/compiler-core": "3.2.33", + "@vue/shared": "3.2.33", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.33.tgz", + "integrity": "sha512-N2D2vfaXsBPhzCV3JsXQa2NECjxP3eXgZlFqKh4tgakp3iX6LCGv76DLlc+IfFZq+TW10Y8QUfeihXOupJ1dGw==", + "dev": true, + "dependencies": { + "@vue/reactivity": "3.2.33", + "@vue/shared": "3.2.33" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.33.tgz", + "integrity": "sha512-LSrJ6W7CZTSUygX5s8aFkraDWlO6K4geOwA3quFF2O+hC3QuAMZt/0Xb7JKE3C4JD4pFwCSO7oCrZmZ0BIJUnw==", + "dev": true, + "dependencies": { + "@vue/runtime-core": "3.2.33", + "@vue/shared": "3.2.33", + "csstype": "^2.6.8" + } + }, + "node_modules/@vue/runtime-dom/node_modules/csstype": { + "version": "2.6.20", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.20.tgz", + "integrity": "sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA==", + "dev": true + }, + "node_modules/@vue/server-renderer": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.33.tgz", + "integrity": "sha512-4jpJHRD4ORv8PlbYi+/MfP8ec1okz6rybe36MdpkDrGIdEItHEUyaHSKvz+ptNEyQpALmmVfRteHkU9F8vxOew==", + "dev": true, + "dependencies": { + "@vue/compiler-ssr": "3.2.33", + "@vue/shared": "3.2.33" + }, + "peerDependencies": { + "vue": "3.2.33" + } + }, + "node_modules/@vue/shared": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.33.tgz", + "integrity": "sha512-UBc1Pg1T3yZ97vsA2ueER0F6GbJebLHYlEi4ou1H5YL4KWvMOOWwpYo9/QpWq93wxKG6Wo13IY74Hcn/f7c7Bg==", + "dev": true + }, + "node_modules/algoliasearch": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.13.0.tgz", + "integrity": "sha512-oHv4faI1Vl2s+YC0YquwkK/TsaJs79g2JFg5FDm2rKN12VItPTAeQ7hyJMHarOPPYuCnNC5kixbtcqvb21wchw==", + "dev": true, + "dependencies": { + "@algolia/cache-browser-local-storage": "4.13.0", + "@algolia/cache-common": "4.13.0", + "@algolia/cache-in-memory": "4.13.0", + "@algolia/client-account": "4.13.0", + "@algolia/client-analytics": "4.13.0", + "@algolia/client-common": "4.13.0", + "@algolia/client-personalization": "4.13.0", + "@algolia/client-search": "4.13.0", + "@algolia/logger-common": "4.13.0", + "@algolia/logger-console": "4.13.0", + "@algolia/requester-browser-xhr": "4.13.0", + "@algolia/requester-common": "4.13.0", + "@algolia/requester-node-http": "4.13.0", + "@algolia/transporter": "4.13.0" + } + }, + "node_modules/csstype": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz", + "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==", + "dev": true, + "peer": true + }, + "node_modules/esbuild": { + "version": "0.14.39", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.39.tgz", + "integrity": "sha512-2kKujuzvRWYtwvNjYDY444LQIA3TyJhJIX3Yo4+qkFlDDtGlSicWgeHVJqMUP/2sSfH10PGwfsj+O2ro1m10xQ==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "esbuild-android-64": "0.14.39", + "esbuild-android-arm64": "0.14.39", + "esbuild-darwin-64": "0.14.39", + "esbuild-darwin-arm64": "0.14.39", + "esbuild-freebsd-64": "0.14.39", + "esbuild-freebsd-arm64": "0.14.39", + "esbuild-linux-32": "0.14.39", + "esbuild-linux-64": "0.14.39", + "esbuild-linux-arm": "0.14.39", + "esbuild-linux-arm64": "0.14.39", + "esbuild-linux-mips64le": "0.14.39", + "esbuild-linux-ppc64le": "0.14.39", + "esbuild-linux-riscv64": "0.14.39", + "esbuild-linux-s390x": "0.14.39", + "esbuild-netbsd-64": "0.14.39", + "esbuild-openbsd-64": "0.14.39", + "esbuild-sunos-64": "0.14.39", + "esbuild-windows-32": "0.14.39", + "esbuild-windows-64": "0.14.39", + "esbuild-windows-arm64": "0.14.39" + } + }, + "node_modules/esbuild-linux-64": { + "version": "0.14.39", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.39.tgz", + "integrity": "sha512-4tcgFDYWdI+UbNMGlua9u1Zhu0N5R6u9tl5WOM8aVnNX143JZoBZLpCuUr5lCKhnD0SCO+5gUyMfupGrHtfggQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/is-core-module": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "peer": true + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "peer": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "dev": true, + "dependencies": { + "sourcemap-codec": "^1.4.8" + } + }, + "node_modules/nanoid": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", + "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/postcss": { + "version": "8.4.13", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.13.tgz", + "integrity": "sha512-jtL6eTBrza5MPzy8oJLFuUscHDXTV5KcLlqAWHl5q5WYRfnNRGSmOZmOZ1T6Gy7A99mOZfqungmZMpMmCVJ8ZA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + } + ], + "dependencies": { + "nanoid": "^3.3.3", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/preact": { + "version": "10.7.2", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.7.2.tgz", + "integrity": "sha512-GLjn0I3r6ka+NvxJUppsVFqb4V0qDTEHT/QxHlidPuClGaxF/4AI2Qti4a0cv3XMh5n1+D3hLScW10LRIm5msQ==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, + "node_modules/prismjs": { + "version": "1.28.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.28.0.tgz", + "integrity": "sha512-8aaXdYvl1F7iC7Xm1spqSaY/OJBpYW3v+KJ+F17iYxvdc8sfjW194COK5wVhMZX45tGteiBQgdvD/nhxcRwylw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/react": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", + "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", + "dev": true, + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", + "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", + "dev": true, + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "scheduler": "^0.20.2" + }, + "peerDependencies": { + "react": "17.0.2" + } + }, + "node_modules/resolve": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.8.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/rollup": { + "version": "2.73.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.73.0.tgz", + "integrity": "sha512-h/UngC3S4Zt28mB3g0+2YCMegT5yoftnQplwzPqGZcKvlld5e+kT/QRmJiL+qxGyZKOYpgirWGdLyEO1b0dpLQ==", + "dev": true, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=10.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/scheduler": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", + "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "dev": true, + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "dev": true + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/vite": { + "version": "2.9.9", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.9.9.tgz", + "integrity": "sha512-ffaam+NgHfbEmfw/Vuh6BHKKlI/XIAhxE5QSS7gFLIngxg171mg1P3a4LSRME0z2ZU1ScxoKzphkipcYwSD5Ew==", + "dev": true, + "dependencies": { + "esbuild": "^0.14.27", + "postcss": "^8.4.13", + "resolve": "^1.22.0", + "rollup": "^2.59.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": ">=12.2.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + }, + "peerDependencies": { + "less": "*", + "sass": "*", + "stylus": "*" + }, + "peerDependenciesMeta": { + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + } + } + }, + "node_modules/vitepress": { + "version": "0.22.4", + "resolved": "https://registry.npmjs.org/vitepress/-/vitepress-0.22.4.tgz", + "integrity": "sha512-oZUnLO/SpYdThaBKefDeOiVlr0Rie4Ppx3FzMnMyLtJnI5GlBMNjqYqMy/4+umm/iC+ZDJfI+IlDKxv5fZnYzA==", + "dev": true, + "dependencies": { + "@docsearch/css": "^3.0.0", + "@docsearch/js": "^3.0.0", + "@vitejs/plugin-vue": "^2.3.2", + "prismjs": "^1.25.0", + "vite": "^2.9.7", + "vue": "^3.2.33" + }, + "bin": { + "vitepress": "bin/vitepress.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vue": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.33.tgz", + "integrity": "sha512-si1ExAlDUrLSIg/V7D/GgA4twJwfsfgG+t9w10z38HhL/HA07132pUQ2KuwAo8qbCyMJ9e6OqrmWrOCr+jW7ZQ==", + "dev": true, + "dependencies": { + "@vue/compiler-dom": "3.2.33", + "@vue/compiler-sfc": "3.2.33", + "@vue/runtime-dom": "3.2.33", + "@vue/server-renderer": "3.2.33", + "@vue/shared": "3.2.33" + } + } + } +} diff --git a/node_modules/@algolia/autocomplete-core/README.md b/node_modules/@algolia/autocomplete-core/README.md new file mode 100644 index 0000000000..c3e83bb914 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/README.md @@ -0,0 +1,17 @@ +# @algolia/autocomplete-core + +The [`autocomplete-core`](https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-core/createAutocomplete) package is the foundation of Autocomplete. It exposes primitives to build an autocomplete experience. + +You likely don’t need to use this package directly unless you’re building a [renderer](https://www.algolia.com/doc/ui-libraries/autocomplete/guides/creating-a-renderer). + +## Installation + +```sh +yarn add @algolia/autocomplete-core +# or +npm install @algolia/autocomplete-core +``` + +## Documentation + +See [**Documentation**](https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-core). diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/checkOptions.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/checkOptions.d.ts new file mode 100644 index 0000000000..ef6afb1db1 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/checkOptions.d.ts @@ -0,0 +1,2 @@ +import { AutocompleteOptions, BaseItem } from './types'; +export declare function checkOptions(options: AutocompleteOptions): void; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/checkOptions.js b/node_modules/@algolia/autocomplete-core/dist/esm/checkOptions.js new file mode 100644 index 0000000000..8f22cbb246 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/checkOptions.js @@ -0,0 +1,4 @@ +import { warn } from '@algolia/autocomplete-shared'; +export function checkOptions(options) { + process.env.NODE_ENV !== 'production' ? warn(!options.debug, 'The `debug` option is meant for development debugging and should not be used in production.') : void 0; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/createAutocomplete.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/createAutocomplete.d.ts new file mode 100644 index 0000000000..b1b973c652 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/createAutocomplete.d.ts @@ -0,0 +1,8 @@ +import { AutocompleteApi, AutocompleteOptions as AutocompleteCoreOptions, BaseItem } from './types'; +export interface AutocompleteOptionsWithMetadata extends AutocompleteCoreOptions { + /** + * @internal + */ + __autocomplete_metadata?: Record; +} +export declare function createAutocomplete(options: AutocompleteOptionsWithMetadata): AutocompleteApi; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/createAutocomplete.js b/node_modules/@algolia/autocomplete-core/dist/esm/createAutocomplete.js new file mode 100644 index 0000000000..749d66530e --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/createAutocomplete.js @@ -0,0 +1,79 @@ +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import { checkOptions } from './checkOptions'; +import { createStore } from './createStore'; +import { getAutocompleteSetters } from './getAutocompleteSetters'; +import { getDefaultProps } from './getDefaultProps'; +import { getPropGetters } from './getPropGetters'; +import { getMetadata, injectMetadata } from './metadata'; +import { onInput } from './onInput'; +import { stateReducer } from './stateReducer'; +export function createAutocomplete(options) { + checkOptions(options); + var subscribers = []; + var props = getDefaultProps(options, subscribers); + var store = createStore(stateReducer, props, onStoreStateChange); + var setters = getAutocompleteSetters({ + store: store + }); + var propGetters = getPropGetters(_objectSpread({ + props: props, + refresh: refresh, + store: store + }, setters)); + + function onStoreStateChange(_ref) { + var prevState = _ref.prevState, + state = _ref.state; + props.onStateChange(_objectSpread({ + prevState: prevState, + state: state, + refresh: refresh + }, setters)); + } + + function refresh() { + return onInput(_objectSpread({ + event: new Event('input'), + nextState: { + isOpen: store.getState().isOpen + }, + props: props, + query: store.getState().query, + refresh: refresh, + store: store + }, setters)); + } + + props.plugins.forEach(function (plugin) { + var _plugin$subscribe; + + return (_plugin$subscribe = plugin.subscribe) === null || _plugin$subscribe === void 0 ? void 0 : _plugin$subscribe.call(plugin, _objectSpread(_objectSpread({}, setters), {}, { + refresh: refresh, + onSelect: function onSelect(fn) { + subscribers.push({ + onSelect: fn + }); + }, + onActive: function onActive(fn) { + subscribers.push({ + onActive: fn + }); + } + })); + }); + injectMetadata({ + metadata: getMetadata({ + plugins: props.plugins, + options: options + }), + environment: props.environment + }); + return _objectSpread(_objectSpread({ + refresh: refresh + }, propGetters), setters); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/createStore.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/createStore.d.ts new file mode 100644 index 0000000000..1aec83acf7 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/createStore.d.ts @@ -0,0 +1,7 @@ +import { AutocompleteState, AutocompleteStore, BaseItem, InternalAutocompleteOptions, Reducer } from './types'; +declare type OnStoreStateChange = ({ prevState, state, }: { + prevState: AutocompleteState; + state: AutocompleteState; +}) => void; +export declare function createStore(reducer: Reducer, props: InternalAutocompleteOptions, onStoreStateChange: OnStoreStateChange): AutocompleteStore; +export {}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/createStore.js b/node_modules/@algolia/autocomplete-core/dist/esm/createStore.js new file mode 100644 index 0000000000..f3a77cfc20 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/createStore.js @@ -0,0 +1,29 @@ +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import { createCancelablePromiseList } from './utils'; +export function createStore(reducer, props, onStoreStateChange) { + var state = props.initialState; + return { + getState: function getState() { + return state; + }, + dispatch: function dispatch(action, payload) { + var prevState = _objectSpread({}, state); + + state = reducer(state, { + type: action, + props: props, + payload: payload + }); + onStoreStateChange({ + state: state, + prevState: prevState + }); + }, + pendingRequests: createCancelablePromiseList() + }; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/getAutocompleteSetters.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/getAutocompleteSetters.d.ts new file mode 100644 index 0000000000..9124d8d2ec --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/getAutocompleteSetters.d.ts @@ -0,0 +1,13 @@ +import { AutocompleteCollection, AutocompleteStore, BaseItem } from './types'; +interface GetAutocompleteSettersOptions { + store: AutocompleteStore; +} +export declare function getAutocompleteSetters({ store, }: GetAutocompleteSettersOptions): { + setActiveItemId: import("./types").StateUpdater; + setQuery: import("./types").StateUpdater; + setCollections: import("./types").StateUpdater<(AutocompleteCollection | import("./types").AutocompleteCollectionItemsArray)[]>; + setIsOpen: import("./types").StateUpdater; + setStatus: import("./types").StateUpdater<"idle" | "loading" | "stalled" | "error">; + setContext: import("./types").StateUpdater; +}; +export {}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/getAutocompleteSetters.js b/node_modules/@algolia/autocomplete-core/dist/esm/getAutocompleteSetters.js new file mode 100644 index 0000000000..56ff8ed5f3 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/getAutocompleteSetters.js @@ -0,0 +1,55 @@ +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import { flatten } from '@algolia/autocomplete-shared'; +export function getAutocompleteSetters(_ref) { + var store = _ref.store; + + var setActiveItemId = function setActiveItemId(value) { + store.dispatch('setActiveItemId', value); + }; + + var setQuery = function setQuery(value) { + store.dispatch('setQuery', value); + }; + + var setCollections = function setCollections(rawValue) { + var baseItemId = 0; + var value = rawValue.map(function (collection) { + return _objectSpread(_objectSpread({}, collection), {}, { + // We flatten the stored items to support calling `getAlgoliaResults` + // from the source itself. + items: flatten(collection.items).map(function (item) { + return _objectSpread(_objectSpread({}, item), {}, { + __autocomplete_id: baseItemId++ + }); + }) + }); + }); + store.dispatch('setCollections', value); + }; + + var setIsOpen = function setIsOpen(value) { + store.dispatch('setIsOpen', value); + }; + + var setStatus = function setStatus(value) { + store.dispatch('setStatus', value); + }; + + var setContext = function setContext(value) { + store.dispatch('setContext', value); + }; + + return { + setActiveItemId: setActiveItemId, + setQuery: setQuery, + setCollections: setCollections, + setIsOpen: setIsOpen, + setStatus: setStatus, + setContext: setContext + }; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/getCompletion.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/getCompletion.d.ts new file mode 100644 index 0000000000..f06b2a2a71 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/getCompletion.d.ts @@ -0,0 +1,6 @@ +import { AutocompleteState, BaseItem } from './types'; +interface GetCompletionProps { + state: AutocompleteState; +} +export declare function getCompletion({ state, }: GetCompletionProps): string | null; +export {}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/getCompletion.js b/node_modules/@algolia/autocomplete-core/dist/esm/getCompletion.js new file mode 100644 index 0000000000..d6c71f9c0c --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/getCompletion.js @@ -0,0 +1,12 @@ +import { getActiveItem } from './utils'; +export function getCompletion(_ref) { + var _getActiveItem; + + var state = _ref.state; + + if (state.isOpen === false || state.activeItemId === null) { + return null; + } + + return ((_getActiveItem = getActiveItem(state)) === null || _getActiveItem === void 0 ? void 0 : _getActiveItem.itemInputValue) || null; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/getDefaultProps.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/getDefaultProps.d.ts new file mode 100644 index 0000000000..4dd7dbad59 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/getDefaultProps.d.ts @@ -0,0 +1,2 @@ +import { AutocompleteOptions, AutocompleteSubscribers, BaseItem, InternalAutocompleteOptions } from './types'; +export declare function getDefaultProps(props: AutocompleteOptions, pluginSubscribers: AutocompleteSubscribers): InternalAutocompleteOptions; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/getDefaultProps.js b/node_modules/@algolia/autocomplete-core/dist/esm/getDefaultProps.js new file mode 100644 index 0000000000..df0974eac0 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/getDefaultProps.js @@ -0,0 +1,136 @@ +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import { getItemsCount, generateAutocompleteId, flatten } from '@algolia/autocomplete-shared'; +import { getNormalizedSources } from './utils'; +export function getDefaultProps(props, pluginSubscribers) { + var _props$id; + + /* eslint-disable no-restricted-globals */ + var environment = typeof window !== 'undefined' ? window : {}; + /* eslint-enable no-restricted-globals */ + + var plugins = props.plugins || []; + return _objectSpread(_objectSpread({ + debug: false, + openOnFocus: false, + placeholder: '', + autoFocus: false, + defaultActiveItemId: null, + stallThreshold: 300, + environment: environment, + shouldPanelOpen: function shouldPanelOpen(_ref) { + var state = _ref.state; + return getItemsCount(state) > 0; + }, + reshape: function reshape(_ref2) { + var sources = _ref2.sources; + return sources; + } + }, props), {}, { + // Since `generateAutocompleteId` triggers a side effect (it increments + // an internal counter), we don't want to execute it if unnecessary. + id: (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : generateAutocompleteId(), + plugins: plugins, + // The following props need to be deeply defaulted. + initialState: _objectSpread({ + activeItemId: null, + query: '', + completion: null, + collections: [], + isOpen: false, + status: 'idle', + context: {} + }, props.initialState), + onStateChange: function onStateChange(params) { + var _props$onStateChange; + + (_props$onStateChange = props.onStateChange) === null || _props$onStateChange === void 0 ? void 0 : _props$onStateChange.call(props, params); + plugins.forEach(function (x) { + var _x$onStateChange; + + return (_x$onStateChange = x.onStateChange) === null || _x$onStateChange === void 0 ? void 0 : _x$onStateChange.call(x, params); + }); + }, + onSubmit: function onSubmit(params) { + var _props$onSubmit; + + (_props$onSubmit = props.onSubmit) === null || _props$onSubmit === void 0 ? void 0 : _props$onSubmit.call(props, params); + plugins.forEach(function (x) { + var _x$onSubmit; + + return (_x$onSubmit = x.onSubmit) === null || _x$onSubmit === void 0 ? void 0 : _x$onSubmit.call(x, params); + }); + }, + onReset: function onReset(params) { + var _props$onReset; + + (_props$onReset = props.onReset) === null || _props$onReset === void 0 ? void 0 : _props$onReset.call(props, params); + plugins.forEach(function (x) { + var _x$onReset; + + return (_x$onReset = x.onReset) === null || _x$onReset === void 0 ? void 0 : _x$onReset.call(x, params); + }); + }, + getSources: function getSources(params) { + return Promise.all([].concat(_toConsumableArray(plugins.map(function (plugin) { + return plugin.getSources; + })), [props.getSources]).filter(Boolean).map(function (getSources) { + return getNormalizedSources(getSources, params); + })).then(function (nested) { + return flatten(nested); + }).then(function (sources) { + return sources.map(function (source) { + return _objectSpread(_objectSpread({}, source), {}, { + onSelect: function onSelect(params) { + source.onSelect(params); + pluginSubscribers.forEach(function (x) { + var _x$onSelect; + + return (_x$onSelect = x.onSelect) === null || _x$onSelect === void 0 ? void 0 : _x$onSelect.call(x, params); + }); + }, + onActive: function onActive(params) { + source.onActive(params); + pluginSubscribers.forEach(function (x) { + var _x$onActive; + + return (_x$onActive = x.onActive) === null || _x$onActive === void 0 ? void 0 : _x$onActive.call(x, params); + }); + } + }); + }); + }); + }, + navigator: _objectSpread({ + navigate: function navigate(_ref3) { + var itemUrl = _ref3.itemUrl; + environment.location.assign(itemUrl); + }, + navigateNewTab: function navigateNewTab(_ref4) { + var itemUrl = _ref4.itemUrl; + var windowReference = environment.open(itemUrl, '_blank', 'noopener'); + windowReference === null || windowReference === void 0 ? void 0 : windowReference.focus(); + }, + navigateNewWindow: function navigateNewWindow(_ref5) { + var itemUrl = _ref5.itemUrl; + environment.open(itemUrl, '_blank', 'noopener'); + } + }, props.navigator) + }); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/getPropGetters.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/getPropGetters.d.ts new file mode 100644 index 0000000000..27f3adf210 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/getPropGetters.d.ts @@ -0,0 +1,16 @@ +import { AutocompleteScopeApi, AutocompleteStore, BaseItem, GetEnvironmentProps, GetFormProps, GetInputProps, GetItemProps, GetLabelProps, GetListProps, GetPanelProps, GetRootProps, InternalAutocompleteOptions } from './types'; +interface GetPropGettersOptions extends AutocompleteScopeApi { + store: AutocompleteStore; + props: InternalAutocompleteOptions; +} +export declare function getPropGetters({ props, refresh, store, ...setters }: GetPropGettersOptions): { + getEnvironmentProps: GetEnvironmentProps; + getRootProps: GetRootProps; + getFormProps: GetFormProps; + getLabelProps: GetLabelProps; + getInputProps: GetInputProps; + getPanelProps: GetPanelProps; + getListProps: GetListProps; + getItemProps: GetItemProps; +}; +export {}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/getPropGetters.js b/node_modules/@algolia/autocomplete-core/dist/esm/getPropGetters.js new file mode 100644 index 0000000000..b1fdac96fe --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/getPropGetters.js @@ -0,0 +1,333 @@ +var _excluded = ["props", "refresh", "store"], + _excluded2 = ["inputElement", "formElement", "panelElement"], + _excluded3 = ["inputElement"], + _excluded4 = ["inputElement", "maxLength"], + _excluded5 = ["item", "source"]; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +import { onInput } from './onInput'; +import { onKeyDown as _onKeyDown } from './onKeyDown'; +import { getActiveItem, isOrContainsNode } from './utils'; +export function getPropGetters(_ref) { + var props = _ref.props, + refresh = _ref.refresh, + store = _ref.store, + setters = _objectWithoutProperties(_ref, _excluded); + + var getEnvironmentProps = function getEnvironmentProps(providedProps) { + var inputElement = providedProps.inputElement, + formElement = providedProps.formElement, + panelElement = providedProps.panelElement, + rest = _objectWithoutProperties(providedProps, _excluded2); + + return _objectSpread({ + // On touch devices, we do not rely on the native `blur` event of the + // input to close the panel, but rather on a custom `touchstart` event + // outside of the autocomplete elements. + // This ensures a working experience on mobile because we blur the input + // on touch devices when the user starts scrolling (`touchmove`). + // @TODO: support cases where there are multiple Autocomplete instances. + // Right now, a second instance makes this computation return false. + onTouchStart: function onTouchStart(event) { + // The `onTouchStart` event shouldn't trigger the `blur` handler when + // it's not an interaction with Autocomplete. We detect it with the + // following heuristics: + // - the panel is closed AND there are no pending requests + // (no interaction with the autocomplete, no future state updates) + // - OR the touched target is the input element (should open the panel) + var isAutocompleteInteraction = store.getState().isOpen || !store.pendingRequests.isEmpty(); + + if (!isAutocompleteInteraction || event.target === inputElement) { + return; + } + + var isTargetWithinAutocomplete = [formElement, panelElement].some(function (contextNode) { + return isOrContainsNode(contextNode, event.target); + }); + + if (isTargetWithinAutocomplete === false) { + store.dispatch('blur', null); // If requests are still pending when the user closes the panel, they + // could reopen the panel once they resolve. + // We want to prevent any subsequent query from reopening the panel + // because it would result in an unsolicited UI behavior. + + if (!props.debug) { + store.pendingRequests.cancelAll(); + } + } + }, + // When scrolling on touch devices (mobiles, tablets, etc.), we want to + // mimic the native platform behavior where the input is blurred to + // hide the virtual keyboard. This gives more vertical space to + // discover all the suggestions showing up in the panel. + onTouchMove: function onTouchMove(event) { + if (store.getState().isOpen === false || inputElement !== props.environment.document.activeElement || event.target === inputElement) { + return; + } + + inputElement.blur(); + } + }, rest); + }; + + var getRootProps = function getRootProps(rest) { + return _objectSpread({ + role: 'combobox', + 'aria-expanded': store.getState().isOpen, + 'aria-haspopup': 'listbox', + 'aria-owns': store.getState().isOpen ? "".concat(props.id, "-list") : undefined, + 'aria-labelledby': "".concat(props.id, "-label") + }, rest); + }; + + var getFormProps = function getFormProps(providedProps) { + var inputElement = providedProps.inputElement, + rest = _objectWithoutProperties(providedProps, _excluded3); + + return _objectSpread({ + action: '', + noValidate: true, + role: 'search', + onSubmit: function onSubmit(event) { + var _providedProps$inputE; + + event.preventDefault(); + props.onSubmit(_objectSpread({ + event: event, + refresh: refresh, + state: store.getState() + }, setters)); + store.dispatch('submit', null); + (_providedProps$inputE = providedProps.inputElement) === null || _providedProps$inputE === void 0 ? void 0 : _providedProps$inputE.blur(); + }, + onReset: function onReset(event) { + var _providedProps$inputE2; + + event.preventDefault(); + props.onReset(_objectSpread({ + event: event, + refresh: refresh, + state: store.getState() + }, setters)); + store.dispatch('reset', null); + (_providedProps$inputE2 = providedProps.inputElement) === null || _providedProps$inputE2 === void 0 ? void 0 : _providedProps$inputE2.focus(); + } + }, rest); + }; + + var getInputProps = function getInputProps(providedProps) { + function onFocus(event) { + // We want to trigger a query when `openOnFocus` is true + // because the panel should open with the current query. + if (props.openOnFocus || Boolean(store.getState().query)) { + onInput(_objectSpread({ + event: event, + props: props, + query: store.getState().completion || store.getState().query, + refresh: refresh, + store: store + }, setters)); + } + + store.dispatch('focus', null); + } + + var isTouchDevice = ('ontouchstart' in props.environment); + + var _ref2 = providedProps || {}, + inputElement = _ref2.inputElement, + _ref2$maxLength = _ref2.maxLength, + maxLength = _ref2$maxLength === void 0 ? 512 : _ref2$maxLength, + rest = _objectWithoutProperties(_ref2, _excluded4); + + var activeItem = getActiveItem(store.getState()); + return _objectSpread({ + 'aria-autocomplete': 'both', + 'aria-activedescendant': store.getState().isOpen && store.getState().activeItemId !== null ? "".concat(props.id, "-item-").concat(store.getState().activeItemId) : undefined, + 'aria-controls': store.getState().isOpen ? "".concat(props.id, "-list") : undefined, + 'aria-labelledby': "".concat(props.id, "-label"), + value: store.getState().completion || store.getState().query, + id: "".concat(props.id, "-input"), + autoComplete: 'off', + autoCorrect: 'off', + autoCapitalize: 'off', + enterKeyHint: activeItem !== null && activeItem !== void 0 && activeItem.itemUrl ? 'go' : 'search', + spellCheck: 'false', + autoFocus: props.autoFocus, + placeholder: props.placeholder, + maxLength: maxLength, + type: 'search', + onChange: function onChange(event) { + onInput(_objectSpread({ + event: event, + props: props, + query: event.currentTarget.value.slice(0, maxLength), + refresh: refresh, + store: store + }, setters)); + }, + onKeyDown: function onKeyDown(event) { + _onKeyDown(_objectSpread({ + event: event, + props: props, + refresh: refresh, + store: store + }, setters)); + }, + onFocus: onFocus, + onBlur: function onBlur() { + // We do rely on the `blur` event on touch devices. + // See explanation in `onTouchStart`. + if (!isTouchDevice) { + store.dispatch('blur', null); // If requests are still pending when the user closes the panel, they + // could reopen the panel once they resolve. + // We want to prevent any subsequent query from reopening the panel + // because it would result in an unsolicited UI behavior. + + if (!props.debug) { + store.pendingRequests.cancelAll(); + } + } + }, + onClick: function onClick(event) { + // When the panel is closed and you click on the input while + // the input is focused, the `onFocus` event is not triggered + // (default browser behavior). + // In an autocomplete context, it makes sense to open the panel in this + // case. + // We mimic this event by catching the `onClick` event which + // triggers the `onFocus` for the panel to open. + if (providedProps.inputElement === props.environment.document.activeElement && !store.getState().isOpen) { + onFocus(event); + } + } + }, rest); + }; + + var getLabelProps = function getLabelProps(rest) { + return _objectSpread({ + htmlFor: "".concat(props.id, "-input"), + id: "".concat(props.id, "-label") + }, rest); + }; + + var getListProps = function getListProps(rest) { + return _objectSpread({ + role: 'listbox', + 'aria-labelledby': "".concat(props.id, "-label"), + id: "".concat(props.id, "-list") + }, rest); + }; + + var getPanelProps = function getPanelProps(rest) { + return _objectSpread({ + onMouseDown: function onMouseDown(event) { + // Prevents the `activeElement` from being changed to the panel so + // that the blur event is not triggered, otherwise it closes the + // panel. + event.preventDefault(); + }, + onMouseLeave: function onMouseLeave() { + store.dispatch('mouseleave', null); + } + }, rest); + }; + + var getItemProps = function getItemProps(providedProps) { + var item = providedProps.item, + source = providedProps.source, + rest = _objectWithoutProperties(providedProps, _excluded5); + + return _objectSpread({ + id: "".concat(props.id, "-item-").concat(item.__autocomplete_id), + role: 'option', + 'aria-selected': store.getState().activeItemId === item.__autocomplete_id, + onMouseMove: function onMouseMove(event) { + if (item.__autocomplete_id === store.getState().activeItemId) { + return; + } + + store.dispatch('mousemove', item.__autocomplete_id); + var activeItem = getActiveItem(store.getState()); + + if (store.getState().activeItemId !== null && activeItem) { + var _item = activeItem.item, + itemInputValue = activeItem.itemInputValue, + itemUrl = activeItem.itemUrl, + _source = activeItem.source; + + _source.onActive(_objectSpread({ + event: event, + item: _item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: _source, + state: store.getState() + }, setters)); + } + }, + onMouseDown: function onMouseDown(event) { + // Prevents the `activeElement` from being changed to the item so it + // can remain with the current `activeElement`. + event.preventDefault(); + }, + onClick: function onClick(event) { + var itemInputValue = source.getItemInputValue({ + item: item, + state: store.getState() + }); + var itemUrl = source.getItemUrl({ + item: item, + state: store.getState() + }); // If `getItemUrl` is provided, it means that the suggestion + // is a link, not plain text that aims at updating the query. + // We can therefore skip the state change because it will update + // the `activeItemId`, resulting in a UI flash, especially + // noticeable on mobile. + + var runPreCommand = itemUrl ? Promise.resolve() : onInput(_objectSpread({ + event: event, + nextState: { + isOpen: false + }, + props: props, + query: itemInputValue, + refresh: refresh, + store: store + }, setters)); + runPreCommand.then(function () { + source.onSelect(_objectSpread({ + event: event, + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: source, + state: store.getState() + }, setters)); + }); + } + }, rest); + }; + + return { + getEnvironmentProps: getEnvironmentProps, + getRootProps: getRootProps, + getFormProps: getFormProps, + getLabelProps: getLabelProps, + getInputProps: getInputProps, + getPanelProps: getPanelProps, + getListProps: getListProps, + getItemProps: getItemProps + }; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/index.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/index.d.ts new file mode 100644 index 0000000000..ce100ed6ab --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/index.d.ts @@ -0,0 +1,3 @@ +export * from './createAutocomplete'; +export * from './getDefaultProps'; +export * from './types'; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/index.js b/node_modules/@algolia/autocomplete-core/dist/esm/index.js new file mode 100644 index 0000000000..012b303473 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/index.js @@ -0,0 +1,3 @@ +export * from './createAutocomplete'; +export * from './getDefaultProps'; +export * from './types'; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/metadata.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/metadata.d.ts new file mode 100644 index 0000000000..efa9c1c14a --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/metadata.d.ts @@ -0,0 +1,33 @@ +import { UserAgent } from '@algolia/autocomplete-shared'; +import { AutocompleteEnvironment, AutocompleteOptionsWithMetadata, AutocompletePlugin, BaseItem } from '.'; +declare type AutocompleteMetadata = { + plugins: Array<{ + name: string | undefined; + options: string[]; + }>; + options: Record; + ua: UserAgent[]; +}; +declare type GetMetadataParams = { + plugins: Array>; + options: AutocompleteOptionsWithMetadata; +}; +export declare function getMetadata({ plugins, options, }: GetMetadataParams): { + plugins: { + name: string | undefined; + options: string[]; + }[]; + options: { + 'autocomplete-core': string[]; + }; + ua: { + segment: string; + version: string; + }[]; +}; +declare type InlineMetadataParams = { + metadata: AutocompleteMetadata; + environment: AutocompleteEnvironment; +}; +export declare function injectMetadata({ metadata, environment, }: InlineMetadataParams): void; +export {}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/metadata.js b/node_modules/@algolia/autocomplete-core/dist/esm/metadata.js new file mode 100644 index 0000000000..54c37534d8 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/metadata.js @@ -0,0 +1,44 @@ +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import { userAgents } from '@algolia/autocomplete-shared'; +export function getMetadata(_ref) { + var _, _options$__autocomple, _options$__autocomple2, _options$__autocomple3; + + var plugins = _ref.plugins, + options = _ref.options; + var optionsKey = (_ = (((_options$__autocomple = options.__autocomplete_metadata) === null || _options$__autocomple === void 0 ? void 0 : _options$__autocomple.userAgents) || [])[0]) === null || _ === void 0 ? void 0 : _.segment; + var extraOptions = optionsKey ? _defineProperty({}, optionsKey, Object.keys(((_options$__autocomple2 = options.__autocomplete_metadata) === null || _options$__autocomple2 === void 0 ? void 0 : _options$__autocomple2.options) || {})) : {}; + return { + plugins: plugins.map(function (plugin) { + return { + name: plugin.name, + options: Object.keys(plugin.__autocomplete_pluginOptions || []) + }; + }), + options: _objectSpread({ + 'autocomplete-core': Object.keys(options) + }, extraOptions), + ua: userAgents.concat(((_options$__autocomple3 = options.__autocomplete_metadata) === null || _options$__autocomple3 === void 0 ? void 0 : _options$__autocomple3.userAgents) || []) + }; +} +export function injectMetadata(_ref3) { + var _environment$navigato; + + var metadata = _ref3.metadata, + environment = _ref3.environment; + var isMetadataEnabled = (_environment$navigato = environment.navigator) === null || _environment$navigato === void 0 ? void 0 : _environment$navigato.userAgent.includes('Algolia Crawler'); + + if (isMetadataEnabled) { + var metadataContainer = environment.document.createElement('meta'); + var headRef = environment.document.querySelector('head'); + metadataContainer.name = 'algolia:metadata'; + setTimeout(function () { + metadataContainer.content = JSON.stringify(metadata); + headRef.appendChild(metadataContainer); + }, 0); + } +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/onInput.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/onInput.d.ts new file mode 100644 index 0000000000..88b699ada2 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/onInput.d.ts @@ -0,0 +1,18 @@ +import { AutocompleteScopeApi, AutocompleteState, AutocompleteStore, BaseItem, InternalAutocompleteOptions } from './types'; +import { CancelablePromise } from './utils'; +interface OnInputParams extends AutocompleteScopeApi { + event: any; + /** + * The next partial state to apply after the function is called. + * + * This is useful when we call `onInput` in a different scenario than an + * actual input. For example, we use `onInput` when we click on an item, + * but we want to close the panel in that case. + */ + nextState?: Partial>; + props: InternalAutocompleteOptions; + query: string; + store: AutocompleteStore; +} +export declare function onInput({ event, nextState, props, query, refresh, store, ...setters }: OnInputParams): CancelablePromise; +export {}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/onInput.js b/node_modules/@algolia/autocomplete-core/dist/esm/onInput.js new file mode 100644 index 0000000000..e4cc3ef041 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/onInput.js @@ -0,0 +1,134 @@ +var _excluded = ["event", "nextState", "props", "query", "refresh", "store"]; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +import { reshape } from './reshape'; +import { preResolve, resolve, postResolve } from './resolve'; +import { cancelable, createConcurrentSafePromise, getActiveItem } from './utils'; +var lastStalledId = null; +var runConcurrentSafePromise = createConcurrentSafePromise(); +export function onInput(_ref) { + var event = _ref.event, + _ref$nextState = _ref.nextState, + nextState = _ref$nextState === void 0 ? {} : _ref$nextState, + props = _ref.props, + query = _ref.query, + refresh = _ref.refresh, + store = _ref.store, + setters = _objectWithoutProperties(_ref, _excluded); + + if (lastStalledId) { + props.environment.clearTimeout(lastStalledId); + } + + var setCollections = setters.setCollections, + setIsOpen = setters.setIsOpen, + setQuery = setters.setQuery, + setActiveItemId = setters.setActiveItemId, + setStatus = setters.setStatus; + setQuery(query); + setActiveItemId(props.defaultActiveItemId); + + if (!query && props.openOnFocus === false) { + var _nextState$isOpen; + + var collections = store.getState().collections.map(function (collection) { + return _objectSpread(_objectSpread({}, collection), {}, { + items: [] + }); + }); + setStatus('idle'); + setCollections(collections); + setIsOpen((_nextState$isOpen = nextState.isOpen) !== null && _nextState$isOpen !== void 0 ? _nextState$isOpen : props.shouldPanelOpen({ + state: store.getState() + })); // We make sure to update the latest resolved value of the tracked + // promises to keep late resolving promises from "cancelling" the state + // updates performed in this code path. + // We chain with a void promise to respect `onInput`'s expected return type. + + var _request = cancelable(runConcurrentSafePromise(collections).then(function () { + return Promise.resolve(); + })); + + return store.pendingRequests.add(_request); + } + + setStatus('loading'); + lastStalledId = props.environment.setTimeout(function () { + setStatus('stalled'); + }, props.stallThreshold); // We track the entire promise chain triggered by `onInput` before mutating + // the Autocomplete state to make sure that any state manipulation is based on + // fresh data regardless of when promises individually resolve. + // We don't track nested promises and only rely on the full chain resolution, + // meaning we should only ever manipulate the state once this concurrent-safe + // promise is resolved. + + var request = cancelable(runConcurrentSafePromise(props.getSources(_objectSpread({ + query: query, + refresh: refresh, + state: store.getState() + }, setters)).then(function (sources) { + return Promise.all(sources.map(function (source) { + return Promise.resolve(source.getItems(_objectSpread({ + query: query, + refresh: refresh, + state: store.getState() + }, setters))).then(function (itemsOrDescription) { + return preResolve(itemsOrDescription, source.sourceId); + }); + })).then(resolve).then(function (responses) { + return postResolve(responses, sources); + }).then(function (collections) { + return reshape({ + collections: collections, + props: props, + state: store.getState() + }); + }); + }))).then(function (collections) { + var _nextState$isOpen2; + + // Parameters passed to `onInput` could be stale when the following code + // executes, because `onInput` calls may not resolve in order. + // If it becomes a problem we'll need to save the last passed parameters. + // See: https://codesandbox.io/s/agitated-cookies-y290z + setStatus('idle'); + setCollections(collections); + var isPanelOpen = props.shouldPanelOpen({ + state: store.getState() + }); + setIsOpen((_nextState$isOpen2 = nextState.isOpen) !== null && _nextState$isOpen2 !== void 0 ? _nextState$isOpen2 : props.openOnFocus && !query && isPanelOpen || isPanelOpen); + var highlightedItem = getActiveItem(store.getState()); + + if (store.getState().activeItemId !== null && highlightedItem) { + var item = highlightedItem.item, + itemInputValue = highlightedItem.itemInputValue, + itemUrl = highlightedItem.itemUrl, + source = highlightedItem.source; + source.onActive(_objectSpread({ + event: event, + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: source, + state: store.getState() + }, setters)); + } + }).finally(function () { + setStatus('idle'); + + if (lastStalledId) { + props.environment.clearTimeout(lastStalledId); + } + }); + return store.pendingRequests.add(request); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/onKeyDown.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/onKeyDown.d.ts new file mode 100644 index 0000000000..51a1dceece --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/onKeyDown.d.ts @@ -0,0 +1,8 @@ +import { AutocompleteScopeApi, AutocompleteStore, BaseItem, InternalAutocompleteOptions } from './types'; +interface OnKeyDownOptions extends AutocompleteScopeApi { + event: KeyboardEvent; + props: InternalAutocompleteOptions; + store: AutocompleteStore; +} +export declare function onKeyDown({ event, props, refresh, store, ...setters }: OnKeyDownOptions): void; +export {}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/onKeyDown.js b/node_modules/@algolia/autocomplete-core/dist/esm/onKeyDown.js new file mode 100644 index 0000000000..cefb5f1ea1 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/onKeyDown.js @@ -0,0 +1,190 @@ +var _excluded = ["event", "props", "refresh", "store"]; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +import { onInput } from './onInput'; +import { getActiveItem } from './utils'; +export function onKeyDown(_ref) { + var event = _ref.event, + props = _ref.props, + refresh = _ref.refresh, + store = _ref.store, + setters = _objectWithoutProperties(_ref, _excluded); + + if (event.key === 'ArrowUp' || event.key === 'ArrowDown') { + // eslint-disable-next-line no-inner-declarations + var triggerScrollIntoView = function triggerScrollIntoView() { + var nodeItem = props.environment.document.getElementById("".concat(props.id, "-item-").concat(store.getState().activeItemId)); + + if (nodeItem) { + if (nodeItem.scrollIntoViewIfNeeded) { + nodeItem.scrollIntoViewIfNeeded(false); + } else { + nodeItem.scrollIntoView(false); + } + } + }; // eslint-disable-next-line no-inner-declarations + + + var triggerOnActive = function triggerOnActive() { + var highlightedItem = getActiveItem(store.getState()); + + if (store.getState().activeItemId !== null && highlightedItem) { + var item = highlightedItem.item, + itemInputValue = highlightedItem.itemInputValue, + itemUrl = highlightedItem.itemUrl, + source = highlightedItem.source; + source.onActive(_objectSpread({ + event: event, + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: source, + state: store.getState() + }, setters)); + } + }; // Default browser behavior changes the caret placement on ArrowUp and + // ArrowDown. + + + event.preventDefault(); // When re-opening the panel, we need to split the logic to keep the actions + // synchronized as `onInput` returns a promise. + + if (store.getState().isOpen === false && (props.openOnFocus || Boolean(store.getState().query))) { + onInput(_objectSpread({ + event: event, + props: props, + query: store.getState().query, + refresh: refresh, + store: store + }, setters)).then(function () { + store.dispatch(event.key, { + nextActiveItemId: props.defaultActiveItemId + }); + triggerOnActive(); // Since we rely on the DOM, we need to wait for all the micro tasks to + // finish (which include re-opening the panel) to make sure all the + // elements are available. + + setTimeout(triggerScrollIntoView, 0); + }); + } else { + store.dispatch(event.key, {}); + triggerOnActive(); + triggerScrollIntoView(); + } + } else if (event.key === 'Escape') { + // This prevents the default browser behavior on `input[type="search"]` + // from removing the query right away because we first want to close the + // panel. + event.preventDefault(); + store.dispatch(event.key, null); // Hitting the `Escape` key signals the end of a user interaction with the + // autocomplete. At this point, we should ignore any requests that are still + // pending and could reopen the panel once they resolve, because that would + // result in an unsolicited UI behavior. + + store.pendingRequests.cancelAll(); + } else if (event.key === 'Enter') { + // No active item, so we let the browser handle the native `onSubmit` form + // event. + if (store.getState().activeItemId === null || store.getState().collections.every(function (collection) { + return collection.items.length === 0; + })) { + return; + } // This prevents the `onSubmit` event to be sent because an item is + // highlighted. + + + event.preventDefault(); + + var _ref2 = getActiveItem(store.getState()), + item = _ref2.item, + itemInputValue = _ref2.itemInputValue, + itemUrl = _ref2.itemUrl, + source = _ref2.source; + + if (event.metaKey || event.ctrlKey) { + if (itemUrl !== undefined) { + source.onSelect(_objectSpread({ + event: event, + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: source, + state: store.getState() + }, setters)); + props.navigator.navigateNewTab({ + itemUrl: itemUrl, + item: item, + state: store.getState() + }); + } + } else if (event.shiftKey) { + if (itemUrl !== undefined) { + source.onSelect(_objectSpread({ + event: event, + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: source, + state: store.getState() + }, setters)); + props.navigator.navigateNewWindow({ + itemUrl: itemUrl, + item: item, + state: store.getState() + }); + } + } else if (event.altKey) {// Keep native browser behavior + } else { + if (itemUrl !== undefined) { + source.onSelect(_objectSpread({ + event: event, + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: source, + state: store.getState() + }, setters)); + props.navigator.navigate({ + itemUrl: itemUrl, + item: item, + state: store.getState() + }); + return; + } + + onInput(_objectSpread({ + event: event, + nextState: { + isOpen: false + }, + props: props, + query: itemInputValue, + refresh: refresh, + store: store + }, setters)).then(function () { + source.onSelect(_objectSpread({ + event: event, + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: source, + state: store.getState() + }, setters)); + }); + } + } +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/reshape.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/reshape.d.ts new file mode 100644 index 0000000000..02a207b0b0 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/reshape.d.ts @@ -0,0 +1,11 @@ +import { AutocompleteCollection, AutocompleteState, BaseItem, InternalAutocompleteOptions } from './types'; +declare type ReshapeParams = { + collections: Array>; + props: InternalAutocompleteOptions; + state: AutocompleteState; +}; +export declare function reshape({ collections, props, state, }: ReshapeParams): { + source: import("./types").AutocompleteReshapeSource; + items: TItem[]; +}[]; +export {}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/reshape.js b/node_modules/@algolia/autocomplete-core/dist/esm/reshape.js new file mode 100644 index 0000000000..0be9729d44 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/reshape.js @@ -0,0 +1,34 @@ +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import { flatten } from '@algolia/autocomplete-shared'; +export function reshape(_ref) { + var collections = _ref.collections, + props = _ref.props, + state = _ref.state; + // Sources are grouped by `sourceId` to conveniently pick them via destructuring. + // Example: `const { recentSearchesPlugin } = sourcesBySourceId` + var sourcesBySourceId = collections.reduce(function (acc, collection) { + return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, collection.source.sourceId, _objectSpread(_objectSpread({}, collection.source), {}, { + getItems: function getItems() { + // We provide the resolved items from the collection to the `reshape` prop. + return flatten(collection.items); + } + }))); + }, {}); + var reshapeSources = props.reshape({ + sources: Object.values(sourcesBySourceId), + sourcesBySourceId: sourcesBySourceId, + state: state + }); // We reconstruct the collections with the items modified by the `reshape` prop. + + return flatten(reshapeSources).filter(Boolean).map(function (source) { + return { + source: source, + items: source.getItems() + }; + }); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/resolve.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/resolve.d.ts new file mode 100644 index 0000000000..ef52f2df0d --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/resolve.d.ts @@ -0,0 +1,42 @@ +import type { ExecuteResponse, RequesterDescription, TransformResponse } from '@algolia/autocomplete-preset-algolia'; +import { MultipleQueriesQuery, SearchForFacetValuesResponse, SearchResponse } from '@algolia/client-search'; +import { BaseItem, InternalAutocompleteSource } from './types'; +declare type RequestDescriptionPreResolved = Pick, 'execute' | 'searchClient' | 'transformResponse'> & { + requests: Array<{ + query: MultipleQueriesQuery; + sourceId: string; + transformResponse: TransformResponse; + }>; +}; +declare type RequestDescriptionPreResolvedCustom = { + items: TItem[] | TItem[][]; + sourceId: string; + transformResponse?: undefined; +}; +export declare function preResolve(itemsOrDescription: TItem[] | TItem[][] | RequesterDescription, sourceId: string): RequestDescriptionPreResolved | RequestDescriptionPreResolvedCustom; +export declare function resolve(items: Array | RequestDescriptionPreResolvedCustom>): Promise<(RequestDescriptionPreResolvedCustom | { + items: SearchForFacetValuesResponse | SearchResponse; + sourceId: string; + transformResponse: TransformResponse; +})[]>; +export declare function postResolve(responses: Array | ExecuteResponse[0]>, sources: Array>): { + source: InternalAutocompleteSource; + items: { + label: string; + count: number; + _highlightResult: { + label: { + value: string; + }; + }; + }[][] | { + label: string; + count: number; + _highlightResult: { + label: { + value: string; + }; + }; + }[] | import("@algolia/client-search").Hit[] | (SearchForFacetValuesResponse | SearchResponse | TItem[] | TItem[][])[]; +}[]; +export {}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/resolve.js b/node_modules/@algolia/autocomplete-core/dist/esm/resolve.js new file mode 100644 index 0000000000..05cb5f06e3 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/resolve.js @@ -0,0 +1,117 @@ +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import { decycle, flatten, invariant } from '@algolia/autocomplete-shared'; +import { mapToAlgoliaResponse } from './utils'; + +function isDescription(item) { + return Boolean(item.execute); +} + +function isRequesterDescription(description) { + return Boolean(description === null || description === void 0 ? void 0 : description.execute); +} + +export function preResolve(itemsOrDescription, sourceId) { + if (isRequesterDescription(itemsOrDescription)) { + return _objectSpread(_objectSpread({}, itemsOrDescription), {}, { + requests: itemsOrDescription.queries.map(function (query) { + return { + query: query, + sourceId: sourceId, + transformResponse: itemsOrDescription.transformResponse + }; + }) + }); + } + + return { + items: itemsOrDescription, + sourceId: sourceId + }; +} +export function resolve(items) { + var packed = items.reduce(function (acc, current) { + if (!isDescription(current)) { + acc.push(current); + return acc; + } + + var searchClient = current.searchClient, + execute = current.execute, + requests = current.requests; + var container = acc.find(function (item) { + return isDescription(current) && isDescription(item) && item.searchClient === searchClient && item.execute === execute; + }); + + if (container) { + var _container$items; + + (_container$items = container.items).push.apply(_container$items, _toConsumableArray(requests)); + } else { + var request = { + execute: execute, + items: requests, + searchClient: searchClient + }; + acc.push(request); + } + + return acc; + }, []); + var values = packed.map(function (maybeDescription) { + if (!isDescription(maybeDescription)) { + return Promise.resolve(maybeDescription); + } + + var _ref = maybeDescription, + execute = _ref.execute, + items = _ref.items, + searchClient = _ref.searchClient; + return execute({ + searchClient: searchClient, + requests: items + }); + }); + return Promise.all(values).then(function (responses) { + return flatten(responses); + }); +} +export function postResolve(responses, sources) { + return sources.map(function (source) { + var matches = responses.filter(function (response) { + return response.sourceId === source.sourceId; + }); + var results = matches.map(function (_ref2) { + var items = _ref2.items; + return items; + }); + var transform = matches[0].transformResponse; + var items = transform ? transform(mapToAlgoliaResponse(results)) : results; + invariant(Array.isArray(items), function () { + return "The `getItems` function from source \"".concat(source.sourceId, "\" must return an array of items but returned type ").concat(JSON.stringify(_typeof(items)), ":\n\n").concat(JSON.stringify(decycle(items), null, 2), ".\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems"); + }); + invariant(items.every(Boolean), "The `getItems` function from source \"".concat(source.sourceId, "\" must return an array of items but returned ").concat(JSON.stringify(undefined), ".\n\nDid you forget to return items?\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems")); + return { + source: source, + items: items + }; + }); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/stateReducer.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/stateReducer.d.ts new file mode 100644 index 0000000000..48e479b788 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/stateReducer.d.ts @@ -0,0 +1,2 @@ +import { Reducer } from './types'; +export declare const stateReducer: Reducer; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/stateReducer.js b/node_modules/@algolia/autocomplete-core/dist/esm/stateReducer.js new file mode 100644 index 0000000000..6ad9f443ba --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/stateReducer.js @@ -0,0 +1,161 @@ +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import { getItemsCount, invariant } from '@algolia/autocomplete-shared'; +import { getCompletion } from './getCompletion'; +import { getNextActiveItemId } from './utils'; +export var stateReducer = function stateReducer(state, action) { + switch (action.type) { + case 'setActiveItemId': + { + return _objectSpread(_objectSpread({}, state), {}, { + activeItemId: action.payload + }); + } + + case 'setQuery': + { + return _objectSpread(_objectSpread({}, state), {}, { + query: action.payload, + completion: null + }); + } + + case 'setCollections': + { + return _objectSpread(_objectSpread({}, state), {}, { + collections: action.payload + }); + } + + case 'setIsOpen': + { + return _objectSpread(_objectSpread({}, state), {}, { + isOpen: action.payload + }); + } + + case 'setStatus': + { + return _objectSpread(_objectSpread({}, state), {}, { + status: action.payload + }); + } + + case 'setContext': + { + return _objectSpread(_objectSpread({}, state), {}, { + context: _objectSpread(_objectSpread({}, state.context), action.payload) + }); + } + + case 'ArrowDown': + { + var nextState = _objectSpread(_objectSpread({}, state), {}, { + activeItemId: action.payload.hasOwnProperty('nextActiveItemId') ? action.payload.nextActiveItemId : getNextActiveItemId(1, state.activeItemId, getItemsCount(state), action.props.defaultActiveItemId) + }); + + return _objectSpread(_objectSpread({}, nextState), {}, { + completion: getCompletion({ + state: nextState + }) + }); + } + + case 'ArrowUp': + { + var _nextState = _objectSpread(_objectSpread({}, state), {}, { + activeItemId: getNextActiveItemId(-1, state.activeItemId, getItemsCount(state), action.props.defaultActiveItemId) + }); + + return _objectSpread(_objectSpread({}, _nextState), {}, { + completion: getCompletion({ + state: _nextState + }) + }); + } + + case 'Escape': + { + if (state.isOpen) { + return _objectSpread(_objectSpread({}, state), {}, { + activeItemId: null, + isOpen: false, + completion: null + }); + } + + return _objectSpread(_objectSpread({}, state), {}, { + activeItemId: null, + query: '', + status: 'idle', + collections: [] + }); + } + + case 'submit': + { + return _objectSpread(_objectSpread({}, state), {}, { + activeItemId: null, + isOpen: false, + status: 'idle' + }); + } + + case 'reset': + { + return _objectSpread(_objectSpread({}, state), {}, { + activeItemId: // Since we open the panel on reset when openOnFocus=true + // we need to restore the highlighted index to the defaultActiveItemId. (DocSearch use-case) + // Since we close the panel when openOnFocus=false + // we lose track of the highlighted index. (Query-suggestions use-case) + action.props.openOnFocus === true ? action.props.defaultActiveItemId : null, + status: 'idle', + query: '' + }); + } + + case 'focus': + { + return _objectSpread(_objectSpread({}, state), {}, { + activeItemId: action.props.defaultActiveItemId, + isOpen: (action.props.openOnFocus || Boolean(state.query)) && action.props.shouldPanelOpen({ + state: state + }) + }); + } + + case 'blur': + { + if (action.props.debug) { + return state; + } + + return _objectSpread(_objectSpread({}, state), {}, { + isOpen: false, + activeItemId: null + }); + } + + case 'mousemove': + { + return _objectSpread(_objectSpread({}, state), {}, { + activeItemId: action.payload + }); + } + + case 'mouseleave': + { + return _objectSpread(_objectSpread({}, state), {}, { + activeItemId: action.props.defaultActiveItemId + }); + } + + default: + invariant(false, "The reducer action ".concat(JSON.stringify(action.type), " is not supported.")); + return state; + } +}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteApi.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteApi.d.ts new file mode 100644 index 0000000000..46d82c5a34 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteApi.d.ts @@ -0,0 +1,10 @@ +import { AutocompletePropGetters } from './AutocompletePropGetters'; +import { AutocompleteSetters } from './AutocompleteSetters'; +export declare type BaseItem = Record; +export interface AutocompleteScopeApi extends AutocompleteSetters { + /** + * Triggers a search to refresh the state. + */ + refresh(): Promise; +} +export declare type AutocompleteApi = AutocompleteScopeApi & AutocompletePropGetters; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteApi.js b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteApi.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteApi.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteCollection.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteCollection.d.ts new file mode 100644 index 0000000000..e6c3b89316 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteCollection.d.ts @@ -0,0 +1,10 @@ +import { BaseItem } from './AutocompleteApi'; +import { InternalAutocompleteSource } from './AutocompleteSource'; +export interface AutocompleteCollection { + source: InternalAutocompleteSource; + items: TItem[]; +} +export interface AutocompleteCollectionItemsArray { + source: InternalAutocompleteSource; + items: TItem[][]; +} diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteCollection.js b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteCollection.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteCollection.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteContext.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteContext.d.ts new file mode 100644 index 0000000000..e75149eda6 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteContext.d.ts @@ -0,0 +1,3 @@ +export interface AutocompleteContext { + [key: string]: unknown; +} diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteContext.js b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteContext.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteContext.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteEnvironment.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteEnvironment.d.ts new file mode 100644 index 0000000000..248c251cad --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteEnvironment.d.ts @@ -0,0 +1,13 @@ +export declare type AutocompleteEnvironment = Window | { + [prop: string]: unknown; + addEventListener: Window['addEventListener']; + removeEventListener: Window['removeEventListener']; + setTimeout: Window['setTimeout']; + clearTimeout: Window['clearTimeout']; + document: Window['document']; + location: { + assign: Location['assign']; + }; + open: Window['open']; + navigator: Window['navigator']; +}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteEnvironment.js b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteEnvironment.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteEnvironment.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteNavigator.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteNavigator.d.ts new file mode 100644 index 0000000000..4a32775952 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteNavigator.d.ts @@ -0,0 +1,28 @@ +import { BaseItem } from './AutocompleteApi'; +import { AutocompleteState } from './AutocompleteState'; +export interface AutocompleteNavigator { + /** + * Called when a URL should be open in the current page. + */ + navigate(params: { + itemUrl: string; + item: TItem; + state: AutocompleteState; + }): void; + /** + * Called when a URL should be open in a new tab. + */ + navigateNewTab(params: { + itemUrl: string; + item: TItem; + state: AutocompleteState; + }): void; + /** + * Called when a URL should be open in a new window. + */ + navigateNewWindow(params: { + itemUrl: string; + item: TItem; + state: AutocompleteState; + }): void; +} diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteNavigator.js b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteNavigator.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteNavigator.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteOptions.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteOptions.d.ts new file mode 100644 index 0000000000..fc99050f1e --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteOptions.d.ts @@ -0,0 +1,185 @@ +import { MaybePromise } from '@algolia/autocomplete-shared'; +import { AutocompleteScopeApi, BaseItem } from './AutocompleteApi'; +import { AutocompleteEnvironment } from './AutocompleteEnvironment'; +import { AutocompleteNavigator } from './AutocompleteNavigator'; +import { AutocompletePlugin } from './AutocompletePlugin'; +import { Reshape } from './AutocompleteReshape'; +import { AutocompleteSource, InternalAutocompleteSource } from './AutocompleteSource'; +import { AutocompleteState } from './AutocompleteState'; +export interface OnSubmitParams extends AutocompleteScopeApi { + state: AutocompleteState; + event: any; +} +export declare type OnResetParams = OnSubmitParams; +export interface OnInputParams extends AutocompleteScopeApi { + query: string; + state: AutocompleteState; +} +export declare type GetSourcesParams = OnInputParams; +export declare type GetSources = (params: GetSourcesParams) => MaybePromise | boolean | undefined>>; +export declare type InternalGetSources = (params: GetSourcesParams) => Promise>>; +interface OnStateChangeProps extends AutocompleteScopeApi { + /** + * The current Autocomplete state. + */ + state: AutocompleteState; + /** + * The previous Autocomplete state. + */ + prevState: AutocompleteState; +} +export interface AutocompleteOptions { + /** + * A flag to activate the debug mode. + * + * This is useful while developing because it keeps the panel open even when the blur event occurs. **Make sure to disable it in production.** + * + * See [**Debugging**](https://www.algolia.com/doc/ui-libraries/autocomplete/guides/debugging/) for more information. + * + * @default false + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-debug + */ + debug?: boolean; + /** + * An ID for the autocomplete to create accessible attributes. + * + * It is incremented by default when creating a new Autocomplete instance. + * + * @default "autocomplete-0" + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-id + */ + id?: string; + /** + * The function called when the internal state changes. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-onstatechange + */ + onStateChange?(props: OnStateChangeProps): void; + /** + * The placeholder text to show in the search input when there's no query. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-placeholder + */ + placeholder?: string; + /** + * Whether to focus the search input or not when the page is loaded. + * + * @default false + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-autofocus + */ + autoFocus?: boolean; + /** + * The default item index to pre-select. + * + * We recommend using `0` when the autocomplete is used to open links, instead of triggering a search in an application. + * + * @default null + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-defaultactiveitemid + */ + defaultActiveItemId?: number | null; + /** + * Whether to open the panel on focus when there's no query. + * + * @default false + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-openonfocus + */ + openOnFocus?: boolean; + /** + * How many milliseconds must elapse before considering the autocomplete experience [stalled](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#param-status). + * + * @default 300 + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-stallthreshold + */ + stallThreshold?: number; + /** + * The initial state to apply when autocomplete is created. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-initialstate + */ + initialState?: Partial>; + /** + * The [sources](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/) to get the suggestions from. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-getsources + */ + getSources?: GetSources; + /** + * The environment in which your application is running. + * + * This is useful if you're using autocomplete in a different context than `window`. + * + * @default window + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-environment + */ + environment?: AutocompleteEnvironment; + /** + * An implementation of Autocomplete's Navigator API to redirect the user when opening a link. + * + * Learn more on the [**Navigator API**](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/keyboard-navigation/) documentation. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-navigator + */ + navigator?: Partial>; + /** + * The function called to determine whether the panel should open or not. + * + * By default, the panel opens when there are items in the state. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-shouldpanelopen + */ + shouldPanelOpen?(params: { + state: AutocompleteState; + }): boolean; + /** + * The function called when submitting the Autocomplete form. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-onsubmit + */ + onSubmit?(params: OnSubmitParams): void; + /** + * The function called when resetting the Autocomplete form. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-onreset + */ + onReset?(params: OnResetParams): void; + /** + * The plugins that encapsulate and distribute custom Autocomplete behaviors. + * + * See [**Plugins**](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/plugins/) for more information. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-plugins + */ + plugins?: Array>; + /** + * The function called to reshape the sources after they're resolved. + * + * This is useful to transform sources before rendering them. You can group sources by attribute, remove duplicates, create shared limits between sources, etc. + * + * See [**Reshaping sources**](https://www.algolia.com/doc/ui-libraries/autocomplete/guides/reshaping-sources/) for more information. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-js/autocomplete/#param-reshape + */ + reshape?: Reshape; +} +export interface InternalAutocompleteOptions extends AutocompleteOptions { + debug: boolean; + id: string; + onStateChange(props: OnStateChangeProps): void; + placeholder: string; + autoFocus: boolean; + defaultActiveItemId: number | null; + openOnFocus: boolean; + stallThreshold: number; + initialState: AutocompleteState; + getSources: InternalGetSources; + environment: AutocompleteEnvironment; + navigator: AutocompleteNavigator; + plugins: Array>; + shouldPanelOpen(params: { + state: AutocompleteState; + }): boolean; + onSubmit(params: OnSubmitParams): void; + onReset(params: OnResetParams): void; + reshape: Reshape; +} +export {}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteOptions.js b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteOptions.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteOptions.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompletePlugin.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompletePlugin.d.ts new file mode 100644 index 0000000000..88af6bcb46 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompletePlugin.d.ts @@ -0,0 +1,35 @@ +import { AutocompleteScopeApi, BaseItem } from './AutocompleteApi'; +import { AutocompleteOptions } from './AutocompleteOptions'; +import { OnSelectParams, OnActiveParams } from './AutocompleteSource'; +declare type PluginSubscriber = (params: TParams) => void; +export interface PluginSubscribeParams extends AutocompleteScopeApi { + onSelect(fn: PluginSubscriber>): void; + onActive(fn: PluginSubscriber>): void; +} +export declare type AutocompletePlugin = Partial, 'onStateChange' | 'onSubmit' | 'onReset'> & Pick, 'getSources'>> & { + /** + * The function called when Autocomplete starts. + * + * It lets you subscribe to lifecycle hooks and interact with the instance's state and context. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/plugins/#param-subscribe + */ + subscribe?(params: PluginSubscribeParams): void; + /** + * An extra plugin object to expose properties and functions as APIs. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/plugins/#param-data + */ + data?: TData; + /** + * A name to identify the plugin. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/plugins/#param-name + */ + name?: string; + /** + * @internal + */ + __autocomplete_pluginOptions?: Record; +}; +export {}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompletePlugin.js b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompletePlugin.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompletePlugin.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompletePropGetters.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompletePropGetters.d.ts new file mode 100644 index 0000000000..a9408c033c --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompletePropGetters.d.ts @@ -0,0 +1,97 @@ +import { BaseItem } from './AutocompleteApi'; +import { InternalAutocompleteSource } from './AutocompleteSource'; +export interface AutocompletePropGetters { + getEnvironmentProps: GetEnvironmentProps; + getRootProps: GetRootProps; + getFormProps: GetFormProps; + getLabelProps: GetLabelProps; + getInputProps: GetInputProps; + getPanelProps: GetPanelProps; + getListProps: GetListProps; + getItemProps: GetItemProps; +} +export declare type GetEnvironmentProps = (props: { + [key: string]: unknown; + formElement: HTMLElement; + inputElement: HTMLInputElement; + panelElement: HTMLElement; +}) => { + onTouchStart(event: TouchEvent): void; + onTouchMove(event: TouchEvent): void; +}; +export declare type GetRootProps = (props?: { + [key: string]: unknown; +}) => { + role: string; + 'aria-expanded': boolean; + 'aria-haspopup': boolean | 'dialog' | 'menu' | 'true' | 'false' | 'grid' | 'listbox' | 'tree' | undefined; + 'aria-owns': string | undefined; + 'aria-labelledby': string; +}; +export declare type GetFormProps = (props: { + [key: string]: unknown; + inputElement: HTMLInputElement | null; +}) => { + action: ''; + noValidate: true; + role: 'search'; + onSubmit(event: TEvent): void; + onReset(event: TEvent): void; +}; +export declare type GetLabelProps = (props?: { + [key: string]: unknown; +}) => { + htmlFor: string; + id: string; +}; +export declare type GetInputProps = (props: { + [key: string]: unknown; + inputElement: HTMLInputElement | null; + maxLength?: number; +}) => { + id: string; + value: string; + autoFocus: boolean; + placeholder: string; + autoComplete: 'on' | 'off'; + autoCorrect: 'on' | 'off'; + autoCapitalize: 'on' | 'off'; + enterKeyHint: 'go' | 'search'; + spellCheck: 'false'; + maxLength: number; + type: 'search'; + 'aria-autocomplete': 'none' | 'inline' | 'list' | 'both'; + 'aria-activedescendant': string | undefined; + 'aria-controls': string | undefined; + 'aria-labelledby': string; + onChange(event: TEvent): void; + onKeyDown(event: TKeyboardEvent): void; + onFocus(event: TEvent): void; + onBlur(): void; + onClick(event: TMouseEvent): void; +}; +export declare type GetPanelProps = (props?: { + [key: string]: unknown; +}) => { + onMouseDown(event: TMouseEvent): void; + onMouseLeave(): void; +}; +export declare type GetListProps = (props?: { + [key: string]: unknown; +}) => { + role: string; + 'aria-labelledby': string; + id: string; +}; +export declare type GetItemProps = (props: { + [key: string]: unknown; + item: TItem; + source: InternalAutocompleteSource; +}) => { + id: string; + role: string; + 'aria-selected': boolean; + onMouseMove(event: TMouseEvent): void; + onMouseDown(event: TMouseEvent): void; + onClick(event: TMouseEvent): void; +}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompletePropGetters.js b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompletePropGetters.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompletePropGetters.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteReshape.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteReshape.d.ts new file mode 100644 index 0000000000..c0c504bc61 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteReshape.d.ts @@ -0,0 +1,23 @@ +import { BaseItem } from './AutocompleteApi'; +import { AutocompleteSource } from './AutocompleteSource'; +import { AutocompleteState } from './AutocompleteState'; +export declare type AutocompleteReshapeSource = AutocompleteSource & { + getItems(): TItem[]; +}; +export declare type AutocompleteReshapeSourcesBySourceId = Record>; +export declare type Reshape = AutocompleteState> = (params: { + /** + * The resolved sources provided by [`getSources`](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getsources) + */ + sources: Array>; + /** + * The resolved sources grouped by [`sourceId`](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-sourceid)s + */ + sourcesBySourceId: AutocompleteReshapeSourcesBySourceId; + /** + * The current Autocomplete state. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state + */ + state: TState; +}) => Array>; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteReshape.js b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteReshape.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteReshape.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSetters.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSetters.d.ts new file mode 100644 index 0000000000..ecd9c148b8 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSetters.d.ts @@ -0,0 +1,46 @@ +import { BaseItem } from './AutocompleteApi'; +import { AutocompleteCollection, AutocompleteCollectionItemsArray } from './AutocompleteCollection'; +import { AutocompleteState } from './AutocompleteState'; +export declare type StateUpdater = (value: TState) => void; +export interface AutocompleteSetters { + /** + * Sets the highlighted item index. + * + * Pass `null` to unselect items. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#param-setactiveitemid + */ + setActiveItemId: StateUpdater['activeItemId']>; + /** + * Sets the query. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#param-setquery + */ + setQuery: StateUpdater['query']>; + /** + * Sets the collections. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#param-setcollections + */ + setCollections: StateUpdater | AutocompleteCollectionItemsArray>>; + /** + * Sets whether the panel is open or not. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#param-setisopen + */ + setIsOpen: StateUpdater['isOpen']>; + /** + * Sets the status of the autocomplete. + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#param-setisopen + */ + setStatus: StateUpdater['status']>; + /** + * Sets the context passed to lifecycle hooks. + * + * See more in [**Context**](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/context/). + * + * @link https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#param-setcontext + */ + setContext: StateUpdater['context']>; +} diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSetters.js b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSetters.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSetters.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSource.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSource.d.ts new file mode 100644 index 0000000000..f02fb64705 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSource.d.ts @@ -0,0 +1,57 @@ +import type { RequesterDescription } from '@algolia/autocomplete-preset-algolia'; +import type { MaybePromise } from '@algolia/autocomplete-shared'; +import { AutocompleteScopeApi, BaseItem } from './AutocompleteApi'; +import { GetSourcesParams } from './AutocompleteOptions'; +import { AutocompleteState } from './AutocompleteState'; +export interface OnSelectParams extends AutocompleteScopeApi { + state: AutocompleteState; + event: any; + item: TItem; + itemInputValue: ReturnType['getItemInputValue']>; + itemUrl: ReturnType['getItemUrl']>; + source: InternalAutocompleteSource; +} +export declare type OnActiveParams = OnSelectParams; +export interface AutocompleteSource { + /** + * Unique identifier for the source. + */ + sourceId: string; + /** + * The function called to get the value of an item. + * + * The value is used to fill the search box. + */ + getItemInputValue?({ item, state, }: { + item: TItem; + state: AutocompleteState; + }): string; + /** + * The function called to get the URL of the item. + * + * The value is used to add [keyboard accessibility](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/keyboard-navigation/) features to let users open items in the current tab, a new tab, or a new window. + */ + getItemUrl?({ item, state, }: { + item: TItem; + state: AutocompleteState; + }): string | undefined; + /** + * The function called when the input changes. + * + * You can use this function to filter the items based on the query. + */ + getItems(params: GetSourcesParams): MaybePromise>; + /** + * The function called whenever an item is selected. + */ + onSelect?(params: OnSelectParams): void; + /** + * The function called whenever an item is active. + * + * You can trigger different behaviors if the item is active depending on the triggering event using the `event` parameter. + */ + onActive?(params: OnActiveParams): void; +} +export declare type InternalAutocompleteSource = { + [KParam in keyof AutocompleteSource]-?: AutocompleteSource[KParam]; +}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSource.js b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSource.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSource.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteState.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteState.d.ts new file mode 100644 index 0000000000..4654b0004b --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteState.d.ts @@ -0,0 +1,12 @@ +import { BaseItem } from './AutocompleteApi'; +import { AutocompleteCollection } from './AutocompleteCollection'; +import { AutocompleteContext } from './AutocompleteContext'; +export interface AutocompleteState { + activeItemId: number | null; + query: string; + completion: string | null; + collections: Array>; + isOpen: boolean; + status: 'idle' | 'loading' | 'stalled' | 'error'; + context: AutocompleteContext; +} diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteState.js b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteState.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteState.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteStore.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteStore.d.ts new file mode 100644 index 0000000000..36def662f2 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteStore.d.ts @@ -0,0 +1,17 @@ +import { CancelablePromiseList } from '../utils'; +import { BaseItem } from './AutocompleteApi'; +import { InternalAutocompleteOptions } from './AutocompleteOptions'; +import { AutocompleteState } from './AutocompleteState'; +export interface AutocompleteStore { + getState(): AutocompleteState; + dispatch(action: ActionType, payload: any): void; + pendingRequests: CancelablePromiseList; +} +export declare type Reducer = (state: AutocompleteState, action: Action) => AutocompleteState; +declare type Action = { + type: ActionType; + props: InternalAutocompleteOptions; + payload: TPayload; +}; +export declare type ActionType = 'setActiveItemId' | 'setQuery' | 'setCollections' | 'setIsOpen' | 'setStatus' | 'setContext' | 'ArrowUp' | 'ArrowDown' | 'Escape' | 'Enter' | 'submit' | 'reset' | 'focus' | 'blur' | 'mousemove' | 'mouseleave' | 'click'; +export {}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteStore.js b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteStore.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteStore.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSubscribers.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSubscribers.d.ts new file mode 100644 index 0000000000..511670715a --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSubscribers.d.ts @@ -0,0 +1,7 @@ +import { BaseItem } from './AutocompleteApi'; +import { OnActiveParams, OnSelectParams } from './AutocompleteSource'; +export declare type AutocompleteSubscriber = { + onSelect(params: OnSelectParams): void; + onActive(params: OnActiveParams): void; +}; +export declare type AutocompleteSubscribers = Array>>; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSubscribers.js b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSubscribers.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/AutocompleteSubscribers.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/index.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/types/index.d.ts new file mode 100644 index 0000000000..02ce133288 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/index.d.ts @@ -0,0 +1,13 @@ +export * from './AutocompleteApi'; +export * from './AutocompleteCollection'; +export * from './AutocompleteContext'; +export * from './AutocompleteEnvironment'; +export * from './AutocompleteOptions'; +export * from './AutocompleteSource'; +export * from './AutocompletePropGetters'; +export * from './AutocompletePlugin'; +export * from './AutocompleteReshape'; +export * from './AutocompleteSetters'; +export * from './AutocompleteState'; +export * from './AutocompleteStore'; +export * from './AutocompleteSubscribers'; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/types/index.js b/node_modules/@algolia/autocomplete-core/dist/esm/types/index.js new file mode 100644 index 0000000000..ceebc1bd7b --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/types/index.js @@ -0,0 +1,13 @@ +export * from './AutocompleteApi'; +export * from './AutocompleteCollection'; +export * from './AutocompleteContext'; +export * from './AutocompleteEnvironment'; +export * from './AutocompleteOptions'; +export * from './AutocompleteSource'; +export * from './AutocompletePropGetters'; +export * from './AutocompletePlugin'; +export * from './AutocompleteReshape'; +export * from './AutocompleteSetters'; +export * from './AutocompleteState'; +export * from './AutocompleteStore'; +export * from './AutocompleteSubscribers'; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromise.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromise.d.ts new file mode 100644 index 0000000000..c3d9bf32e6 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromise.d.ts @@ -0,0 +1,15 @@ +declare type PromiseExecutor = (resolve: (value: TValue | PromiseLike) => void, reject: (reason?: any) => void) => void; +export declare type CancelablePromise = { + then(onfulfilled?: ((value: TValue) => TResultFulfilled | PromiseLike | CancelablePromise) | undefined | null, onrejected?: ((reason: any) => TResultRejected | PromiseLike | CancelablePromise) | undefined | null): CancelablePromise; + catch(onrejected?: ((reason: any) => TResult | PromiseLike | CancelablePromise) | undefined | null): CancelablePromise; + finally(onfinally?: (() => void) | undefined | null): CancelablePromise; + cancel(): void; + isCanceled(): boolean; +}; +export declare function createCancelablePromise(executor: PromiseExecutor): CancelablePromise; +export declare namespace createCancelablePromise { + var resolve: (value?: TValue | PromiseLike | CancelablePromise | undefined) => CancelablePromise | undefined>; + var reject: (reason?: any) => CancelablePromise; +} +export declare function cancelable(promise: Promise): CancelablePromise; +export {}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromise.js b/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromise.js new file mode 100644 index 0000000000..2b853424d4 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromise.js @@ -0,0 +1,70 @@ +function createInternalCancelablePromise(promise, initialState) { + var state = initialState; + return { + then: function then(onfulfilled, onrejected) { + return createInternalCancelablePromise(promise.then(createCallback(onfulfilled, state, promise), createCallback(onrejected, state, promise)), state); + }, + catch: function _catch(onrejected) { + return createInternalCancelablePromise(promise.catch(createCallback(onrejected, state, promise)), state); + }, + finally: function _finally(onfinally) { + if (onfinally) { + state.onCancelList.push(onfinally); + } + + return createInternalCancelablePromise(promise.finally(createCallback(onfinally && function () { + state.onCancelList = []; + return onfinally(); + }, state, promise)), state); + }, + cancel: function cancel() { + state.isCanceled = true; + var callbacks = state.onCancelList; + state.onCancelList = []; + callbacks.forEach(function (callback) { + callback(); + }); + }, + isCanceled: function isCanceled() { + return state.isCanceled === true; + } + }; +} + +export function createCancelablePromise(executor) { + return createInternalCancelablePromise(new Promise(function (resolve, reject) { + return executor(resolve, reject); + }), { + isCanceled: false, + onCancelList: [] + }); +} + +createCancelablePromise.resolve = function (value) { + return cancelable(Promise.resolve(value)); +}; + +createCancelablePromise.reject = function (reason) { + return cancelable(Promise.reject(reason)); +}; + +export function cancelable(promise) { + return createInternalCancelablePromise(promise, { + isCanceled: false, + onCancelList: [] + }); +} + +function createCallback(onResult, state, fallback) { + if (!onResult) { + return fallback; + } + + return function callback(arg) { + if (state.isCanceled) { + return arg; + } + + return onResult(arg); + }; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromiseList.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromiseList.d.ts new file mode 100644 index 0000000000..dfc96965a4 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromiseList.d.ts @@ -0,0 +1,7 @@ +import { CancelablePromise } from '.'; +export declare type CancelablePromiseList = { + add(cancelablePromise: CancelablePromise): CancelablePromise; + cancelAll(): void; + isEmpty(): boolean; +}; +export declare function createCancelablePromiseList(): CancelablePromiseList; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromiseList.js b/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromiseList.js new file mode 100644 index 0000000000..13b578562e --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromiseList.js @@ -0,0 +1,21 @@ +export function createCancelablePromiseList() { + var list = []; + return { + add: function add(cancelablePromise) { + list.push(cancelablePromise); + return cancelablePromise.finally(function () { + list = list.filter(function (item) { + return item !== cancelablePromise; + }); + }); + }, + cancelAll: function cancelAll() { + list.forEach(function (promise) { + return promise.cancel(); + }); + }, + isEmpty: function isEmpty() { + return list.length === 0; + } + }; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/createConcurrentSafePromise.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/utils/createConcurrentSafePromise.d.ts new file mode 100644 index 0000000000..7a4ab5acb2 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/createConcurrentSafePromise.d.ts @@ -0,0 +1,8 @@ +import { MaybePromise } from '@algolia/autocomplete-shared'; +/** + * Creates a runner that executes promises in a concurrent-safe way. + * + * This is useful to prevent older promises to resolve after a newer promise, + * otherwise resulting in stale resolved values. + */ +export declare function createConcurrentSafePromise(): (promise: MaybePromise) => Promise; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/createConcurrentSafePromise.js b/node_modules/@algolia/autocomplete-core/dist/esm/utils/createConcurrentSafePromise.js new file mode 100644 index 0000000000..4bba4bf2d0 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/createConcurrentSafePromise.js @@ -0,0 +1,37 @@ +/** + * Creates a runner that executes promises in a concurrent-safe way. + * + * This is useful to prevent older promises to resolve after a newer promise, + * otherwise resulting in stale resolved values. + */ +export function createConcurrentSafePromise() { + var basePromiseId = -1; + var latestResolvedId = -1; + var latestResolvedValue = undefined; + return function runConcurrentSafePromise(promise) { + basePromiseId++; + var currentPromiseId = basePromiseId; + return Promise.resolve(promise).then(function (x) { + // The promise might take too long to resolve and get outdated. This would + // result in resolving stale values. + // When this happens, we ignore the promise value and return the one + // coming from the latest resolved value. + // + // +----------------------------------+ + // | 100ms | + // | run(1) +---> R1 | + // | 300ms | + // | run(2) +-------------> R2 (SKIP) | + // | 200ms | + // | run(3) +--------> R3 | + // +----------------------------------+ + if (latestResolvedValue && currentPromiseId < latestResolvedId) { + return latestResolvedValue; + } + + latestResolvedId = currentPromiseId; + latestResolvedValue = x; + return x; + }); + }; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/getActiveItem.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/utils/getActiveItem.d.ts new file mode 100644 index 0000000000..90d75d68e4 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/getActiveItem.d.ts @@ -0,0 +1,7 @@ +import { AutocompleteState, BaseItem } from '../types'; +export declare function getActiveItem(state: AutocompleteState): { + item: TItem; + itemInputValue: string; + itemUrl: string | undefined; + source: import("../types").InternalAutocompleteSource; +} | null; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/getActiveItem.js b/node_modules/@algolia/autocomplete-core/dist/esm/utils/getActiveItem.js new file mode 100644 index 0000000000..46d88b8507 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/getActiveItem.js @@ -0,0 +1,85 @@ +// We don't have access to the autocomplete source when we call `onKeyDown` +// or `onClick` because those are native browser events. +// However, we can get the source from the suggestion index. +function getCollectionFromActiveItemId(state) { + // Given 3 sources with respectively 1, 2 and 3 suggestions: [1, 2, 3] + // We want to get the accumulated counts: + // [1, 1 + 2, 1 + 2 + 3] = [1, 3, 3 + 3] = [1, 3, 6] + var accumulatedCollectionsCount = state.collections.map(function (collections) { + return collections.items.length; + }).reduce(function (acc, collectionsCount, index) { + var previousValue = acc[index - 1] || 0; + var nextValue = previousValue + collectionsCount; + acc.push(nextValue); + return acc; + }, []); // Based on the accumulated counts, we can infer the index of the suggestion. + + var collectionIndex = accumulatedCollectionsCount.reduce(function (acc, current) { + if (current <= state.activeItemId) { + return acc + 1; + } + + return acc; + }, 0); + return state.collections[collectionIndex]; +} +/** + * Gets the highlighted index relative to a suggestion object (not the absolute + * highlighted index). + * + * Example: + * [['a', 'b'], ['c', 'd', 'e'], ['f']] + * ↑ + * (absolute: 3, relative: 1) + */ + + +function getRelativeActiveItemId(_ref) { + var state = _ref.state, + collection = _ref.collection; + var isOffsetFound = false; + var counter = 0; + var previousItemsOffset = 0; + + while (isOffsetFound === false) { + var currentCollection = state.collections[counter]; + + if (currentCollection === collection) { + isOffsetFound = true; + break; + } + + previousItemsOffset += currentCollection.items.length; + counter++; + } + + return state.activeItemId - previousItemsOffset; +} + +export function getActiveItem(state) { + var collection = getCollectionFromActiveItemId(state); + + if (!collection) { + return null; + } + + var item = collection.items[getRelativeActiveItemId({ + state: state, + collection: collection + })]; + var source = collection.source; + var itemInputValue = source.getItemInputValue({ + item: item, + state: state + }); + var itemUrl = source.getItemUrl({ + item: item, + state: state + }); + return { + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + source: source + }; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNextActiveItemId.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNextActiveItemId.d.ts new file mode 100644 index 0000000000..6ed80b3cfd --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNextActiveItemId.d.ts @@ -0,0 +1,17 @@ +/** + * Returns the next active item ID from the current state. + * + * We allow circular keyboard navigation from the base index. + * The base index can either be `null` (nothing is highlighted) or `0` + * (the first item is highlighted). + * The base index is allowed to get assigned `null` only if + * `props.defaultActiveItemId` is `null`. This pattern allows to "stop" + * by the actual query before navigating to other suggestions as seen on + * Google or Amazon. + * + * @param moveAmount The offset to increment (or decrement) the last index + * @param baseIndex The current index to compute the next index from + * @param itemCount The number of items + * @param defaultActiveItemId The default active index to fallback to + */ +export declare function getNextActiveItemId(moveAmount: number, baseIndex: number | null, itemCount: number, defaultActiveItemId: number | null): number | null; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNextActiveItemId.js b/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNextActiveItemId.js new file mode 100644 index 0000000000..43cd7e19a0 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNextActiveItemId.js @@ -0,0 +1,33 @@ +/** + * Returns the next active item ID from the current state. + * + * We allow circular keyboard navigation from the base index. + * The base index can either be `null` (nothing is highlighted) or `0` + * (the first item is highlighted). + * The base index is allowed to get assigned `null` only if + * `props.defaultActiveItemId` is `null`. This pattern allows to "stop" + * by the actual query before navigating to other suggestions as seen on + * Google or Amazon. + * + * @param moveAmount The offset to increment (or decrement) the last index + * @param baseIndex The current index to compute the next index from + * @param itemCount The number of items + * @param defaultActiveItemId The default active index to fallback to + */ +export function getNextActiveItemId(moveAmount, baseIndex, itemCount, defaultActiveItemId) { + if (!itemCount) { + return null; + } + + if (moveAmount < 0 && (baseIndex === null || defaultActiveItemId !== null && baseIndex === 0)) { + return itemCount + moveAmount; + } + + var numericIndex = (baseIndex === null ? -1 : baseIndex) + moveAmount; + + if (numericIndex <= -1 || numericIndex >= itemCount) { + return defaultActiveItemId === null ? null : 0; + } + + return numericIndex; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNormalizedSources.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNormalizedSources.d.ts new file mode 100644 index 0000000000..8061dcb1ad --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNormalizedSources.d.ts @@ -0,0 +1,2 @@ +import { BaseItem, GetSources, GetSourcesParams, InternalGetSources } from '../types'; +export declare function getNormalizedSources(getSources: GetSources, params: GetSourcesParams): ReturnType>; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNormalizedSources.js b/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNormalizedSources.js new file mode 100644 index 0000000000..1458d8facc --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNormalizedSources.js @@ -0,0 +1,48 @@ +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +import { invariant, decycle, noop } from '@algolia/autocomplete-shared'; +export function getNormalizedSources(getSources, params) { + var seenSourceIds = []; + return Promise.resolve(getSources(params)).then(function (sources) { + invariant(Array.isArray(sources), function () { + return "The `getSources` function must return an array of sources but returned type ".concat(JSON.stringify(_typeof(sources)), ":\n\n").concat(JSON.stringify(decycle(sources), null, 2)); + }); + return Promise.all(sources // We allow `undefined` and `false` sources to allow users to use + // `Boolean(query) && source` (=> `false`). + // We need to remove these values at this point. + .filter(function (maybeSource) { + return Boolean(maybeSource); + }).map(function (source) { + invariant(typeof source.sourceId === 'string', 'A source must provide a `sourceId` string.'); + + if (seenSourceIds.includes(source.sourceId)) { + throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(source.sourceId), " is not unique.")); + } + + seenSourceIds.push(source.sourceId); + + var normalizedSource = _objectSpread({ + getItemInputValue: function getItemInputValue(_ref) { + var state = _ref.state; + return state.query; + }, + getItemUrl: function getItemUrl() { + return undefined; + }, + onSelect: function onSelect(_ref2) { + var setIsOpen = _ref2.setIsOpen; + setIsOpen(false); + }, + onActive: noop + }, source); + + return Promise.resolve(normalizedSource); + })); + }); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/index.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/utils/index.d.ts new file mode 100644 index 0000000000..d732b3ee11 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/index.d.ts @@ -0,0 +1,8 @@ +export * from './createCancelablePromise'; +export * from './createCancelablePromiseList'; +export * from './createConcurrentSafePromise'; +export * from './getNextActiveItemId'; +export * from './getNormalizedSources'; +export * from './getActiveItem'; +export * from './isOrContainsNode'; +export * from './mapToAlgoliaResponse'; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/index.js b/node_modules/@algolia/autocomplete-core/dist/esm/utils/index.js new file mode 100644 index 0000000000..f937a52210 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/index.js @@ -0,0 +1,8 @@ +export * from './createCancelablePromise'; +export * from './createCancelablePromiseList'; +export * from './createConcurrentSafePromise'; +export * from './getNextActiveItemId'; +export * from './getNormalizedSources'; +export * from './getActiveItem'; +export * from './isOrContainsNode'; +export * from './mapToAlgoliaResponse'; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/isOrContainsNode.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/utils/isOrContainsNode.d.ts new file mode 100644 index 0000000000..8ee16d0fd2 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/isOrContainsNode.d.ts @@ -0,0 +1 @@ +export declare function isOrContainsNode(parent: Node, child: Node): boolean; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/isOrContainsNode.js b/node_modules/@algolia/autocomplete-core/dist/esm/utils/isOrContainsNode.js new file mode 100644 index 0000000000..7cc4d9b525 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/isOrContainsNode.js @@ -0,0 +1,3 @@ +export function isOrContainsNode(parent, child) { + return parent === child || parent.contains(child); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/mapToAlgoliaResponse.d.ts b/node_modules/@algolia/autocomplete-core/dist/esm/utils/mapToAlgoliaResponse.d.ts new file mode 100644 index 0000000000..464966d500 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/mapToAlgoliaResponse.d.ts @@ -0,0 +1,14 @@ +import type { SearchForFacetValuesResponse, SearchResponse } from '@algolia/client-search'; +export declare function mapToAlgoliaResponse(rawResults: Array | SearchForFacetValuesResponse>): { + results: (SearchForFacetValuesResponse | SearchResponse)[]; + hits: import("@algolia/client-search").Hit[][]; + facetHits: { + label: string; + count: number; + _highlightResult: { + label: { + value: string; + }; + }; + }[][]; +}; diff --git a/node_modules/@algolia/autocomplete-core/dist/esm/utils/mapToAlgoliaResponse.js b/node_modules/@algolia/autocomplete-core/dist/esm/utils/mapToAlgoliaResponse.js new file mode 100644 index 0000000000..aa6f747953 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/esm/utils/mapToAlgoliaResponse.js @@ -0,0 +1,43 @@ +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +export function mapToAlgoliaResponse(rawResults) { + var results = rawResults.map(function (result) { + var _hits; + + return _objectSpread(_objectSpread({}, result), {}, { + hits: (_hits = result.hits) === null || _hits === void 0 ? void 0 : _hits.map(function (hit) { + // Bring support for the Insights plugin. + return _objectSpread(_objectSpread({}, hit), {}, { + __autocomplete_indexName: result.index, + __autocomplete_queryID: result.queryID + }); + }) + }); + }); + return { + results: results, + hits: results.map(function (result) { + return result.hits; + }).filter(Boolean), + facetHits: results.map(function (result) { + var _facetHits; + + return (_facetHits = result.facetHits) === null || _facetHits === void 0 ? void 0 : _facetHits.map(function (facetHit) { + // Bring support for the highlighting components. + return { + label: facetHit.value, + count: facetHit.count, + _highlightResult: { + label: { + value: facetHit.highlighted + } + } + }; + }); + }).filter(Boolean) + }; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/umd/index.development.js b/node_modules/@algolia/autocomplete-core/dist/umd/index.development.js new file mode 100644 index 0000000000..4d5731d53c --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/umd/index.development.js @@ -0,0 +1,1847 @@ +/*! @algolia/autocomplete-core 1.5.2 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@algolia/autocomplete-core"] = {})); +})(this, (function (exports) { 'use strict'; + + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + + if (enumerableOnly) { + symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + } + + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + + return target; + } + + function _typeof$1(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof$1 = function (obj) { + return typeof obj; + }; + } else { + _typeof$1 = function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof$1(obj); + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + } + + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; + } + + function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; + + var target = _objectWithoutPropertiesLoose(source, excluded); + + var key, i; + + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; + target[key] = source[key]; + } + } + + return target; + } + + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread(); + } + + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray$1(arr); + } + + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); + } + + function _unsupportedIterableToArray$1(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); + } + + function _arrayLikeToArray$1(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; + } + + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); + } + + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } + + function _iterableToArrayLimit(arr, i) { + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; + + if (_i == null) return; + var _arr = []; + var _n = true; + var _d = false; + + var _s, _e; + + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof(obj); + } + /** + * Decycles objects with circular references. + * This is used to print cyclic structures in development environment only. + */ + + + function decycle(obj) { + var seen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set(); + + if (!obj || _typeof(obj) !== 'object') { + return obj; + } + + if (seen.has(obj)) { + return '[Circular]'; + } + + var newSeen = seen.add(obj); + + if (Array.isArray(obj)) { + return obj.map(function (x) { + return decycle(x, newSeen); + }); + } + + return Object.fromEntries(Object.entries(obj).map(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + value = _ref2[1]; + + return [key, decycle(value, newSeen)]; + })); + } + + function flatten(values) { + return values.reduce(function (a, b) { + return a.concat(b); + }, []); + } + + var autocompleteId = 0; + function generateAutocompleteId() { + return "autocomplete-".concat(autocompleteId++); + } + + function getItemsCount(state) { + if (state.collections.length === 0) { + return 0; + } + + return state.collections.reduce(function (sum, collection) { + return sum + collection.items.length; + }, 0); + } + + /** + * Throws an error if the condition is not met in development mode. + * This is used to make development a better experience to provide guidance as + * to where the error comes from. + */ + function invariant(condition, message) { + + if (!condition) { + throw new Error("[Autocomplete] ".concat(typeof message === 'function' ? message() : message)); + } + } + + var noop = function noop() {}; + + var version = '1.5.2'; + + var userAgents = [{ + segment: 'autocomplete-core', + version: version + }]; + + var warnCache = { + current: {} + }; + /** + * Logs a warning if the condition is not met. + * This is used to log issues in development environment only. + */ + + function warn(condition, message) { + + if (condition) { + return; + } + + var sanitizedMessage = message.trim(); + var hasAlreadyPrinted = warnCache.current[sanitizedMessage]; + + if (!hasAlreadyPrinted) { + warnCache.current[sanitizedMessage] = true; // eslint-disable-next-line no-console + + console.warn("[Autocomplete] ".concat(sanitizedMessage)); + } + } + + function checkOptions(options) { + "development" !== 'production' ? warn(!options.debug, 'The `debug` option is meant for development debugging and should not be used in production.') : void 0; + } + + function createInternalCancelablePromise(promise, initialState) { + var state = initialState; + return { + then: function then(onfulfilled, onrejected) { + return createInternalCancelablePromise(promise.then(createCallback(onfulfilled, state, promise), createCallback(onrejected, state, promise)), state); + }, + catch: function _catch(onrejected) { + return createInternalCancelablePromise(promise.catch(createCallback(onrejected, state, promise)), state); + }, + finally: function _finally(onfinally) { + if (onfinally) { + state.onCancelList.push(onfinally); + } + + return createInternalCancelablePromise(promise.finally(createCallback(onfinally && function () { + state.onCancelList = []; + return onfinally(); + }, state, promise)), state); + }, + cancel: function cancel() { + state.isCanceled = true; + var callbacks = state.onCancelList; + state.onCancelList = []; + callbacks.forEach(function (callback) { + callback(); + }); + }, + isCanceled: function isCanceled() { + return state.isCanceled === true; + } + }; + } + + function cancelable(promise) { + return createInternalCancelablePromise(promise, { + isCanceled: false, + onCancelList: [] + }); + } + + function createCallback(onResult, state, fallback) { + if (!onResult) { + return fallback; + } + + return function callback(arg) { + if (state.isCanceled) { + return arg; + } + + return onResult(arg); + }; + } + + function createCancelablePromiseList() { + var list = []; + return { + add: function add(cancelablePromise) { + list.push(cancelablePromise); + return cancelablePromise.finally(function () { + list = list.filter(function (item) { + return item !== cancelablePromise; + }); + }); + }, + cancelAll: function cancelAll() { + list.forEach(function (promise) { + return promise.cancel(); + }); + }, + isEmpty: function isEmpty() { + return list.length === 0; + } + }; + } + + /** + * Creates a runner that executes promises in a concurrent-safe way. + * + * This is useful to prevent older promises to resolve after a newer promise, + * otherwise resulting in stale resolved values. + */ + function createConcurrentSafePromise() { + var basePromiseId = -1; + var latestResolvedId = -1; + var latestResolvedValue = undefined; + return function runConcurrentSafePromise(promise) { + basePromiseId++; + var currentPromiseId = basePromiseId; + return Promise.resolve(promise).then(function (x) { + // The promise might take too long to resolve and get outdated. This would + // result in resolving stale values. + // When this happens, we ignore the promise value and return the one + // coming from the latest resolved value. + // + // +----------------------------------+ + // | 100ms | + // | run(1) +---> R1 | + // | 300ms | + // | run(2) +-------------> R2 (SKIP) | + // | 200ms | + // | run(3) +--------> R3 | + // +----------------------------------+ + if (latestResolvedValue && currentPromiseId < latestResolvedId) { + return latestResolvedValue; + } + + latestResolvedId = currentPromiseId; + latestResolvedValue = x; + return x; + }); + }; + } + + /** + * Returns the next active item ID from the current state. + * + * We allow circular keyboard navigation from the base index. + * The base index can either be `null` (nothing is highlighted) or `0` + * (the first item is highlighted). + * The base index is allowed to get assigned `null` only if + * `props.defaultActiveItemId` is `null`. This pattern allows to "stop" + * by the actual query before navigating to other suggestions as seen on + * Google or Amazon. + * + * @param moveAmount The offset to increment (or decrement) the last index + * @param baseIndex The current index to compute the next index from + * @param itemCount The number of items + * @param defaultActiveItemId The default active index to fallback to + */ + function getNextActiveItemId(moveAmount, baseIndex, itemCount, defaultActiveItemId) { + if (!itemCount) { + return null; + } + + if (moveAmount < 0 && (baseIndex === null || defaultActiveItemId !== null && baseIndex === 0)) { + return itemCount + moveAmount; + } + + var numericIndex = (baseIndex === null ? -1 : baseIndex) + moveAmount; + + if (numericIndex <= -1 || numericIndex >= itemCount) { + return defaultActiveItemId === null ? null : 0; + } + + return numericIndex; + } + + function getNormalizedSources(getSources, params) { + var seenSourceIds = []; + return Promise.resolve(getSources(params)).then(function (sources) { + invariant(Array.isArray(sources), function () { + return "The `getSources` function must return an array of sources but returned type ".concat(JSON.stringify(_typeof$1(sources)), ":\n\n").concat(JSON.stringify(decycle(sources), null, 2)); + }); + return Promise.all(sources // We allow `undefined` and `false` sources to allow users to use + // `Boolean(query) && source` (=> `false`). + // We need to remove these values at this point. + .filter(function (maybeSource) { + return Boolean(maybeSource); + }).map(function (source) { + invariant(typeof source.sourceId === 'string', 'A source must provide a `sourceId` string.'); + + if (seenSourceIds.includes(source.sourceId)) { + throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(source.sourceId), " is not unique.")); + } + + seenSourceIds.push(source.sourceId); + + var normalizedSource = _objectSpread2({ + getItemInputValue: function getItemInputValue(_ref) { + var state = _ref.state; + return state.query; + }, + getItemUrl: function getItemUrl() { + return undefined; + }, + onSelect: function onSelect(_ref2) { + var setIsOpen = _ref2.setIsOpen; + setIsOpen(false); + }, + onActive: noop + }, source); + + return Promise.resolve(normalizedSource); + })); + }); + } + + // We don't have access to the autocomplete source when we call `onKeyDown` + // or `onClick` because those are native browser events. + // However, we can get the source from the suggestion index. + function getCollectionFromActiveItemId(state) { + // Given 3 sources with respectively 1, 2 and 3 suggestions: [1, 2, 3] + // We want to get the accumulated counts: + // [1, 1 + 2, 1 + 2 + 3] = [1, 3, 3 + 3] = [1, 3, 6] + var accumulatedCollectionsCount = state.collections.map(function (collections) { + return collections.items.length; + }).reduce(function (acc, collectionsCount, index) { + var previousValue = acc[index - 1] || 0; + var nextValue = previousValue + collectionsCount; + acc.push(nextValue); + return acc; + }, []); // Based on the accumulated counts, we can infer the index of the suggestion. + + var collectionIndex = accumulatedCollectionsCount.reduce(function (acc, current) { + if (current <= state.activeItemId) { + return acc + 1; + } + + return acc; + }, 0); + return state.collections[collectionIndex]; + } + /** + * Gets the highlighted index relative to a suggestion object (not the absolute + * highlighted index). + * + * Example: + * [['a', 'b'], ['c', 'd', 'e'], ['f']] + * ↑ + * (absolute: 3, relative: 1) + */ + + + function getRelativeActiveItemId(_ref) { + var state = _ref.state, + collection = _ref.collection; + var isOffsetFound = false; + var counter = 0; + var previousItemsOffset = 0; + + while (isOffsetFound === false) { + var currentCollection = state.collections[counter]; + + if (currentCollection === collection) { + isOffsetFound = true; + break; + } + + previousItemsOffset += currentCollection.items.length; + counter++; + } + + return state.activeItemId - previousItemsOffset; + } + + function getActiveItem(state) { + var collection = getCollectionFromActiveItemId(state); + + if (!collection) { + return null; + } + + var item = collection.items[getRelativeActiveItemId({ + state: state, + collection: collection + })]; + var source = collection.source; + var itemInputValue = source.getItemInputValue({ + item: item, + state: state + }); + var itemUrl = source.getItemUrl({ + item: item, + state: state + }); + return { + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + source: source + }; + } + + function isOrContainsNode(parent, child) { + return parent === child || parent.contains(child); + } + + function mapToAlgoliaResponse(rawResults) { + var results = rawResults.map(function (result) { + var _hits; + + return _objectSpread2(_objectSpread2({}, result), {}, { + hits: (_hits = result.hits) === null || _hits === void 0 ? void 0 : _hits.map(function (hit) { + // Bring support for the Insights plugin. + return _objectSpread2(_objectSpread2({}, hit), {}, { + __autocomplete_indexName: result.index, + __autocomplete_queryID: result.queryID + }); + }) + }); + }); + return { + results: results, + hits: results.map(function (result) { + return result.hits; + }).filter(Boolean), + facetHits: results.map(function (result) { + var _facetHits; + + return (_facetHits = result.facetHits) === null || _facetHits === void 0 ? void 0 : _facetHits.map(function (facetHit) { + // Bring support for the highlighting components. + return { + label: facetHit.value, + count: facetHit.count, + _highlightResult: { + label: { + value: facetHit.highlighted + } + } + }; + }); + }).filter(Boolean) + }; + } + + function createStore(reducer, props, onStoreStateChange) { + var state = props.initialState; + return { + getState: function getState() { + return state; + }, + dispatch: function dispatch(action, payload) { + var prevState = _objectSpread2({}, state); + + state = reducer(state, { + type: action, + props: props, + payload: payload + }); + onStoreStateChange({ + state: state, + prevState: prevState + }); + }, + pendingRequests: createCancelablePromiseList() + }; + } + + function getAutocompleteSetters(_ref) { + var store = _ref.store; + + var setActiveItemId = function setActiveItemId(value) { + store.dispatch('setActiveItemId', value); + }; + + var setQuery = function setQuery(value) { + store.dispatch('setQuery', value); + }; + + var setCollections = function setCollections(rawValue) { + var baseItemId = 0; + var value = rawValue.map(function (collection) { + return _objectSpread2(_objectSpread2({}, collection), {}, { + // We flatten the stored items to support calling `getAlgoliaResults` + // from the source itself. + items: flatten(collection.items).map(function (item) { + return _objectSpread2(_objectSpread2({}, item), {}, { + __autocomplete_id: baseItemId++ + }); + }) + }); + }); + store.dispatch('setCollections', value); + }; + + var setIsOpen = function setIsOpen(value) { + store.dispatch('setIsOpen', value); + }; + + var setStatus = function setStatus(value) { + store.dispatch('setStatus', value); + }; + + var setContext = function setContext(value) { + store.dispatch('setContext', value); + }; + + return { + setActiveItemId: setActiveItemId, + setQuery: setQuery, + setCollections: setCollections, + setIsOpen: setIsOpen, + setStatus: setStatus, + setContext: setContext + }; + } + + function getDefaultProps(props, pluginSubscribers) { + var _props$id; + + /* eslint-disable no-restricted-globals */ + var environment = typeof window !== 'undefined' ? window : {}; + /* eslint-enable no-restricted-globals */ + + var plugins = props.plugins || []; + return _objectSpread2(_objectSpread2({ + debug: false, + openOnFocus: false, + placeholder: '', + autoFocus: false, + defaultActiveItemId: null, + stallThreshold: 300, + environment: environment, + shouldPanelOpen: function shouldPanelOpen(_ref) { + var state = _ref.state; + return getItemsCount(state) > 0; + }, + reshape: function reshape(_ref2) { + var sources = _ref2.sources; + return sources; + } + }, props), {}, { + // Since `generateAutocompleteId` triggers a side effect (it increments + // an internal counter), we don't want to execute it if unnecessary. + id: (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : generateAutocompleteId(), + plugins: plugins, + // The following props need to be deeply defaulted. + initialState: _objectSpread2({ + activeItemId: null, + query: '', + completion: null, + collections: [], + isOpen: false, + status: 'idle', + context: {} + }, props.initialState), + onStateChange: function onStateChange(params) { + var _props$onStateChange; + + (_props$onStateChange = props.onStateChange) === null || _props$onStateChange === void 0 ? void 0 : _props$onStateChange.call(props, params); + plugins.forEach(function (x) { + var _x$onStateChange; + + return (_x$onStateChange = x.onStateChange) === null || _x$onStateChange === void 0 ? void 0 : _x$onStateChange.call(x, params); + }); + }, + onSubmit: function onSubmit(params) { + var _props$onSubmit; + + (_props$onSubmit = props.onSubmit) === null || _props$onSubmit === void 0 ? void 0 : _props$onSubmit.call(props, params); + plugins.forEach(function (x) { + var _x$onSubmit; + + return (_x$onSubmit = x.onSubmit) === null || _x$onSubmit === void 0 ? void 0 : _x$onSubmit.call(x, params); + }); + }, + onReset: function onReset(params) { + var _props$onReset; + + (_props$onReset = props.onReset) === null || _props$onReset === void 0 ? void 0 : _props$onReset.call(props, params); + plugins.forEach(function (x) { + var _x$onReset; + + return (_x$onReset = x.onReset) === null || _x$onReset === void 0 ? void 0 : _x$onReset.call(x, params); + }); + }, + getSources: function getSources(params) { + return Promise.all([].concat(_toConsumableArray(plugins.map(function (plugin) { + return plugin.getSources; + })), [props.getSources]).filter(Boolean).map(function (getSources) { + return getNormalizedSources(getSources, params); + })).then(function (nested) { + return flatten(nested); + }).then(function (sources) { + return sources.map(function (source) { + return _objectSpread2(_objectSpread2({}, source), {}, { + onSelect: function onSelect(params) { + source.onSelect(params); + pluginSubscribers.forEach(function (x) { + var _x$onSelect; + + return (_x$onSelect = x.onSelect) === null || _x$onSelect === void 0 ? void 0 : _x$onSelect.call(x, params); + }); + }, + onActive: function onActive(params) { + source.onActive(params); + pluginSubscribers.forEach(function (x) { + var _x$onActive; + + return (_x$onActive = x.onActive) === null || _x$onActive === void 0 ? void 0 : _x$onActive.call(x, params); + }); + } + }); + }); + }); + }, + navigator: _objectSpread2({ + navigate: function navigate(_ref3) { + var itemUrl = _ref3.itemUrl; + environment.location.assign(itemUrl); + }, + navigateNewTab: function navigateNewTab(_ref4) { + var itemUrl = _ref4.itemUrl; + var windowReference = environment.open(itemUrl, '_blank', 'noopener'); + windowReference === null || windowReference === void 0 ? void 0 : windowReference.focus(); + }, + navigateNewWindow: function navigateNewWindow(_ref5) { + var itemUrl = _ref5.itemUrl; + environment.open(itemUrl, '_blank', 'noopener'); + } + }, props.navigator) + }); + } + + function reshape(_ref) { + var collections = _ref.collections, + props = _ref.props, + state = _ref.state; + // Sources are grouped by `sourceId` to conveniently pick them via destructuring. + // Example: `const { recentSearchesPlugin } = sourcesBySourceId` + var sourcesBySourceId = collections.reduce(function (acc, collection) { + return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, collection.source.sourceId, _objectSpread2(_objectSpread2({}, collection.source), {}, { + getItems: function getItems() { + // We provide the resolved items from the collection to the `reshape` prop. + return flatten(collection.items); + } + }))); + }, {}); + var reshapeSources = props.reshape({ + sources: Object.values(sourcesBySourceId), + sourcesBySourceId: sourcesBySourceId, + state: state + }); // We reconstruct the collections with the items modified by the `reshape` prop. + + return flatten(reshapeSources).filter(Boolean).map(function (source) { + return { + source: source, + items: source.getItems() + }; + }); + } + + function isDescription(item) { + return Boolean(item.execute); + } + + function isRequesterDescription(description) { + return Boolean(description === null || description === void 0 ? void 0 : description.execute); + } + + function preResolve(itemsOrDescription, sourceId) { + if (isRequesterDescription(itemsOrDescription)) { + return _objectSpread2(_objectSpread2({}, itemsOrDescription), {}, { + requests: itemsOrDescription.queries.map(function (query) { + return { + query: query, + sourceId: sourceId, + transformResponse: itemsOrDescription.transformResponse + }; + }) + }); + } + + return { + items: itemsOrDescription, + sourceId: sourceId + }; + } + function resolve(items) { + var packed = items.reduce(function (acc, current) { + if (!isDescription(current)) { + acc.push(current); + return acc; + } + + var searchClient = current.searchClient, + execute = current.execute, + requests = current.requests; + var container = acc.find(function (item) { + return isDescription(current) && isDescription(item) && item.searchClient === searchClient && item.execute === execute; + }); + + if (container) { + var _container$items; + + (_container$items = container.items).push.apply(_container$items, _toConsumableArray(requests)); + } else { + var request = { + execute: execute, + items: requests, + searchClient: searchClient + }; + acc.push(request); + } + + return acc; + }, []); + var values = packed.map(function (maybeDescription) { + if (!isDescription(maybeDescription)) { + return Promise.resolve(maybeDescription); + } + + var _ref = maybeDescription, + execute = _ref.execute, + items = _ref.items, + searchClient = _ref.searchClient; + return execute({ + searchClient: searchClient, + requests: items + }); + }); + return Promise.all(values).then(function (responses) { + return flatten(responses); + }); + } + function postResolve(responses, sources) { + return sources.map(function (source) { + var matches = responses.filter(function (response) { + return response.sourceId === source.sourceId; + }); + var results = matches.map(function (_ref2) { + var items = _ref2.items; + return items; + }); + var transform = matches[0].transformResponse; + var items = transform ? transform(mapToAlgoliaResponse(results)) : results; + invariant(Array.isArray(items), function () { + return "The `getItems` function from source \"".concat(source.sourceId, "\" must return an array of items but returned type ").concat(JSON.stringify(_typeof$1(items)), ":\n\n").concat(JSON.stringify(decycle(items), null, 2), ".\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems"); + }); + invariant(items.every(Boolean), "The `getItems` function from source \"".concat(source.sourceId, "\" must return an array of items but returned ").concat(JSON.stringify(undefined), ".\n\nDid you forget to return items?\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems")); + return { + source: source, + items: items + }; + }); + } + + var _excluded$2 = ["event", "nextState", "props", "query", "refresh", "store"]; + var lastStalledId = null; + var runConcurrentSafePromise = createConcurrentSafePromise(); + function onInput(_ref) { + var event = _ref.event, + _ref$nextState = _ref.nextState, + nextState = _ref$nextState === void 0 ? {} : _ref$nextState, + props = _ref.props, + query = _ref.query, + refresh = _ref.refresh, + store = _ref.store, + setters = _objectWithoutProperties(_ref, _excluded$2); + + if (lastStalledId) { + props.environment.clearTimeout(lastStalledId); + } + + var setCollections = setters.setCollections, + setIsOpen = setters.setIsOpen, + setQuery = setters.setQuery, + setActiveItemId = setters.setActiveItemId, + setStatus = setters.setStatus; + setQuery(query); + setActiveItemId(props.defaultActiveItemId); + + if (!query && props.openOnFocus === false) { + var _nextState$isOpen; + + var collections = store.getState().collections.map(function (collection) { + return _objectSpread2(_objectSpread2({}, collection), {}, { + items: [] + }); + }); + setStatus('idle'); + setCollections(collections); + setIsOpen((_nextState$isOpen = nextState.isOpen) !== null && _nextState$isOpen !== void 0 ? _nextState$isOpen : props.shouldPanelOpen({ + state: store.getState() + })); // We make sure to update the latest resolved value of the tracked + // promises to keep late resolving promises from "cancelling" the state + // updates performed in this code path. + // We chain with a void promise to respect `onInput`'s expected return type. + + var _request = cancelable(runConcurrentSafePromise(collections).then(function () { + return Promise.resolve(); + })); + + return store.pendingRequests.add(_request); + } + + setStatus('loading'); + lastStalledId = props.environment.setTimeout(function () { + setStatus('stalled'); + }, props.stallThreshold); // We track the entire promise chain triggered by `onInput` before mutating + // the Autocomplete state to make sure that any state manipulation is based on + // fresh data regardless of when promises individually resolve. + // We don't track nested promises and only rely on the full chain resolution, + // meaning we should only ever manipulate the state once this concurrent-safe + // promise is resolved. + + var request = cancelable(runConcurrentSafePromise(props.getSources(_objectSpread2({ + query: query, + refresh: refresh, + state: store.getState() + }, setters)).then(function (sources) { + return Promise.all(sources.map(function (source) { + return Promise.resolve(source.getItems(_objectSpread2({ + query: query, + refresh: refresh, + state: store.getState() + }, setters))).then(function (itemsOrDescription) { + return preResolve(itemsOrDescription, source.sourceId); + }); + })).then(resolve).then(function (responses) { + return postResolve(responses, sources); + }).then(function (collections) { + return reshape({ + collections: collections, + props: props, + state: store.getState() + }); + }); + }))).then(function (collections) { + var _nextState$isOpen2; + + // Parameters passed to `onInput` could be stale when the following code + // executes, because `onInput` calls may not resolve in order. + // If it becomes a problem we'll need to save the last passed parameters. + // See: https://codesandbox.io/s/agitated-cookies-y290z + setStatus('idle'); + setCollections(collections); + var isPanelOpen = props.shouldPanelOpen({ + state: store.getState() + }); + setIsOpen((_nextState$isOpen2 = nextState.isOpen) !== null && _nextState$isOpen2 !== void 0 ? _nextState$isOpen2 : props.openOnFocus && !query && isPanelOpen || isPanelOpen); + var highlightedItem = getActiveItem(store.getState()); + + if (store.getState().activeItemId !== null && highlightedItem) { + var item = highlightedItem.item, + itemInputValue = highlightedItem.itemInputValue, + itemUrl = highlightedItem.itemUrl, + source = highlightedItem.source; + source.onActive(_objectSpread2({ + event: event, + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: source, + state: store.getState() + }, setters)); + } + }).finally(function () { + setStatus('idle'); + + if (lastStalledId) { + props.environment.clearTimeout(lastStalledId); + } + }); + return store.pendingRequests.add(request); + } + + var _excluded$1 = ["event", "props", "refresh", "store"]; + function onKeyDown(_ref) { + var event = _ref.event, + props = _ref.props, + refresh = _ref.refresh, + store = _ref.store, + setters = _objectWithoutProperties(_ref, _excluded$1); + + if (event.key === 'ArrowUp' || event.key === 'ArrowDown') { + // eslint-disable-next-line no-inner-declarations + var triggerScrollIntoView = function triggerScrollIntoView() { + var nodeItem = props.environment.document.getElementById("".concat(props.id, "-item-").concat(store.getState().activeItemId)); + + if (nodeItem) { + if (nodeItem.scrollIntoViewIfNeeded) { + nodeItem.scrollIntoViewIfNeeded(false); + } else { + nodeItem.scrollIntoView(false); + } + } + }; // eslint-disable-next-line no-inner-declarations + + + var triggerOnActive = function triggerOnActive() { + var highlightedItem = getActiveItem(store.getState()); + + if (store.getState().activeItemId !== null && highlightedItem) { + var item = highlightedItem.item, + itemInputValue = highlightedItem.itemInputValue, + itemUrl = highlightedItem.itemUrl, + source = highlightedItem.source; + source.onActive(_objectSpread2({ + event: event, + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: source, + state: store.getState() + }, setters)); + } + }; // Default browser behavior changes the caret placement on ArrowUp and + // ArrowDown. + + + event.preventDefault(); // When re-opening the panel, we need to split the logic to keep the actions + // synchronized as `onInput` returns a promise. + + if (store.getState().isOpen === false && (props.openOnFocus || Boolean(store.getState().query))) { + onInput(_objectSpread2({ + event: event, + props: props, + query: store.getState().query, + refresh: refresh, + store: store + }, setters)).then(function () { + store.dispatch(event.key, { + nextActiveItemId: props.defaultActiveItemId + }); + triggerOnActive(); // Since we rely on the DOM, we need to wait for all the micro tasks to + // finish (which include re-opening the panel) to make sure all the + // elements are available. + + setTimeout(triggerScrollIntoView, 0); + }); + } else { + store.dispatch(event.key, {}); + triggerOnActive(); + triggerScrollIntoView(); + } + } else if (event.key === 'Escape') { + // This prevents the default browser behavior on `input[type="search"]` + // from removing the query right away because we first want to close the + // panel. + event.preventDefault(); + store.dispatch(event.key, null); // Hitting the `Escape` key signals the end of a user interaction with the + // autocomplete. At this point, we should ignore any requests that are still + // pending and could reopen the panel once they resolve, because that would + // result in an unsolicited UI behavior. + + store.pendingRequests.cancelAll(); + } else if (event.key === 'Enter') { + // No active item, so we let the browser handle the native `onSubmit` form + // event. + if (store.getState().activeItemId === null || store.getState().collections.every(function (collection) { + return collection.items.length === 0; + })) { + return; + } // This prevents the `onSubmit` event to be sent because an item is + // highlighted. + + + event.preventDefault(); + + var _ref2 = getActiveItem(store.getState()), + item = _ref2.item, + itemInputValue = _ref2.itemInputValue, + itemUrl = _ref2.itemUrl, + source = _ref2.source; + + if (event.metaKey || event.ctrlKey) { + if (itemUrl !== undefined) { + source.onSelect(_objectSpread2({ + event: event, + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: source, + state: store.getState() + }, setters)); + props.navigator.navigateNewTab({ + itemUrl: itemUrl, + item: item, + state: store.getState() + }); + } + } else if (event.shiftKey) { + if (itemUrl !== undefined) { + source.onSelect(_objectSpread2({ + event: event, + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: source, + state: store.getState() + }, setters)); + props.navigator.navigateNewWindow({ + itemUrl: itemUrl, + item: item, + state: store.getState() + }); + } + } else if (event.altKey) ; else { + if (itemUrl !== undefined) { + source.onSelect(_objectSpread2({ + event: event, + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: source, + state: store.getState() + }, setters)); + props.navigator.navigate({ + itemUrl: itemUrl, + item: item, + state: store.getState() + }); + return; + } + + onInput(_objectSpread2({ + event: event, + nextState: { + isOpen: false + }, + props: props, + query: itemInputValue, + refresh: refresh, + store: store + }, setters)).then(function () { + source.onSelect(_objectSpread2({ + event: event, + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: source, + state: store.getState() + }, setters)); + }); + } + } + } + + var _excluded = ["props", "refresh", "store"], + _excluded2 = ["inputElement", "formElement", "panelElement"], + _excluded3 = ["inputElement"], + _excluded4 = ["inputElement", "maxLength"], + _excluded5 = ["item", "source"]; + function getPropGetters(_ref) { + var props = _ref.props, + refresh = _ref.refresh, + store = _ref.store, + setters = _objectWithoutProperties(_ref, _excluded); + + var getEnvironmentProps = function getEnvironmentProps(providedProps) { + var inputElement = providedProps.inputElement, + formElement = providedProps.formElement, + panelElement = providedProps.panelElement, + rest = _objectWithoutProperties(providedProps, _excluded2); + + return _objectSpread2({ + // On touch devices, we do not rely on the native `blur` event of the + // input to close the panel, but rather on a custom `touchstart` event + // outside of the autocomplete elements. + // This ensures a working experience on mobile because we blur the input + // on touch devices when the user starts scrolling (`touchmove`). + // @TODO: support cases where there are multiple Autocomplete instances. + // Right now, a second instance makes this computation return false. + onTouchStart: function onTouchStart(event) { + // The `onTouchStart` event shouldn't trigger the `blur` handler when + // it's not an interaction with Autocomplete. We detect it with the + // following heuristics: + // - the panel is closed AND there are no pending requests + // (no interaction with the autocomplete, no future state updates) + // - OR the touched target is the input element (should open the panel) + var isAutocompleteInteraction = store.getState().isOpen || !store.pendingRequests.isEmpty(); + + if (!isAutocompleteInteraction || event.target === inputElement) { + return; + } + + var isTargetWithinAutocomplete = [formElement, panelElement].some(function (contextNode) { + return isOrContainsNode(contextNode, event.target); + }); + + if (isTargetWithinAutocomplete === false) { + store.dispatch('blur', null); // If requests are still pending when the user closes the panel, they + // could reopen the panel once they resolve. + // We want to prevent any subsequent query from reopening the panel + // because it would result in an unsolicited UI behavior. + + if (!props.debug) { + store.pendingRequests.cancelAll(); + } + } + }, + // When scrolling on touch devices (mobiles, tablets, etc.), we want to + // mimic the native platform behavior where the input is blurred to + // hide the virtual keyboard. This gives more vertical space to + // discover all the suggestions showing up in the panel. + onTouchMove: function onTouchMove(event) { + if (store.getState().isOpen === false || inputElement !== props.environment.document.activeElement || event.target === inputElement) { + return; + } + + inputElement.blur(); + } + }, rest); + }; + + var getRootProps = function getRootProps(rest) { + return _objectSpread2({ + role: 'combobox', + 'aria-expanded': store.getState().isOpen, + 'aria-haspopup': 'listbox', + 'aria-owns': store.getState().isOpen ? "".concat(props.id, "-list") : undefined, + 'aria-labelledby': "".concat(props.id, "-label") + }, rest); + }; + + var getFormProps = function getFormProps(providedProps) { + providedProps.inputElement; + var rest = _objectWithoutProperties(providedProps, _excluded3); + + return _objectSpread2({ + action: '', + noValidate: true, + role: 'search', + onSubmit: function onSubmit(event) { + var _providedProps$inputE; + + event.preventDefault(); + props.onSubmit(_objectSpread2({ + event: event, + refresh: refresh, + state: store.getState() + }, setters)); + store.dispatch('submit', null); + (_providedProps$inputE = providedProps.inputElement) === null || _providedProps$inputE === void 0 ? void 0 : _providedProps$inputE.blur(); + }, + onReset: function onReset(event) { + var _providedProps$inputE2; + + event.preventDefault(); + props.onReset(_objectSpread2({ + event: event, + refresh: refresh, + state: store.getState() + }, setters)); + store.dispatch('reset', null); + (_providedProps$inputE2 = providedProps.inputElement) === null || _providedProps$inputE2 === void 0 ? void 0 : _providedProps$inputE2.focus(); + } + }, rest); + }; + + var getInputProps = function getInputProps(providedProps) { + function onFocus(event) { + // We want to trigger a query when `openOnFocus` is true + // because the panel should open with the current query. + if (props.openOnFocus || Boolean(store.getState().query)) { + onInput(_objectSpread2({ + event: event, + props: props, + query: store.getState().completion || store.getState().query, + refresh: refresh, + store: store + }, setters)); + } + + store.dispatch('focus', null); + } + + var isTouchDevice = ('ontouchstart' in props.environment); + + var _ref2 = providedProps || {}; + _ref2.inputElement; + var _ref2$maxLength = _ref2.maxLength, + maxLength = _ref2$maxLength === void 0 ? 512 : _ref2$maxLength, + rest = _objectWithoutProperties(_ref2, _excluded4); + + var activeItem = getActiveItem(store.getState()); + return _objectSpread2({ + 'aria-autocomplete': 'both', + 'aria-activedescendant': store.getState().isOpen && store.getState().activeItemId !== null ? "".concat(props.id, "-item-").concat(store.getState().activeItemId) : undefined, + 'aria-controls': store.getState().isOpen ? "".concat(props.id, "-list") : undefined, + 'aria-labelledby': "".concat(props.id, "-label"), + value: store.getState().completion || store.getState().query, + id: "".concat(props.id, "-input"), + autoComplete: 'off', + autoCorrect: 'off', + autoCapitalize: 'off', + enterKeyHint: activeItem !== null && activeItem !== void 0 && activeItem.itemUrl ? 'go' : 'search', + spellCheck: 'false', + autoFocus: props.autoFocus, + placeholder: props.placeholder, + maxLength: maxLength, + type: 'search', + onChange: function onChange(event) { + onInput(_objectSpread2({ + event: event, + props: props, + query: event.currentTarget.value.slice(0, maxLength), + refresh: refresh, + store: store + }, setters)); + }, + onKeyDown: function onKeyDown$1(event) { + onKeyDown(_objectSpread2({ + event: event, + props: props, + refresh: refresh, + store: store + }, setters)); + }, + onFocus: onFocus, + onBlur: function onBlur() { + // We do rely on the `blur` event on touch devices. + // See explanation in `onTouchStart`. + if (!isTouchDevice) { + store.dispatch('blur', null); // If requests are still pending when the user closes the panel, they + // could reopen the panel once they resolve. + // We want to prevent any subsequent query from reopening the panel + // because it would result in an unsolicited UI behavior. + + if (!props.debug) { + store.pendingRequests.cancelAll(); + } + } + }, + onClick: function onClick(event) { + // When the panel is closed and you click on the input while + // the input is focused, the `onFocus` event is not triggered + // (default browser behavior). + // In an autocomplete context, it makes sense to open the panel in this + // case. + // We mimic this event by catching the `onClick` event which + // triggers the `onFocus` for the panel to open. + if (providedProps.inputElement === props.environment.document.activeElement && !store.getState().isOpen) { + onFocus(event); + } + } + }, rest); + }; + + var getLabelProps = function getLabelProps(rest) { + return _objectSpread2({ + htmlFor: "".concat(props.id, "-input"), + id: "".concat(props.id, "-label") + }, rest); + }; + + var getListProps = function getListProps(rest) { + return _objectSpread2({ + role: 'listbox', + 'aria-labelledby': "".concat(props.id, "-label"), + id: "".concat(props.id, "-list") + }, rest); + }; + + var getPanelProps = function getPanelProps(rest) { + return _objectSpread2({ + onMouseDown: function onMouseDown(event) { + // Prevents the `activeElement` from being changed to the panel so + // that the blur event is not triggered, otherwise it closes the + // panel. + event.preventDefault(); + }, + onMouseLeave: function onMouseLeave() { + store.dispatch('mouseleave', null); + } + }, rest); + }; + + var getItemProps = function getItemProps(providedProps) { + var item = providedProps.item, + source = providedProps.source, + rest = _objectWithoutProperties(providedProps, _excluded5); + + return _objectSpread2({ + id: "".concat(props.id, "-item-").concat(item.__autocomplete_id), + role: 'option', + 'aria-selected': store.getState().activeItemId === item.__autocomplete_id, + onMouseMove: function onMouseMove(event) { + if (item.__autocomplete_id === store.getState().activeItemId) { + return; + } + + store.dispatch('mousemove', item.__autocomplete_id); + var activeItem = getActiveItem(store.getState()); + + if (store.getState().activeItemId !== null && activeItem) { + var _item = activeItem.item, + itemInputValue = activeItem.itemInputValue, + itemUrl = activeItem.itemUrl, + _source = activeItem.source; + + _source.onActive(_objectSpread2({ + event: event, + item: _item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: _source, + state: store.getState() + }, setters)); + } + }, + onMouseDown: function onMouseDown(event) { + // Prevents the `activeElement` from being changed to the item so it + // can remain with the current `activeElement`. + event.preventDefault(); + }, + onClick: function onClick(event) { + var itemInputValue = source.getItemInputValue({ + item: item, + state: store.getState() + }); + var itemUrl = source.getItemUrl({ + item: item, + state: store.getState() + }); // If `getItemUrl` is provided, it means that the suggestion + // is a link, not plain text that aims at updating the query. + // We can therefore skip the state change because it will update + // the `activeItemId`, resulting in a UI flash, especially + // noticeable on mobile. + + var runPreCommand = itemUrl ? Promise.resolve() : onInput(_objectSpread2({ + event: event, + nextState: { + isOpen: false + }, + props: props, + query: itemInputValue, + refresh: refresh, + store: store + }, setters)); + runPreCommand.then(function () { + source.onSelect(_objectSpread2({ + event: event, + item: item, + itemInputValue: itemInputValue, + itemUrl: itemUrl, + refresh: refresh, + source: source, + state: store.getState() + }, setters)); + }); + } + }, rest); + }; + + return { + getEnvironmentProps: getEnvironmentProps, + getRootProps: getRootProps, + getFormProps: getFormProps, + getLabelProps: getLabelProps, + getInputProps: getInputProps, + getPanelProps: getPanelProps, + getListProps: getListProps, + getItemProps: getItemProps + }; + } + + function getMetadata(_ref) { + var _, _options$__autocomple, _options$__autocomple2, _options$__autocomple3; + + var plugins = _ref.plugins, + options = _ref.options; + var optionsKey = (_ = (((_options$__autocomple = options.__autocomplete_metadata) === null || _options$__autocomple === void 0 ? void 0 : _options$__autocomple.userAgents) || [])[0]) === null || _ === void 0 ? void 0 : _.segment; + var extraOptions = optionsKey ? _defineProperty({}, optionsKey, Object.keys(((_options$__autocomple2 = options.__autocomplete_metadata) === null || _options$__autocomple2 === void 0 ? void 0 : _options$__autocomple2.options) || {})) : {}; + return { + plugins: plugins.map(function (plugin) { + return { + name: plugin.name, + options: Object.keys(plugin.__autocomplete_pluginOptions || []) + }; + }), + options: _objectSpread2({ + 'autocomplete-core': Object.keys(options) + }, extraOptions), + ua: userAgents.concat(((_options$__autocomple3 = options.__autocomplete_metadata) === null || _options$__autocomple3 === void 0 ? void 0 : _options$__autocomple3.userAgents) || []) + }; + } + function injectMetadata(_ref3) { + var _environment$navigato; + + var metadata = _ref3.metadata, + environment = _ref3.environment; + var isMetadataEnabled = (_environment$navigato = environment.navigator) === null || _environment$navigato === void 0 ? void 0 : _environment$navigato.userAgent.includes('Algolia Crawler'); + + if (isMetadataEnabled) { + var metadataContainer = environment.document.createElement('meta'); + var headRef = environment.document.querySelector('head'); + metadataContainer.name = 'algolia:metadata'; + setTimeout(function () { + metadataContainer.content = JSON.stringify(metadata); + headRef.appendChild(metadataContainer); + }, 0); + } + } + + function getCompletion(_ref) { + var _getActiveItem; + + var state = _ref.state; + + if (state.isOpen === false || state.activeItemId === null) { + return null; + } + + return ((_getActiveItem = getActiveItem(state)) === null || _getActiveItem === void 0 ? void 0 : _getActiveItem.itemInputValue) || null; + } + + var stateReducer = function stateReducer(state, action) { + switch (action.type) { + case 'setActiveItemId': + { + return _objectSpread2(_objectSpread2({}, state), {}, { + activeItemId: action.payload + }); + } + + case 'setQuery': + { + return _objectSpread2(_objectSpread2({}, state), {}, { + query: action.payload, + completion: null + }); + } + + case 'setCollections': + { + return _objectSpread2(_objectSpread2({}, state), {}, { + collections: action.payload + }); + } + + case 'setIsOpen': + { + return _objectSpread2(_objectSpread2({}, state), {}, { + isOpen: action.payload + }); + } + + case 'setStatus': + { + return _objectSpread2(_objectSpread2({}, state), {}, { + status: action.payload + }); + } + + case 'setContext': + { + return _objectSpread2(_objectSpread2({}, state), {}, { + context: _objectSpread2(_objectSpread2({}, state.context), action.payload) + }); + } + + case 'ArrowDown': + { + var nextState = _objectSpread2(_objectSpread2({}, state), {}, { + activeItemId: action.payload.hasOwnProperty('nextActiveItemId') ? action.payload.nextActiveItemId : getNextActiveItemId(1, state.activeItemId, getItemsCount(state), action.props.defaultActiveItemId) + }); + + return _objectSpread2(_objectSpread2({}, nextState), {}, { + completion: getCompletion({ + state: nextState + }) + }); + } + + case 'ArrowUp': + { + var _nextState = _objectSpread2(_objectSpread2({}, state), {}, { + activeItemId: getNextActiveItemId(-1, state.activeItemId, getItemsCount(state), action.props.defaultActiveItemId) + }); + + return _objectSpread2(_objectSpread2({}, _nextState), {}, { + completion: getCompletion({ + state: _nextState + }) + }); + } + + case 'Escape': + { + if (state.isOpen) { + return _objectSpread2(_objectSpread2({}, state), {}, { + activeItemId: null, + isOpen: false, + completion: null + }); + } + + return _objectSpread2(_objectSpread2({}, state), {}, { + activeItemId: null, + query: '', + status: 'idle', + collections: [] + }); + } + + case 'submit': + { + return _objectSpread2(_objectSpread2({}, state), {}, { + activeItemId: null, + isOpen: false, + status: 'idle' + }); + } + + case 'reset': + { + return _objectSpread2(_objectSpread2({}, state), {}, { + activeItemId: // Since we open the panel on reset when openOnFocus=true + // we need to restore the highlighted index to the defaultActiveItemId. (DocSearch use-case) + // Since we close the panel when openOnFocus=false + // we lose track of the highlighted index. (Query-suggestions use-case) + action.props.openOnFocus === true ? action.props.defaultActiveItemId : null, + status: 'idle', + query: '' + }); + } + + case 'focus': + { + return _objectSpread2(_objectSpread2({}, state), {}, { + activeItemId: action.props.defaultActiveItemId, + isOpen: (action.props.openOnFocus || Boolean(state.query)) && action.props.shouldPanelOpen({ + state: state + }) + }); + } + + case 'blur': + { + if (action.props.debug) { + return state; + } + + return _objectSpread2(_objectSpread2({}, state), {}, { + isOpen: false, + activeItemId: null + }); + } + + case 'mousemove': + { + return _objectSpread2(_objectSpread2({}, state), {}, { + activeItemId: action.payload + }); + } + + case 'mouseleave': + { + return _objectSpread2(_objectSpread2({}, state), {}, { + activeItemId: action.props.defaultActiveItemId + }); + } + + default: + invariant(false, "The reducer action ".concat(JSON.stringify(action.type), " is not supported.")); + return state; + } + }; + + function createAutocomplete(options) { + checkOptions(options); + var subscribers = []; + var props = getDefaultProps(options, subscribers); + var store = createStore(stateReducer, props, onStoreStateChange); + var setters = getAutocompleteSetters({ + store: store + }); + var propGetters = getPropGetters(_objectSpread2({ + props: props, + refresh: refresh, + store: store + }, setters)); + + function onStoreStateChange(_ref) { + var prevState = _ref.prevState, + state = _ref.state; + props.onStateChange(_objectSpread2({ + prevState: prevState, + state: state, + refresh: refresh + }, setters)); + } + + function refresh() { + return onInput(_objectSpread2({ + event: new Event('input'), + nextState: { + isOpen: store.getState().isOpen + }, + props: props, + query: store.getState().query, + refresh: refresh, + store: store + }, setters)); + } + + props.plugins.forEach(function (plugin) { + var _plugin$subscribe; + + return (_plugin$subscribe = plugin.subscribe) === null || _plugin$subscribe === void 0 ? void 0 : _plugin$subscribe.call(plugin, _objectSpread2(_objectSpread2({}, setters), {}, { + refresh: refresh, + onSelect: function onSelect(fn) { + subscribers.push({ + onSelect: fn + }); + }, + onActive: function onActive(fn) { + subscribers.push({ + onActive: fn + }); + } + })); + }); + injectMetadata({ + metadata: getMetadata({ + plugins: props.plugins, + options: options + }), + environment: props.environment + }); + return _objectSpread2(_objectSpread2({ + refresh: refresh + }, propGetters), setters); + } + + exports.createAutocomplete = createAutocomplete; + exports.getDefaultProps = getDefaultProps; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=index.development.js.map diff --git a/node_modules/@algolia/autocomplete-core/dist/umd/index.development.js.map b/node_modules/@algolia/autocomplete-core/dist/umd/index.development.js.map new file mode 100644 index 0000000000..dea49a1b9b --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/umd/index.development.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.development.js","sources":["../../../autocomplete-shared/dist/esm/decycle.js","../../../autocomplete-shared/dist/esm/flatten.js","../../../autocomplete-shared/dist/esm/generateAutocompleteId.js","../../../autocomplete-shared/dist/esm/getItemsCount.js","../../../autocomplete-shared/dist/esm/invariant.js","../../../autocomplete-shared/dist/esm/noop.js","../../../autocomplete-shared/dist/esm/version.js","../../../autocomplete-shared/dist/esm/userAgents.js","../../../autocomplete-shared/dist/esm/warn.js","../../src/checkOptions.ts","../../src/utils/createCancelablePromise.ts","../../src/utils/createCancelablePromiseList.ts","../../src/utils/createConcurrentSafePromise.ts","../../src/utils/getNextActiveItemId.ts","../../src/utils/getNormalizedSources.ts","../../src/utils/getActiveItem.ts","../../src/utils/isOrContainsNode.ts","../../src/utils/mapToAlgoliaResponse.ts","../../src/createStore.ts","../../src/getAutocompleteSetters.ts","../../src/getDefaultProps.ts","../../src/reshape.ts","../../src/resolve.ts","../../src/onInput.ts","../../src/onKeyDown.ts","../../src/getPropGetters.ts","../../src/metadata.ts","../../src/getCompletion.ts","../../src/stateReducer.ts","../../src/createAutocomplete.ts"],"sourcesContent":["function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/**\n * Decycles objects with circular references.\n * This is used to print cyclic structures in development environment only.\n */\nexport function decycle(obj) {\n var seen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set();\n\n if (!(process.env.NODE_ENV !== 'production') || !obj || _typeof(obj) !== 'object') {\n return obj;\n }\n\n if (seen.has(obj)) {\n return '[Circular]';\n }\n\n var newSeen = seen.add(obj);\n\n if (Array.isArray(obj)) {\n return obj.map(function (x) {\n return decycle(x, newSeen);\n });\n }\n\n return Object.fromEntries(Object.entries(obj).map(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n value = _ref2[1];\n\n return [key, decycle(value, newSeen)];\n }));\n}","export function flatten(values) {\n return values.reduce(function (a, b) {\n return a.concat(b);\n }, []);\n}","var autocompleteId = 0;\nexport function generateAutocompleteId() {\n return \"autocomplete-\".concat(autocompleteId++);\n}","export function getItemsCount(state) {\n if (state.collections.length === 0) {\n return 0;\n }\n\n return state.collections.reduce(function (sum, collection) {\n return sum + collection.items.length;\n }, 0);\n}","/**\n * Throws an error if the condition is not met in development mode.\n * This is used to make development a better experience to provide guidance as\n * to where the error comes from.\n */\nexport function invariant(condition, message) {\n if (!(process.env.NODE_ENV !== 'production')) {\n return;\n }\n\n if (!condition) {\n throw new Error(\"[Autocomplete] \".concat(typeof message === 'function' ? message() : message));\n }\n}","export var noop = function noop() {};","export var version = '1.5.2';","import { version } from './version';\nexport var userAgents = [{\n segment: 'autocomplete-core',\n version: version\n}];","export var warnCache = {\n current: {}\n};\n/**\n * Logs a warning if the condition is not met.\n * This is used to log issues in development environment only.\n */\n\nexport function warn(condition, message) {\n if (!(process.env.NODE_ENV !== 'production')) {\n return;\n }\n\n if (condition) {\n return;\n }\n\n var sanitizedMessage = message.trim();\n var hasAlreadyPrinted = warnCache.current[sanitizedMessage];\n\n if (!hasAlreadyPrinted) {\n warnCache.current[sanitizedMessage] = true; // eslint-disable-next-line no-console\n\n console.warn(\"[Autocomplete] \".concat(sanitizedMessage));\n }\n}","import { warn } from '@algolia/autocomplete-shared';\n\nimport { AutocompleteOptions, BaseItem } from './types';\n\nexport function checkOptions(\n options: AutocompleteOptions\n) {\n warn(\n !options.debug,\n 'The `debug` option is meant for development debugging and should not be used in production.'\n );\n}\n","type PromiseExecutor = (\n resolve: (value: TValue | PromiseLike) => void,\n reject: (reason?: any) => void\n) => void;\n\ntype CancelablePromiseState = {\n isCanceled: boolean;\n onCancelList: Array<(...args: any[]) => any>;\n};\n\nfunction createInternalCancelablePromise(\n promise: Promise,\n initialState: CancelablePromiseState\n): CancelablePromise {\n const state = initialState;\n\n return {\n then(onfulfilled, onrejected) {\n return createInternalCancelablePromise(\n promise.then(\n createCallback(onfulfilled, state, promise),\n createCallback(onrejected, state, promise)\n ),\n state\n );\n },\n catch(onrejected) {\n return createInternalCancelablePromise(\n promise.catch(createCallback(onrejected, state, promise)),\n state\n );\n },\n finally(onfinally) {\n if (onfinally) {\n state.onCancelList.push(onfinally);\n }\n\n return createInternalCancelablePromise(\n promise.finally(\n createCallback(\n onfinally &&\n (() => {\n state.onCancelList = [];\n\n return onfinally();\n }),\n state,\n promise\n )\n ),\n state\n );\n },\n cancel() {\n state.isCanceled = true;\n const callbacks = state.onCancelList;\n state.onCancelList = [];\n\n callbacks.forEach((callback) => {\n callback();\n });\n },\n isCanceled() {\n return state.isCanceled === true;\n },\n };\n}\n\nexport type CancelablePromise = {\n then(\n onfulfilled?:\n | ((\n value: TValue\n ) =>\n | TResultFulfilled\n | PromiseLike\n | CancelablePromise)\n | undefined\n | null,\n onrejected?:\n | ((\n reason: any\n ) =>\n | TResultRejected\n | PromiseLike\n | CancelablePromise)\n | undefined\n | null\n ): CancelablePromise;\n catch(\n onrejected?:\n | ((\n reason: any\n ) => TResult | PromiseLike | CancelablePromise)\n | undefined\n | null\n ): CancelablePromise;\n finally(\n onfinally?: (() => void) | undefined | null\n ): CancelablePromise;\n cancel(): void;\n isCanceled(): boolean;\n};\n\nexport function createCancelablePromise(\n executor: PromiseExecutor\n): CancelablePromise {\n return createInternalCancelablePromise(\n new Promise((resolve, reject) => {\n return executor(resolve, reject);\n }),\n { isCanceled: false, onCancelList: [] }\n );\n}\n\ncreateCancelablePromise.resolve = (\n value?: TValue | PromiseLike | CancelablePromise\n) => cancelable(Promise.resolve(value));\n\ncreateCancelablePromise.reject = (reason?: any) =>\n cancelable(Promise.reject(reason));\n\nexport function cancelable(promise: Promise) {\n return createInternalCancelablePromise(promise, {\n isCanceled: false,\n onCancelList: [],\n });\n}\n\nfunction createCallback(\n onResult: ((...args: any[]) => any) | null | undefined,\n state: CancelablePromiseState,\n fallback: any\n) {\n if (!onResult) {\n return fallback;\n }\n\n return function callback(arg?: any) {\n if (state.isCanceled) {\n return arg;\n }\n\n return onResult(arg);\n };\n}\n","import { CancelablePromise } from '.';\n\nexport type CancelablePromiseList = {\n add(cancelablePromise: CancelablePromise): CancelablePromise;\n cancelAll(): void;\n isEmpty(): boolean;\n};\n\nexport function createCancelablePromiseList<\n TValue\n>(): CancelablePromiseList {\n let list: Array> = [];\n\n return {\n add(cancelablePromise) {\n list.push(cancelablePromise);\n\n return cancelablePromise.finally(() => {\n list = list.filter((item) => item !== cancelablePromise);\n });\n },\n cancelAll() {\n list.forEach((promise) => promise.cancel());\n },\n isEmpty() {\n return list.length === 0;\n },\n };\n}\n","import { MaybePromise } from '@algolia/autocomplete-shared';\n\n/**\n * Creates a runner that executes promises in a concurrent-safe way.\n *\n * This is useful to prevent older promises to resolve after a newer promise,\n * otherwise resulting in stale resolved values.\n */\nexport function createConcurrentSafePromise() {\n let basePromiseId = -1;\n let latestResolvedId = -1;\n let latestResolvedValue: unknown = undefined;\n\n return function runConcurrentSafePromise(\n promise: MaybePromise\n ) {\n basePromiseId++;\n const currentPromiseId = basePromiseId;\n\n return Promise.resolve(promise).then((x) => {\n // The promise might take too long to resolve and get outdated. This would\n // result in resolving stale values.\n // When this happens, we ignore the promise value and return the one\n // coming from the latest resolved value.\n //\n // +----------------------------------+\n // | 100ms |\n // | run(1) +---> R1 |\n // | 300ms |\n // | run(2) +-------------> R2 (SKIP) |\n // | 200ms |\n // | run(3) +--------> R3 |\n // +----------------------------------+\n if (latestResolvedValue && currentPromiseId < latestResolvedId) {\n return latestResolvedValue as TValue;\n }\n\n latestResolvedId = currentPromiseId;\n latestResolvedValue = x;\n\n return x;\n });\n };\n}\n","/**\n * Returns the next active item ID from the current state.\n *\n * We allow circular keyboard navigation from the base index.\n * The base index can either be `null` (nothing is highlighted) or `0`\n * (the first item is highlighted).\n * The base index is allowed to get assigned `null` only if\n * `props.defaultActiveItemId` is `null`. This pattern allows to \"stop\"\n * by the actual query before navigating to other suggestions as seen on\n * Google or Amazon.\n *\n * @param moveAmount The offset to increment (or decrement) the last index\n * @param baseIndex The current index to compute the next index from\n * @param itemCount The number of items\n * @param defaultActiveItemId The default active index to fallback to\n */\nexport function getNextActiveItemId(\n moveAmount: number,\n baseIndex: number | null,\n itemCount: number,\n defaultActiveItemId: number | null\n): number | null {\n if (!itemCount) {\n return null;\n }\n\n if (\n moveAmount < 0 &&\n (baseIndex === null || (defaultActiveItemId !== null && baseIndex === 0))\n ) {\n return itemCount + moveAmount;\n }\n\n const numericIndex = (baseIndex === null ? -1 : baseIndex) + moveAmount;\n\n if (numericIndex <= -1 || numericIndex >= itemCount) {\n return defaultActiveItemId === null ? null : 0;\n }\n\n return numericIndex;\n}\n","import { invariant, decycle, noop } from '@algolia/autocomplete-shared';\n\nimport {\n AutocompleteSource,\n BaseItem,\n GetSources,\n GetSourcesParams,\n InternalAutocompleteSource,\n InternalGetSources,\n} from '../types';\n\nexport function getNormalizedSources(\n getSources: GetSources,\n params: GetSourcesParams\n): ReturnType> {\n const seenSourceIds: string[] = [];\n\n return Promise.resolve(getSources(params)).then((sources) => {\n invariant(\n Array.isArray(sources),\n () =>\n `The \\`getSources\\` function must return an array of sources but returned type ${JSON.stringify(\n typeof sources\n )}:\\n\\n${JSON.stringify(decycle(sources), null, 2)}`\n );\n\n return Promise.all(\n sources\n // We allow `undefined` and `false` sources to allow users to use\n // `Boolean(query) && source` (=> `false`).\n // We need to remove these values at this point.\n .filter((maybeSource: any): maybeSource is AutocompleteSource =>\n Boolean(maybeSource)\n )\n .map((source) => {\n invariant(\n typeof source.sourceId === 'string',\n 'A source must provide a `sourceId` string.'\n );\n\n if (seenSourceIds.includes(source.sourceId)) {\n throw new Error(\n `[Autocomplete] The \\`sourceId\\` ${JSON.stringify(\n source.sourceId\n )} is not unique.`\n );\n }\n\n seenSourceIds.push(source.sourceId);\n\n const normalizedSource: InternalAutocompleteSource = {\n getItemInputValue({ state }) {\n return state.query;\n },\n getItemUrl() {\n return undefined;\n },\n onSelect({ setIsOpen }) {\n setIsOpen(false);\n },\n onActive: noop,\n ...source,\n };\n\n return Promise.resolve(normalizedSource);\n })\n );\n });\n}\n","import { AutocompleteCollection, AutocompleteState, BaseItem } from '../types';\n\n// We don't have access to the autocomplete source when we call `onKeyDown`\n// or `onClick` because those are native browser events.\n// However, we can get the source from the suggestion index.\nfunction getCollectionFromActiveItemId(\n state: AutocompleteState\n): AutocompleteCollection | undefined {\n // Given 3 sources with respectively 1, 2 and 3 suggestions: [1, 2, 3]\n // We want to get the accumulated counts:\n // [1, 1 + 2, 1 + 2 + 3] = [1, 3, 3 + 3] = [1, 3, 6]\n const accumulatedCollectionsCount = state.collections\n .map((collections) => collections.items.length)\n .reduce((acc, collectionsCount, index) => {\n const previousValue = acc[index - 1] || 0;\n const nextValue = previousValue + collectionsCount;\n\n acc.push(nextValue);\n\n return acc;\n }, []);\n\n // Based on the accumulated counts, we can infer the index of the suggestion.\n const collectionIndex = accumulatedCollectionsCount.reduce((acc, current) => {\n if (current <= state.activeItemId!) {\n return acc + 1;\n }\n\n return acc;\n }, 0);\n\n return state.collections[collectionIndex];\n}\n\n/**\n * Gets the highlighted index relative to a suggestion object (not the absolute\n * highlighted index).\n *\n * Example:\n * [['a', 'b'], ['c', 'd', 'e'], ['f']]\n * ↑\n * (absolute: 3, relative: 1)\n */\nfunction getRelativeActiveItemId({\n state,\n collection,\n}: {\n state: AutocompleteState;\n collection: AutocompleteCollection;\n}): number {\n let isOffsetFound = false;\n let counter = 0;\n let previousItemsOffset = 0;\n\n while (isOffsetFound === false) {\n const currentCollection = state.collections[counter];\n\n if (currentCollection === collection) {\n isOffsetFound = true;\n break;\n }\n\n previousItemsOffset += currentCollection.items.length;\n\n counter++;\n }\n\n return state.activeItemId! - previousItemsOffset;\n}\n\nexport function getActiveItem(\n state: AutocompleteState\n) {\n const collection = getCollectionFromActiveItemId(state);\n\n if (!collection) {\n return null;\n }\n\n const item = collection.items[getRelativeActiveItemId({ state, collection })];\n const source = collection.source;\n const itemInputValue = source.getItemInputValue({ item, state });\n const itemUrl = source.getItemUrl({ item, state });\n\n return {\n item,\n itemInputValue,\n itemUrl,\n source,\n };\n}\n","export function isOrContainsNode(parent: Node, child: Node) {\n return parent === child || parent.contains(child);\n}\n","import type {\n SearchForFacetValuesResponse,\n SearchResponse,\n} from '@algolia/client-search';\n\nexport function mapToAlgoliaResponse(\n rawResults: Array | SearchForFacetValuesResponse>\n) {\n const results: Array<\n SearchResponse | SearchForFacetValuesResponse\n > = rawResults.map((result) => {\n return {\n ...result,\n hits: (result as SearchResponse).hits?.map((hit) => {\n // Bring support for the Insights plugin.\n return {\n ...hit,\n __autocomplete_indexName: (result as SearchResponse).index,\n __autocomplete_queryID: (result as SearchResponse).queryID,\n };\n }),\n };\n });\n\n return {\n results,\n hits: results\n .map((result) => (result as SearchResponse).hits)\n .filter(Boolean),\n facetHits: results\n .map((result) =>\n (result as SearchForFacetValuesResponse).facetHits?.map((facetHit) => {\n // Bring support for the highlighting components.\n return {\n label: facetHit.value,\n count: facetHit.count,\n _highlightResult: {\n label: {\n value: facetHit.highlighted,\n },\n },\n };\n })\n )\n .filter(Boolean),\n };\n}\n","import {\n AutocompleteState,\n AutocompleteStore,\n BaseItem,\n InternalAutocompleteOptions,\n Reducer,\n} from './types';\nimport { createCancelablePromiseList } from './utils';\n\ntype OnStoreStateChange = ({\n prevState,\n state,\n}: {\n prevState: AutocompleteState;\n state: AutocompleteState;\n}) => void;\n\nexport function createStore(\n reducer: Reducer,\n props: InternalAutocompleteOptions,\n onStoreStateChange: OnStoreStateChange\n): AutocompleteStore {\n let state = props.initialState;\n\n return {\n getState() {\n return state;\n },\n dispatch(action, payload) {\n const prevState = { ...state };\n state = reducer(state, {\n type: action,\n props,\n payload,\n });\n\n onStoreStateChange({ state, prevState });\n },\n pendingRequests: createCancelablePromiseList(),\n };\n}\n","import { flatten } from '@algolia/autocomplete-shared';\n\nimport {\n AutocompleteApi,\n AutocompleteCollection,\n AutocompleteStore,\n BaseItem,\n} from './types';\n\ninterface GetAutocompleteSettersOptions {\n store: AutocompleteStore;\n}\n\nexport function getAutocompleteSetters({\n store,\n}: GetAutocompleteSettersOptions) {\n const setActiveItemId: AutocompleteApi['setActiveItemId'] = (\n value\n ) => {\n store.dispatch('setActiveItemId', value);\n };\n\n const setQuery: AutocompleteApi['setQuery'] = (value) => {\n store.dispatch('setQuery', value);\n };\n\n const setCollections: AutocompleteApi['setCollections'] = (\n rawValue\n ) => {\n let baseItemId = 0;\n const value = rawValue.map>((collection) => ({\n ...collection,\n // We flatten the stored items to support calling `getAlgoliaResults`\n // from the source itself.\n items: flatten(collection.items as any).map((item: any) => ({\n ...item,\n __autocomplete_id: baseItemId++,\n })),\n }));\n\n store.dispatch('setCollections', value);\n };\n\n const setIsOpen: AutocompleteApi['setIsOpen'] = (value) => {\n store.dispatch('setIsOpen', value);\n };\n\n const setStatus: AutocompleteApi['setStatus'] = (value) => {\n store.dispatch('setStatus', value);\n };\n\n const setContext: AutocompleteApi['setContext'] = (value) => {\n store.dispatch('setContext', value);\n };\n\n return {\n setActiveItemId,\n setQuery,\n setCollections,\n setIsOpen,\n setStatus,\n setContext,\n };\n}\n","import {\n getItemsCount,\n generateAutocompleteId,\n flatten,\n} from '@algolia/autocomplete-shared';\n\nimport {\n AutocompleteEnvironment,\n AutocompleteOptions,\n AutocompleteSubscribers,\n BaseItem,\n InternalAutocompleteOptions,\n} from './types';\nimport { getNormalizedSources } from './utils';\n\nexport function getDefaultProps(\n props: AutocompleteOptions,\n pluginSubscribers: AutocompleteSubscribers\n): InternalAutocompleteOptions {\n /* eslint-disable no-restricted-globals */\n const environment: AutocompleteEnvironment = (typeof window !== 'undefined'\n ? window\n : {}) as typeof window;\n /* eslint-enable no-restricted-globals */\n const plugins = props.plugins || [];\n\n return {\n debug: false,\n openOnFocus: false,\n placeholder: '',\n autoFocus: false,\n defaultActiveItemId: null,\n stallThreshold: 300,\n environment,\n shouldPanelOpen: ({ state }) => getItemsCount(state) > 0,\n reshape: ({ sources }) => sources,\n ...props,\n // Since `generateAutocompleteId` triggers a side effect (it increments\n // an internal counter), we don't want to execute it if unnecessary.\n id: props.id ?? generateAutocompleteId(),\n plugins,\n // The following props need to be deeply defaulted.\n initialState: {\n activeItemId: null,\n query: '',\n completion: null,\n collections: [],\n isOpen: false,\n status: 'idle',\n context: {},\n ...props.initialState,\n },\n onStateChange(params) {\n props.onStateChange?.(params);\n plugins.forEach((x) => x.onStateChange?.(params));\n },\n onSubmit(params) {\n props.onSubmit?.(params);\n plugins.forEach((x) => x.onSubmit?.(params));\n },\n onReset(params) {\n props.onReset?.(params);\n plugins.forEach((x) => x.onReset?.(params));\n },\n getSources(params) {\n return Promise.all(\n [...plugins.map((plugin) => plugin.getSources), props.getSources]\n .filter(Boolean)\n .map((getSources) => getNormalizedSources(getSources!, params))\n )\n .then((nested) => flatten(nested))\n .then((sources) =>\n sources.map((source) => ({\n ...source,\n onSelect(params) {\n source.onSelect(params);\n pluginSubscribers.forEach((x) => x.onSelect?.(params));\n },\n onActive(params) {\n source.onActive(params);\n pluginSubscribers.forEach((x) => x.onActive?.(params));\n },\n }))\n );\n },\n navigator: {\n navigate({ itemUrl }) {\n environment.location.assign(itemUrl);\n },\n navigateNewTab({ itemUrl }) {\n const windowReference = environment.open(itemUrl, '_blank', 'noopener');\n windowReference?.focus();\n },\n navigateNewWindow({ itemUrl }) {\n environment.open(itemUrl, '_blank', 'noopener');\n },\n ...props.navigator,\n },\n };\n}\n","import { flatten } from '@algolia/autocomplete-shared';\n\nimport {\n AutocompleteCollection,\n AutocompleteReshapeSourcesBySourceId,\n AutocompleteState,\n BaseItem,\n InternalAutocompleteOptions,\n} from './types';\n\ntype ReshapeParams = {\n collections: Array>;\n props: InternalAutocompleteOptions;\n state: AutocompleteState;\n};\n\nexport function reshape({\n collections,\n props,\n state,\n}: ReshapeParams) {\n // Sources are grouped by `sourceId` to conveniently pick them via destructuring.\n // Example: `const { recentSearchesPlugin } = sourcesBySourceId`\n const sourcesBySourceId = collections.reduce<\n AutocompleteReshapeSourcesBySourceId\n >(\n (acc, collection) => ({\n ...acc,\n [collection.source.sourceId]: {\n ...collection.source,\n getItems() {\n // We provide the resolved items from the collection to the `reshape` prop.\n return flatten(collection.items);\n },\n },\n }),\n {}\n );\n\n const reshapeSources = props.reshape({\n sources: Object.values(sourcesBySourceId),\n sourcesBySourceId,\n state,\n });\n\n // We reconstruct the collections with the items modified by the `reshape` prop.\n return flatten(reshapeSources)\n .filter(Boolean)\n .map((source) => {\n return {\n source,\n items: source.getItems(),\n };\n });\n}\n","import type {\n Execute,\n ExecuteResponse,\n RequesterDescription,\n TransformResponse,\n} from '@algolia/autocomplete-preset-algolia';\nimport { decycle, flatten, invariant } from '@algolia/autocomplete-shared';\nimport {\n MultipleQueriesQuery,\n SearchForFacetValuesResponse,\n SearchResponse,\n} from '@algolia/client-search';\nimport type { SearchClient } from 'algoliasearch/lite';\n\nimport { BaseItem, InternalAutocompleteSource } from './types';\nimport { mapToAlgoliaResponse } from './utils';\n\nfunction isDescription(\n item:\n | RequestDescriptionPreResolved\n | RequestDescriptionPreResolvedCustom\n | PackedDescription\n): item is RequestDescriptionPreResolved {\n return Boolean((item as RequestDescriptionPreResolved).execute);\n}\n\nfunction isRequesterDescription(\n description: TItem[] | TItem[][] | RequesterDescription\n): description is RequesterDescription {\n return Boolean((description as RequesterDescription)?.execute);\n}\n\ntype PackedDescription = {\n searchClient: SearchClient;\n execute: Execute;\n items: RequestDescriptionPreResolved['requests'];\n};\n\ntype RequestDescriptionPreResolved = Pick<\n RequesterDescription,\n 'execute' | 'searchClient' | 'transformResponse'\n> & {\n requests: Array<{\n query: MultipleQueriesQuery;\n sourceId: string;\n transformResponse: TransformResponse;\n }>;\n};\n\ntype RequestDescriptionPreResolvedCustom = {\n items: TItem[] | TItem[][];\n sourceId: string;\n transformResponse?: undefined;\n};\n\nexport function preResolve(\n itemsOrDescription: TItem[] | TItem[][] | RequesterDescription,\n sourceId: string\n):\n | RequestDescriptionPreResolved\n | RequestDescriptionPreResolvedCustom {\n if (isRequesterDescription(itemsOrDescription)) {\n return {\n ...itemsOrDescription,\n requests: itemsOrDescription.queries.map((query) => ({\n query,\n sourceId,\n transformResponse: itemsOrDescription.transformResponse,\n })),\n };\n }\n\n return {\n items: itemsOrDescription,\n sourceId,\n };\n}\n\nexport function resolve(\n items: Array<\n | RequestDescriptionPreResolved\n | RequestDescriptionPreResolvedCustom\n >\n) {\n const packed = items.reduce<\n Array | PackedDescription>\n >((acc, current) => {\n if (!isDescription(current)) {\n acc.push(current);\n return acc;\n }\n\n const { searchClient, execute, requests } = current;\n\n const container = acc.find>(\n (item): item is PackedDescription => {\n return (\n isDescription(current) &&\n isDescription(item) &&\n item.searchClient === searchClient &&\n item.execute === execute\n );\n }\n );\n\n if (container) {\n container.items.push(...requests);\n } else {\n const request: PackedDescription = {\n execute,\n items: requests,\n searchClient,\n };\n acc.push(request);\n }\n\n return acc;\n }, []);\n\n const values = packed.map<\n | Promise>\n | ReturnType>\n >((maybeDescription) => {\n if (!isDescription(maybeDescription)) {\n return Promise.resolve(\n maybeDescription as RequestDescriptionPreResolvedCustom\n );\n }\n\n const {\n execute,\n items,\n searchClient,\n } = maybeDescription as PackedDescription;\n\n return execute({\n searchClient,\n requests: items,\n });\n });\n\n return Promise.all<\n RequestDescriptionPreResolvedCustom | ExecuteResponse\n >(values).then((responses) =>\n flatten<\n RequestDescriptionPreResolvedCustom | ExecuteResponse[0]\n >(responses)\n );\n}\n\nexport function postResolve(\n responses: Array<\n RequestDescriptionPreResolvedCustom | ExecuteResponse[0]\n >,\n sources: Array>\n) {\n return sources.map((source) => {\n const matches = responses.filter(\n (response) => response.sourceId === source.sourceId\n );\n const results = matches.map(({ items }) => items);\n const transform = matches[0].transformResponse;\n const items = transform\n ? transform(\n mapToAlgoliaResponse(\n results as Array<\n SearchForFacetValuesResponse | SearchResponse\n >\n )\n )\n : results;\n\n invariant(\n Array.isArray(items),\n () => `The \\`getItems\\` function from source \"${\n source.sourceId\n }\" must return an array of items but returned type ${JSON.stringify(\n typeof items\n )}:\\n\\n${JSON.stringify(decycle(items), null, 2)}.\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems`\n );\n\n invariant(\n (items as Array).every(Boolean),\n `The \\`getItems\\` function from source \"${\n source.sourceId\n }\" must return an array of items but returned ${JSON.stringify(\n undefined\n )}.\n\nDid you forget to return items?\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems`\n );\n\n return {\n source,\n items,\n };\n });\n}\n","import { reshape } from './reshape';\nimport { preResolve, resolve, postResolve } from './resolve';\nimport {\n AutocompleteScopeApi,\n AutocompleteState,\n AutocompleteStore,\n BaseItem,\n InternalAutocompleteOptions,\n} from './types';\nimport {\n cancelable,\n CancelablePromise,\n createConcurrentSafePromise,\n getActiveItem,\n} from './utils';\n\nlet lastStalledId: number | null = null;\n\ninterface OnInputParams\n extends AutocompleteScopeApi {\n event: any;\n /**\n * The next partial state to apply after the function is called.\n *\n * This is useful when we call `onInput` in a different scenario than an\n * actual input. For example, we use `onInput` when we click on an item,\n * but we want to close the panel in that case.\n */\n nextState?: Partial>;\n props: InternalAutocompleteOptions;\n query: string;\n store: AutocompleteStore;\n}\n\nconst runConcurrentSafePromise = createConcurrentSafePromise();\n\nexport function onInput({\n event,\n nextState = {},\n props,\n query,\n refresh,\n store,\n ...setters\n}: OnInputParams): CancelablePromise {\n if (lastStalledId) {\n props.environment.clearTimeout(lastStalledId);\n }\n\n const {\n setCollections,\n setIsOpen,\n setQuery,\n setActiveItemId,\n setStatus,\n } = setters;\n\n setQuery(query);\n setActiveItemId(props.defaultActiveItemId);\n\n if (!query && props.openOnFocus === false) {\n const collections = store.getState().collections.map((collection) => ({\n ...collection,\n items: [],\n }));\n\n setStatus('idle');\n setCollections(collections);\n setIsOpen(\n nextState.isOpen ?? props.shouldPanelOpen({ state: store.getState() })\n );\n\n // We make sure to update the latest resolved value of the tracked\n // promises to keep late resolving promises from \"cancelling\" the state\n // updates performed in this code path.\n // We chain with a void promise to respect `onInput`'s expected return type.\n const request = cancelable(\n runConcurrentSafePromise(collections).then(() => Promise.resolve())\n );\n\n return store.pendingRequests.add(request);\n }\n\n setStatus('loading');\n\n lastStalledId = props.environment.setTimeout(() => {\n setStatus('stalled');\n }, props.stallThreshold);\n\n // We track the entire promise chain triggered by `onInput` before mutating\n // the Autocomplete state to make sure that any state manipulation is based on\n // fresh data regardless of when promises individually resolve.\n // We don't track nested promises and only rely on the full chain resolution,\n // meaning we should only ever manipulate the state once this concurrent-safe\n // promise is resolved.\n const request = cancelable(\n runConcurrentSafePromise(\n props\n .getSources({\n query,\n refresh,\n state: store.getState(),\n ...setters,\n })\n .then((sources) => {\n return Promise.all(\n sources.map((source) => {\n return Promise.resolve(\n source.getItems({\n query,\n refresh,\n state: store.getState(),\n ...setters,\n })\n ).then((itemsOrDescription) =>\n preResolve(itemsOrDescription, source.sourceId)\n );\n })\n )\n .then(resolve)\n .then((responses) => postResolve(responses, sources))\n .then((collections) =>\n reshape({ collections, props, state: store.getState() })\n );\n })\n )\n )\n .then((collections) => {\n // Parameters passed to `onInput` could be stale when the following code\n // executes, because `onInput` calls may not resolve in order.\n // If it becomes a problem we'll need to save the last passed parameters.\n // See: https://codesandbox.io/s/agitated-cookies-y290z\n\n setStatus('idle');\n\n setCollections(collections as any);\n\n const isPanelOpen = props.shouldPanelOpen({ state: store.getState() });\n\n setIsOpen(\n nextState.isOpen ??\n ((props.openOnFocus && !query && isPanelOpen) || isPanelOpen)\n );\n\n const highlightedItem = getActiveItem(store.getState());\n\n if (store.getState().activeItemId !== null && highlightedItem) {\n const { item, itemInputValue, itemUrl, source } = highlightedItem;\n\n source.onActive({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n }\n })\n .finally(() => {\n setStatus('idle');\n\n if (lastStalledId) {\n props.environment.clearTimeout(lastStalledId);\n }\n });\n\n return store.pendingRequests.add(request);\n}\n","import { onInput } from './onInput';\nimport {\n ActionType,\n AutocompleteScopeApi,\n AutocompleteStore,\n BaseItem,\n InternalAutocompleteOptions,\n} from './types';\nimport { getActiveItem } from './utils';\n\ninterface OnKeyDownOptions\n extends AutocompleteScopeApi {\n event: KeyboardEvent;\n props: InternalAutocompleteOptions;\n store: AutocompleteStore;\n}\n\nexport function onKeyDown({\n event,\n props,\n refresh,\n store,\n ...setters\n}: OnKeyDownOptions): void {\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n // eslint-disable-next-line no-inner-declarations\n function triggerScrollIntoView() {\n const nodeItem = props.environment.document.getElementById(\n `${props.id}-item-${store.getState().activeItemId}`\n );\n\n if (nodeItem) {\n if ((nodeItem as any).scrollIntoViewIfNeeded) {\n (nodeItem as any).scrollIntoViewIfNeeded(false);\n } else {\n nodeItem.scrollIntoView(false);\n }\n }\n }\n\n // eslint-disable-next-line no-inner-declarations\n function triggerOnActive() {\n const highlightedItem = getActiveItem(store.getState());\n\n if (store.getState().activeItemId !== null && highlightedItem) {\n const { item, itemInputValue, itemUrl, source } = highlightedItem;\n\n source.onActive({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n }\n }\n\n // Default browser behavior changes the caret placement on ArrowUp and\n // ArrowDown.\n event.preventDefault();\n\n // When re-opening the panel, we need to split the logic to keep the actions\n // synchronized as `onInput` returns a promise.\n if (\n store.getState().isOpen === false &&\n (props.openOnFocus || Boolean(store.getState().query))\n ) {\n onInput({\n event,\n props,\n query: store.getState().query,\n refresh,\n store,\n ...setters,\n }).then(() => {\n store.dispatch(event.key as ActionType, {\n nextActiveItemId: props.defaultActiveItemId,\n });\n\n triggerOnActive();\n // Since we rely on the DOM, we need to wait for all the micro tasks to\n // finish (which include re-opening the panel) to make sure all the\n // elements are available.\n setTimeout(triggerScrollIntoView, 0);\n });\n } else {\n store.dispatch(event.key, {});\n\n triggerOnActive();\n triggerScrollIntoView();\n }\n } else if (event.key === 'Escape') {\n // This prevents the default browser behavior on `input[type=\"search\"]`\n // from removing the query right away because we first want to close the\n // panel.\n event.preventDefault();\n\n store.dispatch(event.key, null);\n\n // Hitting the `Escape` key signals the end of a user interaction with the\n // autocomplete. At this point, we should ignore any requests that are still\n // pending and could reopen the panel once they resolve, because that would\n // result in an unsolicited UI behavior.\n store.pendingRequests.cancelAll();\n } else if (event.key === 'Enter') {\n // No active item, so we let the browser handle the native `onSubmit` form\n // event.\n if (\n store.getState().activeItemId === null ||\n store\n .getState()\n .collections.every((collection) => collection.items.length === 0)\n ) {\n return;\n }\n\n // This prevents the `onSubmit` event to be sent because an item is\n // highlighted.\n event.preventDefault();\n\n const { item, itemInputValue, itemUrl, source } = getActiveItem(\n store.getState()\n )!;\n\n if (event.metaKey || event.ctrlKey) {\n if (itemUrl !== undefined) {\n source.onSelect({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n props.navigator.navigateNewTab({\n itemUrl,\n item,\n state: store.getState(),\n });\n }\n } else if (event.shiftKey) {\n if (itemUrl !== undefined) {\n source.onSelect({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n props.navigator.navigateNewWindow({\n itemUrl,\n item,\n state: store.getState(),\n });\n }\n } else if (event.altKey) {\n // Keep native browser behavior\n } else {\n if (itemUrl !== undefined) {\n source.onSelect({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n props.navigator.navigate({\n itemUrl,\n item,\n state: store.getState(),\n });\n\n return;\n }\n\n onInput({\n event,\n nextState: { isOpen: false },\n props,\n query: itemInputValue,\n refresh,\n store,\n ...setters,\n }).then(() => {\n source.onSelect({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n });\n }\n }\n}\n","import { onInput } from './onInput';\nimport { onKeyDown } from './onKeyDown';\nimport {\n AutocompleteScopeApi,\n AutocompleteStore,\n BaseItem,\n GetEnvironmentProps,\n GetFormProps,\n GetInputProps,\n GetItemProps,\n GetLabelProps,\n GetListProps,\n GetPanelProps,\n GetRootProps,\n InternalAutocompleteOptions,\n} from './types';\nimport { getActiveItem, isOrContainsNode } from './utils';\n\ninterface GetPropGettersOptions\n extends AutocompleteScopeApi {\n store: AutocompleteStore;\n props: InternalAutocompleteOptions;\n}\n\nexport function getPropGetters<\n TItem extends BaseItem,\n TEvent,\n TMouseEvent,\n TKeyboardEvent\n>({ props, refresh, store, ...setters }: GetPropGettersOptions) {\n const getEnvironmentProps: GetEnvironmentProps = (providedProps) => {\n const { inputElement, formElement, panelElement, ...rest } = providedProps;\n\n return {\n // On touch devices, we do not rely on the native `blur` event of the\n // input to close the panel, but rather on a custom `touchstart` event\n // outside of the autocomplete elements.\n // This ensures a working experience on mobile because we blur the input\n // on touch devices when the user starts scrolling (`touchmove`).\n // @TODO: support cases where there are multiple Autocomplete instances.\n // Right now, a second instance makes this computation return false.\n onTouchStart(event) {\n // The `onTouchStart` event shouldn't trigger the `blur` handler when\n // it's not an interaction with Autocomplete. We detect it with the\n // following heuristics:\n // - the panel is closed AND there are no pending requests\n // (no interaction with the autocomplete, no future state updates)\n // - OR the touched target is the input element (should open the panel)\n const isAutocompleteInteraction =\n store.getState().isOpen || !store.pendingRequests.isEmpty();\n\n if (!isAutocompleteInteraction || event.target === inputElement) {\n return;\n }\n\n const isTargetWithinAutocomplete = [formElement, panelElement].some(\n (contextNode) => {\n return isOrContainsNode(contextNode, event.target as Node);\n }\n );\n\n if (isTargetWithinAutocomplete === false) {\n store.dispatch('blur', null);\n\n // If requests are still pending when the user closes the panel, they\n // could reopen the panel once they resolve.\n // We want to prevent any subsequent query from reopening the panel\n // because it would result in an unsolicited UI behavior.\n if (!props.debug) {\n store.pendingRequests.cancelAll();\n }\n }\n },\n // When scrolling on touch devices (mobiles, tablets, etc.), we want to\n // mimic the native platform behavior where the input is blurred to\n // hide the virtual keyboard. This gives more vertical space to\n // discover all the suggestions showing up in the panel.\n onTouchMove(event: TouchEvent) {\n if (\n store.getState().isOpen === false ||\n inputElement !== props.environment.document.activeElement ||\n event.target === inputElement\n ) {\n return;\n }\n\n inputElement.blur();\n },\n ...rest,\n };\n };\n\n const getRootProps: GetRootProps = (rest) => {\n return {\n role: 'combobox',\n 'aria-expanded': store.getState().isOpen,\n 'aria-haspopup': 'listbox',\n 'aria-owns': store.getState().isOpen ? `${props.id}-list` : undefined,\n 'aria-labelledby': `${props.id}-label`,\n ...rest,\n };\n };\n\n const getFormProps: GetFormProps = (providedProps) => {\n const { inputElement, ...rest } = providedProps;\n\n return {\n action: '',\n noValidate: true,\n role: 'search',\n onSubmit: (event) => {\n ((event as unknown) as Event).preventDefault();\n\n props.onSubmit({\n event,\n refresh,\n state: store.getState(),\n ...setters,\n });\n\n store.dispatch('submit', null);\n providedProps.inputElement?.blur();\n },\n onReset: (event) => {\n ((event as unknown) as Event).preventDefault();\n\n props.onReset({\n event,\n refresh,\n state: store.getState(),\n ...setters,\n });\n\n store.dispatch('reset', null);\n providedProps.inputElement?.focus();\n },\n ...rest,\n };\n };\n\n const getInputProps: GetInputProps = (\n providedProps\n ) => {\n function onFocus(event: TEvent) {\n // We want to trigger a query when `openOnFocus` is true\n // because the panel should open with the current query.\n if (props.openOnFocus || Boolean(store.getState().query)) {\n onInput({\n event,\n props,\n query: store.getState().completion || store.getState().query,\n refresh,\n store,\n ...setters,\n });\n }\n\n store.dispatch('focus', null);\n }\n\n const isTouchDevice = 'ontouchstart' in props.environment;\n const { inputElement, maxLength = 512, ...rest } = providedProps || {};\n const activeItem = getActiveItem(store.getState());\n\n return {\n 'aria-autocomplete': 'both',\n 'aria-activedescendant':\n store.getState().isOpen && store.getState().activeItemId !== null\n ? `${props.id}-item-${store.getState().activeItemId}`\n : undefined,\n 'aria-controls': store.getState().isOpen ? `${props.id}-list` : undefined,\n 'aria-labelledby': `${props.id}-label`,\n value: store.getState().completion || store.getState().query,\n id: `${props.id}-input`,\n autoComplete: 'off',\n autoCorrect: 'off',\n autoCapitalize: 'off',\n enterKeyHint: activeItem?.itemUrl ? 'go' : 'search',\n spellCheck: 'false',\n autoFocus: props.autoFocus,\n placeholder: props.placeholder,\n maxLength,\n type: 'search',\n onChange: (event) => {\n onInput({\n event,\n props,\n query: (((event as unknown) as Event)\n .currentTarget as HTMLInputElement).value.slice(0, maxLength),\n refresh,\n store,\n ...setters,\n });\n },\n onKeyDown: (event) => {\n onKeyDown({\n event: (event as unknown) as KeyboardEvent,\n props,\n refresh,\n store,\n ...setters,\n });\n },\n onFocus,\n onBlur: () => {\n // We do rely on the `blur` event on touch devices.\n // See explanation in `onTouchStart`.\n if (!isTouchDevice) {\n store.dispatch('blur', null);\n\n // If requests are still pending when the user closes the panel, they\n // could reopen the panel once they resolve.\n // We want to prevent any subsequent query from reopening the panel\n // because it would result in an unsolicited UI behavior.\n if (!props.debug) {\n store.pendingRequests.cancelAll();\n }\n }\n },\n onClick: (event) => {\n // When the panel is closed and you click on the input while\n // the input is focused, the `onFocus` event is not triggered\n // (default browser behavior).\n // In an autocomplete context, it makes sense to open the panel in this\n // case.\n // We mimic this event by catching the `onClick` event which\n // triggers the `onFocus` for the panel to open.\n if (\n providedProps.inputElement ===\n props.environment.document.activeElement &&\n !store.getState().isOpen\n ) {\n onFocus((event as unknown) as TEvent);\n }\n },\n ...rest,\n };\n };\n\n const getLabelProps: GetLabelProps = (rest) => {\n return {\n htmlFor: `${props.id}-input`,\n id: `${props.id}-label`,\n ...rest,\n };\n };\n\n const getListProps: GetListProps = (rest) => {\n return {\n role: 'listbox',\n 'aria-labelledby': `${props.id}-label`,\n id: `${props.id}-list`,\n ...rest,\n };\n };\n\n const getPanelProps: GetPanelProps = (rest) => {\n return {\n onMouseDown(event) {\n // Prevents the `activeElement` from being changed to the panel so\n // that the blur event is not triggered, otherwise it closes the\n // panel.\n ((event as unknown) as MouseEvent).preventDefault();\n },\n onMouseLeave() {\n store.dispatch('mouseleave', null);\n },\n ...rest,\n };\n };\n\n const getItemProps: GetItemProps = (providedProps) => {\n const { item, source, ...rest } = providedProps;\n\n return {\n id: `${props.id}-item-${item.__autocomplete_id}`,\n role: 'option',\n 'aria-selected': store.getState().activeItemId === item.__autocomplete_id,\n onMouseMove(event) {\n if (item.__autocomplete_id === store.getState().activeItemId) {\n return;\n }\n\n store.dispatch('mousemove', item.__autocomplete_id);\n\n const activeItem = getActiveItem(store.getState());\n\n if (store.getState().activeItemId !== null && activeItem) {\n const { item, itemInputValue, itemUrl, source } = activeItem;\n\n source.onActive({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n }\n },\n onMouseDown(event) {\n // Prevents the `activeElement` from being changed to the item so it\n // can remain with the current `activeElement`.\n ((event as unknown) as MouseEvent).preventDefault();\n },\n onClick(event) {\n const itemInputValue = source.getItemInputValue({\n item,\n state: store.getState(),\n });\n const itemUrl = source.getItemUrl({\n item,\n state: store.getState(),\n });\n\n // If `getItemUrl` is provided, it means that the suggestion\n // is a link, not plain text that aims at updating the query.\n // We can therefore skip the state change because it will update\n // the `activeItemId`, resulting in a UI flash, especially\n // noticeable on mobile.\n const runPreCommand = itemUrl\n ? Promise.resolve()\n : onInput({\n event,\n nextState: { isOpen: false },\n props,\n query: itemInputValue,\n refresh,\n store,\n ...setters,\n });\n\n runPreCommand.then(() => {\n source.onSelect({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n });\n },\n ...rest,\n };\n };\n\n return {\n getEnvironmentProps,\n getRootProps,\n getFormProps,\n getLabelProps,\n getInputProps,\n getPanelProps,\n getListProps,\n getItemProps,\n };\n}\n","import { UserAgent, userAgents } from '@algolia/autocomplete-shared';\n\nimport {\n AutocompleteEnvironment,\n AutocompleteOptions,\n AutocompleteOptionsWithMetadata,\n AutocompletePlugin,\n BaseItem,\n} from '.';\n\ntype AutocompleteMetadata = {\n plugins: Array<{\n name: string | undefined;\n options: string[];\n }>;\n options: Record;\n ua: UserAgent[];\n};\n\ntype GetMetadataParams = {\n plugins: Array>;\n options: AutocompleteOptionsWithMetadata;\n};\n\nexport function getMetadata({\n plugins,\n options,\n}: GetMetadataParams) {\n const optionsKey = ((options.__autocomplete_metadata\n ?.userAgents as UserAgent[]) || [])[0]?.segment;\n\n const extraOptions = optionsKey\n ? {\n [optionsKey]: Object.keys(\n (options.__autocomplete_metadata\n ?.options as AutocompleteOptions) || {}\n ),\n }\n : {};\n\n return {\n plugins: plugins.map((plugin) => ({\n name: plugin.name,\n options: Object.keys(plugin.__autocomplete_pluginOptions || []),\n })),\n options: {\n 'autocomplete-core': Object.keys(options),\n ...extraOptions,\n },\n ua: userAgents.concat(\n (options.__autocomplete_metadata?.userAgents as any) || []\n ),\n };\n}\n\ntype InlineMetadataParams = {\n metadata: AutocompleteMetadata;\n environment: AutocompleteEnvironment;\n};\n\nexport function injectMetadata({\n metadata,\n environment,\n}: InlineMetadataParams) {\n const isMetadataEnabled = environment.navigator?.userAgent.includes(\n 'Algolia Crawler'\n );\n\n if (isMetadataEnabled) {\n const metadataContainer = environment.document.createElement('meta');\n const headRef = environment.document.querySelector('head');\n\n metadataContainer.name = 'algolia:metadata';\n\n setTimeout(() => {\n metadataContainer.content = JSON.stringify(metadata);\n headRef!.appendChild(metadataContainer);\n }, 0);\n }\n}\n","import { AutocompleteState, BaseItem } from './types';\nimport { getActiveItem } from './utils';\n\ninterface GetCompletionProps {\n state: AutocompleteState;\n}\n\nexport function getCompletion({\n state,\n}: GetCompletionProps): string | null {\n if (state.isOpen === false || state.activeItemId === null) {\n return null;\n }\n\n return getActiveItem(state)?.itemInputValue || null;\n}\n","import { getItemsCount, invariant } from '@algolia/autocomplete-shared';\n\nimport { getCompletion } from './getCompletion';\nimport { Reducer } from './types';\nimport { getNextActiveItemId } from './utils';\n\nexport const stateReducer: Reducer = (state, action) => {\n switch (action.type) {\n case 'setActiveItemId': {\n return {\n ...state,\n activeItemId: action.payload,\n };\n }\n\n case 'setQuery': {\n return {\n ...state,\n query: action.payload,\n completion: null,\n };\n }\n\n case 'setCollections': {\n return {\n ...state,\n collections: action.payload,\n };\n }\n\n case 'setIsOpen': {\n return {\n ...state,\n isOpen: action.payload,\n };\n }\n\n case 'setStatus': {\n return {\n ...state,\n status: action.payload,\n };\n }\n\n case 'setContext': {\n return {\n ...state,\n context: {\n ...state.context,\n ...action.payload,\n },\n };\n }\n\n case 'ArrowDown': {\n const nextState = {\n ...state,\n activeItemId: action.payload.hasOwnProperty('nextActiveItemId')\n ? action.payload.nextActiveItemId\n : getNextActiveItemId(\n 1,\n state.activeItemId,\n getItemsCount(state),\n action.props.defaultActiveItemId\n ),\n };\n\n return {\n ...nextState,\n completion: getCompletion({ state: nextState }),\n };\n }\n\n case 'ArrowUp': {\n const nextState = {\n ...state,\n activeItemId: getNextActiveItemId(\n -1,\n state.activeItemId,\n getItemsCount(state),\n action.props.defaultActiveItemId\n ),\n };\n\n return {\n ...nextState,\n completion: getCompletion({ state: nextState }),\n };\n }\n\n case 'Escape': {\n if (state.isOpen) {\n return {\n ...state,\n activeItemId: null,\n isOpen: false,\n completion: null,\n };\n }\n\n return {\n ...state,\n activeItemId: null,\n query: '',\n status: 'idle',\n collections: [],\n };\n }\n\n case 'submit': {\n return {\n ...state,\n activeItemId: null,\n isOpen: false,\n status: 'idle',\n };\n }\n\n case 'reset': {\n return {\n ...state,\n activeItemId:\n // Since we open the panel on reset when openOnFocus=true\n // we need to restore the highlighted index to the defaultActiveItemId. (DocSearch use-case)\n\n // Since we close the panel when openOnFocus=false\n // we lose track of the highlighted index. (Query-suggestions use-case)\n action.props.openOnFocus === true\n ? action.props.defaultActiveItemId\n : null,\n status: 'idle',\n query: '',\n };\n }\n\n case 'focus': {\n return {\n ...state,\n activeItemId: action.props.defaultActiveItemId,\n isOpen:\n (action.props.openOnFocus || Boolean(state.query)) &&\n action.props.shouldPanelOpen({ state }),\n };\n }\n\n case 'blur': {\n if (action.props.debug) {\n return state;\n }\n\n return {\n ...state,\n isOpen: false,\n activeItemId: null,\n };\n }\n\n case 'mousemove': {\n return {\n ...state,\n activeItemId: action.payload,\n };\n }\n\n case 'mouseleave': {\n return {\n ...state,\n activeItemId: action.props.defaultActiveItemId,\n };\n }\n\n default:\n invariant(\n false,\n `The reducer action ${JSON.stringify(action.type)} is not supported.`\n );\n\n return state;\n }\n};\n","import { checkOptions } from './checkOptions';\nimport { createStore } from './createStore';\nimport { getAutocompleteSetters } from './getAutocompleteSetters';\nimport { getDefaultProps } from './getDefaultProps';\nimport { getPropGetters } from './getPropGetters';\nimport { getMetadata, injectMetadata } from './metadata';\nimport { onInput } from './onInput';\nimport { stateReducer } from './stateReducer';\nimport {\n AutocompleteApi,\n AutocompleteOptions as AutocompleteCoreOptions,\n BaseItem,\n AutocompleteSubscribers,\n} from './types';\n\nexport interface AutocompleteOptionsWithMetadata\n extends AutocompleteCoreOptions {\n /**\n * @internal\n */\n __autocomplete_metadata?: Record;\n}\n\nexport function createAutocomplete<\n TItem extends BaseItem,\n TEvent = Event,\n TMouseEvent = MouseEvent,\n TKeyboardEvent = KeyboardEvent\n>(\n options: AutocompleteOptionsWithMetadata\n): AutocompleteApi {\n checkOptions(options);\n\n const subscribers: AutocompleteSubscribers = [];\n const props = getDefaultProps(options, subscribers);\n const store = createStore(stateReducer, props, onStoreStateChange);\n\n const setters = getAutocompleteSetters({ store });\n const propGetters = getPropGetters<\n TItem,\n TEvent,\n TMouseEvent,\n TKeyboardEvent\n >({ props, refresh, store, ...setters });\n\n function onStoreStateChange({ prevState, state }) {\n props.onStateChange({ prevState, state, refresh, ...setters });\n }\n\n function refresh() {\n return onInput({\n event: new Event('input'),\n nextState: { isOpen: store.getState().isOpen },\n props,\n query: store.getState().query,\n refresh,\n store,\n ...setters,\n });\n }\n\n props.plugins.forEach((plugin) =>\n plugin.subscribe?.({\n ...setters,\n refresh,\n onSelect(fn) {\n subscribers.push({ onSelect: fn });\n },\n onActive(fn) {\n subscribers.push({ onActive: fn });\n },\n })\n );\n\n injectMetadata({\n metadata: getMetadata({ plugins: props.plugins, options }),\n environment: props.environment,\n });\n\n return {\n refresh,\n ...propGetters,\n ...setters,\n };\n}\n"],"names":["_slicedToArray","arr","i","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","Object","prototype","toString","call","slice","constructor","name","Array","from","test","len","length","arr2","_i","Symbol","iterator","_arr","_n","_d","_s","_e","next","done","push","value","err","isArray","_typeof","obj","decycle","seen","arguments","undefined","Set","has","newSeen","add","map","x","fromEntries","entries","_ref","_ref2","key","flatten","values","reduce","a","b","concat","autocompleteId","generateAutocompleteId","getItemsCount","state","collections","sum","collection","items","invariant","condition","message","Error","noop","version","userAgents","segment","warnCache","current","warn","sanitizedMessage","trim","hasAlreadyPrinted","console","checkOptions","options","process","debug","createInternalCancelablePromise","promise","initialState","then","onfulfilled","onrejected","createCallback","catch","finally","onfinally","onCancelList","cancel","isCanceled","callbacks","forEach","callback","cancelable","onResult","fallback","arg","createCancelablePromiseList","list","cancelablePromise","filter","item","cancelAll","isEmpty","createConcurrentSafePromise","basePromiseId","latestResolvedId","latestResolvedValue","runConcurrentSafePromise","currentPromiseId","Promise","resolve","getNextActiveItemId","moveAmount","baseIndex","itemCount","defaultActiveItemId","numericIndex","getNormalizedSources","getSources","params","seenSourceIds","sources","JSON","stringify","all","maybeSource","Boolean","source","sourceId","includes","normalizedSource","getItemInputValue","query","getItemUrl","onSelect","setIsOpen","onActive","getCollectionFromActiveItemId","accumulatedCollectionsCount","acc","collectionsCount","index","previousValue","nextValue","collectionIndex","activeItemId","getRelativeActiveItemId","isOffsetFound","counter","previousItemsOffset","currentCollection","getActiveItem","itemInputValue","itemUrl","isOrContainsNode","parent","child","contains","mapToAlgoliaResponse","rawResults","results","result","hits","hit","__autocomplete_indexName","__autocomplete_queryID","queryID","facetHits","facetHit","label","count","_highlightResult","highlighted","createStore","reducer","props","onStoreStateChange","getState","dispatch","action","payload","prevState","type","pendingRequests","getAutocompleteSetters","store","setActiveItemId","setQuery","setCollections","rawValue","baseItemId","__autocomplete_id","setStatus","setContext","getDefaultProps","pluginSubscribers","environment","window","plugins","openOnFocus","placeholder","autoFocus","stallThreshold","shouldPanelOpen","reshape","id","completion","isOpen","status","context","onStateChange","onSubmit","onReset","plugin","nested","navigator","navigate","location","assign","navigateNewTab","windowReference","open","focus","navigateNewWindow","sourcesBySourceId","getItems","reshapeSources","isDescription","execute","isRequesterDescription","description","preResolve","itemsOrDescription","requests","queries","transformResponse","packed","searchClient","container","find","request","maybeDescription","responses","postResolve","matches","response","transform","every","lastStalledId","onInput","event","nextState","refresh","setters","clearTimeout","setTimeout","isPanelOpen","highlightedItem","onKeyDown","triggerScrollIntoView","nodeItem","document","getElementById","scrollIntoViewIfNeeded","scrollIntoView","triggerOnActive","preventDefault","nextActiveItemId","metaKey","ctrlKey","shiftKey","altKey","getPropGetters","getEnvironmentProps","providedProps","inputElement","formElement","panelElement","rest","onTouchStart","isAutocompleteInteraction","target","isTargetWithinAutocomplete","some","contextNode","onTouchMove","activeElement","blur","getRootProps","role","getFormProps","noValidate","getInputProps","onFocus","isTouchDevice","maxLength","activeItem","autoComplete","autoCorrect","autoCapitalize","enterKeyHint","spellCheck","onChange","currentTarget","onBlur","onClick","getLabelProps","htmlFor","getListProps","getPanelProps","onMouseDown","onMouseLeave","getItemProps","onMouseMove","runPreCommand","getMetadata","optionsKey","__autocomplete_metadata","extraOptions","keys","__autocomplete_pluginOptions","ua","injectMetadata","metadata","isMetadataEnabled","userAgent","metadataContainer","createElement","headRef","querySelector","content","appendChild","getCompletion","stateReducer","hasOwnProperty","createAutocomplete","subscribers","propGetters","Event","subscribe","fn"],"mappings":";;;;;;;;;;;;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ACuB,OAAN,CAAc5G,OAAd,CAAsB,UAAC2H,MAAD;EAAA;;EAAA,gCACpBA,MAAM,CAAC8H,SADa,sDACpB,uBAAA9H,MAAM,oCACDwC,OADC;EAEJD,MAAAA,OAAO,EAAPA,OAFI;EAGJtH,MAAAA,QAHI,oBAGK8M,EAHL,EAGS;EACXJ,QAAAA,WAAW,CAAC1T,IAAZ,CAAiB;EAAEgH,UAAAA,QAAQ,EAAE8M;EAAZ,SAAjB;EACD,OALG;EAMJ5M,MAAAA,QANI,oBAMK4M,EANL,EAMS;EACXJ,QAAAA,WAAW,CAAC1T,IAAZ,CAAiB;EAAEkH,UAAAA,QAAQ,EAAE4M;EAAZ,SAAjB;EACD;EARG,OADc;EAAA,GAAtB;EAaAlB,EAAAA,cAAc,CAAC;EACbC,IAAAA,QAAQ,EAAER,WAAW,CAAC;EAAErH,MAAAA,OAAO,EAAEvB,KAAK,CAACuB,OAAjB;EAA0B7H,MAAAA,OAAO,EAAPA;EAA1B,KAAD,CADR;EAEb2H,IAAAA,WAAW,EAAErB,KAAK,CAACqB;EAFN,GAAD,CAAd;EAKA;EACEwD,IAAAA,OAAO,EAAPA;EADF,KAEKqF,WAFL,GAGKpF,OAHL;EAKD;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/dist/umd/index.production.js b/node_modules/@algolia/autocomplete-core/dist/umd/index.production.js new file mode 100644 index 0000000000..f1f55713c0 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/dist/umd/index.production.js @@ -0,0 +1,3 @@ +/*! @algolia/autocomplete-core 1.5.2 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/autocomplete-core"]={})}(this,(function(e){"use strict";function t(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 n(e){for(var n=1;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function i(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=n?null===r?null:0:o}function g(e){var t=function(e){var t=e.collections.map((function(e){return e.items.length})).reduce((function(e,t,n){var r=(e[n-1]||0)+t;return e.push(r),e}),[]).reduce((function(t,n){return n<=e.activeItemId?t+1:t}),0);return e.collections[t]}(e);if(!t)return null;var n=t.items[function(e){for(var t=e.state,n=e.collection,r=!1,o=0,i=0;!1===r;){var u=t.collections[o];if(u===n){r=!0;break}i+=u.items.length,o++}return t.activeItemId-i}({state:e,collection:t})],r=t.source;return{item:n,itemInputValue:r.getItemInputValue({item:n,state:e}),itemUrl:r.getItemUrl({item:n,state:e}),source:r}}function h(e,t){var r,o="undefined"!=typeof window?window:{},u=e.plugins||[];return n(n({debug:!1,openOnFocus:!1,placeholder:"",autoFocus:!1,defaultActiveItemId:null,stallThreshold:300,environment:o,shouldPanelOpen:function(e){return l(e.state)>0},reshape:function(e){return e.sources}},e),{},{id:null!==(r=e.id)&&void 0!==r?r:"autocomplete-".concat(c++),plugins:u,initialState:n({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var n;null===(n=e.onStateChange)||void 0===n||n.call(e,t),u.forEach((function(e){var n;return null===(n=e.onStateChange)||void 0===n?void 0:n.call(e,t)}))},onSubmit:function(t){var n;null===(n=e.onSubmit)||void 0===n||n.call(e,t),u.forEach((function(e){var n;return null===(n=e.onSubmit)||void 0===n?void 0:n.call(e,t)}))},onReset:function(t){var n;null===(n=e.onReset)||void 0===n||n.call(e,t),u.forEach((function(e){var n;return null===(n=e.onReset)||void 0===n?void 0:n.call(e,t)}))},getSources:function(r){return Promise.all([].concat(i(u.map((function(e){return e.getSources}))),[e.getSources]).filter(Boolean).map((function(e){return function(e,t){var r=[];return Promise.resolve(e(t)).then((function(e){return Promise.all(e.filter((function(e){return Boolean(e)})).map((function(e){if(e.sourceId,r.includes(e.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(e.sourceId)," is not unique."));r.push(e.sourceId);var t=n({getItemInputValue:function(e){return e.state.query},getItemUrl:function(){},onSelect:function(e){(0,e.setIsOpen)(!1)},onActive:s},e);return Promise.resolve(t)})))}))}(e,r)}))).then((function(e){return a(e)})).then((function(e){return e.map((function(e){return n(n({},e),{},{onSelect:function(n){e.onSelect(n),t.forEach((function(e){var t;return null===(t=e.onSelect)||void 0===t?void 0:t.call(e,n)}))},onActive:function(n){e.onActive(n),t.forEach((function(e){var t;return null===(t=e.onActive)||void 0===t?void 0:t.call(e,n)}))}})}))}))},navigator:n({navigate:function(e){var t=e.itemUrl;o.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl,n=o.open(t,"_blank","noopener");null==n||n.focus()},navigateNewWindow:function(e){var t=e.itemUrl;o.open(t,"_blank","noopener")}},e.navigator)})}function I(e){return Boolean(e.execute)}function y(e,t){return r=e,Boolean(null==r?void 0:r.execute)?n(n({},e),{},{requests:e.queries.map((function(n){return{query:n,sourceId:t,transformResponse:e.transformResponse}}))}):{items:e,sourceId:t};var r}function S(e){var t=e.reduce((function(e,t){if(!I(t))return e.push(t),e;var n=t.searchClient,r=t.execute,o=t.requests,u=e.find((function(e){return I(t)&&I(e)&&e.searchClient===n&&e.execute===r}));if(u){var a;(a=u.items).push.apply(a,i(o))}else{var c={execute:r,items:o,searchClient:n};e.push(c)}return e}),[]).map((function(e){if(!I(e))return Promise.resolve(e);var t=e,n=t.execute,r=t.items;return n({searchClient:t.searchClient,requests:r})}));return Promise.all(t).then((function(e){return a(e)}))}function b(e,t){return t.map((function(t){var r=e.filter((function(e){return e.sourceId===t.sourceId})),o=r.map((function(e){return e.items})),i=r[0].transformResponse,u=i?i(function(e){var t=e.map((function(e){var t;return n(n({},e),{},{hits:null===(t=e.hits)||void 0===t?void 0:t.map((function(t){return n(n({},t),{},{__autocomplete_indexName:e.index,__autocomplete_queryID:e.queryID})}))})}));return{results:t,hits:t.map((function(e){return e.hits})).filter(Boolean),facetHits:t.map((function(e){var t;return null===(t=e.facetHits)||void 0===t?void 0:t.map((function(e){return{label:e.value,count:e.count,_highlightResult:{label:{value:e.highlighted}}}}))})).filter(Boolean)}}(o)):o;return u.every(Boolean),'The `getItems` function from source "'.concat(t.sourceId,'" must return an array of items but returned ').concat(JSON.stringify(void 0),".\n\nDid you forget to return items?\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems"),{source:t,items:u}}))}var O,A,w,q=["event","nextState","props","query","refresh","store"],P=null,_=(O=-1,A=-1,w=void 0,function(e){var t=++O;return Promise.resolve(e).then((function(e){return w&&t = (\n resolve: (value: TValue | PromiseLike) => void,\n reject: (reason?: any) => void\n) => void;\n\ntype CancelablePromiseState = {\n isCanceled: boolean;\n onCancelList: Array<(...args: any[]) => any>;\n};\n\nfunction createInternalCancelablePromise(\n promise: Promise,\n initialState: CancelablePromiseState\n): CancelablePromise {\n const state = initialState;\n\n return {\n then(onfulfilled, onrejected) {\n return createInternalCancelablePromise(\n promise.then(\n createCallback(onfulfilled, state, promise),\n createCallback(onrejected, state, promise)\n ),\n state\n );\n },\n catch(onrejected) {\n return createInternalCancelablePromise(\n promise.catch(createCallback(onrejected, state, promise)),\n state\n );\n },\n finally(onfinally) {\n if (onfinally) {\n state.onCancelList.push(onfinally);\n }\n\n return createInternalCancelablePromise(\n promise.finally(\n createCallback(\n onfinally &&\n (() => {\n state.onCancelList = [];\n\n return onfinally();\n }),\n state,\n promise\n )\n ),\n state\n );\n },\n cancel() {\n state.isCanceled = true;\n const callbacks = state.onCancelList;\n state.onCancelList = [];\n\n callbacks.forEach((callback) => {\n callback();\n });\n },\n isCanceled() {\n return state.isCanceled === true;\n },\n };\n}\n\nexport type CancelablePromise = {\n then(\n onfulfilled?:\n | ((\n value: TValue\n ) =>\n | TResultFulfilled\n | PromiseLike\n | CancelablePromise)\n | undefined\n | null,\n onrejected?:\n | ((\n reason: any\n ) =>\n | TResultRejected\n | PromiseLike\n | CancelablePromise)\n | undefined\n | null\n ): CancelablePromise;\n catch(\n onrejected?:\n | ((\n reason: any\n ) => TResult | PromiseLike | CancelablePromise)\n | undefined\n | null\n ): CancelablePromise;\n finally(\n onfinally?: (() => void) | undefined | null\n ): CancelablePromise;\n cancel(): void;\n isCanceled(): boolean;\n};\n\nexport function createCancelablePromise(\n executor: PromiseExecutor\n): CancelablePromise {\n return createInternalCancelablePromise(\n new Promise((resolve, reject) => {\n return executor(resolve, reject);\n }),\n { isCanceled: false, onCancelList: [] }\n );\n}\n\ncreateCancelablePromise.resolve = (\n value?: TValue | PromiseLike | CancelablePromise\n) => cancelable(Promise.resolve(value));\n\ncreateCancelablePromise.reject = (reason?: any) =>\n cancelable(Promise.reject(reason));\n\nexport function cancelable(promise: Promise) {\n return createInternalCancelablePromise(promise, {\n isCanceled: false,\n onCancelList: [],\n });\n}\n\nfunction createCallback(\n onResult: ((...args: any[]) => any) | null | undefined,\n state: CancelablePromiseState,\n fallback: any\n) {\n if (!onResult) {\n return fallback;\n }\n\n return function callback(arg?: any) {\n if (state.isCanceled) {\n return arg;\n }\n\n return onResult(arg);\n };\n}\n","/**\n * Returns the next active item ID from the current state.\n *\n * We allow circular keyboard navigation from the base index.\n * The base index can either be `null` (nothing is highlighted) or `0`\n * (the first item is highlighted).\n * The base index is allowed to get assigned `null` only if\n * `props.defaultActiveItemId` is `null`. This pattern allows to \"stop\"\n * by the actual query before navigating to other suggestions as seen on\n * Google or Amazon.\n *\n * @param moveAmount The offset to increment (or decrement) the last index\n * @param baseIndex The current index to compute the next index from\n * @param itemCount The number of items\n * @param defaultActiveItemId The default active index to fallback to\n */\nexport function getNextActiveItemId(\n moveAmount: number,\n baseIndex: number | null,\n itemCount: number,\n defaultActiveItemId: number | null\n): number | null {\n if (!itemCount) {\n return null;\n }\n\n if (\n moveAmount < 0 &&\n (baseIndex === null || (defaultActiveItemId !== null && baseIndex === 0))\n ) {\n return itemCount + moveAmount;\n }\n\n const numericIndex = (baseIndex === null ? -1 : baseIndex) + moveAmount;\n\n if (numericIndex <= -1 || numericIndex >= itemCount) {\n return defaultActiveItemId === null ? null : 0;\n }\n\n return numericIndex;\n}\n","import { AutocompleteCollection, AutocompleteState, BaseItem } from '../types';\n\n// We don't have access to the autocomplete source when we call `onKeyDown`\n// or `onClick` because those are native browser events.\n// However, we can get the source from the suggestion index.\nfunction getCollectionFromActiveItemId(\n state: AutocompleteState\n): AutocompleteCollection | undefined {\n // Given 3 sources with respectively 1, 2 and 3 suggestions: [1, 2, 3]\n // We want to get the accumulated counts:\n // [1, 1 + 2, 1 + 2 + 3] = [1, 3, 3 + 3] = [1, 3, 6]\n const accumulatedCollectionsCount = state.collections\n .map((collections) => collections.items.length)\n .reduce((acc, collectionsCount, index) => {\n const previousValue = acc[index - 1] || 0;\n const nextValue = previousValue + collectionsCount;\n\n acc.push(nextValue);\n\n return acc;\n }, []);\n\n // Based on the accumulated counts, we can infer the index of the suggestion.\n const collectionIndex = accumulatedCollectionsCount.reduce((acc, current) => {\n if (current <= state.activeItemId!) {\n return acc + 1;\n }\n\n return acc;\n }, 0);\n\n return state.collections[collectionIndex];\n}\n\n/**\n * Gets the highlighted index relative to a suggestion object (not the absolute\n * highlighted index).\n *\n * Example:\n * [['a', 'b'], ['c', 'd', 'e'], ['f']]\n * ↑\n * (absolute: 3, relative: 1)\n */\nfunction getRelativeActiveItemId({\n state,\n collection,\n}: {\n state: AutocompleteState;\n collection: AutocompleteCollection;\n}): number {\n let isOffsetFound = false;\n let counter = 0;\n let previousItemsOffset = 0;\n\n while (isOffsetFound === false) {\n const currentCollection = state.collections[counter];\n\n if (currentCollection === collection) {\n isOffsetFound = true;\n break;\n }\n\n previousItemsOffset += currentCollection.items.length;\n\n counter++;\n }\n\n return state.activeItemId! - previousItemsOffset;\n}\n\nexport function getActiveItem(\n state: AutocompleteState\n) {\n const collection = getCollectionFromActiveItemId(state);\n\n if (!collection) {\n return null;\n }\n\n const item = collection.items[getRelativeActiveItemId({ state, collection })];\n const source = collection.source;\n const itemInputValue = source.getItemInputValue({ item, state });\n const itemUrl = source.getItemUrl({ item, state });\n\n return {\n item,\n itemInputValue,\n itemUrl,\n source,\n };\n}\n","import {\n getItemsCount,\n generateAutocompleteId,\n flatten,\n} from '@algolia/autocomplete-shared';\n\nimport {\n AutocompleteEnvironment,\n AutocompleteOptions,\n AutocompleteSubscribers,\n BaseItem,\n InternalAutocompleteOptions,\n} from './types';\nimport { getNormalizedSources } from './utils';\n\nexport function getDefaultProps(\n props: AutocompleteOptions,\n pluginSubscribers: AutocompleteSubscribers\n): InternalAutocompleteOptions {\n /* eslint-disable no-restricted-globals */\n const environment: AutocompleteEnvironment = (typeof window !== 'undefined'\n ? window\n : {}) as typeof window;\n /* eslint-enable no-restricted-globals */\n const plugins = props.plugins || [];\n\n return {\n debug: false,\n openOnFocus: false,\n placeholder: '',\n autoFocus: false,\n defaultActiveItemId: null,\n stallThreshold: 300,\n environment,\n shouldPanelOpen: ({ state }) => getItemsCount(state) > 0,\n reshape: ({ sources }) => sources,\n ...props,\n // Since `generateAutocompleteId` triggers a side effect (it increments\n // an internal counter), we don't want to execute it if unnecessary.\n id: props.id ?? generateAutocompleteId(),\n plugins,\n // The following props need to be deeply defaulted.\n initialState: {\n activeItemId: null,\n query: '',\n completion: null,\n collections: [],\n isOpen: false,\n status: 'idle',\n context: {},\n ...props.initialState,\n },\n onStateChange(params) {\n props.onStateChange?.(params);\n plugins.forEach((x) => x.onStateChange?.(params));\n },\n onSubmit(params) {\n props.onSubmit?.(params);\n plugins.forEach((x) => x.onSubmit?.(params));\n },\n onReset(params) {\n props.onReset?.(params);\n plugins.forEach((x) => x.onReset?.(params));\n },\n getSources(params) {\n return Promise.all(\n [...plugins.map((plugin) => plugin.getSources), props.getSources]\n .filter(Boolean)\n .map((getSources) => getNormalizedSources(getSources!, params))\n )\n .then((nested) => flatten(nested))\n .then((sources) =>\n sources.map((source) => ({\n ...source,\n onSelect(params) {\n source.onSelect(params);\n pluginSubscribers.forEach((x) => x.onSelect?.(params));\n },\n onActive(params) {\n source.onActive(params);\n pluginSubscribers.forEach((x) => x.onActive?.(params));\n },\n }))\n );\n },\n navigator: {\n navigate({ itemUrl }) {\n environment.location.assign(itemUrl);\n },\n navigateNewTab({ itemUrl }) {\n const windowReference = environment.open(itemUrl, '_blank', 'noopener');\n windowReference?.focus();\n },\n navigateNewWindow({ itemUrl }) {\n environment.open(itemUrl, '_blank', 'noopener');\n },\n ...props.navigator,\n },\n };\n}\n","import { invariant, decycle, noop } from '@algolia/autocomplete-shared';\n\nimport {\n AutocompleteSource,\n BaseItem,\n GetSources,\n GetSourcesParams,\n InternalAutocompleteSource,\n InternalGetSources,\n} from '../types';\n\nexport function getNormalizedSources(\n getSources: GetSources,\n params: GetSourcesParams\n): ReturnType> {\n const seenSourceIds: string[] = [];\n\n return Promise.resolve(getSources(params)).then((sources) => {\n invariant(\n Array.isArray(sources),\n () =>\n `The \\`getSources\\` function must return an array of sources but returned type ${JSON.stringify(\n typeof sources\n )}:\\n\\n${JSON.stringify(decycle(sources), null, 2)}`\n );\n\n return Promise.all(\n sources\n // We allow `undefined` and `false` sources to allow users to use\n // `Boolean(query) && source` (=> `false`).\n // We need to remove these values at this point.\n .filter((maybeSource: any): maybeSource is AutocompleteSource =>\n Boolean(maybeSource)\n )\n .map((source) => {\n invariant(\n typeof source.sourceId === 'string',\n 'A source must provide a `sourceId` string.'\n );\n\n if (seenSourceIds.includes(source.sourceId)) {\n throw new Error(\n `[Autocomplete] The \\`sourceId\\` ${JSON.stringify(\n source.sourceId\n )} is not unique.`\n );\n }\n\n seenSourceIds.push(source.sourceId);\n\n const normalizedSource: InternalAutocompleteSource = {\n getItemInputValue({ state }) {\n return state.query;\n },\n getItemUrl() {\n return undefined;\n },\n onSelect({ setIsOpen }) {\n setIsOpen(false);\n },\n onActive: noop,\n ...source,\n };\n\n return Promise.resolve(normalizedSource);\n })\n );\n });\n}\n","import type {\n Execute,\n ExecuteResponse,\n RequesterDescription,\n TransformResponse,\n} from '@algolia/autocomplete-preset-algolia';\nimport { decycle, flatten, invariant } from '@algolia/autocomplete-shared';\nimport {\n MultipleQueriesQuery,\n SearchForFacetValuesResponse,\n SearchResponse,\n} from '@algolia/client-search';\nimport type { SearchClient } from 'algoliasearch/lite';\n\nimport { BaseItem, InternalAutocompleteSource } from './types';\nimport { mapToAlgoliaResponse } from './utils';\n\nfunction isDescription(\n item:\n | RequestDescriptionPreResolved\n | RequestDescriptionPreResolvedCustom\n | PackedDescription\n): item is RequestDescriptionPreResolved {\n return Boolean((item as RequestDescriptionPreResolved).execute);\n}\n\nfunction isRequesterDescription(\n description: TItem[] | TItem[][] | RequesterDescription\n): description is RequesterDescription {\n return Boolean((description as RequesterDescription)?.execute);\n}\n\ntype PackedDescription = {\n searchClient: SearchClient;\n execute: Execute;\n items: RequestDescriptionPreResolved['requests'];\n};\n\ntype RequestDescriptionPreResolved = Pick<\n RequesterDescription,\n 'execute' | 'searchClient' | 'transformResponse'\n> & {\n requests: Array<{\n query: MultipleQueriesQuery;\n sourceId: string;\n transformResponse: TransformResponse;\n }>;\n};\n\ntype RequestDescriptionPreResolvedCustom = {\n items: TItem[] | TItem[][];\n sourceId: string;\n transformResponse?: undefined;\n};\n\nexport function preResolve(\n itemsOrDescription: TItem[] | TItem[][] | RequesterDescription,\n sourceId: string\n):\n | RequestDescriptionPreResolved\n | RequestDescriptionPreResolvedCustom {\n if (isRequesterDescription(itemsOrDescription)) {\n return {\n ...itemsOrDescription,\n requests: itemsOrDescription.queries.map((query) => ({\n query,\n sourceId,\n transformResponse: itemsOrDescription.transformResponse,\n })),\n };\n }\n\n return {\n items: itemsOrDescription,\n sourceId,\n };\n}\n\nexport function resolve(\n items: Array<\n | RequestDescriptionPreResolved\n | RequestDescriptionPreResolvedCustom\n >\n) {\n const packed = items.reduce<\n Array | PackedDescription>\n >((acc, current) => {\n if (!isDescription(current)) {\n acc.push(current);\n return acc;\n }\n\n const { searchClient, execute, requests } = current;\n\n const container = acc.find>(\n (item): item is PackedDescription => {\n return (\n isDescription(current) &&\n isDescription(item) &&\n item.searchClient === searchClient &&\n item.execute === execute\n );\n }\n );\n\n if (container) {\n container.items.push(...requests);\n } else {\n const request: PackedDescription = {\n execute,\n items: requests,\n searchClient,\n };\n acc.push(request);\n }\n\n return acc;\n }, []);\n\n const values = packed.map<\n | Promise>\n | ReturnType>\n >((maybeDescription) => {\n if (!isDescription(maybeDescription)) {\n return Promise.resolve(\n maybeDescription as RequestDescriptionPreResolvedCustom\n );\n }\n\n const {\n execute,\n items,\n searchClient,\n } = maybeDescription as PackedDescription;\n\n return execute({\n searchClient,\n requests: items,\n });\n });\n\n return Promise.all<\n RequestDescriptionPreResolvedCustom | ExecuteResponse\n >(values).then((responses) =>\n flatten<\n RequestDescriptionPreResolvedCustom | ExecuteResponse[0]\n >(responses)\n );\n}\n\nexport function postResolve(\n responses: Array<\n RequestDescriptionPreResolvedCustom | ExecuteResponse[0]\n >,\n sources: Array>\n) {\n return sources.map((source) => {\n const matches = responses.filter(\n (response) => response.sourceId === source.sourceId\n );\n const results = matches.map(({ items }) => items);\n const transform = matches[0].transformResponse;\n const items = transform\n ? transform(\n mapToAlgoliaResponse(\n results as Array<\n SearchForFacetValuesResponse | SearchResponse\n >\n )\n )\n : results;\n\n invariant(\n Array.isArray(items),\n () => `The \\`getItems\\` function from source \"${\n source.sourceId\n }\" must return an array of items but returned type ${JSON.stringify(\n typeof items\n )}:\\n\\n${JSON.stringify(decycle(items), null, 2)}.\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems`\n );\n\n invariant(\n (items as Array).every(Boolean),\n `The \\`getItems\\` function from source \"${\n source.sourceId\n }\" must return an array of items but returned ${JSON.stringify(\n undefined\n )}.\n\nDid you forget to return items?\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems`\n );\n\n return {\n source,\n items,\n };\n });\n}\n","import type {\n SearchForFacetValuesResponse,\n SearchResponse,\n} from '@algolia/client-search';\n\nexport function mapToAlgoliaResponse(\n rawResults: Array | SearchForFacetValuesResponse>\n) {\n const results: Array<\n SearchResponse | SearchForFacetValuesResponse\n > = rawResults.map((result) => {\n return {\n ...result,\n hits: (result as SearchResponse).hits?.map((hit) => {\n // Bring support for the Insights plugin.\n return {\n ...hit,\n __autocomplete_indexName: (result as SearchResponse).index,\n __autocomplete_queryID: (result as SearchResponse).queryID,\n };\n }),\n };\n });\n\n return {\n results,\n hits: results\n .map((result) => (result as SearchResponse).hits)\n .filter(Boolean),\n facetHits: results\n .map((result) =>\n (result as SearchForFacetValuesResponse).facetHits?.map((facetHit) => {\n // Bring support for the highlighting components.\n return {\n label: facetHit.value,\n count: facetHit.count,\n _highlightResult: {\n label: {\n value: facetHit.highlighted,\n },\n },\n };\n })\n )\n .filter(Boolean),\n };\n}\n","import { MaybePromise } from '@algolia/autocomplete-shared';\n\n/**\n * Creates a runner that executes promises in a concurrent-safe way.\n *\n * This is useful to prevent older promises to resolve after a newer promise,\n * otherwise resulting in stale resolved values.\n */\nexport function createConcurrentSafePromise() {\n let basePromiseId = -1;\n let latestResolvedId = -1;\n let latestResolvedValue: unknown = undefined;\n\n return function runConcurrentSafePromise(\n promise: MaybePromise\n ) {\n basePromiseId++;\n const currentPromiseId = basePromiseId;\n\n return Promise.resolve(promise).then((x) => {\n // The promise might take too long to resolve and get outdated. This would\n // result in resolving stale values.\n // When this happens, we ignore the promise value and return the one\n // coming from the latest resolved value.\n //\n // +----------------------------------+\n // | 100ms |\n // | run(1) +---> R1 |\n // | 300ms |\n // | run(2) +-------------> R2 (SKIP) |\n // | 200ms |\n // | run(3) +--------> R3 |\n // +----------------------------------+\n if (latestResolvedValue && currentPromiseId < latestResolvedId) {\n return latestResolvedValue as TValue;\n }\n\n latestResolvedId = currentPromiseId;\n latestResolvedValue = x;\n\n return x;\n });\n };\n}\n","import { reshape } from './reshape';\nimport { preResolve, resolve, postResolve } from './resolve';\nimport {\n AutocompleteScopeApi,\n AutocompleteState,\n AutocompleteStore,\n BaseItem,\n InternalAutocompleteOptions,\n} from './types';\nimport {\n cancelable,\n CancelablePromise,\n createConcurrentSafePromise,\n getActiveItem,\n} from './utils';\n\nlet lastStalledId: number | null = null;\n\ninterface OnInputParams\n extends AutocompleteScopeApi {\n event: any;\n /**\n * The next partial state to apply after the function is called.\n *\n * This is useful when we call `onInput` in a different scenario than an\n * actual input. For example, we use `onInput` when we click on an item,\n * but we want to close the panel in that case.\n */\n nextState?: Partial>;\n props: InternalAutocompleteOptions;\n query: string;\n store: AutocompleteStore;\n}\n\nconst runConcurrentSafePromise = createConcurrentSafePromise();\n\nexport function onInput({\n event,\n nextState = {},\n props,\n query,\n refresh,\n store,\n ...setters\n}: OnInputParams): CancelablePromise {\n if (lastStalledId) {\n props.environment.clearTimeout(lastStalledId);\n }\n\n const {\n setCollections,\n setIsOpen,\n setQuery,\n setActiveItemId,\n setStatus,\n } = setters;\n\n setQuery(query);\n setActiveItemId(props.defaultActiveItemId);\n\n if (!query && props.openOnFocus === false) {\n const collections = store.getState().collections.map((collection) => ({\n ...collection,\n items: [],\n }));\n\n setStatus('idle');\n setCollections(collections);\n setIsOpen(\n nextState.isOpen ?? props.shouldPanelOpen({ state: store.getState() })\n );\n\n // We make sure to update the latest resolved value of the tracked\n // promises to keep late resolving promises from \"cancelling\" the state\n // updates performed in this code path.\n // We chain with a void promise to respect `onInput`'s expected return type.\n const request = cancelable(\n runConcurrentSafePromise(collections).then(() => Promise.resolve())\n );\n\n return store.pendingRequests.add(request);\n }\n\n setStatus('loading');\n\n lastStalledId = props.environment.setTimeout(() => {\n setStatus('stalled');\n }, props.stallThreshold);\n\n // We track the entire promise chain triggered by `onInput` before mutating\n // the Autocomplete state to make sure that any state manipulation is based on\n // fresh data regardless of when promises individually resolve.\n // We don't track nested promises and only rely on the full chain resolution,\n // meaning we should only ever manipulate the state once this concurrent-safe\n // promise is resolved.\n const request = cancelable(\n runConcurrentSafePromise(\n props\n .getSources({\n query,\n refresh,\n state: store.getState(),\n ...setters,\n })\n .then((sources) => {\n return Promise.all(\n sources.map((source) => {\n return Promise.resolve(\n source.getItems({\n query,\n refresh,\n state: store.getState(),\n ...setters,\n })\n ).then((itemsOrDescription) =>\n preResolve(itemsOrDescription, source.sourceId)\n );\n })\n )\n .then(resolve)\n .then((responses) => postResolve(responses, sources))\n .then((collections) =>\n reshape({ collections, props, state: store.getState() })\n );\n })\n )\n )\n .then((collections) => {\n // Parameters passed to `onInput` could be stale when the following code\n // executes, because `onInput` calls may not resolve in order.\n // If it becomes a problem we'll need to save the last passed parameters.\n // See: https://codesandbox.io/s/agitated-cookies-y290z\n\n setStatus('idle');\n\n setCollections(collections as any);\n\n const isPanelOpen = props.shouldPanelOpen({ state: store.getState() });\n\n setIsOpen(\n nextState.isOpen ??\n ((props.openOnFocus && !query && isPanelOpen) || isPanelOpen)\n );\n\n const highlightedItem = getActiveItem(store.getState());\n\n if (store.getState().activeItemId !== null && highlightedItem) {\n const { item, itemInputValue, itemUrl, source } = highlightedItem;\n\n source.onActive({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n }\n })\n .finally(() => {\n setStatus('idle');\n\n if (lastStalledId) {\n props.environment.clearTimeout(lastStalledId);\n }\n });\n\n return store.pendingRequests.add(request);\n}\n","import { flatten } from '@algolia/autocomplete-shared';\n\nimport {\n AutocompleteCollection,\n AutocompleteReshapeSourcesBySourceId,\n AutocompleteState,\n BaseItem,\n InternalAutocompleteOptions,\n} from './types';\n\ntype ReshapeParams = {\n collections: Array>;\n props: InternalAutocompleteOptions;\n state: AutocompleteState;\n};\n\nexport function reshape({\n collections,\n props,\n state,\n}: ReshapeParams) {\n // Sources are grouped by `sourceId` to conveniently pick them via destructuring.\n // Example: `const { recentSearchesPlugin } = sourcesBySourceId`\n const sourcesBySourceId = collections.reduce<\n AutocompleteReshapeSourcesBySourceId\n >(\n (acc, collection) => ({\n ...acc,\n [collection.source.sourceId]: {\n ...collection.source,\n getItems() {\n // We provide the resolved items from the collection to the `reshape` prop.\n return flatten(collection.items);\n },\n },\n }),\n {}\n );\n\n const reshapeSources = props.reshape({\n sources: Object.values(sourcesBySourceId),\n sourcesBySourceId,\n state,\n });\n\n // We reconstruct the collections with the items modified by the `reshape` prop.\n return flatten(reshapeSources)\n .filter(Boolean)\n .map((source) => {\n return {\n source,\n items: source.getItems(),\n };\n });\n}\n","import { onInput } from './onInput';\nimport { onKeyDown } from './onKeyDown';\nimport {\n AutocompleteScopeApi,\n AutocompleteStore,\n BaseItem,\n GetEnvironmentProps,\n GetFormProps,\n GetInputProps,\n GetItemProps,\n GetLabelProps,\n GetListProps,\n GetPanelProps,\n GetRootProps,\n InternalAutocompleteOptions,\n} from './types';\nimport { getActiveItem, isOrContainsNode } from './utils';\n\ninterface GetPropGettersOptions\n extends AutocompleteScopeApi {\n store: AutocompleteStore;\n props: InternalAutocompleteOptions;\n}\n\nexport function getPropGetters<\n TItem extends BaseItem,\n TEvent,\n TMouseEvent,\n TKeyboardEvent\n>({ props, refresh, store, ...setters }: GetPropGettersOptions) {\n const getEnvironmentProps: GetEnvironmentProps = (providedProps) => {\n const { inputElement, formElement, panelElement, ...rest } = providedProps;\n\n return {\n // On touch devices, we do not rely on the native `blur` event of the\n // input to close the panel, but rather on a custom `touchstart` event\n // outside of the autocomplete elements.\n // This ensures a working experience on mobile because we blur the input\n // on touch devices when the user starts scrolling (`touchmove`).\n // @TODO: support cases where there are multiple Autocomplete instances.\n // Right now, a second instance makes this computation return false.\n onTouchStart(event) {\n // The `onTouchStart` event shouldn't trigger the `blur` handler when\n // it's not an interaction with Autocomplete. We detect it with the\n // following heuristics:\n // - the panel is closed AND there are no pending requests\n // (no interaction with the autocomplete, no future state updates)\n // - OR the touched target is the input element (should open the panel)\n const isAutocompleteInteraction =\n store.getState().isOpen || !store.pendingRequests.isEmpty();\n\n if (!isAutocompleteInteraction || event.target === inputElement) {\n return;\n }\n\n const isTargetWithinAutocomplete = [formElement, panelElement].some(\n (contextNode) => {\n return isOrContainsNode(contextNode, event.target as Node);\n }\n );\n\n if (isTargetWithinAutocomplete === false) {\n store.dispatch('blur', null);\n\n // If requests are still pending when the user closes the panel, they\n // could reopen the panel once they resolve.\n // We want to prevent any subsequent query from reopening the panel\n // because it would result in an unsolicited UI behavior.\n if (!props.debug) {\n store.pendingRequests.cancelAll();\n }\n }\n },\n // When scrolling on touch devices (mobiles, tablets, etc.), we want to\n // mimic the native platform behavior where the input is blurred to\n // hide the virtual keyboard. This gives more vertical space to\n // discover all the suggestions showing up in the panel.\n onTouchMove(event: TouchEvent) {\n if (\n store.getState().isOpen === false ||\n inputElement !== props.environment.document.activeElement ||\n event.target === inputElement\n ) {\n return;\n }\n\n inputElement.blur();\n },\n ...rest,\n };\n };\n\n const getRootProps: GetRootProps = (rest) => {\n return {\n role: 'combobox',\n 'aria-expanded': store.getState().isOpen,\n 'aria-haspopup': 'listbox',\n 'aria-owns': store.getState().isOpen ? `${props.id}-list` : undefined,\n 'aria-labelledby': `${props.id}-label`,\n ...rest,\n };\n };\n\n const getFormProps: GetFormProps = (providedProps) => {\n const { inputElement, ...rest } = providedProps;\n\n return {\n action: '',\n noValidate: true,\n role: 'search',\n onSubmit: (event) => {\n ((event as unknown) as Event).preventDefault();\n\n props.onSubmit({\n event,\n refresh,\n state: store.getState(),\n ...setters,\n });\n\n store.dispatch('submit', null);\n providedProps.inputElement?.blur();\n },\n onReset: (event) => {\n ((event as unknown) as Event).preventDefault();\n\n props.onReset({\n event,\n refresh,\n state: store.getState(),\n ...setters,\n });\n\n store.dispatch('reset', null);\n providedProps.inputElement?.focus();\n },\n ...rest,\n };\n };\n\n const getInputProps: GetInputProps = (\n providedProps\n ) => {\n function onFocus(event: TEvent) {\n // We want to trigger a query when `openOnFocus` is true\n // because the panel should open with the current query.\n if (props.openOnFocus || Boolean(store.getState().query)) {\n onInput({\n event,\n props,\n query: store.getState().completion || store.getState().query,\n refresh,\n store,\n ...setters,\n });\n }\n\n store.dispatch('focus', null);\n }\n\n const isTouchDevice = 'ontouchstart' in props.environment;\n const { inputElement, maxLength = 512, ...rest } = providedProps || {};\n const activeItem = getActiveItem(store.getState());\n\n return {\n 'aria-autocomplete': 'both',\n 'aria-activedescendant':\n store.getState().isOpen && store.getState().activeItemId !== null\n ? `${props.id}-item-${store.getState().activeItemId}`\n : undefined,\n 'aria-controls': store.getState().isOpen ? `${props.id}-list` : undefined,\n 'aria-labelledby': `${props.id}-label`,\n value: store.getState().completion || store.getState().query,\n id: `${props.id}-input`,\n autoComplete: 'off',\n autoCorrect: 'off',\n autoCapitalize: 'off',\n enterKeyHint: activeItem?.itemUrl ? 'go' : 'search',\n spellCheck: 'false',\n autoFocus: props.autoFocus,\n placeholder: props.placeholder,\n maxLength,\n type: 'search',\n onChange: (event) => {\n onInput({\n event,\n props,\n query: (((event as unknown) as Event)\n .currentTarget as HTMLInputElement).value.slice(0, maxLength),\n refresh,\n store,\n ...setters,\n });\n },\n onKeyDown: (event) => {\n onKeyDown({\n event: (event as unknown) as KeyboardEvent,\n props,\n refresh,\n store,\n ...setters,\n });\n },\n onFocus,\n onBlur: () => {\n // We do rely on the `blur` event on touch devices.\n // See explanation in `onTouchStart`.\n if (!isTouchDevice) {\n store.dispatch('blur', null);\n\n // If requests are still pending when the user closes the panel, they\n // could reopen the panel once they resolve.\n // We want to prevent any subsequent query from reopening the panel\n // because it would result in an unsolicited UI behavior.\n if (!props.debug) {\n store.pendingRequests.cancelAll();\n }\n }\n },\n onClick: (event) => {\n // When the panel is closed and you click on the input while\n // the input is focused, the `onFocus` event is not triggered\n // (default browser behavior).\n // In an autocomplete context, it makes sense to open the panel in this\n // case.\n // We mimic this event by catching the `onClick` event which\n // triggers the `onFocus` for the panel to open.\n if (\n providedProps.inputElement ===\n props.environment.document.activeElement &&\n !store.getState().isOpen\n ) {\n onFocus((event as unknown) as TEvent);\n }\n },\n ...rest,\n };\n };\n\n const getLabelProps: GetLabelProps = (rest) => {\n return {\n htmlFor: `${props.id}-input`,\n id: `${props.id}-label`,\n ...rest,\n };\n };\n\n const getListProps: GetListProps = (rest) => {\n return {\n role: 'listbox',\n 'aria-labelledby': `${props.id}-label`,\n id: `${props.id}-list`,\n ...rest,\n };\n };\n\n const getPanelProps: GetPanelProps = (rest) => {\n return {\n onMouseDown(event) {\n // Prevents the `activeElement` from being changed to the panel so\n // that the blur event is not triggered, otherwise it closes the\n // panel.\n ((event as unknown) as MouseEvent).preventDefault();\n },\n onMouseLeave() {\n store.dispatch('mouseleave', null);\n },\n ...rest,\n };\n };\n\n const getItemProps: GetItemProps = (providedProps) => {\n const { item, source, ...rest } = providedProps;\n\n return {\n id: `${props.id}-item-${item.__autocomplete_id}`,\n role: 'option',\n 'aria-selected': store.getState().activeItemId === item.__autocomplete_id,\n onMouseMove(event) {\n if (item.__autocomplete_id === store.getState().activeItemId) {\n return;\n }\n\n store.dispatch('mousemove', item.__autocomplete_id);\n\n const activeItem = getActiveItem(store.getState());\n\n if (store.getState().activeItemId !== null && activeItem) {\n const { item, itemInputValue, itemUrl, source } = activeItem;\n\n source.onActive({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n }\n },\n onMouseDown(event) {\n // Prevents the `activeElement` from being changed to the item so it\n // can remain with the current `activeElement`.\n ((event as unknown) as MouseEvent).preventDefault();\n },\n onClick(event) {\n const itemInputValue = source.getItemInputValue({\n item,\n state: store.getState(),\n });\n const itemUrl = source.getItemUrl({\n item,\n state: store.getState(),\n });\n\n // If `getItemUrl` is provided, it means that the suggestion\n // is a link, not plain text that aims at updating the query.\n // We can therefore skip the state change because it will update\n // the `activeItemId`, resulting in a UI flash, especially\n // noticeable on mobile.\n const runPreCommand = itemUrl\n ? Promise.resolve()\n : onInput({\n event,\n nextState: { isOpen: false },\n props,\n query: itemInputValue,\n refresh,\n store,\n ...setters,\n });\n\n runPreCommand.then(() => {\n source.onSelect({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n });\n },\n ...rest,\n };\n };\n\n return {\n getEnvironmentProps,\n getRootProps,\n getFormProps,\n getLabelProps,\n getInputProps,\n getPanelProps,\n getListProps,\n getItemProps,\n };\n}\n","export function isOrContainsNode(parent: Node, child: Node) {\n return parent === child || parent.contains(child);\n}\n","import { onInput } from './onInput';\nimport {\n ActionType,\n AutocompleteScopeApi,\n AutocompleteStore,\n BaseItem,\n InternalAutocompleteOptions,\n} from './types';\nimport { getActiveItem } from './utils';\n\ninterface OnKeyDownOptions\n extends AutocompleteScopeApi {\n event: KeyboardEvent;\n props: InternalAutocompleteOptions;\n store: AutocompleteStore;\n}\n\nexport function onKeyDown({\n event,\n props,\n refresh,\n store,\n ...setters\n}: OnKeyDownOptions): void {\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n // eslint-disable-next-line no-inner-declarations\n function triggerScrollIntoView() {\n const nodeItem = props.environment.document.getElementById(\n `${props.id}-item-${store.getState().activeItemId}`\n );\n\n if (nodeItem) {\n if ((nodeItem as any).scrollIntoViewIfNeeded) {\n (nodeItem as any).scrollIntoViewIfNeeded(false);\n } else {\n nodeItem.scrollIntoView(false);\n }\n }\n }\n\n // eslint-disable-next-line no-inner-declarations\n function triggerOnActive() {\n const highlightedItem = getActiveItem(store.getState());\n\n if (store.getState().activeItemId !== null && highlightedItem) {\n const { item, itemInputValue, itemUrl, source } = highlightedItem;\n\n source.onActive({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n }\n }\n\n // Default browser behavior changes the caret placement on ArrowUp and\n // ArrowDown.\n event.preventDefault();\n\n // When re-opening the panel, we need to split the logic to keep the actions\n // synchronized as `onInput` returns a promise.\n if (\n store.getState().isOpen === false &&\n (props.openOnFocus || Boolean(store.getState().query))\n ) {\n onInput({\n event,\n props,\n query: store.getState().query,\n refresh,\n store,\n ...setters,\n }).then(() => {\n store.dispatch(event.key as ActionType, {\n nextActiveItemId: props.defaultActiveItemId,\n });\n\n triggerOnActive();\n // Since we rely on the DOM, we need to wait for all the micro tasks to\n // finish (which include re-opening the panel) to make sure all the\n // elements are available.\n setTimeout(triggerScrollIntoView, 0);\n });\n } else {\n store.dispatch(event.key, {});\n\n triggerOnActive();\n triggerScrollIntoView();\n }\n } else if (event.key === 'Escape') {\n // This prevents the default browser behavior on `input[type=\"search\"]`\n // from removing the query right away because we first want to close the\n // panel.\n event.preventDefault();\n\n store.dispatch(event.key, null);\n\n // Hitting the `Escape` key signals the end of a user interaction with the\n // autocomplete. At this point, we should ignore any requests that are still\n // pending and could reopen the panel once they resolve, because that would\n // result in an unsolicited UI behavior.\n store.pendingRequests.cancelAll();\n } else if (event.key === 'Enter') {\n // No active item, so we let the browser handle the native `onSubmit` form\n // event.\n if (\n store.getState().activeItemId === null ||\n store\n .getState()\n .collections.every((collection) => collection.items.length === 0)\n ) {\n return;\n }\n\n // This prevents the `onSubmit` event to be sent because an item is\n // highlighted.\n event.preventDefault();\n\n const { item, itemInputValue, itemUrl, source } = getActiveItem(\n store.getState()\n )!;\n\n if (event.metaKey || event.ctrlKey) {\n if (itemUrl !== undefined) {\n source.onSelect({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n props.navigator.navigateNewTab({\n itemUrl,\n item,\n state: store.getState(),\n });\n }\n } else if (event.shiftKey) {\n if (itemUrl !== undefined) {\n source.onSelect({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n props.navigator.navigateNewWindow({\n itemUrl,\n item,\n state: store.getState(),\n });\n }\n } else if (event.altKey) {\n // Keep native browser behavior\n } else {\n if (itemUrl !== undefined) {\n source.onSelect({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n props.navigator.navigate({\n itemUrl,\n item,\n state: store.getState(),\n });\n\n return;\n }\n\n onInput({\n event,\n nextState: { isOpen: false },\n props,\n query: itemInputValue,\n refresh,\n store,\n ...setters,\n }).then(() => {\n source.onSelect({\n event,\n item,\n itemInputValue,\n itemUrl,\n refresh,\n source,\n state: store.getState(),\n ...setters,\n });\n });\n }\n }\n}\n","import { UserAgent, userAgents } from '@algolia/autocomplete-shared';\n\nimport {\n AutocompleteEnvironment,\n AutocompleteOptions,\n AutocompleteOptionsWithMetadata,\n AutocompletePlugin,\n BaseItem,\n} from '.';\n\ntype AutocompleteMetadata = {\n plugins: Array<{\n name: string | undefined;\n options: string[];\n }>;\n options: Record;\n ua: UserAgent[];\n};\n\ntype GetMetadataParams = {\n plugins: Array>;\n options: AutocompleteOptionsWithMetadata;\n};\n\nexport function getMetadata({\n plugins,\n options,\n}: GetMetadataParams) {\n const optionsKey = ((options.__autocomplete_metadata\n ?.userAgents as UserAgent[]) || [])[0]?.segment;\n\n const extraOptions = optionsKey\n ? {\n [optionsKey]: Object.keys(\n (options.__autocomplete_metadata\n ?.options as AutocompleteOptions) || {}\n ),\n }\n : {};\n\n return {\n plugins: plugins.map((plugin) => ({\n name: plugin.name,\n options: Object.keys(plugin.__autocomplete_pluginOptions || []),\n })),\n options: {\n 'autocomplete-core': Object.keys(options),\n ...extraOptions,\n },\n ua: userAgents.concat(\n (options.__autocomplete_metadata?.userAgents as any) || []\n ),\n };\n}\n\ntype InlineMetadataParams = {\n metadata: AutocompleteMetadata;\n environment: AutocompleteEnvironment;\n};\n\nexport function injectMetadata({\n metadata,\n environment,\n}: InlineMetadataParams) {\n const isMetadataEnabled = environment.navigator?.userAgent.includes(\n 'Algolia Crawler'\n );\n\n if (isMetadataEnabled) {\n const metadataContainer = environment.document.createElement('meta');\n const headRef = environment.document.querySelector('head');\n\n metadataContainer.name = 'algolia:metadata';\n\n setTimeout(() => {\n metadataContainer.content = JSON.stringify(metadata);\n headRef!.appendChild(metadataContainer);\n }, 0);\n }\n}\n","import { AutocompleteState, BaseItem } from './types';\nimport { getActiveItem } from './utils';\n\ninterface GetCompletionProps {\n state: AutocompleteState;\n}\n\nexport function getCompletion({\n state,\n}: GetCompletionProps): string | null {\n if (state.isOpen === false || state.activeItemId === null) {\n return null;\n }\n\n return getActiveItem(state)?.itemInputValue || null;\n}\n","import { getItemsCount, invariant } from '@algolia/autocomplete-shared';\n\nimport { getCompletion } from './getCompletion';\nimport { Reducer } from './types';\nimport { getNextActiveItemId } from './utils';\n\nexport const stateReducer: Reducer = (state, action) => {\n switch (action.type) {\n case 'setActiveItemId': {\n return {\n ...state,\n activeItemId: action.payload,\n };\n }\n\n case 'setQuery': {\n return {\n ...state,\n query: action.payload,\n completion: null,\n };\n }\n\n case 'setCollections': {\n return {\n ...state,\n collections: action.payload,\n };\n }\n\n case 'setIsOpen': {\n return {\n ...state,\n isOpen: action.payload,\n };\n }\n\n case 'setStatus': {\n return {\n ...state,\n status: action.payload,\n };\n }\n\n case 'setContext': {\n return {\n ...state,\n context: {\n ...state.context,\n ...action.payload,\n },\n };\n }\n\n case 'ArrowDown': {\n const nextState = {\n ...state,\n activeItemId: action.payload.hasOwnProperty('nextActiveItemId')\n ? action.payload.nextActiveItemId\n : getNextActiveItemId(\n 1,\n state.activeItemId,\n getItemsCount(state),\n action.props.defaultActiveItemId\n ),\n };\n\n return {\n ...nextState,\n completion: getCompletion({ state: nextState }),\n };\n }\n\n case 'ArrowUp': {\n const nextState = {\n ...state,\n activeItemId: getNextActiveItemId(\n -1,\n state.activeItemId,\n getItemsCount(state),\n action.props.defaultActiveItemId\n ),\n };\n\n return {\n ...nextState,\n completion: getCompletion({ state: nextState }),\n };\n }\n\n case 'Escape': {\n if (state.isOpen) {\n return {\n ...state,\n activeItemId: null,\n isOpen: false,\n completion: null,\n };\n }\n\n return {\n ...state,\n activeItemId: null,\n query: '',\n status: 'idle',\n collections: [],\n };\n }\n\n case 'submit': {\n return {\n ...state,\n activeItemId: null,\n isOpen: false,\n status: 'idle',\n };\n }\n\n case 'reset': {\n return {\n ...state,\n activeItemId:\n // Since we open the panel on reset when openOnFocus=true\n // we need to restore the highlighted index to the defaultActiveItemId. (DocSearch use-case)\n\n // Since we close the panel when openOnFocus=false\n // we lose track of the highlighted index. (Query-suggestions use-case)\n action.props.openOnFocus === true\n ? action.props.defaultActiveItemId\n : null,\n status: 'idle',\n query: '',\n };\n }\n\n case 'focus': {\n return {\n ...state,\n activeItemId: action.props.defaultActiveItemId,\n isOpen:\n (action.props.openOnFocus || Boolean(state.query)) &&\n action.props.shouldPanelOpen({ state }),\n };\n }\n\n case 'blur': {\n if (action.props.debug) {\n return state;\n }\n\n return {\n ...state,\n isOpen: false,\n activeItemId: null,\n };\n }\n\n case 'mousemove': {\n return {\n ...state,\n activeItemId: action.payload,\n };\n }\n\n case 'mouseleave': {\n return {\n ...state,\n activeItemId: action.props.defaultActiveItemId,\n };\n }\n\n default:\n invariant(\n false,\n `The reducer action ${JSON.stringify(action.type)} is not supported.`\n );\n\n return state;\n }\n};\n","import { checkOptions } from './checkOptions';\nimport { createStore } from './createStore';\nimport { getAutocompleteSetters } from './getAutocompleteSetters';\nimport { getDefaultProps } from './getDefaultProps';\nimport { getPropGetters } from './getPropGetters';\nimport { getMetadata, injectMetadata } from './metadata';\nimport { onInput } from './onInput';\nimport { stateReducer } from './stateReducer';\nimport {\n AutocompleteApi,\n AutocompleteOptions as AutocompleteCoreOptions,\n BaseItem,\n AutocompleteSubscribers,\n} from './types';\n\nexport interface AutocompleteOptionsWithMetadata\n extends AutocompleteCoreOptions {\n /**\n * @internal\n */\n __autocomplete_metadata?: Record;\n}\n\nexport function createAutocomplete<\n TItem extends BaseItem,\n TEvent = Event,\n TMouseEvent = MouseEvent,\n TKeyboardEvent = KeyboardEvent\n>(\n options: AutocompleteOptionsWithMetadata\n): AutocompleteApi {\n checkOptions(options);\n\n const subscribers: AutocompleteSubscribers = [];\n const props = getDefaultProps(options, subscribers);\n const store = createStore(stateReducer, props, onStoreStateChange);\n\n const setters = getAutocompleteSetters({ store });\n const propGetters = getPropGetters<\n TItem,\n TEvent,\n TMouseEvent,\n TKeyboardEvent\n >({ props, refresh, store, ...setters });\n\n function onStoreStateChange({ prevState, state }) {\n props.onStateChange({ prevState, state, refresh, ...setters });\n }\n\n function refresh() {\n return onInput({\n event: new Event('input'),\n nextState: { isOpen: store.getState().isOpen },\n props,\n query: store.getState().query,\n refresh,\n store,\n ...setters,\n });\n }\n\n props.plugins.forEach((plugin) =>\n plugin.subscribe?.({\n ...setters,\n refresh,\n onSelect(fn) {\n subscribers.push({ onSelect: fn });\n },\n onActive(fn) {\n subscribers.push({ onActive: fn });\n },\n })\n );\n\n injectMetadata({\n metadata: getMetadata({ plugins: props.plugins, options }),\n environment: props.environment,\n });\n\n return {\n refresh,\n ...propGetters,\n ...setters,\n };\n}\n","import {\n AutocompleteState,\n AutocompleteStore,\n BaseItem,\n InternalAutocompleteOptions,\n Reducer,\n} from './types';\nimport { createCancelablePromiseList } from './utils';\n\ntype OnStoreStateChange = ({\n prevState,\n state,\n}: {\n prevState: AutocompleteState;\n state: AutocompleteState;\n}) => void;\n\nexport function createStore(\n reducer: Reducer,\n props: InternalAutocompleteOptions,\n onStoreStateChange: OnStoreStateChange\n): AutocompleteStore {\n let state = props.initialState;\n\n return {\n getState() {\n return state;\n },\n dispatch(action, payload) {\n const prevState = { ...state };\n state = reducer(state, {\n type: action,\n props,\n payload,\n });\n\n onStoreStateChange({ state, prevState });\n },\n pendingRequests: createCancelablePromiseList(),\n };\n}\n","import { CancelablePromise } from '.';\n\nexport type CancelablePromiseList = {\n add(cancelablePromise: CancelablePromise): CancelablePromise;\n cancelAll(): void;\n isEmpty(): boolean;\n};\n\nexport function createCancelablePromiseList<\n TValue\n>(): CancelablePromiseList {\n let list: Array> = [];\n\n return {\n add(cancelablePromise) {\n list.push(cancelablePromise);\n\n return cancelablePromise.finally(() => {\n list = list.filter((item) => item !== cancelablePromise);\n });\n },\n cancelAll() {\n list.forEach((promise) => promise.cancel());\n },\n isEmpty() {\n return list.length === 0;\n },\n };\n}\n","import { flatten } from '@algolia/autocomplete-shared';\n\nimport {\n AutocompleteApi,\n AutocompleteCollection,\n AutocompleteStore,\n BaseItem,\n} from './types';\n\ninterface GetAutocompleteSettersOptions {\n store: AutocompleteStore;\n}\n\nexport function getAutocompleteSetters({\n store,\n}: GetAutocompleteSettersOptions) {\n const setActiveItemId: AutocompleteApi['setActiveItemId'] = (\n value\n ) => {\n store.dispatch('setActiveItemId', value);\n };\n\n const setQuery: AutocompleteApi['setQuery'] = (value) => {\n store.dispatch('setQuery', value);\n };\n\n const setCollections: AutocompleteApi['setCollections'] = (\n rawValue\n ) => {\n let baseItemId = 0;\n const value = rawValue.map>((collection) => ({\n ...collection,\n // We flatten the stored items to support calling `getAlgoliaResults`\n // from the source itself.\n items: flatten(collection.items as any).map((item: any) => ({\n ...item,\n __autocomplete_id: baseItemId++,\n })),\n }));\n\n store.dispatch('setCollections', value);\n };\n\n const setIsOpen: AutocompleteApi['setIsOpen'] = (value) => {\n store.dispatch('setIsOpen', value);\n };\n\n const setStatus: AutocompleteApi['setStatus'] = (value) => {\n store.dispatch('setStatus', value);\n };\n\n const setContext: AutocompleteApi['setContext'] = (value) => {\n store.dispatch('setContext', value);\n };\n\n return {\n setActiveItemId,\n setQuery,\n setCollections,\n setIsOpen,\n setStatus,\n setContext,\n };\n}\n"],"names":["flatten","values","reduce","a","b","concat","autocompleteId","getItemsCount","state","collections","length","sum","collection","items","noop","userAgents","segment","version","createInternalCancelablePromise","promise","initialState","then","onfulfilled","onrejected","createCallback","catch","finally","onfinally","onCancelList","push","cancel","isCanceled","callbacks","forEach","callback","cancelable","onResult","fallback","arg","getNextActiveItemId","moveAmount","baseIndex","itemCount","defaultActiveItemId","numericIndex","getActiveItem","collectionIndex","map","acc","collectionsCount","index","nextValue","current","activeItemId","getCollectionFromActiveItemId","item","isOffsetFound","counter","previousItemsOffset","currentCollection","getRelativeActiveItemId","source","itemInputValue","getItemInputValue","itemUrl","getItemUrl","getDefaultProps","props","pluginSubscribers","environment","window","plugins","debug","openOnFocus","placeholder","autoFocus","stallThreshold","shouldPanelOpen","reshape","sources","id","query","completion","isOpen","status","context","onStateChange","params","x","_x$onStateChange","onSubmit","_x$onSubmit","onReset","_x$onReset","getSources","Promise","all","plugin","filter","Boolean","seenSourceIds","resolve","maybeSource","sourceId","includes","Error","JSON","stringify","normalizedSource","onSelect","setIsOpen","onActive","getNormalizedSources","nested","_x$onSelect","_x$onActive","navigator","navigate","location","assign","navigateNewTab","windowReference","open","focus","navigateNewWindow","isDescription","execute","preResolve","itemsOrDescription","description","requests","queries","transformResponse","searchClient","container","find","request","maybeDescription","responses","postResolve","matches","response","results","transform","rawResults","result","hits","_hits","hit","__autocomplete_indexName","__autocomplete_queryID","queryID","facetHits","_facetHits","facetHit","label","value","count","_highlightResult","highlighted","mapToAlgoliaResponse","every","undefined","basePromiseId","latestResolvedId","latestResolvedValue","lastStalledId","runConcurrentSafePromise","currentPromiseId","onInput","event","nextState","refresh","store","setters","clearTimeout","setCollections","setQuery","setActiveItemId","setStatus","getState","pendingRequests","add","setTimeout","getItems","sourcesBySourceId","Object","isPanelOpen","highlightedItem","getPropGetters","getEnvironmentProps","providedProps","inputElement","formElement","panelElement","onTouchStart","isEmpty","target","some","contextNode","parent","child","contains","dispatch","cancelAll","onTouchMove","document","activeElement","blur","getRootProps","rest","role","getFormProps","action","noValidate","preventDefault","getLabelProps","htmlFor","getInputProps","onFocus","isTouchDevice","maxLength","activeItem","autoComplete","autoCorrect","autoCapitalize","enterKeyHint","spellCheck","type","onChange","currentTarget","slice","onKeyDown","key","triggerScrollIntoView","nodeItem","getElementById","scrollIntoViewIfNeeded","scrollIntoView","triggerOnActive","nextActiveItemId","metaKey","ctrlKey","shiftKey","altKey","onBlur","onClick","getPanelProps","onMouseDown","onMouseLeave","getListProps","getItemProps","__autocomplete_id","onMouseMove","getMetadata","options","optionsKey","__autocomplete_metadata","_options$__autocomple","_","extraOptions","keys","_options$__autocomple2","name","__autocomplete_pluginOptions","ua","_options$__autocomple3","getCompletion","stateReducer","payload","hasOwnProperty","subscribers","reducer","onStoreStateChange","list","prevState","cancelablePromise","createStore","rawValue","baseItemId","setContext","getAutocompleteSetters","propGetters","Event","subscribe","_plugin$subscribe","fn","metadata","_environment$navigato","userAgent","metadataContainer","createElement","headRef","querySelector","content","appendChild","injectMetadata"],"mappings":";6iEAAO,SAASA,EAAQC,UACfA,EAAOC,QAAO,SAAUC,EAAGC,UACzBD,EAAEE,OAAOD,KACf,ICHL,IAAIE,EAAiB,ECAd,SAASC,EAAcC,UACK,IAA7BA,EAAMC,YAAYC,OACb,EAGFF,EAAMC,YAAYP,QAAO,SAAUS,EAAKC,UACtCD,EAAMC,EAAWC,MAAMH,SAC7B,GCPE,IAAII,EAAO,aCCPC,EAAa,CAAC,CACvBC,QAAS,oBACTC,QCHmB,UCUrB,SAASC,EACPC,EACAC,OAEMZ,EAAQY,QAEP,CACLC,cAAKC,EAAaC,UACTL,EACLC,EAAQE,KACNG,EAAeF,EAAad,EAAOW,GACnCK,EAAeD,EAAYf,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O2L,8BAAPC,OAAA5L,SACK6E,OACHF,QAAAA,EACA/D,kBAASiL,GACPf,EAAYlP,KAAK,CAAEgF,SAAUiL,KAE/B/K,kBAAS+K,GACPf,EAAYlP,KAAK,CAAEkF,SAAU+K,WHT9B,kBACLC,IAAAA,SACA1N,IAAAA,yBAE0BA,EAAY+C,8BAAZ4K,EAAuBC,UAAUzL,SACzD,mBAGqB,KACf0L,EAAoB7N,EAAYyI,SAASqF,cAAc,QACvDC,EAAU/N,EAAYyI,SAASuF,cAAc,QAEnDH,EAAkB3B,KAAO,mBAEzBhF,YAAW,WACT2G,EAAkBI,QAAU5L,KAAKC,UAAUoL,GAC3CK,EAASG,YAAYL,KACpB,IGHLM,CAAe,CACbT,SAAUjC,EAAY,CAAEvL,QAASJ,EAAMI,QAASwL,QAAAA,IAChD1L,YAAaF,EAAME,mBAInBuG,QAAAA,GACG8G,GACA5G"} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-core/package.json b/node_modules/@algolia/autocomplete-core/package.json new file mode 100644 index 0000000000..0072eb69b5 --- /dev/null +++ b/node_modules/@algolia/autocomplete-core/package.json @@ -0,0 +1,41 @@ +{ + "name": "@algolia/autocomplete-core", + "description": "Core primitives for building autocomplete experiences.", + "version": "1.5.2", + "license": "MIT", + "homepage": "https://github.com/algolia/autocomplete", + "repository": "algolia/autocomplete", + "author": { + "name": "Algolia, Inc.", + "url": "https://www.algolia.com" + }, + "source": "src/index.ts", + "types": "dist/esm/index.d.ts", + "module": "dist/esm/index.js", + "main": "dist/umd/index.production.js", + "umd:main": "dist/umd/index.production.js", + "unpkg": "dist/umd/index.production.js", + "jsdelivr": "dist/umd/index.production.js", + "sideEffects": false, + "files": [ + "dist/" + ], + "scripts": { + "build:clean": "rm -rf ./dist", + "build:esm": "babel src --root-mode upward --extensions '.ts,.tsx' --out-dir dist/esm --ignore '**/*/__tests__/'", + "build:types": "tsc -p ./tsconfig.declaration.json --outDir ./dist/esm", + "build:umd": "rollup --config", + "build": "yarn build:clean && yarn build:umd && yarn build:esm && yarn build:types", + "on:change": "concurrently \"yarn build:esm\" \"yarn build:types\"", + "prepare": "yarn build:esm && yarn build:types", + "watch": "watch \"yarn on:change\" --ignoreDirectoryPattern \"/dist/\"" + }, + "dependencies": { + "@algolia/autocomplete-shared": "1.5.2" + }, + "devDependencies": { + "@algolia/autocomplete-preset-algolia": "1.5.2", + "@algolia/client-search": "4.9.1", + "algoliasearch": "4.9.1" + } +} diff --git a/node_modules/@algolia/autocomplete-preset-algolia/README.md b/node_modules/@algolia/autocomplete-preset-algolia/README.md new file mode 100644 index 0000000000..da4d3c1b6a --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/README.md @@ -0,0 +1,15 @@ +# @algolia/autocomplete-preset-algolia + +The Algolia preset provides fetching and highlighting utilities for usage with Algolia. + +## Installation + +```sh +yarn add @algolia/autocomplete-preset-algolia +# or +npm install @algolia/autocomplete-preset-algolia +``` + +## Documentation + +See [**Documentation**](https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-preset-algolia). diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/constants/index.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/constants/index.d.ts new file mode 100644 index 0000000000..eefc295ff5 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/constants/index.d.ts @@ -0,0 +1,2 @@ +export declare const HIGHLIGHT_PRE_TAG = "__aa-highlight__"; +export declare const HIGHLIGHT_POST_TAG = "__/aa-highlight__"; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/constants/index.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/constants/index.js new file mode 100644 index 0000000000..66dcdd1862 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/constants/index.js @@ -0,0 +1,2 @@ +export var HIGHLIGHT_PRE_TAG = '__aa-highlight__'; +export var HIGHLIGHT_POST_TAG = '__/aa-highlight__'; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/HighlightedHit.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/HighlightedHit.d.ts new file mode 100644 index 0000000000..c65da849fc --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/HighlightedHit.d.ts @@ -0,0 +1,4 @@ +import { HighlightResult } from '@algolia/client-search'; +export declare type HighlightedHit = THit & { + _highlightResult?: HighlightResult; +}; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/HighlightedHit.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/HighlightedHit.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/HighlightedHit.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParseAlgoliaHitParams.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParseAlgoliaHitParams.d.ts new file mode 100644 index 0000000000..f6fe56162a --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParseAlgoliaHitParams.d.ts @@ -0,0 +1,4 @@ +export declare type ParseAlgoliaHitParams = { + hit: TItem; + attribute: keyof TItem | string[]; +}; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParseAlgoliaHitParams.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParseAlgoliaHitParams.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParseAlgoliaHitParams.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParsedAttribute.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParsedAttribute.d.ts new file mode 100644 index 0000000000..977a68dd35 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParsedAttribute.d.ts @@ -0,0 +1,4 @@ +export declare type ParsedAttribute = { + value: string; + isHighlighted: boolean; +}; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParsedAttribute.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParsedAttribute.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/ParsedAttribute.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/SnippetedHit.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/SnippetedHit.d.ts new file mode 100644 index 0000000000..de638e9d27 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/SnippetedHit.d.ts @@ -0,0 +1,4 @@ +import { SnippetResult } from '@algolia/client-search'; +export declare type SnippetedHit = THit & { + _snippetResult?: SnippetResult; +}; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/SnippetedHit.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/SnippetedHit.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/SnippetedHit.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/index.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/index.d.ts new file mode 100644 index 0000000000..fdc8b211aa --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/index.d.ts @@ -0,0 +1,6 @@ +export * from './HighlightedHit'; +export * from './parseAlgoliaHitHighlight'; +export * from './parseAlgoliaHitReverseHighlight'; +export * from './parseAlgoliaHitReverseSnippet'; +export * from './parseAlgoliaHitSnippet'; +export * from './SnippetedHit'; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/index.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/index.js new file mode 100644 index 0000000000..2f9950e311 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/index.js @@ -0,0 +1,6 @@ +export * from './HighlightedHit'; +export * from './parseAlgoliaHitHighlight'; +export * from './parseAlgoliaHitReverseHighlight'; +export * from './parseAlgoliaHitReverseSnippet'; +export * from './parseAlgoliaHitSnippet'; +export * from './SnippetedHit'; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/isPartHighlighted.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/isPartHighlighted.d.ts new file mode 100644 index 0000000000..d588c3f37e --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/isPartHighlighted.d.ts @@ -0,0 +1,2 @@ +import { ParsedAttribute } from './ParsedAttribute'; +export declare function isPartHighlighted(parts: ParsedAttribute[], i: number): boolean; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/isPartHighlighted.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/isPartHighlighted.js new file mode 100644 index 0000000000..f7ece6e1ab --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/isPartHighlighted.js @@ -0,0 +1,30 @@ +var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" +}; +var hasAlphanumeric = new RegExp(/\w/i); +var regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g; +var regexHasEscapedHtml = RegExp(regexEscapedHtml.source); + +function unescape(value) { + return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) { + return htmlEscapes[character]; + }) : value; +} + +export function isPartHighlighted(parts, i) { + var _parts, _parts2; + + var current = parts[i]; + var isNextHighlighted = ((_parts = parts[i + 1]) === null || _parts === void 0 ? void 0 : _parts.isHighlighted) || true; + var isPreviousHighlighted = ((_parts2 = parts[i - 1]) === null || _parts2 === void 0 ? void 0 : _parts2.isHighlighted) || true; + + if (!hasAlphanumeric.test(unescape(current.value)) && isPreviousHighlighted === isNextHighlighted) { + return isPreviousHighlighted; + } + + return current.isHighlighted; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitHighlight.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitHighlight.d.ts new file mode 100644 index 0000000000..d045d31642 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitHighlight.d.ts @@ -0,0 +1,4 @@ +import { HighlightedHit } from './HighlightedHit'; +import { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams'; +import { ParsedAttribute } from './ParsedAttribute'; +export declare function parseAlgoliaHitHighlight>({ hit, attribute, }: ParseAlgoliaHitParams): ParsedAttribute[]; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitHighlight.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitHighlight.js new file mode 100644 index 0000000000..202bd63dca --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitHighlight.js @@ -0,0 +1,29 @@ +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +import { getAttributeValueByPath, warn } from '@algolia/autocomplete-shared'; +import { parseAttribute } from './parseAttribute'; +export function parseAlgoliaHitHighlight(_ref) { + var hit = _ref.hit, + attribute = _ref.attribute; + var path = Array.isArray(attribute) ? attribute : [attribute]; + var highlightedValue = getAttributeValueByPath(hit, ['_highlightResult'].concat(_toConsumableArray(path), ['value'])); + + if (typeof highlightedValue !== 'string') { + process.env.NODE_ENV !== 'production' ? warn(false, "The attribute \"".concat(path.join('.'), "\" described by the path ").concat(JSON.stringify(path), " does not exist on the hit. Did you set it in `attributesToHighlight`?") + '\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/') : void 0; + highlightedValue = getAttributeValueByPath(hit, path) || ''; + } + + return parseAttribute({ + highlightedValue: highlightedValue + }); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseHighlight.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseHighlight.d.ts new file mode 100644 index 0000000000..d18eb18ae9 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseHighlight.d.ts @@ -0,0 +1,4 @@ +import { HighlightedHit } from './HighlightedHit'; +import { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams'; +import { ParsedAttribute } from './ParsedAttribute'; +export declare function parseAlgoliaHitReverseHighlight>(props: ParseAlgoliaHitParams): ParsedAttribute[]; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseHighlight.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseHighlight.js new file mode 100644 index 0000000000..ab35f172ba --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseHighlight.js @@ -0,0 +1,5 @@ +import { parseAlgoliaHitHighlight } from './parseAlgoliaHitHighlight'; +import { reverseHighlightedParts } from './reverseHighlightedParts'; +export function parseAlgoliaHitReverseHighlight(props) { + return reverseHighlightedParts(parseAlgoliaHitHighlight(props)); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseSnippet.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseSnippet.d.ts new file mode 100644 index 0000000000..dd17c6be02 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseSnippet.d.ts @@ -0,0 +1,4 @@ +import { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams'; +import { ParsedAttribute } from './ParsedAttribute'; +import { SnippetedHit } from './SnippetedHit'; +export declare function parseAlgoliaHitReverseSnippet>(props: ParseAlgoliaHitParams): ParsedAttribute[]; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseSnippet.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseSnippet.js new file mode 100644 index 0000000000..fbaf47767e --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseSnippet.js @@ -0,0 +1,5 @@ +import { parseAlgoliaHitSnippet } from './parseAlgoliaHitSnippet'; +import { reverseHighlightedParts } from './reverseHighlightedParts'; +export function parseAlgoliaHitReverseSnippet(props) { + return reverseHighlightedParts(parseAlgoliaHitSnippet(props)); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitSnippet.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitSnippet.d.ts new file mode 100644 index 0000000000..9ec48cd158 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitSnippet.d.ts @@ -0,0 +1,4 @@ +import { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams'; +import { ParsedAttribute } from './ParsedAttribute'; +import { SnippetedHit } from './SnippetedHit'; +export declare function parseAlgoliaHitSnippet>({ hit, attribute, }: ParseAlgoliaHitParams): ParsedAttribute[]; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitSnippet.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitSnippet.js new file mode 100644 index 0000000000..c2614218f9 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitSnippet.js @@ -0,0 +1,29 @@ +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +import { getAttributeValueByPath, warn } from '@algolia/autocomplete-shared'; +import { parseAttribute } from './parseAttribute'; +export function parseAlgoliaHitSnippet(_ref) { + var hit = _ref.hit, + attribute = _ref.attribute; + var path = Array.isArray(attribute) ? attribute : [attribute]; + var highlightedValue = getAttributeValueByPath(hit, ['_snippetResult'].concat(_toConsumableArray(path), ['value'])); + + if (typeof highlightedValue !== 'string') { + process.env.NODE_ENV !== 'production' ? warn(false, "The attribute \"".concat(path.join('.'), "\" described by the path ").concat(JSON.stringify(path), " does not exist on the hit. Did you set it in `attributesToSnippet`?") + '\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/') : void 0; + highlightedValue = getAttributeValueByPath(hit, path) || ''; + } + + return parseAttribute({ + highlightedValue: highlightedValue + }); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAttribute.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAttribute.d.ts new file mode 100644 index 0000000000..da17b62428 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAttribute.d.ts @@ -0,0 +1,6 @@ +import { ParsedAttribute } from './ParsedAttribute'; +declare type ParseAttributeParams = { + highlightedValue: string; +}; +export declare function parseAttribute({ highlightedValue, }: ParseAttributeParams): ParsedAttribute[]; +export {}; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAttribute.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAttribute.js new file mode 100644 index 0000000000..7386b9e133 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAttribute.js @@ -0,0 +1,52 @@ +import { HIGHLIGHT_PRE_TAG, HIGHLIGHT_POST_TAG } from '../constants'; + +/** + * Creates a data structure that allows to concatenate similar highlighting + * parts in a single value. + */ +function createAttributeSet() { + var initialValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var value = initialValue; + return { + get: function get() { + return value; + }, + add: function add(part) { + var lastPart = value[value.length - 1]; + + if ((lastPart === null || lastPart === void 0 ? void 0 : lastPart.isHighlighted) === part.isHighlighted) { + value[value.length - 1] = { + value: lastPart.value + part.value, + isHighlighted: lastPart.isHighlighted + }; + } else { + value.push(part); + } + } + }; +} + +export function parseAttribute(_ref) { + var highlightedValue = _ref.highlightedValue; + var preTagParts = highlightedValue.split(HIGHLIGHT_PRE_TAG); + var firstValue = preTagParts.shift(); + var parts = createAttributeSet(firstValue ? [{ + value: firstValue, + isHighlighted: false + }] : []); + preTagParts.forEach(function (part) { + var postTagParts = part.split(HIGHLIGHT_POST_TAG); + parts.add({ + value: postTagParts[0], + isHighlighted: true + }); + + if (postTagParts[1] !== '') { + parts.add({ + value: postTagParts[1], + isHighlighted: false + }); + } + }); + return parts.get(); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/reverseHighlightedParts.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/reverseHighlightedParts.d.ts new file mode 100644 index 0000000000..2c979a92ab --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/reverseHighlightedParts.d.ts @@ -0,0 +1,5 @@ +import { ParsedAttribute } from './ParsedAttribute'; +export declare function reverseHighlightedParts(parts: ParsedAttribute[]): { + isHighlighted: boolean; + value: string; +}[]; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/reverseHighlightedParts.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/reverseHighlightedParts.js new file mode 100644 index 0000000000..e7fa2079c7 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/reverseHighlightedParts.js @@ -0,0 +1,25 @@ +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import { isPartHighlighted } from './isPartHighlighted'; +export function reverseHighlightedParts(parts) { + // We don't want to highlight the whole word when no parts match. + if (!parts.some(function (part) { + return part.isHighlighted; + })) { + return parts.map(function (part) { + return _objectSpread(_objectSpread({}, part), {}, { + isHighlighted: false + }); + }); + } + + return parts.map(function (part, i) { + return _objectSpread(_objectSpread({}, part), {}, { + isHighlighted: !isPartHighlighted(parts, i) + }); + }); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/index.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/index.d.ts new file mode 100644 index 0000000000..bac6a84dac --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/index.d.ts @@ -0,0 +1,3 @@ +export * from './highlight'; +export * from './requester'; +export * from './search'; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/index.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/index.js new file mode 100644 index 0000000000..8ea7dc2c64 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/index.js @@ -0,0 +1,3 @@ +export * from './highlight'; +export * from './requester'; +export * from './search'; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createAlgoliaRequester.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createAlgoliaRequester.d.ts new file mode 100644 index 0000000000..5f94b5958e --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createAlgoliaRequester.d.ts @@ -0,0 +1 @@ +export declare const createAlgoliaRequester: (requesterParams: import("./createRequester").RequesterParams) => (requestParams: import("./createRequester").RequestParams) => import("./createRequester").RequesterDescription; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createAlgoliaRequester.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createAlgoliaRequester.js new file mode 100644 index 0000000000..27d18c6af4 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createAlgoliaRequester.js @@ -0,0 +1,3 @@ +import { fetchAlgoliaResults } from '../search'; +import { createRequester } from './createRequester'; +export var createAlgoliaRequester = createRequester(fetchAlgoliaResults); \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createRequester.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createRequester.d.ts new file mode 100644 index 0000000000..37ff594937 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createRequester.d.ts @@ -0,0 +1,55 @@ +import { MultipleQueriesQuery, SearchForFacetValuesResponse, SearchResponse } from '@algolia/client-search'; +import { SearchClient } from 'algoliasearch/lite'; +import { fetchAlgoliaResults } from '../search'; +declare type Fetcher = typeof fetchAlgoliaResults; +declare type FacetHit = { + label: string; + count: number; + _highlightResult: { + label: { + value: string; + }; + }; +}; +export declare type FetcherParams = Pick[0], 'searchClient' | 'queries'>; +export declare type RequesterParams = { + transformResponse(response: TransformResponseParams): TransformedRequesterResponse; +}; +declare type TransformResponseParams = { + results: Array | SearchForFacetValuesResponse>; + hits: Array['hits']>; + facetHits: FacetHit[][]; +}; +export declare type TransformedRequesterResponse = Array['hits']> | SearchResponse['hits'] | FacetHit[][] | FacetHit[]; +export declare type TransformResponse = (response: TransformResponseParams) => TransformedRequesterResponse; +declare type FetcherParamsQuery = { + query: MultipleQueriesQuery; + sourceId: string; + transformResponse: TransformResponse; +}; +declare type ExecuteParams = { + searchClient: SearchClient; + requests: Array>; +}; +export declare type Execute = (params: ExecuteParams) => Promise>; +export declare type ExecuteResponse = Array<{ + items: SearchResponse | SearchForFacetValuesResponse; + sourceId: string; + transformResponse: TransformResponse; +}>; +export declare type RequestParams = FetcherParams & { + /** + * The function to transform the Algolia response before passing it to the Autocomplete state. You have access to the full Algolia results, as well as the pre-computed hits and facet hits. + * + * This is useful to manipulate the hits, or store data from the results in the [context](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/context/). + */ + transformResponse?: TransformResponse; +}; +export declare type RequesterDescription = { + searchClient: SearchClient; + queries: MultipleQueriesQuery[]; + transformResponse: TransformResponse; + execute: Execute; +}; +export declare function createRequester(fetcher: Fetcher): (requesterParams: RequesterParams) => (requestParams: RequestParams) => RequesterDescription; +export {}; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createRequester.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createRequester.js new file mode 100644 index 0000000000..5b91cad48c --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createRequester.js @@ -0,0 +1,35 @@ +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +export function createRequester(fetcher) { + function execute(fetcherParams) { + return fetcher({ + searchClient: fetcherParams.searchClient, + queries: fetcherParams.requests.map(function (x) { + return x.query; + }) + }).then(function (responses) { + return responses.map(function (response, index) { + var _fetcherParams$reques = fetcherParams.requests[index], + sourceId = _fetcherParams$reques.sourceId, + transformResponse = _fetcherParams$reques.transformResponse; + return { + items: response, + sourceId: sourceId, + transformResponse: transformResponse + }; + }); + }); + } + + return function createSpecifiedRequester(requesterParams) { + return function requester(requestParams) { + return _objectSpread(_objectSpread({ + execute: execute + }, requesterParams), requestParams); + }; + }; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaFacets.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaFacets.d.ts new file mode 100644 index 0000000000..a8c907e843 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaFacets.d.ts @@ -0,0 +1,5 @@ +import { RequestParams } from './createRequester'; +/** + * Retrieves Algolia facet hits from multiple indices. + */ +export declare function getAlgoliaFacets(requestParams: RequestParams): import("./createRequester").RequesterDescription; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaFacets.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaFacets.js new file mode 100644 index 0000000000..ef9defaa30 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaFacets.js @@ -0,0 +1,26 @@ +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +import { createAlgoliaRequester } from './createAlgoliaRequester'; + +/** + * Retrieves Algolia facet hits from multiple indices. + */ +export function getAlgoliaFacets(requestParams) { + var requester = createAlgoliaRequester({ + transformResponse: function transformResponse(response) { + return response.facetHits; + } + }); + var queries = requestParams.queries.map(function (query) { + return _objectSpread(_objectSpread({}, query), {}, { + type: 'facet' + }); + }); + return requester(_objectSpread(_objectSpread({}, requestParams), {}, { + queries: queries + })); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.d.ts new file mode 100644 index 0000000000..d83516cdb6 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.d.ts @@ -0,0 +1,4 @@ +/** + * Retrieves Algolia results from multiple indices. + */ +export declare const getAlgoliaResults: (requestParams: import("./createRequester").RequestParams) => import("./createRequester").RequesterDescription; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.js new file mode 100644 index 0000000000..c4c12ddc4c --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.js @@ -0,0 +1,10 @@ +import { createAlgoliaRequester } from './createAlgoliaRequester'; +/** + * Retrieves Algolia results from multiple indices. + */ + +export var getAlgoliaResults = createAlgoliaRequester({ + transformResponse: function transformResponse(response) { + return response.hits; + } +}); \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/index.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/index.d.ts new file mode 100644 index 0000000000..b6123a4f73 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/index.d.ts @@ -0,0 +1,3 @@ +export * from './createRequester'; +export * from './getAlgoliaFacets'; +export * from './getAlgoliaResults'; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/index.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/index.js new file mode 100644 index 0000000000..a2c16b9819 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/index.js @@ -0,0 +1,3 @@ +export * from './createRequester'; +export * from './getAlgoliaFacets'; +export * from './getAlgoliaResults'; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/fetchAlgoliaResults.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/fetchAlgoliaResults.d.ts new file mode 100644 index 0000000000..f059b2875e --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/fetchAlgoliaResults.d.ts @@ -0,0 +1,20 @@ +import { UserAgent } from '@algolia/autocomplete-shared'; +import { MultipleQueriesQuery, SearchForFacetValuesResponse, SearchResponse } from '@algolia/client-search'; +import type { SearchClient } from 'algoliasearch/lite'; +export interface SearchParams { + /** + * The initialized Algolia search client. + */ + searchClient: SearchClient; + /** + * A list of queries to execute. + */ + queries: MultipleQueriesQuery[]; + /** + * A list of user agents to add to the search client. + * + * This is useful to track usage of an integration. + */ + userAgents?: UserAgent[]; +} +export declare function fetchAlgoliaResults({ searchClient, queries, userAgents, }: SearchParams): Promise | SearchForFacetValuesResponse>>; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/fetchAlgoliaResults.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/fetchAlgoliaResults.js new file mode 100644 index 0000000000..4687f97759 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/fetchAlgoliaResults.js @@ -0,0 +1,56 @@ +var _excluded = ["params"]; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +import { userAgents as coreUserAgents } from '@algolia/autocomplete-shared'; +import { HIGHLIGHT_PRE_TAG, HIGHLIGHT_POST_TAG } from '../constants'; +export function fetchAlgoliaResults(_ref) { + var searchClient = _ref.searchClient, + queries = _ref.queries, + _ref$userAgents = _ref.userAgents, + userAgents = _ref$userAgents === void 0 ? [] : _ref$userAgents; + + if (typeof searchClient.addAlgoliaAgent === 'function') { + var algoliaAgents = [].concat(_toConsumableArray(coreUserAgents), _toConsumableArray(userAgents)); + algoliaAgents.forEach(function (_ref2) { + var segment = _ref2.segment, + version = _ref2.version; + searchClient.addAlgoliaAgent(segment, version); + }); + } + + return searchClient.search(queries.map(function (searchParameters) { + var params = searchParameters.params, + headers = _objectWithoutProperties(searchParameters, _excluded); + + return _objectSpread(_objectSpread({}, headers), {}, { + params: _objectSpread({ + hitsPerPage: 5, + highlightPreTag: HIGHLIGHT_PRE_TAG, + highlightPostTag: HIGHLIGHT_POST_TAG + }, params) + }); + })).then(function (response) { + return response.results; + }); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/index.d.ts b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/index.d.ts new file mode 100644 index 0000000000..f8277f2bd5 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/index.d.ts @@ -0,0 +1 @@ +export * from './fetchAlgoliaResults'; diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/index.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/index.js new file mode 100644 index 0000000000..4fc44bf4be --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/index.js @@ -0,0 +1 @@ +export * from './fetchAlgoliaResults'; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.development.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.development.js new file mode 100644 index 0000000000..87b1563dc1 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.development.js @@ -0,0 +1,416 @@ +/*! @algolia/autocomplete-preset-algolia 1.5.2 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@algolia/autocomplete-preset-algolia"] = {})); +})(this, (function (exports) { 'use strict'; + + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + + if (enumerableOnly) { + symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + } + + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + + return target; + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + } + + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; + } + + function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; + + var target = _objectWithoutPropertiesLoose(source, excluded); + + var key, i; + + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; + target[key] = source[key]; + } + } + + return target; + } + + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); + } + + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; + } + + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function getAttributeValueByPath(record, path) { + return path.reduce(function (current, key) { + return current && current[key]; + }, record); + } + + var version = '1.5.2'; + + var userAgents = [{ + segment: 'autocomplete-core', + version: version + }]; + + var warnCache = { + current: {} + }; + /** + * Logs a warning if the condition is not met. + * This is used to log issues in development environment only. + */ + + function warn(condition, message) { + + if (condition) { + return; + } + + var sanitizedMessage = message.trim(); + var hasAlreadyPrinted = warnCache.current[sanitizedMessage]; + + if (!hasAlreadyPrinted) { + warnCache.current[sanitizedMessage] = true; // eslint-disable-next-line no-console + + console.warn("[Autocomplete] ".concat(sanitizedMessage)); + } + } + + var HIGHLIGHT_PRE_TAG = '__aa-highlight__'; + var HIGHLIGHT_POST_TAG = '__/aa-highlight__'; + + /** + * Creates a data structure that allows to concatenate similar highlighting + * parts in a single value. + */ + function createAttributeSet() { + var initialValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var value = initialValue; + return { + get: function get() { + return value; + }, + add: function add(part) { + var lastPart = value[value.length - 1]; + + if ((lastPart === null || lastPart === void 0 ? void 0 : lastPart.isHighlighted) === part.isHighlighted) { + value[value.length - 1] = { + value: lastPart.value + part.value, + isHighlighted: lastPart.isHighlighted + }; + } else { + value.push(part); + } + } + }; + } + + function parseAttribute(_ref) { + var highlightedValue = _ref.highlightedValue; + var preTagParts = highlightedValue.split(HIGHLIGHT_PRE_TAG); + var firstValue = preTagParts.shift(); + var parts = createAttributeSet(firstValue ? [{ + value: firstValue, + isHighlighted: false + }] : []); + preTagParts.forEach(function (part) { + var postTagParts = part.split(HIGHLIGHT_POST_TAG); + parts.add({ + value: postTagParts[0], + isHighlighted: true + }); + + if (postTagParts[1] !== '') { + parts.add({ + value: postTagParts[1], + isHighlighted: false + }); + } + }); + return parts.get(); + } + + function parseAlgoliaHitHighlight(_ref) { + var hit = _ref.hit, + attribute = _ref.attribute; + var path = Array.isArray(attribute) ? attribute : [attribute]; + var highlightedValue = getAttributeValueByPath(hit, ['_highlightResult'].concat(_toConsumableArray(path), ['value'])); + + if (typeof highlightedValue !== 'string') { + "development" !== 'production' ? warn(false, "The attribute \"".concat(path.join('.'), "\" described by the path ").concat(JSON.stringify(path), " does not exist on the hit. Did you set it in `attributesToHighlight`?") + '\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/') : void 0; + highlightedValue = getAttributeValueByPath(hit, path) || ''; + } + + return parseAttribute({ + highlightedValue: highlightedValue + }); + } + + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + var hasAlphanumeric = new RegExp(/\w/i); + var regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g; + var regexHasEscapedHtml = RegExp(regexEscapedHtml.source); + + function unescape(value) { + return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) { + return htmlEscapes[character]; + }) : value; + } + + function isPartHighlighted(parts, i) { + var _parts, _parts2; + + var current = parts[i]; + var isNextHighlighted = ((_parts = parts[i + 1]) === null || _parts === void 0 ? void 0 : _parts.isHighlighted) || true; + var isPreviousHighlighted = ((_parts2 = parts[i - 1]) === null || _parts2 === void 0 ? void 0 : _parts2.isHighlighted) || true; + + if (!hasAlphanumeric.test(unescape(current.value)) && isPreviousHighlighted === isNextHighlighted) { + return isPreviousHighlighted; + } + + return current.isHighlighted; + } + + function reverseHighlightedParts(parts) { + // We don't want to highlight the whole word when no parts match. + if (!parts.some(function (part) { + return part.isHighlighted; + })) { + return parts.map(function (part) { + return _objectSpread2(_objectSpread2({}, part), {}, { + isHighlighted: false + }); + }); + } + + return parts.map(function (part, i) { + return _objectSpread2(_objectSpread2({}, part), {}, { + isHighlighted: !isPartHighlighted(parts, i) + }); + }); + } + + function parseAlgoliaHitReverseHighlight(props) { + return reverseHighlightedParts(parseAlgoliaHitHighlight(props)); + } + + function parseAlgoliaHitSnippet(_ref) { + var hit = _ref.hit, + attribute = _ref.attribute; + var path = Array.isArray(attribute) ? attribute : [attribute]; + var highlightedValue = getAttributeValueByPath(hit, ['_snippetResult'].concat(_toConsumableArray(path), ['value'])); + + if (typeof highlightedValue !== 'string') { + "development" !== 'production' ? warn(false, "The attribute \"".concat(path.join('.'), "\" described by the path ").concat(JSON.stringify(path), " does not exist on the hit. Did you set it in `attributesToSnippet`?") + '\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/') : void 0; + highlightedValue = getAttributeValueByPath(hit, path) || ''; + } + + return parseAttribute({ + highlightedValue: highlightedValue + }); + } + + function parseAlgoliaHitReverseSnippet(props) { + return reverseHighlightedParts(parseAlgoliaHitSnippet(props)); + } + + function createRequester(fetcher) { + function execute(fetcherParams) { + return fetcher({ + searchClient: fetcherParams.searchClient, + queries: fetcherParams.requests.map(function (x) { + return x.query; + }) + }).then(function (responses) { + return responses.map(function (response, index) { + var _fetcherParams$reques = fetcherParams.requests[index], + sourceId = _fetcherParams$reques.sourceId, + transformResponse = _fetcherParams$reques.transformResponse; + return { + items: response, + sourceId: sourceId, + transformResponse: transformResponse + }; + }); + }); + } + + return function createSpecifiedRequester(requesterParams) { + return function requester(requestParams) { + return _objectSpread2(_objectSpread2({ + execute: execute + }, requesterParams), requestParams); + }; + }; + } + + var _excluded = ["params"]; + function fetchAlgoliaResults(_ref) { + var searchClient = _ref.searchClient, + queries = _ref.queries, + _ref$userAgents = _ref.userAgents, + userAgents$1 = _ref$userAgents === void 0 ? [] : _ref$userAgents; + + if (typeof searchClient.addAlgoliaAgent === 'function') { + var algoliaAgents = [].concat(_toConsumableArray(userAgents), _toConsumableArray(userAgents$1)); + algoliaAgents.forEach(function (_ref2) { + var segment = _ref2.segment, + version = _ref2.version; + searchClient.addAlgoliaAgent(segment, version); + }); + } + + return searchClient.search(queries.map(function (searchParameters) { + var params = searchParameters.params, + headers = _objectWithoutProperties(searchParameters, _excluded); + + return _objectSpread2(_objectSpread2({}, headers), {}, { + params: _objectSpread2({ + hitsPerPage: 5, + highlightPreTag: HIGHLIGHT_PRE_TAG, + highlightPostTag: HIGHLIGHT_POST_TAG + }, params) + }); + })).then(function (response) { + return response.results; + }); + } + + var createAlgoliaRequester = createRequester(fetchAlgoliaResults); + + /** + * Retrieves Algolia facet hits from multiple indices. + */ + function getAlgoliaFacets(requestParams) { + var requester = createAlgoliaRequester({ + transformResponse: function transformResponse(response) { + return response.facetHits; + } + }); + var queries = requestParams.queries.map(function (query) { + return _objectSpread2(_objectSpread2({}, query), {}, { + type: 'facet' + }); + }); + return requester(_objectSpread2(_objectSpread2({}, requestParams), {}, { + queries: queries + })); + } + + /** + * Retrieves Algolia results from multiple indices. + */ + + var getAlgoliaResults = createAlgoliaRequester({ + transformResponse: function transformResponse(response) { + return response.hits; + } + }); + + exports.createRequester = createRequester; + exports.fetchAlgoliaResults = fetchAlgoliaResults; + exports.getAlgoliaFacets = getAlgoliaFacets; + exports.getAlgoliaResults = getAlgoliaResults; + exports.parseAlgoliaHitHighlight = parseAlgoliaHitHighlight; + exports.parseAlgoliaHitReverseHighlight = parseAlgoliaHitReverseHighlight; + exports.parseAlgoliaHitReverseSnippet = parseAlgoliaHitReverseSnippet; + exports.parseAlgoliaHitSnippet = parseAlgoliaHitSnippet; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=index.development.js.map diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.development.js.map b/node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.development.js.map new file mode 100644 index 0000000000..1bf63fceca --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.development.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.development.js","sources":["../../../autocomplete-shared/dist/esm/getAttributeValueByPath.js","../../../autocomplete-shared/dist/esm/version.js","../../../autocomplete-shared/dist/esm/userAgents.js","../../../autocomplete-shared/dist/esm/warn.js","../../src/constants/index.ts","../../src/highlight/parseAttribute.ts","../../src/highlight/parseAlgoliaHitHighlight.ts","../../src/highlight/isPartHighlighted.ts","../../src/highlight/reverseHighlightedParts.ts","../../src/highlight/parseAlgoliaHitReverseHighlight.ts","../../src/highlight/parseAlgoliaHitSnippet.ts","../../src/highlight/parseAlgoliaHitReverseSnippet.ts","../../src/requester/createRequester.ts","../../src/search/fetchAlgoliaResults.ts","../../src/requester/createAlgoliaRequester.ts","../../src/requester/getAlgoliaFacets.ts","../../src/requester/getAlgoliaResults.ts"],"sourcesContent":["export function getAttributeValueByPath(record, path) {\n return path.reduce(function (current, key) {\n return current && current[key];\n }, record);\n}","export var version = '1.5.2';","import { version } from './version';\nexport var userAgents = [{\n segment: 'autocomplete-core',\n version: version\n}];","export var warnCache = {\n current: {}\n};\n/**\n * Logs a warning if the condition is not met.\n * This is used to log issues in development environment only.\n */\n\nexport function warn(condition, message) {\n if (!(process.env.NODE_ENV !== 'production')) {\n return;\n }\n\n if (condition) {\n return;\n }\n\n var sanitizedMessage = message.trim();\n var hasAlreadyPrinted = warnCache.current[sanitizedMessage];\n\n if (!hasAlreadyPrinted) {\n warnCache.current[sanitizedMessage] = true; // eslint-disable-next-line no-console\n\n console.warn(\"[Autocomplete] \".concat(sanitizedMessage));\n }\n}","export const HIGHLIGHT_PRE_TAG = '__aa-highlight__';\nexport const HIGHLIGHT_POST_TAG = '__/aa-highlight__';\n","import { HIGHLIGHT_PRE_TAG, HIGHLIGHT_POST_TAG } from '../constants';\n\nimport { ParsedAttribute } from './ParsedAttribute';\n\n/**\n * Creates a data structure that allows to concatenate similar highlighting\n * parts in a single value.\n */\nfunction createAttributeSet(initialValue: ParsedAttribute[] = []) {\n const value = initialValue;\n\n return {\n get() {\n return value;\n },\n add(part: ParsedAttribute) {\n const lastPart: ParsedAttribute | undefined = value[value.length - 1];\n\n if (lastPart?.isHighlighted === part.isHighlighted) {\n value[value.length - 1] = {\n value: lastPart.value + part.value,\n isHighlighted: lastPart.isHighlighted,\n };\n } else {\n value.push(part);\n }\n },\n };\n}\n\ntype ParseAttributeParams = {\n highlightedValue: string;\n};\n\nexport function parseAttribute({\n highlightedValue,\n}: ParseAttributeParams): ParsedAttribute[] {\n const preTagParts = highlightedValue.split(HIGHLIGHT_PRE_TAG);\n const firstValue = preTagParts.shift();\n const parts = createAttributeSet(\n firstValue ? [{ value: firstValue, isHighlighted: false }] : []\n );\n\n preTagParts.forEach((part) => {\n const postTagParts = part.split(HIGHLIGHT_POST_TAG);\n\n parts.add({\n value: postTagParts[0],\n isHighlighted: true,\n });\n\n if (postTagParts[1] !== '') {\n parts.add({\n value: postTagParts[1],\n isHighlighted: false,\n });\n }\n });\n\n return parts.get();\n}\n","import { getAttributeValueByPath, warn } from '@algolia/autocomplete-shared';\n\nimport { HighlightedHit } from './HighlightedHit';\nimport { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams';\nimport { parseAttribute } from './parseAttribute';\nimport { ParsedAttribute } from './ParsedAttribute';\n\nexport function parseAlgoliaHitHighlight>({\n hit,\n attribute,\n}: ParseAlgoliaHitParams): ParsedAttribute[] {\n const path = Array.isArray(attribute) ? attribute : ([attribute] as string[]);\n let highlightedValue = getAttributeValueByPath(hit, [\n '_highlightResult',\n ...path,\n 'value',\n ]);\n\n if (typeof highlightedValue !== 'string') {\n warn(\n false,\n `The attribute \"${path.join('.')}\" described by the path ${JSON.stringify(\n path\n )} does not exist on the hit. Did you set it in \\`attributesToHighlight\\`?` +\n '\\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/'\n );\n\n highlightedValue = getAttributeValueByPath(hit, path) || '';\n }\n\n return parseAttribute({ highlightedValue });\n}\n","import { ParsedAttribute } from './ParsedAttribute';\n\nconst htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\",\n};\nconst hasAlphanumeric = new RegExp(/\\w/i);\nconst regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g;\nconst regexHasEscapedHtml = RegExp(regexEscapedHtml.source);\n\nfunction unescape(value: string): string {\n return value && regexHasEscapedHtml.test(value)\n ? value.replace(regexEscapedHtml, (character) => htmlEscapes[character])\n : value;\n}\n\nexport function isPartHighlighted(parts: ParsedAttribute[], i: number) {\n const current = parts[i];\n const isNextHighlighted = parts[i + 1]?.isHighlighted || true;\n const isPreviousHighlighted = parts[i - 1]?.isHighlighted || true;\n\n if (\n !hasAlphanumeric.test(unescape(current.value)) &&\n isPreviousHighlighted === isNextHighlighted\n ) {\n return isPreviousHighlighted;\n }\n\n return current.isHighlighted;\n}\n","import { isPartHighlighted } from './isPartHighlighted';\nimport { ParsedAttribute } from './ParsedAttribute';\n\nexport function reverseHighlightedParts(parts: ParsedAttribute[]) {\n // We don't want to highlight the whole word when no parts match.\n if (!parts.some((part) => part.isHighlighted)) {\n return parts.map((part) => ({ ...part, isHighlighted: false }));\n }\n\n return parts.map((part, i) => ({\n ...part,\n isHighlighted: !isPartHighlighted(parts, i),\n }));\n}\n","import { HighlightedHit } from './HighlightedHit';\nimport { parseAlgoliaHitHighlight } from './parseAlgoliaHitHighlight';\nimport { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams';\nimport { ParsedAttribute } from './ParsedAttribute';\nimport { reverseHighlightedParts } from './reverseHighlightedParts';\n\nexport function parseAlgoliaHitReverseHighlight<\n THit extends HighlightedHit\n>(props: ParseAlgoliaHitParams): ParsedAttribute[] {\n return reverseHighlightedParts(parseAlgoliaHitHighlight(props));\n}\n","import { getAttributeValueByPath, warn } from '@algolia/autocomplete-shared';\n\nimport { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams';\nimport { parseAttribute } from './parseAttribute';\nimport { ParsedAttribute } from './ParsedAttribute';\nimport { SnippetedHit } from './SnippetedHit';\n\nexport function parseAlgoliaHitSnippet>({\n hit,\n attribute,\n}: ParseAlgoliaHitParams): ParsedAttribute[] {\n const path = Array.isArray(attribute) ? attribute : ([attribute] as string[]);\n let highlightedValue = getAttributeValueByPath(hit, [\n '_snippetResult',\n ...path,\n 'value',\n ]);\n\n if (typeof highlightedValue !== 'string') {\n warn(\n false,\n `The attribute \"${path.join('.')}\" described by the path ${JSON.stringify(\n path\n )} does not exist on the hit. Did you set it in \\`attributesToSnippet\\`?` +\n '\\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/'\n );\n\n highlightedValue = getAttributeValueByPath(hit, path) || '';\n }\n\n return parseAttribute({ highlightedValue });\n}\n","import { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams';\nimport { parseAlgoliaHitSnippet } from './parseAlgoliaHitSnippet';\nimport { ParsedAttribute } from './ParsedAttribute';\nimport { reverseHighlightedParts } from './reverseHighlightedParts';\nimport { SnippetedHit } from './SnippetedHit';\n\nexport function parseAlgoliaHitReverseSnippet<\n THit extends SnippetedHit\n>(props: ParseAlgoliaHitParams): ParsedAttribute[] {\n return reverseHighlightedParts(parseAlgoliaHitSnippet(props));\n}\n","import {\n MultipleQueriesQuery,\n SearchForFacetValuesResponse,\n SearchResponse,\n} from '@algolia/client-search';\nimport { SearchClient } from 'algoliasearch/lite';\n\nimport { fetchAlgoliaResults } from '../search';\n\ntype Fetcher = typeof fetchAlgoliaResults;\n\ntype FacetHit = {\n label: string;\n count: number;\n _highlightResult: {\n label: {\n value: string;\n };\n };\n};\n\nexport type FetcherParams = Pick<\n Parameters[0],\n 'searchClient' | 'queries'\n>;\n\nexport type RequesterParams = {\n transformResponse(\n response: TransformResponseParams\n ): TransformedRequesterResponse;\n};\n\ntype TransformResponseParams = {\n results: Array | SearchForFacetValuesResponse>;\n hits: Array['hits']>;\n facetHits: FacetHit[][];\n};\n\nexport type TransformedRequesterResponse =\n | Array['hits']>\n | SearchResponse['hits']\n | FacetHit[][]\n | FacetHit[];\n\nexport type TransformResponse = (\n response: TransformResponseParams\n) => TransformedRequesterResponse;\n\ntype FetcherParamsQuery = {\n query: MultipleQueriesQuery;\n sourceId: string;\n transformResponse: TransformResponse;\n};\n\ntype ExecuteParams = {\n searchClient: SearchClient;\n requests: Array>;\n};\n\nexport type Execute = (\n params: ExecuteParams\n) => Promise>;\n\nexport type ExecuteResponse = Array<{\n items: SearchResponse | SearchForFacetValuesResponse;\n sourceId: string;\n transformResponse: TransformResponse;\n}>;\n\nexport type RequestParams = FetcherParams & {\n /**\n * The function to transform the Algolia response before passing it to the Autocomplete state. You have access to the full Algolia results, as well as the pre-computed hits and facet hits.\n *\n * This is useful to manipulate the hits, or store data from the results in the [context](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/context/).\n */\n transformResponse?: TransformResponse;\n};\n\nexport type RequesterDescription = {\n searchClient: SearchClient;\n queries: MultipleQueriesQuery[];\n transformResponse: TransformResponse;\n execute: Execute;\n};\n\nexport function createRequester(fetcher: Fetcher) {\n function execute(fetcherParams: ExecuteParams) {\n return fetcher({\n searchClient: fetcherParams.searchClient,\n queries: fetcherParams.requests.map((x) => x.query),\n }).then((responses) =>\n responses.map((response, index) => {\n const { sourceId, transformResponse } = fetcherParams.requests[index];\n\n return {\n items: response,\n sourceId,\n transformResponse,\n };\n })\n );\n }\n\n return function createSpecifiedRequester(\n requesterParams: RequesterParams\n ) {\n return function requester(\n requestParams: RequestParams\n ): RequesterDescription {\n return {\n execute,\n ...requesterParams,\n ...requestParams,\n };\n };\n };\n}\n","import {\n userAgents as coreUserAgents,\n UserAgent,\n} from '@algolia/autocomplete-shared';\nimport {\n MultipleQueriesQuery,\n SearchForFacetValuesResponse,\n SearchResponse,\n} from '@algolia/client-search';\nimport type { SearchClient } from 'algoliasearch/lite';\n\nimport { HIGHLIGHT_PRE_TAG, HIGHLIGHT_POST_TAG } from '../constants';\n\nexport interface SearchParams {\n /**\n * The initialized Algolia search client.\n */\n searchClient: SearchClient;\n /**\n * A list of queries to execute.\n */\n queries: MultipleQueriesQuery[];\n /**\n * A list of user agents to add to the search client.\n *\n * This is useful to track usage of an integration.\n */\n userAgents?: UserAgent[];\n}\n\nexport function fetchAlgoliaResults({\n searchClient,\n queries,\n userAgents = [],\n}: SearchParams): Promise<\n Array | SearchForFacetValuesResponse>\n> {\n if (typeof searchClient.addAlgoliaAgent === 'function') {\n const algoliaAgents: UserAgent[] = [...coreUserAgents, ...userAgents];\n\n algoliaAgents.forEach(({ segment, version }) => {\n searchClient.addAlgoliaAgent(segment, version);\n });\n }\n\n return searchClient\n .search(\n queries.map((searchParameters) => {\n const { params, ...headers } = searchParameters;\n\n return {\n ...headers,\n params: {\n hitsPerPage: 5,\n highlightPreTag: HIGHLIGHT_PRE_TAG,\n highlightPostTag: HIGHLIGHT_POST_TAG,\n ...params,\n },\n };\n })\n )\n .then((response) => {\n return response.results;\n });\n}\n","import { fetchAlgoliaResults } from '../search';\n\nimport { createRequester } from './createRequester';\n\nexport const createAlgoliaRequester = createRequester(fetchAlgoliaResults);\n","import { MultipleQueriesQuery } from '@algolia/client-search';\n\nimport { createAlgoliaRequester } from './createAlgoliaRequester';\nimport { RequestParams } from './createRequester';\n\n/**\n * Retrieves Algolia facet hits from multiple indices.\n */\nexport function getAlgoliaFacets(requestParams: RequestParams) {\n const requester = createAlgoliaRequester({\n transformResponse: (response) => response.facetHits,\n });\n\n const queries = requestParams.queries.map((query) => ({\n ...query,\n type: 'facet',\n })) as MultipleQueriesQuery[];\n\n return requester({\n ...requestParams,\n queries,\n });\n}\n","import { createAlgoliaRequester } from './createAlgoliaRequester';\n\n/**\n * Retrieves Algolia results from multiple indices.\n */\nexport const getAlgoliaResults = createAlgoliaRequester({\n transformResponse: (response) => response.hits,\n});\n"],"names":["getAttributeValueByPath","record","path","reduce","current","key","version","userAgents","segment","warnCache","warn","condition","message","sanitizedMessage","trim","hasAlreadyPrinted","console","concat","HIGHLIGHT_PRE_TAG","HIGHLIGHT_POST_TAG","createAttributeSet","initialValue","value","get","add","part","lastPart","length","isHighlighted","push","parseAttribute","highlightedValue","preTagParts","split","firstValue","shift","parts","forEach","postTagParts","parseAlgoliaHitHighlight","hit","attribute","Array","isArray","process","join","JSON","stringify","htmlEscapes","hasAlphanumeric","RegExp","regexEscapedHtml","regexHasEscapedHtml","source","unescape","test","replace","character","isPartHighlighted","i","isNextHighlighted","isPreviousHighlighted","reverseHighlightedParts","some","map","parseAlgoliaHitReverseHighlight","props","parseAlgoliaHitSnippet","parseAlgoliaHitReverseSnippet","createRequester","fetcher","execute","fetcherParams","searchClient","queries","requests","x","query","then","responses","response","index","sourceId","transformResponse","items","createSpecifiedRequester","requesterParams","requester","requestParams","fetchAlgoliaResults","addAlgoliaAgent","algoliaAgents","coreUserAgents","search","searchParameters","params","headers","hitsPerPage","highlightPreTag","highlightPostTag","results","createAlgoliaRequester","getAlgoliaFacets","facetHits","type","getAlgoliaResults","hits"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAO,SAASA,uBAAT,CAAiCC,MAAjC,EAAyCC,IAAzC,EAA+C;EACpD,SAAOA,IAAI,CAACC,MAAL,CAAY,UAAUC,OAAV,EAAmBC,GAAnB,EAAwB;EACzC,WAAOD,OAAO,IAAIA,OAAO,CAACC,GAAD,CAAzB;EACD,GAFM,EAEJJ,MAFI,CAAP;EAGD;;ECJM,IAAIK,OAAO,GAAG,OAAd;;ECCA,IAAIC,UAAU,GAAG,CAAC;EACvBC,EAAAA,OAAO,EAAE,mBADc;EAEvBF,EAAAA,OAAO,EAAEA;E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AQ,CAACuB,SAAvB;EAAA;EADoB,GAAD,CAAxC;EAIA,MAAM7B,OAAO,GAAGc,aAAa,CAACd,OAAd,CAAsBV,GAAtB,CAA0B,UAACa,KAAD;EAAA,6CACrCA,KADqC;EAExC2B,MAAAA,IAAI,EAAE;EAFkC;EAAA,GAA1B,CAAhB;EAKA,SAAOjB,SAAS,mCACXC,aADW;EAEdd,IAAAA,OAAO,EAAPA;EAFc,KAAhB;EAID;;ECpBD;EACA;EACA;;MACa+B,iBAAiB,GAAGJ,sBAAsB,CAAC;EACtDlB,EAAAA,iBAAiB,EAAE,2BAACH,QAAD;EAAA,WAAcA,QAAQ,CAAC0B,IAAvB;EAAA;EADmC,CAAD;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.production.js b/node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.production.js new file mode 100644 index 0000000000..d2957195d9 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.production.js @@ -0,0 +1,3 @@ +/*! @algolia/autocomplete-preset-algolia 1.5.2 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/autocomplete-preset-algolia"]={})}(this,(function(e){"use strict";function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(e){for(var r=1;r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function o(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:[];return{get:function(){return e},add:function(t){var r=e[e.length-1];(null==r?void 0:r.isHighlighted)===t.isHighlighted?e[e.length-1]={value:r.value+t.value,isHighlighted:r.isHighlighted}:e.push(t)}}}(r?[{value:r,isHighlighted:!1}]:[]);return t.forEach((function(e){var t=e.split(c);n.add({value:t[0],isHighlighted:!0}),""!==t[1]&&n.add({value:t[1],isHighlighted:!1})})),n.get()}function g(e){var t=e.hit,r=e.attribute,n=Array.isArray(r)?r:[r],i=a(t,["_highlightResult"].concat(o(n),["value"]));return"string"!=typeof i&&(i=a(t,n)||""),f({highlightedValue:i})}var h={"&":"&","<":"<",">":">",""":'"',"'":"'"},p=new RegExp(/\w/i),d=/&(amp|quot|lt|gt|#39);/g,v=RegExp(d.source);function y(e,t){var r,n,i,o=e[t],u=(null===(r=e[t+1])||void 0===r?void 0:r.isHighlighted)||!0,a=(null===(n=e[t-1])||void 0===n?void 0:n.isHighlighted)||!0;return p.test((i=o.value)&&v.test(i)?i.replace(d,(function(e){return h[e]})):i)||a!==u?o.isHighlighted:a}function m(e){return e.some((function(e){return e.isHighlighted}))?e.map((function(t,n){return r(r({},t),{},{isHighlighted:!y(e,n)})})):e.map((function(e){return r(r({},e),{},{isHighlighted:!1})}))}function b(e){var t=e.hit,r=e.attribute,n=Array.isArray(r)?r:[r],i=a(t,["_snippetResult"].concat(o(n),["value"]));return"string"!=typeof i&&(i=a(t,n)||""),f({highlightedValue:i})}function O(e){function t(t){return e({searchClient:t.searchClient,queries:t.requests.map((function(e){return e.query}))}).then((function(e){return e.map((function(e,r){var n=t.requests[r];return{items:e,sourceId:n.sourceId,transformResponse:n.transformResponse}}))}))}return function(e){return function(n){return r(r({execute:t},e),n)}}}var A=["params"];function j(e){var t=e.searchClient,n=e.queries,u=e.userAgents,a=void 0===u?[]:u;"function"==typeof t.addAlgoliaAgent&&[].concat(o(l),o(a)).forEach((function(e){var r=e.segment,n=e.version;t.addAlgoliaAgent(r,n)}));return t.search(n.map((function(e){var t=e.params;return r(r({},i(e,A)),{},{params:r({hitsPerPage:5,highlightPreTag:s,highlightPostTag:c},t)})}))).then((function(e){return e.results}))}var H=O(j);var P=H({transformResponse:function(e){return e.hits}});e.createRequester=O,e.fetchAlgoliaResults=j,e.getAlgoliaFacets=function(e){var t=H({transformResponse:function(e){return e.facetHits}}),n=e.queries.map((function(e){return r(r({},e),{},{type:"facet"})}));return t(r(r({},e),{},{queries:n}))},e.getAlgoliaResults=P,e.parseAlgoliaHitHighlight=g,e.parseAlgoliaHitReverseHighlight=function(e){return m(g(e))},e.parseAlgoliaHitReverseSnippet=function(e){return m(b(e))},e.parseAlgoliaHitSnippet=b,Object.defineProperty(e,"__esModule",{value:!0})})); +//# sourceMappingURL=index.production.js.map diff --git a/node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.production.js.map b/node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.production.js.map new file mode 100644 index 0000000000..55edb0feb1 --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/dist/umd/index.production.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.production.js","sources":["../../../autocomplete-shared/dist/esm/getAttributeValueByPath.js","../../../autocomplete-shared/dist/esm/version.js","../../../autocomplete-shared/dist/esm/userAgents.js","../../src/constants/index.ts","../../src/highlight/parseAttribute.ts","../../src/highlight/parseAlgoliaHitHighlight.ts","../../src/highlight/isPartHighlighted.ts","../../src/highlight/reverseHighlightedParts.ts","../../src/highlight/parseAlgoliaHitSnippet.ts","../../src/requester/createRequester.ts","../../src/search/fetchAlgoliaResults.ts","../../src/requester/createAlgoliaRequester.ts","../../src/requester/getAlgoliaResults.ts","../../src/requester/getAlgoliaFacets.ts","../../src/highlight/parseAlgoliaHitReverseHighlight.ts","../../src/highlight/parseAlgoliaHitReverseSnippet.ts"],"sourcesContent":["export function getAttributeValueByPath(record, path) {\n return path.reduce(function (current, key) {\n return current && current[key];\n }, record);\n}","export var version = '1.5.2';","import { version } from './version';\nexport var userAgents = [{\n segment: 'autocomplete-core',\n version: version\n}];","export const HIGHLIGHT_PRE_TAG = '__aa-highlight__';\nexport const HIGHLIGHT_POST_TAG = '__/aa-highlight__';\n","import { HIGHLIGHT_PRE_TAG, HIGHLIGHT_POST_TAG } from '../constants';\n\nimport { ParsedAttribute } from './ParsedAttribute';\n\n/**\n * Creates a data structure that allows to concatenate similar highlighting\n * parts in a single value.\n */\nfunction createAttributeSet(initialValue: ParsedAttribute[] = []) {\n const value = initialValue;\n\n return {\n get() {\n return value;\n },\n add(part: ParsedAttribute) {\n const lastPart: ParsedAttribute | undefined = value[value.length - 1];\n\n if (lastPart?.isHighlighted === part.isHighlighted) {\n value[value.length - 1] = {\n value: lastPart.value + part.value,\n isHighlighted: lastPart.isHighlighted,\n };\n } else {\n value.push(part);\n }\n },\n };\n}\n\ntype ParseAttributeParams = {\n highlightedValue: string;\n};\n\nexport function parseAttribute({\n highlightedValue,\n}: ParseAttributeParams): ParsedAttribute[] {\n const preTagParts = highlightedValue.split(HIGHLIGHT_PRE_TAG);\n const firstValue = preTagParts.shift();\n const parts = createAttributeSet(\n firstValue ? [{ value: firstValue, isHighlighted: false }] : []\n );\n\n preTagParts.forEach((part) => {\n const postTagParts = part.split(HIGHLIGHT_POST_TAG);\n\n parts.add({\n value: postTagParts[0],\n isHighlighted: true,\n });\n\n if (postTagParts[1] !== '') {\n parts.add({\n value: postTagParts[1],\n isHighlighted: false,\n });\n }\n });\n\n return parts.get();\n}\n","import { getAttributeValueByPath, warn } from '@algolia/autocomplete-shared';\n\nimport { HighlightedHit } from './HighlightedHit';\nimport { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams';\nimport { parseAttribute } from './parseAttribute';\nimport { ParsedAttribute } from './ParsedAttribute';\n\nexport function parseAlgoliaHitHighlight>({\n hit,\n attribute,\n}: ParseAlgoliaHitParams): ParsedAttribute[] {\n const path = Array.isArray(attribute) ? attribute : ([attribute] as string[]);\n let highlightedValue = getAttributeValueByPath(hit, [\n '_highlightResult',\n ...path,\n 'value',\n ]);\n\n if (typeof highlightedValue !== 'string') {\n warn(\n false,\n `The attribute \"${path.join('.')}\" described by the path ${JSON.stringify(\n path\n )} does not exist on the hit. Did you set it in \\`attributesToHighlight\\`?` +\n '\\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/'\n );\n\n highlightedValue = getAttributeValueByPath(hit, path) || '';\n }\n\n return parseAttribute({ highlightedValue });\n}\n","import { ParsedAttribute } from './ParsedAttribute';\n\nconst htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\",\n};\nconst hasAlphanumeric = new RegExp(/\\w/i);\nconst regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g;\nconst regexHasEscapedHtml = RegExp(regexEscapedHtml.source);\n\nfunction unescape(value: string): string {\n return value && regexHasEscapedHtml.test(value)\n ? value.replace(regexEscapedHtml, (character) => htmlEscapes[character])\n : value;\n}\n\nexport function isPartHighlighted(parts: ParsedAttribute[], i: number) {\n const current = parts[i];\n const isNextHighlighted = parts[i + 1]?.isHighlighted || true;\n const isPreviousHighlighted = parts[i - 1]?.isHighlighted || true;\n\n if (\n !hasAlphanumeric.test(unescape(current.value)) &&\n isPreviousHighlighted === isNextHighlighted\n ) {\n return isPreviousHighlighted;\n }\n\n return current.isHighlighted;\n}\n","import { isPartHighlighted } from './isPartHighlighted';\nimport { ParsedAttribute } from './ParsedAttribute';\n\nexport function reverseHighlightedParts(parts: ParsedAttribute[]) {\n // We don't want to highlight the whole word when no parts match.\n if (!parts.some((part) => part.isHighlighted)) {\n return parts.map((part) => ({ ...part, isHighlighted: false }));\n }\n\n return parts.map((part, i) => ({\n ...part,\n isHighlighted: !isPartHighlighted(parts, i),\n }));\n}\n","import { getAttributeValueByPath, warn } from '@algolia/autocomplete-shared';\n\nimport { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams';\nimport { parseAttribute } from './parseAttribute';\nimport { ParsedAttribute } from './ParsedAttribute';\nimport { SnippetedHit } from './SnippetedHit';\n\nexport function parseAlgoliaHitSnippet>({\n hit,\n attribute,\n}: ParseAlgoliaHitParams): ParsedAttribute[] {\n const path = Array.isArray(attribute) ? attribute : ([attribute] as string[]);\n let highlightedValue = getAttributeValueByPath(hit, [\n '_snippetResult',\n ...path,\n 'value',\n ]);\n\n if (typeof highlightedValue !== 'string') {\n warn(\n false,\n `The attribute \"${path.join('.')}\" described by the path ${JSON.stringify(\n path\n )} does not exist on the hit. Did you set it in \\`attributesToSnippet\\`?` +\n '\\nSee https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/'\n );\n\n highlightedValue = getAttributeValueByPath(hit, path) || '';\n }\n\n return parseAttribute({ highlightedValue });\n}\n","import {\n MultipleQueriesQuery,\n SearchForFacetValuesResponse,\n SearchResponse,\n} from '@algolia/client-search';\nimport { SearchClient } from 'algoliasearch/lite';\n\nimport { fetchAlgoliaResults } from '../search';\n\ntype Fetcher = typeof fetchAlgoliaResults;\n\ntype FacetHit = {\n label: string;\n count: number;\n _highlightResult: {\n label: {\n value: string;\n };\n };\n};\n\nexport type FetcherParams = Pick<\n Parameters[0],\n 'searchClient' | 'queries'\n>;\n\nexport type RequesterParams = {\n transformResponse(\n response: TransformResponseParams\n ): TransformedRequesterResponse;\n};\n\ntype TransformResponseParams = {\n results: Array | SearchForFacetValuesResponse>;\n hits: Array['hits']>;\n facetHits: FacetHit[][];\n};\n\nexport type TransformedRequesterResponse =\n | Array['hits']>\n | SearchResponse['hits']\n | FacetHit[][]\n | FacetHit[];\n\nexport type TransformResponse = (\n response: TransformResponseParams\n) => TransformedRequesterResponse;\n\ntype FetcherParamsQuery = {\n query: MultipleQueriesQuery;\n sourceId: string;\n transformResponse: TransformResponse;\n};\n\ntype ExecuteParams = {\n searchClient: SearchClient;\n requests: Array>;\n};\n\nexport type Execute = (\n params: ExecuteParams\n) => Promise>;\n\nexport type ExecuteResponse = Array<{\n items: SearchResponse | SearchForFacetValuesResponse;\n sourceId: string;\n transformResponse: TransformResponse;\n}>;\n\nexport type RequestParams = FetcherParams & {\n /**\n * The function to transform the Algolia response before passing it to the Autocomplete state. You have access to the full Algolia results, as well as the pre-computed hits and facet hits.\n *\n * This is useful to manipulate the hits, or store data from the results in the [context](https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/context/).\n */\n transformResponse?: TransformResponse;\n};\n\nexport type RequesterDescription = {\n searchClient: SearchClient;\n queries: MultipleQueriesQuery[];\n transformResponse: TransformResponse;\n execute: Execute;\n};\n\nexport function createRequester(fetcher: Fetcher) {\n function execute(fetcherParams: ExecuteParams) {\n return fetcher({\n searchClient: fetcherParams.searchClient,\n queries: fetcherParams.requests.map((x) => x.query),\n }).then((responses) =>\n responses.map((response, index) => {\n const { sourceId, transformResponse } = fetcherParams.requests[index];\n\n return {\n items: response,\n sourceId,\n transformResponse,\n };\n })\n );\n }\n\n return function createSpecifiedRequester(\n requesterParams: RequesterParams\n ) {\n return function requester(\n requestParams: RequestParams\n ): RequesterDescription {\n return {\n execute,\n ...requesterParams,\n ...requestParams,\n };\n };\n };\n}\n","import {\n userAgents as coreUserAgents,\n UserAgent,\n} from '@algolia/autocomplete-shared';\nimport {\n MultipleQueriesQuery,\n SearchForFacetValuesResponse,\n SearchResponse,\n} from '@algolia/client-search';\nimport type { SearchClient } from 'algoliasearch/lite';\n\nimport { HIGHLIGHT_PRE_TAG, HIGHLIGHT_POST_TAG } from '../constants';\n\nexport interface SearchParams {\n /**\n * The initialized Algolia search client.\n */\n searchClient: SearchClient;\n /**\n * A list of queries to execute.\n */\n queries: MultipleQueriesQuery[];\n /**\n * A list of user agents to add to the search client.\n *\n * This is useful to track usage of an integration.\n */\n userAgents?: UserAgent[];\n}\n\nexport function fetchAlgoliaResults({\n searchClient,\n queries,\n userAgents = [],\n}: SearchParams): Promise<\n Array | SearchForFacetValuesResponse>\n> {\n if (typeof searchClient.addAlgoliaAgent === 'function') {\n const algoliaAgents: UserAgent[] = [...coreUserAgents, ...userAgents];\n\n algoliaAgents.forEach(({ segment, version }) => {\n searchClient.addAlgoliaAgent(segment, version);\n });\n }\n\n return searchClient\n .search(\n queries.map((searchParameters) => {\n const { params, ...headers } = searchParameters;\n\n return {\n ...headers,\n params: {\n hitsPerPage: 5,\n highlightPreTag: HIGHLIGHT_PRE_TAG,\n highlightPostTag: HIGHLIGHT_POST_TAG,\n ...params,\n },\n };\n })\n )\n .then((response) => {\n return response.results;\n });\n}\n","import { fetchAlgoliaResults } from '../search';\n\nimport { createRequester } from './createRequester';\n\nexport const createAlgoliaRequester = createRequester(fetchAlgoliaResults);\n","import { createAlgoliaRequester } from './createAlgoliaRequester';\n\n/**\n * Retrieves Algolia results from multiple indices.\n */\nexport const getAlgoliaResults = createAlgoliaRequester({\n transformResponse: (response) => response.hits,\n});\n","import { MultipleQueriesQuery } from '@algolia/client-search';\n\nimport { createAlgoliaRequester } from './createAlgoliaRequester';\nimport { RequestParams } from './createRequester';\n\n/**\n * Retrieves Algolia facet hits from multiple indices.\n */\nexport function getAlgoliaFacets(requestParams: RequestParams) {\n const requester = createAlgoliaRequester({\n transformResponse: (response) => response.facetHits,\n });\n\n const queries = requestParams.queries.map((query) => ({\n ...query,\n type: 'facet',\n })) as MultipleQueriesQuery[];\n\n return requester({\n ...requestParams,\n queries,\n });\n}\n","import { HighlightedHit } from './HighlightedHit';\nimport { parseAlgoliaHitHighlight } from './parseAlgoliaHitHighlight';\nimport { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams';\nimport { ParsedAttribute } from './ParsedAttribute';\nimport { reverseHighlightedParts } from './reverseHighlightedParts';\n\nexport function parseAlgoliaHitReverseHighlight<\n THit extends HighlightedHit\n>(props: ParseAlgoliaHitParams): ParsedAttribute[] {\n return reverseHighlightedParts(parseAlgoliaHitHighlight(props));\n}\n","import { ParseAlgoliaHitParams } from './ParseAlgoliaHitParams';\nimport { parseAlgoliaHitSnippet } from './parseAlgoliaHitSnippet';\nimport { ParsedAttribute } from './ParsedAttribute';\nimport { reverseHighlightedParts } from './reverseHighlightedParts';\nimport { SnippetedHit } from './SnippetedHit';\n\nexport function parseAlgoliaHitReverseSnippet<\n THit extends SnippetedHit\n>(props: ParseAlgoliaHitParams): ParsedAttribute[] {\n return reverseHighlightedParts(parseAlgoliaHitSnippet(props));\n}\n"],"names":["getAttributeValueByPath","record","path","reduce","current","key","userAgents","segment","version","HIGHLIGHT_PRE_TAG","HIGHLIGHT_POST_TAG","parseAttribute","preTagParts","highlightedValue","split","firstValue","shift","parts","value","get","add","part","lastPart","length","isHighlighted","push","createAttributeSet","forEach","postTagParts","parseAlgoliaHitHighlight","hit","attribute","Array","isArray","htmlEscapes","hasAlphanumeric","RegExp","regexEscapedHtml","regexHasEscapedHtml","source","isPartHighlighted","i","isNextHighlighted","isPreviousHighlighted","test","replace","character","reverseHighlightedParts","some","map","parseAlgoliaHitSnippet","createRequester","fetcher","execute","fetcherParams","searchClient","queries","requests","x","query","then","responses","response","index","items","sourceId","transformResponse","requesterParams","requestParams","fetchAlgoliaResults","addAlgoliaAgent","coreUserAgents","search","searchParameters","params","hitsPerPage","highlightPreTag","highlightPostTag","results","createAlgoliaRequester","getAlgoliaResults","hits","requester","facetHits","type","props"],"mappings":";ujEAAO,SAASA,EAAwBC,EAAQC,UACvCA,EAAKC,QAAO,SAAUC,EAASC,UAC7BD,GAAWA,EAAQC,KACzBJ,GCHE,ICCIK,EAAa,CAA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AAoBD,EAAuB,CACtDb,kBAAmB,SAACJ,UAAaA,EAASmB,uECErC,SAAiCb,OAChCc,EAAYH,EAAuB,CACvCb,kBAAmB,SAACJ,UAAaA,EAASqB,aAGtC3B,EAAUY,EAAcZ,QAAQP,KAAI,SAACU,iBACtCA,OACHyB,KAAM,oBAGDF,SACFd,OACHZ,QAAAA,2FCdG,SAEL6B,UACOtC,EAAwBlB,EAA+BwD,qCCHzD,SAELA,UACOtC,EAAwBG,EAA6BmC"} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-preset-algolia/package.json b/node_modules/@algolia/autocomplete-preset-algolia/package.json new file mode 100644 index 0000000000..24532eb68e --- /dev/null +++ b/node_modules/@algolia/autocomplete-preset-algolia/package.json @@ -0,0 +1,44 @@ +{ + "name": "@algolia/autocomplete-preset-algolia", + "description": "Presets for building autocomplete experiences with Algolia.", + "version": "1.5.2", + "license": "MIT", + "homepage": "https://github.com/algolia/autocomplete", + "repository": "algolia/autocomplete", + "author": { + "name": "Algolia, Inc.", + "url": "https://www.algolia.com" + }, + "sideEffects": false, + "files": [ + "dist/" + ], + "source": "src/index.ts", + "types": "dist/esm/index.d.ts", + "module": "dist/esm/index.js", + "main": "dist/umd/index.production.js", + "umd:main": "dist/umd/index.production.js", + "unpkg": "dist/umd/index.production.js", + "jsdelivr": "dist/umd/index.production.js", + "scripts": { + "build:clean": "rm -rf ./dist", + "build:esm": "babel src --root-mode upward --extensions '.ts,.tsx' --out-dir dist/esm --ignore '**/*/__tests__/'", + "build:types": "tsc -p ./tsconfig.declaration.json --outDir ./dist/esm", + "build:umd": "rollup --config", + "build": "yarn build:clean && yarn build:umd && yarn build:esm && yarn build:types", + "on:change": "concurrently \"yarn build:esm\" \"yarn build:types\"", + "prepare": "yarn build:esm && yarn build:types", + "watch": "watch \"yarn on:change\" --ignoreDirectoryPattern \"/dist/\"" + }, + "dependencies": { + "@algolia/autocomplete-shared": "1.5.2" + }, + "devDependencies": { + "@algolia/client-search": "4.9.1", + "algoliasearch": "4.9.1" + }, + "peerDependencies": { + "@algolia/client-search": "^4.9.1", + "algoliasearch": "^4.9.1" + } +} diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/MaybePromise.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/MaybePromise.d.ts new file mode 100644 index 0000000000..b4c928d9f1 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/MaybePromise.d.ts @@ -0,0 +1 @@ +export declare type MaybePromise = Promise | TResolution; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/MaybePromise.js b/node_modules/@algolia/autocomplete-shared/dist/esm/MaybePromise.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/MaybePromise.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/UserAgent.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/UserAgent.d.ts new file mode 100644 index 0000000000..2f5fa9dee0 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/UserAgent.d.ts @@ -0,0 +1,4 @@ +export declare type UserAgent = { + segment: string; + version?: string; +}; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/UserAgent.js b/node_modules/@algolia/autocomplete-shared/dist/esm/UserAgent.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/UserAgent.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/createRef.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/createRef.d.ts new file mode 100644 index 0000000000..feeb16866c --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/createRef.d.ts @@ -0,0 +1,3 @@ +export declare function createRef(initialValue: TValue): { + current: TValue; +}; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/createRef.js b/node_modules/@algolia/autocomplete-shared/dist/esm/createRef.js new file mode 100644 index 0000000000..c8f0f3f5de --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/createRef.js @@ -0,0 +1,5 @@ +export function createRef(initialValue) { + return { + current: initialValue + }; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/debounce.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/debounce.d.ts new file mode 100644 index 0000000000..c6440aee06 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/debounce.d.ts @@ -0,0 +1 @@ +export declare function debounce(fn: (...params: TParams[]) => void, time: number): (...args: TParams[]) => void; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/debounce.js b/node_modules/@algolia/autocomplete-shared/dist/esm/debounce.js new file mode 100644 index 0000000000..d63c8ecbeb --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/debounce.js @@ -0,0 +1,16 @@ +export function debounce(fn, time) { + var timerId = undefined; + return function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (timerId) { + clearTimeout(timerId); + } + + timerId = setTimeout(function () { + return fn.apply(void 0, args); + }, time); + }; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/decycle.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/decycle.d.ts new file mode 100644 index 0000000000..df6b1d9b06 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/decycle.d.ts @@ -0,0 +1,5 @@ +/** + * Decycles objects with circular references. + * This is used to print cyclic structures in development environment only. + */ +export declare function decycle(obj: any, seen?: Set): any; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/decycle.js b/node_modules/@algolia/autocomplete-shared/dist/esm/decycle.js new file mode 100644 index 0000000000..5e3ae13e81 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/decycle.js @@ -0,0 +1,45 @@ +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +/** + * Decycles objects with circular references. + * This is used to print cyclic structures in development environment only. + */ +export function decycle(obj) { + var seen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set(); + + if (!(process.env.NODE_ENV !== 'production') || !obj || _typeof(obj) !== 'object') { + return obj; + } + + if (seen.has(obj)) { + return '[Circular]'; + } + + var newSeen = seen.add(obj); + + if (Array.isArray(obj)) { + return obj.map(function (x) { + return decycle(x, newSeen); + }); + } + + return Object.fromEntries(Object.entries(obj).map(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + value = _ref2[1]; + + return [key, decycle(value, newSeen)]; + })); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/flatten.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/flatten.d.ts new file mode 100644 index 0000000000..931dbf5449 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/flatten.d.ts @@ -0,0 +1 @@ +export declare function flatten(values: Array): TType[]; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/flatten.js b/node_modules/@algolia/autocomplete-shared/dist/esm/flatten.js new file mode 100644 index 0000000000..d088bb2e70 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/flatten.js @@ -0,0 +1,5 @@ +export function flatten(values) { + return values.reduce(function (a, b) { + return a.concat(b); + }, []); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/generateAutocompleteId.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/generateAutocompleteId.d.ts new file mode 100644 index 0000000000..f7aa41aa8b --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/generateAutocompleteId.d.ts @@ -0,0 +1 @@ +export declare function generateAutocompleteId(): string; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/generateAutocompleteId.js b/node_modules/@algolia/autocomplete-shared/dist/esm/generateAutocompleteId.js new file mode 100644 index 0000000000..2e1353bf8a --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/generateAutocompleteId.js @@ -0,0 +1,4 @@ +var autocompleteId = 0; +export function generateAutocompleteId() { + return "autocomplete-".concat(autocompleteId++); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/getAttributeValueByPath.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/getAttributeValueByPath.d.ts new file mode 100644 index 0000000000..49c4621c3e --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/getAttributeValueByPath.d.ts @@ -0,0 +1 @@ +export declare function getAttributeValueByPath(record: TRecord, path: string[]): any; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/getAttributeValueByPath.js b/node_modules/@algolia/autocomplete-shared/dist/esm/getAttributeValueByPath.js new file mode 100644 index 0000000000..851dc1fb06 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/getAttributeValueByPath.js @@ -0,0 +1,5 @@ +export function getAttributeValueByPath(record, path) { + return path.reduce(function (current, key) { + return current && current[key]; + }, record); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/getItemsCount.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/getItemsCount.d.ts new file mode 100644 index 0000000000..342a839f4f --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/getItemsCount.d.ts @@ -0,0 +1,3 @@ +export declare function getItemsCount(state: TAutocompleteState): number; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/getItemsCount.js b/node_modules/@algolia/autocomplete-shared/dist/esm/getItemsCount.js new file mode 100644 index 0000000000..de02ed8d92 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/getItemsCount.js @@ -0,0 +1,9 @@ +export function getItemsCount(state) { + if (state.collections.length === 0) { + return 0; + } + + return state.collections.reduce(function (sum, collection) { + return sum + collection.items.length; + }, 0); +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/index.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/index.d.ts new file mode 100644 index 0000000000..2f849f4cd3 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/index.d.ts @@ -0,0 +1,15 @@ +export * from './createRef'; +export * from './debounce'; +export * from './decycle'; +export * from './flatten'; +export * from './generateAutocompleteId'; +export * from './getAttributeValueByPath'; +export * from './getItemsCount'; +export * from './invariant'; +export * from './isEqual'; +export * from './MaybePromise'; +export * from './noop'; +export * from './UserAgent'; +export * from './userAgents'; +export * from './version'; +export * from './warn'; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/index.js b/node_modules/@algolia/autocomplete-shared/dist/esm/index.js new file mode 100644 index 0000000000..870dc5d763 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/index.js @@ -0,0 +1,15 @@ +export * from './createRef'; +export * from './debounce'; +export * from './decycle'; +export * from './flatten'; +export * from './generateAutocompleteId'; +export * from './getAttributeValueByPath'; +export * from './getItemsCount'; +export * from './invariant'; +export * from './isEqual'; +export * from './MaybePromise'; +export * from './noop'; +export * from './UserAgent'; +export * from './userAgents'; +export * from './version'; +export * from './warn'; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/invariant.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/invariant.d.ts new file mode 100644 index 0000000000..4ef4fe6486 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/invariant.d.ts @@ -0,0 +1,6 @@ +/** + * Throws an error if the condition is not met in development mode. + * This is used to make development a better experience to provide guidance as + * to where the error comes from. + */ +export declare function invariant(condition: boolean, message: string | (() => string)): void; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/invariant.js b/node_modules/@algolia/autocomplete-shared/dist/esm/invariant.js new file mode 100644 index 0000000000..552c7ee7f8 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/invariant.js @@ -0,0 +1,14 @@ +/** + * Throws an error if the condition is not met in development mode. + * This is used to make development a better experience to provide guidance as + * to where the error comes from. + */ +export function invariant(condition, message) { + if (!(process.env.NODE_ENV !== 'production')) { + return; + } + + if (!condition) { + throw new Error("[Autocomplete] ".concat(typeof message === 'function' ? message() : message)); + } +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/isEqual.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/isEqual.d.ts new file mode 100644 index 0000000000..970012591e --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/isEqual.d.ts @@ -0,0 +1 @@ +export declare function isEqual(first: any, second: any): boolean; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/isEqual.js b/node_modules/@algolia/autocomplete-shared/dist/esm/isEqual.js new file mode 100644 index 0000000000..bc4feb79fc --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/isEqual.js @@ -0,0 +1,31 @@ +function isPrimitive(obj) { + return obj !== Object(obj); +} + +export function isEqual(first, second) { + if (first === second) { + return true; + } + + if (isPrimitive(first) || isPrimitive(second) || typeof first === 'function' || typeof second === 'function') { + return first === second; + } + + if (Object.keys(first).length !== Object.keys(second).length) { + return false; + } + + for (var _i = 0, _Object$keys = Object.keys(first); _i < _Object$keys.length; _i++) { + var key = _Object$keys[_i]; + + if (!(key in second)) { + return false; + } + + if (!isEqual(first[key], second[key])) { + return false; + } + } + + return true; +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/noop.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/noop.d.ts new file mode 100644 index 0000000000..27abd08d2f --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/noop.d.ts @@ -0,0 +1 @@ +export declare const noop: () => void; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/noop.js b/node_modules/@algolia/autocomplete-shared/dist/esm/noop.js new file mode 100644 index 0000000000..9ef70ae807 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/noop.js @@ -0,0 +1 @@ +export var noop = function noop() {}; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/userAgents.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/userAgents.d.ts new file mode 100644 index 0000000000..7a20313e6a --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/userAgents.d.ts @@ -0,0 +1,4 @@ +export declare const userAgents: { + segment: string; + version: string; +}[]; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/userAgents.js b/node_modules/@algolia/autocomplete-shared/dist/esm/userAgents.js new file mode 100644 index 0000000000..3744a3dcf1 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/userAgents.js @@ -0,0 +1,5 @@ +import { version } from './version'; +export var userAgents = [{ + segment: 'autocomplete-core', + version: version +}]; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/version.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/version.d.ts new file mode 100644 index 0000000000..f97e989436 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/version.d.ts @@ -0,0 +1 @@ +export declare const version = "1.5.2"; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/version.js b/node_modules/@algolia/autocomplete-shared/dist/esm/version.js new file mode 100644 index 0000000000..07576c5d02 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/version.js @@ -0,0 +1 @@ +export var version = '1.5.2'; \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/warn.d.ts b/node_modules/@algolia/autocomplete-shared/dist/esm/warn.d.ts new file mode 100644 index 0000000000..5807f75087 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/warn.d.ts @@ -0,0 +1,8 @@ +export declare const warnCache: { + current: {}; +}; +/** + * Logs a warning if the condition is not met. + * This is used to log issues in development environment only. + */ +export declare function warn(condition: boolean, message: string): void; diff --git a/node_modules/@algolia/autocomplete-shared/dist/esm/warn.js b/node_modules/@algolia/autocomplete-shared/dist/esm/warn.js new file mode 100644 index 0000000000..a33b9a70cc --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/dist/esm/warn.js @@ -0,0 +1,26 @@ +export var warnCache = { + current: {} +}; +/** + * Logs a warning if the condition is not met. + * This is used to log issues in development environment only. + */ + +export function warn(condition, message) { + if (!(process.env.NODE_ENV !== 'production')) { + return; + } + + if (condition) { + return; + } + + var sanitizedMessage = message.trim(); + var hasAlreadyPrinted = warnCache.current[sanitizedMessage]; + + if (!hasAlreadyPrinted) { + warnCache.current[sanitizedMessage] = true; // eslint-disable-next-line no-console + + console.warn("[Autocomplete] ".concat(sanitizedMessage)); + } +} \ No newline at end of file diff --git a/node_modules/@algolia/autocomplete-shared/package.json b/node_modules/@algolia/autocomplete-shared/package.json new file mode 100644 index 0000000000..adacbfc931 --- /dev/null +++ b/node_modules/@algolia/autocomplete-shared/package.json @@ -0,0 +1,29 @@ +{ + "name": "@algolia/autocomplete-shared", + "description": "Shared utils for Autocomplete packages.", + "version": "1.5.2", + "license": "MIT", + "homepage": "https://github.com/algolia/autocomplete", + "repository": "algolia/autocomplete", + "author": { + "name": "Algolia, Inc.", + "url": "https://www.algolia.com" + }, + "source": "src/index.ts", + "types": "dist/esm/index.d.ts", + "module": "dist/esm/index.js", + "main": "dist/esm/index.js", + "sideEffects": false, + "files": [ + "dist/" + ], + "scripts": { + "build:clean": "rm -rf ./dist", + "build:esm": "babel src --root-mode upward --extensions '.ts,.tsx' --out-dir dist/esm --ignore '**/*/__tests__/'", + "build:types": "tsc -p ./tsconfig.declaration.json --outDir ./dist/esm", + "build": "yarn build:clean && yarn build:esm && yarn build:types", + "on:change": "concurrently \"yarn build:esm\" \"yarn build:types\"", + "prepare": "yarn build:esm && yarn build:types", + "watch": "watch \"yarn on:change\" --ignoreDirectoryPattern \"/dist/\"" + } +} diff --git a/node_modules/@algolia/cache-browser-local-storage/dist/cache-browser-local-storage.cjs.js b/node_modules/@algolia/cache-browser-local-storage/dist/cache-browser-local-storage.cjs.js new file mode 100644 index 0000000000..569adfad4d --- /dev/null +++ b/node_modules/@algolia/cache-browser-local-storage/dist/cache-browser-local-storage.cjs.js @@ -0,0 +1,58 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function createBrowserLocalStorageCache(options) { + const namespaceKey = `algoliasearch-client-js-${options.key}`; + // eslint-disable-next-line functional/no-let + let storage; + const getStorage = () => { + if (storage === undefined) { + storage = options.localStorage || window.localStorage; + } + return storage; + }; + const getNamespace = () => { + return JSON.parse(getStorage().getItem(namespaceKey) || '{}'); + }; + return { + get(key, defaultValue, events = { + miss: () => Promise.resolve(), + }) { + return Promise.resolve() + .then(() => { + const keyAsString = JSON.stringify(key); + const value = getNamespace()[keyAsString]; + return Promise.all([value || defaultValue(), value !== undefined]); + }) + .then(([value, exists]) => { + return Promise.all([value, exists || events.miss(value)]); + }) + .then(([value]) => value); + }, + set(key, value) { + return Promise.resolve().then(() => { + const namespace = getNamespace(); + // eslint-disable-next-line functional/immutable-data + namespace[JSON.stringify(key)] = value; + getStorage().setItem(namespaceKey, JSON.stringify(namespace)); + return value; + }); + }, + delete(key) { + return Promise.resolve().then(() => { + const namespace = getNamespace(); + // eslint-disable-next-line functional/immutable-data + delete namespace[JSON.stringify(key)]; + getStorage().setItem(namespaceKey, JSON.stringify(namespace)); + }); + }, + clear() { + return Promise.resolve().then(() => { + getStorage().removeItem(namespaceKey); + }); + }, + }; +} + +exports.createBrowserLocalStorageCache = createBrowserLocalStorageCache; diff --git a/node_modules/@algolia/cache-browser-local-storage/dist/cache-browser-local-storage.d.ts b/node_modules/@algolia/cache-browser-local-storage/dist/cache-browser-local-storage.d.ts new file mode 100644 index 0000000000..62dbae0d37 --- /dev/null +++ b/node_modules/@algolia/cache-browser-local-storage/dist/cache-browser-local-storage.d.ts @@ -0,0 +1,16 @@ +import { Cache } from '@algolia/cache-common'; + +export declare type BrowserLocalStorageOptions = { + /** + * The cache key. + */ + readonly key: string; + /** + * The native local storage implementation. + */ + readonly localStorage?: Storage; +}; + +export declare function createBrowserLocalStorageCache(options: BrowserLocalStorageOptions): Cache; + +export { } diff --git a/node_modules/@algolia/cache-browser-local-storage/dist/cache-browser-local-storage.esm.js b/node_modules/@algolia/cache-browser-local-storage/dist/cache-browser-local-storage.esm.js new file mode 100644 index 0000000000..7e0ab01e3a --- /dev/null +++ b/node_modules/@algolia/cache-browser-local-storage/dist/cache-browser-local-storage.esm.js @@ -0,0 +1,54 @@ +function createBrowserLocalStorageCache(options) { + const namespaceKey = `algoliasearch-client-js-${options.key}`; + // eslint-disable-next-line functional/no-let + let storage; + const getStorage = () => { + if (storage === undefined) { + storage = options.localStorage || window.localStorage; + } + return storage; + }; + const getNamespace = () => { + return JSON.parse(getStorage().getItem(namespaceKey) || '{}'); + }; + return { + get(key, defaultValue, events = { + miss: () => Promise.resolve(), + }) { + return Promise.resolve() + .then(() => { + const keyAsString = JSON.stringify(key); + const value = getNamespace()[keyAsString]; + return Promise.all([value || defaultValue(), value !== undefined]); + }) + .then(([value, exists]) => { + return Promise.all([value, exists || events.miss(value)]); + }) + .then(([value]) => value); + }, + set(key, value) { + return Promise.resolve().then(() => { + const namespace = getNamespace(); + // eslint-disable-next-line functional/immutable-data + namespace[JSON.stringify(key)] = value; + getStorage().setItem(namespaceKey, JSON.stringify(namespace)); + return value; + }); + }, + delete(key) { + return Promise.resolve().then(() => { + const namespace = getNamespace(); + // eslint-disable-next-line functional/immutable-data + delete namespace[JSON.stringify(key)]; + getStorage().setItem(namespaceKey, JSON.stringify(namespace)); + }); + }, + clear() { + return Promise.resolve().then(() => { + getStorage().removeItem(namespaceKey); + }); + }, + }; +} + +export { createBrowserLocalStorageCache }; diff --git a/node_modules/@algolia/cache-browser-local-storage/index.js b/node_modules/@algolia/cache-browser-local-storage/index.js new file mode 100644 index 0000000000..618c06181b --- /dev/null +++ b/node_modules/@algolia/cache-browser-local-storage/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line functional/immutable-data, import/no-commonjs +module.exports = require('./dist/cache-browser-local-storage.cjs.js'); diff --git a/node_modules/@algolia/cache-browser-local-storage/package.json b/node_modules/@algolia/cache-browser-local-storage/package.json new file mode 100644 index 0000000000..33bee379ce --- /dev/null +++ b/node_modules/@algolia/cache-browser-local-storage/package.json @@ -0,0 +1,22 @@ +{ + "name": "@algolia/cache-browser-local-storage", + "version": "4.13.0", + "private": false, + "description": "Promise-based cache library for browser using local storage.", + "repository": { + "type": "git", + "url": "git://github.com/algolia/algoliasearch-client-javascript.git" + }, + "license": "MIT", + "sideEffects": false, + "main": "index.js", + "module": "dist/cache-browser-local-storage.esm.js", + "types": "dist/cache-browser-local-storage.d.ts", + "files": [ + "index.js", + "dist" + ], + "dependencies": { + "@algolia/cache-common": "4.13.0" + } +} diff --git a/node_modules/@algolia/cache-common/dist/cache-common.cjs.js b/node_modules/@algolia/cache-common/dist/cache-common.cjs.js new file mode 100644 index 0000000000..9061573953 --- /dev/null +++ b/node_modules/@algolia/cache-common/dist/cache-common.cjs.js @@ -0,0 +1,61 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +// @todo Add logger on options to debug when caches go wrong. +function createFallbackableCache(options) { + const caches = [...options.caches]; + const current = caches.shift(); // eslint-disable-line functional/immutable-data + if (current === undefined) { + return createNullCache(); + } + return { + get(key, defaultValue, events = { + miss: () => Promise.resolve(), + }) { + return current.get(key, defaultValue, events).catch(() => { + return createFallbackableCache({ caches }).get(key, defaultValue, events); + }); + }, + set(key, value) { + return current.set(key, value).catch(() => { + return createFallbackableCache({ caches }).set(key, value); + }); + }, + delete(key) { + return current.delete(key).catch(() => { + return createFallbackableCache({ caches }).delete(key); + }); + }, + clear() { + return current.clear().catch(() => { + return createFallbackableCache({ caches }).clear(); + }); + }, + }; +} + +function createNullCache() { + return { + get(_key, defaultValue, events = { + miss: () => Promise.resolve(), + }) { + const value = defaultValue(); + return value + .then(result => Promise.all([result, events.miss(result)])) + .then(([result]) => result); + }, + set(_key, value) { + return Promise.resolve(value); + }, + delete(_key) { + return Promise.resolve(); + }, + clear() { + return Promise.resolve(); + }, + }; +} + +exports.createFallbackableCache = createFallbackableCache; +exports.createNullCache = createNullCache; diff --git a/node_modules/@algolia/cache-common/dist/cache-common.d.ts b/node_modules/@algolia/cache-common/dist/cache-common.d.ts new file mode 100644 index 0000000000..ef7af507ea --- /dev/null +++ b/node_modules/@algolia/cache-common/dist/cache-common.d.ts @@ -0,0 +1,40 @@ +import { Cache as Cache_2 } from '@algolia/cache-common'; + +export declare type Cache = { + /** + * Gets the value of the given `key`. + */ + readonly get: (key: object | string, defaultValue: () => Readonly>, events?: CacheEvents) => Readonly>; + /** + * Sets the given value with the given `key`. + */ + readonly set: (key: object | string, value: TValue) => Readonly>; + /** + * Deletes the given `key`. + */ + readonly delete: (key: object | string) => Readonly>; + /** + * Clears the cache. + */ + readonly clear: () => Readonly>; +}; + +export declare type CacheEvents = { + /** + * The callback when the given `key` is missing from the cache. + */ + readonly miss: (value: TValue) => Readonly>; +}; + +export declare function createFallbackableCache(options: FallbackableCacheOptions): Cache; + +export declare function createNullCache(): Cache; + +export declare type FallbackableCacheOptions = { + /** + * List of caches order by priority. + */ + readonly caches: readonly Cache_2[]; +}; + +export { } diff --git a/node_modules/@algolia/cache-common/dist/cache-common.esm.js b/node_modules/@algolia/cache-common/dist/cache-common.esm.js new file mode 100644 index 0000000000..b42b263065 --- /dev/null +++ b/node_modules/@algolia/cache-common/dist/cache-common.esm.js @@ -0,0 +1,56 @@ +// @todo Add logger on options to debug when caches go wrong. +function createFallbackableCache(options) { + const caches = [...options.caches]; + const current = caches.shift(); // eslint-disable-line functional/immutable-data + if (current === undefined) { + return createNullCache(); + } + return { + get(key, defaultValue, events = { + miss: () => Promise.resolve(), + }) { + return current.get(key, defaultValue, events).catch(() => { + return createFallbackableCache({ caches }).get(key, defaultValue, events); + }); + }, + set(key, value) { + return current.set(key, value).catch(() => { + return createFallbackableCache({ caches }).set(key, value); + }); + }, + delete(key) { + return current.delete(key).catch(() => { + return createFallbackableCache({ caches }).delete(key); + }); + }, + clear() { + return current.clear().catch(() => { + return createFallbackableCache({ caches }).clear(); + }); + }, + }; +} + +function createNullCache() { + return { + get(_key, defaultValue, events = { + miss: () => Promise.resolve(), + }) { + const value = defaultValue(); + return value + .then(result => Promise.all([result, events.miss(result)])) + .then(([result]) => result); + }, + set(_key, value) { + return Promise.resolve(value); + }, + delete(_key) { + return Promise.resolve(); + }, + clear() { + return Promise.resolve(); + }, + }; +} + +export { createFallbackableCache, createNullCache }; diff --git a/node_modules/@algolia/cache-common/index.js b/node_modules/@algolia/cache-common/index.js new file mode 100644 index 0000000000..b121ae501c --- /dev/null +++ b/node_modules/@algolia/cache-common/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line functional/immutable-data, import/no-commonjs +module.exports = require('./dist/cache-common.cjs.js'); diff --git a/node_modules/@algolia/cache-common/package.json b/node_modules/@algolia/cache-common/package.json new file mode 100644 index 0000000000..545488b0b7 --- /dev/null +++ b/node_modules/@algolia/cache-common/package.json @@ -0,0 +1,19 @@ +{ + "name": "@algolia/cache-common", + "version": "4.13.0", + "private": false, + "description": "Common interfaces for promise-based caching libraries", + "repository": { + "type": "git", + "url": "git://github.com/algolia/algoliasearch-client-js.git" + }, + "license": "MIT", + "sideEffects": false, + "main": "index.js", + "module": "dist/cache-common.esm.js", + "types": "dist/cache-common.d.ts", + "files": [ + "index.js", + "dist" + ] +} diff --git a/node_modules/@algolia/cache-in-memory/dist/cache-in-memory.cjs.js b/node_modules/@algolia/cache-in-memory/dist/cache-in-memory.cjs.js new file mode 100644 index 0000000000..cd2603ddf7 --- /dev/null +++ b/node_modules/@algolia/cache-in-memory/dist/cache-in-memory.cjs.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function createInMemoryCache(options = { serializable: true }) { + // eslint-disable-next-line functional/no-let + let cache = {}; + return { + get(key, defaultValue, events = { + miss: () => Promise.resolve(), + }) { + const keyAsString = JSON.stringify(key); + if (keyAsString in cache) { + return Promise.resolve(options.serializable ? JSON.parse(cache[keyAsString]) : cache[keyAsString]); + } + const promise = defaultValue(); + const miss = (events && events.miss) || (() => Promise.resolve()); + return promise.then((value) => miss(value)).then(() => promise); + }, + set(key, value) { + // eslint-disable-next-line functional/immutable-data + cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value; + return Promise.resolve(value); + }, + delete(key) { + // eslint-disable-next-line functional/immutable-data + delete cache[JSON.stringify(key)]; + return Promise.resolve(); + }, + clear() { + cache = {}; + return Promise.resolve(); + }, + }; +} + +exports.createInMemoryCache = createInMemoryCache; diff --git a/node_modules/@algolia/cache-in-memory/dist/cache-in-memory.d.ts b/node_modules/@algolia/cache-in-memory/dist/cache-in-memory.d.ts new file mode 100644 index 0000000000..c27966c6b4 --- /dev/null +++ b/node_modules/@algolia/cache-in-memory/dist/cache-in-memory.d.ts @@ -0,0 +1,12 @@ +import { Cache } from '@algolia/cache-common'; + +export declare function createInMemoryCache(options?: InMemoryCacheOptions): Cache; + +export declare type InMemoryCacheOptions = { + /** + * If keys and values should be serialized using `JSON.stringify`. + */ + readonly serializable?: boolean; +}; + +export { } diff --git a/node_modules/@algolia/cache-in-memory/dist/cache-in-memory.esm.js b/node_modules/@algolia/cache-in-memory/dist/cache-in-memory.esm.js new file mode 100644 index 0000000000..3f5555ff9c --- /dev/null +++ b/node_modules/@algolia/cache-in-memory/dist/cache-in-memory.esm.js @@ -0,0 +1,33 @@ +function createInMemoryCache(options = { serializable: true }) { + // eslint-disable-next-line functional/no-let + let cache = {}; + return { + get(key, defaultValue, events = { + miss: () => Promise.resolve(), + }) { + const keyAsString = JSON.stringify(key); + if (keyAsString in cache) { + return Promise.resolve(options.serializable ? JSON.parse(cache[keyAsString]) : cache[keyAsString]); + } + const promise = defaultValue(); + const miss = (events && events.miss) || (() => Promise.resolve()); + return promise.then((value) => miss(value)).then(() => promise); + }, + set(key, value) { + // eslint-disable-next-line functional/immutable-data + cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value; + return Promise.resolve(value); + }, + delete(key) { + // eslint-disable-next-line functional/immutable-data + delete cache[JSON.stringify(key)]; + return Promise.resolve(); + }, + clear() { + cache = {}; + return Promise.resolve(); + }, + }; +} + +export { createInMemoryCache }; diff --git a/node_modules/@algolia/cache-in-memory/index.js b/node_modules/@algolia/cache-in-memory/index.js new file mode 100644 index 0000000000..14ac878385 --- /dev/null +++ b/node_modules/@algolia/cache-in-memory/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line functional/immutable-data, import/no-commonjs +module.exports = require('./dist/cache-in-memory.cjs.js'); diff --git a/node_modules/@algolia/cache-in-memory/package.json b/node_modules/@algolia/cache-in-memory/package.json new file mode 100644 index 0000000000..9ec8bd8968 --- /dev/null +++ b/node_modules/@algolia/cache-in-memory/package.json @@ -0,0 +1,22 @@ +{ + "name": "@algolia/cache-in-memory", + "version": "4.13.0", + "private": false, + "description": "Promise-based cache library using memory.", + "repository": { + "type": "git", + "url": "git://github.com/algolia/algoliasearch-client-javascript.git" + }, + "license": "MIT", + "sideEffects": false, + "main": "index.js", + "module": "dist/cache-in-memory.esm.js", + "types": "dist/cache-in-memory.d.ts", + "files": [ + "index.js", + "dist" + ], + "dependencies": { + "@algolia/cache-common": "4.13.0" + } +} diff --git a/node_modules/@algolia/client-account/dist/client-account.cjs.js b/node_modules/@algolia/client-account/dist/client-account.cjs.js new file mode 100644 index 0000000000..bae1f22dc6 --- /dev/null +++ b/node_modules/@algolia/client-account/dist/client-account.cjs.js @@ -0,0 +1,69 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var clientCommon = require('@algolia/client-common'); +var clientSearch = require('@algolia/client-search'); + +function createDestinationIndiceExistsError() { + return { + name: 'DestinationIndiceAlreadyExistsError', + message: 'Destination indice already exists.', + }; +} + +function createIndicesInSameAppError(appId) { + return { + name: 'IndicesInTheSameAppError', + message: 'Indices are in the same application. Use SearchClient.copyIndex instead.', + appId, + }; +} + +const accountCopyIndex = (source, destination, requestOptions) => { + // eslint-disable-next-line functional/prefer-readonly-type + const responses = []; + const promise = clientSearch.exists(destination)() + .then(res => { + if (source.appId === destination.appId) { + throw createIndicesInSameAppError(source.appId); + } + if (res) { + throw createDestinationIndiceExistsError(); + } + }) + .then(() => clientSearch.getSettings(source)()) + .then(settings => + // eslint-disable-next-line functional/immutable-data + responses.push(clientSearch.setSettings(destination)(settings, requestOptions))) + .then(() => clientSearch.browseRules(source)({ + // eslint-disable-next-line functional/immutable-data + batch: rules => responses.push(clientSearch.saveRules(destination)(rules, requestOptions)), + })) + .then(() => clientSearch.browseSynonyms(source)({ + // eslint-disable-next-line functional/immutable-data + batch: synonyms => responses.push(clientSearch.saveSynonyms(destination)(synonyms, requestOptions)), + })) + .then(() => clientSearch.browseObjects(source)({ + // eslint-disable-next-line functional/immutable-data + batch: objects => responses.push(clientSearch.saveObjects(destination)(objects, requestOptions)), + })); + return clientCommon.createWaitablePromise( + /** + * The original promise will return an array of async responses, now + * we need to resolve that array of async responses using a + * `Promise.all`, and then resolve `void` for the end-user. + */ + promise.then(() => Promise.all(responses)).then(() => undefined), + /** + * Next, if the end-user calls the `wait` method, we need to also call + * the `wait` method on each element of of async responses. + */ + (_response, waitRequestOptions) => { + return Promise.all(responses.map(response => response.wait(waitRequestOptions))); + }); +}; + +exports.accountCopyIndex = accountCopyIndex; +exports.createDestinationIndiceExistsError = createDestinationIndiceExistsError; +exports.createIndicesInSameAppError = createIndicesInSameAppError; diff --git a/node_modules/@algolia/client-account/dist/client-account.d.ts b/node_modules/@algolia/client-account/dist/client-account.d.ts new file mode 100644 index 0000000000..2e5115e527 --- /dev/null +++ b/node_modules/@algolia/client-account/dist/client-account.d.ts @@ -0,0 +1,18 @@ +import { RequestOptions } from '@algolia/transporter'; +import { SearchIndex } from '@algolia/client-search'; +import { WaitablePromise } from '@algolia/client-common'; + +export declare const accountCopyIndex: (source: SearchIndex, destination: SearchIndex, requestOptions?: RequestOptions | undefined) => WaitablePromise; + +export declare function createDestinationIndiceExistsError(): Error; + +export declare function createIndicesInSameAppError(appId: string): IndicesInSameAppError; + +export declare type IndicesInSameAppError = Error & { + /** + * The app id. + */ + readonly appId: string; +}; + +export { } diff --git a/node_modules/@algolia/client-account/dist/client-account.esm.js b/node_modules/@algolia/client-account/dist/client-account.esm.js new file mode 100644 index 0000000000..dd2299e662 --- /dev/null +++ b/node_modules/@algolia/client-account/dist/client-account.esm.js @@ -0,0 +1,63 @@ +import { createWaitablePromise } from '@algolia/client-common'; +import { exists, getSettings, setSettings, browseRules, saveRules, browseSynonyms, saveSynonyms, browseObjects, saveObjects } from '@algolia/client-search'; + +function createDestinationIndiceExistsError() { + return { + name: 'DestinationIndiceAlreadyExistsError', + message: 'Destination indice already exists.', + }; +} + +function createIndicesInSameAppError(appId) { + return { + name: 'IndicesInTheSameAppError', + message: 'Indices are in the same application. Use SearchClient.copyIndex instead.', + appId, + }; +} + +const accountCopyIndex = (source, destination, requestOptions) => { + // eslint-disable-next-line functional/prefer-readonly-type + const responses = []; + const promise = exists(destination)() + .then(res => { + if (source.appId === destination.appId) { + throw createIndicesInSameAppError(source.appId); + } + if (res) { + throw createDestinationIndiceExistsError(); + } + }) + .then(() => getSettings(source)()) + .then(settings => + // eslint-disable-next-line functional/immutable-data + responses.push(setSettings(destination)(settings, requestOptions))) + .then(() => browseRules(source)({ + // eslint-disable-next-line functional/immutable-data + batch: rules => responses.push(saveRules(destination)(rules, requestOptions)), + })) + .then(() => browseSynonyms(source)({ + // eslint-disable-next-line functional/immutable-data + batch: synonyms => responses.push(saveSynonyms(destination)(synonyms, requestOptions)), + })) + .then(() => browseObjects(source)({ + // eslint-disable-next-line functional/immutable-data + batch: objects => responses.push(saveObjects(destination)(objects, requestOptions)), + })); + return createWaitablePromise( + /** + * The original promise will return an array of async responses, now + * we need to resolve that array of async responses using a + * `Promise.all`, and then resolve `void` for the end-user. + */ + promise.then(() => Promise.all(responses)).then(() => undefined), + /** + * Next, if the end-user calls the `wait` method, we need to also call + * the `wait` method on each element of of async responses. + */ + (_response, waitRequestOptions) => { + return Promise.all(responses.map(response => response.wait(waitRequestOptions))); + }); +}; + +export { accountCopyIndex, createDestinationIndiceExistsError, createIndicesInSameAppError }; diff --git a/node_modules/@algolia/client-account/index.js b/node_modules/@algolia/client-account/index.js new file mode 100644 index 0000000000..ea5e5605a2 --- /dev/null +++ b/node_modules/@algolia/client-account/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line functional/immutable-data, import/no-commonjs +module.exports = require('./dist/client-account.cjs.js'); diff --git a/node_modules/@algolia/client-account/package.json b/node_modules/@algolia/client-account/package.json new file mode 100644 index 0000000000..d176bc51cf --- /dev/null +++ b/node_modules/@algolia/client-account/package.json @@ -0,0 +1,23 @@ +{ + "name": "@algolia/client-account", + "version": "4.13.0", + "private": false, + "repository": { + "type": "git", + "url": "git://github.com/algolia/algoliasearch-client-javascript.git" + }, + "license": "MIT", + "sideEffects": false, + "main": "index.js", + "module": "dist/client-account.esm.js", + "types": "dist/client-account.d.ts", + "files": [ + "index.js", + "dist" + ], + "dependencies": { + "@algolia/client-common": "4.13.0", + "@algolia/client-search": "4.13.0", + "@algolia/transporter": "4.13.0" + } +} diff --git a/node_modules/@algolia/client-analytics/dist/client-analytics.cjs.js b/node_modules/@algolia/client-analytics/dist/client-analytics.cjs.js new file mode 100644 index 0000000000..ad8292e817 --- /dev/null +++ b/node_modules/@algolia/client-analytics/dist/client-analytics.cjs.js @@ -0,0 +1,80 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var clientCommon = require('@algolia/client-common'); +var transporter = require('@algolia/transporter'); +var requesterCommon = require('@algolia/requester-common'); + +const createAnalyticsClient = options => { + const region = options.region || 'us'; + const auth = clientCommon.createAuth(clientCommon.AuthMode.WithinHeaders, options.appId, options.apiKey); + const transporter$1 = transporter.createTransporter({ + hosts: [{ url: `analytics.${region}.algolia.com` }], + ...options, + headers: { + ...auth.headers(), + ...{ 'content-type': 'application/json' }, + ...options.headers, + }, + queryParameters: { + ...auth.queryParameters(), + ...options.queryParameters, + }, + }); + const appId = options.appId; + return clientCommon.addMethods({ appId, transporter: transporter$1 }, options.methods); +}; + +const addABTest = (base) => { + return (abTest, requestOptions) => { + return base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: '2/abtests', + data: abTest, + }, requestOptions); + }; +}; + +const deleteABTest = (base) => { + return (abTestID, requestOptions) => { + return base.transporter.write({ + method: requesterCommon.MethodEnum.Delete, + path: clientCommon.encode('2/abtests/%s', abTestID), + }, requestOptions); + }; +}; + +const getABTest = (base) => { + return (abTestID, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: clientCommon.encode('2/abtests/%s', abTestID), + }, requestOptions); + }; +}; + +const getABTests = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: '2/abtests', + }, requestOptions); + }; +}; + +const stopABTest = (base) => { + return (abTestID, requestOptions) => { + return base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('2/abtests/%s/stop', abTestID), + }, requestOptions); + }; +}; + +exports.addABTest = addABTest; +exports.createAnalyticsClient = createAnalyticsClient; +exports.deleteABTest = deleteABTest; +exports.getABTest = getABTest; +exports.getABTests = getABTests; +exports.stopABTest = stopABTest; diff --git a/node_modules/@algolia/client-analytics/dist/client-analytics.d.ts b/node_modules/@algolia/client-analytics/dist/client-analytics.d.ts new file mode 100644 index 0000000000..a217fd12b4 --- /dev/null +++ b/node_modules/@algolia/client-analytics/dist/client-analytics.d.ts @@ -0,0 +1,233 @@ +import { ClientTransporterOptions } from '@algolia/client-common'; +import { CreateClient } from '@algolia/client-common'; +import { RequestOptions } from '@algolia/transporter'; +import { SearchOptions } from '@algolia/client-search'; +import { Transporter } from '@algolia/transporter'; + +export declare type ABTest = { + /** + * The ab test name. + */ + readonly name: string; + /** + * The ab test list of variants. + */ + readonly variants: readonly Variant[]; + /** + * The ab test end date, if any. + */ + readonly endAt: string; +}; + +export declare const addABTest: (base: AnalyticsClient) => (abTest: ABTest, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type AddABTestResponse = { + /** + * The ab test unique identifier. + */ + abTestID: number; + /** + * The operation task id. May be used to perform a wait task. + */ + taskID: number; + /** + * The index name where the ab test is attached to. + */ + index: string; +}; + +export declare type AnalyticsClient = { + /** + * The application id. + */ + readonly appId: string; + /** + * The underlying transporter. + */ + readonly transporter: Transporter; +}; + +export declare type AnalyticsClientOptions = { + /** + * The application id. + */ + readonly appId: string; + /** + * The api key. + */ + readonly apiKey: string; + /** + * The prefered region. + */ + readonly region?: 'de' | 'us'; +}; + +export declare const createAnalyticsClient: CreateClient; + +export declare const deleteABTest: (base: AnalyticsClient) => (abTestID: number, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type DeleteABTestResponse = { + /** + * The ab test unique identifier. + */ + abTestID: number; + /** + * The operation task id. May be used to perform a wait task. + */ + taskID: number; + /** + * The index name where the ab test was attached to. + */ + index: string; +}; + +export declare const getABTest: (base: AnalyticsClient) => (abTestID: number, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type GetABTestResponse = { + /** + * The ab test name. + */ + name: string; + /** + * The ab test status. + */ + status: string; + /** + * The ab test list of variants. + */ + variants: VariantResponse[]; + /** + * The ab test end date, if any. + */ + endAt: string; + /** + * The ab test created date, if any. + */ + createdAt: string; + /** + * The ab test updated date. + */ + updatedAt: string; + /** + * The ab test unique identifier. + */ + abTestID: number; + /** + * The ab test significance based on click data. Should be higher than 0.95 to be considered significant - no matter which variant is winning. + */ + clickSignificance: number; + /** + * + * The ab test significance based on conversion data. Should be higher than 0.95 to be considered significant - no matter which variant is winning. + */ + conversionSignificance: number; +}; + +export declare const getABTests: (base: AnalyticsClient) => (requestOptions?: (RequestOptions & GetABTestsOptions) | undefined) => Readonly>; + +export declare type GetABTestsOptions = { + /** + * The number of ab tests to skip from the biginning of the list. + */ + readonly offset?: number; + /** + * The limit of the number of ab tests returned. + */ + readonly limit?: number; +}; + +export declare type GetABTestsResponse = { + /** + * The number of ab tests within this response. + */ + count: number; + /** + * The total of ab tests. + */ + total: number; + /** + * The list of ab tests. + */ + abtests: GetABTestResponse[] | null; +}; + +export declare const stopABTest: (base: AnalyticsClient) => (abTestID: number, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type StopABTestResponse = { + /** + * The ab test unique identifier. + */ + abTestID: number; + /** + * The operation task id. May be used to perform a wait task. + */ + taskID: number; + /** + * The index name where the ab test is attached to. + */ + index: string; +}; + +export declare type Variant = { + /** + * The index name. + */ + readonly index: string; + /** + * Description of the variant. Useful when seing the results in the dashboard or via the API. + */ + readonly description?: string; + /** + * Percentage of the traffic that should be going to the variant. The sum of the percentage should be equal to 100. + */ + readonly trafficPercentage: number; + /** + * The search parameters. + */ + readonly customSearchParameters?: SearchOptions; +}; + +export declare type VariantResponse = Variant & { + /** + * Average click position for the variant. + */ + averageClickPosition?: number; + /** + * Distinct click count for the variant. + */ + clickCount?: number; + /** + * Click through rate for the variant. + */ + clickThroughRate?: number; + /** + * Click through rate for the variant. + */ + conversionCount?: number; + /** + * Distinct conversion count for the variant. + */ + conversionRate?: number; + /** + * No result count. + */ + noResultCount?: number; + /** + * Tracked search count. + */ + trackedSearchCount?: number; + /** + * Search count. + */ + searchCount?: number; + /** + * User count. + */ + userCount?: number; + /** + * The search parameters. + */ + customSearchParameters?: SearchOptions; +}; + +export { } diff --git a/node_modules/@algolia/client-analytics/dist/client-analytics.esm.js b/node_modules/@algolia/client-analytics/dist/client-analytics.esm.js new file mode 100644 index 0000000000..0c907f5808 --- /dev/null +++ b/node_modules/@algolia/client-analytics/dist/client-analytics.esm.js @@ -0,0 +1,71 @@ +import { createAuth, AuthMode, addMethods, encode } from '@algolia/client-common'; +import { createTransporter } from '@algolia/transporter'; +import { MethodEnum } from '@algolia/requester-common'; + +const createAnalyticsClient = options => { + const region = options.region || 'us'; + const auth = createAuth(AuthMode.WithinHeaders, options.appId, options.apiKey); + const transporter = createTransporter({ + hosts: [{ url: `analytics.${region}.algolia.com` }], + ...options, + headers: { + ...auth.headers(), + ...{ 'content-type': 'application/json' }, + ...options.headers, + }, + queryParameters: { + ...auth.queryParameters(), + ...options.queryParameters, + }, + }); + const appId = options.appId; + return addMethods({ appId, transporter }, options.methods); +}; + +const addABTest = (base) => { + return (abTest, requestOptions) => { + return base.transporter.write({ + method: MethodEnum.Post, + path: '2/abtests', + data: abTest, + }, requestOptions); + }; +}; + +const deleteABTest = (base) => { + return (abTestID, requestOptions) => { + return base.transporter.write({ + method: MethodEnum.Delete, + path: encode('2/abtests/%s', abTestID), + }, requestOptions); + }; +}; + +const getABTest = (base) => { + return (abTestID, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: encode('2/abtests/%s', abTestID), + }, requestOptions); + }; +}; + +const getABTests = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: '2/abtests', + }, requestOptions); + }; +}; + +const stopABTest = (base) => { + return (abTestID, requestOptions) => { + return base.transporter.write({ + method: MethodEnum.Post, + path: encode('2/abtests/%s/stop', abTestID), + }, requestOptions); + }; +}; + +export { addABTest, createAnalyticsClient, deleteABTest, getABTest, getABTests, stopABTest }; diff --git a/node_modules/@algolia/client-analytics/index.js b/node_modules/@algolia/client-analytics/index.js new file mode 100644 index 0000000000..3588503aa3 --- /dev/null +++ b/node_modules/@algolia/client-analytics/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line functional/immutable-data, import/no-commonjs +module.exports = require('./dist/client-analytics.cjs.js'); diff --git a/node_modules/@algolia/client-analytics/package.json b/node_modules/@algolia/client-analytics/package.json new file mode 100644 index 0000000000..6b1c104977 --- /dev/null +++ b/node_modules/@algolia/client-analytics/package.json @@ -0,0 +1,24 @@ +{ + "name": "@algolia/client-analytics", + "version": "4.13.0", + "private": false, + "repository": { + "type": "git", + "url": "git://github.com/algolia/algoliasearch-client-javascript.git" + }, + "license": "MIT", + "sideEffects": false, + "main": "index.js", + "module": "dist/client-analytics.esm.js", + "types": "dist/client-analytics.d.ts", + "files": [ + "index.js", + "dist" + ], + "dependencies": { + "@algolia/client-common": "4.13.0", + "@algolia/client-search": "4.13.0", + "@algolia/requester-common": "4.13.0", + "@algolia/transporter": "4.13.0" + } +} diff --git a/node_modules/@algolia/client-common/dist/client-common.cjs.js b/node_modules/@algolia/client-common/dist/client-common.cjs.js new file mode 100644 index 0000000000..12c5d8bd68 --- /dev/null +++ b/node_modules/@algolia/client-common/dist/client-common.cjs.js @@ -0,0 +1,101 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function createAuth(authMode, appId, apiKey) { + const credentials = { + 'x-algolia-api-key': apiKey, + 'x-algolia-application-id': appId, + }; + return { + headers() { + return authMode === AuthMode.WithinHeaders ? credentials : {}; + }, + queryParameters() { + return authMode === AuthMode.WithinQueryParameters ? credentials : {}; + }, + }; +} + +function createRetryablePromise(callback) { + let retriesCount = 0; // eslint-disable-line functional/no-let + const retry = () => { + retriesCount++; + return new Promise((resolve) => { + setTimeout(() => { + resolve(callback(retry)); + }, Math.min(100 * retriesCount, 1000)); + }); + }; + return callback(retry); +} + +function createWaitablePromise(promise, wait = (_response, _requestOptions) => { + return Promise.resolve(); +}) { + // eslint-disable-next-line functional/immutable-data + return Object.assign(promise, { + wait(requestOptions) { + return createWaitablePromise(promise + .then(response => Promise.all([wait(response, requestOptions), response])) + .then(promiseResults => promiseResults[1])); + }, + }); +} + +// eslint-disable-next-line functional/prefer-readonly-type +function shuffle(array) { + let c = array.length - 1; // eslint-disable-line functional/no-let + // eslint-disable-next-line functional/no-loop-statement + for (c; c > 0; c--) { + const b = Math.floor(Math.random() * (c + 1)); + const a = array[c]; + array[c] = array[b]; // eslint-disable-line functional/immutable-data, no-param-reassign + array[b] = a; // eslint-disable-line functional/immutable-data, no-param-reassign + } + return array; +} +function addMethods(base, methods) { + if (!methods) { + return base; + } + Object.keys(methods).forEach(key => { + // eslint-disable-next-line functional/immutable-data, no-param-reassign + base[key] = methods[key](base); + }); + return base; +} +function encode(format, ...args) { + // eslint-disable-next-line functional/no-let + let i = 0; + return format.replace(/%s/g, () => encodeURIComponent(args[i++])); +} + +const version = '4.13.0'; + +const destroy = (base) => { + return () => { + return base.transporter.requester.destroy(); + }; +}; + +const AuthMode = { + /** + * If auth credentials should be in query parameters. + */ + WithinQueryParameters: 0, + /** + * If auth credentials should be in headers. + */ + WithinHeaders: 1, +}; + +exports.AuthMode = AuthMode; +exports.addMethods = addMethods; +exports.createAuth = createAuth; +exports.createRetryablePromise = createRetryablePromise; +exports.createWaitablePromise = createWaitablePromise; +exports.destroy = destroy; +exports.encode = encode; +exports.shuffle = shuffle; +exports.version = version; diff --git a/node_modules/@algolia/client-common/dist/client-common.d.ts b/node_modules/@algolia/client-common/dist/client-common.d.ts new file mode 100644 index 0000000000..b45d3e5906 --- /dev/null +++ b/node_modules/@algolia/client-common/dist/client-common.d.ts @@ -0,0 +1,102 @@ +import { Headers } from '@algolia/transporter'; +import { HostOptions } from '@algolia/transporter'; +import { QueryParameters } from '@algolia/transporter'; +import { RequestOptions } from '@algolia/transporter'; +import { Transporter } from '@algolia/transporter'; +import { TransporterOptions } from '@algolia/transporter'; + +declare type AddedMethods> = TBase & { + [TKey in keyof TMethods extends string ? keyof TMethods : never]: ReturnType; +}; + +export declare function addMethods>(base: TBase, methods?: TMethods): AddedMethods; + +export declare type Auth = { + /** + * Returns the headers related to auth. Should be + * merged to the transporter headers. + */ + readonly headers: () => Readonly>; + /** + * Returns the query parameters related to auth. Should be + * merged to the query parameters headers. + */ + readonly queryParameters: () => Readonly>; +}; + +export declare const AuthMode: Readonly>; + +export declare type AuthModeType = 0 | 1; + +export declare type ClientTransporterOptions = Pick & Exclude & Exclude> & { + /** + * The hosts used by the requester. + */ + readonly hosts?: readonly HostOptions[]; + /** + * The headers used by the requester. The transporter + * layer may add some extra headers during the request + * for the user agent, and others. + */ + readonly headers?: Headers; + /** + * The query parameters used by the requester. The transporter + * layer may add some extra headers during the request + * for the user agent, and others. + */ + readonly queryParameters?: QueryParameters; +}; + +export declare function createAuth(authMode: AuthModeType, appId: string, apiKey: string): Auth; + +export declare type CreateClient = (...args: any) => any; +}>(options: TOptions & { + readonly methods?: TMethods; +}) => TClient & { + [key in keyof TMethods extends string ? keyof TMethods : never]: ReturnType; +}; + +export declare function createRetryablePromise(callback: (retry: () => Promise) => Promise): Promise; + +export declare function createWaitablePromise(promise: Readonly>, wait?: Wait): Readonly>; + +export declare const destroy: (base: { + readonly transporter: Transporter; +}) => () => Readonly>; + +export declare function encode(format: string, ...args: readonly any[]): string; + +declare type Methods = { + readonly [key: string]: (base: TBase) => (...args: any[]) => any; +}; + +export declare function shuffle(array: TData[]): TData[]; + +export declare const version = "4.13.0"; + +export declare type Wait = ( +/** + * The original response. + */ +response: TResponse, +/** + * The custom request options. + */ +requestOptions?: RequestOptions) => Readonly>; + +export declare type WaitablePromise = Readonly> & { + /** + * Wait for a task to complete before executing the next line of code, to synchronize index updates. + * + * All write operations in Algolia are asynchronous by design. It means that when you add or + * update an object to your index, our servers will reply to your request with a taskID as + * soon as they understood the write operation. The actual insert and indexing will be + * done after replying to your code. + * + * You can wait for a task to complete by using this method. + */ + readonly wait: (requestOptions?: RequestOptions) => Readonly>; +}; + +export { } diff --git a/node_modules/@algolia/client-common/dist/client-common.esm.js b/node_modules/@algolia/client-common/dist/client-common.esm.js new file mode 100644 index 0000000000..802fc640c2 --- /dev/null +++ b/node_modules/@algolia/client-common/dist/client-common.esm.js @@ -0,0 +1,89 @@ +function createAuth(authMode, appId, apiKey) { + const credentials = { + 'x-algolia-api-key': apiKey, + 'x-algolia-application-id': appId, + }; + return { + headers() { + return authMode === AuthMode.WithinHeaders ? credentials : {}; + }, + queryParameters() { + return authMode === AuthMode.WithinQueryParameters ? credentials : {}; + }, + }; +} + +function createRetryablePromise(callback) { + let retriesCount = 0; // eslint-disable-line functional/no-let + const retry = () => { + retriesCount++; + return new Promise((resolve) => { + setTimeout(() => { + resolve(callback(retry)); + }, Math.min(100 * retriesCount, 1000)); + }); + }; + return callback(retry); +} + +function createWaitablePromise(promise, wait = (_response, _requestOptions) => { + return Promise.resolve(); +}) { + // eslint-disable-next-line functional/immutable-data + return Object.assign(promise, { + wait(requestOptions) { + return createWaitablePromise(promise + .then(response => Promise.all([wait(response, requestOptions), response])) + .then(promiseResults => promiseResults[1])); + }, + }); +} + +// eslint-disable-next-line functional/prefer-readonly-type +function shuffle(array) { + let c = array.length - 1; // eslint-disable-line functional/no-let + // eslint-disable-next-line functional/no-loop-statement + for (c; c > 0; c--) { + const b = Math.floor(Math.random() * (c + 1)); + const a = array[c]; + array[c] = array[b]; // eslint-disable-line functional/immutable-data, no-param-reassign + array[b] = a; // eslint-disable-line functional/immutable-data, no-param-reassign + } + return array; +} +function addMethods(base, methods) { + if (!methods) { + return base; + } + Object.keys(methods).forEach(key => { + // eslint-disable-next-line functional/immutable-data, no-param-reassign + base[key] = methods[key](base); + }); + return base; +} +function encode(format, ...args) { + // eslint-disable-next-line functional/no-let + let i = 0; + return format.replace(/%s/g, () => encodeURIComponent(args[i++])); +} + +const version = '4.13.0'; + +const destroy = (base) => { + return () => { + return base.transporter.requester.destroy(); + }; +}; + +const AuthMode = { + /** + * If auth credentials should be in query parameters. + */ + WithinQueryParameters: 0, + /** + * If auth credentials should be in headers. + */ + WithinHeaders: 1, +}; + +export { AuthMode, addMethods, createAuth, createRetryablePromise, createWaitablePromise, destroy, encode, shuffle, version }; diff --git a/node_modules/@algolia/client-common/index.js b/node_modules/@algolia/client-common/index.js new file mode 100644 index 0000000000..ddbe0e4dc9 --- /dev/null +++ b/node_modules/@algolia/client-common/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line functional/immutable-data, import/no-commonjs +module.exports = require('./dist/client-common.cjs.js'); diff --git a/node_modules/@algolia/client-common/package.json b/node_modules/@algolia/client-common/package.json new file mode 100644 index 0000000000..c7e415ead3 --- /dev/null +++ b/node_modules/@algolia/client-common/package.json @@ -0,0 +1,22 @@ +{ + "name": "@algolia/client-common", + "version": "4.13.0", + "private": false, + "repository": { + "type": "git", + "url": "git://github.com/algolia/algoliasearch-client-javascript.git" + }, + "license": "MIT", + "sideEffects": false, + "main": "index.js", + "module": "dist/client-common.esm.js", + "types": "dist/client-common.d.ts", + "files": [ + "index.js", + "dist" + ], + "dependencies": { + "@algolia/requester-common": "4.13.0", + "@algolia/transporter": "4.13.0" + } +} diff --git a/node_modules/@algolia/client-personalization/dist/client-personalization.cjs.js b/node_modules/@algolia/client-personalization/dist/client-personalization.cjs.js new file mode 100644 index 0000000000..a497e15d7e --- /dev/null +++ b/node_modules/@algolia/client-personalization/dist/client-personalization.cjs.js @@ -0,0 +1,49 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var clientCommon = require('@algolia/client-common'); +var transporter = require('@algolia/transporter'); +var requesterCommon = require('@algolia/requester-common'); + +const createPersonalizationClient = options => { + const region = options.region || 'us'; + const auth = clientCommon.createAuth(clientCommon.AuthMode.WithinHeaders, options.appId, options.apiKey); + const transporter$1 = transporter.createTransporter({ + hosts: [{ url: `personalization.${region}.algolia.com` }], + ...options, + headers: { + ...auth.headers(), + ...{ 'content-type': 'application/json' }, + ...options.headers, + }, + queryParameters: { + ...auth.queryParameters(), + ...options.queryParameters, + }, + }); + return clientCommon.addMethods({ appId: options.appId, transporter: transporter$1 }, options.methods); +}; + +const getPersonalizationStrategy = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: '1/strategies/personalization', + }, requestOptions); + }; +}; + +const setPersonalizationStrategy = (base) => { + return (personalizationStrategy, requestOptions) => { + return base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: '1/strategies/personalization', + data: personalizationStrategy, + }, requestOptions); + }; +}; + +exports.createPersonalizationClient = createPersonalizationClient; +exports.getPersonalizationStrategy = getPersonalizationStrategy; +exports.setPersonalizationStrategy = setPersonalizationStrategy; diff --git a/node_modules/@algolia/client-personalization/dist/client-personalization.d.ts b/node_modules/@algolia/client-personalization/dist/client-personalization.d.ts new file mode 100644 index 0000000000..e9d3cfdc33 --- /dev/null +++ b/node_modules/@algolia/client-personalization/dist/client-personalization.d.ts @@ -0,0 +1,93 @@ +import { ClientTransporterOptions } from '@algolia/client-common'; +import { CreateClient } from '@algolia/client-common'; +import { RequestOptions } from '@algolia/transporter'; +import { Transporter } from '@algolia/transporter'; + +export declare const createPersonalizationClient: CreateClient; + +export declare const getPersonalizationStrategy: (base: PersonalizationClient) => (requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type GetPersonalizationStrategyResponse = { + /** + * Events scoring + */ + eventsScoring: Array<{ + eventName: string; + eventType: string; + score: number; + }>; + /** + * Facets scoring + */ + facetsScoring: Array<{ + facetName: string; + score: number; + }>; + /** + * Personalization impact + */ + personalizationImpact: number; +}; + +export declare type PersonalizationClient = { + /** + * The application id. + */ + readonly appId: string; + /** + * The underlying transporter. + */ + readonly transporter: Transporter; +}; + +export declare type PersonalizationClientOptions = { + /** + * The application id. + */ + readonly appId: string; + /** + * The api key. + */ + readonly apiKey: string; + /** + * The prefered region. + */ + readonly region?: string; +}; + +export declare type PersonalizationStrategy = { + /** + * Events scoring + */ + readonly eventsScoring: ReadonlyArray<{ + readonly eventName: string; + readonly eventType: string; + readonly score: number; + }>; + /** + * Facets scoring + */ + readonly facetsScoring: ReadonlyArray<{ + readonly facetName: string; + readonly score: number; + }>; + /** + * Personalization impact + */ + readonly personalizationImpact: number; +}; + +export declare const setPersonalizationStrategy: (base: PersonalizationClient) => (personalizationStrategy: PersonalizationStrategy, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type SetPersonalizationStrategyResponse = { + /** + * The status code. + */ + status?: number; + /** + * The message. + */ + message: string; +}; + +export { } diff --git a/node_modules/@algolia/client-personalization/dist/client-personalization.esm.js b/node_modules/@algolia/client-personalization/dist/client-personalization.esm.js new file mode 100644 index 0000000000..71d3167a9d --- /dev/null +++ b/node_modules/@algolia/client-personalization/dist/client-personalization.esm.js @@ -0,0 +1,43 @@ +import { createAuth, AuthMode, addMethods } from '@algolia/client-common'; +import { createTransporter } from '@algolia/transporter'; +import { MethodEnum } from '@algolia/requester-common'; + +const createPersonalizationClient = options => { + const region = options.region || 'us'; + const auth = createAuth(AuthMode.WithinHeaders, options.appId, options.apiKey); + const transporter = createTransporter({ + hosts: [{ url: `personalization.${region}.algolia.com` }], + ...options, + headers: { + ...auth.headers(), + ...{ 'content-type': 'application/json' }, + ...options.headers, + }, + queryParameters: { + ...auth.queryParameters(), + ...options.queryParameters, + }, + }); + return addMethods({ appId: options.appId, transporter }, options.methods); +}; + +const getPersonalizationStrategy = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: '1/strategies/personalization', + }, requestOptions); + }; +}; + +const setPersonalizationStrategy = (base) => { + return (personalizationStrategy, requestOptions) => { + return base.transporter.write({ + method: MethodEnum.Post, + path: '1/strategies/personalization', + data: personalizationStrategy, + }, requestOptions); + }; +}; + +export { createPersonalizationClient, getPersonalizationStrategy, setPersonalizationStrategy }; diff --git a/node_modules/@algolia/client-personalization/index.js b/node_modules/@algolia/client-personalization/index.js new file mode 100644 index 0000000000..df07d60ae0 --- /dev/null +++ b/node_modules/@algolia/client-personalization/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line functional/immutable-data, import/no-commonjs +module.exports = require('./dist/client-personalization.cjs.js'); diff --git a/node_modules/@algolia/client-personalization/package.json b/node_modules/@algolia/client-personalization/package.json new file mode 100644 index 0000000000..8c55518fc4 --- /dev/null +++ b/node_modules/@algolia/client-personalization/package.json @@ -0,0 +1,23 @@ +{ + "name": "@algolia/client-personalization", + "version": "4.13.0", + "private": false, + "repository": { + "type": "git", + "url": "git://github.com/algolia/algoliasearch-client-javascript.git" + }, + "license": "MIT", + "sideEffects": false, + "main": "index.js", + "module": "dist/client-personalization.esm.js", + "types": "dist/client-personalization.d.ts", + "files": [ + "index.js", + "dist" + ], + "dependencies": { + "@algolia/client-common": "4.13.0", + "@algolia/requester-common": "4.13.0", + "@algolia/transporter": "4.13.0" + } +} diff --git a/node_modules/@algolia/client-search/dist/client-search.cjs.js b/node_modules/@algolia/client-search/dist/client-search.cjs.js new file mode 100644 index 0000000000..bf73ce48d0 --- /dev/null +++ b/node_modules/@algolia/client-search/dist/client-search.cjs.js @@ -0,0 +1,1369 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var clientCommon = require('@algolia/client-common'); +var transporter = require('@algolia/transporter'); +var requesterCommon = require('@algolia/requester-common'); +var crypto = require('crypto'); + +function createBrowsablePromise(options) { + const browse = (data) => { + return options.request(data).then(response => { + /** + * First we send to the developer the + * batch retrieved from the API. + */ + if (options.batch !== undefined) { + options.batch(response.hits); + } + /** + * Then, we ask to the browse concrete implementation + * if we should stop browsing. As example, the `browseObjects` + * method will stop if the cursor is not present on the response. + */ + if (options.shouldStop(response)) { + return undefined; + } + /** + * Finally, if the response contains a cursor, we browse to the next + * batch using that same cursor. Otherwise, we just use the traditional + * browsing using the page element. + */ + if (response.cursor) { + return browse({ + cursor: response.cursor, + }); + } + return browse({ + page: (data.page || 0) + 1, + }); + }); + }; + return browse({}); +} + +const createSearchClient = options => { + const appId = options.appId; + const auth = clientCommon.createAuth(options.authMode !== undefined ? options.authMode : clientCommon.AuthMode.WithinHeaders, appId, options.apiKey); + const transporter$1 = transporter.createTransporter({ + hosts: [ + { url: `${appId}-dsn.algolia.net`, accept: transporter.CallEnum.Read }, + { url: `${appId}.algolia.net`, accept: transporter.CallEnum.Write }, + ].concat(clientCommon.shuffle([ + { url: `${appId}-1.algolianet.com` }, + { url: `${appId}-2.algolianet.com` }, + { url: `${appId}-3.algolianet.com` }, + ])), + ...options, + headers: { + ...auth.headers(), + ...{ 'content-type': 'application/x-www-form-urlencoded' }, + ...options.headers, + }, + queryParameters: { + ...auth.queryParameters(), + ...options.queryParameters, + }, + }); + const base = { + transporter: transporter$1, + appId, + addAlgoliaAgent(segment, version) { + transporter$1.userAgent.add({ segment, version }); + }, + clearCache() { + return Promise.all([ + transporter$1.requestsCache.clear(), + transporter$1.responsesCache.clear(), + ]).then(() => undefined); + }, + }; + return clientCommon.addMethods(base, options.methods); +}; + +function createMissingObjectIDError() { + return { + name: 'MissingObjectIDError', + message: 'All objects must have an unique objectID ' + + '(like a primary key) to be valid. ' + + 'Algolia is also able to generate objectIDs ' + + "automatically but *it's not recommended*. " + + "To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option.", + }; +} + +function createObjectNotFoundError() { + return { + name: 'ObjectNotFoundError', + message: 'Object not found.', + }; +} + +function createValidUntilNotFoundError() { + return { + name: 'ValidUntilNotFoundError', + message: 'ValidUntil not found in given secured api key.', + }; +} + +const addApiKey = (base) => { + return (acl, requestOptions) => { + const { queryParameters, ...options } = requestOptions || {}; + const data = { + acl, + ...(queryParameters !== undefined ? { queryParameters } : {}), + }; + const wait = (response, waitRequestOptions) => { + return clientCommon.createRetryablePromise(retry => { + return getApiKey(base)(response.key, waitRequestOptions).catch((apiError) => { + if (apiError.status !== 404) { + throw apiError; + } + return retry(); + }); + }); + }; + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: '1/keys', + data, + }, options), wait); + }; +}; + +const assignUserID = (base) => { + return (userID, clusterName, requestOptions) => { + const mappedRequestOptions = transporter.createMappedRequestOptions(requestOptions); + // eslint-disable-next-line functional/immutable-data + mappedRequestOptions.queryParameters['X-Algolia-User-ID'] = userID; + return base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: '1/clusters/mapping', + data: { cluster: clusterName }, + }, mappedRequestOptions); + }; +}; + +const assignUserIDs = (base) => { + return (userIDs, clusterName, requestOptions) => { + return base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: '1/clusters/mapping/batch', + data: { + users: userIDs, + cluster: clusterName, + }, + }, requestOptions); + }; +}; + +const clearDictionaryEntries = (base) => { + return (dictionary, requestOptions) => { + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('/1/dictionaries/%s/batch', dictionary), + data: { + clearExistingDictionaryEntries: true, + requests: { action: 'addEntry', body: [] }, + }, + }, requestOptions), (response, waitRequestOptions) => waitAppTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const copyIndex = (base) => { + return (from, to, requestOptions) => { + const wait = (response, waitRequestOptions) => { + return initIndex(base)(from, { + methods: { waitTask }, + }).waitTask(response.taskID, waitRequestOptions); + }; + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/indexes/%s/operation', from), + data: { + operation: 'copy', + destination: to, + }, + }, requestOptions), wait); + }; +}; + +const copyRules = (base) => { + return (from, to, requestOptions) => { + return copyIndex(base)(from, to, { + ...requestOptions, + scope: [ScopeEnum.Rules], + }); + }; +}; + +const copySettings = (base) => { + return (from, to, requestOptions) => { + return copyIndex(base)(from, to, { + ...requestOptions, + scope: [ScopeEnum.Settings], + }); + }; +}; + +const copySynonyms = (base) => { + return (from, to, requestOptions) => { + return copyIndex(base)(from, to, { + ...requestOptions, + scope: [ScopeEnum.Synonyms], + }); + }; +}; + +const customRequest = (base) => { + return (request, requestOptions) => { + if (request.method === requesterCommon.MethodEnum.Get) { + return base.transporter.read(request, requestOptions); + } + return base.transporter.write(request, requestOptions); + }; +}; + +const deleteApiKey = (base) => { + return (apiKey, requestOptions) => { + const wait = (_, waitRequestOptions) => { + return clientCommon.createRetryablePromise(retry => { + return getApiKey(base)(apiKey, waitRequestOptions) + .then(retry) + .catch((apiError) => { + if (apiError.status !== 404) { + throw apiError; + } + }); + }); + }; + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Delete, + path: clientCommon.encode('1/keys/%s', apiKey), + }, requestOptions), wait); + }; +}; + +const deleteDictionaryEntries = (base) => { + return (dictionary, objectIDs, requestOptions) => { + const requests = objectIDs.map(objectID => ({ + action: 'deleteEntry', + body: { objectID }, + })); + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('/1/dictionaries/%s/batch', dictionary), + data: { clearExistingDictionaryEntries: false, requests }, + }, requestOptions), (response, waitRequestOptions) => waitAppTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const generateSecuredApiKey = () => { + return (parentApiKey, restrictions) => { + const queryParameters = transporter.serializeQueryParameters(restrictions); + const securedKey = crypto.createHmac('sha256', parentApiKey) + .update(queryParameters) + .digest('hex'); + return Buffer.from(securedKey + queryParameters).toString('base64'); + }; +}; + +const getApiKey = (base) => { + return (apiKey, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: clientCommon.encode('1/keys/%s', apiKey), + }, requestOptions); + }; +}; + +const getAppTask = (base) => { + return (taskID, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: clientCommon.encode('1/task/%s', taskID.toString()), + }, requestOptions); + }; +}; + +const getDictionarySettings = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: '/1/dictionaries/*/settings', + }, requestOptions); + }; +}; + +const getLogs = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: '1/logs', + }, requestOptions); + }; +}; + +const getSecuredApiKeyRemainingValidity = () => { + return (securedApiKey) => { + const decodedString = Buffer.from(securedApiKey, 'base64').toString('ascii'); + const regex = /validUntil=(\d+)/; + const match = decodedString.match(regex); + if (match === null) { + throw createValidUntilNotFoundError(); + } + return parseInt(match[1], 10) - Math.round(new Date().getTime() / 1000); + }; +}; + +const getTopUserIDs = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: '1/clusters/mapping/top', + }, requestOptions); + }; +}; + +const getUserID = (base) => { + return (userID, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: clientCommon.encode('1/clusters/mapping/%s', userID), + }, requestOptions); + }; +}; + +const hasPendingMappings = (base) => { + return (requestOptions) => { + const { retrieveMappings, ...options } = requestOptions || {}; + if (retrieveMappings === true) { + // eslint-disable-next-line functional/immutable-data + options.getClusters = true; + } + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: '1/clusters/mapping/pending', + }, options); + }; +}; + +const initIndex = (base) => { + return (indexName, options = {}) => { + const searchIndex = { + transporter: base.transporter, + appId: base.appId, + indexName, + }; + return clientCommon.addMethods(searchIndex, options.methods); + }; +}; + +const listApiKeys = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: '1/keys', + }, requestOptions); + }; +}; + +const listClusters = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: '1/clusters', + }, requestOptions); + }; +}; + +const listIndices = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: '1/indexes', + }, requestOptions); + }; +}; + +const listUserIDs = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: '1/clusters/mapping', + }, requestOptions); + }; +}; + +const moveIndex = (base) => { + return (from, to, requestOptions) => { + const wait = (response, waitRequestOptions) => { + return initIndex(base)(from, { + methods: { waitTask }, + }).waitTask(response.taskID, waitRequestOptions); + }; + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/indexes/%s/operation', from), + data: { + operation: 'move', + destination: to, + }, + }, requestOptions), wait); + }; +}; + +const multipleBatch = (base) => { + return (requests, requestOptions) => { + const wait = (response, waitRequestOptions) => { + return Promise.all(Object.keys(response.taskID).map(indexName => { + return initIndex(base)(indexName, { + methods: { waitTask }, + }).waitTask(response.taskID[indexName], waitRequestOptions); + })); + }; + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: '1/indexes/*/batch', + data: { + requests, + }, + }, requestOptions), wait); + }; +}; + +const multipleGetObjects = (base) => { + return (requests, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Post, + path: '1/indexes/*/objects', + data: { + requests, + }, + }, requestOptions); + }; +}; + +const multipleQueries = (base) => { + return (queries, requestOptions) => { + const requests = queries.map(query => { + return { + ...query, + params: transporter.serializeQueryParameters(query.params || {}), + }; + }); + return base.transporter.read({ + method: requesterCommon.MethodEnum.Post, + path: '1/indexes/*/queries', + data: { + requests, + }, + cacheable: true, + }, requestOptions); + }; +}; + +const multipleSearchForFacetValues = (base) => { + return (queries, requestOptions) => { + return Promise.all(queries.map(query => { + const { facetName, facetQuery, ...params } = query.params; + return initIndex(base)(query.indexName, { + methods: { searchForFacetValues }, + }).searchForFacetValues(facetName, facetQuery, { + ...requestOptions, + ...params, + }); + })); + }; +}; + +const removeUserID = (base) => { + return (userID, requestOptions) => { + const mappedRequestOptions = transporter.createMappedRequestOptions(requestOptions); + // eslint-disable-next-line functional/immutable-data + mappedRequestOptions.queryParameters['X-Algolia-User-ID'] = userID; + return base.transporter.write({ + method: requesterCommon.MethodEnum.Delete, + path: '1/clusters/mapping', + }, mappedRequestOptions); + }; +}; + +const replaceDictionaryEntries = (base) => { + return (dictionary, entries, requestOptions) => { + const requests = entries.map(entry => ({ + action: 'addEntry', + body: entry, + })); + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('/1/dictionaries/%s/batch', dictionary), + data: { clearExistingDictionaryEntries: true, requests }, + }, requestOptions), (response, waitRequestOptions) => waitAppTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const restoreApiKey = (base) => { + return (apiKey, requestOptions) => { + const wait = (_, waitRequestOptions) => { + return clientCommon.createRetryablePromise(retry => { + return getApiKey(base)(apiKey, waitRequestOptions).catch((apiError) => { + if (apiError.status !== 404) { + throw apiError; + } + return retry(); + }); + }); + }; + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/keys/%s/restore', apiKey), + }, requestOptions), wait); + }; +}; + +const saveDictionaryEntries = (base) => { + return (dictionary, entries, requestOptions) => { + const requests = entries.map(entry => ({ + action: 'addEntry', + body: entry, + })); + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('/1/dictionaries/%s/batch', dictionary), + data: { clearExistingDictionaryEntries: false, requests }, + }, requestOptions), (response, waitRequestOptions) => waitAppTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const searchDictionaryEntries = (base) => { + return (dictionary, query, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('/1/dictionaries/%s/search', dictionary), + data: { + query, + }, + cacheable: true, + }, requestOptions); + }; +}; + +const searchUserIDs = (base) => { + return (query, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Post, + path: '1/clusters/mapping/search', + data: { + query, + }, + }, requestOptions); + }; +}; + +const setDictionarySettings = (base) => { + return (settings, requestOptions) => { + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Put, + path: '/1/dictionaries/*/settings', + data: settings, + }, requestOptions), (response, waitRequestOptions) => waitAppTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const updateApiKey = (base) => { + return (apiKey, requestOptions) => { + const updatedFields = Object.assign({}, requestOptions); + const { queryParameters, ...options } = requestOptions || {}; + const data = queryParameters ? { queryParameters } : {}; + const apiKeyFields = [ + 'acl', + 'indexes', + 'referers', + 'restrictSources', + 'queryParameters', + 'description', + 'maxQueriesPerIPPerHour', + 'maxHitsPerQuery', + ]; + const hasChanged = (getApiKeyResponse) => { + return Object.keys(updatedFields) + .filter((updatedField) => apiKeyFields.indexOf(updatedField) !== -1) + .every(updatedField => { + return getApiKeyResponse[updatedField] === updatedFields[updatedField]; + }); + }; + const wait = (_, waitRequestOptions) => clientCommon.createRetryablePromise(retry => { + return getApiKey(base)(apiKey, waitRequestOptions).then(getApiKeyResponse => { + return hasChanged(getApiKeyResponse) ? Promise.resolve() : retry(); + }); + }); + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Put, + path: clientCommon.encode('1/keys/%s', apiKey), + data, + }, options), wait); + }; +}; + +const waitAppTask = (base) => { + return (taskID, requestOptions) => { + return clientCommon.createRetryablePromise(retry => { + return getAppTask(base)(taskID, requestOptions).then(response => { + return response.status !== 'published' ? retry() : undefined; + }); + }); + }; +}; + +const batch = (base) => { + return (requests, requestOptions) => { + const wait = (response, waitRequestOptions) => { + return waitTask(base)(response.taskID, waitRequestOptions); + }; + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/indexes/%s/batch', base.indexName), + data: { + requests, + }, + }, requestOptions), wait); + }; +}; + +const browseObjects = (base) => { + return (requestOptions) => { + return createBrowsablePromise({ + shouldStop: response => response.cursor === undefined, + ...requestOptions, + request: (data) => base.transporter.read({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/indexes/%s/browse', base.indexName), + data, + }, requestOptions), + }); + }; +}; + +const browseRules = (base) => { + return (requestOptions) => { + const options = { + hitsPerPage: 1000, + ...requestOptions, + }; + return createBrowsablePromise({ + shouldStop: response => response.hits.length < options.hitsPerPage, + ...options, + request(data) { + return searchRules(base)('', { ...options, ...data }).then((response) => { + return { + ...response, + hits: response.hits.map(rule => { + // eslint-disable-next-line functional/immutable-data,no-param-reassign + delete rule._highlightResult; + return rule; + }), + }; + }); + }, + }); + }; +}; + +const browseSynonyms = (base) => { + return (requestOptions) => { + const options = { + hitsPerPage: 1000, + ...requestOptions, + }; + return createBrowsablePromise({ + shouldStop: response => response.hits.length < options.hitsPerPage, + ...options, + request(data) { + return searchSynonyms(base)('', { ...options, ...data }).then((response) => { + return { + ...response, + hits: response.hits.map(synonym => { + // eslint-disable-next-line functional/immutable-data,no-param-reassign + delete synonym._highlightResult; + return synonym; + }), + }; + }); + }, + }); + }; +}; + +const chunkedBatch = (base) => { + return (bodies, action, requestOptions) => { + const { batchSize, ...options } = requestOptions || {}; + const response = { + taskIDs: [], + objectIDs: [], + }; + const forEachBatch = (lastIndex = 0) => { + // eslint-disable-next-line functional/prefer-readonly-type + const bodiesChunk = []; + // eslint-disable-next-line functional/no-let + let index; + /* eslint-disable-next-line functional/no-loop-statement */ + for (index = lastIndex; index < bodies.length; index++) { + // eslint-disable-next-line functional/immutable-data + bodiesChunk.push(bodies[index]); + if (bodiesChunk.length === (batchSize || 1000)) { + break; + } + } + if (bodiesChunk.length === 0) { + return Promise.resolve(response); + } + return batch(base)(bodiesChunk.map(body => { + return { + action, + body, + }; + }), options).then(res => { + response.objectIDs = response.objectIDs.concat(res.objectIDs); // eslint-disable-line functional/immutable-data + response.taskIDs.push(res.taskID); // eslint-disable-line functional/immutable-data + index++; + return forEachBatch(index); + }); + }; + return clientCommon.createWaitablePromise(forEachBatch(), (chunkedBatchResponse, waitRequestOptions) => { + return Promise.all(chunkedBatchResponse.taskIDs.map(taskID => { + return waitTask(base)(taskID, waitRequestOptions); + })); + }); + }; +}; + +const clearObjects = (base) => { + return (requestOptions) => { + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/indexes/%s/clear', base.indexName), + }, requestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const clearRules = (base) => { + return (requestOptions) => { + const { forwardToReplicas, ...options } = requestOptions || {}; + const mappedRequestOptions = transporter.createMappedRequestOptions(options); + if (forwardToReplicas) { + mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data + } + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/indexes/%s/rules/clear', base.indexName), + }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const clearSynonyms = (base) => { + return (requestOptions) => { + const { forwardToReplicas, ...options } = requestOptions || {}; + const mappedRequestOptions = transporter.createMappedRequestOptions(options); + if (forwardToReplicas) { + mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data + } + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/indexes/%s/synonyms/clear', base.indexName), + }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const deleteBy = (base) => { + return (filters, requestOptions) => { + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/indexes/%s/deleteByQuery', base.indexName), + data: filters, + }, requestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const deleteIndex = (base) => { + return (requestOptions) => { + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Delete, + path: clientCommon.encode('1/indexes/%s', base.indexName), + }, requestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const deleteObject = (base) => { + return (objectID, requestOptions) => { + return clientCommon.createWaitablePromise(deleteObjects(base)([objectID], requestOptions).then(response => { + return { taskID: response.taskIDs[0] }; + }), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const deleteObjects = (base) => { + return (objectIDs, requestOptions) => { + const objects = objectIDs.map(objectID => { + return { objectID }; + }); + return chunkedBatch(base)(objects, BatchActionEnum.DeleteObject, requestOptions); + }; +}; + +const deleteRule = (base) => { + return (objectID, requestOptions) => { + const { forwardToReplicas, ...options } = requestOptions || {}; + const mappedRequestOptions = transporter.createMappedRequestOptions(options); + if (forwardToReplicas) { + mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data + } + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Delete, + path: clientCommon.encode('1/indexes/%s/rules/%s', base.indexName, objectID), + }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const deleteSynonym = (base) => { + return (objectID, requestOptions) => { + const { forwardToReplicas, ...options } = requestOptions || {}; + const mappedRequestOptions = transporter.createMappedRequestOptions(options); + if (forwardToReplicas) { + mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data + } + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Delete, + path: clientCommon.encode('1/indexes/%s/synonyms/%s', base.indexName, objectID), + }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const exists = (base) => { + return (requestOptions) => { + return getSettings(base)(requestOptions) + .then(() => true) + .catch(error => { + if (error.status !== 404) { + throw error; + } + return false; + }); + }; +}; + +const findAnswers = (base) => { + return (query, queryLanguages, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/answers/%s/prediction', base.indexName), + data: { + query, + queryLanguages, + }, + cacheable: true, + }, requestOptions); + }; +}; + +const findObject = (base) => { + return (callback, requestOptions) => { + const { query, paginate, ...options } = requestOptions || {}; + // eslint-disable-next-line functional/no-let + let page = 0; + const forEachPage = () => { + return search(base)(query || '', { ...options, page }).then(result => { + // eslint-disable-next-line functional/no-loop-statement + for (const [position, hit] of Object.entries(result.hits)) { + // eslint-disable-next-line promise/no-callback-in-promise + if (callback(hit)) { + return { + object: hit, + position: parseInt(position, 10), + page, + }; + } + } + page++; + // paginate if option was set and has next page + if (paginate === false || page >= result.nbPages) { + throw createObjectNotFoundError(); + } + return forEachPage(); + }); + }; + return forEachPage(); + }; +}; + +const getObject = (base) => { + return (objectID, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: clientCommon.encode('1/indexes/%s/%s', base.indexName, objectID), + }, requestOptions); + }; +}; + +const getObjectPosition = () => { + return (searchResponse, objectID) => { + // eslint-disable-next-line functional/no-loop-statement + for (const [position, hit] of Object.entries(searchResponse.hits)) { + if (hit.objectID === objectID) { + return parseInt(position, 10); + } + } + return -1; + }; +}; + +const getObjects = (base) => { + return (objectIDs, requestOptions) => { + const { attributesToRetrieve, ...options } = requestOptions || {}; + const requests = objectIDs.map(objectID => { + return { + indexName: base.indexName, + objectID, + ...(attributesToRetrieve ? { attributesToRetrieve } : {}), + }; + }); + return base.transporter.read({ + method: requesterCommon.MethodEnum.Post, + path: '1/indexes/*/objects', + data: { + requests, + }, + }, options); + }; +}; + +const getRule = (base) => { + return (objectID, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: clientCommon.encode('1/indexes/%s/rules/%s', base.indexName, objectID), + }, requestOptions); + }; +}; + +const getSettings = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: clientCommon.encode('1/indexes/%s/settings', base.indexName), + data: { + getVersion: 2, + }, + }, requestOptions); + }; +}; + +const getSynonym = (base) => { + return (objectID, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: clientCommon.encode(`1/indexes/%s/synonyms/%s`, base.indexName, objectID), + }, requestOptions); + }; +}; + +const getTask = (base) => { + return (taskID, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Get, + path: clientCommon.encode('1/indexes/%s/task/%s', base.indexName, taskID.toString()), + }, requestOptions); + }; +}; + +const partialUpdateObject = (base) => { + return (object, requestOptions) => { + return clientCommon.createWaitablePromise(partialUpdateObjects(base)([object], requestOptions).then(response => { + return { + objectID: response.objectIDs[0], + taskID: response.taskIDs[0], + }; + }), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const partialUpdateObjects = (base) => { + return (objects, requestOptions) => { + const { createIfNotExists, ...options } = requestOptions || {}; + const action = createIfNotExists + ? BatchActionEnum.PartialUpdateObject + : BatchActionEnum.PartialUpdateObjectNoCreate; + return chunkedBatch(base)(objects, action, options); + }; +}; + +const replaceAllObjects = (base) => { + return (objects, requestOptions) => { + const { safe, autoGenerateObjectIDIfNotExist, batchSize, ...options } = requestOptions || {}; + const operation = (from, to, type, operationRequestOptions) => { + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/indexes/%s/operation', from), + data: { + operation: type, + destination: to, + }, + }, operationRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; + const randomSuffix = Math.random() + .toString(36) + .substring(7); + const temporaryIndexName = `${base.indexName}_tmp_${randomSuffix}`; + const saveObjectsInTemporary = saveObjects({ + appId: base.appId, + transporter: base.transporter, + indexName: temporaryIndexName, + }); + // @ts-ignore + // eslint-disable-next-line prefer-const, functional/no-let, functional/prefer-readonly-type + let responses = []; + const copyWaitablePromise = operation(base.indexName, temporaryIndexName, 'copy', { + ...options, + scope: ['settings', 'synonyms', 'rules'], + }); + // eslint-disable-next-line functional/immutable-data + responses.push(copyWaitablePromise); + const result = (safe + ? copyWaitablePromise.wait(options) + : copyWaitablePromise) + .then(() => { + const saveObjectsWaitablePromise = saveObjectsInTemporary(objects, { + ...options, + autoGenerateObjectIDIfNotExist, + batchSize, + }); + // eslint-disable-next-line functional/immutable-data + responses.push(saveObjectsWaitablePromise); + return safe ? saveObjectsWaitablePromise.wait(options) : saveObjectsWaitablePromise; + }) + .then(() => { + const moveWaitablePromise = operation(temporaryIndexName, base.indexName, 'move', options); + // eslint-disable-next-line functional/immutable-data + responses.push(moveWaitablePromise); + return safe ? moveWaitablePromise.wait(options) : moveWaitablePromise; + }) + .then(() => Promise.all(responses)) + .then(([copyResponse, saveObjectsResponse, moveResponse]) => { + return { + objectIDs: saveObjectsResponse.objectIDs, + taskIDs: [copyResponse.taskID, ...saveObjectsResponse.taskIDs, moveResponse.taskID], + }; + }); + return clientCommon.createWaitablePromise(result, (_, waitRequestOptions) => { + return Promise.all(responses.map(response => response.wait(waitRequestOptions))); + }); + }; +}; + +const replaceAllRules = (base) => { + return (rules, requestOptions) => { + return saveRules(base)(rules, { + ...requestOptions, + clearExistingRules: true, + }); + }; +}; + +const replaceAllSynonyms = (base) => { + return (synonyms, requestOptions) => { + return saveSynonyms(base)(synonyms, { + ...requestOptions, + clearExistingSynonyms: true, + }); + }; +}; + +const saveObject = (base) => { + return (object, requestOptions) => { + return clientCommon.createWaitablePromise(saveObjects(base)([object], requestOptions).then(response => { + return { + objectID: response.objectIDs[0], + taskID: response.taskIDs[0], + }; + }), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const saveObjects = (base) => { + return (objects, requestOptions) => { + const { autoGenerateObjectIDIfNotExist, ...options } = requestOptions || {}; + const action = autoGenerateObjectIDIfNotExist + ? BatchActionEnum.AddObject + : BatchActionEnum.UpdateObject; + if (action === BatchActionEnum.UpdateObject) { + // eslint-disable-next-line functional/no-loop-statement + for (const object of objects) { + if (object.objectID === undefined) { + return clientCommon.createWaitablePromise(Promise.reject(createMissingObjectIDError())); + } + } + } + return chunkedBatch(base)(objects, action, options); + }; +}; + +const saveRule = (base) => { + return (rule, requestOptions) => { + return saveRules(base)([rule], requestOptions); + }; +}; + +const saveRules = (base) => { + return (rules, requestOptions) => { + const { forwardToReplicas, clearExistingRules, ...options } = requestOptions || {}; + const mappedRequestOptions = transporter.createMappedRequestOptions(options); + if (forwardToReplicas) { + mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data + } + if (clearExistingRules) { + mappedRequestOptions.queryParameters.clearExistingRules = 1; // eslint-disable-line functional/immutable-data + } + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/indexes/%s/rules/batch', base.indexName), + data: rules, + }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const saveSynonym = (base) => { + return (synonym, requestOptions) => { + return saveSynonyms(base)([synonym], requestOptions); + }; +}; + +const saveSynonyms = (base) => { + return (synonyms, requestOptions) => { + const { forwardToReplicas, clearExistingSynonyms, replaceExistingSynonyms, ...options } = requestOptions || {}; + const mappedRequestOptions = transporter.createMappedRequestOptions(options); + if (forwardToReplicas) { + mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data + } + if (replaceExistingSynonyms || clearExistingSynonyms) { + mappedRequestOptions.queryParameters.replaceExistingSynonyms = 1; // eslint-disable-line functional/immutable-data + } + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/indexes/%s/synonyms/batch', base.indexName), + data: synonyms, + }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const search = (base) => { + return (query, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/indexes/%s/query', base.indexName), + data: { + query, + }, + cacheable: true, + }, requestOptions); + }; +}; + +const searchForFacetValues = (base) => { + return (facetName, facetQuery, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/indexes/%s/facets/%s/query', base.indexName, facetName), + data: { + facetQuery, + }, + cacheable: true, + }, requestOptions); + }; +}; + +const searchRules = (base) => { + return (query, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/indexes/%s/rules/search', base.indexName), + data: { + query, + }, + }, requestOptions); + }; +}; + +const searchSynonyms = (base) => { + return (query, requestOptions) => { + return base.transporter.read({ + method: requesterCommon.MethodEnum.Post, + path: clientCommon.encode('1/indexes/%s/synonyms/search', base.indexName), + data: { + query, + }, + }, requestOptions); + }; +}; + +const setSettings = (base) => { + return (settings, requestOptions) => { + const { forwardToReplicas, ...options } = requestOptions || {}; + const mappedRequestOptions = transporter.createMappedRequestOptions(options); + if (forwardToReplicas) { + mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data + } + return clientCommon.createWaitablePromise(base.transporter.write({ + method: requesterCommon.MethodEnum.Put, + path: clientCommon.encode('1/indexes/%s/settings', base.indexName), + data: settings, + }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const waitTask = (base) => { + return (taskID, requestOptions) => { + return clientCommon.createRetryablePromise(retry => { + return getTask(base)(taskID, requestOptions).then(response => { + return response.status !== 'published' ? retry() : undefined; + }); + }); + }; +}; + +const ApiKeyACLEnum = { + AddObject: 'addObject', + Analytics: 'analytics', + Browser: 'browse', + DeleteIndex: 'deleteIndex', + DeleteObject: 'deleteObject', + EditSettings: 'editSettings', + ListIndexes: 'listIndexes', + Logs: 'logs', + Personalization: 'personalization', + Recommendation: 'recommendation', + Search: 'search', + SeeUnretrievableAttributes: 'seeUnretrievableAttributes', + Settings: 'settings', + Usage: 'usage', +}; + +const BatchActionEnum = { + AddObject: 'addObject', + UpdateObject: 'updateObject', + PartialUpdateObject: 'partialUpdateObject', + PartialUpdateObjectNoCreate: 'partialUpdateObjectNoCreate', + DeleteObject: 'deleteObject', + DeleteIndex: 'delete', + ClearIndex: 'clear', +}; + +const ScopeEnum = { + Settings: 'settings', + Synonyms: 'synonyms', + Rules: 'rules', +}; + +const StrategyEnum = { + None: 'none', + StopIfEnoughMatches: 'stopIfEnoughMatches', +}; + +const SynonymEnum = { + Synonym: 'synonym', + OneWaySynonym: 'oneWaySynonym', + AltCorrection1: 'altCorrection1', + AltCorrection2: 'altCorrection2', + Placeholder: 'placeholder', +}; + +exports.ApiKeyACLEnum = ApiKeyACLEnum; +exports.BatchActionEnum = BatchActionEnum; +exports.ScopeEnum = ScopeEnum; +exports.StrategyEnum = StrategyEnum; +exports.SynonymEnum = SynonymEnum; +exports.addApiKey = addApiKey; +exports.assignUserID = assignUserID; +exports.assignUserIDs = assignUserIDs; +exports.batch = batch; +exports.browseObjects = browseObjects; +exports.browseRules = browseRules; +exports.browseSynonyms = browseSynonyms; +exports.chunkedBatch = chunkedBatch; +exports.clearDictionaryEntries = clearDictionaryEntries; +exports.clearObjects = clearObjects; +exports.clearRules = clearRules; +exports.clearSynonyms = clearSynonyms; +exports.copyIndex = copyIndex; +exports.copyRules = copyRules; +exports.copySettings = copySettings; +exports.copySynonyms = copySynonyms; +exports.createBrowsablePromise = createBrowsablePromise; +exports.createMissingObjectIDError = createMissingObjectIDError; +exports.createObjectNotFoundError = createObjectNotFoundError; +exports.createSearchClient = createSearchClient; +exports.createValidUntilNotFoundError = createValidUntilNotFoundError; +exports.customRequest = customRequest; +exports.deleteApiKey = deleteApiKey; +exports.deleteBy = deleteBy; +exports.deleteDictionaryEntries = deleteDictionaryEntries; +exports.deleteIndex = deleteIndex; +exports.deleteObject = deleteObject; +exports.deleteObjects = deleteObjects; +exports.deleteRule = deleteRule; +exports.deleteSynonym = deleteSynonym; +exports.exists = exists; +exports.findAnswers = findAnswers; +exports.findObject = findObject; +exports.generateSecuredApiKey = generateSecuredApiKey; +exports.getApiKey = getApiKey; +exports.getAppTask = getAppTask; +exports.getDictionarySettings = getDictionarySettings; +exports.getLogs = getLogs; +exports.getObject = getObject; +exports.getObjectPosition = getObjectPosition; +exports.getObjects = getObjects; +exports.getRule = getRule; +exports.getSecuredApiKeyRemainingValidity = getSecuredApiKeyRemainingValidity; +exports.getSettings = getSettings; +exports.getSynonym = getSynonym; +exports.getTask = getTask; +exports.getTopUserIDs = getTopUserIDs; +exports.getUserID = getUserID; +exports.hasPendingMappings = hasPendingMappings; +exports.initIndex = initIndex; +exports.listApiKeys = listApiKeys; +exports.listClusters = listClusters; +exports.listIndices = listIndices; +exports.listUserIDs = listUserIDs; +exports.moveIndex = moveIndex; +exports.multipleBatch = multipleBatch; +exports.multipleGetObjects = multipleGetObjects; +exports.multipleQueries = multipleQueries; +exports.multipleSearchForFacetValues = multipleSearchForFacetValues; +exports.partialUpdateObject = partialUpdateObject; +exports.partialUpdateObjects = partialUpdateObjects; +exports.removeUserID = removeUserID; +exports.replaceAllObjects = replaceAllObjects; +exports.replaceAllRules = replaceAllRules; +exports.replaceAllSynonyms = replaceAllSynonyms; +exports.replaceDictionaryEntries = replaceDictionaryEntries; +exports.restoreApiKey = restoreApiKey; +exports.saveDictionaryEntries = saveDictionaryEntries; +exports.saveObject = saveObject; +exports.saveObjects = saveObjects; +exports.saveRule = saveRule; +exports.saveRules = saveRules; +exports.saveSynonym = saveSynonym; +exports.saveSynonyms = saveSynonyms; +exports.search = search; +exports.searchDictionaryEntries = searchDictionaryEntries; +exports.searchForFacetValues = searchForFacetValues; +exports.searchRules = searchRules; +exports.searchSynonyms = searchSynonyms; +exports.searchUserIDs = searchUserIDs; +exports.setDictionarySettings = setDictionarySettings; +exports.setSettings = setSettings; +exports.updateApiKey = updateApiKey; +exports.waitAppTask = waitAppTask; +exports.waitTask = waitTask; diff --git a/node_modules/@algolia/client-search/dist/client-search.d.ts b/node_modules/@algolia/client-search/dist/client-search.d.ts new file mode 100644 index 0000000000..7bc2537202 --- /dev/null +++ b/node_modules/@algolia/client-search/dist/client-search.d.ts @@ -0,0 +1,2482 @@ +import { AuthModeType } from '@algolia/client-common'; +import { ClientTransporterOptions } from '@algolia/client-common'; +import { CreateClient } from '@algolia/client-common'; +import { Request } from '@algolia/transporter'; +import { RequestOptions } from '@algolia/transporter'; +import { Transporter } from '@algolia/transporter'; +import { WaitablePromise } from '@algolia/client-common'; + +export declare const addApiKey: (base: SearchClient) => (acl: readonly ApiKeyACLType[], requestOptions?: (AddApiKeyOptions & Pick) | undefined) => Readonly>; + +export declare type AddApiKeyOptions = { + /** + * A Unix timestamp used to define the expiration date of the API key. + */ + readonly validity?: number; + /** + * Specify the maximum number of hits this API key can retrieve in one call. + * This parameter can be used to protect you from attempts at retrieving your entire index contents by massively querying the index. + */ + readonly maxHitsPerQuery?: number; + /** + * Specify the maximum number of API calls allowed from an IP address per hour. Each time an API call is performed with this key, a check is performed. + */ + readonly maxQueriesPerIPPerHour?: number; + /** + * Specify the list of targeted indices. You can target all indices starting with a prefix or ending with a suffix using the ‘*’ character. + */ + readonly indexes?: readonly string[]; + /** + * Specify the list of referers. You can target all referers starting with a prefix, ending with a suffix using the ‘*’ character. + */ + readonly referers?: readonly string[]; + /** + * Specify the list of query parameters. You can force the query parameters for a query using the url string format. + */ + readonly queryParameters?: string; + /** + * Specify a description of the API key. Used for informative purposes only. It has impact on the functionality of the API key. + */ + readonly description?: string; +}; + +export declare type AddApiKeyResponse = { + /** + * The returned api key. + */ + key: string; + /** + * Date of creation of the api key. + */ + createdAt: string; +}; + +export declare const ApiKeyACLEnum: Readonly>; + +export declare type ApiKeyACLType = 'addObject' | 'analytics' | 'browse' | 'deleteIndex' | 'deleteObject' | 'editSettings' | 'listIndexes' | 'logs' | 'personalization' | 'recommendation' | 'search' | 'seeUnretrievableAttributes' | 'settings' | 'usage'; + +export declare const assignUserID: (base: SearchClient) => (userID: string, clusterName: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type AssignUserIDResponse = { + /** + * Date of creation of the userId. + */ + createdAt: string; +}; + +export declare const assignUserIDs: (base: SearchClient) => (userIDs: readonly string[], clusterName: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type AssignUserIDsResponse = { + /** + * Date of creation of the userId + */ + createdAt: string; +}; + +export declare type AutomaticFacetFilter = { + /** + * Attribute to filter on. This must match a facet placeholder in the rule’s pattern. + */ + readonly facet: string; + /** + * Whether the filter is disjunctive (true) or conjunctive (false). + */ + readonly disjunctive?: boolean; + /** + * Score for the filter. Typically used for optional or disjunctive filters. + */ + readonly score?: number; +}; + +export declare const batch: (base: SearchIndex) => (requests: readonly BatchRequest[], requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const BatchActionEnum: Readonly>; + +export declare type BatchActionType = 'addObject' | 'updateObject' | 'partialUpdateObject' | 'partialUpdateObjectNoCreate' | 'deleteObject' | 'delete' | 'clear'; + +export declare type BatchRequest = { + /** + * The batch action. + */ + readonly action: BatchActionType; + /** + * The body of the given `action`. Note that, bodies difer + * depending of the action. + */ + readonly body: Record; +}; + +export declare type BatchResponse = { + /** + * The operation task id. May be used to perform a wait task. + */ + taskID: number; + /** + * The object ids created/updated by the batch request. + */ + objectIDs: string[]; +}; + +export declare const browseObjects: (base: SearchIndex) => (requestOptions?: (SearchOptions & BrowseOptions & RequestOptions) | undefined) => Readonly>; + +export declare type BrowseOptions = { + /** + * The callback called for each batch of objects. + */ + readonly batch?: (batch: ReadonlyArray) => any; + /** + * The callback called to determine if the browse should stop. By + * default this checks whether there's any more content to get. + */ + readonly shouldStop?: (response: BrowseResponse) => boolean; +}; + +export declare type BrowseRequestData = { + /** + * If available, should be used for browsing to the next page. + */ + readonly cursor?: string; + /** + * If cursor is not available, should be used for browsing to the next page. + */ + readonly page?: number; +}; + +export declare type BrowseResponse = { + /** + * The hits per page. + */ + hits: Array; + /** + * The cursor used for iterate on the next page. + */ + cursor?: string; +}; + +export declare const browseRules: (base: SearchIndex) => (requestOptions?: (SearchRulesOptions & BrowseOptions & RequestOptions) | undefined) => Readonly>; + +export declare const browseSynonyms: (base: SearchIndex) => (requestOptions?: (SearchSynonymsOptions & BrowseOptions & RequestOptions) | undefined) => Readonly>; + +export declare const chunkedBatch: (base: SearchIndex) => (bodies: readonly object[], action: BatchActionType, requestOptions?: (RequestOptions & ChunkOptions) | undefined) => Readonly>; + +export declare type ChunkedBatchResponse = { + /** + * The operations task ids. May be used to perform a wait task. + */ + taskIDs: number[]; + /** + * The object ids created/updated/deleted by the multiple requests. + */ + objectIDs: string[]; +}; + +export declare type ChunkOptions = { + /** + * The number of objects per batch. + */ + readonly batchSize?: number; +}; + +export declare const clearDictionaryEntries: (base: SearchClient) => (dictionary: DictionaryName, requestOptions?: (RequestOptions & DictionaryEntriesOptions) | undefined) => Readonly>; + +export declare const clearObjects: (base: SearchIndex) => (requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const clearRules: (base: SearchIndex) => (requestOptions?: (RequestOptions & ClearRulesOptions) | undefined) => Readonly>; + +export declare type ClearRulesOptions = { + /** + * If the clear rules request should be forward to replicas. + */ + readonly forwardToReplicas?: boolean; +}; + +export declare const clearSynonyms: (base: SearchIndex) => (requestOptions?: (ClearSynonymsOptions & RequestOptions) | undefined) => Readonly>; + +export declare type ClearSynonymsOptions = { + /** + * If the clear synonyms request should be forward to replicas. + */ + readonly forwardToReplicas?: boolean; +}; + +export declare type Cluster = { + /** + * The cluster name + */ + readonly clusterName: string; + /** + * Number of records in the cluster. + */ + readonly nbRecords: number; + /** + * Number of users assign to the cluster. + */ + readonly nbUserIDs: number; + /** + * Data size taken by all the users assigned to the cluster. + */ + readonly dataSize: number; +}; + +export declare type Condition = { + /** + * Query patterns are expressed as a string with a specific syntax. A pattern is a sequence of tokens. + */ + readonly pattern?: string; + /** + * Apply this rule only when the filter matches. + */ + readonly filters?: string; + /** + * is | startsWith | endsWith | contains: Whether the pattern must match the beginning or the end of the query string, or both, or none. + */ + readonly anchoring?: 'is' | 'startsWith' | 'endsWith' | 'contains'; + /** + * Rule context (format: [A-Za-z0-9_-]+). When specified, the rule is contextual and applies only when the same context is specified at query time (using the ruleContexts parameter). + * When absent, the rule is generic and always applies (provided that its other conditions are met, of course). + */ + readonly context?: string; + /** + * If set to true, alternatives make the rule to trigger on synonyms, typos and plurals. + * Note that setting ignorePlurals to false overrides this parameter. + */ + readonly alternatives?: boolean; +}; + +export declare type Consequence = { + /** + * Additional search parameters. Any valid search parameter is allowed. + */ + readonly params?: ConsequenceParams & Pick>; + /** + * Objects to promote as hits. + */ + readonly promote?: readonly ConsequencePromote[]; + /** + * Objects to hide from hits. + */ + readonly hide?: ReadonlyArray<{ + readonly objectID: string; + }>; + /** + * Whether the Query Rule should promote or not promoted items. + */ + readonly filterPromotes?: boolean; + /** + * Custom JSON object that will be appended to the userData array in the response. + * This object is not interpreted by the API. It is limited to 1kB of minified JSON. + */ + readonly userData?: any; +}; + +export declare type ConsequenceParams = { + /** + * When providing a string, it replaces the entire query string. + * When providing an object, it describes incremental edits to be made to the query string (but you can’t do both). + */ + readonly query?: ConsequenceQuery | string; + /** + * Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern. + */ + readonly automaticFacetFilters?: readonly AutomaticFacetFilter[] | readonly string[]; + /** + * Same syntax as automaticFacetFilters, but the engine treats the filters as optional. + * Behaves like optionalFilters. + */ + readonly automaticOptionalFacetFilters?: readonly AutomaticFacetFilter[] | readonly string[]; + /** + * Content defining how the search interface should be rendered. + * A default value for this can be set via settings + */ + readonly renderingContent?: Settings['renderingContent']; +}; + +export declare type ConsequencePromote = { + /** + * Unique identifier of the object to promote. + */ + readonly objectID: string; + /** + * Promoted rank for the object (zero-based). + */ + readonly position: number; +} | { + /** + * List of unique identifiers for the objects to promote. + */ + readonly objectIDs: readonly string[]; + /** + * Promoted start rank for the objects (zero-based). + */ + readonly position: number; +}; + +export declare type ConsequenceQuery = { + /** + * List of removes. + */ + readonly remove?: readonly string[]; + /** + * List of edits. + */ + readonly edits?: ReadonlyArray<{ + /** + * Type of edit. + */ + readonly type?: 'remove' | 'replace'; + /** + * Text or patterns to remove from the query string. + */ + readonly delete?: string; + /** + * Text that should be inserted in place of the removed text inside the query string. + */ + readonly insert?: string; + }>; +}; + +export declare const copyIndex: (base: SearchClient) => (from: string, to: string, requestOptions?: (CopyIndexOptions & RequestOptions) | undefined) => Readonly>; + +export declare type CopyIndexOptions = { + readonly scope?: readonly ScopeType[]; +}; + +export declare const copyRules: (base: SearchClient) => (from: string, to: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const copySettings: (base: SearchClient) => (from: string, to: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const copySynonyms: (base: SearchClient) => (from: string, to: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare function createBrowsablePromise(options: { + readonly shouldStop: (response: BrowseResponse) => boolean; + readonly request: (data: BrowseRequestData) => Readonly>>; +} & BrowseOptions): Readonly>; + +export declare type CreateIndex = (...args: any) => any; +}>(indexName: string, options?: { + readonly methods?: TMethods; +}) => SearchIndex & { + [key in keyof TMethods extends string ? keyof TMethods : never]: ReturnType; +}; + +export declare function createMissingObjectIDError(): Error; + +export declare function createObjectNotFoundError(): Error; + +export declare const createSearchClient: CreateClient; + +export declare function createValidUntilNotFoundError(): Error; + +export declare const customRequest: (base: SearchClient) => (request: Request, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const deleteApiKey: (base: SearchClient) => (apiKey: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type DeleteApiKeyResponse = { + /** + * The date when the api key was deleted. + */ + deletedAt: string; +}; + +export declare const deleteBy: (base: SearchIndex) => (filters: DeleteByFiltersOptions, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type DeleteByFiltersOptions = { + /** + * Filter the query with numeric, facet and/or tag filters. + */ + readonly filters?: string; + /** + * Filter hits by facet value. + */ + readonly facetFilters?: string | readonly string[] | ReadonlyArray; + /** + * Filter on numeric attributes. + */ + readonly numericFilters?: string | readonly string[] | ReadonlyArray; + /** + * Filter hits by tags. tagFilters is a different way of filtering, which relies on the _tags + * attribute. It uses a simpler syntax than filters. You can use it when you want to do + * simple filtering based on tags. + */ + readonly tagFilters?: string | readonly string[] | ReadonlyArray; + /** + * Search for entries around a central geolocation, enabling a geo search within a circular area. + */ + readonly aroundLatLng?: string; + /** + * Search for entries around a given location automatically computed from the requester’s IP address. + */ + readonly aroundLatLngViaIP?: boolean; + /** + * Search inside a rectangular area (in geo coordinates). + */ + readonly insideBoundingBox?: ReadonlyArray | string; + /** + * Search inside a polygon (in geo coordinates). + */ + readonly insidePolygon?: ReadonlyArray; +}; + +export declare const deleteDictionaryEntries: (base: SearchClient) => (dictionary: DictionaryName, objectIDs: readonly string[], requestOptions?: (RequestOptions & DictionaryEntriesOptions) | undefined) => Readonly>; + +export declare const deleteIndex: (base: SearchIndex) => (requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const deleteObject: (base: SearchIndex) => (objectID: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const deleteObjects: (base: SearchIndex) => (objectIDs: readonly string[], requestOptions?: (RequestOptions & ChunkOptions) | undefined) => Readonly>; + +export declare type DeleteResponse = { + /** + * The operation task id. May be used to perform a wait task. + */ + taskID: number; +}; + +export declare const deleteRule: (base: SearchIndex) => (objectID: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const deleteSynonym: (base: SearchIndex) => (objectID: string, requestOptions?: (RequestOptions & DeleteSynonymOptions) | undefined) => Readonly>; + +export declare type DeleteSynonymOptions = { + /** + * If the delete synonym request should be forward to replicas. + */ + readonly forwardToReplicas?: boolean; +}; + +export declare type DictionaryEntriesOptions = { + /** + * Array of dictionary entries + */ + readonly dictionaryEntries: readonly DictionaryEntry[]; +}; + +export declare type DictionaryEntriesResponse = { + /** + * When the given rules got saved. + */ + updatedAt: number; + /** + * The operation task id. May be used to perform a wait task. + */ + taskID: number; +}; + +export declare type DictionaryEntry = { + /** + * Unique identifier for the rule (format: [A-Za-z0-9_-]+). + */ + readonly objectID: string; + readonly language: string; + readonly word?: string; + readonly words?: readonly string[]; + readonly decomposition?: readonly string[]; + readonly state?: 'enabled' | 'disabled'; +}; + +export declare type DictionaryName = 'plurals' | 'stopwords' | 'compounds'; + +export declare type DictionarySettings = { + /** + * Disable the builtin Algolia entries for a type of dictionary per language. + */ + readonly disableStandardEntries: RequireAtLeastOne>>; +}; + +export declare const exists: (base: SearchIndex) => (requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type FacetHit = { + /** + * The value of the facet. + */ + readonly value: string; + /** + * The highlighted value. + */ + readonly highlighted: string; + /** + * The count. + */ + readonly count: number; +}; + +export declare const findAnswers: (base: SearchIndex) => (query: string, queryLanguages: readonly string[], requestOptions?: (RequestOptions & FindAnswersOptions) | undefined) => Readonly>>; + +export declare type FindAnswersOptions = { + /** + * Attributes to use for predictions. + * If using the default (["*"]), all attributes are used to find answers. + */ + readonly attributesForPrediction?: readonly string[]; + /** + * Maximum number of answers to retrieve from the Answers Engine. + * Cannot be greater than 1000. + */ + readonly nbHits?: number; + /** + * Threshold for the answers’ confidence score: + * only answers with extracts that score above this threshold are returned. + */ + readonly threshold?: number; + /** + * Whether the attribute name in which the answer was found should be returned. + * This option is expensive in processing time. + */ + readonly returnExtractAttribute?: boolean; + /** + * Algolia search parameters to use to fetch the hits. + * Can be any search parameter, except: + * - attributesToSnippet + * - hitsPerPage + * - queryType + * - naturalLanguages and associated parameters + * (removeStopWords, ignorePlurals, and removeWordsIfNoResults) + */ + readonly searchParameters?: Omit; +}; + +export declare type FindAnswersResponse = Omit, 'hits'> & { + /** + * The hits returned by the search. + * + * Hits are ordered according to the ranking or sorting of the index being queried. + */ + hits: Array>; +}; + +export declare const findObject: (base: SearchIndex) => (callback: (object: TObject & ObjectWithObjectID) => boolean, requestOptions?: (FindObjectOptions & RequestOptions) | undefined) => Readonly>>; + +export declare type FindObjectOptions = { + /** + * If the underlying find object options should paginate + * over a search method. + */ + readonly paginate?: boolean; + /** + * The query used by the underlying find object to + * find the object. + */ + readonly query?: string; +}; + +export declare type FindObjectResponse = { + /** + * The found object. + */ + object: TObject & ObjectWithObjectID; + /** + * The position where the object was found. + */ + position: number; + /** + * The page where the object was found. + */ + page: number; +}; + +export declare const generateSecuredApiKey: () => (parentApiKey: string, restrictions: SecuredApiKeyRestrictions) => string; + +export declare const getApiKey: (base: SearchClient) => (apiKey: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type GetApiKeyResponse = { + /** + * The api key value + */ + value: string; + /** + * Date of creation (Unix timestamp). + */ + createdAt: number; + /** + * List of permissions the key contains. + */ + acl: ApiKeyACLType[]; + /** + * A Unix timestamp used to define the expiration date of the API key. + */ + validity: number; + /** + * Specify the maximum number of hits this API key can retrieve in one call. + * This parameter can be used to protect you from attempts at retrieving your entire index contents by massively querying the index. + */ + maxHitsPerQuery?: number; + /** + * Specify the maximum number of API calls allowed from an IP address per hour. Each time an API call is performed with this key, a check is performed. + */ + maxQueriesPerIPPerHour?: number; + /** + * Specify the list of targeted indices. You can target all indices starting with a prefix or ending with a suffix using the ‘*’ character. + */ + indexes?: string[]; + /** + * Specify the list of referers. You can target all referers starting with a prefix, ending with a suffix using the ‘*’ character. + */ + referers?: string[]; + /** + * IPv4 network allowed to use the generated key. + * This is used for more protection against API key leaking and reuse. + * Note that you can only provide a single source, but you can specify a range of IPs (e.g., 192.168.1.0/24). + */ + restrictSources?: string; + /** + * Specify the list of query parameters. You can force the query parameters for a query using the url string format. + */ + queryParameters?: string; + /** + * Specify a description of the API key. Used for informative purposes only. It has impact on the functionality of the API key. + */ + description?: string; +}; + +export declare const getAppTask: (base: SearchClient) => (taskID: number, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const getDictionarySettings: (base: SearchClient) => (requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type GetDictionarySettingsResponse = { + /** + * Disable the builtin Algolia entries for a type of dictionary per language. + */ + readonly disableStandardEntries: RequireAtLeastOne>>; +}; + +export declare const getLogs: (base: SearchClient) => (requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type GetLogsOptions = { + /** + * The offset. + */ + readonly offset: number; + /** + * The length size. + */ + readonly length: number; +}; + +export declare type GetLogsResponse = { + /** + * The list of logs. + */ + logs: Log[]; +}; + +export declare const getObject: (base: SearchIndex) => (objectID: string, requestOptions?: (RequestOptions & GetObjectOptions) | undefined) => Readonly>; + +export declare type GetObjectOptions = { + /** + * The attributes that should come with witch object. + */ + readonly attributesToRetrieve?: readonly string[]; +}; + +export declare const getObjectPosition: () => (searchResponse: SearchResponse, objectID: string) => number; + +export declare const getObjects: (base: SearchIndex) => (objectIDs: readonly string[], requestOptions?: (RequestOptions & GetObjectsOptions) | undefined) => Readonly>>; + +export declare type GetObjectsOptions = { + /** + * The attributes that should come with witch object. + */ + readonly attributesToRetrieve?: readonly string[]; +}; + +export declare type GetObjectsResponse = { + /** + * The list of results. + */ + results: Array<(TObject & ObjectWithObjectID) | null>; +}; + +export declare const getRule: (base: SearchIndex) => (objectID: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const getSecuredApiKeyRemainingValidity: () => (securedApiKey: string) => number; + +export declare const getSettings: (base: SearchIndex) => (requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const getSynonym: (base: SearchIndex) => (objectID: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const getTask: (base: SearchIndex) => (taskID: number, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const getTopUserIDs: (base: SearchClient) => (requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type GetTopUserIDsResponse = { + /** + * Mapping of cluster names to top users. + */ + topUsers: Record; +}; + +export declare const getUserID: (base: SearchClient) => (userID: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const hasPendingMappings: (base: SearchClient) => (requestOptions?: (HasPendingMappingsOptions & RequestOptions) | undefined) => Readonly>; + +export declare type HasPendingMappingsOptions = { + /** + * If the clusters pending mapping state should be on the response. + * + * @defaultValue false + */ + readonly retrieveMappings?: boolean; + /** + * If the clusters pending mapping state should be on the response. + * + * @defaultValue false + * + * @internal + */ + readonly getClusters?: boolean; +}; + +export declare type HasPendingMappingsResponse = { + /** + * If there is any clusters with pending mapping state. + */ + pending: boolean; + /** + * Describe cluster pending (migrating, creating, deleting) mapping state. + */ + clusters?: { + [key: string]: string[]; + }; +}; + +declare type HighlightMatch = { + readonly value: string; + readonly matchLevel: 'none' | 'partial' | 'full'; + readonly matchedWords: readonly string[]; + readonly fullyHighlighted?: boolean; +}; + +export declare type HighlightResult = THit extends string | number ? HighlightMatch : { + [KAttribute in keyof THit]?: HighlightResult; +}; + +export declare type Hit = THit & { + readonly objectID: string; + readonly _highlightResult?: HighlightResult; + readonly _snippetResult?: SnippetResult; + readonly _rankingInfo?: RankingInfo; + readonly _distinctSeqID?: number; +}; + +export declare type Index = { + /** + * Index name. + */ + readonly name: string; + /** + * Index creation date. (ISO-8601 format) + */ + readonly createdAt: string; + /** + * Date of last update. (ISO-8601 format) + */ + readonly updatedAt: string; + /** + * Number of records contained in the index + */ + readonly entries: number; + /** + * Number of bytes of the index in minified format. + */ + readonly dataSize: number; + /** + * Number of bytes of the index binary file. + */ + readonly fileSize: number; + /** + * Last build time in seconds. + */ + readonly lastBuildTimeS: number; + /** + * Number of pending indexing operations. + */ + readonly numberOfPendingTasks: number; + /** + * A boolean which says whether the index has pending tasks. + */ + readonly pendingTask: boolean; + /** + * Only present if the index is a replica. + * Contains the name of the related primary index. + */ + readonly primary?: string; + /** + * Only present if the index is a primary index with replicas. + * Contains the names of all linked replicas. + */ + readonly replicas?: readonly string[]; +}; + +export declare type IndexOperationResponse = { + /** + * The operation task id. May be used to perform a wait task. + */ + taskID: number; +}; + +/** + * @deprecated please use `Index` instead of `Indice` + */ +export declare type Indice = Index; + +export declare const initIndex: (base: SearchClient) => CreateIndex; + +export declare const listApiKeys: (base: SearchClient) => (requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type ListApiKeysResponse = { + /** + * List of keys + */ + keys: GetApiKeyResponse[]; +}; + +export declare const listClusters: (base: SearchClient) => (requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type ListClustersResponse = { + /** + * List of clusters. + */ + clusters: Cluster[]; +}; + +export declare const listIndices: (base: SearchClient) => (requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type ListIndicesResponse = { + /** + * Number of pages + */ + nbPages: number; + /** + * List of index response + */ + items: Index[]; +}; + +export declare const listUserIDs: (base: SearchClient) => (requestOptions?: (ListUserIDsOptions & RequestOptions) | undefined) => Readonly>; + +export declare type ListUserIDsOptions = { + /** + * Page to fetch. + */ + readonly page?: number; + /** + * Number of users to retrieve per page. + */ + readonly hitsPerPage?: number; +}; + +export declare type ListUserIDsResponse = { + /** + * List of users id. + */ + userIDs: UserIDResponse[]; +}; + +export declare type Log = { + /** + * Timestamp in ISO-8601 format. + */ + readonly timestamp: string; + /** + * Rest type of the method. + */ + readonly method: string; + /** + * Http response code. + */ + readonly answer_code: string; + /** + * Request body. It’s truncated after 1000 characters. + */ + readonly query_body: string; + /** + * Answer body. It’s truncated after 1000 characters. + */ + readonly answer: string; + /** + * Request URL. + */ + readonly url: string; + /** + * Client ip of the call. + */ + readonly ip: string; + /** + * SHA1 ID of entry. + */ + readonly sha1: string; + /** + * Request Headers (API Key is obfuscated). + */ + readonly query_headers: string; + /** + * Number Of Api Calls + */ + readonly nb_api_calls?: string; + /** + * Processing time for the query. This does not include network time. + */ + readonly processing_time_ms: string; + /** + * Number of hits returned for the query. + */ + readonly query_nb_hits?: string; + /** + * Exhaustive flags used during the query. + */ + readonly exhaustive?: boolean; + /** + * Index name of the log + */ + readonly index?: string; + /** + * Internal queries performed for this query. + */ + readonly inner_queries: ReadonlyArray<{ + /** + * Index name of the query. + */ + readonly index_name: string; + /** + * Query ID of the query. + */ + readonly query_id?: string; + /** + * The offset of the query. + */ + readonly offset?: number; + /** + * The user token of the query. + */ + readonly user_token?: string; + }>; +}; + +export declare const moveIndex: (base: SearchClient) => (from: string, to: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const multipleBatch: (base: SearchClient) => (requests: readonly MultipleBatchRequest[], requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type MultipleBatchRequest = { + /** + * The index name where the multiple batch are going to be applied. + */ + readonly indexName: string; + /** + * The action used. + */ + readonly action: BatchActionType; + /** + * The body associated with the request. + */ + readonly body: Record; +}; + +export declare type MultipleBatchResponse = { + /** + * The list of object ids. + */ + objectIDs: string[]; + /** + * The operation task id. May be used to perform a wait task. + */ + taskID: Record; +}; + +export declare type MultipleGetObject = { + /** + * The index name. + */ + readonly indexName: string; + /** + * The object id. + */ + readonly objectID: string; + /** + * The attributes that should be returned with the object. + */ + readonly attributesToRetrieve?: readonly string[]; +}; + +export declare const multipleGetObjects: (base: SearchClient) => (requests: readonly MultipleGetObject[], requestOptions?: RequestOptions | undefined) => Readonly>>; + +export declare type MultipleGetObjectsResponse = { + /** + * The list of objects. + */ + results: Array; +}; + +export declare const multipleQueries: (base: SearchClient) => (queries: readonly MultipleQueriesQuery[], requestOptions?: (RequestOptions & MultipleQueriesOptions) | undefined) => Readonly>>; + +export declare type MultipleQueriesOptions = { + readonly strategy?: StrategyType; +}; + +export declare type MultipleQueriesQuery = SharedMultipleQueriesQuery & ({ + readonly type?: 'default'; +} | { + readonly type: 'facet'; + /** + * The facet name. + */ + readonly facet: string; + /** + * The search options. + */ + readonly params?: SharedMultipleQueriesQuery['params'] & { + /** + * The search query used to search the facet attribute. Follows the same rules for an index query: a single character, a partial word, a word, or a phrase. + */ + readonly facetQuery?: string; + }; +}); + +export declare type MultipleQueriesResponse = { + /** + * The list of results. + */ + results: Array>; +}; + +export declare const multipleSearchForFacetValues: (base: SearchClient) => (queries: readonly { + readonly indexName: string; + readonly params: SearchForFacetValuesQueryParams & SearchOptions; +}[], requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type ObjectWithObjectID = { + /** + * The object id of the object. + */ + readonly objectID: string; +}; + +export declare const partialUpdateObject: (base: SearchIndex) => (object: Record, requestOptions?: (RequestOptions & ChunkOptions & PartialUpdateObjectsOptions) | undefined) => Readonly>; + +export declare type PartialUpdateObjectResponse = { + /** + * The operation task id. May be used to perform a wait task. + */ + taskID: number; + /** + * The object id updated. + */ + objectID: string; +}; + +export declare const partialUpdateObjects: (base: SearchIndex) => (objects: readonly Record[], requestOptions?: (RequestOptions & ChunkOptions & PartialUpdateObjectsOptions) | undefined) => Readonly>; + +export declare type PartialUpdateObjectsOptions = { + /** + * If the object should be created when does not exist. + */ + readonly createIfNotExists?: boolean; +}; + +export declare type RankingInfo = { + readonly promoted: boolean; + readonly nbTypos: number; + readonly firstMatchedWord: number; + readonly proximityDistance?: number; + readonly geoDistance: number; + readonly geoPrecision?: number; + readonly nbExactWords: number; + readonly words: number; + readonly filters: number; + readonly userScore: number; + readonly matchedGeoLocation?: { + readonly lat: number; + readonly lng: number; + readonly distance: number; + }; + readonly personalization?: { + readonly filtersScore: number; + readonly rankingScore: number; + readonly score: number; + }; + readonly promotedByReRanking?: boolean; +}; + +export declare const removeUserID: (base: SearchClient) => (userID: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type RemoveUserIDResponse = { + /** + * When the given `userID` got removed. + */ + deletedAt: string; +}; + +export declare const replaceAllObjects: (base: SearchIndex) => (objects: readonly Readonly>[], requestOptions?: (ReplaceAllObjectsOptions & ChunkOptions & SaveObjectsOptions & RequestOptions) | undefined) => Readonly>; + +export declare type ReplaceAllObjectsOptions = { + /** + * If the all objects should be replaced using wait operations. Keep + * in mind that, when the `safe` option is used, the operation may + * take a little more than expected. + */ + readonly safe?: boolean; +}; + +export declare const replaceAllRules: (base: SearchIndex) => (rules: readonly Rule[], requestOptions?: (RequestOptions & SaveRulesOptions) | undefined) => Readonly>; + +export declare const replaceAllSynonyms: (base: SearchIndex) => (synonyms: readonly Synonym[], requestOptions?: (RequestOptions & Pick) | undefined) => Readonly>; + +export declare const replaceDictionaryEntries: (base: SearchClient) => (dictionary: DictionaryName, entries: readonly DictionaryEntry[], requestOptions?: (RequestOptions & DictionaryEntriesOptions) | undefined) => Readonly>; + +export declare type RequireAtLeastOne = { + [TKey in keyof TType]-?: Required> & Partial>>; +}[keyof TType]; + +export declare const restoreApiKey: (base: SearchClient) => (apiKey: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type RestoreApiKeyResponse = { + /** + * Restoration date of the API key. + */ + createdAt: string; +}; + +export declare type Rule = { + /** + * Unique identifier for the rule (format: [A-Za-z0-9_-]+). + */ + readonly objectID: string; + /** + * Condition of the rule, expressed using the following variables: pattern, anchoring, context. + * + * @deprecated This parameter is deprecated in favor of `conditions`. + */ + readonly condition?: Condition; + /** + * Conditions of the rule, expressed using the following variables: pattern, anchoring, context. + */ + readonly conditions?: readonly Condition[]; + /** + * Consequence of the rule. At least one of the following object must be used: params, promote, hide, userData. + */ + readonly consequence?: Consequence; + /** + * This field is intended for rule management purposes, in particular to ease searching for rules and presenting them to human readers. It is not interpreted by the API. + */ + readonly description?: string; + /** + * Whether the rule is enabled. Disabled rules remain in the index, but are not applied at query time. + */ + readonly enabled?: boolean; + /** + * By default, rules are permanently valid. When validity periods are specified, the rule applies only during those periods; it is ignored the rest of the time. + * The list must not be empty. + */ + readonly validity?: readonly TimeRange[]; +}; + +export declare const saveDictionaryEntries: (base: SearchClient) => (dictionary: DictionaryName, entries: readonly DictionaryEntry[], requestOptions?: (RequestOptions & DictionaryEntriesOptions) | undefined) => Readonly>; + +export declare const saveObject: (base: SearchIndex) => (object: Readonly>, requestOptions?: (RequestOptions & ChunkOptions & SaveObjectsOptions) | undefined) => Readonly>; + +export declare type SaveObjectResponse = { + /** + * The operation task id. May be used to perform a wait task. + */ + taskID: number; + /** + * The object id saved. + */ + objectID: string; +}; + +export declare const saveObjects: (base: SearchIndex) => (objects: readonly Readonly>[], requestOptions?: (RequestOptions & ChunkOptions & SaveObjectsOptions) | undefined) => Readonly>; + +export declare type SaveObjectsOptions = { + /** + * If the object id should be generated when does not exists. + */ + readonly autoGenerateObjectIDIfNotExist?: boolean; +}; + +export declare const saveRule: (base: SearchIndex) => (rule: Rule, requestOptions?: (RequestOptions & SaveRulesOptions) | undefined) => Readonly>; + +export declare type SaveRuleResponse = { + /** + * When the given rules got saved. + */ + updatedAt: number; + /** + * The operation task id. May be used to perform a wait task. + */ + taskID: number; +}; + +export declare const saveRules: (base: SearchIndex) => (rules: readonly Rule[], requestOptions?: (RequestOptions & SaveRulesOptions) | undefined) => Readonly>; + +export declare type SaveRulesOptions = { + /** + * If the saved rules should be forward to replicas. + */ + readonly forwardToReplicas?: boolean; + /** + * If the existing rules should be removed. + */ + readonly clearExistingRules?: boolean; +}; + +export declare type SaveRulesResponse = { + /** + * When the given rules got saved. + */ + updatedAt: number; + /** + * The operation task id. May be used to perform a wait task. + */ + taskID: number; +}; + +export declare const saveSynonym: (base: SearchIndex) => (synonym: Synonym, requestOptions?: (RequestOptions & SaveSynonymsOptions) | undefined) => Readonly>; + +export declare type SaveSynonymResponse = { + /** + * When the given synonyms got saved. + */ + updatedAt: number; + /** + * The operation task id. May be used to perform a wait task. + */ + taskID: number; +}; + +export declare const saveSynonyms: (base: SearchIndex) => (synonyms: readonly Synonym[], requestOptions?: (SaveSynonymsOptions & RequestOptions) | undefined) => Readonly>; + +export declare type SaveSynonymsOptions = { + /** + * If the saved synonyms should be forward to replicas. + */ + readonly forwardToReplicas?: boolean; + /** + * If the existing synonyms should be removed. + * @deprecated use clearExistingSynonyms + */ + readonly replaceExistingSynonyms?: boolean; + /** + * If the existing synonyms should be removed. + */ + readonly clearExistingSynonyms?: boolean; +}; + +export declare type SaveSynonymsResponse = { + /** + * When the given synonyms got saved. + */ + updatedAt: number; + /** + * The operation task id. May be used to perform a wait task. + */ + taskID: number; +}; + +export declare const ScopeEnum: Readonly>; + +export declare type ScopeType = 'settings' | 'synonyms' | 'rules'; + +export declare const search: (base: SearchIndex) => (query: string, requestOptions?: (RequestOptions & SearchOptions) | undefined) => Readonly>>; + +export declare type SearchClient = { + /** + * The application id. + */ + readonly appId: string; + /** + * The underlying transporter. + */ + readonly transporter: Transporter; + /** + * Mutates the transporter, adding the given user agent. + */ + readonly addAlgoliaAgent: (segment: string, version?: string) => void; + /** + * Clears both requests and responses caches. + */ + readonly clearCache: () => Readonly>; +}; + +export declare type SearchClientOptions = { + /** + * The application id. + */ + readonly appId: string; + /** + * The api key. + */ + readonly apiKey: string; + /** + * The auth mode type. In browser environments credentials may + * be passed within the headers. + */ + readonly authMode?: AuthModeType; +}; + +export declare const searchDictionaryEntries: (base: SearchClient) => (dictionary: DictionaryName, query: string, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare type SearchDictionaryEntriesResponse = { + /** + * The dictionary entries returned by the search. + */ + hits: DictionaryEntry[]; + /** + * Index of the current page (zero-based). + */ + page: number; + /** + * Number of dictionary entries matched by the query. + */ + nbHits: number; + /** + * Number of pages returned. + * + * Calculation is based on the total number of hits (nbHits) divided by the + * number of hits per page (hitsPerPage), rounded up to the nearest integer. + */ + nbPages: number; +}; + +export declare const searchForFacetValues: (base: SearchIndex) => (facetName: string, facetQuery: string, requestOptions?: (RequestOptions & SearchOptions) | undefined) => Readonly>; + +export declare type SearchForFacetValuesQueryParams = { + /** + * The facet name. + */ + readonly facetName: string; + /** + * The facet query. + */ + readonly facetQuery: string; +}; + +export declare type SearchForFacetValuesResponse = { + /** + * The list of facet hits. + */ + facetHits: FacetHit[]; + /** + * The exhaustive facets count. + */ + exhaustiveFacetsCount: boolean; + /** + * The time that the API toke the process the request. + */ + processingTimeMS?: number; +}; + +export declare type SearchIndex = { + /** + * The application id. + */ + readonly appId: string; + /** + * The index name. + */ + readonly indexName: string; + /** + * The underlying transporter. + */ + readonly transporter: Transporter; +}; + +export declare type SearchOptions = { + /** + * Create a new query with an empty search query. + */ + readonly query?: string; + /** + * Allows a search for similar objects, but the query has to be constructed on your end and included alongside an empty query. + * + * The similarQuery should be made from the tags and keywords of the relevant object. + */ + readonly similarQuery?: string; + /** + * Filter hits by facet value. + */ + readonly facetFilters?: string | readonly string[] | ReadonlyArray; + /** + * Create filters for ranking purposes, where records that match the filter are ranked highest. + */ + readonly optionalFilters?: string | readonly string[] | ReadonlyArray; + /** + * Filter on numeric attributes. + */ + readonly numericFilters?: string | readonly string[] | ReadonlyArray; + /** + * Filter hits by tags. tagFilters is a different way of filtering, which relies on the _tags + * attribute. It uses a simpler syntax than filters. You can use it when you want to do + * simple filtering based on tags. + */ + readonly tagFilters?: string | readonly string[] | ReadonlyArray; + /** + * Determines how to calculate the total score for filtering. + */ + readonly sumOrFiltersScores?: boolean; + /** + * Filter the query with numeric, facet and/or tag filters. + */ + readonly filters?: string; + /** + * Specify the page to retrieve. + */ + readonly page?: number; + /** + * Set the number of hits per page. + */ + readonly hitsPerPage?: number; + /** + * Specify the offset of the first hit to return. + */ + readonly offset?: number; + /** + * Set the number of hits to retrieve (used only with offset). + */ + readonly length?: number; + /** + * List of attributes to highlight. + */ + readonly attributesToHighlight?: readonly string[]; + /** + * List of attributes to snippet, with an optional maximum number of words to snippet. + */ + readonly attributesToSnippet?: readonly string[]; + /** + * Gives control over which attributes to retrieve and which not to retrieve. + */ + readonly attributesToRetrieve?: readonly string[]; + /** + * The HTML string to insert before the highlighted parts in all highlight and snippet results. + */ + readonly highlightPreTag?: string; + /** + * The HTML string to insert after the highlighted parts in all highlight and snippet results + */ + readonly highlightPostTag?: string; + /** + * String used as an ellipsis indicator when a snippet is truncated. + */ + readonly snippetEllipsisText?: string; + /** + * Restrict highlighting and snippeting to items that matched the query. + */ + readonly restrictHighlightAndSnippetArrays?: boolean; + /** + * Facets to retrieve. + */ + readonly facets?: readonly string[]; + /** + * Maximum number of facet values to return for each facet during a regular search. + */ + readonly maxValuesPerFacet?: number; + /** + * Force faceting to be applied after de-duplication (via the Distinct setting). + */ + readonly facetingAfterDistinct?: boolean; + /** + * Minimum number of characters a word in the query string must contain to accept matches with 1 typo + */ + readonly minWordSizefor1Typo?: number; + /** + * Minimum number of characters a word in the query string must contain to accept matches with 2 typos. + */ + readonly minWordSizefor2Typos?: number; + /** + * Whether to allow typos on numbers (“numeric tokens”) in the query string. + */ + readonly allowTyposOnNumericTokens?: boolean; + /** + * List of attributes on which you want to disable typo tolerance. + */ + readonly disableTypoToleranceOnAttributes?: readonly string[]; + /** + * Controls if and how query words are interpreted as prefixes. + */ + readonly queryType?: 'prefixLast' | 'prefixAll' | 'prefixNone'; + /** + * Selects a strategy to remove words from the query when it doesn’t match any hits. + */ + readonly removeWordsIfNoResults?: 'none' | 'lastWords' | 'firstWords' | 'allOptional'; + /** + * Enables the advanced query syntax. + */ + readonly advancedSyntax?: boolean; + /** + * AdvancedSyntaxFeatures can be exactPhrase or excludeWords + */ + readonly advancedSyntaxFeatures?: ReadonlyArray<'exactPhrase' | 'excludeWords'>; + /** + * A list of words that should be considered as optional when found in the query. + */ + readonly optionalWords?: string | readonly string[]; + /** + * List of attributes on which you want to disable the exact ranking criterion. + */ + readonly disableExactOnAttributes?: readonly string[]; + /** + * Controls how the exact ranking criterion is computed when the query contains only one word. + */ + readonly exactOnSingleWordQuery?: 'attribute' | 'none' | 'word'; + /** + * List of alternatives that should be considered an exact match by the exact ranking criterion. + */ + readonly alternativesAsExact?: ReadonlyArray<'ignorePlurals' | 'singleWordSynonym' | 'multiWordsSynonym'>; + /** + * Whether rules should be globally enabled. + */ + readonly enableRules?: boolean; + /** + * Enables contextual rules. + */ + readonly ruleContexts?: readonly string[]; + /** + * Enables de-duplication or grouping of results. + */ + readonly distinct?: boolean | number; + /** + * Whether the current query will be taken into account in the Analytics + */ + readonly analytics?: boolean; + /** + * List of tags to apply to the query in the analytics. + */ + readonly analyticsTags?: readonly string[]; + /** + * Whether to take into account an index’s synonyms for a particular search. + */ + readonly synonyms?: boolean; + /** + * Whether to highlight and snippet the original word that matches the synonym or the synonym itself. + */ + readonly replaceSynonymsInHighlight?: boolean; + /** + * Precision of the proximity ranking criterion. + */ + readonly minProximity?: number; + /** + * Choose which fields the response will contain. Applies to search and browse queries. + */ + readonly responseFields?: readonly string[]; + /** + * Maximum number of facet hits to return during a search for facet values. + */ + readonly maxFacetHits?: number; + /** + * Whether to include or exclude a query from the processing-time percentile computation. + */ + readonly percentileComputation?: boolean; + /** + * Enable the Click Analytics feature. + */ + readonly clickAnalytics?: boolean; + /** + * The `personalizationImpact` parameter sets the percentage of the impact that personalization has on ranking records. The + * value must be between 0 and 100 (inclusive). This parameter will not be taken into account if `enablePersonalization` + * is **false**. + */ + readonly personalizationImpact?: number; + /** + * Enable personalization for the query + */ + readonly enablePersonalization?: boolean; + /** + * Restricts a given query to look in only a subset of your searchable attributes. + */ + readonly restrictSearchableAttributes?: readonly string[]; + /** + * Restricts a given query to look in only a subset of your searchable attributes. + */ + readonly sortFacetValuesBy?: 'count' | 'alpha'; + /** + * Controls whether typo tolerance is enabled and how it is applied. + */ + readonly typoTolerance?: boolean | 'min' | 'strict'; + /** + * Search for entries around a central geolocation, enabling a geo search within a circular area. + */ + readonly aroundLatLng?: string; + /** + * Search for entries around a given location automatically computed from the requester’s IP address. + */ + readonly aroundLatLngViaIP?: boolean; + /** + * Search for entries around a given location automatically computed from the requester’s IP address. + */ + readonly aroundRadius?: number | 'all'; + /** + * Precision of geo search (in meters), to add grouping by geo location to the ranking formula. + */ + readonly aroundPrecision?: number | ReadonlyArray<{ + readonly from: number; + readonly value: number; + }>; + /** + * Minimum radius (in meters) used for a geo search when aroundRadius is not set. + */ + readonly minimumAroundRadius?: number; + /** + * Search inside a rectangular area (in geo coordinates). + */ + readonly insideBoundingBox?: ReadonlyArray | string; + /** + * Search inside a polygon (in geo coordinates). + */ + readonly insidePolygon?: ReadonlyArray; + /** + * Treats singular, plurals, and other forms of declensions as matching terms. + */ + readonly ignorePlurals?: boolean | readonly string[]; + /** + * Removes stop (common) words from the query before executing it. + */ + readonly removeStopWords?: boolean | readonly string[]; + /** + * List of supported languages with their associated language ISO code. + * + * Apply a set of natural language best practices such as ignorePlurals, + * removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. + */ + readonly naturalLanguages?: readonly string[]; + /** + * When true, each hit in the response contains an additional _rankingInfo object. + */ + readonly getRankingInfo?: boolean; + /** + * A user identifier. + * Format: alpha numeric string [a-zA-Z0-9_-] + * Length: between 1 and 64 characters. + */ + readonly userToken?: string; + /** + * Can be to enable or disable A/B tests at query time. + * Engine's default: true + */ + readonly enableABTest?: boolean; + /** + * Enable word segmentation (also called decompounding) at query time for + * compatible languages. For example, this turns the Dutch query + * "spaanplaatbehang" into "spaan plaat behang" to retrieve more relevant + * results. + */ + readonly decompoundQuery?: boolean; + /** + * The relevancy threshold to apply to search in a virtual index [0-100]. A Bigger + * value means fewer, but more relevant results, smaller value means more, but + * less relevant results. + */ + readonly relevancyStrictness?: number; + /** + * Whether this search should use Dynamic Re-Ranking. + * @link https://www.algolia.com/doc/guides/algolia-ai/re-ranking/ + * + * Note: You need to turn on Dynamic Re-Ranking on your index for it to have an effect on + * your search results. You can do this through the Re-Ranking page on the dashboard. + * This parameter is only used to turn off Dynamic Re-Ranking (with false) at search time. + */ + readonly enableReRanking?: boolean; + /** + * When Dynamic Re-Ranking is enabled, only records that match these filters will be impacted by Dynamic Re-Ranking. + */ + readonly reRankingApplyFilter?: string | readonly string[] | ReadonlyArray | null; +}; + +export declare type SearchResponse = { + /** + * The hits returned by the search. + * + * Hits are ordered according to the ranking or sorting of the index being queried. + */ + hits: Array>; + /** + * Index of the current page (zero-based). + */ + page: number; + /** + * Number of hits returned (used only with offset) + */ + length?: number; + /** + * The offset of the first hit to returned. + */ + offset?: number; + /** + * Number of hits matched by the query. + */ + nbHits: number; + /** + * Subset of hits selected when relevancyStrictness is applied. + */ + nbSortedHits?: number; + /** + * Number of pages returned. + * + * Calculation is based on the total number of hits (nbHits) divided by the + * number of hits per page (hitsPerPage), rounded up to the nearest integer. + */ + nbPages: number; + /** + * Maximum number of hits returned per page. + */ + hitsPerPage: number; + /** + * Time the server took to process the request, in milliseconds. This does not include network time. + */ + processingTimeMS: number; + /** + * Whether the nbHits is exhaustive (true) or approximate (false). + * + * An approximation is done when the query takes more than 50ms to be + * processed (this can happen when using complex filters on millions on records). + */ + exhaustiveNbHits: boolean; + /** + * Whether the facet count is exhaustive (true) or approximate (false). + */ + exhaustiveFacetsCount?: boolean; + /** + * A mapping of each facet name to the corresponding facet counts. + */ + facets?: Record>; + /** + * Statistics for numerical facets. + */ + facets_stats?: Record; + /** + * The query used to search. Accepts every character, and every character entered will be used in the search. + * + * An empty query can be used to fetch all records. + */ + query: string; + /** + * A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. + */ + queryAfterRemoval?: string; + /** + * A url-encoded string of all search parameters. + */ + params: string; + /** + * Unique identifier of the search query, to be sent in Insights methods. This identifier links events back to the search query it represents. + * + * Returned only if clickAnalytics is true. + */ + queryID?: string; + /** + * Used to return warnings about the query. + */ + message?: string; + /** + * The computed geo location. + * + * Format: "lat,lng", where the latitude and longitude are expressed as decimal floating point number. + */ + aroundLatLng?: string; + /** + * The automatically computed radius. + */ + automaticRadius?: string; + /** + * Actual host name of the server that processed the request. + * + * Our DNS supports automatic failover and load balancing, so this may differ from the host name used in the request. + */ + serverUsed?: string; + /** + * Index name used for the query. + */ + index?: string; + /** + * Index name used for the query. In case of AB test, the index targetted isn’t always the index used by the query. + */ + indexUsed?: string; + /** + * In case of AB test, reports the variant ID used. The variant ID is the position in the array of variants (starting at 1). + */ + abTestVariantID?: number; + /** + * The query string that will be searched, after normalization. + */ + parsedQuery?: string; + /** + * Custom user data. + */ + userData?: any; + /** + * Rules applied to the query. + */ + appliedRules?: Array>; + /** + * The explanation of the decompounding at query time. + */ + explain?: { + /** + * The explain query match. + */ + match: { + /** + * The explain query match alternatives. + */ + alternatives: Array<{ + /** + * The alternative type. + */ + types: string[]; + /** + * The list of alternative words. + */ + words: string[]; + /** + * The number of typos. + */ + typos: number; + /** + * The offset. + */ + offset: number; + /** + * The length. + */ + length: number; + }>; + }; + /** + * Query parameter reporting. Parameters are reported + * as a JSON object with one field per parameter. + */ + params?: Record; + }; + /** + * The relevancy threshold applied to search in a virtual index. + */ + appliedRelevancyStrictness?: number; + renderingContent?: Settings['renderingContent']; +}; + +export declare const searchRules: (base: SearchIndex) => (query: string, requestOptions?: (RequestOptions & SearchRulesOptions) | undefined) => Readonly>>; + +export declare type SearchRulesOptions = { + /** + * Full text query. + */ + readonly query?: string; + /** + * When specified, restricts matches to rules with a specific anchoring type. When omitted, all anchoring types may match. + */ + readonly anchoring?: string; + /** + * Restricts matches to contextual rules with a specific context (exact match). + */ + readonly context?: string; + /** + * Requested page (zero-based). + */ + readonly page?: number; + /** + * Maximum number of hits in a page. Minimum is 1, maximum is 1000. + */ + readonly hitsPerPage?: number; + /** + * When specified, restricts matches to rules with a specific enabled status. + * When absent (default), all rules are retrieved, regardless of their enabled status. + */ + readonly enabled?: boolean; +}; + +export declare const searchSynonyms: (base: SearchIndex) => (query: string, requestOptions?: (SearchSynonymsOptions & RequestOptions) | undefined) => Readonly>; + +export declare type SearchSynonymsOptions = { + /** + * The synonym type. + */ + readonly type?: string; + /** + * Page to retrieve. + */ + readonly page?: number; + /** + * Number of hits per page. + */ + readonly hitsPerPage?: number; +}; + +export declare type SearchSynonymsResponse = { + /** + * The list of synonyms. + */ + hits: Synonym[]; + /** + * The number of synonyms on the list. + */ + nbHits: number; +}; + +export declare const searchUserIDs: (base: SearchClient) => (query: string, requestOptions?: (SearchUserIDsOptions & RequestOptions) | undefined) => Readonly>; + +export declare type SearchUserIDsOptions = { + /** + * If specified, only clusters assigned to this cluster can be returned. + * */ + readonly cluster?: string; + /** + * Page to fetch. + */ + readonly page?: number; + /** + * Number of users to return by page. + */ + readonly hitsPerPage?: number; +}; + +export declare type SearchUserIDsResponse = { + /** + * List of userID matching the query. + */ + hits: UserIDResponse[]; + /** + * Current page. + */ + page: number; + /** + * Number of userIDs matching the query. + */ + nbHits: number; + /** + * Number of hits retrieved per page. + */ + hitsPerPage: number; + /** + * Timestamp of the last update of the index. + */ + updatedAt: number; +}; + +export declare type SecuredApiKeyRestrictions = SearchOptions & { + /** + * A Unix timestamp used to define the expiration date of the API key. + */ + readonly validUntil?: number; + /** + * List of index names that can be queried. + */ + readonly restrictIndices?: readonly string[] | string; + /** + * IPv4 network allowed to use the generated key. This is used for more protection against API key leaking and reuse. + */ + readonly restrictSources?: string; + /** + * Specify a user identifier. This is often used with rate limits. + */ + readonly userToken?: string; +}; + +export declare const setDictionarySettings: (base: SearchClient) => (settings: DictionarySettings, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const setSettings: (base: SearchIndex) => (settings: Settings, requestOptions?: (RequestOptions & SetSettingsOptions) | undefined) => Readonly>; + +export declare type SetSettingsOptions = { + /** + * If the saved settings should be forward to replicas. + */ + readonly forwardToReplicas?: boolean; +}; + +export declare type SetSettingsResponse = { + /** + * The operation task id. May be used to perform a wait task. + */ + taskID: number; + /** + * When the settings got updated. + */ + updatedAt: number; +}; + +export declare type Settings = { + /** + * The complete list of attributes that will be used for searching. + */ + readonly searchableAttributes?: readonly string[]; + /** + * @deprecated Use `searchableAttributes` instead. + */ + readonly attributesToIndex?: readonly string[]; + /** + * The complete list of attributes that will be used for faceting. + */ + readonly attributesForFaceting?: readonly string[]; + /** + * List of attributes that cannot be retrieved at query time. + */ + readonly unretrievableAttributes?: readonly string[]; + /** + * Gives control over which attributes to retrieve and which not to retrieve. + */ + readonly attributesToRetrieve?: readonly string[]; + /** + * Controls the way results are sorted. + */ + readonly ranking?: readonly string[]; + /** + * Specifies the custom ranking criterion. + */ + readonly customRanking?: readonly string[]; + /** + * Creates replicas, exact copies of an index. + */ + readonly replicas?: readonly string[]; + /** + * @deprecated Use `replicas` instead. + */ + readonly slaves?: readonly string[]; + /** + * The primary parameter is automatically added to a replica's settings when the replica is created and cannot be modified. + * + * Can not be setted. + */ + readonly primary?: string; + /** + * Maximum number of facet values to return for each facet during a regular search. + */ + readonly maxValuesPerFacet?: number; + /** + * Controls how facet values are sorted. + */ + readonly sortFacetValuesBy?: 'count' | 'alpha'; + /** + * List of attributes to highlight. + */ + readonly attributesToHighlight?: readonly string[]; + /** + * List of attributes to snippet, with an optional maximum number of words to snippet. + */ + readonly attributesToSnippet?: readonly string[]; + /** + * The HTML string to insert before the highlighted parts in all highlight and snippet results. + */ + readonly highlightPreTag?: string; + /** + * The HTML string to insert after the highlighted parts in all highlight and snippet results. + */ + readonly highlightPostTag?: string; + /** + * String used as an ellipsis indicator when a snippet is truncated. + */ + readonly snippetEllipsisText?: string; + /** + * Restrict highlighting and snippeting to items that matched the query. + */ + readonly restrictHighlightAndSnippetArrays?: boolean; + /** + * Set the number of hits per page. + */ + readonly hitsPerPage?: number; + /** + * Set the maximum number of hits accessible via pagination. + */ + readonly paginationLimitedTo?: number; + /** + * Minimum number of characters a word in the query string must contain to accept matches with 1 typo. + */ + readonly minWordSizefor1Typo?: number; + /** + * Minimum number of characters a word in the query string must contain to accept matches with 2 typos. + */ + readonly minWordSizefor2Typos?: number; + /** + * Controls whether typo tolerance is enabled and how it is applied. + */ + readonly typoTolerance?: string | boolean; + /** + * hether to allow typos on numbers (“numeric tokens”) in the query string. + */ + readonly allowTyposOnNumericTokens?: boolean; + /** + * List of attributes on which you want to disable typo tolerance. + */ + readonly disableTypoToleranceOnAttributes?: readonly string[]; + /** + * List of words on which you want to disable typo tolerance. + */ + readonly disableTypoToleranceOnWords?: readonly string[]; + /** + * Control which separators are indexed. + */ + readonly separatorsToIndex?: string; + /** + * Treats singular, plurals, and other forms of declensions as matching terms. + */ + readonly ignorePlurals?: readonly string[] | boolean; + /** + * Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. + */ + readonly queryLanguages?: readonly string[]; + /** + * A list of language ISO code. + */ + readonly indexLanguages?: readonly string[]; + /** + * Whether rules should be globally enabled. + */ + readonly enableRules?: boolean; + /** + * Controls if and how query words are interpreted as prefixes. + */ + readonly queryType?: 'prefixLast' | 'prefixAll' | 'prefixNone'; + /** + * Selects a strategy to remove words from the query when it doesn’t match any hits. + */ + readonly removeWordsIfNoResults?: 'none' | 'lastWords' | 'firstWords' | 'allOptional'; + /** + * Enables the advanced query syntax. + */ + readonly advancedSyntax?: boolean; + /** + * AdvancedSyntaxFeatures can be exactPhrase or excludeWords + */ + readonly advancedSyntaxFeatures?: ReadonlyArray<'exactPhrase' | 'excludeWords'>; + /** + * A list of words that should be considered as optional when found in the query. + */ + readonly optionalWords?: readonly string[]; + /** + * List of attributes on which you want to disable prefix matching. + */ + readonly disablePrefixOnAttributes?: readonly string[]; + /** + * List of attributes on which you want to disable the exact ranking criterion. + */ + readonly disableExactOnAttributes?: readonly string[]; + /** + * Controls how the exact ranking criterion is computed when the query contains only one word. + */ + readonly exactOnSingleWordQuery?: 'attribute' | 'none' | 'word'; + /** + * List of alternatives that should be considered an exact match by the exact ranking criterion. + */ + readonly alternativesAsExact?: ReadonlyArray<'ignorePlurals' | 'singleWordSynonym' | 'multiWordsSynonym'>; + /** + * Removes stop (common) words from the query before executing it. + */ + readonly removeStopWords?: boolean | readonly string[]; + /** + * List of numeric attributes that can be used as numerical filters. + */ + readonly numericAttributesForFiltering?: readonly string[]; + /** + * Enables compression of large integer arrays. + */ + readonly allowCompressionOfIntegerArray?: boolean; + /** + * Name of the de-duplication attribute to be used with the distinct feature. + */ + readonly attributeForDistinct?: string; + /** + * Enables de-duplication or grouping of results. + */ + readonly distinct?: boolean | number; + /** + * Whether to highlight and snippet the original word that matches the synonym or the synonym itself. + */ + readonly replaceSynonymsInHighlight?: boolean; + /** + * Allows proximity to impact which searchable attribute is matched in the attribute ranking stage. + */ + readonly attributeCriteriaComputedByMinProximity?: boolean; + /** + * Precision of the proximity ranking criterion. + */ + readonly minProximity?: number; + /** + * Choose which fields the response will contain. Applies to search and browse queries. + */ + readonly responseFields?: readonly string[]; + /** + * Maximum number of facet hits to return during a search for facet values. + */ + readonly maxFacetHits?: number; + /** + * List of attributes on which to do a decomposition of camel case words. + */ + readonly camelCaseAttributes?: readonly string[]; + /** + * Specify on which attributes in your index Algolia should apply word-splitting (“decompounding”) + */ + readonly decompoundedAttributes?: Readonly>; + /** + * Characters that should not be automatically normalized by the search engine. + */ + readonly keepDiacriticsOnCharacters?: string; + /** + * Overrides Algolia's default normalization. + */ + readonly customNormalization?: Readonly>>>; + /** + * Enable personalization for queries by default + */ + readonly enablePersonalization?: boolean; + /** + * Custom userData that could be added to the Settings. + */ + readonly userData?: any; + /** + * Enable word segmentation (also called decompounding) at query time for + * compatible languages. For example, this turns the Dutch query + * "spaanplaatbehang" into "spaan plaat behang" to retrieve more relevant + * results. + */ + readonly decompoundQuery?: boolean; + /** + * Specify on which attributes in your index Algolia should apply Japanese + * transliteration to make words indexed in Katakana or Kanji searchable in Hiragana. + */ + readonly attributesToTransliterate?: readonly string[]; + /** + * The relevancy threshold to apply to search in a virtual index [0-100]. A Bigger + * value means fewer, but more relevant results, smaller value means more, but + * less relevant results. + */ + readonly relevancyStrictness?: number; + /** + * Content defining how the search interface should be rendered. + * This is set via the settings for a default value and can be overridden via rules + */ + readonly renderingContent?: { + /** + * defining how facets should be ordered + */ + readonly facetOrdering?: { + /** + * the ordering of facets (widgets) + */ + readonly facets?: { + /** + * pinned order of facet lists + */ + readonly order?: readonly string[]; + }; + /** + * the ordering of facet values, within an individual list + */ + readonly values?: { + readonly [facet: string]: { + /** + * pinned order of facet values + */ + readonly order?: readonly string[]; + /** + * How to display the remaining items. + * - facet count (descending) + * - alphabetical (ascending) + * - hidden (show only pinned values) + */ + readonly sortRemainingBy?: 'count' | 'alpha' | 'hidden'; + }; + }; + }; + }; + /** + * Whether this index should use Dynamic Re-Ranking. + * @link https://www.algolia.com/doc/guides/algolia-ai/re-ranking/ + * + * Note: You need to turn on Dynamic Re-Ranking on your index for it to have an effect on + * your search results. You can do this through the Re-Ranking page on the dashboard. + */ + readonly enableReRanking?: boolean; + /** + * When Dynamic Re-Ranking is enabled, only records that match these filters will be impacted by Dynamic Re-Ranking. + */ + readonly reRankingApplyFilter?: string | readonly string[] | ReadonlyArray | null; +}; + +declare type SharedMultipleQueriesQuery = { + /** + * The type of query to perform. + * + * @defaultValue "default" + */ + readonly type?: 'default' | 'facet'; + /** + * The index name. + */ + readonly indexName: string; + /** + * The search options. + */ + readonly params?: SearchOptions; + /** + * The query associated with the request. + */ + readonly query?: string; +}; + +declare type SnippetMatch = { + readonly value: string; + readonly matchLevel: 'none' | 'partial' | 'full'; +}; + +export declare type SnippetResult = THit extends string | number ? SnippetMatch : { + [KAttribute in keyof THit]: SnippetResult; +}; + +export declare const StrategyEnum: Readonly>; + +export declare type StrategyType = 'none' | 'stopIfEnoughMatches'; + +export declare type Synonym = { + /** + * Synonym object ID. + */ + readonly objectID: string; + /** + * There are 4 synonym types. The parameter can be one of the following value. + */ + readonly type: SynonymType; + /** + * A list of synonyms. + */ + readonly synonyms?: readonly string[]; + /** + * Defines the synonym. A word or expression, used as the basis for the array of synonyms. + */ + readonly input?: string; + /** + * A single word, used as the basis for the below array of corrections. + */ + readonly word?: string; + /** + * An list of corrections of the word. + */ + readonly corrections?: readonly string[]; + /** + * A single word, used as the basis for the below list of replacements. + */ + readonly placeholder?: string; + /** + * An list of replacements of the placeholder. + */ + readonly replacements?: readonly string[]; +}; + +export declare const SynonymEnum: Readonly>; + +export declare type SynonymType = 'synonym' | 'oneWaySynonym' | 'altCorrection1' | 'altCorrection2' | 'placeholder'; + +export declare type TaskStatusResponse = { + /** + * The operation status. When the value is `published` the + * operation is completed. + */ + status: string; + /** + * If the operation is pending. + */ + pendingTask: boolean; +}; + +export declare type TimeRange = { + /** + * DateTime with UTC offset for Serialization/Deserialization in unix timespan. + */ + readonly from: number; + /** + * DateTime with UTC offset for Serialization/Deserialization in unix timespan. + */ + readonly until: number; +}; + +export declare const updateApiKey: (base: SearchClient) => (apiKey: string, requestOptions?: (UpdateApiKeyOptions & Pick) | undefined) => Readonly>; + +export declare type UpdateApiKeyOptions = { + /** + * List of permissions the key contains. + */ + readonly acl?: readonly ApiKeyACLType[]; + /** + * A Unix timestamp used to define the expiration date of the API key. + */ + readonly validity?: number; + /** + * Specify the maximum number of hits this API key can retrieve in one call. + * This parameter can be used to protect you from attempts at retrieving your entire index contents by massively querying the index. + */ + readonly maxHitsPerQuery?: number; + /** + * Specify the maximum number of API calls allowed from an IP address per hour. Each time an API call is performed with this key, a check is performed. + */ + readonly maxQueriesPerIPPerHour?: number; + /** + * Specify the list of targeted indices. You can target all indices starting with a prefix or ending with a suffix using the ‘*’ character. + */ + readonly indexes?: readonly string[]; + /** + * Specify the list of referers. You can target all referers starting with a prefix, ending with a suffix using the ‘*’ character. + */ + readonly referers?: readonly string[]; + /** + * Specify the list of query parameters. You can force the query parameters for a query using the url string format. + */ + readonly queryParameters?: string; + /** + * Specify a description of the API key. Used for informative purposes only. It has impact on the functionality of the API key. + */ + readonly description?: string; +}; + +export declare type UpdateApiKeyResponse = { + /** + * The api key. + */ + key: string; + /** + * Date of update + */ + updatedAt: string; +}; + +export declare type UserIDResponse = { + /** + * userID of the user. + */ + userID: string; + /** + * Cluster on which the user is assigned + */ + clusterName: string; + /** + * Number of records belonging to the user. + */ + nbRecords: number; + /** + * Data size used by the user. + */ + dataSize: number; +}; + +export declare const waitAppTask: (base: SearchClient) => (taskID: number, requestOptions?: RequestOptions | undefined) => Readonly>; + +export declare const waitTask: (base: SearchIndex) => (taskID: number, requestOptions?: RequestOptions | undefined) => Readonly>; + +export { } diff --git a/node_modules/@algolia/client-search/dist/client-search.esm.js b/node_modules/@algolia/client-search/dist/client-search.esm.js new file mode 100644 index 0000000000..78b157aa7c --- /dev/null +++ b/node_modules/@algolia/client-search/dist/client-search.esm.js @@ -0,0 +1,1276 @@ +import { createAuth, AuthMode, shuffle, addMethods, createWaitablePromise, createRetryablePromise, encode } from '@algolia/client-common'; +import { createTransporter, CallEnum, createMappedRequestOptions, serializeQueryParameters } from '@algolia/transporter'; +import { MethodEnum } from '@algolia/requester-common'; +import { createHmac } from 'crypto'; + +function createBrowsablePromise(options) { + const browse = (data) => { + return options.request(data).then(response => { + /** + * First we send to the developer the + * batch retrieved from the API. + */ + if (options.batch !== undefined) { + options.batch(response.hits); + } + /** + * Then, we ask to the browse concrete implementation + * if we should stop browsing. As example, the `browseObjects` + * method will stop if the cursor is not present on the response. + */ + if (options.shouldStop(response)) { + return undefined; + } + /** + * Finally, if the response contains a cursor, we browse to the next + * batch using that same cursor. Otherwise, we just use the traditional + * browsing using the page element. + */ + if (response.cursor) { + return browse({ + cursor: response.cursor, + }); + } + return browse({ + page: (data.page || 0) + 1, + }); + }); + }; + return browse({}); +} + +const createSearchClient = options => { + const appId = options.appId; + const auth = createAuth(options.authMode !== undefined ? options.authMode : AuthMode.WithinHeaders, appId, options.apiKey); + const transporter = createTransporter({ + hosts: [ + { url: `${appId}-dsn.algolia.net`, accept: CallEnum.Read }, + { url: `${appId}.algolia.net`, accept: CallEnum.Write }, + ].concat(shuffle([ + { url: `${appId}-1.algolianet.com` }, + { url: `${appId}-2.algolianet.com` }, + { url: `${appId}-3.algolianet.com` }, + ])), + ...options, + headers: { + ...auth.headers(), + ...{ 'content-type': 'application/x-www-form-urlencoded' }, + ...options.headers, + }, + queryParameters: { + ...auth.queryParameters(), + ...options.queryParameters, + }, + }); + const base = { + transporter, + appId, + addAlgoliaAgent(segment, version) { + transporter.userAgent.add({ segment, version }); + }, + clearCache() { + return Promise.all([ + transporter.requestsCache.clear(), + transporter.responsesCache.clear(), + ]).then(() => undefined); + }, + }; + return addMethods(base, options.methods); +}; + +function createMissingObjectIDError() { + return { + name: 'MissingObjectIDError', + message: 'All objects must have an unique objectID ' + + '(like a primary key) to be valid. ' + + 'Algolia is also able to generate objectIDs ' + + "automatically but *it's not recommended*. " + + "To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option.", + }; +} + +function createObjectNotFoundError() { + return { + name: 'ObjectNotFoundError', + message: 'Object not found.', + }; +} + +function createValidUntilNotFoundError() { + return { + name: 'ValidUntilNotFoundError', + message: 'ValidUntil not found in given secured api key.', + }; +} + +const addApiKey = (base) => { + return (acl, requestOptions) => { + const { queryParameters, ...options } = requestOptions || {}; + const data = { + acl, + ...(queryParameters !== undefined ? { queryParameters } : {}), + }; + const wait = (response, waitRequestOptions) => { + return createRetryablePromise(retry => { + return getApiKey(base)(response.key, waitRequestOptions).catch((apiError) => { + if (apiError.status !== 404) { + throw apiError; + } + return retry(); + }); + }); + }; + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: '1/keys', + data, + }, options), wait); + }; +}; + +const assignUserID = (base) => { + return (userID, clusterName, requestOptions) => { + const mappedRequestOptions = createMappedRequestOptions(requestOptions); + // eslint-disable-next-line functional/immutable-data + mappedRequestOptions.queryParameters['X-Algolia-User-ID'] = userID; + return base.transporter.write({ + method: MethodEnum.Post, + path: '1/clusters/mapping', + data: { cluster: clusterName }, + }, mappedRequestOptions); + }; +}; + +const assignUserIDs = (base) => { + return (userIDs, clusterName, requestOptions) => { + return base.transporter.write({ + method: MethodEnum.Post, + path: '1/clusters/mapping/batch', + data: { + users: userIDs, + cluster: clusterName, + }, + }, requestOptions); + }; +}; + +const clearDictionaryEntries = (base) => { + return (dictionary, requestOptions) => { + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: encode('/1/dictionaries/%s/batch', dictionary), + data: { + clearExistingDictionaryEntries: true, + requests: { action: 'addEntry', body: [] }, + }, + }, requestOptions), (response, waitRequestOptions) => waitAppTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const copyIndex = (base) => { + return (from, to, requestOptions) => { + const wait = (response, waitRequestOptions) => { + return initIndex(base)(from, { + methods: { waitTask }, + }).waitTask(response.taskID, waitRequestOptions); + }; + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: encode('1/indexes/%s/operation', from), + data: { + operation: 'copy', + destination: to, + }, + }, requestOptions), wait); + }; +}; + +const copyRules = (base) => { + return (from, to, requestOptions) => { + return copyIndex(base)(from, to, { + ...requestOptions, + scope: [ScopeEnum.Rules], + }); + }; +}; + +const copySettings = (base) => { + return (from, to, requestOptions) => { + return copyIndex(base)(from, to, { + ...requestOptions, + scope: [ScopeEnum.Settings], + }); + }; +}; + +const copySynonyms = (base) => { + return (from, to, requestOptions) => { + return copyIndex(base)(from, to, { + ...requestOptions, + scope: [ScopeEnum.Synonyms], + }); + }; +}; + +const customRequest = (base) => { + return (request, requestOptions) => { + if (request.method === MethodEnum.Get) { + return base.transporter.read(request, requestOptions); + } + return base.transporter.write(request, requestOptions); + }; +}; + +const deleteApiKey = (base) => { + return (apiKey, requestOptions) => { + const wait = (_, waitRequestOptions) => { + return createRetryablePromise(retry => { + return getApiKey(base)(apiKey, waitRequestOptions) + .then(retry) + .catch((apiError) => { + if (apiError.status !== 404) { + throw apiError; + } + }); + }); + }; + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Delete, + path: encode('1/keys/%s', apiKey), + }, requestOptions), wait); + }; +}; + +const deleteDictionaryEntries = (base) => { + return (dictionary, objectIDs, requestOptions) => { + const requests = objectIDs.map(objectID => ({ + action: 'deleteEntry', + body: { objectID }, + })); + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: encode('/1/dictionaries/%s/batch', dictionary), + data: { clearExistingDictionaryEntries: false, requests }, + }, requestOptions), (response, waitRequestOptions) => waitAppTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const generateSecuredApiKey = () => { + return (parentApiKey, restrictions) => { + const queryParameters = serializeQueryParameters(restrictions); + const securedKey = createHmac('sha256', parentApiKey) + .update(queryParameters) + .digest('hex'); + return Buffer.from(securedKey + queryParameters).toString('base64'); + }; +}; + +const getApiKey = (base) => { + return (apiKey, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: encode('1/keys/%s', apiKey), + }, requestOptions); + }; +}; + +const getAppTask = (base) => { + return (taskID, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: encode('1/task/%s', taskID.toString()), + }, requestOptions); + }; +}; + +const getDictionarySettings = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: '/1/dictionaries/*/settings', + }, requestOptions); + }; +}; + +const getLogs = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: '1/logs', + }, requestOptions); + }; +}; + +const getSecuredApiKeyRemainingValidity = () => { + return (securedApiKey) => { + const decodedString = Buffer.from(securedApiKey, 'base64').toString('ascii'); + const regex = /validUntil=(\d+)/; + const match = decodedString.match(regex); + if (match === null) { + throw createValidUntilNotFoundError(); + } + return parseInt(match[1], 10) - Math.round(new Date().getTime() / 1000); + }; +}; + +const getTopUserIDs = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: '1/clusters/mapping/top', + }, requestOptions); + }; +}; + +const getUserID = (base) => { + return (userID, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: encode('1/clusters/mapping/%s', userID), + }, requestOptions); + }; +}; + +const hasPendingMappings = (base) => { + return (requestOptions) => { + const { retrieveMappings, ...options } = requestOptions || {}; + if (retrieveMappings === true) { + // eslint-disable-next-line functional/immutable-data + options.getClusters = true; + } + return base.transporter.read({ + method: MethodEnum.Get, + path: '1/clusters/mapping/pending', + }, options); + }; +}; + +const initIndex = (base) => { + return (indexName, options = {}) => { + const searchIndex = { + transporter: base.transporter, + appId: base.appId, + indexName, + }; + return addMethods(searchIndex, options.methods); + }; +}; + +const listApiKeys = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: '1/keys', + }, requestOptions); + }; +}; + +const listClusters = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: '1/clusters', + }, requestOptions); + }; +}; + +const listIndices = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: '1/indexes', + }, requestOptions); + }; +}; + +const listUserIDs = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: '1/clusters/mapping', + }, requestOptions); + }; +}; + +const moveIndex = (base) => { + return (from, to, requestOptions) => { + const wait = (response, waitRequestOptions) => { + return initIndex(base)(from, { + methods: { waitTask }, + }).waitTask(response.taskID, waitRequestOptions); + }; + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: encode('1/indexes/%s/operation', from), + data: { + operation: 'move', + destination: to, + }, + }, requestOptions), wait); + }; +}; + +const multipleBatch = (base) => { + return (requests, requestOptions) => { + const wait = (response, waitRequestOptions) => { + return Promise.all(Object.keys(response.taskID).map(indexName => { + return initIndex(base)(indexName, { + methods: { waitTask }, + }).waitTask(response.taskID[indexName], waitRequestOptions); + })); + }; + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: '1/indexes/*/batch', + data: { + requests, + }, + }, requestOptions), wait); + }; +}; + +const multipleGetObjects = (base) => { + return (requests, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Post, + path: '1/indexes/*/objects', + data: { + requests, + }, + }, requestOptions); + }; +}; + +const multipleQueries = (base) => { + return (queries, requestOptions) => { + const requests = queries.map(query => { + return { + ...query, + params: serializeQueryParameters(query.params || {}), + }; + }); + return base.transporter.read({ + method: MethodEnum.Post, + path: '1/indexes/*/queries', + data: { + requests, + }, + cacheable: true, + }, requestOptions); + }; +}; + +const multipleSearchForFacetValues = (base) => { + return (queries, requestOptions) => { + return Promise.all(queries.map(query => { + const { facetName, facetQuery, ...params } = query.params; + return initIndex(base)(query.indexName, { + methods: { searchForFacetValues }, + }).searchForFacetValues(facetName, facetQuery, { + ...requestOptions, + ...params, + }); + })); + }; +}; + +const removeUserID = (base) => { + return (userID, requestOptions) => { + const mappedRequestOptions = createMappedRequestOptions(requestOptions); + // eslint-disable-next-line functional/immutable-data + mappedRequestOptions.queryParameters['X-Algolia-User-ID'] = userID; + return base.transporter.write({ + method: MethodEnum.Delete, + path: '1/clusters/mapping', + }, mappedRequestOptions); + }; +}; + +const replaceDictionaryEntries = (base) => { + return (dictionary, entries, requestOptions) => { + const requests = entries.map(entry => ({ + action: 'addEntry', + body: entry, + })); + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: encode('/1/dictionaries/%s/batch', dictionary), + data: { clearExistingDictionaryEntries: true, requests }, + }, requestOptions), (response, waitRequestOptions) => waitAppTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const restoreApiKey = (base) => { + return (apiKey, requestOptions) => { + const wait = (_, waitRequestOptions) => { + return createRetryablePromise(retry => { + return getApiKey(base)(apiKey, waitRequestOptions).catch((apiError) => { + if (apiError.status !== 404) { + throw apiError; + } + return retry(); + }); + }); + }; + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: encode('1/keys/%s/restore', apiKey), + }, requestOptions), wait); + }; +}; + +const saveDictionaryEntries = (base) => { + return (dictionary, entries, requestOptions) => { + const requests = entries.map(entry => ({ + action: 'addEntry', + body: entry, + })); + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: encode('/1/dictionaries/%s/batch', dictionary), + data: { clearExistingDictionaryEntries: false, requests }, + }, requestOptions), (response, waitRequestOptions) => waitAppTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const searchDictionaryEntries = (base) => { + return (dictionary, query, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Post, + path: encode('/1/dictionaries/%s/search', dictionary), + data: { + query, + }, + cacheable: true, + }, requestOptions); + }; +}; + +const searchUserIDs = (base) => { + return (query, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Post, + path: '1/clusters/mapping/search', + data: { + query, + }, + }, requestOptions); + }; +}; + +const setDictionarySettings = (base) => { + return (settings, requestOptions) => { + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Put, + path: '/1/dictionaries/*/settings', + data: settings, + }, requestOptions), (response, waitRequestOptions) => waitAppTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const updateApiKey = (base) => { + return (apiKey, requestOptions) => { + const updatedFields = Object.assign({}, requestOptions); + const { queryParameters, ...options } = requestOptions || {}; + const data = queryParameters ? { queryParameters } : {}; + const apiKeyFields = [ + 'acl', + 'indexes', + 'referers', + 'restrictSources', + 'queryParameters', + 'description', + 'maxQueriesPerIPPerHour', + 'maxHitsPerQuery', + ]; + const hasChanged = (getApiKeyResponse) => { + return Object.keys(updatedFields) + .filter((updatedField) => apiKeyFields.indexOf(updatedField) !== -1) + .every(updatedField => { + return getApiKeyResponse[updatedField] === updatedFields[updatedField]; + }); + }; + const wait = (_, waitRequestOptions) => createRetryablePromise(retry => { + return getApiKey(base)(apiKey, waitRequestOptions).then(getApiKeyResponse => { + return hasChanged(getApiKeyResponse) ? Promise.resolve() : retry(); + }); + }); + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Put, + path: encode('1/keys/%s', apiKey), + data, + }, options), wait); + }; +}; + +const waitAppTask = (base) => { + return (taskID, requestOptions) => { + return createRetryablePromise(retry => { + return getAppTask(base)(taskID, requestOptions).then(response => { + return response.status !== 'published' ? retry() : undefined; + }); + }); + }; +}; + +const batch = (base) => { + return (requests, requestOptions) => { + const wait = (response, waitRequestOptions) => { + return waitTask(base)(response.taskID, waitRequestOptions); + }; + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: encode('1/indexes/%s/batch', base.indexName), + data: { + requests, + }, + }, requestOptions), wait); + }; +}; + +const browseObjects = (base) => { + return (requestOptions) => { + return createBrowsablePromise({ + shouldStop: response => response.cursor === undefined, + ...requestOptions, + request: (data) => base.transporter.read({ + method: MethodEnum.Post, + path: encode('1/indexes/%s/browse', base.indexName), + data, + }, requestOptions), + }); + }; +}; + +const browseRules = (base) => { + return (requestOptions) => { + const options = { + hitsPerPage: 1000, + ...requestOptions, + }; + return createBrowsablePromise({ + shouldStop: response => response.hits.length < options.hitsPerPage, + ...options, + request(data) { + return searchRules(base)('', { ...options, ...data }).then((response) => { + return { + ...response, + hits: response.hits.map(rule => { + // eslint-disable-next-line functional/immutable-data,no-param-reassign + delete rule._highlightResult; + return rule; + }), + }; + }); + }, + }); + }; +}; + +const browseSynonyms = (base) => { + return (requestOptions) => { + const options = { + hitsPerPage: 1000, + ...requestOptions, + }; + return createBrowsablePromise({ + shouldStop: response => response.hits.length < options.hitsPerPage, + ...options, + request(data) { + return searchSynonyms(base)('', { ...options, ...data }).then((response) => { + return { + ...response, + hits: response.hits.map(synonym => { + // eslint-disable-next-line functional/immutable-data,no-param-reassign + delete synonym._highlightResult; + return synonym; + }), + }; + }); + }, + }); + }; +}; + +const chunkedBatch = (base) => { + return (bodies, action, requestOptions) => { + const { batchSize, ...options } = requestOptions || {}; + const response = { + taskIDs: [], + objectIDs: [], + }; + const forEachBatch = (lastIndex = 0) => { + // eslint-disable-next-line functional/prefer-readonly-type + const bodiesChunk = []; + // eslint-disable-next-line functional/no-let + let index; + /* eslint-disable-next-line functional/no-loop-statement */ + for (index = lastIndex; index < bodies.length; index++) { + // eslint-disable-next-line functional/immutable-data + bodiesChunk.push(bodies[index]); + if (bodiesChunk.length === (batchSize || 1000)) { + break; + } + } + if (bodiesChunk.length === 0) { + return Promise.resolve(response); + } + return batch(base)(bodiesChunk.map(body => { + return { + action, + body, + }; + }), options).then(res => { + response.objectIDs = response.objectIDs.concat(res.objectIDs); // eslint-disable-line functional/immutable-data + response.taskIDs.push(res.taskID); // eslint-disable-line functional/immutable-data + index++; + return forEachBatch(index); + }); + }; + return createWaitablePromise(forEachBatch(), (chunkedBatchResponse, waitRequestOptions) => { + return Promise.all(chunkedBatchResponse.taskIDs.map(taskID => { + return waitTask(base)(taskID, waitRequestOptions); + })); + }); + }; +}; + +const clearObjects = (base) => { + return (requestOptions) => { + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: encode('1/indexes/%s/clear', base.indexName), + }, requestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const clearRules = (base) => { + return (requestOptions) => { + const { forwardToReplicas, ...options } = requestOptions || {}; + const mappedRequestOptions = createMappedRequestOptions(options); + if (forwardToReplicas) { + mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data + } + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: encode('1/indexes/%s/rules/clear', base.indexName), + }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const clearSynonyms = (base) => { + return (requestOptions) => { + const { forwardToReplicas, ...options } = requestOptions || {}; + const mappedRequestOptions = createMappedRequestOptions(options); + if (forwardToReplicas) { + mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data + } + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: encode('1/indexes/%s/synonyms/clear', base.indexName), + }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const deleteBy = (base) => { + return (filters, requestOptions) => { + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: encode('1/indexes/%s/deleteByQuery', base.indexName), + data: filters, + }, requestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const deleteIndex = (base) => { + return (requestOptions) => { + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Delete, + path: encode('1/indexes/%s', base.indexName), + }, requestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const deleteObject = (base) => { + return (objectID, requestOptions) => { + return createWaitablePromise(deleteObjects(base)([objectID], requestOptions).then(response => { + return { taskID: response.taskIDs[0] }; + }), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const deleteObjects = (base) => { + return (objectIDs, requestOptions) => { + const objects = objectIDs.map(objectID => { + return { objectID }; + }); + return chunkedBatch(base)(objects, BatchActionEnum.DeleteObject, requestOptions); + }; +}; + +const deleteRule = (base) => { + return (objectID, requestOptions) => { + const { forwardToReplicas, ...options } = requestOptions || {}; + const mappedRequestOptions = createMappedRequestOptions(options); + if (forwardToReplicas) { + mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data + } + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Delete, + path: encode('1/indexes/%s/rules/%s', base.indexName, objectID), + }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const deleteSynonym = (base) => { + return (objectID, requestOptions) => { + const { forwardToReplicas, ...options } = requestOptions || {}; + const mappedRequestOptions = createMappedRequestOptions(options); + if (forwardToReplicas) { + mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data + } + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Delete, + path: encode('1/indexes/%s/synonyms/%s', base.indexName, objectID), + }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const exists = (base) => { + return (requestOptions) => { + return getSettings(base)(requestOptions) + .then(() => true) + .catch(error => { + if (error.status !== 404) { + throw error; + } + return false; + }); + }; +}; + +const findAnswers = (base) => { + return (query, queryLanguages, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Post, + path: encode('1/answers/%s/prediction', base.indexName), + data: { + query, + queryLanguages, + }, + cacheable: true, + }, requestOptions); + }; +}; + +const findObject = (base) => { + return (callback, requestOptions) => { + const { query, paginate, ...options } = requestOptions || {}; + // eslint-disable-next-line functional/no-let + let page = 0; + const forEachPage = () => { + return search(base)(query || '', { ...options, page }).then(result => { + // eslint-disable-next-line functional/no-loop-statement + for (const [position, hit] of Object.entries(result.hits)) { + // eslint-disable-next-line promise/no-callback-in-promise + if (callback(hit)) { + return { + object: hit, + position: parseInt(position, 10), + page, + }; + } + } + page++; + // paginate if option was set and has next page + if (paginate === false || page >= result.nbPages) { + throw createObjectNotFoundError(); + } + return forEachPage(); + }); + }; + return forEachPage(); + }; +}; + +const getObject = (base) => { + return (objectID, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: encode('1/indexes/%s/%s', base.indexName, objectID), + }, requestOptions); + }; +}; + +const getObjectPosition = () => { + return (searchResponse, objectID) => { + // eslint-disable-next-line functional/no-loop-statement + for (const [position, hit] of Object.entries(searchResponse.hits)) { + if (hit.objectID === objectID) { + return parseInt(position, 10); + } + } + return -1; + }; +}; + +const getObjects = (base) => { + return (objectIDs, requestOptions) => { + const { attributesToRetrieve, ...options } = requestOptions || {}; + const requests = objectIDs.map(objectID => { + return { + indexName: base.indexName, + objectID, + ...(attributesToRetrieve ? { attributesToRetrieve } : {}), + }; + }); + return base.transporter.read({ + method: MethodEnum.Post, + path: '1/indexes/*/objects', + data: { + requests, + }, + }, options); + }; +}; + +const getRule = (base) => { + return (objectID, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: encode('1/indexes/%s/rules/%s', base.indexName, objectID), + }, requestOptions); + }; +}; + +const getSettings = (base) => { + return (requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: encode('1/indexes/%s/settings', base.indexName), + data: { + getVersion: 2, + }, + }, requestOptions); + }; +}; + +const getSynonym = (base) => { + return (objectID, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: encode(`1/indexes/%s/synonyms/%s`, base.indexName, objectID), + }, requestOptions); + }; +}; + +const getTask = (base) => { + return (taskID, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Get, + path: encode('1/indexes/%s/task/%s', base.indexName, taskID.toString()), + }, requestOptions); + }; +}; + +const partialUpdateObject = (base) => { + return (object, requestOptions) => { + return createWaitablePromise(partialUpdateObjects(base)([object], requestOptions).then(response => { + return { + objectID: response.objectIDs[0], + taskID: response.taskIDs[0], + }; + }), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const partialUpdateObjects = (base) => { + return (objects, requestOptions) => { + const { createIfNotExists, ...options } = requestOptions || {}; + const action = createIfNotExists + ? BatchActionEnum.PartialUpdateObject + : BatchActionEnum.PartialUpdateObjectNoCreate; + return chunkedBatch(base)(objects, action, options); + }; +}; + +const replaceAllObjects = (base) => { + return (objects, requestOptions) => { + const { safe, autoGenerateObjectIDIfNotExist, batchSize, ...options } = requestOptions || {}; + const operation = (from, to, type, operationRequestOptions) => { + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: encode('1/indexes/%s/operation', from), + data: { + operation: type, + destination: to, + }, + }, operationRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; + const randomSuffix = Math.random() + .toString(36) + .substring(7); + const temporaryIndexName = `${base.indexName}_tmp_${randomSuffix}`; + const saveObjectsInTemporary = saveObjects({ + appId: base.appId, + transporter: base.transporter, + indexName: temporaryIndexName, + }); + // @ts-ignore + // eslint-disable-next-line prefer-const, functional/no-let, functional/prefer-readonly-type + let responses = []; + const copyWaitablePromise = operation(base.indexName, temporaryIndexName, 'copy', { + ...options, + scope: ['settings', 'synonyms', 'rules'], + }); + // eslint-disable-next-line functional/immutable-data + responses.push(copyWaitablePromise); + const result = (safe + ? copyWaitablePromise.wait(options) + : copyWaitablePromise) + .then(() => { + const saveObjectsWaitablePromise = saveObjectsInTemporary(objects, { + ...options, + autoGenerateObjectIDIfNotExist, + batchSize, + }); + // eslint-disable-next-line functional/immutable-data + responses.push(saveObjectsWaitablePromise); + return safe ? saveObjectsWaitablePromise.wait(options) : saveObjectsWaitablePromise; + }) + .then(() => { + const moveWaitablePromise = operation(temporaryIndexName, base.indexName, 'move', options); + // eslint-disable-next-line functional/immutable-data + responses.push(moveWaitablePromise); + return safe ? moveWaitablePromise.wait(options) : moveWaitablePromise; + }) + .then(() => Promise.all(responses)) + .then(([copyResponse, saveObjectsResponse, moveResponse]) => { + return { + objectIDs: saveObjectsResponse.objectIDs, + taskIDs: [copyResponse.taskID, ...saveObjectsResponse.taskIDs, moveResponse.taskID], + }; + }); + return createWaitablePromise(result, (_, waitRequestOptions) => { + return Promise.all(responses.map(response => response.wait(waitRequestOptions))); + }); + }; +}; + +const replaceAllRules = (base) => { + return (rules, requestOptions) => { + return saveRules(base)(rules, { + ...requestOptions, + clearExistingRules: true, + }); + }; +}; + +const replaceAllSynonyms = (base) => { + return (synonyms, requestOptions) => { + return saveSynonyms(base)(synonyms, { + ...requestOptions, + clearExistingSynonyms: true, + }); + }; +}; + +const saveObject = (base) => { + return (object, requestOptions) => { + return createWaitablePromise(saveObjects(base)([object], requestOptions).then(response => { + return { + objectID: response.objectIDs[0], + taskID: response.taskIDs[0], + }; + }), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const saveObjects = (base) => { + return (objects, requestOptions) => { + const { autoGenerateObjectIDIfNotExist, ...options } = requestOptions || {}; + const action = autoGenerateObjectIDIfNotExist + ? BatchActionEnum.AddObject + : BatchActionEnum.UpdateObject; + if (action === BatchActionEnum.UpdateObject) { + // eslint-disable-next-line functional/no-loop-statement + for (const object of objects) { + if (object.objectID === undefined) { + return createWaitablePromise(Promise.reject(createMissingObjectIDError())); + } + } + } + return chunkedBatch(base)(objects, action, options); + }; +}; + +const saveRule = (base) => { + return (rule, requestOptions) => { + return saveRules(base)([rule], requestOptions); + }; +}; + +const saveRules = (base) => { + return (rules, requestOptions) => { + const { forwardToReplicas, clearExistingRules, ...options } = requestOptions || {}; + const mappedRequestOptions = createMappedRequestOptions(options); + if (forwardToReplicas) { + mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data + } + if (clearExistingRules) { + mappedRequestOptions.queryParameters.clearExistingRules = 1; // eslint-disable-line functional/immutable-data + } + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: encode('1/indexes/%s/rules/batch', base.indexName), + data: rules, + }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const saveSynonym = (base) => { + return (synonym, requestOptions) => { + return saveSynonyms(base)([synonym], requestOptions); + }; +}; + +const saveSynonyms = (base) => { + return (synonyms, requestOptions) => { + const { forwardToReplicas, clearExistingSynonyms, replaceExistingSynonyms, ...options } = requestOptions || {}; + const mappedRequestOptions = createMappedRequestOptions(options); + if (forwardToReplicas) { + mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data + } + if (replaceExistingSynonyms || clearExistingSynonyms) { + mappedRequestOptions.queryParameters.replaceExistingSynonyms = 1; // eslint-disable-line functional/immutable-data + } + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Post, + path: encode('1/indexes/%s/synonyms/batch', base.indexName), + data: synonyms, + }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const search = (base) => { + return (query, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Post, + path: encode('1/indexes/%s/query', base.indexName), + data: { + query, + }, + cacheable: true, + }, requestOptions); + }; +}; + +const searchForFacetValues = (base) => { + return (facetName, facetQuery, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Post, + path: encode('1/indexes/%s/facets/%s/query', base.indexName, facetName), + data: { + facetQuery, + }, + cacheable: true, + }, requestOptions); + }; +}; + +const searchRules = (base) => { + return (query, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Post, + path: encode('1/indexes/%s/rules/search', base.indexName), + data: { + query, + }, + }, requestOptions); + }; +}; + +const searchSynonyms = (base) => { + return (query, requestOptions) => { + return base.transporter.read({ + method: MethodEnum.Post, + path: encode('1/indexes/%s/synonyms/search', base.indexName), + data: { + query, + }, + }, requestOptions); + }; +}; + +const setSettings = (base) => { + return (settings, requestOptions) => { + const { forwardToReplicas, ...options } = requestOptions || {}; + const mappedRequestOptions = createMappedRequestOptions(options); + if (forwardToReplicas) { + mappedRequestOptions.queryParameters.forwardToReplicas = 1; // eslint-disable-line functional/immutable-data + } + return createWaitablePromise(base.transporter.write({ + method: MethodEnum.Put, + path: encode('1/indexes/%s/settings', base.indexName), + data: settings, + }, mappedRequestOptions), (response, waitRequestOptions) => waitTask(base)(response.taskID, waitRequestOptions)); + }; +}; + +const waitTask = (base) => { + return (taskID, requestOptions) => { + return createRetryablePromise(retry => { + return getTask(base)(taskID, requestOptions).then(response => { + return response.status !== 'published' ? retry() : undefined; + }); + }); + }; +}; + +const ApiKeyACLEnum = { + AddObject: 'addObject', + Analytics: 'analytics', + Browser: 'browse', + DeleteIndex: 'deleteIndex', + DeleteObject: 'deleteObject', + EditSettings: 'editSettings', + ListIndexes: 'listIndexes', + Logs: 'logs', + Personalization: 'personalization', + Recommendation: 'recommendation', + Search: 'search', + SeeUnretrievableAttributes: 'seeUnretrievableAttributes', + Settings: 'settings', + Usage: 'usage', +}; + +const BatchActionEnum = { + AddObject: 'addObject', + UpdateObject: 'updateObject', + PartialUpdateObject: 'partialUpdateObject', + PartialUpdateObjectNoCreate: 'partialUpdateObjectNoCreate', + DeleteObject: 'deleteObject', + DeleteIndex: 'delete', + ClearIndex: 'clear', +}; + +const ScopeEnum = { + Settings: 'settings', + Synonyms: 'synonyms', + Rules: 'rules', +}; + +const StrategyEnum = { + None: 'none', + StopIfEnoughMatches: 'stopIfEnoughMatches', +}; + +const SynonymEnum = { + Synonym: 'synonym', + OneWaySynonym: 'oneWaySynonym', + AltCorrection1: 'altCorrection1', + AltCorrection2: 'altCorrection2', + Placeholder: 'placeholder', +}; + +export { ApiKeyACLEnum, BatchActionEnum, ScopeEnum, StrategyEnum, SynonymEnum, addApiKey, assignUserID, assignUserIDs, batch, browseObjects, browseRules, browseSynonyms, chunkedBatch, clearDictionaryEntries, clearObjects, clearRules, clearSynonyms, copyIndex, copyRules, copySettings, copySynonyms, createBrowsablePromise, createMissingObjectIDError, createObjectNotFoundError, createSearchClient, createValidUntilNotFoundError, customRequest, deleteApiKey, deleteBy, deleteDictionaryEntries, deleteIndex, deleteObject, deleteObjects, deleteRule, deleteSynonym, exists, findAnswers, findObject, generateSecuredApiKey, getApiKey, getAppTask, getDictionarySettings, getLogs, getObject, getObjectPosition, getObjects, getRule, getSecuredApiKeyRemainingValidity, getSettings, getSynonym, getTask, getTopUserIDs, getUserID, hasPendingMappings, initIndex, listApiKeys, listClusters, listIndices, listUserIDs, moveIndex, multipleBatch, multipleGetObjects, multipleQueries, multipleSearchForFacetValues, partialUpdateObject, partialUpdateObjects, removeUserID, replaceAllObjects, replaceAllRules, replaceAllSynonyms, replaceDictionaryEntries, restoreApiKey, saveDictionaryEntries, saveObject, saveObjects, saveRule, saveRules, saveSynonym, saveSynonyms, search, searchDictionaryEntries, searchForFacetValues, searchRules, searchSynonyms, searchUserIDs, setDictionarySettings, setSettings, updateApiKey, waitAppTask, waitTask }; diff --git a/node_modules/@algolia/client-search/index.js b/node_modules/@algolia/client-search/index.js new file mode 100644 index 0000000000..eebe74cb43 --- /dev/null +++ b/node_modules/@algolia/client-search/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line functional/immutable-data, import/no-commonjs +module.exports = require('./dist/client-search.cjs.js'); diff --git a/node_modules/@algolia/client-search/package.json b/node_modules/@algolia/client-search/package.json new file mode 100644 index 0000000000..3b982b5558 --- /dev/null +++ b/node_modules/@algolia/client-search/package.json @@ -0,0 +1,23 @@ +{ + "name": "@algolia/client-search", + "version": "4.13.0", + "private": false, + "repository": { + "type": "git", + "url": "git://github.com/algolia/algoliasearch-client-javascript.git" + }, + "license": "MIT", + "sideEffects": false, + "main": "index.js", + "module": "dist/client-search.esm.js", + "types": "dist/client-search.d.ts", + "files": [ + "index.js", + "dist" + ], + "dependencies": { + "@algolia/client-common": "4.13.0", + "@algolia/requester-common": "4.13.0", + "@algolia/transporter": "4.13.0" + } +} diff --git a/node_modules/@algolia/logger-common/dist/logger-common.cjs.js b/node_modules/@algolia/logger-common/dist/logger-common.cjs.js new file mode 100644 index 0000000000..8468c31791 --- /dev/null +++ b/node_modules/@algolia/logger-common/dist/logger-common.cjs.js @@ -0,0 +1,26 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function createNullLogger() { + return { + debug(_message, _args) { + return Promise.resolve(); + }, + info(_message, _args) { + return Promise.resolve(); + }, + error(_message, _args) { + return Promise.resolve(); + }, + }; +} + +const LogLevelEnum = { + Debug: 1, + Info: 2, + Error: 3, +}; + +exports.LogLevelEnum = LogLevelEnum; +exports.createNullLogger = createNullLogger; diff --git a/node_modules/@algolia/logger-common/dist/logger-common.d.ts b/node_modules/@algolia/logger-common/dist/logger-common.d.ts new file mode 100644 index 0000000000..dbc9d9abdb --- /dev/null +++ b/node_modules/@algolia/logger-common/dist/logger-common.d.ts @@ -0,0 +1,23 @@ + +export declare function createNullLogger(): Logger; + +export declare type Logger = { + /** + * Logs debug messages. + */ + readonly debug: (message: string, args?: any) => Readonly>; + /** + * Logs info messages. + */ + readonly info: (message: string, args?: any) => Readonly>; + /** + * Logs error messages. + */ + readonly error: (message: string, args?: any) => Readonly>; +}; + +export declare const LogLevelEnum: Readonly>; + +export declare type LogLevelType = 1 | 2 | 3; + +export { } diff --git a/node_modules/@algolia/logger-common/dist/logger-common.esm.js b/node_modules/@algolia/logger-common/dist/logger-common.esm.js new file mode 100644 index 0000000000..d7c830c99e --- /dev/null +++ b/node_modules/@algolia/logger-common/dist/logger-common.esm.js @@ -0,0 +1,21 @@ +function createNullLogger() { + return { + debug(_message, _args) { + return Promise.resolve(); + }, + info(_message, _args) { + return Promise.resolve(); + }, + error(_message, _args) { + return Promise.resolve(); + }, + }; +} + +const LogLevelEnum = { + Debug: 1, + Info: 2, + Error: 3, +}; + +export { LogLevelEnum, createNullLogger }; diff --git a/node_modules/@algolia/logger-common/index.js b/node_modules/@algolia/logger-common/index.js new file mode 100644 index 0000000000..56c0010ede --- /dev/null +++ b/node_modules/@algolia/logger-common/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line functional/immutable-data, import/no-commonjs +module.exports = require('./dist/logger-common.cjs.js'); diff --git a/node_modules/@algolia/logger-common/package.json b/node_modules/@algolia/logger-common/package.json new file mode 100644 index 0000000000..d3e06881c7 --- /dev/null +++ b/node_modules/@algolia/logger-common/package.json @@ -0,0 +1,19 @@ +{ + "name": "@algolia/logger-common", + "version": "4.13.0", + "private": false, + "description": "Common interfaces for promise-based log libraries", + "repository": { + "type": "git", + "url": "git://github.com/algolia/algoliasearch-client-js.git" + }, + "license": "MIT", + "sideEffects": false, + "main": "index.js", + "module": "dist/logger-common.esm.js", + "types": "dist/logger-common.d.ts", + "files": [ + "index.js", + "dist" + ] +} diff --git a/node_modules/@algolia/logger-console/dist/logger-console.cjs.js b/node_modules/@algolia/logger-console/dist/logger-console.cjs.js new file mode 100644 index 0000000000..90cf4bc0e8 --- /dev/null +++ b/node_modules/@algolia/logger-console/dist/logger-console.cjs.js @@ -0,0 +1,29 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var loggerCommon = require('@algolia/logger-common'); + +/* eslint no-console: 0 */ +function createConsoleLogger(logLevel) { + return { + debug(message, args) { + if (loggerCommon.LogLevelEnum.Debug >= logLevel) { + console.debug(message, args); + } + return Promise.resolve(); + }, + info(message, args) { + if (loggerCommon.LogLevelEnum.Info >= logLevel) { + console.info(message, args); + } + return Promise.resolve(); + }, + error(message, args) { + console.error(message, args); + return Promise.resolve(); + }, + }; +} + +exports.createConsoleLogger = createConsoleLogger; diff --git a/node_modules/@algolia/logger-console/dist/logger-console.d.ts b/node_modules/@algolia/logger-console/dist/logger-console.d.ts new file mode 100644 index 0000000000..46d24aa600 --- /dev/null +++ b/node_modules/@algolia/logger-console/dist/logger-console.d.ts @@ -0,0 +1,6 @@ +import { Logger } from '@algolia/logger-common'; +import { LogLevelType } from '@algolia/logger-common'; + +export declare function createConsoleLogger(logLevel: LogLevelType): Logger; + +export { } diff --git a/node_modules/@algolia/logger-console/dist/logger-console.esm.js b/node_modules/@algolia/logger-console/dist/logger-console.esm.js new file mode 100644 index 0000000000..ce36e99218 --- /dev/null +++ b/node_modules/@algolia/logger-console/dist/logger-console.esm.js @@ -0,0 +1,25 @@ +import { LogLevelEnum } from '@algolia/logger-common'; + +/* eslint no-console: 0 */ +function createConsoleLogger(logLevel) { + return { + debug(message, args) { + if (LogLevelEnum.Debug >= logLevel) { + console.debug(message, args); + } + return Promise.resolve(); + }, + info(message, args) { + if (LogLevelEnum.Info >= logLevel) { + console.info(message, args); + } + return Promise.resolve(); + }, + error(message, args) { + console.error(message, args); + return Promise.resolve(); + }, + }; +} + +export { createConsoleLogger }; diff --git a/node_modules/@algolia/logger-console/index.js b/node_modules/@algolia/logger-console/index.js new file mode 100644 index 0000000000..1a8f955bd4 --- /dev/null +++ b/node_modules/@algolia/logger-console/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line functional/immutable-data, import/no-commonjs +module.exports = require('./dist/logger-console.cjs.js'); diff --git a/node_modules/@algolia/logger-console/package.json b/node_modules/@algolia/logger-console/package.json new file mode 100644 index 0000000000..1250caab60 --- /dev/null +++ b/node_modules/@algolia/logger-console/package.json @@ -0,0 +1,22 @@ +{ + "name": "@algolia/logger-console", + "version": "4.13.0", + "private": false, + "description": "Promise-based log library using console log.", + "repository": { + "type": "git", + "url": "git://github.com/algolia/algoliasearch-client-javascript.git" + }, + "license": "MIT", + "sideEffects": false, + "main": "index.js", + "module": "dist/logger-console.esm.js", + "types": "dist/logger-console.d.ts", + "files": [ + "index.js", + "dist" + ], + "dependencies": { + "@algolia/logger-common": "4.13.0" + } +} diff --git a/node_modules/@algolia/requester-browser-xhr/dist/requester-browser-xhr.cjs.js b/node_modules/@algolia/requester-browser-xhr/dist/requester-browser-xhr.cjs.js new file mode 100644 index 0000000000..4c4465f3f1 --- /dev/null +++ b/node_modules/@algolia/requester-browser-xhr/dist/requester-browser-xhr.cjs.js @@ -0,0 +1,61 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function createBrowserXhrRequester() { + return { + send(request) { + return new Promise((resolve) => { + const baseRequester = new XMLHttpRequest(); + baseRequester.open(request.method, request.url, true); + Object.keys(request.headers).forEach(key => baseRequester.setRequestHeader(key, request.headers[key])); + const createTimeout = (timeout, content) => { + return setTimeout(() => { + baseRequester.abort(); + resolve({ + status: 0, + content, + isTimedOut: true, + }); + }, timeout * 1000); + }; + const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout'); + // eslint-disable-next-line functional/no-let + let responseTimeout; + // eslint-disable-next-line functional/immutable-data + baseRequester.onreadystatechange = () => { + if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) { + clearTimeout(connectTimeout); + responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout'); + } + }; + // eslint-disable-next-line functional/immutable-data + baseRequester.onerror = () => { + // istanbul ignore next + if (baseRequester.status === 0) { + clearTimeout(connectTimeout); + clearTimeout(responseTimeout); + resolve({ + content: baseRequester.responseText || 'Network request failed', + status: baseRequester.status, + isTimedOut: false, + }); + } + }; + // eslint-disable-next-line functional/immutable-data + baseRequester.onload = () => { + clearTimeout(connectTimeout); + clearTimeout(responseTimeout); + resolve({ + content: baseRequester.responseText, + status: baseRequester.status, + isTimedOut: false, + }); + }; + baseRequester.send(request.data); + }); + }, + }; +} + +exports.createBrowserXhrRequester = createBrowserXhrRequester; diff --git a/node_modules/@algolia/requester-browser-xhr/dist/requester-browser-xhr.d.ts b/node_modules/@algolia/requester-browser-xhr/dist/requester-browser-xhr.d.ts new file mode 100644 index 0000000000..5e50a32e31 --- /dev/null +++ b/node_modules/@algolia/requester-browser-xhr/dist/requester-browser-xhr.d.ts @@ -0,0 +1,5 @@ +import { Requester } from '@algolia/requester-common'; + +export declare function createBrowserXhrRequester(): Requester; + +export { } diff --git a/node_modules/@algolia/requester-browser-xhr/dist/requester-browser-xhr.esm.js b/node_modules/@algolia/requester-browser-xhr/dist/requester-browser-xhr.esm.js new file mode 100644 index 0000000000..55e4447886 --- /dev/null +++ b/node_modules/@algolia/requester-browser-xhr/dist/requester-browser-xhr.esm.js @@ -0,0 +1,57 @@ +function createBrowserXhrRequester() { + return { + send(request) { + return new Promise((resolve) => { + const baseRequester = new XMLHttpRequest(); + baseRequester.open(request.method, request.url, true); + Object.keys(request.headers).forEach(key => baseRequester.setRequestHeader(key, request.headers[key])); + const createTimeout = (timeout, content) => { + return setTimeout(() => { + baseRequester.abort(); + resolve({ + status: 0, + content, + isTimedOut: true, + }); + }, timeout * 1000); + }; + const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout'); + // eslint-disable-next-line functional/no-let + let responseTimeout; + // eslint-disable-next-line functional/immutable-data + baseRequester.onreadystatechange = () => { + if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) { + clearTimeout(connectTimeout); + responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout'); + } + }; + // eslint-disable-next-line functional/immutable-data + baseRequester.onerror = () => { + // istanbul ignore next + if (baseRequester.status === 0) { + clearTimeout(connectTimeout); + clearTimeout(responseTimeout); + resolve({ + content: baseRequester.responseText || 'Network request failed', + status: baseRequester.status, + isTimedOut: false, + }); + } + }; + // eslint-disable-next-line functional/immutable-data + baseRequester.onload = () => { + clearTimeout(connectTimeout); + clearTimeout(responseTimeout); + resolve({ + content: baseRequester.responseText, + status: baseRequester.status, + isTimedOut: false, + }); + }; + baseRequester.send(request.data); + }); + }, + }; +} + +export { createBrowserXhrRequester }; diff --git a/node_modules/@algolia/requester-browser-xhr/index.js b/node_modules/@algolia/requester-browser-xhr/index.js new file mode 100644 index 0000000000..bc56b32624 --- /dev/null +++ b/node_modules/@algolia/requester-browser-xhr/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line functional/immutable-data, import/no-commonjs +module.exports = require('./dist/requester-browser-xhr.cjs.js'); diff --git a/node_modules/@algolia/requester-browser-xhr/package.json b/node_modules/@algolia/requester-browser-xhr/package.json new file mode 100644 index 0000000000..74f16c02ef --- /dev/null +++ b/node_modules/@algolia/requester-browser-xhr/package.json @@ -0,0 +1,22 @@ +{ + "name": "@algolia/requester-browser-xhr", + "version": "4.13.0", + "private": false, + "description": "Promise-based request library for browser using xhr.", + "repository": { + "type": "git", + "url": "git://github.com/algolia/algoliasearch-client-javascript.git" + }, + "license": "MIT", + "sideEffects": false, + "main": "index.js", + "module": "dist/requester-browser-xhr.esm.js", + "types": "dist/requester-browser-xhr.d.ts", + "files": [ + "index.js", + "dist" + ], + "dependencies": { + "@algolia/requester-common": "4.13.0" + } +} diff --git a/node_modules/@algolia/requester-common/dist/requester-common.cjs.js b/node_modules/@algolia/requester-common/dist/requester-common.cjs.js new file mode 100644 index 0000000000..9655a02eb9 --- /dev/null +++ b/node_modules/@algolia/requester-common/dist/requester-common.cjs.js @@ -0,0 +1,12 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +const MethodEnum = { + Delete: 'DELETE', + Get: 'GET', + Post: 'POST', + Put: 'PUT', +}; + +exports.MethodEnum = MethodEnum; diff --git a/node_modules/@algolia/requester-common/dist/requester-common.d.ts b/node_modules/@algolia/requester-common/dist/requester-common.d.ts new file mode 100644 index 0000000000..7f49ef2cb5 --- /dev/null +++ b/node_modules/@algolia/requester-common/dist/requester-common.d.ts @@ -0,0 +1,66 @@ + +export declare type Destroyable = { + /** + * Destroy any sockets that are currently in use by the agent. + * + * It is usually not necessary to do this. However, if using an agent with keepAlive enabled, then + * it is best to explicitly shut down the agent when it will no longer be used. Otherwise, sockets + * may hang open for quite a long time before the server terminates them. + */ + readonly destroy: () => Readonly>; +}; + +export declare const MethodEnum: Readonly>; + +export declare type MethodType = 'DELETE' | 'GET' | 'POST' | 'PUT'; + +export declare type Request = { + /** + * The headers of the request. + */ + readonly headers: Readonly>; + /** + * The method of the request. `GET`, etc. + */ + readonly method: MethodType; + /** + * The complete url of the request, with the protocol. + */ + readonly url: string; + /** + * The timeout to stablish a connection with the server. + */ + readonly connectTimeout: number; + /** + * The timeout to receive the response. + */ + readonly responseTimeout: number; + /** + * The data to be transfered to the server. + */ + readonly data: string | undefined; +}; + +export declare type Requester = { + /** + * Sends the given `request` to the server. + */ + readonly send: (request: Request) => Readonly>; +}; + +export declare type Response = { + /** + * The raw response from the server. + */ + content: string; + /** + * If the request timeouted. + */ + isTimedOut: boolean; + /** + * The http status code. + */ + status: number; +}; + +export { } diff --git a/node_modules/@algolia/requester-common/dist/requester-common.esm.js b/node_modules/@algolia/requester-common/dist/requester-common.esm.js new file mode 100644 index 0000000000..4a89de7442 --- /dev/null +++ b/node_modules/@algolia/requester-common/dist/requester-common.esm.js @@ -0,0 +1,8 @@ +const MethodEnum = { + Delete: 'DELETE', + Get: 'GET', + Post: 'POST', + Put: 'PUT', +}; + +export { MethodEnum }; diff --git a/node_modules/@algolia/requester-common/index.js b/node_modules/@algolia/requester-common/index.js new file mode 100644 index 0000000000..0ced494c4a --- /dev/null +++ b/node_modules/@algolia/requester-common/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line functional/immutable-data, import/no-commonjs +module.exports = require('./dist/requester-common.cjs.js'); diff --git a/node_modules/@algolia/requester-common/package.json b/node_modules/@algolia/requester-common/package.json new file mode 100644 index 0000000000..097591992d --- /dev/null +++ b/node_modules/@algolia/requester-common/package.json @@ -0,0 +1,19 @@ +{ + "name": "@algolia/requester-common", + "version": "4.13.0", + "private": false, + "description": "Common interfaces for promise-based request libraries", + "repository": { + "type": "git", + "url": "git://github.com/algolia/algoliasearch-client-js.git" + }, + "license": "MIT", + "sideEffects": false, + "main": "index.js", + "module": "dist/requester-common.esm.js", + "types": "dist/requester-common.d.ts", + "files": [ + "index.js", + "dist" + ] +} diff --git a/node_modules/@algolia/requester-node-http/dist/requester-node-http.cjs.js b/node_modules/@algolia/requester-node-http/dist/requester-node-http.cjs.js new file mode 100644 index 0000000000..88552795aa --- /dev/null +++ b/node_modules/@algolia/requester-node-http/dist/requester-node-http.cjs.js @@ -0,0 +1,87 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var http = require('http'); +var https = require('https'); +var URL = require('url'); + +/* eslint functional/prefer-readonly-type: 0 */ +const agentOptions = { keepAlive: true }; +const defaultHttpAgent = new http.Agent(agentOptions); +const defaultHttpsAgent = new https.Agent(agentOptions); +function createNodeHttpRequester({ agent: userGlobalAgent, httpAgent: userHttpAgent, httpsAgent: userHttpsAgent, requesterOptions = {}, } = {}) { + const httpAgent = userHttpAgent || userGlobalAgent || defaultHttpAgent; + const httpsAgent = userHttpsAgent || userGlobalAgent || defaultHttpsAgent; + return { + send(request) { + return new Promise(resolve => { + const url = URL.parse(request.url); + const path = url.query === null ? url.pathname : `${url.pathname}?${url.query}`; + const options = { + ...requesterOptions, + agent: url.protocol === 'https:' ? httpsAgent : httpAgent, + hostname: url.hostname, + path, + method: request.method, + headers: { + ...(requesterOptions && requesterOptions.headers ? requesterOptions.headers : {}), + ...request.headers, + }, + ...(url.port !== undefined ? { port: url.port || '' } : {}), + }; + const req = (url.protocol === 'https:' ? https : http).request(options, response => { + // eslint-disable-next-line functional/no-let + let contentBuffers = []; + response.on('data', chunk => { + contentBuffers = contentBuffers.concat(chunk); + }); + response.on('end', () => { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + clearTimeout(connectTimeout); + // eslint-disable-next-line @typescript-eslint/no-use-before-define + clearTimeout(responseTimeout); + resolve({ + status: response.statusCode || 0, + content: Buffer.concat(contentBuffers).toString(), + isTimedOut: false, + }); + }); + }); + const createTimeout = (timeout, content) => { + return setTimeout(() => { + req.abort(); + resolve({ + status: 0, + content, + isTimedOut: true, + }); + }, timeout * 1000); + }; + const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout'); + // eslint-disable-next-line functional/no-let + let responseTimeout; + req.on('error', error => { + clearTimeout(connectTimeout); + clearTimeout(responseTimeout); + resolve({ status: 0, content: error.message, isTimedOut: false }); + }); + req.once('response', () => { + clearTimeout(connectTimeout); + responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout'); + }); + if (request.data !== undefined) { + req.write(request.data); + } + req.end(); + }); + }, + destroy() { + httpAgent.destroy(); + httpsAgent.destroy(); + return Promise.resolve(); + }, + }; +} + +exports.createNodeHttpRequester = createNodeHttpRequester; diff --git a/node_modules/@algolia/requester-node-http/dist/requester-node-http.d.ts b/node_modules/@algolia/requester-node-http/dist/requester-node-http.d.ts new file mode 100644 index 0000000000..21010c373d --- /dev/null +++ b/node_modules/@algolia/requester-node-http/dist/requester-node-http.d.ts @@ -0,0 +1,16 @@ +/// +import { Destroyable } from '@algolia/requester-common'; +import * as http from 'http'; +import * as https from 'https'; +import { Requester } from '@algolia/requester-common'; + +export declare function createNodeHttpRequester({ agent: userGlobalAgent, httpAgent: userHttpAgent, httpsAgent: userHttpsAgent, requesterOptions, }?: NodeHttpRequesterOptions): Requester & Destroyable; + +export declare type NodeHttpRequesterOptions = { + agent?: https.Agent | http.Agent; + httpAgent?: http.Agent; + httpsAgent?: https.Agent; + requesterOptions?: https.RequestOptions; +}; + +export { } diff --git a/node_modules/@algolia/requester-node-http/dist/requester-node-http.esm.js b/node_modules/@algolia/requester-node-http/dist/requester-node-http.esm.js new file mode 100644 index 0000000000..1b83c61233 --- /dev/null +++ b/node_modules/@algolia/requester-node-http/dist/requester-node-http.esm.js @@ -0,0 +1,85 @@ +import * as http from 'http'; +import { Agent } from 'http'; +import * as https from 'https'; +import { Agent as Agent$1 } from 'https'; +import { parse } from 'url'; + +/* eslint functional/prefer-readonly-type: 0 */ +const agentOptions = { keepAlive: true }; +const defaultHttpAgent = new Agent(agentOptions); +const defaultHttpsAgent = new Agent$1(agentOptions); +function createNodeHttpRequester({ agent: userGlobalAgent, httpAgent: userHttpAgent, httpsAgent: userHttpsAgent, requesterOptions = {}, } = {}) { + const httpAgent = userHttpAgent || userGlobalAgent || defaultHttpAgent; + const httpsAgent = userHttpsAgent || userGlobalAgent || defaultHttpsAgent; + return { + send(request) { + return new Promise(resolve => { + const url = parse(request.url); + const path = url.query === null ? url.pathname : `${url.pathname}?${url.query}`; + const options = { + ...requesterOptions, + agent: url.protocol === 'https:' ? httpsAgent : httpAgent, + hostname: url.hostname, + path, + method: request.method, + headers: { + ...(requesterOptions && requesterOptions.headers ? requesterOptions.headers : {}), + ...request.headers, + }, + ...(url.port !== undefined ? { port: url.port || '' } : {}), + }; + const req = (url.protocol === 'https:' ? https : http).request(options, response => { + // eslint-disable-next-line functional/no-let + let contentBuffers = []; + response.on('data', chunk => { + contentBuffers = contentBuffers.concat(chunk); + }); + response.on('end', () => { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + clearTimeout(connectTimeout); + // eslint-disable-next-line @typescript-eslint/no-use-before-define + clearTimeout(responseTimeout); + resolve({ + status: response.statusCode || 0, + content: Buffer.concat(contentBuffers).toString(), + isTimedOut: false, + }); + }); + }); + const createTimeout = (timeout, content) => { + return setTimeout(() => { + req.abort(); + resolve({ + status: 0, + content, + isTimedOut: true, + }); + }, timeout * 1000); + }; + const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout'); + // eslint-disable-next-line functional/no-let + let responseTimeout; + req.on('error', error => { + clearTimeout(connectTimeout); + clearTimeout(responseTimeout); + resolve({ status: 0, content: error.message, isTimedOut: false }); + }); + req.once('response', () => { + clearTimeout(connectTimeout); + responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout'); + }); + if (request.data !== undefined) { + req.write(request.data); + } + req.end(); + }); + }, + destroy() { + httpAgent.destroy(); + httpsAgent.destroy(); + return Promise.resolve(); + }, + }; +} + +export { createNodeHttpRequester }; diff --git a/node_modules/@algolia/requester-node-http/index.js b/node_modules/@algolia/requester-node-http/index.js new file mode 100644 index 0000000000..fb864517ce --- /dev/null +++ b/node_modules/@algolia/requester-node-http/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line functional/immutable-data, import/no-commonjs +module.exports = require('./dist/requester-node-http.cjs.js'); diff --git a/node_modules/@algolia/requester-node-http/package.json b/node_modules/@algolia/requester-node-http/package.json new file mode 100644 index 0000000000..2abdd572e3 --- /dev/null +++ b/node_modules/@algolia/requester-node-http/package.json @@ -0,0 +1,22 @@ +{ + "name": "@algolia/requester-node-http", + "version": "4.13.0", + "private": false, + "description": "Promise-based request library for node using the native http module.", + "repository": { + "type": "git", + "url": "git://github.com/algolia/algoliasearch-client-javascript.git" + }, + "license": "MIT", + "sideEffects": false, + "main": "index.js", + "module": "dist/requester-node-http.esm.js", + "types": "dist/requester-node-http.d.ts", + "files": [ + "index.js", + "dist" + ], + "dependencies": { + "@algolia/requester-common": "4.13.0" + } +} diff --git a/node_modules/@algolia/transporter/dist/transporter.cjs.js b/node_modules/@algolia/transporter/dist/transporter.cjs.js new file mode 100644 index 0000000000..dd7a0f7ba6 --- /dev/null +++ b/node_modules/@algolia/transporter/dist/transporter.cjs.js @@ -0,0 +1,483 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var requesterCommon = require('@algolia/requester-common'); + +function createMappedRequestOptions(requestOptions, timeout) { + const options = requestOptions || {}; + const data = options.data || {}; + Object.keys(options).forEach(key => { + if (['timeout', 'headers', 'queryParameters', 'data', 'cacheable'].indexOf(key) === -1) { + data[key] = options[key]; // eslint-disable-line functional/immutable-data + } + }); + return { + data: Object.entries(data).length > 0 ? data : undefined, + timeout: options.timeout || timeout, + headers: options.headers || {}, + queryParameters: options.queryParameters || {}, + cacheable: options.cacheable, + }; +} + +const CallEnum = { + /** + * If the host is read only. + */ + Read: 1, + /** + * If the host is write only. + */ + Write: 2, + /** + * If the host is both read and write. + */ + Any: 3, +}; + +const HostStatusEnum = { + Up: 1, + Down: 2, + Timeouted: 3, +}; + +// By default, API Clients at Algolia have expiration delay +// of 5 mins. In the JavaScript client, we have 2 mins. +const EXPIRATION_DELAY = 2 * 60 * 1000; +function createStatefulHost(host, status = HostStatusEnum.Up) { + return { + ...host, + status, + lastUpdate: Date.now(), + }; +} +function isStatefulHostUp(host) { + return host.status === HostStatusEnum.Up || Date.now() - host.lastUpdate > EXPIRATION_DELAY; +} +function isStatefulHostTimeouted(host) { + return (host.status === HostStatusEnum.Timeouted && Date.now() - host.lastUpdate <= EXPIRATION_DELAY); +} + +function createStatelessHost(options) { + if (typeof options === 'string') { + return { + protocol: 'https', + url: options, + accept: CallEnum.Any, + }; + } + return { + protocol: options.protocol || 'https', + url: options.url, + accept: options.accept || CallEnum.Any, + }; +} + +function createRetryableOptions(hostsCache, statelessHosts) { + return Promise.all(statelessHosts.map(statelessHost => { + return hostsCache.get(statelessHost, () => { + return Promise.resolve(createStatefulHost(statelessHost)); + }); + })).then(statefulHosts => { + const hostsUp = statefulHosts.filter(host => isStatefulHostUp(host)); + const hostsTimeouted = statefulHosts.filter(host => isStatefulHostTimeouted(host)); + /** + * Note, we put the hosts that previously timeouted on the end of the list. + */ + const hostsAvailable = [...hostsUp, ...hostsTimeouted]; + const statelessHostsAvailable = hostsAvailable.length > 0 + ? hostsAvailable.map(host => createStatelessHost(host)) + : statelessHosts; + return { + getTimeout(timeoutsCount, baseTimeout) { + /** + * Imagine that you have 4 hosts, if timeouts will increase + * on the following way: 1 (timeouted) > 4 (timeouted) > 5 (200) + * + * Note that, the very next request, we start from the previous timeout + * + * 5 (timeouted) > 6 (timeouted) > 7 ... + * + * This strategy may need to be reviewed, but is the strategy on the our + * current v3 version. + */ + const timeoutMultiplier = hostsTimeouted.length === 0 && timeoutsCount === 0 + ? 1 + : hostsTimeouted.length + 3 + timeoutsCount; + return timeoutMultiplier * baseTimeout; + }, + statelessHosts: statelessHostsAvailable, + }; + }); +} + +const isNetworkError = ({ isTimedOut, status }) => { + return !isTimedOut && ~~status === 0; +}; +const isRetryable = (response) => { + const status = response.status; + const isTimedOut = response.isTimedOut; + return (isTimedOut || isNetworkError(response) || (~~(status / 100) !== 2 && ~~(status / 100) !== 4)); +}; +const isSuccess = ({ status }) => { + return ~~(status / 100) === 2; +}; +const retryDecision = (response, outcomes) => { + if (isRetryable(response)) { + return outcomes.onRetry(response); + } + if (isSuccess(response)) { + return outcomes.onSuccess(response); + } + return outcomes.onFail(response); +}; + +function retryableRequest(transporter, statelessHosts, request, requestOptions) { + const stackTrace = []; // eslint-disable-line functional/prefer-readonly-type + /** + * First we prepare the payload that do not depend from hosts. + */ + const data = serializeData(request, requestOptions); + const headers = serializeHeaders(transporter, requestOptions); + const method = request.method; + // On `GET`, the data is proxied to query parameters. + const dataQueryParameters = request.method !== requesterCommon.MethodEnum.Get + ? {} + : { + ...request.data, + ...requestOptions.data, + }; + const queryParameters = { + 'x-algolia-agent': transporter.userAgent.value, + ...transporter.queryParameters, + ...dataQueryParameters, + ...requestOptions.queryParameters, + }; + let timeoutsCount = 0; // eslint-disable-line functional/no-let + const retry = (hosts, // eslint-disable-line functional/prefer-readonly-type + getTimeout) => { + /** + * We iterate on each host, until there is no host left. + */ + const host = hosts.pop(); // eslint-disable-line functional/immutable-data + if (host === undefined) { + throw createRetryError(stackTraceWithoutCredentials(stackTrace)); + } + const payload = { + data, + headers, + method, + url: serializeUrl(host, request.path, queryParameters), + connectTimeout: getTimeout(timeoutsCount, transporter.timeouts.connect), + responseTimeout: getTimeout(timeoutsCount, requestOptions.timeout), + }; + /** + * The stackFrame is pushed to the stackTrace so we + * can have information about onRetry and onFailure + * decisions. + */ + const pushToStackTrace = (response) => { + const stackFrame = { + request: payload, + response, + host, + triesLeft: hosts.length, + }; + // eslint-disable-next-line functional/immutable-data + stackTrace.push(stackFrame); + return stackFrame; + }; + const decisions = { + onSuccess: response => deserializeSuccess(response), + onRetry(response) { + const stackFrame = pushToStackTrace(response); + /** + * If response is a timeout, we increaset the number of + * timeouts so we can increase the timeout later. + */ + if (response.isTimedOut) { + timeoutsCount++; + } + return Promise.all([ + /** + * Failures are individually send the logger, allowing + * the end user to debug / store stack frames even + * when a retry error does not happen. + */ + transporter.logger.info('Retryable failure', stackFrameWithoutCredentials(stackFrame)), + /** + * We also store the state of the host in failure cases. If the host, is + * down it will remain down for the next 2 minutes. In a timeout situation, + * this host will be added end of the list of hosts on the next request. + */ + transporter.hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? HostStatusEnum.Timeouted : HostStatusEnum.Down)), + ]).then(() => retry(hosts, getTimeout)); + }, + onFail(response) { + pushToStackTrace(response); + throw deserializeFailure(response, stackTraceWithoutCredentials(stackTrace)); + }, + }; + return transporter.requester.send(payload).then(response => { + return retryDecision(response, decisions); + }); + }; + /** + * Finally, for each retryable host perform request until we got a non + * retryable response. Some notes here: + * + * 1. The reverse here is applied so we can apply a `pop` later on => more performant. + * 2. We also get from the retryable options a timeout multiplier that is tailored + * for the current context. + */ + return createRetryableOptions(transporter.hostsCache, statelessHosts).then(options => { + return retry([...options.statelessHosts].reverse(), options.getTimeout); + }); +} + +function createTransporter(options) { + const { hostsCache, logger, requester, requestsCache, responsesCache, timeouts, userAgent, hosts, queryParameters, headers, } = options; + const transporter = { + hostsCache, + logger, + requester, + requestsCache, + responsesCache, + timeouts, + userAgent, + headers, + queryParameters, + hosts: hosts.map(host => createStatelessHost(host)), + read(request, requestOptions) { + /** + * First, we compute the user request options. Now, keep in mind, + * that using request options the user is able to modified the intire + * payload of the request. Such as headers, query parameters, and others. + */ + const mappedRequestOptions = createMappedRequestOptions(requestOptions, transporter.timeouts.read); + const createRetryableRequest = () => { + /** + * Then, we prepare a function factory that contains the construction of + * the retryable request. At this point, we may *not* perform the actual + * request. But we want to have the function factory ready. + */ + return retryableRequest(transporter, transporter.hosts.filter(host => (host.accept & CallEnum.Read) !== 0), request, mappedRequestOptions); + }; + /** + * Once we have the function factory ready, we need to determine of the + * request is "cacheable" - should be cached. Note that, once again, + * the user can force this option. + */ + const cacheable = mappedRequestOptions.cacheable !== undefined + ? mappedRequestOptions.cacheable + : request.cacheable; + /** + * If is not "cacheable", we immediatly trigger the retryable request, no + * need to check cache implementations. + */ + if (cacheable !== true) { + return createRetryableRequest(); + } + /** + * If the request is "cacheable", we need to first compute the key to ask + * the cache implementations if this request is on progress or if the + * response already exists on the cache. + */ + const key = { + request, + mappedRequestOptions, + transporter: { + queryParameters: transporter.queryParameters, + headers: transporter.headers, + }, + }; + /** + * With the computed key, we first ask the responses cache + * implemention if this request was been resolved before. + */ + return transporter.responsesCache.get(key, () => { + /** + * If the request has never resolved before, we actually ask if there + * is a current request with the same key on progress. + */ + return transporter.requestsCache.get(key, () => { + return (transporter.requestsCache + /** + * Finally, if there is no request in progress with the same key, + * this `createRetryableRequest()` will actually trigger the + * retryable request. + */ + .set(key, createRetryableRequest()) + .then(response => Promise.all([transporter.requestsCache.delete(key), response]), err => Promise.all([transporter.requestsCache.delete(key), Promise.reject(err)])) + .then(([_, response]) => response)); + }); + }, { + /** + * Of course, once we get this response back from the server, we + * tell response cache to actually store the received response + * to be used later. + */ + miss: response => transporter.responsesCache.set(key, response), + }); + }, + write(request, requestOptions) { + /** + * On write requests, no cache mechanisms are applied, and we + * proxy the request immediately to the requester. + */ + return retryableRequest(transporter, transporter.hosts.filter(host => (host.accept & CallEnum.Write) !== 0), request, createMappedRequestOptions(requestOptions, transporter.timeouts.write)); + }, + }; + return transporter; +} + +function createUserAgent(version) { + const userAgent = { + value: `Algolia for JavaScript (${version})`, + add(options) { + const addedUserAgent = `; ${options.segment}${options.version !== undefined ? ` (${options.version})` : ''}`; + if (userAgent.value.indexOf(addedUserAgent) === -1) { + // eslint-disable-next-line functional/immutable-data + userAgent.value = `${userAgent.value}${addedUserAgent}`; + } + return userAgent; + }, + }; + return userAgent; +} + +function deserializeSuccess(response) { + // eslint-disable-next-line functional/no-try-statement + try { + return JSON.parse(response.content); + } + catch (e) { + throw createDeserializationError(e.message, response); + } +} +function deserializeFailure({ content, status }, stackFrame) { + // eslint-disable-next-line functional/no-let + let message = content; + // eslint-disable-next-line functional/no-try-statement + try { + message = JSON.parse(content).message; + } + catch (e) { + // .. + } + return createApiError(message, status, stackFrame); +} + +// eslint-disable-next-line functional/prefer-readonly-type +function encode(format, ...args) { + // eslint-disable-next-line functional/no-let + let i = 0; + return format.replace(/%s/g, () => encodeURIComponent(args[i++])); +} + +function serializeUrl(host, path, queryParameters) { + const queryParametersAsString = serializeQueryParameters(queryParameters); + // eslint-disable-next-line functional/no-let + let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.substr(1) : path}`; + if (queryParametersAsString.length) { + url += `?${queryParametersAsString}`; + } + return url; +} +function serializeQueryParameters(parameters) { + const isObjectOrArray = (value) => Object.prototype.toString.call(value) === '[object Object]' || + Object.prototype.toString.call(value) === '[object Array]'; + return Object.keys(parameters) + .map(key => encode('%s=%s', key, isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key])) + .join('&'); +} +function serializeData(request, requestOptions) { + if (request.method === requesterCommon.MethodEnum.Get || + (request.data === undefined && requestOptions.data === undefined)) { + return undefined; + } + const data = Array.isArray(request.data) + ? request.data + : { ...request.data, ...requestOptions.data }; + return JSON.stringify(data); +} +function serializeHeaders(transporter, requestOptions) { + const headers = { + ...transporter.headers, + ...requestOptions.headers, + }; + const serializedHeaders = {}; + Object.keys(headers).forEach(header => { + const value = headers[header]; + // @ts-ignore + // eslint-disable-next-line functional/immutable-data + serializedHeaders[header.toLowerCase()] = value; + }); + return serializedHeaders; +} + +function stackTraceWithoutCredentials(stackTrace) { + return stackTrace.map(stackFrame => stackFrameWithoutCredentials(stackFrame)); +} +function stackFrameWithoutCredentials(stackFrame) { + const modifiedHeaders = stackFrame.request.headers['x-algolia-api-key'] + ? { 'x-algolia-api-key': '*****' } + : {}; + return { + ...stackFrame, + request: { + ...stackFrame.request, + headers: { + ...stackFrame.request.headers, + ...modifiedHeaders, + }, + }, + }; +} + +function createApiError(message, status, transporterStackTrace) { + return { + name: 'ApiError', + message, + status, + transporterStackTrace, + }; +} + +function createDeserializationError(message, response) { + return { + name: 'DeserializationError', + message, + response, + }; +} + +function createRetryError(transporterStackTrace) { + return { + name: 'RetryError', + message: 'Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.', + transporterStackTrace, + }; +} + +exports.CallEnum = CallEnum; +exports.HostStatusEnum = HostStatusEnum; +exports.createApiError = createApiError; +exports.createDeserializationError = createDeserializationError; +exports.createMappedRequestOptions = createMappedRequestOptions; +exports.createRetryError = createRetryError; +exports.createStatefulHost = createStatefulHost; +exports.createStatelessHost = createStatelessHost; +exports.createTransporter = createTransporter; +exports.createUserAgent = createUserAgent; +exports.deserializeFailure = deserializeFailure; +exports.deserializeSuccess = deserializeSuccess; +exports.isStatefulHostTimeouted = isStatefulHostTimeouted; +exports.isStatefulHostUp = isStatefulHostUp; +exports.serializeData = serializeData; +exports.serializeHeaders = serializeHeaders; +exports.serializeQueryParameters = serializeQueryParameters; +exports.serializeUrl = serializeUrl; +exports.stackFrameWithoutCredentials = stackFrameWithoutCredentials; +exports.stackTraceWithoutCredentials = stackTraceWithoutCredentials; diff --git a/node_modules/@algolia/transporter/dist/transporter.d.ts b/node_modules/@algolia/transporter/dist/transporter.d.ts new file mode 100644 index 0000000000..a096e500db --- /dev/null +++ b/node_modules/@algolia/transporter/dist/transporter.d.ts @@ -0,0 +1,381 @@ +import { Cache } from '@algolia/cache-common'; +import { Logger } from '@algolia/logger-common'; +import { MethodType } from '@algolia/requester-common'; +import { Request as Request_2 } from '@algolia/requester-common'; +import { Requester } from '@algolia/requester-common'; +import { Response } from '@algolia/requester-common'; + +export declare type ApiError = Error & { + /** + * The http status code. + */ + readonly status: number; + /** + * Contains report of stack frames of the + * execution of a certain request. + */ + readonly transporterStackTrace: readonly StackFrame[]; +}; + +export declare const CallEnum: Readonly>; + +export declare type CallType = 1 | 2 | 3; + +export declare function createApiError(message: string, status: number, transporterStackTrace: readonly StackFrame[]): ApiError; + +export declare function createDeserializationError(message: string, response: Response): DeserializationError; + +export declare function createMappedRequestOptions(requestOptions?: RequestOptions, timeout?: number): MappedRequestOptions; + +export declare function createRetryError(transporterStackTrace: readonly StackFrame[]): RetryError; + +export declare function createStatefulHost(host: StatelessHost, status?: HostStatusType): StatefulHost; + +export declare function createStatelessHost(options: HostOptions): StatelessHost; + +export declare function createTransporter(options: TransporterOptions): Transporter; + +export declare function createUserAgent(version: string): UserAgent; + +export declare type DeserializationError = Error & { + /** + * The raw response from the server. + */ + readonly response: Response; +}; + +export declare function deserializeFailure({ content, status }: Response, stackFrame: readonly StackFrame[]): Error; + +export declare function deserializeSuccess(response: Response): TObject; + +export declare type Headers = Readonly>; + +export declare type HostOptions = string | { + /** + * The url of the server, without the protocol. + */ + readonly url: string; + /** + * The type of host. Defaults to `Any`. + */ + readonly accept?: CallType; + /** + * The protocol. Defaults to `https`. + */ + readonly protocol?: string; +}; + +export declare const HostStatusEnum: Readonly>; + +export declare type HostStatusType = 1 | 2 | 3; + +export declare function isStatefulHostTimeouted(host: StatefulHost): boolean; + +export declare function isStatefulHostUp(host: StatefulHost): boolean; + +export declare type MappedRequestOptions = { + /** + * If the request should be cached. + */ + readonly cacheable: boolean | undefined; + /** + * The `read` or `write` timeout of the request. + */ + readonly timeout: number | undefined; + /** + * The headers of the request. + */ + readonly headers: Record; + /** + * The query parameters of the request. + */ + readonly queryParameters: Record; + /** + * The data to be transfered to the server. + */ + readonly data?: Record; +}; + +export declare type QueryParameters = Readonly>; + +export declare type Request = { + /** + * The method of the request. `GET`, etc. + */ + readonly method: MethodType; + /** + * The path of the request. i.e: `/1/indexes`. + */ + readonly path: string; + /** + * The data to transfer to the server. + */ + readonly data?: Record | ReadonlyArray>; + /** + * If the response should persist on cache. + */ + readonly cacheable?: boolean; +}; + +export declare type RequestOptions = { + /** + * If the given request should persist on the cache. Keep in mind, + * that some methods may have this option enabled by default. + */ + readonly cacheable?: boolean; + /** + * Custom timeout for the request. Note that, in normal situacions + * the given timeout will be applied. But the transporter layer may + * increase this timeout if there is need for it. + */ + readonly timeout?: number; + /** + * Custom headers for the request. This headers are + * going to be merged the transporter headers. + */ + readonly headers?: Readonly>; + /** + * Custom query parameters for the request. This query parameters are + * going to be merged the transporter query parameters. + */ + readonly queryParameters?: Record; + /** + * Custom data for the request. This data are + * going to be merged the transporter data. + */ + readonly data?: Record; + /** + * Additional request body values. It's only taken in + * consideration in `POST` and `PUT` requests. + */ + [key: string]: any; +}; + +export declare type RetryError = Error & { + /** + * Contains report of stack frames of the + * execution of a certain request. + */ + readonly transporterStackTrace: readonly StackFrame[]; +}; + +export declare function serializeData(request: Request, requestOptions: RequestOptions): string | undefined; + +export declare function serializeHeaders(transporter: Transporter, requestOptions: RequestOptions): Headers; + +export declare function serializeQueryParameters(parameters: Readonly>): string; + +export declare function serializeUrl(host: StatelessHost, path: string, queryParameters: Readonly>): string; + +export declare type StackFrame = { + /** + * The request made. + */ + readonly request: Request_2; + /** + * The received response. + */ + readonly response: Response; + /** + * The host associated with the `request` and the `response`. + */ + readonly host: StatelessHost; + /** + * The number of tries left. + */ + readonly triesLeft: number; +}; + +export declare function stackFrameWithoutCredentials(stackFrame: StackFrame): StackFrame; + +export declare function stackTraceWithoutCredentials(stackTrace: readonly StackFrame[]): readonly StackFrame[]; + +export declare type StatefulHost = StatelessHost & { + /** + * Holds the last time this host failed in milliseconds elapsed + * since the UNIX epoch. This failure can be because of an + * timeout error or a because the host is not available. + */ + readonly lastUpdate: number; + /** + * Holds the host status. Note that, depending of the `lastUpdate` + * an host may be considered as `Up` on the transporter layer. + */ + readonly status: HostStatusType; +}; + +export declare type StatelessHost = { + /** + * The protocol of the stateless host. Between `http` and `https`. + */ + readonly protocol: string; + /** + * The url, without protocol. + */ + readonly url: string; + /** + * The type of the host. + */ + readonly accept: CallType; +}; + +export declare type Timeouts = { + /** + * The timeout to stablish a connection with the server. + */ + readonly connect: number; + /** + * The timeout to receive the response on read requests. + */ + readonly read: number; + /** + * The timeout to receive the response on write requests. + */ + readonly write: number; +}; + +export declare type Transporter = { + /** + * The cache of the hosts. Usually used to persist + * the state of the host when its down. + */ + readonly hostsCache: Cache; + /** + * The logger instance to send events of the transporter. + */ + readonly logger: Logger; + /** + * The underlying requester used. Should differ + * depending of the enviroment where the client + * will be used. + */ + readonly requester: Requester; + /** + * The cache of the requests. When requests are + * `cacheable`, the returned promised persists + * in this cache to shared in similar resquests + * before being resolved. + */ + readonly requestsCache: Cache; + /** + * The cache of the responses. When requests are + * `cacheable`, the returned responses persists + * in this cache to shared in similar resquests. + */ + readonly responsesCache: Cache; + /** + * The timeouts used by the requester. The transporter + * layer may increase this timeouts as defined on the + * retry strategy. + */ + readonly timeouts: Timeouts; + /** + * The user agent used. Sent on query parameters. + */ + readonly userAgent: UserAgent; + /** + * The headers used on each request. + */ + readonly headers: Headers; + /** + * The query parameters used on each request. + */ + readonly queryParameters: QueryParameters; + /** + * The hosts used by the retry strategy. + * + * @readonly + */ + hosts: readonly StatelessHost[]; + /** + * Performs a read request using read hosts. + */ + readonly read: (request: Request, requestOptions?: RequestOptions) => Readonly>; + /** + * Performs a write request using write hosts. + */ + readonly write: (request: Request, requestOptions?: RequestOptions) => Readonly>; +}; + +export declare type TransporterOptions = { + /** + * The cache of the hosts. Usually used to persist + * the state of the host when its down. + */ + readonly hostsCache: Cache; + /** + * The logger instance to send events of the transporter. + */ + readonly logger: Logger; + /** + * The underlying requester used. Should differ + * depending of the enviroment where the client + * will be used. + */ + readonly requester: Requester; + /** + * The cache of the requests. When requests are + * `cacheable`, the returned promised persists + * in this cache to shared in similar resquests + * before being resolved. + */ + readonly requestsCache: Cache; + /** + * The cache of the responses. When requests are + * `cacheable`, the returned responses persists + * in this cache to shared in similar resquests. + */ + readonly responsesCache: Cache; + /** + * The timeouts used by the requester. The transporter + * layer may increase this timeouts as defined on the + * retry strategy. + */ + readonly timeouts: Timeouts; + /** + * The hosts used by the requester. + */ + readonly hosts: readonly HostOptions[]; + /** + * The headers used by the requester. The transporter + * layer may add some extra headers during the request + * for the user agent, and others. + */ + readonly headers: Headers; + /** + * The query parameters used by the requester. The transporter + * layer may add some extra headers during the request + * for the user agent, and others. + */ + readonly queryParameters: QueryParameters; + /** + * The user agent used. Sent on query parameters. + */ + readonly userAgent: UserAgent; +}; + +export declare type UserAgent = { + /** + * The raw value of the user agent. + * + * @readonly + */ + value: string; + /** + * Mutates the current user agent ading the given user agent options. + */ + readonly add: (options: UserAgentOptions) => UserAgent; +}; + +export declare type UserAgentOptions = { + /** + * The segment. Usually the integration name. + */ + readonly segment: string; + /** + * The version. Usually the integration version. + */ + readonly version?: string; +}; + +export { } diff --git a/node_modules/@algolia/transporter/dist/transporter.esm.js b/node_modules/@algolia/transporter/dist/transporter.esm.js new file mode 100644 index 0000000000..882d4e4472 --- /dev/null +++ b/node_modules/@algolia/transporter/dist/transporter.esm.js @@ -0,0 +1,460 @@ +import { MethodEnum } from '@algolia/requester-common'; + +function createMappedRequestOptions(requestOptions, timeout) { + const options = requestOptions || {}; + const data = options.data || {}; + Object.keys(options).forEach(key => { + if (['timeout', 'headers', 'queryParameters', 'data', 'cacheable'].indexOf(key) === -1) { + data[key] = options[key]; // eslint-disable-line functional/immutable-data + } + }); + return { + data: Object.entries(data).length > 0 ? data : undefined, + timeout: options.timeout || timeout, + headers: options.headers || {}, + queryParameters: options.queryParameters || {}, + cacheable: options.cacheable, + }; +} + +const CallEnum = { + /** + * If the host is read only. + */ + Read: 1, + /** + * If the host is write only. + */ + Write: 2, + /** + * If the host is both read and write. + */ + Any: 3, +}; + +const HostStatusEnum = { + Up: 1, + Down: 2, + Timeouted: 3, +}; + +// By default, API Clients at Algolia have expiration delay +// of 5 mins. In the JavaScript client, we have 2 mins. +const EXPIRATION_DELAY = 2 * 60 * 1000; +function createStatefulHost(host, status = HostStatusEnum.Up) { + return { + ...host, + status, + lastUpdate: Date.now(), + }; +} +function isStatefulHostUp(host) { + return host.status === HostStatusEnum.Up || Date.now() - host.lastUpdate > EXPIRATION_DELAY; +} +function isStatefulHostTimeouted(host) { + return (host.status === HostStatusEnum.Timeouted && Date.now() - host.lastUpdate <= EXPIRATION_DELAY); +} + +function createStatelessHost(options) { + if (typeof options === 'string') { + return { + protocol: 'https', + url: options, + accept: CallEnum.Any, + }; + } + return { + protocol: options.protocol || 'https', + url: options.url, + accept: options.accept || CallEnum.Any, + }; +} + +function createRetryableOptions(hostsCache, statelessHosts) { + return Promise.all(statelessHosts.map(statelessHost => { + return hostsCache.get(statelessHost, () => { + return Promise.resolve(createStatefulHost(statelessHost)); + }); + })).then(statefulHosts => { + const hostsUp = statefulHosts.filter(host => isStatefulHostUp(host)); + const hostsTimeouted = statefulHosts.filter(host => isStatefulHostTimeouted(host)); + /** + * Note, we put the hosts that previously timeouted on the end of the list. + */ + const hostsAvailable = [...hostsUp, ...hostsTimeouted]; + const statelessHostsAvailable = hostsAvailable.length > 0 + ? hostsAvailable.map(host => createStatelessHost(host)) + : statelessHosts; + return { + getTimeout(timeoutsCount, baseTimeout) { + /** + * Imagine that you have 4 hosts, if timeouts will increase + * on the following way: 1 (timeouted) > 4 (timeouted) > 5 (200) + * + * Note that, the very next request, we start from the previous timeout + * + * 5 (timeouted) > 6 (timeouted) > 7 ... + * + * This strategy may need to be reviewed, but is the strategy on the our + * current v3 version. + */ + const timeoutMultiplier = hostsTimeouted.length === 0 && timeoutsCount === 0 + ? 1 + : hostsTimeouted.length + 3 + timeoutsCount; + return timeoutMultiplier * baseTimeout; + }, + statelessHosts: statelessHostsAvailable, + }; + }); +} + +const isNetworkError = ({ isTimedOut, status }) => { + return !isTimedOut && ~~status === 0; +}; +const isRetryable = (response) => { + const status = response.status; + const isTimedOut = response.isTimedOut; + return (isTimedOut || isNetworkError(response) || (~~(status / 100) !== 2 && ~~(status / 100) !== 4)); +}; +const isSuccess = ({ status }) => { + return ~~(status / 100) === 2; +}; +const retryDecision = (response, outcomes) => { + if (isRetryable(response)) { + return outcomes.onRetry(response); + } + if (isSuccess(response)) { + return outcomes.onSuccess(response); + } + return outcomes.onFail(response); +}; + +function retryableRequest(transporter, statelessHosts, request, requestOptions) { + const stackTrace = []; // eslint-disable-line functional/prefer-readonly-type + /** + * First we prepare the payload that do not depend from hosts. + */ + const data = serializeData(request, requestOptions); + const headers = serializeHeaders(transporter, requestOptions); + const method = request.method; + // On `GET`, the data is proxied to query parameters. + const dataQueryParameters = request.method !== MethodEnum.Get + ? {} + : { + ...request.data, + ...requestOptions.data, + }; + const queryParameters = { + 'x-algolia-agent': transporter.userAgent.value, + ...transporter.queryParameters, + ...dataQueryParameters, + ...requestOptions.queryParameters, + }; + let timeoutsCount = 0; // eslint-disable-line functional/no-let + const retry = (hosts, // eslint-disable-line functional/prefer-readonly-type + getTimeout) => { + /** + * We iterate on each host, until there is no host left. + */ + const host = hosts.pop(); // eslint-disable-line functional/immutable-data + if (host === undefined) { + throw createRetryError(stackTraceWithoutCredentials(stackTrace)); + } + const payload = { + data, + headers, + method, + url: serializeUrl(host, request.path, queryParameters), + connectTimeout: getTimeout(timeoutsCount, transporter.timeouts.connect), + responseTimeout: getTimeout(timeoutsCount, requestOptions.timeout), + }; + /** + * The stackFrame is pushed to the stackTrace so we + * can have information about onRetry and onFailure + * decisions. + */ + const pushToStackTrace = (response) => { + const stackFrame = { + request: payload, + response, + host, + triesLeft: hosts.length, + }; + // eslint-disable-next-line functional/immutable-data + stackTrace.push(stackFrame); + return stackFrame; + }; + const decisions = { + onSuccess: response => deserializeSuccess(response), + onRetry(response) { + const stackFrame = pushToStackTrace(response); + /** + * If response is a timeout, we increaset the number of + * timeouts so we can increase the timeout later. + */ + if (response.isTimedOut) { + timeoutsCount++; + } + return Promise.all([ + /** + * Failures are individually send the logger, allowing + * the end user to debug / store stack frames even + * when a retry error does not happen. + */ + transporter.logger.info('Retryable failure', stackFrameWithoutCredentials(stackFrame)), + /** + * We also store the state of the host in failure cases. If the host, is + * down it will remain down for the next 2 minutes. In a timeout situation, + * this host will be added end of the list of hosts on the next request. + */ + transporter.hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? HostStatusEnum.Timeouted : HostStatusEnum.Down)), + ]).then(() => retry(hosts, getTimeout)); + }, + onFail(response) { + pushToStackTrace(response); + throw deserializeFailure(response, stackTraceWithoutCredentials(stackTrace)); + }, + }; + return transporter.requester.send(payload).then(response => { + return retryDecision(response, decisions); + }); + }; + /** + * Finally, for each retryable host perform request until we got a non + * retryable response. Some notes here: + * + * 1. The reverse here is applied so we can apply a `pop` later on => more performant. + * 2. We also get from the retryable options a timeout multiplier that is tailored + * for the current context. + */ + return createRetryableOptions(transporter.hostsCache, statelessHosts).then(options => { + return retry([...options.statelessHosts].reverse(), options.getTimeout); + }); +} + +function createTransporter(options) { + const { hostsCache, logger, requester, requestsCache, responsesCache, timeouts, userAgent, hosts, queryParameters, headers, } = options; + const transporter = { + hostsCache, + logger, + requester, + requestsCache, + responsesCache, + timeouts, + userAgent, + headers, + queryParameters, + hosts: hosts.map(host => createStatelessHost(host)), + read(request, requestOptions) { + /** + * First, we compute the user request options. Now, keep in mind, + * that using request options the user is able to modified the intire + * payload of the request. Such as headers, query parameters, and others. + */ + const mappedRequestOptions = createMappedRequestOptions(requestOptions, transporter.timeouts.read); + const createRetryableRequest = () => { + /** + * Then, we prepare a function factory that contains the construction of + * the retryable request. At this point, we may *not* perform the actual + * request. But we want to have the function factory ready. + */ + return retryableRequest(transporter, transporter.hosts.filter(host => (host.accept & CallEnum.Read) !== 0), request, mappedRequestOptions); + }; + /** + * Once we have the function factory ready, we need to determine of the + * request is "cacheable" - should be cached. Note that, once again, + * the user can force this option. + */ + const cacheable = mappedRequestOptions.cacheable !== undefined + ? mappedRequestOptions.cacheable + : request.cacheable; + /** + * If is not "cacheable", we immediatly trigger the retryable request, no + * need to check cache implementations. + */ + if (cacheable !== true) { + return createRetryableRequest(); + } + /** + * If the request is "cacheable", we need to first compute the key to ask + * the cache implementations if this request is on progress or if the + * response already exists on the cache. + */ + const key = { + request, + mappedRequestOptions, + transporter: { + queryParameters: transporter.queryParameters, + headers: transporter.headers, + }, + }; + /** + * With the computed key, we first ask the responses cache + * implemention if this request was been resolved before. + */ + return transporter.responsesCache.get(key, () => { + /** + * If the request has never resolved before, we actually ask if there + * is a current request with the same key on progress. + */ + return transporter.requestsCache.get(key, () => { + return (transporter.requestsCache + /** + * Finally, if there is no request in progress with the same key, + * this `createRetryableRequest()` will actually trigger the + * retryable request. + */ + .set(key, createRetryableRequest()) + .then(response => Promise.all([transporter.requestsCache.delete(key), response]), err => Promise.all([transporter.requestsCache.delete(key), Promise.reject(err)])) + .then(([_, response]) => response)); + }); + }, { + /** + * Of course, once we get this response back from the server, we + * tell response cache to actually store the received response + * to be used later. + */ + miss: response => transporter.responsesCache.set(key, response), + }); + }, + write(request, requestOptions) { + /** + * On write requests, no cache mechanisms are applied, and we + * proxy the request immediately to the requester. + */ + return retryableRequest(transporter, transporter.hosts.filter(host => (host.accept & CallEnum.Write) !== 0), request, createMappedRequestOptions(requestOptions, transporter.timeouts.write)); + }, + }; + return transporter; +} + +function createUserAgent(version) { + const userAgent = { + value: `Algolia for JavaScript (${version})`, + add(options) { + const addedUserAgent = `; ${options.segment}${options.version !== undefined ? ` (${options.version})` : ''}`; + if (userAgent.value.indexOf(addedUserAgent) === -1) { + // eslint-disable-next-line functional/immutable-data + userAgent.value = `${userAgent.value}${addedUserAgent}`; + } + return userAgent; + }, + }; + return userAgent; +} + +function deserializeSuccess(response) { + // eslint-disable-next-line functional/no-try-statement + try { + return JSON.parse(response.content); + } + catch (e) { + throw createDeserializationError(e.message, response); + } +} +function deserializeFailure({ content, status }, stackFrame) { + // eslint-disable-next-line functional/no-let + let message = content; + // eslint-disable-next-line functional/no-try-statement + try { + message = JSON.parse(content).message; + } + catch (e) { + // .. + } + return createApiError(message, status, stackFrame); +} + +// eslint-disable-next-line functional/prefer-readonly-type +function encode(format, ...args) { + // eslint-disable-next-line functional/no-let + let i = 0; + return format.replace(/%s/g, () => encodeURIComponent(args[i++])); +} + +function serializeUrl(host, path, queryParameters) { + const queryParametersAsString = serializeQueryParameters(queryParameters); + // eslint-disable-next-line functional/no-let + let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.substr(1) : path}`; + if (queryParametersAsString.length) { + url += `?${queryParametersAsString}`; + } + return url; +} +function serializeQueryParameters(parameters) { + const isObjectOrArray = (value) => Object.prototype.toString.call(value) === '[object Object]' || + Object.prototype.toString.call(value) === '[object Array]'; + return Object.keys(parameters) + .map(key => encode('%s=%s', key, isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key])) + .join('&'); +} +function serializeData(request, requestOptions) { + if (request.method === MethodEnum.Get || + (request.data === undefined && requestOptions.data === undefined)) { + return undefined; + } + const data = Array.isArray(request.data) + ? request.data + : { ...request.data, ...requestOptions.data }; + return JSON.stringify(data); +} +function serializeHeaders(transporter, requestOptions) { + const headers = { + ...transporter.headers, + ...requestOptions.headers, + }; + const serializedHeaders = {}; + Object.keys(headers).forEach(header => { + const value = headers[header]; + // @ts-ignore + // eslint-disable-next-line functional/immutable-data + serializedHeaders[header.toLowerCase()] = value; + }); + return serializedHeaders; +} + +function stackTraceWithoutCredentials(stackTrace) { + return stackTrace.map(stackFrame => stackFrameWithoutCredentials(stackFrame)); +} +function stackFrameWithoutCredentials(stackFrame) { + const modifiedHeaders = stackFrame.request.headers['x-algolia-api-key'] + ? { 'x-algolia-api-key': '*****' } + : {}; + return { + ...stackFrame, + request: { + ...stackFrame.request, + headers: { + ...stackFrame.request.headers, + ...modifiedHeaders, + }, + }, + }; +} + +function createApiError(message, status, transporterStackTrace) { + return { + name: 'ApiError', + message, + status, + transporterStackTrace, + }; +} + +function createDeserializationError(message, response) { + return { + name: 'DeserializationError', + message, + response, + }; +} + +function createRetryError(transporterStackTrace) { + return { + name: 'RetryError', + message: 'Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.', + transporterStackTrace, + }; +} + +export { CallEnum, HostStatusEnum, createApiError, createDeserializationError, createMappedRequestOptions, createRetryError, createStatefulHost, createStatelessHost, createTransporter, createUserAgent, deserializeFailure, deserializeSuccess, isStatefulHostTimeouted, isStatefulHostUp, serializeData, serializeHeaders, serializeQueryParameters, serializeUrl, stackFrameWithoutCredentials, stackTraceWithoutCredentials }; diff --git a/node_modules/@algolia/transporter/index.js b/node_modules/@algolia/transporter/index.js new file mode 100644 index 0000000000..e254eb1b46 --- /dev/null +++ b/node_modules/@algolia/transporter/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line functional/immutable-data, import/no-commonjs +module.exports = require('./dist/transporter.cjs.js'); diff --git a/node_modules/@algolia/transporter/package.json b/node_modules/@algolia/transporter/package.json new file mode 100644 index 0000000000..6b6aa866b7 --- /dev/null +++ b/node_modules/@algolia/transporter/package.json @@ -0,0 +1,24 @@ +{ + "name": "@algolia/transporter", + "version": "4.13.0", + "private": false, + "description": "Promise-based transporter layer with embedded retry strategy.", + "repository": { + "type": "git", + "url": "git://github.com/algolia/algoliasearch-client-javascript.git" + }, + "license": "MIT", + "sideEffects": false, + "main": "index.js", + "module": "dist/transporter.esm.js", + "types": "dist/transporter.d.ts", + "files": [ + "index.js", + "dist" + ], + "dependencies": { + "@algolia/cache-common": "4.13.0", + "@algolia/logger-common": "4.13.0", + "@algolia/requester-common": "4.13.0" + } +} diff --git a/node_modules/@babel/parser/CHANGELOG.md b/node_modules/@babel/parser/CHANGELOG.md new file mode 100644 index 0000000000..b3840ac8d0 --- /dev/null +++ b/node_modules/@babel/parser/CHANGELOG.md @@ -0,0 +1,1073 @@ +# Changelog + +> **Tags:** +> - :boom: [Breaking Change] +> - :eyeglasses: [Spec Compliance] +> - :rocket: [New Feature] +> - :bug: [Bug Fix] +> - :memo: [Documentation] +> - :house: [Internal] +> - :nail_care: [Polish] + +> Semver Policy: https://github.com/babel/babel/tree/main/packages/babel-parser#semver + +_Note: Gaps between patch versions are faulty, broken or test releases._ + +See the [Babel Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) for the pre-6.8.0 version Changelog. + +## 6.17.1 (2017-05-10) + +### :bug: Bug Fix + * Fix typo in flow spread operator error (Brian Ng) + * Fixed invalid number literal parsing ([#473](https://github.com/babel/babylon/pull/473)) (Alex Kuzmenko) + * Fix number parser ([#433](https://github.com/babel/babylon/pull/433)) (Alex Kuzmenko) + * Ensure non pattern shorthand props are checked for reserved words ([#479](https://github.com/babel/babylon/pull/479)) (Brian Ng) + * Remove jsx context when parsing arrow functions ([#475](https://github.com/babel/babylon/pull/475)) (Brian Ng) + * Allow super in class properties ([#499](https://github.com/babel/babylon/pull/499)) (Brian Ng) + * Allow flow class field to be named constructor ([#510](https://github.com/babel/babylon/pull/510)) (Brian Ng) + +## 6.17.0 (2017-04-20) + +### :bug: Bug Fix + * Cherry-pick #418 to 6.x ([#476](https://github.com/babel/babylon/pull/476)) (Sebastian McKenzie) + * Add support for invalid escapes in tagged templates ([#274](https://github.com/babel/babylon/pull/274)) (Kevin Gibbons) + * Throw error if new.target is used outside of a function ([#402](https://github.com/babel/babylon/pull/402)) (Brian Ng) + * Fix parsing of class properties ([#351](https://github.com/babel/babylon/pull/351)) (Kevin Gibbons) + * Fix parsing yield with dynamicImport ([#383](https://github.com/babel/babylon/pull/383)) (Brian Ng) + * Ensure consistent start args for parseParenItem ([#386](https://github.com/babel/babylon/pull/386)) (Brian Ng) + +## 7.0.0-beta.8 (2017-04-04) + +### New Feature +* Add support for flow type spread (#418) (Conrad Buck) +* Allow statics in flow interfaces (#427) (Brian Ng) + +### Bug Fix +* Fix predicate attachment to match flow parser (#428) (Brian Ng) +* Add extra.raw back to JSXText and JSXAttribute (#344) (Alex Rattray) +* Fix rest parameters with array and objects (#424) (Brian Ng) +* Fix number parser (#433) (Alex Kuzmenko) + +### Docs +* Fix CONTRIBUTING.md [skip ci] (#432) (Alex Kuzmenko) + +### Internal +* Use babel-register script when running babel smoke tests (#442) (Brian Ng) + +## 7.0.0-beta.7 (2017-03-22) + +### Spec Compliance +* Remove babylon plugin for template revision since it's stage-4 (#426) (Henry Zhu) + +### Bug Fix + +* Fix push-pop logic in flow (#405) (Daniel Tschinder) + +## 7.0.0-beta.6 (2017-03-21) + +### New Feature +* Add support for invalid escapes in tagged templates (#274) (Kevin Gibbons) + +### Polish +* Improves error message when super is called outside of constructor (#408) (Arshabh Kumar Agarwal) + +### Docs + +* [7.0] Moved value field in spec from ObjectMember to ObjectProperty as ObjectMethod's don't have it (#415) [skip ci] (James Browning) + +## 7.0.0-beta.5 (2017-03-21) + +### Bug Fix +* Throw error if new.target is used outside of a function (#402) (Brian Ng) +* Fix parsing of class properties (#351) (Kevin Gibbons) + +### Other + * Test runner: Detect extra property in 'actual' but not in 'expected'. (#407) (Andy) + * Optimize travis builds (#419) (Daniel Tschinder) + * Update codecov to 2.0 (#412) (Daniel Tschinder) + * Fix spec for ClassMethod: It doesn't have a function, it *is* a function. (#406) [skip ci] (Andy) + * Changed Non-existent RestPattern to RestElement which is what is actually parsed (#409) [skip ci] (James Browning) + * Upgrade flow to 0.41 (Daniel Tschinder) + * Fix watch command (#403) (Brian Ng) + * Update yarn lock (Daniel Tschinder) + * Fix watch command (#403) (Brian Ng) + * chore(package): update flow-bin to version 0.41.0 (#395) (greenkeeper[bot]) + * Add estree test for correct order of directives (Daniel Tschinder) + * Add DoExpression to spec (#364) (Alex Kuzmenko) + * Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci] (Sumedh Nimkarde) + * Explain how to run only one test (#389) [skip ci] (Aaron Ang) + + ## 7.0.0-beta.4 (2017-03-01) + +* Don't consume async when checking for async func decl (#377) (Brian Ng) +* add `ranges` option [skip ci] (Henry Zhu) +* Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) (Andrew Levine) + +## 7.0.0-beta.3 (2017-02-28) + +- [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384) +- Merge changes from 6.x + +## 7.0.0-beta.2 (2017-02-20) + +- estree: correctly change literals in all cases (#368) (Daniel Tschinder) + +## 7.0.0-beta.1 (2017-02-20) + +- Fix negative number literal typeannotations (#366) (Daniel Tschinder) +- Update contributing with more test info [skip ci] (#355) (Brian Ng) + +## 7.0.0-beta.0 (2017-02-15) + +- Reintroduce Variance node (#333) (Daniel Tschinder) +- Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) (Charles Pick) +- [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349) (Brandon Dail) +- chore(package): update ava to version 0.18.0 (#345) (greenkeeper[bot]) +- chore(package): update babel-plugin-istanbul to version 4.0.0 (#350) (greenkeeper[bot]) +- Change location of ObjectTypeIndexer to match flow (#228) (Daniel Tschinder) +- Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) (Toru Kobayashi) +- Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290) (Daniel Tschinder) +- Remove classConstructorCall plugin (#291) (Brian Ng) +- Update yarn.lock (Daniel Tschinder) +- Update cross-env to 3.x (Daniel Tschinder) +- [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284) (Sergey Rubanov) +- Remove `String.fromCodePoint` shim (#279) (Mathias Bynens) + +## 6.16.1 (2017-02-23) + +### :bug: Regression + +- Revert "Fix export default async function to be FunctionDeclaration" ([#375](https://github.com/babel/babylon/pull/375)) + +Need to modify Babel for this AST node change, so moving to 7.0. + +- Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" ([#376](https://github.com/babel/babylon/pull/376)) + +[react-native](https://github.com/facebook/react-native/issues/12542) broke with this so we reverted. + +## 6.16.0 (2017-02-23) + +### :rocket: New Feature + +***ESTree*** compatibility as plugin ([#277](https://github.com/babel/babylon/pull/277)) (Daniel Tschinder) + +We finally introduce a new compatibility layer for ESTree. To put babylon into ESTree-compatible mode the new plugin `estree` can be enabled. In this mode the parser will output an AST that is compliant to the specs of [ESTree](https://github.com/estree/estree/) + +We highly recommend everyone who uses babylon outside of babel to use this plugin. This will make it much easier for users to switch between different ESTree-compatible parsers. We so far tested several projects with different parsers and exchanged their parser to babylon and in nearly all cases it worked out of the box. Some other estree-compatible parsers include `acorn`, `esprima`, `espree`, `flow-parser`, etc. + +To enable `estree` mode simply add the plugin in the config: +```json +{ + "plugins": [ "estree" ] +} +``` + +If you want to migrate your project from non-ESTree mode to ESTree, have a look at our [Readme](https://github.com/babel/babylon/#output), where all deviations are mentioned. + +Add a parseExpression public method ([#213](https://github.com/babel/babylon/pull/213)) (jeromew) + +Babylon exports a new function to parse a single expression + +```js +import { parseExpression } from 'babylon'; + +const ast = parseExpression('x || y && z', options); +``` + +The returned AST will only consist of the expression. The options are the same as for `parse()` + +Add startLine option ([#346](https://github.com/babel/babylon/pull/346)) (Raphael Mu) + +A new option was added to babylon allowing to change the initial linenumber for the first line which is usually `1`. +Changing this for example to `100` will make line `1` of the input source to be marked as line `100`, line `2` as `101`, line `3` as `102`, ... + +Function predicate declaration ([#103](https://github.com/babel/babylon/pull/103)) (Panagiotis Vekris) + +Added support for function predicates which flow introduced in version 0.33.0 + +```js +declare function is_number(x: mixed): boolean %checks(typeof x === "number"); +``` + +Allow imports in declare module ([#315](https://github.com/babel/babylon/pull/315)) (Daniel Tschinder) + +Added support for imports within module declarations which flow introduced in version 0.37.0 + +```js +declare module "C" { + import type { DT } from "D"; + declare export type CT = { D: DT }; +} +``` + +### :eyeglasses: Spec Compliance + +Forbid semicolons after decorators in classes ([#352](https://github.com/babel/babylon/pull/352)) (Kevin Gibbons) + +This example now correctly throws an error when there is a semicolon after the decorator: + +```js +class A { +@a; +foo(){} +} +``` + +Keywords are not allowed as local specifier ([#307](https://github.com/babel/babylon/pull/307)) (Daniel Tschinder) + +Using keywords in imports is not allowed anymore: + +```js +import { default } from "foo"; +import { a as debugger } from "foo"; +``` + +Do not allow overwritting of primitive types ([#314](https://github.com/babel/babylon/pull/314)) (Daniel Tschinder) + +In flow it is now forbidden to overwrite the primitive types `"any"`, `"mixed"`, `"empty"`, `"bool"`, `"boolean"`, `"number"`, `"string"`, `"void"` and `"null"` with your own type declaration. + +Disallow import type { type a } from … ([#305](https://github.com/babel/babylon/pull/305)) (Daniel Tschinder) + +The following code now correctly throws an error + +```js +import type { type a } from "foo"; +``` + +Don't parse class properties without initializers when classProperties is disabled and Flow is enabled ([#300](https://github.com/babel/babylon/pull/300)) (Andrew Levine) + +Ensure that you enable the `classProperties` plugin in order to enable correct parsing of class properties. Prior to this version it was possible to parse them by enabling the `flow` plugin but this was not intended the behaviour. + +If you enable the flow plugin you can only define the type of the class properties, but not initialize them. + +Fix export default async function to be FunctionDeclaration ([#324](https://github.com/babel/babylon/pull/324)) (Daniel Tschinder) + +Parsing the following code now returns a `FunctionDeclaration` AST node instead of `FunctionExpression`. + +```js +export default async function bar() {}; +``` + +### :nail_care: Polish + +Improve error message on attempt to destructure named import ([#288](https://github.com/babel/babylon/pull/288)) (Brian Ng) + +### :bug: Bug Fix + +Fix negative number literal typeannotations ([#366](https://github.com/babel/babylon/pull/366)) (Daniel Tschinder) + +Ensure takeDecorators is called on exported class ([#358](https://github.com/babel/babylon/pull/358)) (Brian Ng) + +ESTree: correctly change literals in all cases ([#368](https://github.com/babel/babylon/pull/368)) (Daniel Tschinder) + +Correctly convert RestProperty to Assignable ([#339](https://github.com/babel/babylon/pull/339)) (Daniel Tschinder) + +Fix #321 by allowing question marks in type params ([#338](https://github.com/babel/babylon/pull/338)) (Daniel Tschinder) + +Fix #336 by correctly setting arrow-param ([#337](https://github.com/babel/babylon/pull/337)) (Daniel Tschinder) + +Fix parse error when destructuring `set` with default value ([#317](https://github.com/babel/babylon/pull/317)) (Brian Ng) + +Fix ObjectTypeCallProperty static ([#298](https://github.com/babel/babylon/pull/298)) (Dan Harper) + + +### :house: Internal + +Fix generator-method-with-computed-name spec ([#360](https://github.com/babel/babylon/pull/360)) (Alex Rattray) + +Fix flow type-parameter-declaration test with unintended semantic ([#361](https://github.com/babel/babylon/pull/361)) (Alex Rattray) + +Cleanup and splitup parser functions ([#295](https://github.com/babel/babylon/pull/295)) (Daniel Tschinder) + +chore(package): update flow-bin to version 0.38.0 ([#313](https://github.com/babel/babylon/pull/313)) (greenkeeper[bot]) + +Call inner function instead of 1:1 copy to plugin ([#294](https://github.com/babel/babylon/pull/294)) (Daniel Tschinder) + +Update eslint-config-babel to the latest version 🚀 ([#299](https://github.com/babel/babylon/pull/299)) (greenkeeper[bot]) + +Update eslint-config-babel to the latest version 🚀 ([#293](https://github.com/babel/babylon/pull/293)) (greenkeeper[bot]) + +devDeps: remove eslint-plugin-babel ([#292](https://github.com/babel/babylon/pull/292)) (Kai Cataldo) + +Correct indent eslint rule config ([#276](https://github.com/babel/babylon/pull/276)) (Daniel Tschinder) + +Fail tests that have expected.json and throws-option ([#285](https://github.com/babel/babylon/pull/285)) (Daniel Tschinder) + +### :memo: Documentation + +Update contributing with more test info [skip ci] ([#355](https://github.com/babel/babylon/pull/355)) (Brian Ng) + +Update API documentation ([#330](https://github.com/babel/babylon/pull/330)) (Timothy Gu) + +Added keywords to package.json ([#323](https://github.com/babel/babylon/pull/323)) (Dmytro) + +AST spec: fix casing of `RegExpLiteral` ([#318](https://github.com/babel/babylon/pull/318)) (Mathias Bynens) + +## 6.15.0 (2017-01-10) + +### :eyeglasses: Spec Compliance + +Add support for Flow shorthand import type ([#267](https://github.com/babel/babylon/pull/267)) (Jeff Morrison) + +This change implements flows new shorthand import syntax +and where previously you had to write this code: + +```js +import {someValue} from "blah"; +import type {someType} from "blah"; +import typeof {someOtherValue} from "blah"; +``` + +you can now write it like this: + +```js +import { + someValue, + type someType, + typeof someOtherValue, +} from "blah"; +``` + +For more information look at [this](https://github.com/facebook/flow/pull/2890) pull request. + +flow: allow leading pipes in all positions ([#256](https://github.com/babel/babylon/pull/256)) (Vladimir Kurchatkin) + +This change now allows a leading pipe everywhere types can be used: +```js +var f = (x): | 1 | 2 => 1; +``` + +Throw error when exporting non-declaration ([#241](https://github.com/babel/babylon/pull/241)) (Kai Cataldo) + +Previously babylon parsed the following exports, although they are not valid: +```js +export typeof foo; +export new Foo(); +export function() {}; +export for (;;); +export while(foo); +``` + +### :bug: Bug Fix + +Don't set inType flag when parsing property names ([#266](https://github.com/babel/babylon/pull/266)) (Vladimir Kurchatkin) + +This fixes parsing of this case: + +```js +const map = { + [age <= 17] : 'Too young' +}; +``` + +Fix source location for JSXEmptyExpression nodes (fixes #248) ([#249](https://github.com/babel/babylon/pull/249)) (James Long) + +The following case produced an invalid AST +```js +
{/* foo */}
+``` + +Use fromCodePoint to convert high value unicode entities ([#243](https://github.com/babel/babylon/pull/243)) (Ryan Duffy) + +When high value unicode entities (e.g. 💩) were used in the input source code they are now correctly encoded in the resulting AST. + +Rename folder to avoid Windows-illegal characters ([#281](https://github.com/babel/babylon/pull/281)) (Ryan Plant) + +Allow this.state.clone() when parsing decorators ([#262](https://github.com/babel/babylon/pull/262)) (Alex Rattray) + +### :house: Internal + +User external-helpers ([#254](https://github.com/babel/babylon/pull/254)) (Daniel Tschinder) + +Add watch script for dev ([#234](https://github.com/babel/babylon/pull/234)) (Kai Cataldo) + +Freeze current plugins list for "*" option, and remove from README.md ([#245](https://github.com/babel/babylon/pull/245)) (Andrew Levine) + +Prepare tests for multiple fixture runners. ([#240](https://github.com/babel/babylon/pull/240)) (Daniel Tschinder) + +Add some test coverage for decorators stage-0 plugin ([#250](https://github.com/babel/babylon/pull/250)) (Andrew Levine) + +Refactor tokenizer types file ([#263](https://github.com/babel/babylon/pull/263)) (Sven SAULEAU) + +Update eslint-config-babel to the latest version 🚀 ([#273](https://github.com/babel/babylon/pull/273)) (greenkeeper[bot]) + +chore(package): update rollup to version 0.41.0 ([#272](https://github.com/babel/babylon/pull/272)) (greenkeeper[bot]) + +chore(package): update flow-bin to version 0.37.0 ([#255](https://github.com/babel/babylon/pull/255)) (greenkeeper[bot]) + +## 6.14.1 (2016-11-17) + +### :bug: Bug Fix + +Allow `"plugins": ["*"]` ([#229](https://github.com/babel/babylon/pull/229)) (Daniel Tschinder) + +```js +{ + "plugins": ["*"] +} +``` + +Will include all parser plugins instead of specifying each one individually. Useful for tools like babel-eslint, jscodeshift, and ast-explorer. + +## 6.14.0 (2016-11-16) + +### :eyeglasses: Spec Compliance + +Throw error for reserved words `enum` and `await` ([#195](https://github.com/babel/babylon/pull/195)) (Kai Cataldo) + +[11.6.2.2 Future Reserved Words](http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words) + +Babylon will throw for more reserved words such as `enum` or `await` (in strict mode). + +``` +class enum {} // throws +class await {} // throws in strict mode (module) +``` + +Optional names for function types and object type indexers ([#197](https://github.com/babel/babylon/pull/197)) (Gabe Levi) + +So where you used to have to write + +```js +type A = (x: string, y: boolean) => number; +type B = (z: string) => number; +type C = { [key: string]: number }; +``` + +you can now write (with flow 0.34.0) + +```js +type A = (string, boolean) => number; +type B = string => number; +type C = { [string]: number }; +``` + +Parse flow nested array type annotations like `number[][]` ([#219](https://github.com/babel/babylon/pull/219)) (Bernhard Häussner) + +Supports these form now of specifying array types: + +```js +var a: number[][][][]; +var b: string[][]; +``` + +### :bug: Bug Fix + +Correctly eat semicolon at the end of `DelcareModuleExports` ([#223](https://github.com/babel/babylon/pull/223)) (Daniel Tschinder) + +``` +declare module "foo" { declare module.exports: number } +declare module "foo" { declare module.exports: number; } // also allowed now +``` + +### :house: Internal + + * Count Babel tests towards Babylon code coverage ([#182](https://github.com/babel/babylon/pull/182)) (Moti Zilberman) + * Fix strange line endings ([#214](https://github.com/babel/babylon/pull/214)) (Thomas Grainger) + * Add node 7 (Daniel Tschinder) + * chore(package): update flow-bin to version 0.34.0 ([#204](https://github.com/babel/babylon/pull/204)) (Greenkeeper) + +## v6.13.1 (2016-10-26) + +### :nail_care: Polish + +- Use rollup for bundling to speed up startup time ([#190](https://github.com/babel/babylon/pull/190)) ([@drewml](https://github.com/DrewML)) + +```js +const babylon = require('babylon'); +const ast = babylon.parse('var foo = "lol";'); +``` + +With that test case, there was a ~95ms savings by removing the need for node to build/traverse the dependency graph. + +**Without bundling** +![image](https://cloud.githubusercontent.com/assets/5233399/19420264/3133497e-93ad-11e6-9a6a-2da59c4f5c13.png) + +**With bundling** +![image](https://cloud.githubusercontent.com/assets/5233399/19420267/388f556e-93ad-11e6-813e-7c5c396be322.png) + +- add clean command [skip ci] ([#201](https://github.com/babel/babylon/pull/201)) (Henry Zhu) +- add ForAwaitStatement (async generator already added) [skip ci] ([#196](https://github.com/babel/babylon/pull/196)) (Henry Zhu) + +## v6.13.0 (2016-10-21) + +### :eyeglasses: Spec Compliance + +Property variance type annotations for Flow plugin ([#161](https://github.com/babel/babylon/pull/161)) (Sam Goldman) + +> See https://flowtype.org/docs/variance.html for more information + +```js +type T = { +p: T }; +interface T { -p: T }; +declare class T { +[k:K]: V }; +class T { -[k:K]: V }; +class C2 { +p: T = e }; +``` + +Raise error on duplicate definition of __proto__ ([#183](https://github.com/babel/babylon/pull/183)) (Moti Zilberman) + +```js +({ __proto__: 1, __proto__: 2 }) // Throws an error now +``` + +### :bug: Bug Fix + +Flow: Allow class properties to be named `static` ([#184](https://github.com/babel/babylon/pull/184)) (Moti Zilberman) + +```js +declare class A { + static: T; +} +``` + +Allow "async" as identifier for object literal property shorthand ([#187](https://github.com/babel/babylon/pull/187)) (Andrew Levine) + +```js +var foo = { async, bar }; +``` + +### :nail_care: Polish + +Fix flowtype and add inType to state ([#189](https://github.com/babel/babylon/pull/189)) (Daniel Tschinder) + +> This improves the performance slightly (because of hidden classes) + +### :house: Internal + +Fix .gitattributes line ending setting ([#191](https://github.com/babel/babylon/pull/191)) (Moti Zilberman) + +Increase test coverage ([#175](https://github.com/babel/babylon/pull/175) (Moti Zilberman) + +Readd missin .eslinignore for IDEs (Daniel Tschinder) + +Error on missing expected.json fixture in CI ([#188](https://github.com/babel/babylon/pull/188)) (Moti Zilberman) + +Add .gitattributes and .editorconfig for LF line endings ([#179](https://github.com/babel/babylon/pull/179)) (Moti Zilberman) + +Fixes two tests that are failing after the merge of #172 ([#177](https://github.com/babel/babylon/pull/177)) (Moti Zilberman) + +## v6.12.0 (2016-10-14) + +### :eyeglasses: Spec Compliance + +Implement import() syntax ([#163](https://github.com/babel/babylon/pull/163)) (Jordan Gensler) + +#### Dynamic Import + +- Proposal Repo: https://github.com/domenic/proposal-dynamic-import +- Championed by [@domenic](https://github.com/domenic) +- stage-2 +- [sept-28 tc39 notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-09/sept-28.md#113a-import) + +> This repository contains a proposal for adding a "function-like" import() module loading syntactic form to JavaScript + +```js +import(`./section-modules/${link.dataset.entryModule}.js`) +.then(module => { + module.loadPageInto(main); +}) +``` + +Add EmptyTypeAnnotation ([#171](https://github.com/babel/babylon/pull/171)) (Sam Goldman) + +#### EmptyTypeAnnotation + +Just wasn't covered before. + +```js +type T = empty; +``` + +### :bug: Bug Fix + +Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) + +```js +// was failing due to sparse array +export const { foo: [ ,, qux7 ] } = bar; +``` + +Allow keyword in Flow object declaration property names with type parameters ([#146](https://github.com/babel/babylon/pull/146)) (Dan Harper) + +```js +declare class X { + foobar(): void; + static foobar(): void; +} +``` + +Allow keyword in object/class property names with Flow type parameters ([#145](https://github.com/babel/babylon/pull/145)) (Dan Harper) + +```js +class Foo { + delete(item: T): T { + return item; + } +} +``` + +Allow typeAnnotations for yield expressions ([#174](https://github.com/babel/babylon/pull/174))) (Daniel Tschinder) + +```js +function *foo() { + const x = (yield 5: any); +} +``` + +### :nail_care: Polish + +Annotate more errors with expected token ([#172](https://github.com/babel/babylon/pull/172))) (Moti Zilberman) + +```js +// Unexpected token, expected ; (1:6) +{ set 1 } +``` + +### :house: Internal + +Remove kcheck ([#173](https://github.com/babel/babylon/pull/173))) (Daniel Tschinder) + +Also run flow, linting, babel tests on separate instances (add back node 0.10) + +## v6.11.6 (2016-10-12) + +### :bug: Bug Fix/Regression + +Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) + +```js +// was failing with `Cannot read property 'type' of null` because of null identifiers +export const { foo: [ ,, qux7 ] } = bar; +``` + +## v6.11.5 (2016-10-12) + +### :eyeglasses: Spec Compliance + +Fix: Check for duplicate named exports in exported destructuring assignments ([#144](https://github.com/babel/babylon/pull/144)) (Kai Cataldo) + +```js +// `foo` has already been exported. Exported identifiers must be unique. (2:20) +export function foo() {}; +export const { a: [{foo}] } = bar; +``` + +Fix: Check for duplicate named exports in exported rest elements/properties ([#164](https://github.com/babel/babylon/pull/164)) (Kai Cataldo) + +```js +// `foo` has already been exported. Exported identifiers must be unique. (2:22) +export const foo = 1; +export const [bar, ...foo] = baz; +``` + +### :bug: Bug Fix + +Fix: Allow identifier `async` for default param in arrow expression ([#165](https://github.com/babel/babylon/pull/165)) (Kai Cataldo) + +```js +// this is ok now +const test = ({async = true}) => {}; +``` + +### :nail_care: Polish + +Babylon will now print out the token it's expecting if there's a `SyntaxError` ([#150](https://github.com/babel/babylon/pull/150)) (Daniel Tschinder) + +```bash +# So in the case of a missing ending curly (`}`) +Module build failed: SyntaxError: Unexpected token, expected } (30:0) + 28 | } + 29 | +> 30 | + | ^ +``` + +## v6.11.4 (2016-10-03) + +Temporary rollback for erroring on trailing comma with spread (#154) (Henry Zhu) + +## v6.11.3 (2016-10-01) + +### :eyeglasses: Spec Compliance + +Add static errors for object rest (#149) ([@danez](https://github.com/danez)) + +> https://github.com/sebmarkbage/ecmascript-rest-spread + +Object rest copies the *rest* of properties from the right hand side `obj` starting from the left to right. + +```js +let { x, y, ...z } = { x: 1, y: 2, z: 3 }; +// x = 1 +// y = 2 +// z = { z: 3 } +``` + +#### New Syntax Errors: + +**SyntaxError**: The rest element has to be the last element when destructuring (1:10) +```bash +> 1 | let { ...x, y, z } = { x: 1, y: 2, z: 3}; + | ^ +# Previous behavior: +# x = { x: 1, y: 2, z: 3 } +# y = 2 +# z = 3 +``` + +Before, this was just a more verbose way of shallow copying `obj` since it doesn't actually do what you think. + +**SyntaxError**: Cannot have multiple rest elements when destructuring (1:13) + +```bash +> 1 | let { x, ...y, ...z } = { x: 1, y: 2, z: 3}; + | ^ +# Previous behavior: +# x = 1 +# y = { y: 2, z: 3 } +# z = { y: 2, z: 3 } +``` + +Before y and z would just be the same value anyway so there is no reason to need to have both. + +**SyntaxError**: A trailing comma is not permitted after the rest element (1:16) + +```js +let { x, y, ...z, } = obj; +``` + +The rationale for this is that the use case for trailing comma is that you can add something at the end without affecting the line above. Since a RestProperty always has to be the last property it doesn't make sense. + +--- + +get / set are valid property names in default assignment (#142) ([@jezell](https://github.com/jezell)) + +```js +// valid +function something({ set = null, get = null }) {} +``` + +## v6.11.2 (2016-09-23) + +### Bug Fix + +- [#139](https://github.com/babel/babylon/issues/139) Don't do the duplicate check if not an identifier (#140) @hzoo + +```js +// regression with duplicate export check +SyntaxError: ./typography.js: `undefined` has already been exported. Exported identifiers must be unique. (22:13) + 20 | + 21 | export const { rhythm } = typography; +> 22 | export const { TypographyStyle } = typography +``` + +Bail out for now, and make a change to account for destructuring in the next release. + +## 6.11.1 (2016-09-22) + +### Bug Fix +- [#137](https://github.com/babel/babylon/pull/137) - Fix a regression with duplicate exports - it was erroring on all keys in `Object.prototype`. @danez + +```javascript +export toString from './toString'; +``` + +```bash +`toString` has already been exported. Exported identifiers must be unique. (1:7) +> 1 | export toString from './toString'; + | ^ + 2 | +``` + +## 6.11.0 (2016-09-22) + +### Spec Compliance (will break CI) + +- Disallow duplicate named exports ([#107](https://github.com/babel/babylon/pull/107)) @kaicataldo + +```js +// Only one default export allowed per module. (2:9) +export default function() {}; +export { foo as default }; + +// Only one default export allowed per module. (2:0) +export default {}; +export default function() {}; + +// `Foo` has already been exported. Exported identifiers must be unique. (2:0) +export { Foo }; +export class Foo {}; +``` + +### New Feature (Syntax) + +- Add support for computed class property names ([#121](https://github.com/babel/babylon/pull/121)) @motiz88 + +```js +// AST +interface ClassProperty <: Node { + type: "ClassProperty"; + key: Identifier; + value: Expression; + computed: boolean; // added +} +``` + +```js +// with "plugins": ["classProperties"] +class Foo { + [x] + ['y'] +} + +class Bar { + [p] + [m] () {} +} + ``` + +### Bug Fix + +- Fix `static` property falling through in the declare class Flow AST ([#135](https://github.com/babel/babylon/pull/135)) @danharper + +```js +declare class X { + a: number; + static b: number; // static + c: number; // this was being marked as static in the AST as well +} +``` + +### Polish + +- Rephrase "assigning/binding to rvalue" errors to include context ([#119](https://github.com/babel/babylon/pull/119)) @motiz88 + +```js +// Used to error with: +// SyntaxError: Assigning to rvalue (1:0) + +// Now: +// Invalid left-hand side in assignment expression (1:0) +3 = 4 + +// Invalid left-hand side in for-in statement (1:5) +for (+i in {}); +``` + +### Internal + +- Fix call to `this.parseMaybeAssign` with correct arguments ([#133](https://github.com/babel/babylon/pull/133)) @danez +- Add semver note to changelog ([#131](https://github.com/babel/babylon/pull/131)) @hzoo + +## 6.10.0 (2016-09-19) + +> We plan to include some spec compliance bugs in patch versions. An example was the multiple default exports issue. + +### Spec Compliance + +* Implement ES2016 check for simple parameter list in strict mode ([#106](https://github.com/babel/babylon/pull/106)) (Timothy Gu) + +> It is a Syntax Error if ContainsUseStrict of FunctionBody is true and IsSimpleParameterList of FormalParameters is false. https://tc39.github.io/ecma262/2016/#sec-function-definitions-static-semantics-early-errors + +More Context: [tc39-notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-29.md#611-the-scope-of-use-strict-with-respect-to-destructuring-in-parameter-lists) + +For example: + +```js +// this errors because it uses destructuring and default parameters +// in a function with a "use strict" directive +function a([ option1, option2 ] = []) { + "use strict"; +} + ``` + +The solution would be to use a top level "use strict" or to remove the destructuring or default parameters when using a function + "use strict" or to. + +### New Feature + +* Exact object type annotations for Flow plugin ([#104](https://github.com/babel/babylon/pull/104)) (Basil Hosmer) + +Added to flow in https://github.com/facebook/flow/commit/c710c40aa2a115435098d6c0dfeaadb023cd39b8 + +Looks like: + +```js +var a : {| x: number, y: string |} = { x: 0, y: 'foo' }; +``` + +### Bug Fixes + +* Include `typeParameter` location in `ArrowFunctionExpression` ([#126](https://github.com/babel/babylon/pull/126)) (Daniel Tschinder) +* Error on invalid flow type annotation with default assignment ([#122](https://github.com/babel/babylon/pull/122)) (Dan Harper) +* Fix Flow return types on arrow functions ([#124](https://github.com/babel/babylon/pull/124)) (Dan Harper) + +### Misc + +* Add tests for export extensions ([#127](https://github.com/babel/babylon/pull/127)) (Daniel Tschinder) +* Fix Contributing guidelines [skip ci] (Daniel Tschinder) + +## 6.9.2 (2016-09-09) + +The only change is to remove the `babel-runtime` dependency by compiling with Babel's ES2015 loose mode. So using babylon standalone should be smaller. + +## 6.9.1 (2016-08-23) + +This release contains mainly small bugfixes but also updates babylons default mode to es2017. The features for `exponentiationOperator`, `asyncFunctions` and `trailingFunctionCommas` which previously needed to be activated via plugin are now enabled by default and the plugins are now no-ops. + +### Bug Fixes + +- Fix issues with default object params in async functions ([#96](https://github.com/babel/babylon/pull/96)) @danez +- Fix issues with flow-types and async function ([#95](https://github.com/babel/babylon/pull/95)) @danez +- Fix arrow functions with destructuring, types & default value ([#94](https://github.com/babel/babylon/pull/94)) @danharper +- Fix declare class with qualified type identifier ([#97](https://github.com/babel/babylon/pull/97)) @danez +- Remove exponentiationOperator, asyncFunctions, trailingFunctionCommas plugins and enable them by default ([#98](https://github.com/babel/babylon/pull/98)) @danez + +## 6.9.0 (2016-08-16) + +### New syntax support + +- Add JSX spread children ([#42](https://github.com/babel/babylon/pull/42)) @calebmer + +(Be aware that React is not going to support this syntax) + +```js +
+ {...todos.map(todo => )} +
+``` + +- Add support for declare module.exports ([#72](https://github.com/babel/babylon/pull/72)) @danez + +```js +declare module "foo" { + declare module.exports: {} +} +``` + +### New Features + +- If supplied, attach filename property to comment node loc. ([#80](https://github.com/babel/babylon/pull/80)) @divmain +- Add identifier name to node loc field ([#90](https://github.com/babel/babylon/pull/90)) @kittens + +### Bug Fixes + +- Fix exponential operator to behave according to spec ([#75](https://github.com/babel/babylon/pull/75)) @danez +- Fix lookahead to not add comments to arrays which are not cloned ([#76](https://github.com/babel/babylon/pull/76)) @danez +- Fix accidental fall-through in Flow type parsing. ([#82](https://github.com/babel/babylon/pull/82)) @xiemaisi +- Only allow declares inside declare module ([#73](https://github.com/babel/babylon/pull/73)) @danez +- Small fix for parsing type parameter declarations ([#83](https://github.com/babel/babylon/pull/83)) @gabelevi +- Fix arrow param locations with flow types ([#57](https://github.com/babel/babylon/pull/57)) @danez +- Fixes SyntaxError position with flow optional type ([#65](https://github.com/babel/babylon/pull/65)) @danez + +### Internal + +- Add codecoverage to tests @danez +- Fix tests to not save expected output if we expect the test to fail @danez +- Make a shallow clone of babel for testing @danez +- chore(package): update cross-env to version 2.0.0 ([#77](https://github.com/babel/babylon/pull/77)) @greenkeeperio-bot +- chore(package): update ava to version 0.16.0 ([#86](https://github.com/babel/babylon/pull/86)) @greenkeeperio-bot +- chore(package): update babel-plugin-istanbul to version 2.0.0 ([#89](https://github.com/babel/babylon/pull/89)) @greenkeeperio-bot +- chore(package): update nyc to version 8.0.0 ([#88](https://github.com/babel/babylon/pull/88)) @greenkeeperio-bot + +## 6.8.4 (2016-07-06) + +### Bug Fixes + +- Fix the location of params, when flow and default value used ([#68](https://github.com/babel/babylon/pull/68)) @danez + +## 6.8.3 (2016-07-02) + +### Bug Fixes + +- Fix performance regression introduced in 6.8.2 with conditionals ([#63](https://github.com/babel/babylon/pull/63)) @danez + +## 6.8.2 (2016-06-24) + +### Bug Fixes + +- Fix parse error with yielding jsx elements in generators `function* it() { yield ; }` ([#31](https://github.com/babel/babylon/pull/31)) @eldereal +- When cloning nodes do not clone its comments ([#24](https://github.com/babel/babylon/pull/24)) @danez +- Fix parse errors when using arrow functions with an spread element and return type `(...props): void => {}` ([#10](https://github.com/babel/babylon/pull/10)) @danez +- Fix leading comments added from previous node ([#23](https://github.com/babel/babylon/pull/23)) @danez +- Fix parse errors with flow's optional arguments `(arg?) => {}` ([#19](https://github.com/babel/babylon/pull/19)) @danez +- Support negative numeric type literals @kittens +- Remove line terminator restriction after await keyword @kittens +- Remove grouped type arrow restriction as it seems flow no longer has it @kittens +- Fix parse error with generic methods that have the name `get` or `set` `class foo { get() {} }` ([#55](https://github.com/babel/babylon/pull/55)) @vkurchatkin +- Fix parse error with arrow functions that have flow type parameter declarations `(x: T): T => x;` ([#54](https://github.com/babel/babylon/pull/54)) @gabelevi + +### Documentation + +- Document AST differences from ESTree ([#41](https://github.com/babel/babylon/pull/41)) @nene +- Move ast spec from babel/babel ([#46](https://github.com/babel/babylon/pull/46)) @hzoo + +### Internal + +- Enable skipped tests ([#16](https://github.com/babel/babylon/pull/16)) @danez +- Add script to test latest version of babylon with babel ([#21](https://github.com/babel/babylon/pull/21)) @danez +- Upgrade test runner ava @kittens +- Add missing generate-identifier-regex script @kittens +- Rename parser context types @kittens +- Add node v6 to travis testing @hzoo +- Update to Unicode v9 ([#45](https://github.com/babel/babylon/pull/45)) @mathiasbynens + +## 6.8.1 (2016-06-06) + +### New Feature + +- Parse type parameter declarations with defaults like `type Foo = T` + +### Bug Fixes +- Type parameter declarations need 1 or more type parameters. +- The existential type `*` is not a valid type parameter. +- The existential type `*` is a primary type + +### Spec Compliance +- The param list for type parameter declarations now consists of `TypeParameter` nodes +- New `TypeParameter` AST Node (replaces using the `Identifier` node before) + +``` +interface TypeParameter <: Node { + bound: TypeAnnotation; + default: TypeAnnotation; + name: string; + variance: "plus" | "minus"; +} +``` + +## 6.8.0 (2016-05-02) + +#### New Feature + +##### Parse Method Parameter Decorators ([#12](https://github.com/babel/babylon/pull/12)) + +> [Method Parameter Decorators](https://goo.gl/8MmCMG) is now a TC39 [stage 0 proposal](https://github.com/tc39/ecma262/blob/master/stage0.md). + +Examples: + +```js +class Foo { + constructor(@foo() x, @bar({ a: 123 }) @baz() y) {} +} + +export default function func(@foo() x, @bar({ a: 123 }) @baz() y) {} + +var obj = { + method(@foo() x, @bar({ a: 123 }) @baz() y) {} +}; +``` + +##### Parse for-await statements (w/ `asyncGenerators` plugin) ([#17](https://github.com/babel/babylon/pull/17)) + +There is also a new node type, `ForAwaitStatement`. + +> [Async generators and for-await](https://github.com/tc39/proposal-async-iteration) are now a [stage 2 proposal](https://github.com/tc39/ecma262#current-proposals). + +Example: + +```js +async function f() { + for await (let x of y); +} +``` diff --git a/node_modules/@babel/parser/LICENSE b/node_modules/@babel/parser/LICENSE new file mode 100644 index 0000000000..d4c7fc5838 --- /dev/null +++ b/node_modules/@babel/parser/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2014 by various contributors (see AUTHORS) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/@babel/parser/README.md b/node_modules/@babel/parser/README.md new file mode 100644 index 0000000000..513748c370 --- /dev/null +++ b/node_modules/@babel/parser/README.md @@ -0,0 +1,19 @@ +# @babel/parser + +> A JavaScript parser + +See our website [@babel/parser](https://babeljs.io/docs/en/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%20(babylon)%22+is%3Aopen) associated with this package. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/parser +``` + +or using yarn: + +```sh +yarn add @babel/parser --dev +``` diff --git a/node_modules/@babel/parser/bin/babel-parser.js b/node_modules/@babel/parser/bin/babel-parser.js new file mode 100755 index 0000000000..3aca314533 --- /dev/null +++ b/node_modules/@babel/parser/bin/babel-parser.js @@ -0,0 +1,15 @@ +#!/usr/bin/env node +/* eslint no-var: 0 */ + +var parser = require(".."); +var fs = require("fs"); + +var filename = process.argv[2]; +if (!filename) { + console.error("no filename specified"); +} else { + var file = fs.readFileSync(filename, "utf8"); + var ast = parser.parse(file); + + console.log(JSON.stringify(ast, null, " ")); +} diff --git a/node_modules/@babel/parser/lib/index.js b/node_modules/@babel/parser/lib/index.js new file mode 100644 index 0000000000..e9431880ae --- /dev/null +++ b/node_modules/@babel/parser/lib/index.js @@ -0,0 +1,16528 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +class Position { + constructor(line, col, index) { + this.line = void 0; + this.column = void 0; + this.index = void 0; + this.line = line; + this.column = col; + this.index = index; + } + +} +class SourceLocation { + constructor(start, end) { + this.start = void 0; + this.end = void 0; + this.filename = void 0; + this.identifierName = void 0; + this.start = start; + this.end = end; + } + +} +function createPositionWithColumnOffset(position, columnOffset) { + const { + line, + column, + index + } = position; + return new Position(line, column + columnOffset, index + columnOffset); +} + +const ParseErrorCodes = Object.freeze({ + SyntaxError: "BABEL_PARSER_SYNTAX_ERROR", + SourceTypeModuleError: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" +}); + +const reflect = (keys, last = keys.length - 1) => ({ + get() { + return keys.reduce((object, key) => object[key], this); + }, + + set(value) { + keys.reduce((item, key, i) => i === last ? item[key] = value : item[key], this); + } + +}); + +const instantiate = (constructor, properties, descriptors) => Object.keys(descriptors).map(key => [key, descriptors[key]]).filter(([, descriptor]) => !!descriptor).map(([key, descriptor]) => [key, typeof descriptor === "function" ? { + value: descriptor, + enumerable: false +} : typeof descriptor.reflect === "string" ? Object.assign({}, descriptor, reflect(descriptor.reflect.split("."))) : descriptor]).reduce((instance, [key, descriptor]) => Object.defineProperty(instance, key, Object.assign({ + configurable: true +}, descriptor)), Object.assign(new constructor(), properties)); + +var ModuleErrors = (_ => ({ + ImportMetaOutsideModule: _(`import.meta may appear only with 'sourceType: "module"'`, { + code: ParseErrorCodes.SourceTypeModuleError + }), + ImportOutsideModule: _(`'import' and 'export' may appear only with 'sourceType: "module"'`, { + code: ParseErrorCodes.SourceTypeModuleError + }) +})); + +const NodeDescriptions = { + ArrayPattern: "array destructuring pattern", + AssignmentExpression: "assignment expression", + AssignmentPattern: "assignment expression", + ArrowFunctionExpression: "arrow function expression", + ConditionalExpression: "conditional expression", + ForOfStatement: "for-of statement", + ForInStatement: "for-in statement", + ForStatement: "for-loop", + FormalParameters: "function parameter list", + Identifier: "identifier", + ObjectPattern: "object destructuring pattern", + ParenthesizedExpression: "parenthesized expression", + RestElement: "rest element", + UpdateExpression: { + true: "prefix operation", + false: "postfix operation" + }, + VariableDeclarator: "variable declaration", + YieldExpression: "yield expression" +}; + +const toNodeDescription = ({ + type, + prefix +}) => type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[String(prefix)] : NodeDescriptions[type]; + +var StandardErrors = (_ => ({ + AccessorIsGenerator: _(({ + kind + }) => `A ${kind}ter cannot be a generator.`), + ArgumentsInClass: _("'arguments' is only allowed in functions and class methods."), + AsyncFunctionInSingleStatementContext: _("Async functions can only be declared at the top level or inside a block."), + AwaitBindingIdentifier: _("Can not use 'await' as identifier inside an async function."), + AwaitBindingIdentifierInStaticBlock: _("Can not use 'await' as identifier inside a static block."), + AwaitExpressionFormalParameter: _("'await' is not allowed in async function parameters."), + AwaitNotInAsyncContext: _("'await' is only allowed within async functions and at the top levels of modules."), + AwaitNotInAsyncFunction: _("'await' is only allowed within async functions."), + BadGetterArity: _("A 'get' accesor must not have any formal parameters."), + BadSetterArity: _("A 'set' accesor must have exactly one formal parameter."), + BadSetterRestParameter: _("A 'set' accesor function argument must not be a rest parameter."), + ConstructorClassField: _("Classes may not have a field named 'constructor'."), + ConstructorClassPrivateField: _("Classes may not have a private field named '#constructor'."), + ConstructorIsAccessor: _("Class constructor may not be an accessor."), + ConstructorIsAsync: _("Constructor can't be an async function."), + ConstructorIsGenerator: _("Constructor can't be a generator."), + DeclarationMissingInitializer: _(({ + kind + }) => `Missing initializer in ${kind} declaration.`), + DecoratorBeforeExport: _("Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax."), + DecoratorConstructor: _("Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?"), + DecoratorExportClass: _("Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead."), + DecoratorSemicolon: _("Decorators must not be followed by a semicolon."), + DecoratorStaticBlock: _("Decorators can't be used with a static block."), + DeletePrivateField: _("Deleting a private field is not allowed."), + DestructureNamedImport: _("ES2015 named imports do not destructure. Use another statement for destructuring after the import."), + DuplicateConstructor: _("Duplicate constructor in the same class."), + DuplicateDefaultExport: _("Only one default export allowed per module."), + DuplicateExport: _(({ + exportName + }) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`), + DuplicateProto: _("Redefinition of __proto__ property."), + DuplicateRegExpFlags: _("Duplicate regular expression flag."), + ElementAfterRest: _("Rest element must be last element."), + EscapedCharNotAnIdentifier: _("Invalid Unicode escape."), + ExportBindingIsString: _(({ + localName, + exportName + }) => `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`), + ExportDefaultFromAsIdentifier: _("'from' is not allowed as an identifier after 'export default'."), + ForInOfLoopInitializer: _(({ + type + }) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`), + ForOfAsync: _("The left-hand side of a for-of loop may not be 'async'."), + ForOfLet: _("The left-hand side of a for-of loop may not start with 'let'."), + GeneratorInSingleStatementContext: _("Generators can only be declared at the top level or inside a block."), + IllegalBreakContinue: _(({ + type + }) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`), + IllegalLanguageModeDirective: _("Illegal 'use strict' directive in function with non-simple parameter list."), + IllegalReturn: _("'return' outside of function."), + ImportBindingIsString: _(({ + importName + }) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`), + ImportCallArgumentTrailingComma: _("Trailing comma is disallowed inside import(...) arguments."), + ImportCallArity: _(({ + maxArgumentCount + }) => `\`import()\` requires exactly ${maxArgumentCount === 1 ? "one argument" : "one or two arguments"}.`), + ImportCallNotNewExpression: _("Cannot use new with import(...)."), + ImportCallSpreadArgument: _("`...` is not allowed in `import()`."), + IncompatibleRegExpUVFlags: _("The 'u' and 'v' regular expression flags cannot be enabled at the same time."), + InvalidBigIntLiteral: _("Invalid BigIntLiteral."), + InvalidCodePoint: _("Code point out of bounds."), + InvalidCoverInitializedName: _("Invalid shorthand property initializer."), + InvalidDecimal: _("Invalid decimal."), + InvalidDigit: _(({ + radix + }) => `Expected number in radix ${radix}.`), + InvalidEscapeSequence: _("Bad character escape sequence."), + InvalidEscapeSequenceTemplate: _("Invalid escape sequence in template."), + InvalidEscapedReservedWord: _(({ + reservedWord + }) => `Escape sequence in keyword ${reservedWord}.`), + InvalidIdentifier: _(({ + identifierName + }) => `Invalid identifier ${identifierName}.`), + InvalidLhs: _(({ + ancestor + }) => `Invalid left-hand side in ${toNodeDescription(ancestor)}.`), + InvalidLhsBinding: _(({ + ancestor + }) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`), + InvalidNumber: _("Invalid number."), + InvalidOrMissingExponent: _("Floating-point numbers require a valid exponent after the 'e'."), + InvalidOrUnexpectedToken: _(({ + unexpected + }) => `Unexpected character '${unexpected}'.`), + InvalidParenthesizedAssignment: _("Invalid parenthesized assignment pattern."), + InvalidPrivateFieldResolution: _(({ + identifierName + }) => `Private name #${identifierName} is not defined.`), + InvalidPropertyBindingPattern: _("Binding member expression."), + InvalidRecordProperty: _("Only properties and spread elements are allowed in record definitions."), + InvalidRestAssignmentPattern: _("Invalid rest operator's argument."), + LabelRedeclaration: _(({ + labelName + }) => `Label '${labelName}' is already declared.`), + LetInLexicalBinding: _("'let' is not allowed to be used as a name in 'let' or 'const' declarations."), + LineTerminatorBeforeArrow: _("No line break is allowed before '=>'."), + MalformedRegExpFlags: _("Invalid regular expression flag."), + MissingClassName: _("A class name is required."), + MissingEqInAssignment: _("Only '=' operator can be used for specifying default value."), + MissingSemicolon: _("Missing semicolon."), + MissingPlugin: _(({ + missingPlugin + }) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`), + MissingOneOfPlugins: _(({ + missingPlugin + }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`), + MissingUnicodeEscape: _("Expecting Unicode escape sequence \\uXXXX."), + MixingCoalesceWithLogical: _("Nullish coalescing operator(??) requires parens when mixing with logical operators."), + ModuleAttributeDifferentFromType: _("The only accepted module attribute is `type`."), + ModuleAttributeInvalidValue: _("Only string literals are allowed as module attribute values."), + ModuleAttributesWithDuplicateKeys: _(({ + key + }) => `Duplicate key "${key}" is not allowed in module attributes.`), + ModuleExportNameHasLoneSurrogate: _(({ + surrogateCharCode + }) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`), + ModuleExportUndefined: _(({ + localName + }) => `Export '${localName}' is not defined.`), + MultipleDefaultsInSwitch: _("Multiple default clauses."), + NewlineAfterThrow: _("Illegal newline after throw."), + NoCatchOrFinally: _("Missing catch or finally clause."), + NumberIdentifier: _("Identifier directly after number."), + NumericSeparatorInEscapeSequence: _("Numeric separators are not allowed inside unicode escape sequences or hex escape sequences."), + ObsoleteAwaitStar: _("'await*' has been removed from the async functions proposal. Use Promise.all() instead."), + OptionalChainingNoNew: _("Constructors in/after an Optional Chain are not allowed."), + OptionalChainingNoTemplate: _("Tagged Template Literals are not allowed in optionalChain."), + OverrideOnConstructor: _("'override' modifier cannot appear on a constructor declaration."), + ParamDupe: _("Argument name clash."), + PatternHasAccessor: _("Object pattern can't contain getter or setter."), + PatternHasMethod: _("Object pattern can't contain methods."), + PrivateInExpectedIn: _(({ + identifierName + }) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`), + PrivateNameRedeclaration: _(({ + identifierName + }) => `Duplicate private name #${identifierName}.`), + RecordExpressionBarIncorrectEndSyntaxType: _("Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'."), + RecordExpressionBarIncorrectStartSyntaxType: _("Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'."), + RecordExpressionHashIncorrectStartSyntaxType: _("Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'."), + RecordNoProto: _("'__proto__' is not allowed in Record expressions."), + RestTrailingComma: _("Unexpected trailing comma after rest element."), + SloppyFunction: _("In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement."), + StaticPrototype: _("Classes may not have static property named prototype."), + SuperNotAllowed: _("`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?"), + SuperPrivateField: _("Private fields can't be accessed on super."), + TrailingDecorator: _("Decorators must be attached to a class element."), + TupleExpressionBarIncorrectEndSyntaxType: _("Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'."), + TupleExpressionBarIncorrectStartSyntaxType: _("Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'."), + TupleExpressionHashIncorrectStartSyntaxType: _("Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'."), + UnexpectedArgumentPlaceholder: _("Unexpected argument placeholder."), + UnexpectedAwaitAfterPipelineBody: _('Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.'), + UnexpectedDigitAfterHash: _("Unexpected digit after hash token."), + UnexpectedImportExport: _("'import' and 'export' may only appear at the top level."), + UnexpectedKeyword: _(({ + keyword + }) => `Unexpected keyword '${keyword}'.`), + UnexpectedLeadingDecorator: _("Leading decorators must be attached to a class declaration."), + UnexpectedLexicalDeclaration: _("Lexical declaration cannot appear in a single-statement context."), + UnexpectedNewTarget: _("`new.target` can only be used in functions or class properties."), + UnexpectedNumericSeparator: _("A numeric separator is only allowed between two digits."), + UnexpectedPrivateField: _("Unexpected private name."), + UnexpectedReservedWord: _(({ + reservedWord + }) => `Unexpected reserved word '${reservedWord}'.`), + UnexpectedSuper: _("'super' is only allowed in object methods and classes."), + UnexpectedToken: _(({ + expected, + unexpected + }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`), + UnexpectedTokenUnaryExponentiation: _("Illegal expression. Wrap left hand side or entire exponentiation in parentheses."), + UnsupportedBind: _("Binding should be performed on object property."), + UnsupportedDecoratorExport: _("A decorated export must export a class declaration."), + UnsupportedDefaultExport: _("Only expressions, functions or classes are allowed as the `default` export."), + UnsupportedImport: _("`import` can only be used in `import()` or `import.meta`."), + UnsupportedMetaProperty: _(({ + target, + onlyValidPropertyName + }) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`), + UnsupportedParameterDecorator: _("Decorators cannot be used to decorate parameters."), + UnsupportedPropertyDecorator: _("Decorators cannot be used to decorate object literal properties."), + UnsupportedSuper: _("'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop])."), + UnterminatedComment: _("Unterminated comment."), + UnterminatedRegExp: _("Unterminated regular expression."), + UnterminatedString: _("Unterminated string constant."), + UnterminatedTemplate: _("Unterminated template."), + VarRedeclaration: _(({ + identifierName + }) => `Identifier '${identifierName}' has already been declared.`), + YieldBindingIdentifier: _("Can not use 'yield' as identifier inside a generator."), + YieldInParameter: _("Yield expression is not allowed in formal parameters."), + ZeroDigitNumericSeparator: _("Numeric separator can not be used after leading 0.") +})); + +var StrictModeErrors = (_ => ({ + StrictDelete: _("Deleting local variable in strict mode."), + StrictEvalArguments: _(({ + referenceName + }) => `Assigning to '${referenceName}' in strict mode.`), + StrictEvalArgumentsBinding: _(({ + bindingName + }) => `Binding '${bindingName}' in strict mode.`), + StrictFunction: _("In strict mode code, functions can only be declared at top level or inside a block."), + StrictNumericEscape: _("The only valid numeric escape in strict mode is '\\0'."), + StrictOctalLiteral: _("Legacy octal literals are not allowed in strict mode."), + StrictWith: _("'with' in strict mode.") +})); + +const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]); +var PipelineOperatorErrors = (_ => ({ + PipeBodyIsTighter: _("Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence."), + PipeTopicRequiresHackPipes: _('Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'), + PipeTopicUnbound: _("Topic reference is unbound; it must be inside a pipe body."), + PipeTopicUnconfiguredToken: _(({ + token + }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`), + PipeTopicUnused: _("Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once."), + PipeUnparenthesizedBody: _(({ + type + }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({ + type + })}; please wrap it in parentheses.`), + PipelineBodyNoArrow: _('Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.'), + PipelineBodySequenceExpression: _("Pipeline body may not be a comma-separated sequence expression."), + PipelineHeadSequenceExpression: _("Pipeline head should not be a comma-separated sequence expression."), + PipelineTopicUnused: _("Pipeline is in topic style but does not use topic reference."), + PrimaryTopicNotAllowed: _("Topic reference was used in a lexical context without topic binding."), + PrimaryTopicRequiresSmartPipeline: _('Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.') +})); + +const _excluded$1 = ["toMessage"]; + +function toParseErrorConstructor(_ref) { + let { + toMessage + } = _ref, + properties = _objectWithoutPropertiesLoose(_ref, _excluded$1); + + return function constructor({ + loc, + details + }) { + return instantiate(SyntaxError, Object.assign({}, properties, { + loc + }), { + clone(overrides = {}) { + const loc = overrides.loc || {}; + return constructor({ + loc: new Position("line" in loc ? loc.line : this.loc.line, "column" in loc ? loc.column : this.loc.column, "index" in loc ? loc.index : this.loc.index), + details: Object.assign({}, this.details, overrides.details) + }); + }, + + details: { + value: details, + enumerable: false + }, + message: { + get() { + return `${toMessage(this.details)} (${this.loc.line}:${this.loc.column})`; + }, + + set(value) { + Object.defineProperty(this, "message", { + value + }); + } + + }, + pos: { + reflect: "loc.index", + enumerable: true + }, + missingPlugin: "missingPlugin" in details && { + reflect: "details.missingPlugin", + enumerable: true + } + }); + }; +} + +function toParseErrorCredentials(toMessageOrMessage, credentials) { + return Object.assign({ + toMessage: typeof toMessageOrMessage === "string" ? () => toMessageOrMessage : toMessageOrMessage + }, credentials); +} +function ParseErrorEnum(argument, syntaxPlugin) { + if (Array.isArray(argument)) { + return toParseErrorCredentialsMap => ParseErrorEnum(toParseErrorCredentialsMap, argument[0]); + } + + const partialCredentials = argument(toParseErrorCredentials); + const ParseErrorConstructors = {}; + + for (const reasonCode of Object.keys(partialCredentials)) { + ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({ + code: ParseErrorCodes.SyntaxError, + reasonCode + }, syntaxPlugin ? { + syntaxPlugin + } : {}, partialCredentials[reasonCode])); + } + + return ParseErrorConstructors; +} +const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors)); + +const { + defineProperty +} = Object; + +const toUnenumerable = (object, key) => defineProperty(object, key, { + enumerable: false, + value: object[key] +}); + +function toESTreeLocation(node) { + toUnenumerable(node.loc.start, "index"); + toUnenumerable(node.loc.end, "index"); + return node; +} + +var estree = (superClass => class extends superClass { + parse() { + const file = toESTreeLocation(super.parse()); + + if (this.options.tokens) { + file.tokens = file.tokens.map(toESTreeLocation); + } + + return file; + } + + parseRegExpLiteral({ + pattern, + flags + }) { + let regex = null; + + try { + regex = new RegExp(pattern, flags); + } catch (e) {} + + const node = this.estreeParseLiteral(regex); + node.regex = { + pattern, + flags + }; + return node; + } + + parseBigIntLiteral(value) { + let bigInt; + + try { + bigInt = BigInt(value); + } catch (_unused) { + bigInt = null; + } + + const node = this.estreeParseLiteral(bigInt); + node.bigint = String(node.value || value); + return node; + } + + parseDecimalLiteral(value) { + const decimal = null; + const node = this.estreeParseLiteral(decimal); + node.decimal = String(node.value || value); + return node; + } + + estreeParseLiteral(value) { + return this.parseLiteral(value, "Literal"); + } + + parseStringLiteral(value) { + return this.estreeParseLiteral(value); + } + + parseNumericLiteral(value) { + return this.estreeParseLiteral(value); + } + + parseNullLiteral() { + return this.estreeParseLiteral(null); + } + + parseBooleanLiteral(value) { + return this.estreeParseLiteral(value); + } + + directiveToStmt(directive) { + const directiveLiteral = directive.value; + const stmt = this.startNodeAt(directive.start, directive.loc.start); + const expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start); + expression.value = directiveLiteral.extra.expressionValue; + expression.raw = directiveLiteral.extra.raw; + stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.loc.end); + stmt.directive = directiveLiteral.extra.raw.slice(1, -1); + return this.finishNodeAt(stmt, "ExpressionStatement", directive.loc.end); + } + + initFunction(node, isAsync) { + super.initFunction(node, isAsync); + node.expression = false; + } + + checkDeclaration(node) { + if (node != null && this.isObjectProperty(node)) { + this.checkDeclaration(node.value); + } else { + super.checkDeclaration(node); + } + } + + getObjectOrClassMethodParams(method) { + return method.value.params; + } + + isValidDirective(stmt) { + var _stmt$expression$extr; + + return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized); + } + + parseBlockBody(node, ...args) { + super.parseBlockBody(node, ...args); + const directiveStatements = node.directives.map(d => this.directiveToStmt(d)); + node.body = directiveStatements.concat(node.body); + delete node.directives; + } + + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true); + + if (method.typeParameters) { + method.value.typeParameters = method.typeParameters; + delete method.typeParameters; + } + + classBody.body.push(method); + } + + parsePrivateName() { + const node = super.parsePrivateName(); + { + if (!this.getPluginOption("estree", "classFeatures")) { + return node; + } + } + return this.convertPrivateNameToPrivateIdentifier(node); + } + + convertPrivateNameToPrivateIdentifier(node) { + const name = super.getPrivateNameSV(node); + node = node; + delete node.id; + node.name = name; + node.type = "PrivateIdentifier"; + return node; + } + + isPrivateName(node) { + { + if (!this.getPluginOption("estree", "classFeatures")) { + return super.isPrivateName(node); + } + } + return node.type === "PrivateIdentifier"; + } + + getPrivateNameSV(node) { + { + if (!this.getPluginOption("estree", "classFeatures")) { + return super.getPrivateNameSV(node); + } + } + return node.name; + } + + parseLiteral(value, type) { + const node = super.parseLiteral(value, type); + node.raw = node.extra.raw; + delete node.extra; + return node; + } + + parseFunctionBody(node, allowExpression, isMethod = false) { + super.parseFunctionBody(node, allowExpression, isMethod); + node.expression = node.body.type !== "BlockStatement"; + } + + parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { + let funcNode = this.startNode(); + funcNode.kind = node.kind; + funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); + funcNode.type = "FunctionExpression"; + delete funcNode.kind; + node.value = funcNode; + + if (type === "ClassPrivateMethod") { + node.computed = false; + } + + type = "MethodDefinition"; + return this.finishNode(node, type); + } + + parseClassProperty(...args) { + const propertyNode = super.parseClassProperty(...args); + { + if (!this.getPluginOption("estree", "classFeatures")) { + return propertyNode; + } + } + propertyNode.type = "PropertyDefinition"; + return propertyNode; + } + + parseClassPrivateProperty(...args) { + const propertyNode = super.parseClassPrivateProperty(...args); + { + if (!this.getPluginOption("estree", "classFeatures")) { + return propertyNode; + } + } + propertyNode.type = "PropertyDefinition"; + propertyNode.computed = false; + return propertyNode; + } + + parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { + const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor); + + if (node) { + node.type = "Property"; + if (node.kind === "method") node.kind = "init"; + node.shorthand = false; + } + + return node; + } + + parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) { + const node = super.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors); + + if (node) { + node.kind = "init"; + node.type = "Property"; + } + + return node; + } + + isValidLVal(type, ...rest) { + return type === "Property" ? "value" : super.isValidLVal(type, ...rest); + } + + isAssignable(node, isBinding) { + if (node != null && this.isObjectProperty(node)) { + return this.isAssignable(node.value, isBinding); + } + + return super.isAssignable(node, isBinding); + } + + toAssignable(node, isLHS = false) { + if (node != null && this.isObjectProperty(node)) { + const { + key, + value + } = node; + + if (this.isPrivateName(key)) { + this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); + } + + this.toAssignable(value, isLHS); + } else { + super.toAssignable(node, isLHS); + } + } + + toAssignableObjectExpressionProp(prop) { + if (prop.kind === "get" || prop.kind === "set") { + this.raise(Errors.PatternHasAccessor, { + at: prop.key + }); + } else if (prop.method) { + this.raise(Errors.PatternHasMethod, { + at: prop.key + }); + } else { + super.toAssignableObjectExpressionProp(...arguments); + } + } + + finishCallExpression(node, optional) { + super.finishCallExpression(node, optional); + + if (node.callee.type === "Import") { + node.type = "ImportExpression"; + node.source = node.arguments[0]; + + if (this.hasPlugin("importAssertions")) { + var _node$arguments$; + + node.attributes = (_node$arguments$ = node.arguments[1]) != null ? _node$arguments$ : null; + } + + delete node.arguments; + delete node.callee; + } + + return node; + } + + toReferencedArguments(node) { + if (node.type === "ImportExpression") { + return; + } + + super.toReferencedArguments(node); + } + + parseExport(node) { + super.parseExport(node); + + switch (node.type) { + case "ExportAllDeclaration": + node.exported = null; + break; + + case "ExportNamedDeclaration": + if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") { + node.type = "ExportAllDeclaration"; + node.exported = node.specifiers[0].exported; + delete node.specifiers; + } + + break; + } + + return node; + } + + parseSubscript(base, startPos, startLoc, noCalls, state) { + const node = super.parseSubscript(base, startPos, startLoc, noCalls, state); + + if (state.optionalChainMember) { + if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") { + node.type = node.type.substring(8); + } + + if (state.stop) { + const chain = this.startNodeAtNode(node); + chain.expression = node; + return this.finishNode(chain, "ChainExpression"); + } + } else if (node.type === "MemberExpression" || node.type === "CallExpression") { + node.optional = false; + } + + return node; + } + + hasPropertyAsPrivateName(node) { + if (node.type === "ChainExpression") { + node = node.expression; + } + + return super.hasPropertyAsPrivateName(node); + } + + isOptionalChain(node) { + return node.type === "ChainExpression"; + } + + isObjectProperty(node) { + return node.type === "Property" && node.kind === "init" && !node.method; + } + + isObjectMethod(node) { + return node.method || node.kind === "get" || node.kind === "set"; + } + + finishNodeAt(node, type, endLoc) { + return toESTreeLocation(super.finishNodeAt(node, type, endLoc)); + } + + resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { + super.resetEndLocation(node, endLoc); + toESTreeLocation(node); + } + +}); + +class TokContext { + constructor(token, preserveSpace) { + this.token = void 0; + this.preserveSpace = void 0; + this.token = token; + this.preserveSpace = !!preserveSpace; + } + +} +const types = { + brace: new TokContext("{"), + j_oTag: new TokContext("...", true) +}; +{ + types.template = new TokContext("`", true); +} + +const beforeExpr = true; +const startsExpr = true; +const isLoop = true; +const isAssign = true; +const prefix = true; +const postfix = true; +class ExportedTokenType { + constructor(label, conf = {}) { + this.label = void 0; + this.keyword = void 0; + this.beforeExpr = void 0; + this.startsExpr = void 0; + this.rightAssociative = void 0; + this.isLoop = void 0; + this.isAssign = void 0; + this.prefix = void 0; + this.postfix = void 0; + this.binop = void 0; + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.rightAssociative = !!conf.rightAssociative; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop != null ? conf.binop : null; + { + this.updateContext = null; + } + } + +} +const keywords$1 = new Map(); + +function createKeyword(name, options = {}) { + options.keyword = name; + const token = createToken(name, options); + keywords$1.set(name, token); + return token; +} + +function createBinop(name, binop) { + return createToken(name, { + beforeExpr, + binop + }); +} + +let tokenTypeCounter = -1; +const tokenTypes = []; +const tokenLabels = []; +const tokenBinops = []; +const tokenBeforeExprs = []; +const tokenStartsExprs = []; +const tokenPrefixes = []; + +function createToken(name, options = {}) { + var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix; + + ++tokenTypeCounter; + tokenLabels.push(name); + tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1); + tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false); + tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false); + tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false); + tokenTypes.push(new ExportedTokenType(name, options)); + return tokenTypeCounter; +} + +function createKeywordLike(name, options = {}) { + var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2; + + ++tokenTypeCounter; + keywords$1.set(name, tokenTypeCounter); + tokenLabels.push(name); + tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1); + tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false); + tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false); + tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false); + tokenTypes.push(new ExportedTokenType("name", options)); + return tokenTypeCounter; +} + +const tt = { + bracketL: createToken("[", { + beforeExpr, + startsExpr + }), + bracketHashL: createToken("#[", { + beforeExpr, + startsExpr + }), + bracketBarL: createToken("[|", { + beforeExpr, + startsExpr + }), + bracketR: createToken("]"), + bracketBarR: createToken("|]"), + braceL: createToken("{", { + beforeExpr, + startsExpr + }), + braceBarL: createToken("{|", { + beforeExpr, + startsExpr + }), + braceHashL: createToken("#{", { + beforeExpr, + startsExpr + }), + braceR: createToken("}", { + beforeExpr + }), + braceBarR: createToken("|}"), + parenL: createToken("(", { + beforeExpr, + startsExpr + }), + parenR: createToken(")"), + comma: createToken(",", { + beforeExpr + }), + semi: createToken(";", { + beforeExpr + }), + colon: createToken(":", { + beforeExpr + }), + doubleColon: createToken("::", { + beforeExpr + }), + dot: createToken("."), + question: createToken("?", { + beforeExpr + }), + questionDot: createToken("?."), + arrow: createToken("=>", { + beforeExpr + }), + template: createToken("template"), + ellipsis: createToken("...", { + beforeExpr + }), + backQuote: createToken("`", { + startsExpr + }), + dollarBraceL: createToken("${", { + beforeExpr, + startsExpr + }), + templateTail: createToken("...`", { + startsExpr + }), + templateNonTail: createToken("...${", { + beforeExpr, + startsExpr + }), + at: createToken("@"), + hash: createToken("#", { + startsExpr + }), + interpreterDirective: createToken("#!..."), + eq: createToken("=", { + beforeExpr, + isAssign + }), + assign: createToken("_=", { + beforeExpr, + isAssign + }), + slashAssign: createToken("_=", { + beforeExpr, + isAssign + }), + xorAssign: createToken("_=", { + beforeExpr, + isAssign + }), + moduloAssign: createToken("_=", { + beforeExpr, + isAssign + }), + incDec: createToken("++/--", { + prefix, + postfix, + startsExpr + }), + bang: createToken("!", { + beforeExpr, + prefix, + startsExpr + }), + tilde: createToken("~", { + beforeExpr, + prefix, + startsExpr + }), + doubleCaret: createToken("^^", { + startsExpr + }), + doubleAt: createToken("@@", { + startsExpr + }), + pipeline: createBinop("|>", 0), + nullishCoalescing: createBinop("??", 1), + logicalOR: createBinop("||", 1), + logicalAND: createBinop("&&", 2), + bitwiseOR: createBinop("|", 3), + bitwiseXOR: createBinop("^", 4), + bitwiseAND: createBinop("&", 5), + equality: createBinop("==/!=/===/!==", 6), + lt: createBinop("/<=/>=", 7), + gt: createBinop("/<=/>=", 7), + relational: createBinop("/<=/>=", 7), + bitShift: createBinop("<>/>>>", 8), + bitShiftL: createBinop("<>/>>>", 8), + bitShiftR: createBinop("<>/>>>", 8), + plusMin: createToken("+/-", { + beforeExpr, + binop: 9, + prefix, + startsExpr + }), + modulo: createToken("%", { + binop: 10, + startsExpr + }), + star: createToken("*", { + binop: 10 + }), + slash: createBinop("/", 10), + exponent: createToken("**", { + beforeExpr, + binop: 11, + rightAssociative: true + }), + _in: createKeyword("in", { + beforeExpr, + binop: 7 + }), + _instanceof: createKeyword("instanceof", { + beforeExpr, + binop: 7 + }), + _break: createKeyword("break"), + _case: createKeyword("case", { + beforeExpr + }), + _catch: createKeyword("catch"), + _continue: createKeyword("continue"), + _debugger: createKeyword("debugger"), + _default: createKeyword("default", { + beforeExpr + }), + _else: createKeyword("else", { + beforeExpr + }), + _finally: createKeyword("finally"), + _function: createKeyword("function", { + startsExpr + }), + _if: createKeyword("if"), + _return: createKeyword("return", { + beforeExpr + }), + _switch: createKeyword("switch"), + _throw: createKeyword("throw", { + beforeExpr, + prefix, + startsExpr + }), + _try: createKeyword("try"), + _var: createKeyword("var"), + _const: createKeyword("const"), + _with: createKeyword("with"), + _new: createKeyword("new", { + beforeExpr, + startsExpr + }), + _this: createKeyword("this", { + startsExpr + }), + _super: createKeyword("super", { + startsExpr + }), + _class: createKeyword("class", { + startsExpr + }), + _extends: createKeyword("extends", { + beforeExpr + }), + _export: createKeyword("export"), + _import: createKeyword("import", { + startsExpr + }), + _null: createKeyword("null", { + startsExpr + }), + _true: createKeyword("true", { + startsExpr + }), + _false: createKeyword("false", { + startsExpr + }), + _typeof: createKeyword("typeof", { + beforeExpr, + prefix, + startsExpr + }), + _void: createKeyword("void", { + beforeExpr, + prefix, + startsExpr + }), + _delete: createKeyword("delete", { + beforeExpr, + prefix, + startsExpr + }), + _do: createKeyword("do", { + isLoop, + beforeExpr + }), + _for: createKeyword("for", { + isLoop + }), + _while: createKeyword("while", { + isLoop + }), + _as: createKeywordLike("as", { + startsExpr + }), + _assert: createKeywordLike("assert", { + startsExpr + }), + _async: createKeywordLike("async", { + startsExpr + }), + _await: createKeywordLike("await", { + startsExpr + }), + _from: createKeywordLike("from", { + startsExpr + }), + _get: createKeywordLike("get", { + startsExpr + }), + _let: createKeywordLike("let", { + startsExpr + }), + _meta: createKeywordLike("meta", { + startsExpr + }), + _of: createKeywordLike("of", { + startsExpr + }), + _sent: createKeywordLike("sent", { + startsExpr + }), + _set: createKeywordLike("set", { + startsExpr + }), + _static: createKeywordLike("static", { + startsExpr + }), + _yield: createKeywordLike("yield", { + startsExpr + }), + _asserts: createKeywordLike("asserts", { + startsExpr + }), + _checks: createKeywordLike("checks", { + startsExpr + }), + _exports: createKeywordLike("exports", { + startsExpr + }), + _global: createKeywordLike("global", { + startsExpr + }), + _implements: createKeywordLike("implements", { + startsExpr + }), + _intrinsic: createKeywordLike("intrinsic", { + startsExpr + }), + _infer: createKeywordLike("infer", { + startsExpr + }), + _is: createKeywordLike("is", { + startsExpr + }), + _mixins: createKeywordLike("mixins", { + startsExpr + }), + _proto: createKeywordLike("proto", { + startsExpr + }), + _require: createKeywordLike("require", { + startsExpr + }), + _keyof: createKeywordLike("keyof", { + startsExpr + }), + _readonly: createKeywordLike("readonly", { + startsExpr + }), + _unique: createKeywordLike("unique", { + startsExpr + }), + _abstract: createKeywordLike("abstract", { + startsExpr + }), + _declare: createKeywordLike("declare", { + startsExpr + }), + _enum: createKeywordLike("enum", { + startsExpr + }), + _module: createKeywordLike("module", { + startsExpr + }), + _namespace: createKeywordLike("namespace", { + startsExpr + }), + _interface: createKeywordLike("interface", { + startsExpr + }), + _type: createKeywordLike("type", { + startsExpr + }), + _opaque: createKeywordLike("opaque", { + startsExpr + }), + name: createToken("name", { + startsExpr + }), + string: createToken("string", { + startsExpr + }), + num: createToken("num", { + startsExpr + }), + bigint: createToken("bigint", { + startsExpr + }), + decimal: createToken("decimal", { + startsExpr + }), + regexp: createToken("regexp", { + startsExpr + }), + privateName: createToken("#name", { + startsExpr + }), + eof: createToken("eof"), + jsxName: createToken("jsxName"), + jsxText: createToken("jsxText", { + beforeExpr: true + }), + jsxTagStart: createToken("jsxTagStart", { + startsExpr: true + }), + jsxTagEnd: createToken("jsxTagEnd"), + placeholder: createToken("%%", { + startsExpr: true + }) +}; +function tokenIsIdentifier(token) { + return token >= 93 && token <= 128; +} +function tokenKeywordOrIdentifierIsKeyword(token) { + return token <= 92; +} +function tokenIsKeywordOrIdentifier(token) { + return token >= 58 && token <= 128; +} +function tokenIsLiteralPropertyName(token) { + return token >= 58 && token <= 132; +} +function tokenComesBeforeExpression(token) { + return tokenBeforeExprs[token]; +} +function tokenCanStartExpression(token) { + return tokenStartsExprs[token]; +} +function tokenIsAssignment(token) { + return token >= 29 && token <= 33; +} +function tokenIsFlowInterfaceOrTypeOrOpaque(token) { + return token >= 125 && token <= 127; +} +function tokenIsLoop(token) { + return token >= 90 && token <= 92; +} +function tokenIsKeyword(token) { + return token >= 58 && token <= 92; +} +function tokenIsOperator(token) { + return token >= 39 && token <= 59; +} +function tokenIsPostfix(token) { + return token === 34; +} +function tokenIsPrefix(token) { + return tokenPrefixes[token]; +} +function tokenIsTSTypeOperator(token) { + return token >= 117 && token <= 119; +} +function tokenIsTSDeclarationStart(token) { + return token >= 120 && token <= 126; +} +function tokenLabelName(token) { + return tokenLabels[token]; +} +function tokenOperatorPrecedence(token) { + return tokenBinops[token]; +} +function tokenIsRightAssociative(token) { + return token === 57; +} +function tokenIsTemplate(token) { + return token >= 24 && token <= 25; +} +function getExportedToken(token) { + return tokenTypes[token]; +} +{ + tokenTypes[8].updateContext = context => { + context.pop(); + }; + + tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => { + context.push(types.brace); + }; + + tokenTypes[22].updateContext = context => { + if (context[context.length - 1] === types.template) { + context.pop(); + } else { + context.push(types.template); + } + }; + + tokenTypes[138].updateContext = context => { + context.push(types.j_expr, types.j_oTag); + }; +} + +let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; +const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; +const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; +const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; + +function isInAstralSet(code, set) { + let pos = 0x10000; + + for (let i = 0, length = set.length; i < length; i += 2) { + pos += set[i]; + if (pos > code) return false; + pos += set[i + 1]; + if (pos >= code) return true; + } + + return false; +} + +function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + + return isInAstralSet(code, astralIdentifierStartCodes); +} +function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + } + + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} + +const reservedWords = { + keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], + strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], + strictBind: ["eval", "arguments"] +}; +const keywords = new Set(reservedWords.keyword); +const reservedWordsStrictSet = new Set(reservedWords.strict); +const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); +function isReservedWord(word, inModule) { + return inModule && word === "await" || word === "enum"; +} +function isStrictReservedWord(word, inModule) { + return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); +} +function isStrictBindOnlyReservedWord(word) { + return reservedWordsStrictBindSet.has(word); +} +function isStrictBindReservedWord(word, inModule) { + return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); +} +function isKeyword(word) { + return keywords.has(word); +} + +function isIteratorStart(current, next, next2) { + return current === 64 && next === 64 && isIdentifierStart(next2); +} +const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]); +function canBeReservedWord(word) { + return reservedWordLikeSet.has(word); +} + +const SCOPE_OTHER = 0b000000000, + SCOPE_PROGRAM = 0b000000001, + SCOPE_FUNCTION = 0b000000010, + SCOPE_ARROW = 0b000000100, + SCOPE_SIMPLE_CATCH = 0b000001000, + SCOPE_SUPER = 0b000010000, + SCOPE_DIRECT_SUPER = 0b000100000, + SCOPE_CLASS = 0b001000000, + SCOPE_STATIC_BLOCK = 0b010000000, + SCOPE_TS_MODULE = 0b100000000, + SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE; +const BIND_KIND_VALUE = 0b000000000001, + BIND_KIND_TYPE = 0b000000000010, + BIND_SCOPE_VAR = 0b000000000100, + BIND_SCOPE_LEXICAL = 0b000000001000, + BIND_SCOPE_FUNCTION = 0b000000010000, + BIND_FLAGS_NONE = 0b000001000000, + BIND_FLAGS_CLASS = 0b000010000000, + BIND_FLAGS_TS_ENUM = 0b000100000000, + BIND_FLAGS_TS_CONST_ENUM = 0b001000000000, + BIND_FLAGS_TS_EXPORT_ONLY = 0b010000000000, + BIND_FLAGS_FLOW_DECLARE_FN = 0b100000000000; +const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS, + BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0, + BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0, + BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0, + BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS, + BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0, + BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM, + BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, + BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE, + BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE, + BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM, + BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, + BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN; +const CLASS_ELEMENT_FLAG_STATIC = 0b100, + CLASS_ELEMENT_KIND_GETTER = 0b010, + CLASS_ELEMENT_KIND_SETTER = 0b001, + CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER; +const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC, + CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC, + CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER, + CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER, + CLASS_ELEMENT_OTHER = 0; + +class BaseParser { + constructor() { + this.sawUnambiguousESM = false; + this.ambiguousScriptDifferentAst = false; + } + + hasPlugin(pluginConfig) { + if (typeof pluginConfig === "string") { + return this.plugins.has(pluginConfig); + } else { + const [pluginName, pluginOptions] = pluginConfig; + + if (!this.hasPlugin(pluginName)) { + return false; + } + + const actualOptions = this.plugins.get(pluginName); + + for (const key of Object.keys(pluginOptions)) { + if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) { + return false; + } + } + + return true; + } + } + + getPluginOption(plugin, name) { + var _this$plugins$get; + + return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name]; + } + +} + +function setTrailingComments(node, comments) { + if (node.trailingComments === undefined) { + node.trailingComments = comments; + } else { + node.trailingComments.unshift(...comments); + } +} + +function setLeadingComments(node, comments) { + if (node.leadingComments === undefined) { + node.leadingComments = comments; + } else { + node.leadingComments.unshift(...comments); + } +} + +function setInnerComments(node, comments) { + if (node.innerComments === undefined) { + node.innerComments = comments; + } else { + node.innerComments.unshift(...comments); + } +} + +function adjustInnerComments(node, elements, commentWS) { + let lastElement = null; + let i = elements.length; + + while (lastElement === null && i > 0) { + lastElement = elements[--i]; + } + + if (lastElement === null || lastElement.start > commentWS.start) { + setInnerComments(node, commentWS.comments); + } else { + setTrailingComments(lastElement, commentWS.comments); + } +} + +class CommentsParser extends BaseParser { + addComment(comment) { + if (this.filename) comment.loc.filename = this.filename; + this.state.comments.push(comment); + } + + processComment(node) { + const { + commentStack + } = this.state; + const commentStackLength = commentStack.length; + if (commentStackLength === 0) return; + let i = commentStackLength - 1; + const lastCommentWS = commentStack[i]; + + if (lastCommentWS.start === node.end) { + lastCommentWS.leadingNode = node; + i--; + } + + const { + start: nodeStart + } = node; + + for (; i >= 0; i--) { + const commentWS = commentStack[i]; + const commentEnd = commentWS.end; + + if (commentEnd > nodeStart) { + commentWS.containingNode = node; + this.finalizeComment(commentWS); + commentStack.splice(i, 1); + } else { + if (commentEnd === nodeStart) { + commentWS.trailingNode = node; + } + + break; + } + } + } + + finalizeComment(commentWS) { + const { + comments + } = commentWS; + + if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) { + if (commentWS.leadingNode !== null) { + setTrailingComments(commentWS.leadingNode, comments); + } + + if (commentWS.trailingNode !== null) { + setLeadingComments(commentWS.trailingNode, comments); + } + } else { + const { + containingNode: node, + start: commentStart + } = commentWS; + + if (this.input.charCodeAt(commentStart - 1) === 44) { + switch (node.type) { + case "ObjectExpression": + case "ObjectPattern": + case "RecordExpression": + adjustInnerComments(node, node.properties, commentWS); + break; + + case "CallExpression": + case "OptionalCallExpression": + adjustInnerComments(node, node.arguments, commentWS); + break; + + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + case "ObjectMethod": + case "ClassMethod": + case "ClassPrivateMethod": + adjustInnerComments(node, node.params, commentWS); + break; + + case "ArrayExpression": + case "ArrayPattern": + case "TupleExpression": + adjustInnerComments(node, node.elements, commentWS); + break; + + case "ExportNamedDeclaration": + case "ImportDeclaration": + adjustInnerComments(node, node.specifiers, commentWS); + break; + + default: + { + setInnerComments(node, comments); + } + } + } else { + setInnerComments(node, comments); + } + } + } + + finalizeRemainingComments() { + const { + commentStack + } = this.state; + + for (let i = commentStack.length - 1; i >= 0; i--) { + this.finalizeComment(commentStack[i]); + } + + this.state.commentStack = []; + } + + resetPreviousNodeTrailingComments(node) { + const { + commentStack + } = this.state; + const { + length + } = commentStack; + if (length === 0) return; + const commentWS = commentStack[length - 1]; + + if (commentWS.leadingNode === node) { + commentWS.leadingNode = null; + } + } + + takeSurroundingComments(node, start, end) { + const { + commentStack + } = this.state; + const commentStackLength = commentStack.length; + if (commentStackLength === 0) return; + let i = commentStackLength - 1; + + for (; i >= 0; i--) { + const commentWS = commentStack[i]; + const commentEnd = commentWS.end; + const commentStart = commentWS.start; + + if (commentStart === end) { + commentWS.leadingNode = node; + } else if (commentEnd === start) { + commentWS.trailingNode = node; + } else if (commentEnd < start) { + break; + } + } + } + +} + +const lineBreak = /\r\n?|[\n\u2028\u2029]/; +const lineBreakG = new RegExp(lineBreak.source, "g"); +function isNewLine(code) { + switch (code) { + case 10: + case 13: + case 8232: + case 8233: + return true; + + default: + return false; + } +} +const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; +const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y; +const skipWhiteSpaceToLineBreak = new RegExp("(?=(" + skipWhiteSpaceInLine.source + "))\\1" + /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y"); +function isWhitespace(code) { + switch (code) { + case 0x0009: + case 0x000b: + case 0x000c: + case 32: + case 160: + case 5760: + case 0x2000: + case 0x2001: + case 0x2002: + case 0x2003: + case 0x2004: + case 0x2005: + case 0x2006: + case 0x2007: + case 0x2008: + case 0x2009: + case 0x200a: + case 0x202f: + case 0x205f: + case 0x3000: + case 0xfeff: + return true; + + default: + return false; + } +} + +class State { + constructor() { + this.strict = void 0; + this.curLine = void 0; + this.lineStart = void 0; + this.startLoc = void 0; + this.endLoc = void 0; + this.errors = []; + this.potentialArrowAt = -1; + this.noArrowAt = []; + this.noArrowParamsConversionAt = []; + this.maybeInArrowParameters = false; + this.inType = false; + this.noAnonFunctionType = false; + this.hasFlowComment = false; + this.isAmbientContext = false; + this.inAbstractClass = false; + this.topicContext = { + maxNumOfResolvableTopics: 0, + maxTopicIndex: null + }; + this.soloAwait = false; + this.inFSharpPipelineDirectBody = false; + this.labels = []; + this.decoratorStack = [[]]; + this.comments = []; + this.commentStack = []; + this.pos = 0; + this.type = 135; + this.value = null; + this.start = 0; + this.end = 0; + this.lastTokEndLoc = null; + this.lastTokStartLoc = null; + this.lastTokStart = 0; + this.context = [types.brace]; + this.canStartJSXElement = true; + this.containsEsc = false; + this.strictErrors = new Map(); + this.tokensLength = 0; + } + + init({ + strictMode, + sourceType, + startLine, + startColumn + }) { + this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === "module"; + this.curLine = startLine; + this.lineStart = -startColumn; + this.startLoc = this.endLoc = new Position(startLine, startColumn, 0); + } + + curPosition() { + return new Position(this.curLine, this.pos - this.lineStart, this.pos); + } + + clone(skipArrays) { + const state = new State(); + const keys = Object.keys(this); + + for (let i = 0, length = keys.length; i < length; i++) { + const key = keys[i]; + let val = this[key]; + + if (!skipArrays && Array.isArray(val)) { + val = val.slice(); + } + + state[key] = val; + } + + return state; + } + +} + +const _excluded = ["at"], + _excluded2 = ["at"]; + +var _isDigit = function isDigit(code) { + return code >= 48 && code <= 57; +}; +const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]); +const forbiddenNumericSeparatorSiblings = { + decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]), + hex: new Set([46, 88, 95, 120]) +}; +const isAllowedNumericSeparatorSibling = { + bin: ch => ch === 48 || ch === 49, + oct: ch => ch >= 48 && ch <= 55, + dec: ch => ch >= 48 && ch <= 57, + hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102 +}; +class Token { + constructor(state) { + this.type = state.type; + this.value = state.value; + this.start = state.start; + this.end = state.end; + this.loc = new SourceLocation(state.startLoc, state.endLoc); + } + +} +class Tokenizer extends CommentsParser { + constructor(options, input) { + super(); + this.isLookahead = void 0; + this.tokens = []; + this.state = new State(); + this.state.init(options); + this.input = input; + this.length = input.length; + this.isLookahead = false; + } + + pushToken(token) { + this.tokens.length = this.state.tokensLength; + this.tokens.push(token); + ++this.state.tokensLength; + } + + next() { + this.checkKeywordEscapes(); + + if (this.options.tokens) { + this.pushToken(new Token(this.state)); + } + + this.state.lastTokStart = this.state.start; + this.state.lastTokEndLoc = this.state.endLoc; + this.state.lastTokStartLoc = this.state.startLoc; + this.nextToken(); + } + + eat(type) { + if (this.match(type)) { + this.next(); + return true; + } else { + return false; + } + } + + match(type) { + return this.state.type === type; + } + + createLookaheadState(state) { + return { + pos: state.pos, + value: null, + type: state.type, + start: state.start, + end: state.end, + context: [this.curContext()], + inType: state.inType, + startLoc: state.startLoc, + lastTokEndLoc: state.lastTokEndLoc, + curLine: state.curLine, + lineStart: state.lineStart, + curPosition: state.curPosition + }; + } + + lookahead() { + const old = this.state; + this.state = this.createLookaheadState(old); + this.isLookahead = true; + this.nextToken(); + this.isLookahead = false; + const curr = this.state; + this.state = old; + return curr; + } + + nextTokenStart() { + return this.nextTokenStartSince(this.state.pos); + } + + nextTokenStartSince(pos) { + skipWhiteSpace.lastIndex = pos; + return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos; + } + + lookaheadCharCode() { + return this.input.charCodeAt(this.nextTokenStart()); + } + + codePointAtPos(pos) { + let cp = this.input.charCodeAt(pos); + + if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) { + const trail = this.input.charCodeAt(pos); + + if ((trail & 0xfc00) === 0xdc00) { + cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); + } + } + + return cp; + } + + setStrict(strict) { + this.state.strict = strict; + + if (strict) { + this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, { + at + })); + this.state.strictErrors.clear(); + } + } + + curContext() { + return this.state.context[this.state.context.length - 1]; + } + + nextToken() { + this.skipSpace(); + this.state.start = this.state.pos; + if (!this.isLookahead) this.state.startLoc = this.state.curPosition(); + + if (this.state.pos >= this.length) { + this.finishToken(135); + return; + } + + this.getTokenFromCode(this.codePointAtPos(this.state.pos)); + } + + skipBlockComment() { + let startLoc; + if (!this.isLookahead) startLoc = this.state.curPosition(); + const start = this.state.pos; + const end = this.input.indexOf("*/", start + 2); + + if (end === -1) { + throw this.raise(Errors.UnterminatedComment, { + at: this.state.curPosition() + }); + } + + this.state.pos = end + 2; + lineBreakG.lastIndex = start + 2; + + while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) { + ++this.state.curLine; + this.state.lineStart = lineBreakG.lastIndex; + } + + if (this.isLookahead) return; + const comment = { + type: "CommentBlock", + value: this.input.slice(start + 2, end), + start, + end: end + 2, + loc: new SourceLocation(startLoc, this.state.curPosition()) + }; + if (this.options.tokens) this.pushToken(comment); + return comment; + } + + skipLineComment(startSkip) { + const start = this.state.pos; + let startLoc; + if (!this.isLookahead) startLoc = this.state.curPosition(); + let ch = this.input.charCodeAt(this.state.pos += startSkip); + + if (this.state.pos < this.length) { + while (!isNewLine(ch) && ++this.state.pos < this.length) { + ch = this.input.charCodeAt(this.state.pos); + } + } + + if (this.isLookahead) return; + const end = this.state.pos; + const value = this.input.slice(start + startSkip, end); + const comment = { + type: "CommentLine", + value, + start, + end, + loc: new SourceLocation(startLoc, this.state.curPosition()) + }; + if (this.options.tokens) this.pushToken(comment); + return comment; + } + + skipSpace() { + const spaceStart = this.state.pos; + const comments = []; + + loop: while (this.state.pos < this.length) { + const ch = this.input.charCodeAt(this.state.pos); + + switch (ch) { + case 32: + case 160: + case 9: + ++this.state.pos; + break; + + case 13: + if (this.input.charCodeAt(this.state.pos + 1) === 10) { + ++this.state.pos; + } + + case 10: + case 8232: + case 8233: + ++this.state.pos; + ++this.state.curLine; + this.state.lineStart = this.state.pos; + break; + + case 47: + switch (this.input.charCodeAt(this.state.pos + 1)) { + case 42: + { + const comment = this.skipBlockComment(); + + if (comment !== undefined) { + this.addComment(comment); + if (this.options.attachComment) comments.push(comment); + } + + break; + } + + case 47: + { + const comment = this.skipLineComment(2); + + if (comment !== undefined) { + this.addComment(comment); + if (this.options.attachComment) comments.push(comment); + } + + break; + } + + default: + break loop; + } + + break; + + default: + if (isWhitespace(ch)) { + ++this.state.pos; + } else if (ch === 45 && !this.inModule) { + const pos = this.state.pos; + + if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) { + const comment = this.skipLineComment(3); + + if (comment !== undefined) { + this.addComment(comment); + if (this.options.attachComment) comments.push(comment); + } + } else { + break loop; + } + } else if (ch === 60 && !this.inModule) { + const pos = this.state.pos; + + if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) { + const comment = this.skipLineComment(4); + + if (comment !== undefined) { + this.addComment(comment); + if (this.options.attachComment) comments.push(comment); + } + } else { + break loop; + } + } else { + break loop; + } + + } + } + + if (comments.length > 0) { + const end = this.state.pos; + const CommentWhitespace = { + start: spaceStart, + end, + comments, + leadingNode: null, + trailingNode: null, + containingNode: null + }; + this.state.commentStack.push(CommentWhitespace); + } + } + + finishToken(type, val) { + this.state.end = this.state.pos; + this.state.endLoc = this.state.curPosition(); + const prevType = this.state.type; + this.state.type = type; + this.state.value = val; + + if (!this.isLookahead) { + this.updateContext(prevType); + } + } + + replaceToken(type) { + this.state.type = type; + this.updateContext(); + } + + readToken_numberSign() { + if (this.state.pos === 0 && this.readToken_interpreter()) { + return; + } + + const nextPos = this.state.pos + 1; + const next = this.codePointAtPos(nextPos); + + if (next >= 48 && next <= 57) { + throw this.raise(Errors.UnexpectedDigitAfterHash, { + at: this.state.curPosition() + }); + } + + if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) { + this.expectPlugin("recordAndTuple"); + + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "hash") { + throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, { + at: this.state.curPosition() + }); + } + + this.state.pos += 2; + + if (next === 123) { + this.finishToken(7); + } else { + this.finishToken(1); + } + } else if (isIdentifierStart(next)) { + ++this.state.pos; + this.finishToken(134, this.readWord1(next)); + } else if (next === 92) { + ++this.state.pos; + this.finishToken(134, this.readWord1()); + } else { + this.finishOp(27, 1); + } + } + + readToken_dot() { + const next = this.input.charCodeAt(this.state.pos + 1); + + if (next >= 48 && next <= 57) { + this.readNumber(true); + return; + } + + if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) { + this.state.pos += 3; + this.finishToken(21); + } else { + ++this.state.pos; + this.finishToken(16); + } + } + + readToken_slash() { + const next = this.input.charCodeAt(this.state.pos + 1); + + if (next === 61) { + this.finishOp(31, 2); + } else { + this.finishOp(56, 1); + } + } + + readToken_interpreter() { + if (this.state.pos !== 0 || this.length < 2) return false; + let ch = this.input.charCodeAt(this.state.pos + 1); + if (ch !== 33) return false; + const start = this.state.pos; + this.state.pos += 1; + + while (!isNewLine(ch) && ++this.state.pos < this.length) { + ch = this.input.charCodeAt(this.state.pos); + } + + const value = this.input.slice(start + 2, this.state.pos); + this.finishToken(28, value); + return true; + } + + readToken_mult_modulo(code) { + let type = code === 42 ? 55 : 54; + let width = 1; + let next = this.input.charCodeAt(this.state.pos + 1); + + if (code === 42 && next === 42) { + width++; + next = this.input.charCodeAt(this.state.pos + 2); + type = 57; + } + + if (next === 61 && !this.state.inType) { + width++; + type = code === 37 ? 33 : 30; + } + + this.finishOp(type, width); + } + + readToken_pipe_amp(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + + if (next === code) { + if (this.input.charCodeAt(this.state.pos + 2) === 61) { + this.finishOp(30, 3); + } else { + this.finishOp(code === 124 ? 41 : 42, 2); + } + + return; + } + + if (code === 124) { + if (next === 62) { + this.finishOp(39, 2); + return; + } + + if (this.hasPlugin("recordAndTuple") && next === 125) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, { + at: this.state.curPosition() + }); + } + + this.state.pos += 2; + this.finishToken(9); + return; + } + + if (this.hasPlugin("recordAndTuple") && next === 93) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, { + at: this.state.curPosition() + }); + } + + this.state.pos += 2; + this.finishToken(4); + return; + } + } + + if (next === 61) { + this.finishOp(30, 2); + return; + } + + this.finishOp(code === 124 ? 43 : 45, 1); + } + + readToken_caret() { + const next = this.input.charCodeAt(this.state.pos + 1); + + if (next === 61 && !this.state.inType) { + this.finishOp(32, 2); + } else if (next === 94 && this.hasPlugin(["pipelineOperator", { + proposal: "hack", + topicToken: "^^" + }])) { + this.finishOp(37, 2); + const lookaheadCh = this.input.codePointAt(this.state.pos); + + if (lookaheadCh === 94) { + throw this.unexpected(); + } + } else { + this.finishOp(44, 1); + } + } + + readToken_atSign() { + const next = this.input.charCodeAt(this.state.pos + 1); + + if (next === 64 && this.hasPlugin(["pipelineOperator", { + proposal: "hack", + topicToken: "@@" + }])) { + this.finishOp(38, 2); + } else { + this.finishOp(26, 1); + } + } + + readToken_plus_min(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + + if (next === code) { + this.finishOp(34, 2); + return; + } + + if (next === 61) { + this.finishOp(30, 2); + } else { + this.finishOp(53, 1); + } + } + + readToken_lt() { + const { + pos + } = this.state; + const next = this.input.charCodeAt(pos + 1); + + if (next === 60) { + if (this.input.charCodeAt(pos + 2) === 61) { + this.finishOp(30, 3); + return; + } + + this.finishOp(51, 2); + return; + } + + if (next === 61) { + this.finishOp(49, 2); + return; + } + + this.finishOp(47, 1); + } + + readToken_gt() { + const { + pos + } = this.state; + const next = this.input.charCodeAt(pos + 1); + + if (next === 62) { + const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2; + + if (this.input.charCodeAt(pos + size) === 61) { + this.finishOp(30, size + 1); + return; + } + + this.finishOp(52, size); + return; + } + + if (next === 61) { + this.finishOp(49, 2); + return; + } + + this.finishOp(48, 1); + } + + readToken_eq_excl(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + + if (next === 61) { + this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2); + return; + } + + if (code === 61 && next === 62) { + this.state.pos += 2; + this.finishToken(19); + return; + } + + this.finishOp(code === 61 ? 29 : 35, 1); + } + + readToken_question() { + const next = this.input.charCodeAt(this.state.pos + 1); + const next2 = this.input.charCodeAt(this.state.pos + 2); + + if (next === 63) { + if (next2 === 61) { + this.finishOp(30, 3); + } else { + this.finishOp(40, 2); + } + } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) { + this.state.pos += 2; + this.finishToken(18); + } else { + ++this.state.pos; + this.finishToken(17); + } + } + + getTokenFromCode(code) { + switch (code) { + case 46: + this.readToken_dot(); + return; + + case 40: + ++this.state.pos; + this.finishToken(10); + return; + + case 41: + ++this.state.pos; + this.finishToken(11); + return; + + case 59: + ++this.state.pos; + this.finishToken(13); + return; + + case 44: + ++this.state.pos; + this.finishToken(12); + return; + + case 91: + if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, { + at: this.state.curPosition() + }); + } + + this.state.pos += 2; + this.finishToken(2); + } else { + ++this.state.pos; + this.finishToken(0); + } + + return; + + case 93: + ++this.state.pos; + this.finishToken(3); + return; + + case 123: + if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, { + at: this.state.curPosition() + }); + } + + this.state.pos += 2; + this.finishToken(6); + } else { + ++this.state.pos; + this.finishToken(5); + } + + return; + + case 125: + ++this.state.pos; + this.finishToken(8); + return; + + case 58: + if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) { + this.finishOp(15, 2); + } else { + ++this.state.pos; + this.finishToken(14); + } + + return; + + case 63: + this.readToken_question(); + return; + + case 96: + this.readTemplateToken(); + return; + + case 48: + { + const next = this.input.charCodeAt(this.state.pos + 1); + + if (next === 120 || next === 88) { + this.readRadixNumber(16); + return; + } + + if (next === 111 || next === 79) { + this.readRadixNumber(8); + return; + } + + if (next === 98 || next === 66) { + this.readRadixNumber(2); + return; + } + } + + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + this.readNumber(false); + return; + + case 34: + case 39: + this.readString(code); + return; + + case 47: + this.readToken_slash(); + return; + + case 37: + case 42: + this.readToken_mult_modulo(code); + return; + + case 124: + case 38: + this.readToken_pipe_amp(code); + return; + + case 94: + this.readToken_caret(); + return; + + case 43: + case 45: + this.readToken_plus_min(code); + return; + + case 60: + this.readToken_lt(); + return; + + case 62: + this.readToken_gt(); + return; + + case 61: + case 33: + this.readToken_eq_excl(code); + return; + + case 126: + this.finishOp(36, 1); + return; + + case 64: + this.readToken_atSign(); + return; + + case 35: + this.readToken_numberSign(); + return; + + case 92: + this.readWord(); + return; + + default: + if (isIdentifierStart(code)) { + this.readWord(code); + return; + } + + } + + throw this.raise(Errors.InvalidOrUnexpectedToken, { + at: this.state.curPosition(), + unexpected: String.fromCodePoint(code) + }); + } + + finishOp(type, size) { + const str = this.input.slice(this.state.pos, this.state.pos + size); + this.state.pos += size; + this.finishToken(type, str); + } + + readRegexp() { + const startLoc = this.state.startLoc; + const start = this.state.start + 1; + let escaped, inClass; + let { + pos + } = this.state; + + for (;; ++pos) { + if (pos >= this.length) { + throw this.raise(Errors.UnterminatedRegExp, { + at: createPositionWithColumnOffset(startLoc, 1) + }); + } + + const ch = this.input.charCodeAt(pos); + + if (isNewLine(ch)) { + throw this.raise(Errors.UnterminatedRegExp, { + at: createPositionWithColumnOffset(startLoc, 1) + }); + } + + if (escaped) { + escaped = false; + } else { + if (ch === 91) { + inClass = true; + } else if (ch === 93 && inClass) { + inClass = false; + } else if (ch === 47 && !inClass) { + break; + } + + escaped = ch === 92; + } + } + + const content = this.input.slice(start, pos); + ++pos; + let mods = ""; + + const nextPos = () => createPositionWithColumnOffset(startLoc, pos + 2 - start); + + while (pos < this.length) { + const cp = this.codePointAtPos(pos); + const char = String.fromCharCode(cp); + + if (VALID_REGEX_FLAGS.has(cp)) { + if (cp === 118) { + this.expectPlugin("regexpUnicodeSets", nextPos()); + + if (mods.includes("u")) { + this.raise(Errors.IncompatibleRegExpUVFlags, { + at: nextPos() + }); + } + } else if (cp === 117) { + if (mods.includes("v")) { + this.raise(Errors.IncompatibleRegExpUVFlags, { + at: nextPos() + }); + } + } + + if (mods.includes(char)) { + this.raise(Errors.DuplicateRegExpFlags, { + at: nextPos() + }); + } + } else if (isIdentifierChar(cp) || cp === 92) { + this.raise(Errors.MalformedRegExpFlags, { + at: nextPos() + }); + } else { + break; + } + + ++pos; + mods += char; + } + + this.state.pos = pos; + this.finishToken(133, { + pattern: content, + flags: mods + }); + } + + readInt(radix, len, forceLen, allowNumSeparator = true) { + const start = this.state.pos; + const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct; + const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin; + let invalid = false; + let total = 0; + + for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { + const code = this.input.charCodeAt(this.state.pos); + let val; + + if (code === 95 && allowNumSeparator !== "bail") { + const prev = this.input.charCodeAt(this.state.pos - 1); + const next = this.input.charCodeAt(this.state.pos + 1); + + if (!allowNumSeparator) { + this.raise(Errors.NumericSeparatorInEscapeSequence, { + at: this.state.curPosition() + }); + } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) { + this.raise(Errors.UnexpectedNumericSeparator, { + at: this.state.curPosition() + }); + } + + ++this.state.pos; + continue; + } + + if (code >= 97) { + val = code - 97 + 10; + } else if (code >= 65) { + val = code - 65 + 10; + } else if (_isDigit(code)) { + val = code - 48; + } else { + val = Infinity; + } + + if (val >= radix) { + if (this.options.errorRecovery && val <= 9) { + val = 0; + this.raise(Errors.InvalidDigit, { + at: this.state.curPosition(), + radix + }); + } else if (forceLen) { + val = 0; + invalid = true; + } else { + break; + } + } + + ++this.state.pos; + total = total * radix + val; + } + + if (this.state.pos === start || len != null && this.state.pos - start !== len || invalid) { + return null; + } + + return total; + } + + readRadixNumber(radix) { + const startLoc = this.state.curPosition(); + let isBigInt = false; + this.state.pos += 2; + const val = this.readInt(radix); + + if (val == null) { + this.raise(Errors.InvalidDigit, { + at: createPositionWithColumnOffset(startLoc, 2), + radix + }); + } + + const next = this.input.charCodeAt(this.state.pos); + + if (next === 110) { + ++this.state.pos; + isBigInt = true; + } else if (next === 109) { + throw this.raise(Errors.InvalidDecimal, { + at: startLoc + }); + } + + if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { + throw this.raise(Errors.NumberIdentifier, { + at: this.state.curPosition() + }); + } + + if (isBigInt) { + const str = this.input.slice(startLoc.index, this.state.pos).replace(/[_n]/g, ""); + this.finishToken(131, str); + return; + } + + this.finishToken(130, val); + } + + readNumber(startsWithDot) { + const start = this.state.pos; + const startLoc = this.state.curPosition(); + let isFloat = false; + let isBigInt = false; + let isDecimal = false; + let hasExponent = false; + let isOctal = false; + + if (!startsWithDot && this.readInt(10) === null) { + this.raise(Errors.InvalidNumber, { + at: this.state.curPosition() + }); + } + + const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48; + + if (hasLeadingZero) { + const integer = this.input.slice(start, this.state.pos); + this.recordStrictModeErrors(Errors.StrictOctalLiteral, { + at: startLoc + }); + + if (!this.state.strict) { + const underscorePos = integer.indexOf("_"); + + if (underscorePos > 0) { + this.raise(Errors.ZeroDigitNumericSeparator, { + at: createPositionWithColumnOffset(startLoc, underscorePos) + }); + } + } + + isOctal = hasLeadingZero && !/[89]/.test(integer); + } + + let next = this.input.charCodeAt(this.state.pos); + + if (next === 46 && !isOctal) { + ++this.state.pos; + this.readInt(10); + isFloat = true; + next = this.input.charCodeAt(this.state.pos); + } + + if ((next === 69 || next === 101) && !isOctal) { + next = this.input.charCodeAt(++this.state.pos); + + if (next === 43 || next === 45) { + ++this.state.pos; + } + + if (this.readInt(10) === null) { + this.raise(Errors.InvalidOrMissingExponent, { + at: startLoc + }); + } + + isFloat = true; + hasExponent = true; + next = this.input.charCodeAt(this.state.pos); + } + + if (next === 110) { + if (isFloat || hasLeadingZero) { + this.raise(Errors.InvalidBigIntLiteral, { + at: startLoc + }); + } + + ++this.state.pos; + isBigInt = true; + } + + if (next === 109) { + this.expectPlugin("decimal", this.state.curPosition()); + + if (hasExponent || hasLeadingZero) { + this.raise(Errors.InvalidDecimal, { + at: startLoc + }); + } + + ++this.state.pos; + isDecimal = true; + } + + if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { + throw this.raise(Errors.NumberIdentifier, { + at: this.state.curPosition() + }); + } + + const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, ""); + + if (isBigInt) { + this.finishToken(131, str); + return; + } + + if (isDecimal) { + this.finishToken(132, str); + return; + } + + const val = isOctal ? parseInt(str, 8) : parseFloat(str); + this.finishToken(130, val); + } + + readCodePoint(throwOnInvalid) { + const ch = this.input.charCodeAt(this.state.pos); + let code; + + if (ch === 123) { + ++this.state.pos; + code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, true, throwOnInvalid); + ++this.state.pos; + + if (code !== null && code > 0x10ffff) { + if (throwOnInvalid) { + this.raise(Errors.InvalidCodePoint, { + at: this.state.curPosition() + }); + } else { + return null; + } + } + } else { + code = this.readHexChar(4, false, throwOnInvalid); + } + + return code; + } + + readString(quote) { + let out = "", + chunkStart = ++this.state.pos; + + for (;;) { + if (this.state.pos >= this.length) { + throw this.raise(Errors.UnterminatedString, { + at: this.state.startLoc + }); + } + + const ch = this.input.charCodeAt(this.state.pos); + if (ch === quote) break; + + if (ch === 92) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.readEscapedChar(false); + chunkStart = this.state.pos; + } else if (ch === 8232 || ch === 8233) { + ++this.state.pos; + ++this.state.curLine; + this.state.lineStart = this.state.pos; + } else if (isNewLine(ch)) { + throw this.raise(Errors.UnterminatedString, { + at: this.state.startLoc + }); + } else { + ++this.state.pos; + } + } + + out += this.input.slice(chunkStart, this.state.pos++); + this.finishToken(129, out); + } + + readTemplateContinuation() { + if (!this.match(8)) { + this.unexpected(null, 8); + } + + this.state.pos--; + this.readTemplateToken(); + } + + readTemplateToken() { + let out = "", + chunkStart = this.state.pos, + containsInvalid = false; + ++this.state.pos; + + for (;;) { + if (this.state.pos >= this.length) { + throw this.raise(Errors.UnterminatedTemplate, { + at: createPositionWithColumnOffset(this.state.startLoc, 1) + }); + } + + const ch = this.input.charCodeAt(this.state.pos); + + if (ch === 96) { + ++this.state.pos; + out += this.input.slice(chunkStart, this.state.pos); + this.finishToken(24, containsInvalid ? null : out); + return; + } + + if (ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) { + this.state.pos += 2; + out += this.input.slice(chunkStart, this.state.pos); + this.finishToken(25, containsInvalid ? null : out); + return; + } + + if (ch === 92) { + out += this.input.slice(chunkStart, this.state.pos); + const escaped = this.readEscapedChar(true); + + if (escaped === null) { + containsInvalid = true; + } else { + out += escaped; + } + + chunkStart = this.state.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + ++this.state.pos; + + switch (ch) { + case 13: + if (this.input.charCodeAt(this.state.pos) === 10) { + ++this.state.pos; + } + + case 10: + out += "\n"; + break; + + default: + out += String.fromCharCode(ch); + break; + } + + ++this.state.curLine; + this.state.lineStart = this.state.pos; + chunkStart = this.state.pos; + } else { + ++this.state.pos; + } + } + } + + recordStrictModeErrors(toParseError, { + at + }) { + const index = at.index; + + if (this.state.strict && !this.state.strictErrors.has(index)) { + this.raise(toParseError, { + at + }); + } else { + this.state.strictErrors.set(index, [toParseError, at]); + } + } + + readEscapedChar(inTemplate) { + const throwOnInvalid = !inTemplate; + const ch = this.input.charCodeAt(++this.state.pos); + ++this.state.pos; + + switch (ch) { + case 110: + return "\n"; + + case 114: + return "\r"; + + case 120: + { + const code = this.readHexChar(2, false, throwOnInvalid); + return code === null ? null : String.fromCharCode(code); + } + + case 117: + { + const code = this.readCodePoint(throwOnInvalid); + return code === null ? null : String.fromCodePoint(code); + } + + case 116: + return "\t"; + + case 98: + return "\b"; + + case 118: + return "\u000b"; + + case 102: + return "\f"; + + case 13: + if (this.input.charCodeAt(this.state.pos) === 10) { + ++this.state.pos; + } + + case 10: + this.state.lineStart = this.state.pos; + ++this.state.curLine; + + case 8232: + case 8233: + return ""; + + case 56: + case 57: + if (inTemplate) { + return null; + } else { + this.recordStrictModeErrors(Errors.StrictNumericEscape, { + at: createPositionWithColumnOffset(this.state.curPosition(), -1) + }); + } + + default: + if (ch >= 48 && ch <= 55) { + const codePos = createPositionWithColumnOffset(this.state.curPosition(), -1); + const match = this.input.slice(this.state.pos - 1, this.state.pos + 2).match(/^[0-7]+/); + let octalStr = match[0]; + let octal = parseInt(octalStr, 8); + + if (octal > 255) { + octalStr = octalStr.slice(0, -1); + octal = parseInt(octalStr, 8); + } + + this.state.pos += octalStr.length - 1; + const next = this.input.charCodeAt(this.state.pos); + + if (octalStr !== "0" || next === 56 || next === 57) { + if (inTemplate) { + return null; + } else { + this.recordStrictModeErrors(Errors.StrictNumericEscape, { + at: codePos + }); + } + } + + return String.fromCharCode(octal); + } + + return String.fromCharCode(ch); + } + } + + readHexChar(len, forceLen, throwOnInvalid) { + const codeLoc = this.state.curPosition(); + const n = this.readInt(16, len, forceLen, false); + + if (n === null) { + if (throwOnInvalid) { + this.raise(Errors.InvalidEscapeSequence, { + at: codeLoc + }); + } else { + this.state.pos = codeLoc.index - 1; + } + } + + return n; + } + + readWord1(firstCode) { + this.state.containsEsc = false; + let word = ""; + const start = this.state.pos; + let chunkStart = this.state.pos; + + if (firstCode !== undefined) { + this.state.pos += firstCode <= 0xffff ? 1 : 2; + } + + while (this.state.pos < this.length) { + const ch = this.codePointAtPos(this.state.pos); + + if (isIdentifierChar(ch)) { + this.state.pos += ch <= 0xffff ? 1 : 2; + } else if (ch === 92) { + this.state.containsEsc = true; + word += this.input.slice(chunkStart, this.state.pos); + const escStart = this.state.curPosition(); + const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar; + + if (this.input.charCodeAt(++this.state.pos) !== 117) { + this.raise(Errors.MissingUnicodeEscape, { + at: this.state.curPosition() + }); + chunkStart = this.state.pos - 1; + continue; + } + + ++this.state.pos; + const esc = this.readCodePoint(true); + + if (esc !== null) { + if (!identifierCheck(esc)) { + this.raise(Errors.EscapedCharNotAnIdentifier, { + at: escStart + }); + } + + word += String.fromCodePoint(esc); + } + + chunkStart = this.state.pos; + } else { + break; + } + } + + return word + this.input.slice(chunkStart, this.state.pos); + } + + readWord(firstCode) { + const word = this.readWord1(firstCode); + const type = keywords$1.get(word); + + if (type !== undefined) { + this.finishToken(type, tokenLabelName(type)); + } else { + this.finishToken(128, word); + } + } + + checkKeywordEscapes() { + const { + type + } = this.state; + + if (tokenIsKeyword(type) && this.state.containsEsc) { + this.raise(Errors.InvalidEscapedReservedWord, { + at: this.state.startLoc, + reservedWord: tokenLabelName(type) + }); + } + } + + raise(toParseError, raiseProperties) { + const { + at + } = raiseProperties, + details = _objectWithoutPropertiesLoose(raiseProperties, _excluded); + + const loc = at instanceof Position ? at : at.loc.start; + const error = toParseError({ + loc, + details + }); + if (!this.options.errorRecovery) throw error; + if (!this.isLookahead) this.state.errors.push(error); + return error; + } + + raiseOverwrite(toParseError, raiseProperties) { + const { + at + } = raiseProperties, + details = _objectWithoutPropertiesLoose(raiseProperties, _excluded2); + + const loc = at instanceof Position ? at : at.loc.start; + const pos = loc.index; + const errors = this.state.errors; + + for (let i = errors.length - 1; i >= 0; i--) { + const error = errors[i]; + + if (error.loc.index === pos) { + return errors[i] = toParseError({ + loc, + details + }); + } + + if (error.loc.index < pos) break; + } + + return this.raise(toParseError, raiseProperties); + } + + updateContext(prevType) {} + + unexpected(loc, type) { + throw this.raise(Errors.UnexpectedToken, { + expected: type ? tokenLabelName(type) : null, + at: loc != null ? loc : this.state.startLoc + }); + } + + expectPlugin(pluginName, loc) { + if (this.hasPlugin(pluginName)) { + return true; + } + + throw this.raise(Errors.MissingPlugin, { + at: loc != null ? loc : this.state.startLoc, + missingPlugin: [pluginName] + }); + } + + expectOnePlugin(pluginNames) { + if (!pluginNames.some(name => this.hasPlugin(name))) { + throw this.raise(Errors.MissingOneOfPlugins, { + at: this.state.startLoc, + missingPlugin: pluginNames + }); + } + } + +} + +class Scope { + constructor(flags) { + this.var = new Set(); + this.lexical = new Set(); + this.functions = new Set(); + this.flags = flags; + } + +} +class ScopeHandler { + constructor(parser, inModule) { + this.parser = void 0; + this.scopeStack = []; + this.inModule = void 0; + this.undefinedExports = new Map(); + this.parser = parser; + this.inModule = inModule; + } + + get inFunction() { + return (this.currentVarScopeFlags() & SCOPE_FUNCTION) > 0; + } + + get allowSuper() { + return (this.currentThisScopeFlags() & SCOPE_SUPER) > 0; + } + + get allowDirectSuper() { + return (this.currentThisScopeFlags() & SCOPE_DIRECT_SUPER) > 0; + } + + get inClass() { + return (this.currentThisScopeFlags() & SCOPE_CLASS) > 0; + } + + get inClassAndNotInNonArrowFunction() { + const flags = this.currentThisScopeFlags(); + return (flags & SCOPE_CLASS) > 0 && (flags & SCOPE_FUNCTION) === 0; + } + + get inStaticBlock() { + for (let i = this.scopeStack.length - 1;; i--) { + const { + flags + } = this.scopeStack[i]; + + if (flags & SCOPE_STATIC_BLOCK) { + return true; + } + + if (flags & (SCOPE_VAR | SCOPE_CLASS)) { + return false; + } + } + } + + get inNonArrowFunction() { + return (this.currentThisScopeFlags() & SCOPE_FUNCTION) > 0; + } + + get treatFunctionsAsVar() { + return this.treatFunctionsAsVarInScope(this.currentScope()); + } + + createScope(flags) { + return new Scope(flags); + } + + enter(flags) { + this.scopeStack.push(this.createScope(flags)); + } + + exit() { + this.scopeStack.pop(); + } + + treatFunctionsAsVarInScope(scope) { + return !!(scope.flags & (SCOPE_FUNCTION | SCOPE_STATIC_BLOCK) || !this.parser.inModule && scope.flags & SCOPE_PROGRAM); + } + + declareName(name, bindingType, loc) { + let scope = this.currentScope(); + + if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) { + this.checkRedeclarationInScope(scope, name, bindingType, loc); + + if (bindingType & BIND_SCOPE_FUNCTION) { + scope.functions.add(name); + } else { + scope.lexical.add(name); + } + + if (bindingType & BIND_SCOPE_LEXICAL) { + this.maybeExportDefined(scope, name); + } + } else if (bindingType & BIND_SCOPE_VAR) { + for (let i = this.scopeStack.length - 1; i >= 0; --i) { + scope = this.scopeStack[i]; + this.checkRedeclarationInScope(scope, name, bindingType, loc); + scope.var.add(name); + this.maybeExportDefined(scope, name); + if (scope.flags & SCOPE_VAR) break; + } + } + + if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) { + this.undefinedExports.delete(name); + } + } + + maybeExportDefined(scope, name) { + if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) { + this.undefinedExports.delete(name); + } + } + + checkRedeclarationInScope(scope, name, bindingType, loc) { + if (this.isRedeclaredInScope(scope, name, bindingType)) { + this.parser.raise(Errors.VarRedeclaration, { + at: loc, + identifierName: name + }); + } + } + + isRedeclaredInScope(scope, name, bindingType) { + if (!(bindingType & BIND_KIND_VALUE)) return false; + + if (bindingType & BIND_SCOPE_LEXICAL) { + return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name); + } + + if (bindingType & BIND_SCOPE_FUNCTION) { + return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name); + } + + return scope.lexical.has(name) && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name); + } + + checkLocalExport(id) { + const { + name + } = id; + const topLevelScope = this.scopeStack[0]; + + if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) && !topLevelScope.functions.has(name)) { + this.undefinedExports.set(name, id.loc.start); + } + } + + currentScope() { + return this.scopeStack[this.scopeStack.length - 1]; + } + + currentVarScopeFlags() { + for (let i = this.scopeStack.length - 1;; i--) { + const { + flags + } = this.scopeStack[i]; + + if (flags & SCOPE_VAR) { + return flags; + } + } + } + + currentThisScopeFlags() { + for (let i = this.scopeStack.length - 1;; i--) { + const { + flags + } = this.scopeStack[i]; + + if (flags & (SCOPE_VAR | SCOPE_CLASS) && !(flags & SCOPE_ARROW)) { + return flags; + } + } + } + +} + +class FlowScope extends Scope { + constructor(...args) { + super(...args); + this.declareFunctions = new Set(); + } + +} + +class FlowScopeHandler extends ScopeHandler { + createScope(flags) { + return new FlowScope(flags); + } + + declareName(name, bindingType, loc) { + const scope = this.currentScope(); + + if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) { + this.checkRedeclarationInScope(scope, name, bindingType, loc); + this.maybeExportDefined(scope, name); + scope.declareFunctions.add(name); + return; + } + + super.declareName(...arguments); + } + + isRedeclaredInScope(scope, name, bindingType) { + if (super.isRedeclaredInScope(...arguments)) return true; + + if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) { + return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name)); + } + + return false; + } + + checkLocalExport(id) { + if (!this.scopeStack[0].declareFunctions.has(id.name)) { + super.checkLocalExport(id); + } + } + +} + +class ClassScope { + constructor() { + this.privateNames = new Set(); + this.loneAccessors = new Map(); + this.undefinedPrivateNames = new Map(); + } + +} +class ClassScopeHandler { + constructor(parser) { + this.parser = void 0; + this.stack = []; + this.undefinedPrivateNames = new Map(); + this.parser = parser; + } + + current() { + return this.stack[this.stack.length - 1]; + } + + enter() { + this.stack.push(new ClassScope()); + } + + exit() { + const oldClassScope = this.stack.pop(); + const current = this.current(); + + for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) { + if (current) { + if (!current.undefinedPrivateNames.has(name)) { + current.undefinedPrivateNames.set(name, loc); + } + } else { + this.parser.raise(Errors.InvalidPrivateFieldResolution, { + at: loc, + identifierName: name + }); + } + } + } + + declarePrivateName(name, elementType, loc) { + const { + privateNames, + loneAccessors, + undefinedPrivateNames + } = this.current(); + let redefined = privateNames.has(name); + + if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) { + const accessor = redefined && loneAccessors.get(name); + + if (accessor) { + const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC; + const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC; + const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR; + const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR; + redefined = oldKind === newKind || oldStatic !== newStatic; + if (!redefined) loneAccessors.delete(name); + } else if (!redefined) { + loneAccessors.set(name, elementType); + } + } + + if (redefined) { + this.parser.raise(Errors.PrivateNameRedeclaration, { + at: loc, + identifierName: name + }); + } + + privateNames.add(name); + undefinedPrivateNames.delete(name); + } + + usePrivateName(name, loc) { + let classScope; + + for (classScope of this.stack) { + if (classScope.privateNames.has(name)) return; + } + + if (classScope) { + classScope.undefinedPrivateNames.set(name, loc); + } else { + this.parser.raise(Errors.InvalidPrivateFieldResolution, { + at: loc, + identifierName: name + }); + } + } + +} + +const kExpression = 0, + kMaybeArrowParameterDeclaration = 1, + kMaybeAsyncArrowParameterDeclaration = 2, + kParameterDeclaration = 3; + +class ExpressionScope { + constructor(type = kExpression) { + this.type = void 0; + this.type = type; + } + + canBeArrowParameterDeclaration() { + return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration; + } + + isCertainlyParameterDeclaration() { + return this.type === kParameterDeclaration; + } + +} + +class ArrowHeadParsingScope extends ExpressionScope { + constructor(type) { + super(type); + this.declarationErrors = new Map(); + } + + recordDeclarationError(ParsingErrorClass, { + at + }) { + const index = at.index; + this.declarationErrors.set(index, [ParsingErrorClass, at]); + } + + clearDeclarationError(index) { + this.declarationErrors.delete(index); + } + + iterateErrors(iterator) { + this.declarationErrors.forEach(iterator); + } + +} + +class ExpressionScopeHandler { + constructor(parser) { + this.parser = void 0; + this.stack = [new ExpressionScope()]; + this.parser = parser; + } + + enter(scope) { + this.stack.push(scope); + } + + exit() { + this.stack.pop(); + } + + recordParameterInitializerError(toParseError, { + at: node + }) { + const origin = { + at: node.loc.start + }; + const { + stack + } = this; + let i = stack.length - 1; + let scope = stack[i]; + + while (!scope.isCertainlyParameterDeclaration()) { + if (scope.canBeArrowParameterDeclaration()) { + scope.recordDeclarationError(toParseError, origin); + } else { + return; + } + + scope = stack[--i]; + } + + this.parser.raise(toParseError, origin); + } + + recordArrowParemeterBindingError(error, { + at: node + }) { + const { + stack + } = this; + const scope = stack[stack.length - 1]; + const origin = { + at: node.loc.start + }; + + if (scope.isCertainlyParameterDeclaration()) { + this.parser.raise(error, origin); + } else if (scope.canBeArrowParameterDeclaration()) { + scope.recordDeclarationError(error, origin); + } else { + return; + } + } + + recordAsyncArrowParametersError({ + at + }) { + const { + stack + } = this; + let i = stack.length - 1; + let scope = stack[i]; + + while (scope.canBeArrowParameterDeclaration()) { + if (scope.type === kMaybeAsyncArrowParameterDeclaration) { + scope.recordDeclarationError(Errors.AwaitBindingIdentifier, { + at + }); + } + + scope = stack[--i]; + } + } + + validateAsPattern() { + const { + stack + } = this; + const currentScope = stack[stack.length - 1]; + if (!currentScope.canBeArrowParameterDeclaration()) return; + currentScope.iterateErrors(([toParseError, loc]) => { + this.parser.raise(toParseError, { + at: loc + }); + let i = stack.length - 2; + let scope = stack[i]; + + while (scope.canBeArrowParameterDeclaration()) { + scope.clearDeclarationError(loc.index); + scope = stack[--i]; + } + }); + } + +} +function newParameterDeclarationScope() { + return new ExpressionScope(kParameterDeclaration); +} +function newArrowHeadScope() { + return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration); +} +function newAsyncArrowScope() { + return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration); +} +function newExpressionScope() { + return new ExpressionScope(); +} + +const PARAM = 0b0000, + PARAM_YIELD = 0b0001, + PARAM_AWAIT = 0b0010, + PARAM_RETURN = 0b0100, + PARAM_IN = 0b1000; +class ProductionParameterHandler { + constructor() { + this.stacks = []; + } + + enter(flags) { + this.stacks.push(flags); + } + + exit() { + this.stacks.pop(); + } + + currentFlags() { + return this.stacks[this.stacks.length - 1]; + } + + get hasAwait() { + return (this.currentFlags() & PARAM_AWAIT) > 0; + } + + get hasYield() { + return (this.currentFlags() & PARAM_YIELD) > 0; + } + + get hasReturn() { + return (this.currentFlags() & PARAM_RETURN) > 0; + } + + get hasIn() { + return (this.currentFlags() & PARAM_IN) > 0; + } + +} +function functionFlags(isAsync, isGenerator) { + return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0); +} + +class UtilParser extends Tokenizer { + addExtra(node, key, value, enumerable = true) { + if (!node) return; + const extra = node.extra = node.extra || {}; + + if (enumerable) { + extra[key] = value; + } else { + Object.defineProperty(extra, key, { + enumerable, + value + }); + } + } + + isContextual(token) { + return this.state.type === token && !this.state.containsEsc; + } + + isUnparsedContextual(nameStart, name) { + const nameEnd = nameStart + name.length; + + if (this.input.slice(nameStart, nameEnd) === name) { + const nextCh = this.input.charCodeAt(nameEnd); + return !(isIdentifierChar(nextCh) || (nextCh & 0xfc00) === 0xd800); + } + + return false; + } + + isLookaheadContextual(name) { + const next = this.nextTokenStart(); + return this.isUnparsedContextual(next, name); + } + + eatContextual(token) { + if (this.isContextual(token)) { + this.next(); + return true; + } + + return false; + } + + expectContextual(token, toParseError) { + if (!this.eatContextual(token)) { + if (toParseError != null) { + throw this.raise(toParseError, { + at: this.state.startLoc + }); + } + + throw this.unexpected(null, token); + } + } + + canInsertSemicolon() { + return this.match(135) || this.match(8) || this.hasPrecedingLineBreak(); + } + + hasPrecedingLineBreak() { + return lineBreak.test(this.input.slice(this.state.lastTokEndLoc.index, this.state.start)); + } + + hasFollowingLineBreak() { + skipWhiteSpaceToLineBreak.lastIndex = this.state.end; + return skipWhiteSpaceToLineBreak.test(this.input); + } + + isLineTerminator() { + return this.eat(13) || this.canInsertSemicolon(); + } + + semicolon(allowAsi = true) { + if (allowAsi ? this.isLineTerminator() : this.eat(13)) return; + this.raise(Errors.MissingSemicolon, { + at: this.state.lastTokEndLoc + }); + } + + expect(type, loc) { + this.eat(type) || this.unexpected(loc, type); + } + + tryParse(fn, oldState = this.state.clone()) { + const abortSignal = { + node: null + }; + + try { + const node = fn((node = null) => { + abortSignal.node = node; + throw abortSignal; + }); + + if (this.state.errors.length > oldState.errors.length) { + const failState = this.state; + this.state = oldState; + this.state.tokensLength = failState.tokensLength; + return { + node, + error: failState.errors[oldState.errors.length], + thrown: false, + aborted: false, + failState + }; + } + + return { + node, + error: null, + thrown: false, + aborted: false, + failState: null + }; + } catch (error) { + const failState = this.state; + this.state = oldState; + + if (error instanceof SyntaxError) { + return { + node: null, + error, + thrown: true, + aborted: false, + failState + }; + } + + if (error === abortSignal) { + return { + node: abortSignal.node, + error: null, + thrown: false, + aborted: true, + failState + }; + } + + throw error; + } + } + + checkExpressionErrors(refExpressionErrors, andThrow) { + if (!refExpressionErrors) return false; + const { + shorthandAssignLoc, + doubleProtoLoc, + privateKeyLoc, + optionalParametersLoc + } = refExpressionErrors; + const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc; + + if (!andThrow) { + return hasErrors; + } + + if (shorthandAssignLoc != null) { + this.raise(Errors.InvalidCoverInitializedName, { + at: shorthandAssignLoc + }); + } + + if (doubleProtoLoc != null) { + this.raise(Errors.DuplicateProto, { + at: doubleProtoLoc + }); + } + + if (privateKeyLoc != null) { + this.raise(Errors.UnexpectedPrivateField, { + at: privateKeyLoc + }); + } + + if (optionalParametersLoc != null) { + this.unexpected(optionalParametersLoc); + } + } + + isLiteralPropertyName() { + return tokenIsLiteralPropertyName(this.state.type); + } + + isPrivateName(node) { + return node.type === "PrivateName"; + } + + getPrivateNameSV(node) { + return node.id.name; + } + + hasPropertyAsPrivateName(node) { + return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property); + } + + isOptionalChain(node) { + return node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression"; + } + + isObjectProperty(node) { + return node.type === "ObjectProperty"; + } + + isObjectMethod(node) { + return node.type === "ObjectMethod"; + } + + initializeScopes(inModule = this.options.sourceType === "module") { + const oldLabels = this.state.labels; + this.state.labels = []; + const oldExportedIdentifiers = this.exportedIdentifiers; + this.exportedIdentifiers = new Set(); + const oldInModule = this.inModule; + this.inModule = inModule; + const oldScope = this.scope; + const ScopeHandler = this.getScopeHandler(); + this.scope = new ScopeHandler(this, inModule); + const oldProdParam = this.prodParam; + this.prodParam = new ProductionParameterHandler(); + const oldClassScope = this.classScope; + this.classScope = new ClassScopeHandler(this); + const oldExpressionScope = this.expressionScope; + this.expressionScope = new ExpressionScopeHandler(this); + return () => { + this.state.labels = oldLabels; + this.exportedIdentifiers = oldExportedIdentifiers; + this.inModule = oldInModule; + this.scope = oldScope; + this.prodParam = oldProdParam; + this.classScope = oldClassScope; + this.expressionScope = oldExpressionScope; + }; + } + + enterInitialScopes() { + let paramFlags = PARAM; + + if (this.inModule) { + paramFlags |= PARAM_AWAIT; + } + + this.scope.enter(SCOPE_PROGRAM); + this.prodParam.enter(paramFlags); + } + + checkDestructuringPrivate(refExpressionErrors) { + const { + privateKeyLoc + } = refExpressionErrors; + + if (privateKeyLoc !== null) { + this.expectPlugin("destructuringPrivate", privateKeyLoc); + } + } + +} +class ExpressionErrors { + constructor() { + this.shorthandAssignLoc = null; + this.doubleProtoLoc = null; + this.privateKeyLoc = null; + this.optionalParametersLoc = null; + } + +} + +class Node { + constructor(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + this.loc = new SourceLocation(loc); + if (parser != null && parser.options.ranges) this.range = [pos, 0]; + if (parser != null && parser.filename) this.loc.filename = parser.filename; + } + +} + +const NodePrototype = Node.prototype; +{ + NodePrototype.__clone = function () { + const newNode = new Node(); + const keys = Object.keys(this); + + for (let i = 0, length = keys.length; i < length; i++) { + const key = keys[i]; + + if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") { + newNode[key] = this[key]; + } + } + + return newNode; + }; +} + +function clonePlaceholder(node) { + return cloneIdentifier(node); +} + +function cloneIdentifier(node) { + const { + type, + start, + end, + loc, + range, + extra, + name + } = node; + const cloned = Object.create(NodePrototype); + cloned.type = type; + cloned.start = start; + cloned.end = end; + cloned.loc = loc; + cloned.range = range; + cloned.extra = extra; + cloned.name = name; + + if (type === "Placeholder") { + cloned.expectedNode = node.expectedNode; + } + + return cloned; +} +function cloneStringLiteral(node) { + const { + type, + start, + end, + loc, + range, + extra + } = node; + + if (type === "Placeholder") { + return clonePlaceholder(node); + } + + const cloned = Object.create(NodePrototype); + cloned.type = type; + cloned.start = start; + cloned.end = end; + cloned.loc = loc; + cloned.range = range; + + if (node.raw !== undefined) { + cloned.raw = node.raw; + } else { + cloned.extra = extra; + } + + cloned.value = node.value; + return cloned; +} +class NodeUtils extends UtilParser { + startNode() { + return new Node(this, this.state.start, this.state.startLoc); + } + + startNodeAt(pos, loc) { + return new Node(this, pos, loc); + } + + startNodeAtNode(type) { + return this.startNodeAt(type.start, type.loc.start); + } + + finishNode(node, type) { + return this.finishNodeAt(node, type, this.state.lastTokEndLoc); + } + + finishNodeAt(node, type, endLoc) { + + node.type = type; + node.end = endLoc.index; + node.loc.end = endLoc; + if (this.options.ranges) node.range[1] = endLoc.index; + if (this.options.attachComment) this.processComment(node); + return node; + } + + resetStartLocation(node, start, startLoc) { + node.start = start; + node.loc.start = startLoc; + if (this.options.ranges) node.range[0] = start; + } + + resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { + node.end = endLoc.index; + node.loc.end = endLoc; + if (this.options.ranges) node.range[1] = endLoc.index; + } + + resetStartLocationFromNode(node, locationNode) { + this.resetStartLocation(node, locationNode.start, locationNode.loc.start); + } + +} + +const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]); +const FlowErrors = ParseErrorEnum`flow`(_ => ({ + AmbiguousConditionalArrow: _("Ambiguous expression: wrap the arrow functions in parentheses to disambiguate."), + AmbiguousDeclareModuleKind: _("Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module."), + AssignReservedType: _(({ + reservedType + }) => `Cannot overwrite reserved type ${reservedType}.`), + DeclareClassElement: _("The `declare` modifier can only appear on class fields."), + DeclareClassFieldInitializer: _("Initializers are not allowed in fields with the `declare` modifier."), + DuplicateDeclareModuleExports: _("Duplicate `declare module.exports` statement."), + EnumBooleanMemberNotInitialized: _(({ + memberName, + enumName + }) => `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` or \`${memberName} = false,\` in enum \`${enumName}\`.`), + EnumDuplicateMemberName: _(({ + memberName, + enumName + }) => `Enum member names need to be unique, but the name \`${memberName}\` has already been used before in enum \`${enumName}\`.`), + EnumInconsistentMemberValues: _(({ + enumName + }) => `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`), + EnumInvalidExplicitType: _(({ + invalidEnumType, + enumName + }) => `Enum type \`${invalidEnumType}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`), + EnumInvalidExplicitTypeUnknownSupplied: _(({ + enumName + }) => `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`), + EnumInvalidMemberInitializerPrimaryType: _(({ + enumName, + memberName, + explicitType + }) => `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of \`${memberName}\` needs to be a ${explicitType} literal.`), + EnumInvalidMemberInitializerSymbolType: _(({ + enumName, + memberName + }) => `Symbol enum members cannot be initialized. Use \`${memberName},\` in enum \`${enumName}\`.`), + EnumInvalidMemberInitializerUnknownType: _(({ + enumName, + memberName + }) => `The enum member initializer for \`${memberName}\` needs to be a literal (either a boolean, number, or string) in enum \`${enumName}\`.`), + EnumInvalidMemberName: _(({ + enumName, + memberName, + suggestion + }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`), + EnumNumberMemberNotInitialized: _(({ + enumName, + memberName + }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`), + EnumStringMemberInconsistentlyInitailized: _(({ + enumName + }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`), + GetterMayNotHaveThisParam: _("A getter cannot have a `this` parameter."), + ImportTypeShorthandOnlyInPureImport: _("The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements."), + InexactInsideExact: _("Explicit inexact syntax cannot appear inside an explicit exact object type."), + InexactInsideNonObject: _("Explicit inexact syntax cannot appear in class or interface definitions."), + InexactVariance: _("Explicit inexact syntax cannot have variance."), + InvalidNonTypeImportInDeclareModule: _("Imports within a `declare module` body must always be `import type` or `import typeof`."), + MissingTypeParamDefault: _("Type parameter declaration needs a default, since a preceding type parameter declaration has a default."), + NestedDeclareModule: _("`declare module` cannot be used inside another `declare module`."), + NestedFlowComment: _("Cannot have a flow comment inside another flow comment."), + PatternIsOptional: _("A binding pattern parameter cannot be optional in an implementation signature.", { + reasonCode: "OptionalBindingPattern" + }), + SetterMayNotHaveThisParam: _("A setter cannot have a `this` parameter."), + SpreadVariance: _("Spread properties cannot have variance."), + ThisParamAnnotationRequired: _("A type annotation is required for the `this` parameter."), + ThisParamBannedInConstructor: _("Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions."), + ThisParamMayNotBeOptional: _("The `this` parameter cannot be optional."), + ThisParamMustBeFirst: _("The `this` parameter must be the first function parameter."), + ThisParamNoDefault: _("The `this` parameter may not have a default value."), + TypeBeforeInitializer: _("Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`."), + TypeCastInPattern: _("The type cast expression is expected to be wrapped with parenthesis."), + UnexpectedExplicitInexactInObject: _("Explicit inexact syntax must appear at the end of an inexact object."), + UnexpectedReservedType: _(({ + reservedType + }) => `Unexpected reserved type ${reservedType}.`), + UnexpectedReservedUnderscore: _("`_` is only allowed as a type argument to call or new."), + UnexpectedSpaceBetweenModuloChecks: _("Spaces between `%` and `checks` are not allowed here."), + UnexpectedSpreadType: _("Spread operator cannot appear in class or interface definitions."), + UnexpectedSubtractionOperand: _('Unexpected token, expected "number" or "bigint".'), + UnexpectedTokenAfterTypeParameter: _("Expected an arrow function after this type parameter declaration."), + UnexpectedTypeParameterBeforeAsyncArrowFunction: _("Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`."), + UnsupportedDeclareExportKind: _(({ + unsupportedExportKind, + suggestion + }) => `\`declare export ${unsupportedExportKind}\` is not supported. Use \`${suggestion}\` instead.`), + UnsupportedStatementInDeclareModule: _("Only declares and type imports are allowed inside declare module."), + UnterminatedFlowComment: _("Unterminated flow-comment.") +})); + +function isEsModuleType(bodyElement) { + return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration"); +} + +function hasTypeImportKind(node) { + return node.importKind === "type" || node.importKind === "typeof"; +} + +function isMaybeDefaultImport(type) { + return tokenIsKeywordOrIdentifier(type) && type !== 97; +} + +const exportSuggestions = { + const: "declare export var", + let: "declare export var", + type: "export type", + interface: "export interface" +}; + +function partition(list, test) { + const list1 = []; + const list2 = []; + + for (let i = 0; i < list.length; i++) { + (test(list[i], i, list) ? list1 : list2).push(list[i]); + } + + return [list1, list2]; +} + +const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; +var flow = (superClass => class extends superClass { + constructor(...args) { + super(...args); + this.flowPragma = undefined; + } + + getScopeHandler() { + return FlowScopeHandler; + } + + shouldParseTypes() { + return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; + } + + shouldParseEnums() { + return !!this.getPluginOption("flow", "enums"); + } + + finishToken(type, val) { + if (type !== 129 && type !== 13 && type !== 28) { + if (this.flowPragma === undefined) { + this.flowPragma = null; + } + } + + return super.finishToken(type, val); + } + + addComment(comment) { + if (this.flowPragma === undefined) { + const matches = FLOW_PRAGMA_REGEX.exec(comment.value); + + if (!matches) ; else if (matches[1] === "flow") { + this.flowPragma = "flow"; + } else if (matches[1] === "noflow") { + this.flowPragma = "noflow"; + } else { + throw new Error("Unexpected flow pragma"); + } + } + + return super.addComment(comment); + } + + flowParseTypeInitialiser(tok) { + const oldInType = this.state.inType; + this.state.inType = true; + this.expect(tok || 14); + const type = this.flowParseType(); + this.state.inType = oldInType; + return type; + } + + flowParsePredicate() { + const node = this.startNode(); + const moduloLoc = this.state.startLoc; + this.next(); + this.expectContextual(107); + + if (this.state.lastTokStart > moduloLoc.index + 1) { + this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, { + at: moduloLoc + }); + } + + if (this.eat(10)) { + node.value = this.parseExpression(); + this.expect(11); + return this.finishNode(node, "DeclaredPredicate"); + } else { + return this.finishNode(node, "InferredPredicate"); + } + } + + flowParseTypeAndPredicateInitialiser() { + const oldInType = this.state.inType; + this.state.inType = true; + this.expect(14); + let type = null; + let predicate = null; + + if (this.match(54)) { + this.state.inType = oldInType; + predicate = this.flowParsePredicate(); + } else { + type = this.flowParseType(); + this.state.inType = oldInType; + + if (this.match(54)) { + predicate = this.flowParsePredicate(); + } + } + + return [type, predicate]; + } + + flowParseDeclareClass(node) { + this.next(); + this.flowParseInterfaceish(node, true); + return this.finishNode(node, "DeclareClass"); + } + + flowParseDeclareFunction(node) { + this.next(); + const id = node.id = this.parseIdentifier(); + const typeNode = this.startNode(); + const typeContainer = this.startNode(); + + if (this.match(47)) { + typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + typeNode.typeParameters = null; + } + + this.expect(10); + const tmp = this.flowParseFunctionTypeParams(); + typeNode.params = tmp.params; + typeNode.rest = tmp.rest; + typeNode.this = tmp._this; + this.expect(11); + [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); + id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); + this.resetEndLocation(id); + this.semicolon(); + this.scope.declareName(node.id.name, BIND_FLOW_DECLARE_FN, node.id.loc.start); + return this.finishNode(node, "DeclareFunction"); + } + + flowParseDeclare(node, insideModule) { + if (this.match(80)) { + return this.flowParseDeclareClass(node); + } else if (this.match(68)) { + return this.flowParseDeclareFunction(node); + } else if (this.match(74)) { + return this.flowParseDeclareVariable(node); + } else if (this.eatContextual(123)) { + if (this.match(16)) { + return this.flowParseDeclareModuleExports(node); + } else { + if (insideModule) { + this.raise(FlowErrors.NestedDeclareModule, { + at: this.state.lastTokStartLoc + }); + } + + return this.flowParseDeclareModule(node); + } + } else if (this.isContextual(126)) { + return this.flowParseDeclareTypeAlias(node); + } else if (this.isContextual(127)) { + return this.flowParseDeclareOpaqueType(node); + } else if (this.isContextual(125)) { + return this.flowParseDeclareInterface(node); + } else if (this.match(82)) { + return this.flowParseDeclareExportDeclaration(node, insideModule); + } else { + throw this.unexpected(); + } + } + + flowParseDeclareVariable(node) { + this.next(); + node.id = this.flowParseTypeAnnotatableIdentifier(true); + this.scope.declareName(node.id.name, BIND_VAR, node.id.loc.start); + this.semicolon(); + return this.finishNode(node, "DeclareVariable"); + } + + flowParseDeclareModule(node) { + this.scope.enter(SCOPE_OTHER); + + if (this.match(129)) { + node.id = this.parseExprAtom(); + } else { + node.id = this.parseIdentifier(); + } + + const bodyNode = node.body = this.startNode(); + const body = bodyNode.body = []; + this.expect(5); + + while (!this.match(8)) { + let bodyNode = this.startNode(); + + if (this.match(83)) { + this.next(); + + if (!this.isContextual(126) && !this.match(87)) { + this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, { + at: this.state.lastTokStartLoc + }); + } + + this.parseImport(bodyNode); + } else { + this.expectContextual(121, FlowErrors.UnsupportedStatementInDeclareModule); + bodyNode = this.flowParseDeclare(bodyNode, true); + } + + body.push(bodyNode); + } + + this.scope.exit(); + this.expect(8); + this.finishNode(bodyNode, "BlockStatement"); + let kind = null; + let hasModuleExport = false; + body.forEach(bodyElement => { + if (isEsModuleType(bodyElement)) { + if (kind === "CommonJS") { + this.raise(FlowErrors.AmbiguousDeclareModuleKind, { + at: bodyElement + }); + } + + kind = "ES"; + } else if (bodyElement.type === "DeclareModuleExports") { + if (hasModuleExport) { + this.raise(FlowErrors.DuplicateDeclareModuleExports, { + at: bodyElement + }); + } + + if (kind === "ES") { + this.raise(FlowErrors.AmbiguousDeclareModuleKind, { + at: bodyElement + }); + } + + kind = "CommonJS"; + hasModuleExport = true; + } + }); + node.kind = kind || "CommonJS"; + return this.finishNode(node, "DeclareModule"); + } + + flowParseDeclareExportDeclaration(node, insideModule) { + this.expect(82); + + if (this.eat(65)) { + if (this.match(68) || this.match(80)) { + node.declaration = this.flowParseDeclare(this.startNode()); + } else { + node.declaration = this.flowParseType(); + this.semicolon(); + } + + node.default = true; + return this.finishNode(node, "DeclareExportDeclaration"); + } else { + if (this.match(75) || this.isLet() || (this.isContextual(126) || this.isContextual(125)) && !insideModule) { + const label = this.state.value; + throw this.raise(FlowErrors.UnsupportedDeclareExportKind, { + at: this.state.startLoc, + unsupportedExportKind: label, + suggestion: exportSuggestions[label] + }); + } + + if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(127)) { + node.declaration = this.flowParseDeclare(this.startNode()); + node.default = false; + return this.finishNode(node, "DeclareExportDeclaration"); + } else if (this.match(55) || this.match(5) || this.isContextual(125) || this.isContextual(126) || this.isContextual(127)) { + node = this.parseExport(node); + + if (node.type === "ExportNamedDeclaration") { + node.type = "ExportDeclaration"; + node.default = false; + delete node.exportKind; + } + + node.type = "Declare" + node.type; + return node; + } + } + + throw this.unexpected(); + } + + flowParseDeclareModuleExports(node) { + this.next(); + this.expectContextual(108); + node.typeAnnotation = this.flowParseTypeAnnotation(); + this.semicolon(); + return this.finishNode(node, "DeclareModuleExports"); + } + + flowParseDeclareTypeAlias(node) { + this.next(); + this.flowParseTypeAlias(node); + node.type = "DeclareTypeAlias"; + return node; + } + + flowParseDeclareOpaqueType(node) { + this.next(); + this.flowParseOpaqueType(node, true); + node.type = "DeclareOpaqueType"; + return node; + } + + flowParseDeclareInterface(node) { + this.next(); + this.flowParseInterfaceish(node); + return this.finishNode(node, "DeclareInterface"); + } + + flowParseInterfaceish(node, isClass = false) { + node.id = this.flowParseRestrictedIdentifier(!isClass, true); + this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.loc.start); + + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + + node.extends = []; + node.implements = []; + node.mixins = []; + + if (this.eat(81)) { + do { + node.extends.push(this.flowParseInterfaceExtends()); + } while (!isClass && this.eat(12)); + } + + if (this.isContextual(114)) { + this.next(); + + do { + node.mixins.push(this.flowParseInterfaceExtends()); + } while (this.eat(12)); + } + + if (this.isContextual(110)) { + this.next(); + + do { + node.implements.push(this.flowParseInterfaceExtends()); + } while (this.eat(12)); + } + + node.body = this.flowParseObjectType({ + allowStatic: isClass, + allowExact: false, + allowSpread: false, + allowProto: isClass, + allowInexact: false + }); + } + + flowParseInterfaceExtends() { + const node = this.startNode(); + node.id = this.flowParseQualifiedTypeIdentifier(); + + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } + + return this.finishNode(node, "InterfaceExtends"); + } + + flowParseInterface(node) { + this.flowParseInterfaceish(node); + return this.finishNode(node, "InterfaceDeclaration"); + } + + checkNotUnderscore(word) { + if (word === "_") { + this.raise(FlowErrors.UnexpectedReservedUnderscore, { + at: this.state.startLoc + }); + } + } + + checkReservedType(word, startLoc, declaration) { + if (!reservedTypes.has(word)) return; + this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, { + at: startLoc, + reservedType: word + }); + } + + flowParseRestrictedIdentifier(liberal, declaration) { + this.checkReservedType(this.state.value, this.state.startLoc, declaration); + return this.parseIdentifier(liberal); + } + + flowParseTypeAlias(node) { + node.id = this.flowParseRestrictedIdentifier(false, true); + this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start); + + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + + node.right = this.flowParseTypeInitialiser(29); + this.semicolon(); + return this.finishNode(node, "TypeAlias"); + } + + flowParseOpaqueType(node, declare) { + this.expectContextual(126); + node.id = this.flowParseRestrictedIdentifier(true, true); + this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start); + + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + + node.supertype = null; + + if (this.match(14)) { + node.supertype = this.flowParseTypeInitialiser(14); + } + + node.impltype = null; + + if (!declare) { + node.impltype = this.flowParseTypeInitialiser(29); + } + + this.semicolon(); + return this.finishNode(node, "OpaqueType"); + } + + flowParseTypeParameter(requireDefault = false) { + const nodeStartLoc = this.state.startLoc; + const node = this.startNode(); + const variance = this.flowParseVariance(); + const ident = this.flowParseTypeAnnotatableIdentifier(); + node.name = ident.name; + node.variance = variance; + node.bound = ident.typeAnnotation; + + if (this.match(29)) { + this.eat(29); + node.default = this.flowParseType(); + } else { + if (requireDefault) { + this.raise(FlowErrors.MissingTypeParamDefault, { + at: nodeStartLoc + }); + } + } + + return this.finishNode(node, "TypeParameter"); + } + + flowParseTypeParameterDeclaration() { + const oldInType = this.state.inType; + const node = this.startNode(); + node.params = []; + this.state.inType = true; + + if (this.match(47) || this.match(138)) { + this.next(); + } else { + this.unexpected(); + } + + let defaultRequired = false; + + do { + const typeParameter = this.flowParseTypeParameter(defaultRequired); + node.params.push(typeParameter); + + if (typeParameter.default) { + defaultRequired = true; + } + + if (!this.match(48)) { + this.expect(12); + } + } while (!this.match(48)); + + this.expect(48); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterDeclaration"); + } + + flowParseTypeParameterInstantiation() { + const node = this.startNode(); + const oldInType = this.state.inType; + node.params = []; + this.state.inType = true; + this.expect(47); + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = false; + + while (!this.match(48)) { + node.params.push(this.flowParseType()); + + if (!this.match(48)) { + this.expect(12); + } + } + + this.state.noAnonFunctionType = oldNoAnonFunctionType; + this.expect(48); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterInstantiation"); + } + + flowParseTypeParameterInstantiationCallOrNew() { + const node = this.startNode(); + const oldInType = this.state.inType; + node.params = []; + this.state.inType = true; + this.expect(47); + + while (!this.match(48)) { + node.params.push(this.flowParseTypeOrImplicitInstantiation()); + + if (!this.match(48)) { + this.expect(12); + } + } + + this.expect(48); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterInstantiation"); + } + + flowParseInterfaceType() { + const node = this.startNode(); + this.expectContextual(125); + node.extends = []; + + if (this.eat(81)) { + do { + node.extends.push(this.flowParseInterfaceExtends()); + } while (this.eat(12)); + } + + node.body = this.flowParseObjectType({ + allowStatic: false, + allowExact: false, + allowSpread: false, + allowProto: false, + allowInexact: false + }); + return this.finishNode(node, "InterfaceTypeAnnotation"); + } + + flowParseObjectPropertyKey() { + return this.match(130) || this.match(129) ? this.parseExprAtom() : this.parseIdentifier(true); + } + + flowParseObjectTypeIndexer(node, isStatic, variance) { + node.static = isStatic; + + if (this.lookahead().type === 14) { + node.id = this.flowParseObjectPropertyKey(); + node.key = this.flowParseTypeInitialiser(); + } else { + node.id = null; + node.key = this.flowParseType(); + } + + this.expect(3); + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; + return this.finishNode(node, "ObjectTypeIndexer"); + } + + flowParseObjectTypeInternalSlot(node, isStatic) { + node.static = isStatic; + node.id = this.flowParseObjectPropertyKey(); + this.expect(3); + this.expect(3); + + if (this.match(47) || this.match(10)) { + node.method = true; + node.optional = false; + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); + } else { + node.method = false; + + if (this.eat(17)) { + node.optional = true; + } + + node.value = this.flowParseTypeInitialiser(); + } + + return this.finishNode(node, "ObjectTypeInternalSlot"); + } + + flowParseObjectTypeMethodish(node) { + node.params = []; + node.rest = null; + node.typeParameters = null; + node.this = null; + + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + + this.expect(10); + + if (this.match(78)) { + node.this = this.flowParseFunctionTypeParam(true); + node.this.name = null; + + if (!this.match(11)) { + this.expect(12); + } + } + + while (!this.match(11) && !this.match(21)) { + node.params.push(this.flowParseFunctionTypeParam(false)); + + if (!this.match(11)) { + this.expect(12); + } + } + + if (this.eat(21)) { + node.rest = this.flowParseFunctionTypeParam(false); + } + + this.expect(11); + node.returnType = this.flowParseTypeInitialiser(); + return this.finishNode(node, "FunctionTypeAnnotation"); + } + + flowParseObjectTypeCallProperty(node, isStatic) { + const valueNode = this.startNode(); + node.static = isStatic; + node.value = this.flowParseObjectTypeMethodish(valueNode); + return this.finishNode(node, "ObjectTypeCallProperty"); + } + + flowParseObjectType({ + allowStatic, + allowExact, + allowSpread, + allowProto, + allowInexact + }) { + const oldInType = this.state.inType; + this.state.inType = true; + const nodeStart = this.startNode(); + nodeStart.callProperties = []; + nodeStart.properties = []; + nodeStart.indexers = []; + nodeStart.internalSlots = []; + let endDelim; + let exact; + let inexact = false; + + if (allowExact && this.match(6)) { + this.expect(6); + endDelim = 9; + exact = true; + } else { + this.expect(5); + endDelim = 8; + exact = false; + } + + nodeStart.exact = exact; + + while (!this.match(endDelim)) { + let isStatic = false; + let protoStartLoc = null; + let inexactStartLoc = null; + const node = this.startNode(); + + if (allowProto && this.isContextual(115)) { + const lookahead = this.lookahead(); + + if (lookahead.type !== 14 && lookahead.type !== 17) { + this.next(); + protoStartLoc = this.state.startLoc; + allowStatic = false; + } + } + + if (allowStatic && this.isContextual(104)) { + const lookahead = this.lookahead(); + + if (lookahead.type !== 14 && lookahead.type !== 17) { + this.next(); + isStatic = true; + } + } + + const variance = this.flowParseVariance(); + + if (this.eat(0)) { + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + + if (this.eat(0)) { + if (variance) { + this.unexpected(variance.loc.start); + } + + nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); + } else { + nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); + } + } else if (this.match(10) || this.match(47)) { + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + + if (variance) { + this.unexpected(variance.loc.start); + } + + nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); + } else { + let kind = "init"; + + if (this.isContextual(98) || this.isContextual(103)) { + const lookahead = this.lookahead(); + + if (tokenIsLiteralPropertyName(lookahead.type)) { + kind = this.state.value; + this.next(); + } + } + + const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact); + + if (propOrInexact === null) { + inexact = true; + inexactStartLoc = this.state.lastTokStartLoc; + } else { + nodeStart.properties.push(propOrInexact); + } + } + + this.flowObjectTypeSemicolon(); + + if (inexactStartLoc && !this.match(8) && !this.match(9)) { + this.raise(FlowErrors.UnexpectedExplicitInexactInObject, { + at: inexactStartLoc + }); + } + } + + this.expect(endDelim); + + if (allowSpread) { + nodeStart.inexact = inexact; + } + + const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); + this.state.inType = oldInType; + return out; + } + + flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) { + if (this.eat(21)) { + const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9); + + if (isInexactToken) { + if (!allowSpread) { + this.raise(FlowErrors.InexactInsideNonObject, { + at: this.state.lastTokStartLoc + }); + } else if (!allowInexact) { + this.raise(FlowErrors.InexactInsideExact, { + at: this.state.lastTokStartLoc + }); + } + + if (variance) { + this.raise(FlowErrors.InexactVariance, { + at: variance + }); + } + + return null; + } + + if (!allowSpread) { + this.raise(FlowErrors.UnexpectedSpreadType, { + at: this.state.lastTokStartLoc + }); + } + + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + + if (variance) { + this.raise(FlowErrors.SpreadVariance, { + at: variance + }); + } + + node.argument = this.flowParseType(); + return this.finishNode(node, "ObjectTypeSpreadProperty"); + } else { + node.key = this.flowParseObjectPropertyKey(); + node.static = isStatic; + node.proto = protoStartLoc != null; + node.kind = kind; + let optional = false; + + if (this.match(47) || this.match(10)) { + node.method = true; + + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + + if (variance) { + this.unexpected(variance.loc.start); + } + + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); + + if (kind === "get" || kind === "set") { + this.flowCheckGetterSetterParams(node); + } + + if (!allowSpread && node.key.name === "constructor" && node.value.this) { + this.raise(FlowErrors.ThisParamBannedInConstructor, { + at: node.value.this + }); + } + } else { + if (kind !== "init") this.unexpected(); + node.method = false; + + if (this.eat(17)) { + optional = true; + } + + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; + } + + node.optional = optional; + return this.finishNode(node, "ObjectTypeProperty"); + } + } + + flowCheckGetterSetterParams(property) { + const paramCount = property.kind === "get" ? 0 : 1; + const length = property.value.params.length + (property.value.rest ? 1 : 0); + + if (property.value.this) { + this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, { + at: property.value.this + }); + } + + if (length !== paramCount) { + this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, { + at: property + }); + } + + if (property.kind === "set" && property.value.rest) { + this.raise(Errors.BadSetterRestParameter, { + at: property + }); + } + } + + flowObjectTypeSemicolon() { + if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) { + this.unexpected(); + } + } + + flowParseQualifiedTypeIdentifier(startPos, startLoc, id) { + startPos = startPos || this.state.start; + startLoc = startLoc || this.state.startLoc; + let node = id || this.flowParseRestrictedIdentifier(true); + + while (this.eat(16)) { + const node2 = this.startNodeAt(startPos, startLoc); + node2.qualification = node; + node2.id = this.flowParseRestrictedIdentifier(true); + node = this.finishNode(node2, "QualifiedTypeIdentifier"); + } + + return node; + } + + flowParseGenericType(startPos, startLoc, id) { + const node = this.startNodeAt(startPos, startLoc); + node.typeParameters = null; + node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id); + + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } + + return this.finishNode(node, "GenericTypeAnnotation"); + } + + flowParseTypeofType() { + const node = this.startNode(); + this.expect(87); + node.argument = this.flowParsePrimaryType(); + return this.finishNode(node, "TypeofTypeAnnotation"); + } + + flowParseTupleType() { + const node = this.startNode(); + node.types = []; + this.expect(0); + + while (this.state.pos < this.length && !this.match(3)) { + node.types.push(this.flowParseType()); + if (this.match(3)) break; + this.expect(12); + } + + this.expect(3); + return this.finishNode(node, "TupleTypeAnnotation"); + } + + flowParseFunctionTypeParam(first) { + let name = null; + let optional = false; + let typeAnnotation = null; + const node = this.startNode(); + const lh = this.lookahead(); + const isThis = this.state.type === 78; + + if (lh.type === 14 || lh.type === 17) { + if (isThis && !first) { + this.raise(FlowErrors.ThisParamMustBeFirst, { + at: node + }); + } + + name = this.parseIdentifier(isThis); + + if (this.eat(17)) { + optional = true; + + if (isThis) { + this.raise(FlowErrors.ThisParamMayNotBeOptional, { + at: node + }); + } + } + + typeAnnotation = this.flowParseTypeInitialiser(); + } else { + typeAnnotation = this.flowParseType(); + } + + node.name = name; + node.optional = optional; + node.typeAnnotation = typeAnnotation; + return this.finishNode(node, "FunctionTypeParam"); + } + + reinterpretTypeAsFunctionTypeParam(type) { + const node = this.startNodeAt(type.start, type.loc.start); + node.name = null; + node.optional = false; + node.typeAnnotation = type; + return this.finishNode(node, "FunctionTypeParam"); + } + + flowParseFunctionTypeParams(params = []) { + let rest = null; + let _this = null; + + if (this.match(78)) { + _this = this.flowParseFunctionTypeParam(true); + _this.name = null; + + if (!this.match(11)) { + this.expect(12); + } + } + + while (!this.match(11) && !this.match(21)) { + params.push(this.flowParseFunctionTypeParam(false)); + + if (!this.match(11)) { + this.expect(12); + } + } + + if (this.eat(21)) { + rest = this.flowParseFunctionTypeParam(false); + } + + return { + params, + rest, + _this + }; + } + + flowIdentToTypeAnnotation(startPos, startLoc, node, id) { + switch (id.name) { + case "any": + return this.finishNode(node, "AnyTypeAnnotation"); + + case "bool": + case "boolean": + return this.finishNode(node, "BooleanTypeAnnotation"); + + case "mixed": + return this.finishNode(node, "MixedTypeAnnotation"); + + case "empty": + return this.finishNode(node, "EmptyTypeAnnotation"); + + case "number": + return this.finishNode(node, "NumberTypeAnnotation"); + + case "string": + return this.finishNode(node, "StringTypeAnnotation"); + + case "symbol": + return this.finishNode(node, "SymbolTypeAnnotation"); + + default: + this.checkNotUnderscore(id.name); + return this.flowParseGenericType(startPos, startLoc, id); + } + } + + flowParsePrimaryType() { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const node = this.startNode(); + let tmp; + let type; + let isGroupedType = false; + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + + switch (this.state.type) { + case 5: + return this.flowParseObjectType({ + allowStatic: false, + allowExact: false, + allowSpread: true, + allowProto: false, + allowInexact: true + }); + + case 6: + return this.flowParseObjectType({ + allowStatic: false, + allowExact: true, + allowSpread: true, + allowProto: false, + allowInexact: false + }); + + case 0: + this.state.noAnonFunctionType = false; + type = this.flowParseTupleType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + return type; + + case 47: + node.typeParameters = this.flowParseTypeParameterDeclaration(); + this.expect(10); + tmp = this.flowParseFunctionTypeParams(); + node.params = tmp.params; + node.rest = tmp.rest; + node.this = tmp._this; + this.expect(11); + this.expect(19); + node.returnType = this.flowParseType(); + return this.finishNode(node, "FunctionTypeAnnotation"); + + case 10: + this.next(); + + if (!this.match(11) && !this.match(21)) { + if (tokenIsIdentifier(this.state.type) || this.match(78)) { + const token = this.lookahead().type; + isGroupedType = token !== 17 && token !== 14; + } else { + isGroupedType = true; + } + } + + if (isGroupedType) { + this.state.noAnonFunctionType = false; + type = this.flowParseType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + + if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) { + this.expect(11); + return type; + } else { + this.eat(12); + } + } + + if (type) { + tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); + } else { + tmp = this.flowParseFunctionTypeParams(); + } + + node.params = tmp.params; + node.rest = tmp.rest; + node.this = tmp._this; + this.expect(11); + this.expect(19); + node.returnType = this.flowParseType(); + node.typeParameters = null; + return this.finishNode(node, "FunctionTypeAnnotation"); + + case 129: + return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); + + case 85: + case 86: + node.value = this.match(85); + this.next(); + return this.finishNode(node, "BooleanLiteralTypeAnnotation"); + + case 53: + if (this.state.value === "-") { + this.next(); + + if (this.match(130)) { + return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node); + } + + if (this.match(131)) { + return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node); + } + + throw this.raise(FlowErrors.UnexpectedSubtractionOperand, { + at: this.state.startLoc + }); + } + + throw this.unexpected(); + + case 130: + return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); + + case 131: + return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); + + case 88: + this.next(); + return this.finishNode(node, "VoidTypeAnnotation"); + + case 84: + this.next(); + return this.finishNode(node, "NullLiteralTypeAnnotation"); + + case 78: + this.next(); + return this.finishNode(node, "ThisTypeAnnotation"); + + case 55: + this.next(); + return this.finishNode(node, "ExistsTypeAnnotation"); + + case 87: + return this.flowParseTypeofType(); + + default: + if (tokenIsKeyword(this.state.type)) { + const label = tokenLabelName(this.state.type); + this.next(); + return super.createIdentifier(node, label); + } else if (tokenIsIdentifier(this.state.type)) { + if (this.isContextual(125)) { + return this.flowParseInterfaceType(); + } + + return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier()); + } + + } + + throw this.unexpected(); + } + + flowParsePostfixType() { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + let type = this.flowParsePrimaryType(); + let seenOptionalIndexedAccess = false; + + while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) { + const node = this.startNodeAt(startPos, startLoc); + const optional = this.eat(18); + seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional; + this.expect(0); + + if (!optional && this.match(3)) { + node.elementType = type; + this.next(); + type = this.finishNode(node, "ArrayTypeAnnotation"); + } else { + node.objectType = type; + node.indexType = this.flowParseType(); + this.expect(3); + + if (seenOptionalIndexedAccess) { + node.optional = optional; + type = this.finishNode(node, "OptionalIndexedAccessType"); + } else { + type = this.finishNode(node, "IndexedAccessType"); + } + } + } + + return type; + } + + flowParsePrefixType() { + const node = this.startNode(); + + if (this.eat(17)) { + node.typeAnnotation = this.flowParsePrefixType(); + return this.finishNode(node, "NullableTypeAnnotation"); + } else { + return this.flowParsePostfixType(); + } + } + + flowParseAnonFunctionWithoutParens() { + const param = this.flowParsePrefixType(); + + if (!this.state.noAnonFunctionType && this.eat(19)) { + const node = this.startNodeAt(param.start, param.loc.start); + node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; + node.rest = null; + node.this = null; + node.returnType = this.flowParseType(); + node.typeParameters = null; + return this.finishNode(node, "FunctionTypeAnnotation"); + } + + return param; + } + + flowParseIntersectionType() { + const node = this.startNode(); + this.eat(45); + const type = this.flowParseAnonFunctionWithoutParens(); + node.types = [type]; + + while (this.eat(45)) { + node.types.push(this.flowParseAnonFunctionWithoutParens()); + } + + return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); + } + + flowParseUnionType() { + const node = this.startNode(); + this.eat(43); + const type = this.flowParseIntersectionType(); + node.types = [type]; + + while (this.eat(43)) { + node.types.push(this.flowParseIntersectionType()); + } + + return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); + } + + flowParseType() { + const oldInType = this.state.inType; + this.state.inType = true; + const type = this.flowParseUnionType(); + this.state.inType = oldInType; + return type; + } + + flowParseTypeOrImplicitInstantiation() { + if (this.state.type === 128 && this.state.value === "_") { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const node = this.parseIdentifier(); + return this.flowParseGenericType(startPos, startLoc, node); + } else { + return this.flowParseType(); + } + } + + flowParseTypeAnnotation() { + const node = this.startNode(); + node.typeAnnotation = this.flowParseTypeInitialiser(); + return this.finishNode(node, "TypeAnnotation"); + } + + flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { + const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); + + if (this.match(14)) { + ident.typeAnnotation = this.flowParseTypeAnnotation(); + this.resetEndLocation(ident); + } + + return ident; + } + + typeCastToParameter(node) { + node.expression.typeAnnotation = node.typeAnnotation; + this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); + return node.expression; + } + + flowParseVariance() { + let variance = null; + + if (this.match(53)) { + variance = this.startNode(); + + if (this.state.value === "+") { + variance.kind = "plus"; + } else { + variance.kind = "minus"; + } + + this.next(); + this.finishNode(variance, "Variance"); + } + + return variance; + } + + parseFunctionBody(node, allowExpressionBody, isMethod = false) { + if (allowExpressionBody) { + return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); + } + + return super.parseFunctionBody(node, false, isMethod); + } + + parseFunctionBodyAndFinish(node, type, isMethod = false) { + if (this.match(14)) { + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; + } + + super.parseFunctionBodyAndFinish(node, type, isMethod); + } + + parseStatement(context, topLevel) { + if (this.state.strict && this.isContextual(125)) { + const lookahead = this.lookahead(); + + if (tokenIsKeywordOrIdentifier(lookahead.type)) { + const node = this.startNode(); + this.next(); + return this.flowParseInterface(node); + } + } else if (this.shouldParseEnums() && this.isContextual(122)) { + const node = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(node); + } + + const stmt = super.parseStatement(context, topLevel); + + if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { + this.flowPragma = null; + } + + return stmt; + } + + parseExpressionStatement(node, expr) { + if (expr.type === "Identifier") { + if (expr.name === "declare") { + if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) { + return this.flowParseDeclare(node); + } + } else if (tokenIsIdentifier(this.state.type)) { + if (expr.name === "interface") { + return this.flowParseInterface(node); + } else if (expr.name === "type") { + return this.flowParseTypeAlias(node); + } else if (expr.name === "opaque") { + return this.flowParseOpaqueType(node, false); + } + } + } + + return super.parseExpressionStatement(node, expr); + } + + shouldParseExportDeclaration() { + const { + type + } = this.state; + + if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 122) { + return !this.state.containsEsc; + } + + return super.shouldParseExportDeclaration(); + } + + isExportDefaultSpecifier() { + const { + type + } = this.state; + + if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 122) { + return this.state.containsEsc; + } + + return super.isExportDefaultSpecifier(); + } + + parseExportDefaultExpression() { + if (this.shouldParseEnums() && this.isContextual(122)) { + const node = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(node); + } + + return super.parseExportDefaultExpression(); + } + + parseConditional(expr, startPos, startLoc, refExpressionErrors) { + if (!this.match(17)) return expr; + + if (this.state.maybeInArrowParameters) { + const nextCh = this.lookaheadCharCode(); + + if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) { + this.setOptionalParametersError(refExpressionErrors); + return expr; + } + } + + this.expect(17); + const state = this.state.clone(); + const originalNoArrowAt = this.state.noArrowAt; + const node = this.startNodeAt(startPos, startLoc); + let { + consequent, + failed + } = this.tryParseConditionalConsequent(); + let [valid, invalid] = this.getArrowLikeExpressions(consequent); + + if (failed || invalid.length > 0) { + const noArrowAt = [...originalNoArrowAt]; + + if (invalid.length > 0) { + this.state = state; + this.state.noArrowAt = noArrowAt; + + for (let i = 0; i < invalid.length; i++) { + noArrowAt.push(invalid[i].start); + } + + ({ + consequent, + failed + } = this.tryParseConditionalConsequent()); + [valid, invalid] = this.getArrowLikeExpressions(consequent); + } + + if (failed && valid.length > 1) { + this.raise(FlowErrors.AmbiguousConditionalArrow, { + at: state.startLoc + }); + } + + if (failed && valid.length === 1) { + this.state = state; + noArrowAt.push(valid[0].start); + this.state.noArrowAt = noArrowAt; + ({ + consequent, + failed + } = this.tryParseConditionalConsequent()); + } + } + + this.getArrowLikeExpressions(consequent, true); + this.state.noArrowAt = originalNoArrowAt; + this.expect(14); + node.test = expr; + node.consequent = consequent; + node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined)); + return this.finishNode(node, "ConditionalExpression"); + } + + tryParseConditionalConsequent() { + this.state.noArrowParamsConversionAt.push(this.state.start); + const consequent = this.parseMaybeAssignAllowIn(); + const failed = !this.match(14); + this.state.noArrowParamsConversionAt.pop(); + return { + consequent, + failed + }; + } + + getArrowLikeExpressions(node, disallowInvalid) { + const stack = [node]; + const arrows = []; + + while (stack.length !== 0) { + const node = stack.pop(); + + if (node.type === "ArrowFunctionExpression") { + if (node.typeParameters || !node.returnType) { + this.finishArrowValidation(node); + } else { + arrows.push(node); + } + + stack.push(node.body); + } else if (node.type === "ConditionalExpression") { + stack.push(node.consequent); + stack.push(node.alternate); + } + } + + if (disallowInvalid) { + arrows.forEach(node => this.finishArrowValidation(node)); + return [arrows, []]; + } + + return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); + } + + finishArrowValidation(node) { + var _node$extra; + + this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false); + this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW); + super.checkParams(node, false, true); + this.scope.exit(); + } + + forwardNoArrowParamsConversionAt(node, parse) { + let result; + + if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { + this.state.noArrowParamsConversionAt.push(this.state.start); + result = parse(); + this.state.noArrowParamsConversionAt.pop(); + } else { + result = parse(); + } + + return result; + } + + parseParenItem(node, startPos, startLoc) { + node = super.parseParenItem(node, startPos, startLoc); + + if (this.eat(17)) { + node.optional = true; + this.resetEndLocation(node); + } + + if (this.match(14)) { + const typeCastNode = this.startNodeAt(startPos, startLoc); + typeCastNode.expression = node; + typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); + return this.finishNode(typeCastNode, "TypeCastExpression"); + } + + return node; + } + + assertModuleNodeAllowed(node) { + if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { + return; + } + + super.assertModuleNodeAllowed(node); + } + + parseExport(node) { + const decl = super.parseExport(node); + + if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") { + decl.exportKind = decl.exportKind || "value"; + } + + return decl; + } + + parseExportDeclaration(node) { + if (this.isContextual(126)) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + + if (this.match(5)) { + node.specifiers = this.parseExportSpecifiers(true); + this.parseExportFrom(node); + return null; + } else { + return this.flowParseTypeAlias(declarationNode); + } + } else if (this.isContextual(127)) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseOpaqueType(declarationNode, false); + } else if (this.isContextual(125)) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseInterface(declarationNode); + } else if (this.shouldParseEnums() && this.isContextual(122)) { + node.exportKind = "value"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(declarationNode); + } else { + return super.parseExportDeclaration(node); + } + } + + eatExportStar(node) { + if (super.eatExportStar(...arguments)) return true; + + if (this.isContextual(126) && this.lookahead().type === 55) { + node.exportKind = "type"; + this.next(); + this.next(); + return true; + } + + return false; + } + + maybeParseExportNamespaceSpecifier(node) { + const { + startLoc + } = this.state; + const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); + + if (hasNamespace && node.exportKind === "type") { + this.unexpected(startLoc); + } + + return hasNamespace; + } + + parseClassId(node, isStatement, optionalId) { + super.parseClassId(node, isStatement, optionalId); + + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + } + + parseClassMember(classBody, member, state) { + const { + startLoc + } = this.state; + + if (this.isContextual(121)) { + if (this.parseClassMemberFromModifier(classBody, member)) { + return; + } + + member.declare = true; + } + + super.parseClassMember(classBody, member, state); + + if (member.declare) { + if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") { + this.raise(FlowErrors.DeclareClassElement, { + at: startLoc + }); + } else if (member.value) { + this.raise(FlowErrors.DeclareClassFieldInitializer, { + at: member.value + }); + } + } + } + + isIterator(word) { + return word === "iterator" || word === "asyncIterator"; + } + + readIterator() { + const word = super.readWord1(); + const fullWord = "@@" + word; + + if (!this.isIterator(word) || !this.state.inType) { + this.raise(Errors.InvalidIdentifier, { + at: this.state.curPosition(), + identifierName: fullWord + }); + } + + this.finishToken(128, fullWord); + } + + getTokenFromCode(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + + if (code === 123 && next === 124) { + return this.finishOp(6, 2); + } else if (this.state.inType && (code === 62 || code === 60)) { + return this.finishOp(code === 62 ? 48 : 47, 1); + } else if (this.state.inType && code === 63) { + if (next === 46) { + return this.finishOp(18, 2); + } + + return this.finishOp(17, 1); + } else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) { + this.state.pos += 2; + return this.readIterator(); + } else { + return super.getTokenFromCode(code); + } + } + + isAssignable(node, isBinding) { + if (node.type === "TypeCastExpression") { + return this.isAssignable(node.expression, isBinding); + } else { + return super.isAssignable(node, isBinding); + } + } + + toAssignable(node, isLHS = false) { + if (!isLHS && node.type === "AssignmentExpression" && node.left.type === "TypeCastExpression") { + node.left = this.typeCastToParameter(node.left); + } + + super.toAssignable(...arguments); + } + + toAssignableList(exprList, trailingCommaLoc, isLHS) { + for (let i = 0; i < exprList.length; i++) { + const expr = exprList[i]; + + if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { + exprList[i] = this.typeCastToParameter(expr); + } + } + + super.toAssignableList(exprList, trailingCommaLoc, isLHS); + } + + toReferencedList(exprList, isParenthesizedExpr) { + for (let i = 0; i < exprList.length; i++) { + var _expr$extra; + + const expr = exprList[i]; + + if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { + this.raise(FlowErrors.TypeCastInPattern, { + at: expr.typeAnnotation + }); + } + } + + return exprList; + } + + parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { + const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); + + if (canBePattern && !this.state.maybeInArrowParameters) { + this.toReferencedList(node.elements); + } + + return node; + } + + isValidLVal(type, ...rest) { + return type === "TypeCastExpression" || super.isValidLVal(type, ...rest); + } + + parseClassProperty(node) { + if (this.match(14)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); + } + + return super.parseClassProperty(node); + } + + parseClassPrivateProperty(node) { + if (this.match(14)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); + } + + return super.parseClassPrivateProperty(node); + } + + isClassMethod() { + return this.match(47) || super.isClassMethod(); + } + + isClassProperty() { + return this.match(14) || super.isClassProperty(); + } + + isNonstaticConstructor(method) { + return !this.match(14) && super.isNonstaticConstructor(method); + } + + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + if (method.variance) { + this.unexpected(method.variance.loc.start); + } + + delete method.variance; + + if (this.match(47)) { + method.typeParameters = this.flowParseTypeParameterDeclaration(); + } + + super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); + + if (method.params && isConstructor) { + const params = method.params; + + if (params.length > 0 && this.isThisParam(params[0])) { + this.raise(FlowErrors.ThisParamBannedInConstructor, { + at: method + }); + } + } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) { + const params = method.value.params; + + if (params.length > 0 && this.isThisParam(params[0])) { + this.raise(FlowErrors.ThisParamBannedInConstructor, { + at: method + }); + } + } + } + + pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { + if (method.variance) { + this.unexpected(method.variance.loc.start); + } + + delete method.variance; + + if (this.match(47)) { + method.typeParameters = this.flowParseTypeParameterDeclaration(); + } + + super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); + } + + parseClassSuper(node) { + super.parseClassSuper(node); + + if (node.superClass && this.match(47)) { + node.superTypeParameters = this.flowParseTypeParameterInstantiation(); + } + + if (this.isContextual(110)) { + this.next(); + const implemented = node.implements = []; + + do { + const node = this.startNode(); + node.id = this.flowParseRestrictedIdentifier(true); + + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } + + implemented.push(this.finishNode(node, "ClassImplements")); + } while (this.eat(12)); + } + } + + checkGetterSetterParams(method) { + super.checkGetterSetterParams(method); + const params = this.getObjectOrClassMethodParams(method); + + if (params.length > 0) { + const param = params[0]; + + if (this.isThisParam(param) && method.kind === "get") { + this.raise(FlowErrors.GetterMayNotHaveThisParam, { + at: param + }); + } else if (this.isThisParam(param)) { + this.raise(FlowErrors.SetterMayNotHaveThisParam, { + at: param + }); + } + } + } + + parsePropertyNamePrefixOperator(node) { + node.variance = this.flowParseVariance(); + } + + parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { + if (prop.variance) { + this.unexpected(prop.variance.loc.start); + } + + delete prop.variance; + let typeParameters; + + if (this.match(47) && !isAccessor) { + typeParameters = this.flowParseTypeParameterDeclaration(); + if (!this.match(10)) this.unexpected(); + } + + super.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); + + if (typeParameters) { + (prop.value || prop).typeParameters = typeParameters; + } + } + + parseAssignableListItemTypes(param) { + if (this.eat(17)) { + if (param.type !== "Identifier") { + this.raise(FlowErrors.PatternIsOptional, { + at: param + }); + } + + if (this.isThisParam(param)) { + this.raise(FlowErrors.ThisParamMayNotBeOptional, { + at: param + }); + } + + param.optional = true; + } + + if (this.match(14)) { + param.typeAnnotation = this.flowParseTypeAnnotation(); + } else if (this.isThisParam(param)) { + this.raise(FlowErrors.ThisParamAnnotationRequired, { + at: param + }); + } + + if (this.match(29) && this.isThisParam(param)) { + this.raise(FlowErrors.ThisParamNoDefault, { + at: param + }); + } + + this.resetEndLocation(param); + return param; + } + + parseMaybeDefault(startPos, startLoc, left) { + const node = super.parseMaybeDefault(startPos, startLoc, left); + + if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { + this.raise(FlowErrors.TypeBeforeInitializer, { + at: node.typeAnnotation + }); + } + + return node; + } + + shouldParseDefaultImport(node) { + if (!hasTypeImportKind(node)) { + return super.shouldParseDefaultImport(node); + } + + return isMaybeDefaultImport(this.state.type); + } + + parseImportSpecifierLocal(node, specifier, type) { + specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); + node.specifiers.push(this.finishImportSpecifier(specifier, type)); + } + + maybeParseDefaultImportSpecifier(node) { + node.importKind = "value"; + let kind = null; + + if (this.match(87)) { + kind = "typeof"; + } else if (this.isContextual(126)) { + kind = "type"; + } + + if (kind) { + const lh = this.lookahead(); + const { + type + } = lh; + + if (kind === "type" && type === 55) { + this.unexpected(null, lh.type); + } + + if (isMaybeDefaultImport(type) || type === 5 || type === 55) { + this.next(); + node.importKind = kind; + } + } + + return super.maybeParseDefaultImportSpecifier(node); + } + + parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly) { + const firstIdent = specifier.imported; + let specifierTypeKind = null; + + if (firstIdent.type === "Identifier") { + if (firstIdent.name === "type") { + specifierTypeKind = "type"; + } else if (firstIdent.name === "typeof") { + specifierTypeKind = "typeof"; + } + } + + let isBinding = false; + + if (this.isContextual(93) && !this.isLookaheadContextual("as")) { + const as_ident = this.parseIdentifier(true); + + if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) { + specifier.imported = as_ident; + specifier.importKind = specifierTypeKind; + specifier.local = cloneIdentifier(as_ident); + } else { + specifier.imported = firstIdent; + specifier.importKind = null; + specifier.local = this.parseIdentifier(); + } + } else { + if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) { + specifier.imported = this.parseIdentifier(true); + specifier.importKind = specifierTypeKind; + } else { + if (importedIsString) { + throw this.raise(Errors.ImportBindingIsString, { + at: specifier, + importName: firstIdent.value + }); + } + + specifier.imported = firstIdent; + specifier.importKind = null; + } + + if (this.eatContextual(93)) { + specifier.local = this.parseIdentifier(); + } else { + isBinding = true; + specifier.local = cloneIdentifier(specifier.imported); + } + } + + const specifierIsTypeImport = hasTypeImportKind(specifier); + + if (isInTypeOnlyImport && specifierIsTypeImport) { + this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, { + at: specifier + }); + } + + if (isInTypeOnlyImport || specifierIsTypeImport) { + this.checkReservedType(specifier.local.name, specifier.local.loc.start, true); + } + + if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) { + this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true); + } + + return this.finishImportSpecifier(specifier, "ImportSpecifier"); + } + + parseBindingAtom() { + switch (this.state.type) { + case 78: + return this.parseIdentifier(true); + + default: + return super.parseBindingAtom(); + } + } + + parseFunctionParams(node, allowModifiers) { + const kind = node.kind; + + if (kind !== "get" && kind !== "set" && this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + + super.parseFunctionParams(node, allowModifiers); + } + + parseVarId(decl, kind) { + super.parseVarId(decl, kind); + + if (this.match(14)) { + decl.id.typeAnnotation = this.flowParseTypeAnnotation(); + this.resetEndLocation(decl.id); + } + } + + parseAsyncArrowFromCallExpression(node, call) { + if (this.match(14)) { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + node.returnType = this.flowParseTypeAnnotation(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + } + + return super.parseAsyncArrowFromCallExpression(node, call); + } + + shouldParseAsyncArrow() { + return this.match(14) || super.shouldParseAsyncArrow(); + } + + parseMaybeAssign(refExpressionErrors, afterLeftParse) { + var _jsx; + + let state = null; + let jsx; + + if (this.hasPlugin("jsx") && (this.match(138) || this.match(47))) { + state = this.state.clone(); + jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); + if (!jsx.error) return jsx.node; + const { + context + } = this.state; + const currentContext = context[context.length - 1]; + + if (currentContext === types.j_oTag || currentContext === types.j_expr) { + context.pop(); + } + } + + if ((_jsx = jsx) != null && _jsx.error || this.match(47)) { + var _jsx2, _jsx3; + + state = state || this.state.clone(); + let typeParameters; + const arrow = this.tryParse(abort => { + var _arrowExpression$extr; + + typeParameters = this.flowParseTypeParameterDeclaration(); + const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { + const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + this.resetStartLocationFromNode(result, typeParameters); + return result; + }); + if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort(); + const expr = this.maybeUnwrapTypeCastExpression(arrowExpression); + if (expr.type !== "ArrowFunctionExpression") abort(); + expr.typeParameters = typeParameters; + this.resetStartLocationFromNode(expr, typeParameters); + return arrowExpression; + }, state); + let arrowExpression = null; + + if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { + if (!arrow.error && !arrow.aborted) { + if (arrow.node.async) { + this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, { + at: typeParameters + }); + } + + return arrow.node; + } + + arrowExpression = arrow.node; + } + + if ((_jsx2 = jsx) != null && _jsx2.node) { + this.state = jsx.failState; + return jsx.node; + } + + if (arrowExpression) { + this.state = arrow.failState; + return arrowExpression; + } + + if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; + if (arrow.thrown) throw arrow.error; + throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, { + at: typeParameters + }); + } + + return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + } + + parseArrow(node) { + if (this.match(14)) { + const result = this.tryParse(() => { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + if (this.canInsertSemicolon()) this.unexpected(); + if (!this.match(19)) this.unexpected(); + return typeNode; + }); + if (result.thrown) return null; + if (result.error) this.state = result.failState; + node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null; + } + + return super.parseArrow(node); + } + + shouldParseArrow(params) { + return this.match(14) || super.shouldParseArrow(params); + } + + setArrowFunctionParameters(node, params) { + if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { + node.params = params; + } else { + super.setArrowFunctionParameters(node, params); + } + } + + checkParams(node, allowDuplicates, isArrowFunction) { + if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { + return; + } + + for (let i = 0; i < node.params.length; i++) { + if (this.isThisParam(node.params[i]) && i > 0) { + this.raise(FlowErrors.ThisParamMustBeFirst, { + at: node.params[i] + }); + } + } + + return super.checkParams(...arguments); + } + + parseParenAndDistinguishExpression(canBeArrow) { + return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1); + } + + parseSubscripts(base, startPos, startLoc, noCalls) { + if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startPos) !== -1) { + this.next(); + const node = this.startNodeAt(startPos, startLoc); + node.callee = base; + node.arguments = this.parseCallExpressionArguments(11, false); + base = this.finishNode(node, "CallExpression"); + } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) { + const state = this.state.clone(); + const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startPos, startLoc) || abort(), state); + if (!arrow.error && !arrow.aborted) return arrow.node; + const result = this.tryParse(() => super.parseSubscripts(base, startPos, startLoc, noCalls), state); + if (result.node && !result.error) return result.node; + + if (arrow.node) { + this.state = arrow.failState; + return arrow.node; + } + + if (result.node) { + this.state = result.failState; + return result.node; + } + + throw arrow.error || result.error; + } + + return super.parseSubscripts(base, startPos, startLoc, noCalls); + } + + parseSubscript(base, startPos, startLoc, noCalls, subscriptState) { + if (this.match(18) && this.isLookaheadToken_lt()) { + subscriptState.optionalChainMember = true; + + if (noCalls) { + subscriptState.stop = true; + return base; + } + + this.next(); + const node = this.startNodeAt(startPos, startLoc); + node.callee = base; + node.typeArguments = this.flowParseTypeParameterInstantiation(); + this.expect(10); + node.arguments = this.parseCallExpressionArguments(11, false); + node.optional = true; + return this.finishCallExpression(node, true); + } else if (!noCalls && this.shouldParseTypes() && this.match(47)) { + const node = this.startNodeAt(startPos, startLoc); + node.callee = base; + const result = this.tryParse(() => { + node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); + this.expect(10); + node.arguments = this.parseCallExpressionArguments(11, false); + if (subscriptState.optionalChainMember) node.optional = false; + return this.finishCallExpression(node, subscriptState.optionalChainMember); + }); + + if (result.node) { + if (result.error) this.state = result.failState; + return result.node; + } + } + + return super.parseSubscript(base, startPos, startLoc, noCalls, subscriptState); + } + + parseNewArguments(node) { + let targs = null; + + if (this.shouldParseTypes() && this.match(47)) { + targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; + } + + node.typeArguments = targs; + super.parseNewArguments(node); + } + + parseAsyncArrowWithTypeParameters(startPos, startLoc) { + const node = this.startNodeAt(startPos, startLoc); + this.parseFunctionParams(node); + if (!this.parseArrow(node)) return; + return this.parseArrowExpression(node, undefined, true); + } + + readToken_mult_modulo(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + + if (code === 42 && next === 47 && this.state.hasFlowComment) { + this.state.hasFlowComment = false; + this.state.pos += 2; + this.nextToken(); + return; + } + + super.readToken_mult_modulo(code); + } + + readToken_pipe_amp(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + + if (code === 124 && next === 125) { + this.finishOp(9, 2); + return; + } + + super.readToken_pipe_amp(code); + } + + parseTopLevel(file, program) { + const fileNode = super.parseTopLevel(file, program); + + if (this.state.hasFlowComment) { + this.raise(FlowErrors.UnterminatedFlowComment, { + at: this.state.curPosition() + }); + } + + return fileNode; + } + + skipBlockComment() { + if (this.hasPlugin("flowComments") && this.skipFlowComment()) { + if (this.state.hasFlowComment) { + throw this.raise(FlowErrors.NestedFlowComment, { + at: this.state.startLoc + }); + } + + this.hasFlowCommentCompletion(); + this.state.pos += this.skipFlowComment(); + this.state.hasFlowComment = true; + return; + } + + if (this.state.hasFlowComment) { + const end = this.input.indexOf("*-/", this.state.pos + 2); + + if (end === -1) { + throw this.raise(Errors.UnterminatedComment, { + at: this.state.curPosition() + }); + } + + this.state.pos = end + 2 + 3; + return; + } + + return super.skipBlockComment(); + } + + skipFlowComment() { + const { + pos + } = this.state; + let shiftToFirstNonWhiteSpace = 2; + + while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { + shiftToFirstNonWhiteSpace++; + } + + const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); + const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); + + if (ch2 === 58 && ch3 === 58) { + return shiftToFirstNonWhiteSpace + 2; + } + + if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { + return shiftToFirstNonWhiteSpace + 12; + } + + if (ch2 === 58 && ch3 !== 58) { + return shiftToFirstNonWhiteSpace; + } + + return false; + } + + hasFlowCommentCompletion() { + const end = this.input.indexOf("*/", this.state.pos); + + if (end === -1) { + throw this.raise(Errors.UnterminatedComment, { + at: this.state.curPosition() + }); + } + } + + flowEnumErrorBooleanMemberNotInitialized(loc, { + enumName, + memberName + }) { + this.raise(FlowErrors.EnumBooleanMemberNotInitialized, { + at: loc, + memberName, + enumName + }); + } + + flowEnumErrorInvalidMemberInitializer(loc, enumContext) { + return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, Object.assign({ + at: loc + }, enumContext)); + } + + flowEnumErrorNumberMemberNotInitialized(loc, { + enumName, + memberName + }) { + this.raise(FlowErrors.EnumNumberMemberNotInitialized, { + at: loc, + enumName, + memberName + }); + } + + flowEnumErrorStringMemberInconsistentlyInitailized(node, { + enumName + }) { + this.raise(FlowErrors.EnumStringMemberInconsistentlyInitailized, { + at: node, + enumName + }); + } + + flowEnumMemberInit() { + const startLoc = this.state.startLoc; + + const endOfInit = () => this.match(12) || this.match(8); + + switch (this.state.type) { + case 130: + { + const literal = this.parseNumericLiteral(this.state.value); + + if (endOfInit()) { + return { + type: "number", + loc: literal.loc.start, + value: literal + }; + } + + return { + type: "invalid", + loc: startLoc + }; + } + + case 129: + { + const literal = this.parseStringLiteral(this.state.value); + + if (endOfInit()) { + return { + type: "string", + loc: literal.loc.start, + value: literal + }; + } + + return { + type: "invalid", + loc: startLoc + }; + } + + case 85: + case 86: + { + const literal = this.parseBooleanLiteral(this.match(85)); + + if (endOfInit()) { + return { + type: "boolean", + loc: literal.loc.start, + value: literal + }; + } + + return { + type: "invalid", + loc: startLoc + }; + } + + default: + return { + type: "invalid", + loc: startLoc + }; + } + } + + flowEnumMemberRaw() { + const loc = this.state.startLoc; + const id = this.parseIdentifier(true); + const init = this.eat(29) ? this.flowEnumMemberInit() : { + type: "none", + loc + }; + return { + id, + init + }; + } + + flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) { + const { + explicitType + } = context; + + if (explicitType === null) { + return; + } + + if (explicitType !== expectedType) { + this.flowEnumErrorInvalidMemberInitializer(loc, context); + } + } + + flowEnumMembers({ + enumName, + explicitType + }) { + const seenNames = new Set(); + const members = { + booleanMembers: [], + numberMembers: [], + stringMembers: [], + defaultedMembers: [] + }; + let hasUnknownMembers = false; + + while (!this.match(8)) { + if (this.eat(21)) { + hasUnknownMembers = true; + break; + } + + const memberNode = this.startNode(); + const { + id, + init + } = this.flowEnumMemberRaw(); + const memberName = id.name; + + if (memberName === "") { + continue; + } + + if (/^[a-z]/.test(memberName)) { + this.raise(FlowErrors.EnumInvalidMemberName, { + at: id, + memberName, + suggestion: memberName[0].toUpperCase() + memberName.slice(1), + enumName + }); + } + + if (seenNames.has(memberName)) { + this.raise(FlowErrors.EnumDuplicateMemberName, { + at: id, + memberName, + enumName + }); + } + + seenNames.add(memberName); + const context = { + enumName, + explicitType, + memberName + }; + memberNode.id = id; + + switch (init.type) { + case "boolean": + { + this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "boolean"); + memberNode.init = init.value; + members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); + break; + } + + case "number": + { + this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "number"); + memberNode.init = init.value; + members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); + break; + } + + case "string": + { + this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "string"); + memberNode.init = init.value; + members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); + break; + } + + case "invalid": + { + throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context); + } + + case "none": + { + switch (explicitType) { + case "boolean": + this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context); + break; + + case "number": + this.flowEnumErrorNumberMemberNotInitialized(init.loc, context); + break; + + default: + members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); + } + } + } + + if (!this.match(8)) { + this.expect(12); + } + } + + return { + members, + hasUnknownMembers + }; + } + + flowEnumStringMembers(initializedMembers, defaultedMembers, { + enumName + }) { + if (initializedMembers.length === 0) { + return defaultedMembers; + } else if (defaultedMembers.length === 0) { + return initializedMembers; + } else if (defaultedMembers.length > initializedMembers.length) { + for (const member of initializedMembers) { + this.flowEnumErrorStringMemberInconsistentlyInitailized(member, { + enumName + }); + } + + return defaultedMembers; + } else { + for (const member of defaultedMembers) { + this.flowEnumErrorStringMemberInconsistentlyInitailized(member, { + enumName + }); + } + + return initializedMembers; + } + } + + flowEnumParseExplicitType({ + enumName + }) { + if (!this.eatContextual(101)) return null; + + if (!tokenIsIdentifier(this.state.type)) { + throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, { + at: this.state.startLoc, + enumName + }); + } + + const { + value + } = this.state; + this.next(); + + if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { + this.raise(FlowErrors.EnumInvalidExplicitType, { + at: this.state.startLoc, + enumName, + invalidEnumType: value + }); + } + + return value; + } + + flowEnumBody(node, id) { + const enumName = id.name; + const nameLoc = id.loc.start; + const explicitType = this.flowEnumParseExplicitType({ + enumName + }); + this.expect(5); + const { + members, + hasUnknownMembers + } = this.flowEnumMembers({ + enumName, + explicitType + }); + node.hasUnknownMembers = hasUnknownMembers; + + switch (explicitType) { + case "boolean": + node.explicitType = true; + node.members = members.booleanMembers; + this.expect(8); + return this.finishNode(node, "EnumBooleanBody"); + + case "number": + node.explicitType = true; + node.members = members.numberMembers; + this.expect(8); + return this.finishNode(node, "EnumNumberBody"); + + case "string": + node.explicitType = true; + node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { + enumName + }); + this.expect(8); + return this.finishNode(node, "EnumStringBody"); + + case "symbol": + node.members = members.defaultedMembers; + this.expect(8); + return this.finishNode(node, "EnumSymbolBody"); + + default: + { + const empty = () => { + node.members = []; + this.expect(8); + return this.finishNode(node, "EnumStringBody"); + }; + + node.explicitType = false; + const boolsLen = members.booleanMembers.length; + const numsLen = members.numberMembers.length; + const strsLen = members.stringMembers.length; + const defaultedLen = members.defaultedMembers.length; + + if (!boolsLen && !numsLen && !strsLen && !defaultedLen) { + return empty(); + } else if (!boolsLen && !numsLen) { + node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { + enumName + }); + this.expect(8); + return this.finishNode(node, "EnumStringBody"); + } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) { + for (const member of members.defaultedMembers) { + this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, { + enumName, + memberName: member.id.name + }); + } + + node.members = members.booleanMembers; + this.expect(8); + return this.finishNode(node, "EnumBooleanBody"); + } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) { + for (const member of members.defaultedMembers) { + this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, { + enumName, + memberName: member.id.name + }); + } + + node.members = members.numberMembers; + this.expect(8); + return this.finishNode(node, "EnumNumberBody"); + } else { + this.raise(FlowErrors.EnumInconsistentMemberValues, { + at: nameLoc, + enumName + }); + return empty(); + } + } + } + } + + flowParseEnumDeclaration(node) { + const id = this.parseIdentifier(); + node.id = id; + node.body = this.flowEnumBody(this.startNode(), id); + return this.finishNode(node, "EnumDeclaration"); + } + + isLookaheadToken_lt() { + const next = this.nextTokenStart(); + + if (this.input.charCodeAt(next) === 60) { + const afterNext = this.input.charCodeAt(next + 1); + return afterNext !== 60 && afterNext !== 61; + } + + return false; + } + + maybeUnwrapTypeCastExpression(node) { + return node.type === "TypeCastExpression" ? node.expression : node; + } + +}); + +const entities = { + __proto__: null, + quot: "\u0022", + amp: "&", + apos: "\u0027", + lt: "<", + gt: ">", + nbsp: "\u00A0", + iexcl: "\u00A1", + cent: "\u00A2", + pound: "\u00A3", + curren: "\u00A4", + yen: "\u00A5", + brvbar: "\u00A6", + sect: "\u00A7", + uml: "\u00A8", + copy: "\u00A9", + ordf: "\u00AA", + laquo: "\u00AB", + not: "\u00AC", + shy: "\u00AD", + reg: "\u00AE", + macr: "\u00AF", + deg: "\u00B0", + plusmn: "\u00B1", + sup2: "\u00B2", + sup3: "\u00B3", + acute: "\u00B4", + micro: "\u00B5", + para: "\u00B6", + middot: "\u00B7", + cedil: "\u00B8", + sup1: "\u00B9", + ordm: "\u00BA", + raquo: "\u00BB", + frac14: "\u00BC", + frac12: "\u00BD", + frac34: "\u00BE", + iquest: "\u00BF", + Agrave: "\u00C0", + Aacute: "\u00C1", + Acirc: "\u00C2", + Atilde: "\u00C3", + Auml: "\u00C4", + Aring: "\u00C5", + AElig: "\u00C6", + Ccedil: "\u00C7", + Egrave: "\u00C8", + Eacute: "\u00C9", + Ecirc: "\u00CA", + Euml: "\u00CB", + Igrave: "\u00CC", + Iacute: "\u00CD", + Icirc: "\u00CE", + Iuml: "\u00CF", + ETH: "\u00D0", + Ntilde: "\u00D1", + Ograve: "\u00D2", + Oacute: "\u00D3", + Ocirc: "\u00D4", + Otilde: "\u00D5", + Ouml: "\u00D6", + times: "\u00D7", + Oslash: "\u00D8", + Ugrave: "\u00D9", + Uacute: "\u00DA", + Ucirc: "\u00DB", + Uuml: "\u00DC", + Yacute: "\u00DD", + THORN: "\u00DE", + szlig: "\u00DF", + agrave: "\u00E0", + aacute: "\u00E1", + acirc: "\u00E2", + atilde: "\u00E3", + auml: "\u00E4", + aring: "\u00E5", + aelig: "\u00E6", + ccedil: "\u00E7", + egrave: "\u00E8", + eacute: "\u00E9", + ecirc: "\u00EA", + euml: "\u00EB", + igrave: "\u00EC", + iacute: "\u00ED", + icirc: "\u00EE", + iuml: "\u00EF", + eth: "\u00F0", + ntilde: "\u00F1", + ograve: "\u00F2", + oacute: "\u00F3", + ocirc: "\u00F4", + otilde: "\u00F5", + ouml: "\u00F6", + divide: "\u00F7", + oslash: "\u00F8", + ugrave: "\u00F9", + uacute: "\u00FA", + ucirc: "\u00FB", + uuml: "\u00FC", + yacute: "\u00FD", + thorn: "\u00FE", + yuml: "\u00FF", + OElig: "\u0152", + oelig: "\u0153", + Scaron: "\u0160", + scaron: "\u0161", + Yuml: "\u0178", + fnof: "\u0192", + circ: "\u02C6", + tilde: "\u02DC", + Alpha: "\u0391", + Beta: "\u0392", + Gamma: "\u0393", + Delta: "\u0394", + Epsilon: "\u0395", + Zeta: "\u0396", + Eta: "\u0397", + Theta: "\u0398", + Iota: "\u0399", + Kappa: "\u039A", + Lambda: "\u039B", + Mu: "\u039C", + Nu: "\u039D", + Xi: "\u039E", + Omicron: "\u039F", + Pi: "\u03A0", + Rho: "\u03A1", + Sigma: "\u03A3", + Tau: "\u03A4", + Upsilon: "\u03A5", + Phi: "\u03A6", + Chi: "\u03A7", + Psi: "\u03A8", + Omega: "\u03A9", + alpha: "\u03B1", + beta: "\u03B2", + gamma: "\u03B3", + delta: "\u03B4", + epsilon: "\u03B5", + zeta: "\u03B6", + eta: "\u03B7", + theta: "\u03B8", + iota: "\u03B9", + kappa: "\u03BA", + lambda: "\u03BB", + mu: "\u03BC", + nu: "\u03BD", + xi: "\u03BE", + omicron: "\u03BF", + pi: "\u03C0", + rho: "\u03C1", + sigmaf: "\u03C2", + sigma: "\u03C3", + tau: "\u03C4", + upsilon: "\u03C5", + phi: "\u03C6", + chi: "\u03C7", + psi: "\u03C8", + omega: "\u03C9", + thetasym: "\u03D1", + upsih: "\u03D2", + piv: "\u03D6", + ensp: "\u2002", + emsp: "\u2003", + thinsp: "\u2009", + zwnj: "\u200C", + zwj: "\u200D", + lrm: "\u200E", + rlm: "\u200F", + ndash: "\u2013", + mdash: "\u2014", + lsquo: "\u2018", + rsquo: "\u2019", + sbquo: "\u201A", + ldquo: "\u201C", + rdquo: "\u201D", + bdquo: "\u201E", + dagger: "\u2020", + Dagger: "\u2021", + bull: "\u2022", + hellip: "\u2026", + permil: "\u2030", + prime: "\u2032", + Prime: "\u2033", + lsaquo: "\u2039", + rsaquo: "\u203A", + oline: "\u203E", + frasl: "\u2044", + euro: "\u20AC", + image: "\u2111", + weierp: "\u2118", + real: "\u211C", + trade: "\u2122", + alefsym: "\u2135", + larr: "\u2190", + uarr: "\u2191", + rarr: "\u2192", + darr: "\u2193", + harr: "\u2194", + crarr: "\u21B5", + lArr: "\u21D0", + uArr: "\u21D1", + rArr: "\u21D2", + dArr: "\u21D3", + hArr: "\u21D4", + forall: "\u2200", + part: "\u2202", + exist: "\u2203", + empty: "\u2205", + nabla: "\u2207", + isin: "\u2208", + notin: "\u2209", + ni: "\u220B", + prod: "\u220F", + sum: "\u2211", + minus: "\u2212", + lowast: "\u2217", + radic: "\u221A", + prop: "\u221D", + infin: "\u221E", + ang: "\u2220", + and: "\u2227", + or: "\u2228", + cap: "\u2229", + cup: "\u222A", + int: "\u222B", + there4: "\u2234", + sim: "\u223C", + cong: "\u2245", + asymp: "\u2248", + ne: "\u2260", + equiv: "\u2261", + le: "\u2264", + ge: "\u2265", + sub: "\u2282", + sup: "\u2283", + nsub: "\u2284", + sube: "\u2286", + supe: "\u2287", + oplus: "\u2295", + otimes: "\u2297", + perp: "\u22A5", + sdot: "\u22C5", + lceil: "\u2308", + rceil: "\u2309", + lfloor: "\u230A", + rfloor: "\u230B", + lang: "\u2329", + rang: "\u232A", + loz: "\u25CA", + spades: "\u2660", + clubs: "\u2663", + hearts: "\u2665", + diams: "\u2666" +}; + +const JsxErrors = ParseErrorEnum`jsx`(_ => ({ + AttributeIsEmpty: _("JSX attributes must only be assigned a non-empty expression."), + MissingClosingTagElement: _(({ + openingTagName + }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`), + MissingClosingTagFragment: _("Expected corresponding JSX closing tag for <>."), + UnexpectedSequenceExpression: _("Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?"), + UnexpectedToken: _(({ + unexpected, + HTMLEntity + }) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`), + UnsupportedJsxValue: _("JSX value should be either an expression or a quoted JSX text."), + UnterminatedJsxContent: _("Unterminated JSX contents."), + UnwrappedAdjacentJSXElements: _("Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?") +})); + +function isFragment(object) { + return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false; +} + +function getQualifiedJSXName(object) { + if (object.type === "JSXIdentifier") { + return object.name; + } + + if (object.type === "JSXNamespacedName") { + return object.namespace.name + ":" + object.name.name; + } + + if (object.type === "JSXMemberExpression") { + return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); + } + + throw new Error("Node had unexpected type: " + object.type); +} + +var jsx = (superClass => class extends superClass { + jsxReadToken() { + let out = ""; + let chunkStart = this.state.pos; + + for (;;) { + if (this.state.pos >= this.length) { + throw this.raise(JsxErrors.UnterminatedJsxContent, { + at: this.state.startLoc + }); + } + + const ch = this.input.charCodeAt(this.state.pos); + + switch (ch) { + case 60: + case 123: + if (this.state.pos === this.state.start) { + if (ch === 60 && this.state.canStartJSXElement) { + ++this.state.pos; + return this.finishToken(138); + } + + return super.getTokenFromCode(ch); + } + + out += this.input.slice(chunkStart, this.state.pos); + return this.finishToken(137, out); + + case 38: + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadEntity(); + chunkStart = this.state.pos; + break; + + case 62: + case 125: + + default: + if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadNewLine(true); + chunkStart = this.state.pos; + } else { + ++this.state.pos; + } + + } + } + } + + jsxReadNewLine(normalizeCRLF) { + const ch = this.input.charCodeAt(this.state.pos); + let out; + ++this.state.pos; + + if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { + ++this.state.pos; + out = normalizeCRLF ? "\n" : "\r\n"; + } else { + out = String.fromCharCode(ch); + } + + ++this.state.curLine; + this.state.lineStart = this.state.pos; + return out; + } + + jsxReadString(quote) { + let out = ""; + let chunkStart = ++this.state.pos; + + for (;;) { + if (this.state.pos >= this.length) { + throw this.raise(Errors.UnterminatedString, { + at: this.state.startLoc + }); + } + + const ch = this.input.charCodeAt(this.state.pos); + if (ch === quote) break; + + if (ch === 38) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadEntity(); + chunkStart = this.state.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadNewLine(false); + chunkStart = this.state.pos; + } else { + ++this.state.pos; + } + } + + out += this.input.slice(chunkStart, this.state.pos++); + return this.finishToken(129, out); + } + + jsxReadEntity() { + const startPos = ++this.state.pos; + + if (this.codePointAtPos(this.state.pos) === 35) { + ++this.state.pos; + let radix = 10; + + if (this.codePointAtPos(this.state.pos) === 120) { + radix = 16; + ++this.state.pos; + } + + const codePoint = this.readInt(radix, undefined, false, "bail"); + + if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) { + ++this.state.pos; + return String.fromCodePoint(codePoint); + } + } else { + let count = 0; + let semi = false; + + while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) == 59)) { + ++this.state.pos; + } + + if (semi) { + const desc = this.input.slice(startPos, this.state.pos); + const entity = entities[desc]; + ++this.state.pos; + + if (entity) { + return entity; + } + } + } + + this.state.pos = startPos; + return "&"; + } + + jsxReadWord() { + let ch; + const start = this.state.pos; + + do { + ch = this.input.charCodeAt(++this.state.pos); + } while (isIdentifierChar(ch) || ch === 45); + + return this.finishToken(136, this.input.slice(start, this.state.pos)); + } + + jsxParseIdentifier() { + const node = this.startNode(); + + if (this.match(136)) { + node.name = this.state.value; + } else if (tokenIsKeyword(this.state.type)) { + node.name = tokenLabelName(this.state.type); + } else { + this.unexpected(); + } + + this.next(); + return this.finishNode(node, "JSXIdentifier"); + } + + jsxParseNamespacedName() { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const name = this.jsxParseIdentifier(); + if (!this.eat(14)) return name; + const node = this.startNodeAt(startPos, startLoc); + node.namespace = name; + node.name = this.jsxParseIdentifier(); + return this.finishNode(node, "JSXNamespacedName"); + } + + jsxParseElementName() { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + let node = this.jsxParseNamespacedName(); + + if (node.type === "JSXNamespacedName") { + return node; + } + + while (this.eat(16)) { + const newNode = this.startNodeAt(startPos, startLoc); + newNode.object = node; + newNode.property = this.jsxParseIdentifier(); + node = this.finishNode(newNode, "JSXMemberExpression"); + } + + return node; + } + + jsxParseAttributeValue() { + let node; + + switch (this.state.type) { + case 5: + node = this.startNode(); + this.setContext(types.brace); + this.next(); + node = this.jsxParseExpressionContainer(node, types.j_oTag); + + if (node.expression.type === "JSXEmptyExpression") { + this.raise(JsxErrors.AttributeIsEmpty, { + at: node + }); + } + + return node; + + case 138: + case 129: + return this.parseExprAtom(); + + default: + throw this.raise(JsxErrors.UnsupportedJsxValue, { + at: this.state.startLoc + }); + } + } + + jsxParseEmptyExpression() { + const node = this.startNodeAt(this.state.lastTokEndLoc.index, this.state.lastTokEndLoc); + return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc); + } + + jsxParseSpreadChild(node) { + this.next(); + node.expression = this.parseExpression(); + this.setContext(types.j_oTag); + this.expect(8); + return this.finishNode(node, "JSXSpreadChild"); + } + + jsxParseExpressionContainer(node, previousContext) { + if (this.match(8)) { + node.expression = this.jsxParseEmptyExpression(); + } else { + const expression = this.parseExpression(); + node.expression = expression; + } + + this.setContext(previousContext); + this.expect(8); + return this.finishNode(node, "JSXExpressionContainer"); + } + + jsxParseAttribute() { + const node = this.startNode(); + + if (this.match(5)) { + this.setContext(types.brace); + this.next(); + this.expect(21); + node.argument = this.parseMaybeAssignAllowIn(); + this.setContext(types.j_oTag); + this.expect(8); + return this.finishNode(node, "JSXSpreadAttribute"); + } + + node.name = this.jsxParseNamespacedName(); + node.value = this.eat(29) ? this.jsxParseAttributeValue() : null; + return this.finishNode(node, "JSXAttribute"); + } + + jsxParseOpeningElementAt(startPos, startLoc) { + const node = this.startNodeAt(startPos, startLoc); + + if (this.match(139)) { + this.expect(139); + return this.finishNode(node, "JSXOpeningFragment"); + } + + node.name = this.jsxParseElementName(); + return this.jsxParseOpeningElementAfterName(node); + } + + jsxParseOpeningElementAfterName(node) { + const attributes = []; + + while (!this.match(56) && !this.match(139)) { + attributes.push(this.jsxParseAttribute()); + } + + node.attributes = attributes; + node.selfClosing = this.eat(56); + this.expect(139); + return this.finishNode(node, "JSXOpeningElement"); + } + + jsxParseClosingElementAt(startPos, startLoc) { + const node = this.startNodeAt(startPos, startLoc); + + if (this.match(139)) { + this.expect(139); + return this.finishNode(node, "JSXClosingFragment"); + } + + node.name = this.jsxParseElementName(); + this.expect(139); + return this.finishNode(node, "JSXClosingElement"); + } + + jsxParseElementAt(startPos, startLoc) { + const node = this.startNodeAt(startPos, startLoc); + const children = []; + const openingElement = this.jsxParseOpeningElementAt(startPos, startLoc); + let closingElement = null; + + if (!openingElement.selfClosing) { + contents: for (;;) { + switch (this.state.type) { + case 138: + startPos = this.state.start; + startLoc = this.state.startLoc; + this.next(); + + if (this.eat(56)) { + closingElement = this.jsxParseClosingElementAt(startPos, startLoc); + break contents; + } + + children.push(this.jsxParseElementAt(startPos, startLoc)); + break; + + case 137: + children.push(this.parseExprAtom()); + break; + + case 5: + { + const node = this.startNode(); + this.setContext(types.brace); + this.next(); + + if (this.match(21)) { + children.push(this.jsxParseSpreadChild(node)); + } else { + children.push(this.jsxParseExpressionContainer(node, types.j_expr)); + } + + break; + } + + default: + throw this.unexpected(); + } + } + + if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) { + this.raise(JsxErrors.MissingClosingTagFragment, { + at: closingElement + }); + } else if (!isFragment(openingElement) && isFragment(closingElement)) { + this.raise(JsxErrors.MissingClosingTagElement, { + at: closingElement, + openingTagName: getQualifiedJSXName(openingElement.name) + }); + } else if (!isFragment(openingElement) && !isFragment(closingElement)) { + if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { + this.raise(JsxErrors.MissingClosingTagElement, { + at: closingElement, + openingTagName: getQualifiedJSXName(openingElement.name) + }); + } + } + } + + if (isFragment(openingElement)) { + node.openingFragment = openingElement; + node.closingFragment = closingElement; + } else { + node.openingElement = openingElement; + node.closingElement = closingElement; + } + + node.children = children; + + if (this.match(47)) { + throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, { + at: this.state.startLoc + }); + } + + return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); + } + + jsxParseElement() { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + this.next(); + return this.jsxParseElementAt(startPos, startLoc); + } + + setContext(newContext) { + const { + context + } = this.state; + context[context.length - 1] = newContext; + } + + parseExprAtom(refExpressionErrors) { + if (this.match(137)) { + return this.parseLiteral(this.state.value, "JSXText"); + } else if (this.match(138)) { + return this.jsxParseElement(); + } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) { + this.replaceToken(138); + return this.jsxParseElement(); + } else { + return super.parseExprAtom(refExpressionErrors); + } + } + + skipSpace() { + const curContext = this.curContext(); + if (!curContext.preserveSpace) super.skipSpace(); + } + + getTokenFromCode(code) { + const context = this.curContext(); + + if (context === types.j_expr) { + return this.jsxReadToken(); + } + + if (context === types.j_oTag || context === types.j_cTag) { + if (isIdentifierStart(code)) { + return this.jsxReadWord(); + } + + if (code === 62) { + ++this.state.pos; + return this.finishToken(139); + } + + if ((code === 34 || code === 39) && context === types.j_oTag) { + return this.jsxReadString(code); + } + } + + if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) { + ++this.state.pos; + return this.finishToken(138); + } + + return super.getTokenFromCode(code); + } + + updateContext(prevType) { + const { + context, + type + } = this.state; + + if (type === 56 && prevType === 138) { + context.splice(-2, 2, types.j_cTag); + this.state.canStartJSXElement = false; + } else if (type === 138) { + context.push(types.j_oTag); + } else if (type === 139) { + const out = context[context.length - 1]; + + if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) { + context.pop(); + this.state.canStartJSXElement = context[context.length - 1] === types.j_expr; + } else { + this.setContext(types.j_expr); + this.state.canStartJSXElement = true; + } + } else { + this.state.canStartJSXElement = tokenComesBeforeExpression(type); + } + } + +}); + +class TypeScriptScope extends Scope { + constructor(...args) { + super(...args); + this.types = new Set(); + this.enums = new Set(); + this.constEnums = new Set(); + this.classes = new Set(); + this.exportOnlyBindings = new Set(); + } + +} + +class TypeScriptScopeHandler extends ScopeHandler { + createScope(flags) { + return new TypeScriptScope(flags); + } + + declareName(name, bindingType, loc) { + const scope = this.currentScope(); + + if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) { + this.maybeExportDefined(scope, name); + scope.exportOnlyBindings.add(name); + return; + } + + super.declareName(...arguments); + + if (bindingType & BIND_KIND_TYPE) { + if (!(bindingType & BIND_KIND_VALUE)) { + this.checkRedeclarationInScope(scope, name, bindingType, loc); + this.maybeExportDefined(scope, name); + } + + scope.types.add(name); + } + + if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.add(name); + if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.add(name); + if (bindingType & BIND_FLAGS_CLASS) scope.classes.add(name); + } + + isRedeclaredInScope(scope, name, bindingType) { + if (scope.enums.has(name)) { + if (bindingType & BIND_FLAGS_TS_ENUM) { + const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM); + const wasConst = scope.constEnums.has(name); + return isConst !== wasConst; + } + + return true; + } + + if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) { + if (scope.lexical.has(name)) { + return !!(bindingType & BIND_KIND_VALUE); + } else { + return false; + } + } + + if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) { + return true; + } + + return super.isRedeclaredInScope(...arguments); + } + + checkLocalExport(id) { + const topLevelScope = this.scopeStack[0]; + const { + name + } = id; + + if (!topLevelScope.types.has(name) && !topLevelScope.exportOnlyBindings.has(name)) { + super.checkLocalExport(id); + } + } + +} + +const getOwn$1 = (object, key) => Object.hasOwnProperty.call(object, key) && object[key]; + +function nonNull(x) { + if (x == null) { + throw new Error(`Unexpected ${x} value.`); + } + + return x; +} + +function assert(x) { + if (!x) { + throw new Error("Assert fail"); + } +} + +const TSErrors = ParseErrorEnum`typescript`(_ => ({ + AbstractMethodHasImplementation: _(({ + methodName + }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`), + AbstractPropertyHasInitializer: _(({ + propertyName + }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`), + AccesorCannotDeclareThisParameter: _("'get' and 'set' accessors cannot declare 'this' parameters."), + AccesorCannotHaveTypeParameters: _("An accessor cannot have type parameters."), + CannotFindName: _(({ + name + }) => `Cannot find name '${name}'.`), + ClassMethodHasDeclare: _("Class methods cannot have the 'declare' modifier."), + ClassMethodHasReadonly: _("Class methods cannot have the 'readonly' modifier."), + ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference: _("A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."), + ConstructorHasTypeParameters: _("Type parameters cannot appear on a constructor declaration."), + DeclareAccessor: _(({ + kind + }) => `'declare' is not allowed in ${kind}ters.`), + DeclareClassFieldHasInitializer: _("Initializers are not allowed in ambient contexts."), + DeclareFunctionHasImplementation: _("An implementation cannot be declared in ambient contexts."), + DuplicateAccessibilityModifier: _(({ + modifier + }) => `Accessibility modifier already seen.`), + DuplicateModifier: _(({ + modifier + }) => `Duplicate modifier: '${modifier}'.`), + EmptyHeritageClauseType: _(({ + token + }) => `'${token}' list cannot be empty.`), + EmptyTypeArguments: _("Type argument list cannot be empty."), + EmptyTypeParameters: _("Type parameter list cannot be empty."), + ExpectedAmbientAfterExportDeclare: _("'export declare' must be followed by an ambient declaration."), + ImportAliasHasImportType: _("An import alias can not use 'import type'."), + IncompatibleModifiers: _(({ + modifiers + }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`), + IndexSignatureHasAbstract: _("Index signatures cannot have the 'abstract' modifier."), + IndexSignatureHasAccessibility: _(({ + modifier + }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`), + IndexSignatureHasDeclare: _("Index signatures cannot have the 'declare' modifier."), + IndexSignatureHasOverride: _("'override' modifier cannot appear on an index signature."), + IndexSignatureHasStatic: _("Index signatures cannot have the 'static' modifier."), + InitializerNotAllowedInAmbientContext: _("Initializers are not allowed in ambient contexts."), + InvalidModifierOnTypeMember: _(({ + modifier + }) => `'${modifier}' modifier cannot appear on a type member.`), + InvalidModifiersOrder: _(({ + orderedModifiers + }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`), + InvalidTupleMemberLabel: _("Tuple members must be labeled with a simple identifier."), + MissingInterfaceName: _("'interface' declarations must be followed by an identifier."), + MixedLabeledAndUnlabeledElements: _("Tuple members must all have names or all not have names."), + NonAbstractClassHasAbstractMethod: _("Abstract methods can only appear within an abstract class."), + NonClassMethodPropertyHasAbstractModifer: _("'abstract' modifier can only appear on a class, method, or property declaration."), + OptionalTypeBeforeRequired: _("A required element cannot follow an optional element."), + OverrideNotInSubClass: _("This member cannot have an 'override' modifier because its containing class does not extend another class."), + PatternIsOptional: _("A binding pattern parameter cannot be optional in an implementation signature."), + PrivateElementHasAbstract: _("Private elements cannot have the 'abstract' modifier."), + PrivateElementHasAccessibility: _(({ + modifier + }) => `Private elements cannot have an accessibility modifier ('${modifier}').`), + ReadonlyForMethodSignature: _("'readonly' modifier can only appear on a property declaration or index signature."), + ReservedArrowTypeParam: _("This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`."), + ReservedTypeAssertion: _("This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."), + SetAccesorCannotHaveOptionalParameter: _("A 'set' accessor cannot have an optional parameter."), + SetAccesorCannotHaveRestParameter: _("A 'set' accessor cannot have rest parameter."), + SetAccesorCannotHaveReturnType: _("A 'set' accessor cannot have a return type annotation."), + SingleTypeParameterWithoutTrailingComma: _(({ + typeParameterName + }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`), + StaticBlockCannotHaveModifier: _("Static class blocks cannot have any modifier."), + TypeAnnotationAfterAssign: _("Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`."), + TypeImportCannotSpecifyDefaultAndNamed: _("A type-only import can specify a default import or named bindings, but not both."), + TypeModifierIsUsedInTypeExports: _("The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."), + TypeModifierIsUsedInTypeImports: _("The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."), + UnexpectedParameterModifier: _("A parameter property is only allowed in a constructor implementation."), + UnexpectedReadonly: _("'readonly' type modifier is only permitted on array and tuple literal types."), + UnexpectedTypeAnnotation: _("Did not expect a type annotation here."), + UnexpectedTypeCastInParameter: _("Unexpected type cast in parameter position."), + UnsupportedImportTypeArgument: _("Argument in a type import must be a string literal."), + UnsupportedParameterPropertyKind: _("A parameter property may not be declared using a binding pattern."), + UnsupportedSignatureParameterKind: _(({ + type + }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`) +})); + +function keywordTypeFromName(value) { + switch (value) { + case "any": + return "TSAnyKeyword"; + + case "boolean": + return "TSBooleanKeyword"; + + case "bigint": + return "TSBigIntKeyword"; + + case "never": + return "TSNeverKeyword"; + + case "number": + return "TSNumberKeyword"; + + case "object": + return "TSObjectKeyword"; + + case "string": + return "TSStringKeyword"; + + case "symbol": + return "TSSymbolKeyword"; + + case "undefined": + return "TSUndefinedKeyword"; + + case "unknown": + return "TSUnknownKeyword"; + + default: + return undefined; + } +} + +function tsIsAccessModifier(modifier) { + return modifier === "private" || modifier === "public" || modifier === "protected"; +} + +var typescript = (superClass => class extends superClass { + getScopeHandler() { + return TypeScriptScopeHandler; + } + + tsIsIdentifier() { + return tokenIsIdentifier(this.state.type); + } + + tsTokenCanFollowModifier() { + return (this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(134) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak(); + } + + tsNextTokenCanFollowModifier() { + this.next(); + return this.tsTokenCanFollowModifier(); + } + + tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) { + if (!tokenIsIdentifier(this.state.type)) { + return undefined; + } + + const modifier = this.state.value; + + if (allowedModifiers.indexOf(modifier) !== -1) { + if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) { + return undefined; + } + + if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) { + return modifier; + } + } + + return undefined; + } + + tsParseModifiers({ + modified, + allowedModifiers, + disallowedModifiers, + stopOnStartOfClassStaticBlock + }) { + const enforceOrder = (loc, modifier, before, after) => { + if (modifier === before && modified[after]) { + this.raise(TSErrors.InvalidModifiersOrder, { + at: loc, + orderedModifiers: [before, after] + }); + } + }; + + const incompatible = (loc, modifier, mod1, mod2) => { + if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) { + this.raise(TSErrors.IncompatibleModifiers, { + at: loc, + modifiers: [mod1, mod2] + }); + } + }; + + for (;;) { + const { + startLoc + } = this.state; + const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock); + if (!modifier) break; + + if (tsIsAccessModifier(modifier)) { + if (modified.accessibility) { + this.raise(TSErrors.DuplicateAccessibilityModifier, { + at: startLoc, + modifier + }); + } else { + enforceOrder(startLoc, modifier, modifier, "override"); + enforceOrder(startLoc, modifier, modifier, "static"); + enforceOrder(startLoc, modifier, modifier, "readonly"); + modified.accessibility = modifier; + } + } else { + if (Object.hasOwnProperty.call(modified, modifier)) { + this.raise(TSErrors.DuplicateModifier, { + at: startLoc, + modifier + }); + } else { + enforceOrder(startLoc, modifier, "static", "readonly"); + enforceOrder(startLoc, modifier, "static", "override"); + enforceOrder(startLoc, modifier, "override", "readonly"); + enforceOrder(startLoc, modifier, "abstract", "override"); + incompatible(startLoc, modifier, "declare", "override"); + incompatible(startLoc, modifier, "static", "abstract"); + } + + modified[modifier] = true; + } + + if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) { + this.raise(TSErrors.InvalidModifierOnTypeMember, { + at: startLoc, + modifier + }); + } + } + } + + tsIsListTerminator(kind) { + switch (kind) { + case "EnumMembers": + case "TypeMembers": + return this.match(8); + + case "HeritageClauseElement": + return this.match(5); + + case "TupleElementTypes": + return this.match(3); + + case "TypeParametersOrArguments": + return this.match(48); + } + + throw new Error("Unreachable"); + } + + tsParseList(kind, parseElement) { + const result = []; + + while (!this.tsIsListTerminator(kind)) { + result.push(parseElement()); + } + + return result; + } + + tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) { + return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true, refTrailingCommaPos)); + } + + tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) { + const result = []; + let trailingCommaPos = -1; + + for (;;) { + if (this.tsIsListTerminator(kind)) { + break; + } + + trailingCommaPos = -1; + const element = parseElement(); + + if (element == null) { + return undefined; + } + + result.push(element); + + if (this.eat(12)) { + trailingCommaPos = this.state.lastTokStart; + continue; + } + + if (this.tsIsListTerminator(kind)) { + break; + } + + if (expectSuccess) { + this.expect(12); + } + + return undefined; + } + + if (refTrailingCommaPos) { + refTrailingCommaPos.value = trailingCommaPos; + } + + return result; + } + + tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) { + if (!skipFirstToken) { + if (bracket) { + this.expect(0); + } else { + this.expect(47); + } + } + + const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos); + + if (bracket) { + this.expect(3); + } else { + this.expect(48); + } + + return result; + } + + tsParseImportType() { + const node = this.startNode(); + this.expect(83); + this.expect(10); + + if (!this.match(129)) { + this.raise(TSErrors.UnsupportedImportTypeArgument, { + at: this.state.startLoc + }); + } + + node.argument = this.parseExprAtom(); + this.expect(11); + + if (this.eat(16)) { + node.qualifier = this.tsParseEntityName(); + } + + if (this.match(47)) { + node.typeParameters = this.tsParseTypeArguments(); + } + + return this.finishNode(node, "TSImportType"); + } + + tsParseEntityName(allowReservedWords = true) { + let entity = this.parseIdentifier(allowReservedWords); + + while (this.eat(16)) { + const node = this.startNodeAtNode(entity); + node.left = entity; + node.right = this.parseIdentifier(allowReservedWords); + entity = this.finishNode(node, "TSQualifiedName"); + } + + return entity; + } + + tsParseTypeReference() { + const node = this.startNode(); + node.typeName = this.tsParseEntityName(); + + if (!this.hasPrecedingLineBreak() && this.match(47)) { + node.typeParameters = this.tsParseTypeArguments(); + } + + return this.finishNode(node, "TSTypeReference"); + } + + tsParseThisTypePredicate(lhs) { + this.next(); + const node = this.startNodeAtNode(lhs); + node.parameterName = lhs; + node.typeAnnotation = this.tsParseTypeAnnotation(false); + node.asserts = false; + return this.finishNode(node, "TSTypePredicate"); + } + + tsParseThisTypeNode() { + const node = this.startNode(); + this.next(); + return this.finishNode(node, "TSThisType"); + } + + tsParseTypeQuery() { + const node = this.startNode(); + this.expect(87); + + if (this.match(83)) { + node.exprName = this.tsParseImportType(); + } else { + node.exprName = this.tsParseEntityName(); + } + + return this.finishNode(node, "TSTypeQuery"); + } + + tsParseTypeParameter() { + const node = this.startNode(); + node.name = this.tsParseTypeParameterName(); + node.constraint = this.tsEatThenParseType(81); + node.default = this.tsEatThenParseType(29); + return this.finishNode(node, "TSTypeParameter"); + } + + tsTryParseTypeParameters() { + if (this.match(47)) { + return this.tsParseTypeParameters(); + } + } + + tsParseTypeParameters() { + const node = this.startNode(); + + if (this.match(47) || this.match(138)) { + this.next(); + } else { + this.unexpected(); + } + + const refTrailingCommaPos = { + value: -1 + }; + node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this), false, true, refTrailingCommaPos); + + if (node.params.length === 0) { + this.raise(TSErrors.EmptyTypeParameters, { + at: node + }); + } + + if (refTrailingCommaPos.value !== -1) { + this.addExtra(node, "trailingComma", refTrailingCommaPos.value); + } + + return this.finishNode(node, "TSTypeParameterDeclaration"); + } + + tsTryNextParseConstantContext() { + if (this.lookahead().type !== 75) return null; + this.next(); + const typeReference = this.tsParseTypeReference(); + + if (typeReference.typeParameters) { + this.raise(TSErrors.CannotFindName, { + at: typeReference.typeName, + name: "const" + }); + } + + return typeReference; + } + + tsFillSignature(returnToken, signature) { + const returnTokenRequired = returnToken === 19; + const paramsKey = "parameters"; + const returnTypeKey = "typeAnnotation"; + signature.typeParameters = this.tsTryParseTypeParameters(); + this.expect(10); + signature[paramsKey] = this.tsParseBindingListForSignature(); + + if (returnTokenRequired) { + signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); + } else if (this.match(returnToken)) { + signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); + } + } + + tsParseBindingListForSignature() { + return this.parseBindingList(11, 41).map(pattern => { + if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") { + this.raise(TSErrors.UnsupportedSignatureParameterKind, { + at: pattern, + type: pattern.type + }); + } + + return pattern; + }); + } + + tsParseTypeMemberSemicolon() { + if (!this.eat(12) && !this.isLineTerminator()) { + this.expect(13); + } + } + + tsParseSignatureMember(kind, node) { + this.tsFillSignature(14, node); + this.tsParseTypeMemberSemicolon(); + return this.finishNode(node, kind); + } + + tsIsUnambiguouslyIndexSignature() { + this.next(); + + if (tokenIsIdentifier(this.state.type)) { + this.next(); + return this.match(14); + } + + return false; + } + + tsTryParseIndexSignature(node) { + if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) { + return undefined; + } + + this.expect(0); + const id = this.parseIdentifier(); + id.typeAnnotation = this.tsParseTypeAnnotation(); + this.resetEndLocation(id); + this.expect(3); + node.parameters = [id]; + const type = this.tsTryParseTypeAnnotation(); + if (type) node.typeAnnotation = type; + this.tsParseTypeMemberSemicolon(); + return this.finishNode(node, "TSIndexSignature"); + } + + tsParsePropertyOrMethodSignature(node, readonly) { + if (this.eat(17)) node.optional = true; + const nodeAny = node; + + if (this.match(10) || this.match(47)) { + if (readonly) { + this.raise(TSErrors.ReadonlyForMethodSignature, { + at: node + }); + } + + const method = nodeAny; + + if (method.kind && this.match(47)) { + this.raise(TSErrors.AccesorCannotHaveTypeParameters, { + at: this.state.curPosition() + }); + } + + this.tsFillSignature(14, method); + this.tsParseTypeMemberSemicolon(); + const paramsKey = "parameters"; + const returnTypeKey = "typeAnnotation"; + + if (method.kind === "get") { + if (method[paramsKey].length > 0) { + this.raise(Errors.BadGetterArity, { + at: this.state.curPosition() + }); + + if (this.isThisParam(method[paramsKey][0])) { + this.raise(TSErrors.AccesorCannotDeclareThisParameter, { + at: this.state.curPosition() + }); + } + } + } else if (method.kind === "set") { + if (method[paramsKey].length !== 1) { + this.raise(Errors.BadSetterArity, { + at: this.state.curPosition() + }); + } else { + const firstParameter = method[paramsKey][0]; + + if (this.isThisParam(firstParameter)) { + this.raise(TSErrors.AccesorCannotDeclareThisParameter, { + at: this.state.curPosition() + }); + } + + if (firstParameter.type === "Identifier" && firstParameter.optional) { + this.raise(TSErrors.SetAccesorCannotHaveOptionalParameter, { + at: this.state.curPosition() + }); + } + + if (firstParameter.type === "RestElement") { + this.raise(TSErrors.SetAccesorCannotHaveRestParameter, { + at: this.state.curPosition() + }); + } + } + + if (method[returnTypeKey]) { + this.raise(TSErrors.SetAccesorCannotHaveReturnType, { + at: method[returnTypeKey] + }); + } + } else { + method.kind = "method"; + } + + return this.finishNode(method, "TSMethodSignature"); + } else { + const property = nodeAny; + if (readonly) property.readonly = true; + const type = this.tsTryParseTypeAnnotation(); + if (type) property.typeAnnotation = type; + this.tsParseTypeMemberSemicolon(); + return this.finishNode(property, "TSPropertySignature"); + } + } + + tsParseTypeMember() { + const node = this.startNode(); + + if (this.match(10) || this.match(47)) { + return this.tsParseSignatureMember("TSCallSignatureDeclaration", node); + } + + if (this.match(77)) { + const id = this.startNode(); + this.next(); + + if (this.match(10) || this.match(47)) { + return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node); + } else { + node.key = this.createIdentifier(id, "new"); + return this.tsParsePropertyOrMethodSignature(node, false); + } + } + + this.tsParseModifiers({ + modified: node, + allowedModifiers: ["readonly"], + disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"] + }); + const idx = this.tsTryParseIndexSignature(node); + + if (idx) { + return idx; + } + + this.parsePropertyName(node); + + if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) { + node.kind = node.key.name; + this.parsePropertyName(node); + } + + return this.tsParsePropertyOrMethodSignature(node, !!node.readonly); + } + + tsParseTypeLiteral() { + const node = this.startNode(); + node.members = this.tsParseObjectTypeMembers(); + return this.finishNode(node, "TSTypeLiteral"); + } + + tsParseObjectTypeMembers() { + this.expect(5); + const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); + this.expect(8); + return members; + } + + tsIsStartOfMappedType() { + this.next(); + + if (this.eat(53)) { + return this.isContextual(118); + } + + if (this.isContextual(118)) { + this.next(); + } + + if (!this.match(0)) { + return false; + } + + this.next(); + + if (!this.tsIsIdentifier()) { + return false; + } + + this.next(); + return this.match(58); + } + + tsParseMappedTypeParameter() { + const node = this.startNode(); + node.name = this.tsParseTypeParameterName(); + node.constraint = this.tsExpectThenParseType(58); + return this.finishNode(node, "TSTypeParameter"); + } + + tsParseMappedType() { + const node = this.startNode(); + this.expect(5); + + if (this.match(53)) { + node.readonly = this.state.value; + this.next(); + this.expectContextual(118); + } else if (this.eatContextual(118)) { + node.readonly = true; + } + + this.expect(0); + node.typeParameter = this.tsParseMappedTypeParameter(); + node.nameType = this.eatContextual(93) ? this.tsParseType() : null; + this.expect(3); + + if (this.match(53)) { + node.optional = this.state.value; + this.next(); + this.expect(17); + } else if (this.eat(17)) { + node.optional = true; + } + + node.typeAnnotation = this.tsTryParseType(); + this.semicolon(); + this.expect(8); + return this.finishNode(node, "TSMappedType"); + } + + tsParseTupleType() { + const node = this.startNode(); + node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false); + let seenOptionalElement = false; + let labeledElements = null; + node.elementTypes.forEach(elementNode => { + var _labeledElements; + + let { + type + } = elementNode; + + if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) { + this.raise(TSErrors.OptionalTypeBeforeRequired, { + at: elementNode + }); + } + + seenOptionalElement = seenOptionalElement || type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType"; + + if (type === "TSRestType") { + elementNode = elementNode.typeAnnotation; + type = elementNode.type; + } + + const isLabeled = type === "TSNamedTupleMember"; + labeledElements = (_labeledElements = labeledElements) != null ? _labeledElements : isLabeled; + + if (labeledElements !== isLabeled) { + this.raise(TSErrors.MixedLabeledAndUnlabeledElements, { + at: elementNode + }); + } + }); + return this.finishNode(node, "TSTupleType"); + } + + tsParseTupleElementType() { + const { + start: startPos, + startLoc + } = this.state; + const rest = this.eat(21); + let type = this.tsParseType(); + const optional = this.eat(17); + const labeled = this.eat(14); + + if (labeled) { + const labeledNode = this.startNodeAtNode(type); + labeledNode.optional = optional; + + if (type.type === "TSTypeReference" && !type.typeParameters && type.typeName.type === "Identifier") { + labeledNode.label = type.typeName; + } else { + this.raise(TSErrors.InvalidTupleMemberLabel, { + at: type + }); + labeledNode.label = type; + } + + labeledNode.elementType = this.tsParseType(); + type = this.finishNode(labeledNode, "TSNamedTupleMember"); + } else if (optional) { + const optionalTypeNode = this.startNodeAtNode(type); + optionalTypeNode.typeAnnotation = type; + type = this.finishNode(optionalTypeNode, "TSOptionalType"); + } + + if (rest) { + const restNode = this.startNodeAt(startPos, startLoc); + restNode.typeAnnotation = type; + type = this.finishNode(restNode, "TSRestType"); + } + + return type; + } + + tsParseParenthesizedType() { + const node = this.startNode(); + this.expect(10); + node.typeAnnotation = this.tsParseType(); + this.expect(11); + return this.finishNode(node, "TSParenthesizedType"); + } + + tsParseFunctionOrConstructorType(type, abstract) { + const node = this.startNode(); + + if (type === "TSConstructorType") { + node.abstract = !!abstract; + if (abstract) this.next(); + this.next(); + } + + this.tsFillSignature(19, node); + return this.finishNode(node, type); + } + + tsParseLiteralTypeNode() { + const node = this.startNode(); + + node.literal = (() => { + switch (this.state.type) { + case 130: + case 131: + case 129: + case 85: + case 86: + return this.parseExprAtom(); + + default: + throw this.unexpected(); + } + })(); + + return this.finishNode(node, "TSLiteralType"); + } + + tsParseTemplateLiteralType() { + const node = this.startNode(); + node.literal = this.parseTemplate(false); + return this.finishNode(node, "TSLiteralType"); + } + + parseTemplateSubstitution() { + if (this.state.inType) return this.tsParseType(); + return super.parseTemplateSubstitution(); + } + + tsParseThisTypeOrThisTypePredicate() { + const thisKeyword = this.tsParseThisTypeNode(); + + if (this.isContextual(113) && !this.hasPrecedingLineBreak()) { + return this.tsParseThisTypePredicate(thisKeyword); + } else { + return thisKeyword; + } + } + + tsParseNonArrayType() { + switch (this.state.type) { + case 129: + case 130: + case 131: + case 85: + case 86: + return this.tsParseLiteralTypeNode(); + + case 53: + if (this.state.value === "-") { + const node = this.startNode(); + const nextToken = this.lookahead(); + + if (nextToken.type !== 130 && nextToken.type !== 131) { + throw this.unexpected(); + } + + node.literal = this.parseMaybeUnary(); + return this.finishNode(node, "TSLiteralType"); + } + + break; + + case 78: + return this.tsParseThisTypeOrThisTypePredicate(); + + case 87: + return this.tsParseTypeQuery(); + + case 83: + return this.tsParseImportType(); + + case 5: + return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral(); + + case 0: + return this.tsParseTupleType(); + + case 10: + return this.tsParseParenthesizedType(); + + case 25: + case 24: + return this.tsParseTemplateLiteralType(); + + default: + { + const { + type + } = this.state; + + if (tokenIsIdentifier(type) || type === 88 || type === 84) { + const nodeType = type === 88 ? "TSVoidKeyword" : type === 84 ? "TSNullKeyword" : keywordTypeFromName(this.state.value); + + if (nodeType !== undefined && this.lookaheadCharCode() !== 46) { + const node = this.startNode(); + this.next(); + return this.finishNode(node, nodeType); + } + + return this.tsParseTypeReference(); + } + } + } + + throw this.unexpected(); + } + + tsParseArrayTypeOrHigher() { + let type = this.tsParseNonArrayType(); + + while (!this.hasPrecedingLineBreak() && this.eat(0)) { + if (this.match(3)) { + const node = this.startNodeAtNode(type); + node.elementType = type; + this.expect(3); + type = this.finishNode(node, "TSArrayType"); + } else { + const node = this.startNodeAtNode(type); + node.objectType = type; + node.indexType = this.tsParseType(); + this.expect(3); + type = this.finishNode(node, "TSIndexedAccessType"); + } + } + + return type; + } + + tsParseTypeOperator() { + const node = this.startNode(); + const operator = this.state.value; + this.next(); + node.operator = operator; + node.typeAnnotation = this.tsParseTypeOperatorOrHigher(); + + if (operator === "readonly") { + this.tsCheckTypeAnnotationForReadOnly(node); + } + + return this.finishNode(node, "TSTypeOperator"); + } + + tsCheckTypeAnnotationForReadOnly(node) { + switch (node.typeAnnotation.type) { + case "TSTupleType": + case "TSArrayType": + return; + + default: + this.raise(TSErrors.UnexpectedReadonly, { + at: node + }); + } + } + + tsParseInferType() { + const node = this.startNode(); + this.expectContextual(112); + const typeParameter = this.startNode(); + typeParameter.name = this.tsParseTypeParameterName(); + node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); + return this.finishNode(node, "TSInferType"); + } + + tsParseTypeOperatorOrHigher() { + const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc; + return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(112) ? this.tsParseInferType() : this.tsParseArrayTypeOrHigher(); + } + + tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) { + const node = this.startNode(); + const hasLeadingOperator = this.eat(operator); + const types = []; + + do { + types.push(parseConstituentType()); + } while (this.eat(operator)); + + if (types.length === 1 && !hasLeadingOperator) { + return types[0]; + } + + node.types = types; + return this.finishNode(node, kind); + } + + tsParseIntersectionTypeOrHigher() { + return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 45); + } + + tsParseUnionTypeOrHigher() { + return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 43); + } + + tsIsStartOfFunctionType() { + if (this.match(47)) { + return true; + } + + return this.match(10) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this)); + } + + tsSkipParameterStart() { + if (tokenIsIdentifier(this.state.type) || this.match(78)) { + this.next(); + return true; + } + + if (this.match(5)) { + const { + errors + } = this.state; + const previousErrorCount = errors.length; + + try { + this.parseObjectLike(8, true); + return errors.length === previousErrorCount; + } catch (_unused) { + return false; + } + } + + if (this.match(0)) { + this.next(); + const { + errors + } = this.state; + const previousErrorCount = errors.length; + + try { + this.parseBindingList(3, 93, true); + return errors.length === previousErrorCount; + } catch (_unused2) { + return false; + } + } + + return false; + } + + tsIsUnambiguouslyStartOfFunctionType() { + this.next(); + + if (this.match(11) || this.match(21)) { + return true; + } + + if (this.tsSkipParameterStart()) { + if (this.match(14) || this.match(12) || this.match(17) || this.match(29)) { + return true; + } + + if (this.match(11)) { + this.next(); + + if (this.match(19)) { + return true; + } + } + } + + return false; + } + + tsParseTypeOrTypePredicateAnnotation(returnToken) { + return this.tsInType(() => { + const t = this.startNode(); + this.expect(returnToken); + const node = this.startNode(); + const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); + + if (asserts && this.match(78)) { + let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); + + if (thisTypePredicate.type === "TSThisType") { + node.parameterName = thisTypePredicate; + node.asserts = true; + node.typeAnnotation = null; + thisTypePredicate = this.finishNode(node, "TSTypePredicate"); + } else { + this.resetStartLocationFromNode(thisTypePredicate, node); + thisTypePredicate.asserts = true; + } + + t.typeAnnotation = thisTypePredicate; + return this.finishNode(t, "TSTypeAnnotation"); + } + + const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); + + if (!typePredicateVariable) { + if (!asserts) { + return this.tsParseTypeAnnotation(false, t); + } + + node.parameterName = this.parseIdentifier(); + node.asserts = asserts; + node.typeAnnotation = null; + t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); + return this.finishNode(t, "TSTypeAnnotation"); + } + + const type = this.tsParseTypeAnnotation(false); + node.parameterName = typePredicateVariable; + node.typeAnnotation = type; + node.asserts = asserts; + t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); + return this.finishNode(t, "TSTypeAnnotation"); + }); + } + + tsTryParseTypeOrTypePredicateAnnotation() { + return this.match(14) ? this.tsParseTypeOrTypePredicateAnnotation(14) : undefined; + } + + tsTryParseTypeAnnotation() { + return this.match(14) ? this.tsParseTypeAnnotation() : undefined; + } + + tsTryParseType() { + return this.tsEatThenParseType(14); + } + + tsParseTypePredicatePrefix() { + const id = this.parseIdentifier(); + + if (this.isContextual(113) && !this.hasPrecedingLineBreak()) { + this.next(); + return id; + } + } + + tsParseTypePredicateAsserts() { + if (this.state.type !== 106) { + return false; + } + + const containsEsc = this.state.containsEsc; + this.next(); + + if (!tokenIsIdentifier(this.state.type) && !this.match(78)) { + return false; + } + + if (containsEsc) { + this.raise(Errors.InvalidEscapedReservedWord, { + at: this.state.lastTokStartLoc, + reservedWord: "asserts" + }); + } + + return true; + } + + tsParseTypeAnnotation(eatColon = true, t = this.startNode()) { + this.tsInType(() => { + if (eatColon) this.expect(14); + t.typeAnnotation = this.tsParseType(); + }); + return this.finishNode(t, "TSTypeAnnotation"); + } + + tsParseType() { + assert(this.state.inType); + const type = this.tsParseNonConditionalType(); + + if (this.hasPrecedingLineBreak() || !this.eat(81)) { + return type; + } + + const node = this.startNodeAtNode(type); + node.checkType = type; + node.extendsType = this.tsParseNonConditionalType(); + this.expect(17); + node.trueType = this.tsParseType(); + this.expect(14); + node.falseType = this.tsParseType(); + return this.finishNode(node, "TSConditionalType"); + } + + isAbstractConstructorSignature() { + return this.isContextual(120) && this.lookahead().type === 77; + } + + tsParseNonConditionalType() { + if (this.tsIsStartOfFunctionType()) { + return this.tsParseFunctionOrConstructorType("TSFunctionType"); + } + + if (this.match(77)) { + return this.tsParseFunctionOrConstructorType("TSConstructorType"); + } else if (this.isAbstractConstructorSignature()) { + return this.tsParseFunctionOrConstructorType("TSConstructorType", true); + } + + return this.tsParseUnionTypeOrHigher(); + } + + tsParseTypeAssertion() { + if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { + this.raise(TSErrors.ReservedTypeAssertion, { + at: this.state.startLoc + }); + } + + const node = this.startNode(); + + const _const = this.tsTryNextParseConstantContext(); + + node.typeAnnotation = _const || this.tsNextThenParseType(); + this.expect(48); + node.expression = this.parseMaybeUnary(); + return this.finishNode(node, "TSTypeAssertion"); + } + + tsParseHeritageClause(token) { + const originalStartLoc = this.state.startLoc; + const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", this.tsParseExpressionWithTypeArguments.bind(this)); + + if (!delimitedList.length) { + this.raise(TSErrors.EmptyHeritageClauseType, { + at: originalStartLoc, + token + }); + } + + return delimitedList; + } + + tsParseExpressionWithTypeArguments() { + const node = this.startNode(); + node.expression = this.tsParseEntityName(); + + if (this.match(47)) { + node.typeParameters = this.tsParseTypeArguments(); + } + + return this.finishNode(node, "TSExpressionWithTypeArguments"); + } + + tsParseInterfaceDeclaration(node, properties = {}) { + if (this.hasFollowingLineBreak()) return null; + this.expectContextual(125); + if (properties.declare) node.declare = true; + + if (tokenIsIdentifier(this.state.type)) { + node.id = this.parseIdentifier(); + this.checkIdentifier(node.id, BIND_TS_INTERFACE); + } else { + node.id = null; + this.raise(TSErrors.MissingInterfaceName, { + at: this.state.startLoc + }); + } + + node.typeParameters = this.tsTryParseTypeParameters(); + + if (this.eat(81)) { + node.extends = this.tsParseHeritageClause("extends"); + } + + const body = this.startNode(); + body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)); + node.body = this.finishNode(body, "TSInterfaceBody"); + return this.finishNode(node, "TSInterfaceDeclaration"); + } + + tsParseTypeAliasDeclaration(node) { + node.id = this.parseIdentifier(); + this.checkIdentifier(node.id, BIND_TS_TYPE); + node.typeAnnotation = this.tsInType(() => { + node.typeParameters = this.tsTryParseTypeParameters(); + this.expect(29); + + if (this.isContextual(111) && this.lookahead().type !== 16) { + const node = this.startNode(); + this.next(); + return this.finishNode(node, "TSIntrinsicKeyword"); + } + + return this.tsParseType(); + }); + this.semicolon(); + return this.finishNode(node, "TSTypeAliasDeclaration"); + } + + tsInNoContext(cb) { + const oldContext = this.state.context; + this.state.context = [oldContext[0]]; + + try { + return cb(); + } finally { + this.state.context = oldContext; + } + } + + tsInType(cb) { + const oldInType = this.state.inType; + this.state.inType = true; + + try { + return cb(); + } finally { + this.state.inType = oldInType; + } + } + + tsEatThenParseType(token) { + return !this.match(token) ? undefined : this.tsNextThenParseType(); + } + + tsExpectThenParseType(token) { + return this.tsDoThenParseType(() => this.expect(token)); + } + + tsNextThenParseType() { + return this.tsDoThenParseType(() => this.next()); + } + + tsDoThenParseType(cb) { + return this.tsInType(() => { + cb(); + return this.tsParseType(); + }); + } + + tsParseEnumMember() { + const node = this.startNode(); + node.id = this.match(129) ? this.parseExprAtom() : this.parseIdentifier(true); + + if (this.eat(29)) { + node.initializer = this.parseMaybeAssignAllowIn(); + } + + return this.finishNode(node, "TSEnumMember"); + } + + tsParseEnumDeclaration(node, properties = {}) { + if (properties.const) node.const = true; + if (properties.declare) node.declare = true; + this.expectContextual(122); + node.id = this.parseIdentifier(); + this.checkIdentifier(node.id, node.const ? BIND_TS_CONST_ENUM : BIND_TS_ENUM); + this.expect(5); + node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); + this.expect(8); + return this.finishNode(node, "TSEnumDeclaration"); + } + + tsParseModuleBlock() { + const node = this.startNode(); + this.scope.enter(SCOPE_OTHER); + this.expect(5); + this.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 8); + this.scope.exit(); + return this.finishNode(node, "TSModuleBlock"); + } + + tsParseModuleOrNamespaceDeclaration(node, nested = false) { + node.id = this.parseIdentifier(); + + if (!nested) { + this.checkIdentifier(node.id, BIND_TS_NAMESPACE); + } + + if (this.eat(16)) { + const inner = this.startNode(); + this.tsParseModuleOrNamespaceDeclaration(inner, true); + node.body = inner; + } else { + this.scope.enter(SCOPE_TS_MODULE); + this.prodParam.enter(PARAM); + node.body = this.tsParseModuleBlock(); + this.prodParam.exit(); + this.scope.exit(); + } + + return this.finishNode(node, "TSModuleDeclaration"); + } + + tsParseAmbientExternalModuleDeclaration(node) { + if (this.isContextual(109)) { + node.global = true; + node.id = this.parseIdentifier(); + } else if (this.match(129)) { + node.id = this.parseExprAtom(); + } else { + this.unexpected(); + } + + if (this.match(5)) { + this.scope.enter(SCOPE_TS_MODULE); + this.prodParam.enter(PARAM); + node.body = this.tsParseModuleBlock(); + this.prodParam.exit(); + this.scope.exit(); + } else { + this.semicolon(); + } + + return this.finishNode(node, "TSModuleDeclaration"); + } + + tsParseImportEqualsDeclaration(node, isExport) { + node.isExport = isExport || false; + node.id = this.parseIdentifier(); + this.checkIdentifier(node.id, BIND_LEXICAL); + this.expect(29); + const moduleReference = this.tsParseModuleReference(); + + if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") { + this.raise(TSErrors.ImportAliasHasImportType, { + at: moduleReference + }); + } + + node.moduleReference = moduleReference; + this.semicolon(); + return this.finishNode(node, "TSImportEqualsDeclaration"); + } + + tsIsExternalModuleReference() { + return this.isContextual(116) && this.lookaheadCharCode() === 40; + } + + tsParseModuleReference() { + return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false); + } + + tsParseExternalModuleReference() { + const node = this.startNode(); + this.expectContextual(116); + this.expect(10); + + if (!this.match(129)) { + throw this.unexpected(); + } + + node.expression = this.parseExprAtom(); + this.expect(11); + return this.finishNode(node, "TSExternalModuleReference"); + } + + tsLookAhead(f) { + const state = this.state.clone(); + const res = f(); + this.state = state; + return res; + } + + tsTryParseAndCatch(f) { + const result = this.tryParse(abort => f() || abort()); + if (result.aborted || !result.node) return undefined; + if (result.error) this.state = result.failState; + return result.node; + } + + tsTryParse(f) { + const state = this.state.clone(); + const result = f(); + + if (result !== undefined && result !== false) { + return result; + } else { + this.state = state; + return undefined; + } + } + + tsTryParseDeclare(nany) { + if (this.isLineTerminator()) { + return; + } + + let starttype = this.state.type; + let kind; + + if (this.isContextual(99)) { + starttype = 74; + kind = "let"; + } + + return this.tsInAmbientContext(() => { + if (starttype === 68) { + nany.declare = true; + return this.parseFunctionStatement(nany, false, true); + } + + if (starttype === 80) { + nany.declare = true; + return this.parseClass(nany, true, false); + } + + if (starttype === 122) { + return this.tsParseEnumDeclaration(nany, { + declare: true + }); + } + + if (starttype === 109) { + return this.tsParseAmbientExternalModuleDeclaration(nany); + } + + if (starttype === 75 || starttype === 74) { + if (!this.match(75) || !this.isLookaheadContextual("enum")) { + nany.declare = true; + return this.parseVarStatement(nany, kind || this.state.value, true); + } + + this.expect(75); + return this.tsParseEnumDeclaration(nany, { + const: true, + declare: true + }); + } + + if (starttype === 125) { + const result = this.tsParseInterfaceDeclaration(nany, { + declare: true + }); + if (result) return result; + } + + if (tokenIsIdentifier(starttype)) { + return this.tsParseDeclaration(nany, this.state.value, true); + } + }); + } + + tsTryParseExportDeclaration() { + return this.tsParseDeclaration(this.startNode(), this.state.value, true); + } + + tsParseExpressionStatement(node, expr) { + switch (expr.name) { + case "declare": + { + const declaration = this.tsTryParseDeclare(node); + + if (declaration) { + declaration.declare = true; + return declaration; + } + + break; + } + + case "global": + if (this.match(5)) { + this.scope.enter(SCOPE_TS_MODULE); + this.prodParam.enter(PARAM); + const mod = node; + mod.global = true; + mod.id = expr; + mod.body = this.tsParseModuleBlock(); + this.scope.exit(); + this.prodParam.exit(); + return this.finishNode(mod, "TSModuleDeclaration"); + } + + break; + + default: + return this.tsParseDeclaration(node, expr.name, false); + } + } + + tsParseDeclaration(node, value, next) { + switch (value) { + case "abstract": + if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) { + return this.tsParseAbstractDeclaration(node); + } + + break; + + case "module": + if (this.tsCheckLineTerminator(next)) { + if (this.match(129)) { + return this.tsParseAmbientExternalModuleDeclaration(node); + } else if (tokenIsIdentifier(this.state.type)) { + return this.tsParseModuleOrNamespaceDeclaration(node); + } + } + + break; + + case "namespace": + if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { + return this.tsParseModuleOrNamespaceDeclaration(node); + } + + break; + + case "type": + if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { + return this.tsParseTypeAliasDeclaration(node); + } + + break; + } + } + + tsCheckLineTerminator(next) { + if (next) { + if (this.hasFollowingLineBreak()) return false; + this.next(); + return true; + } + + return !this.isLineTerminator(); + } + + tsTryParseGenericAsyncArrowFunction(startPos, startLoc) { + if (!this.match(47)) { + return undefined; + } + + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + this.state.maybeInArrowParameters = true; + const res = this.tsTryParseAndCatch(() => { + const node = this.startNodeAt(startPos, startLoc); + node.typeParameters = this.tsParseTypeParameters(); + super.parseFunctionParams(node); + node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation(); + this.expect(19); + return node; + }); + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + + if (!res) { + return undefined; + } + + return this.parseArrowExpression(res, null, true); + } + + tsParseTypeArgumentsInExpression() { + if (this.reScan_lt() !== 47) { + return undefined; + } + + return this.tsParseTypeArguments(); + } + + tsParseTypeArguments() { + const node = this.startNode(); + node.params = this.tsInType(() => this.tsInNoContext(() => { + this.expect(47); + return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this)); + })); + + if (node.params.length === 0) { + this.raise(TSErrors.EmptyTypeArguments, { + at: node + }); + } + + this.expect(48); + return this.finishNode(node, "TSTypeParameterInstantiation"); + } + + tsIsDeclarationStart() { + return tokenIsTSDeclarationStart(this.state.type); + } + + isExportDefaultSpecifier() { + if (this.tsIsDeclarationStart()) return false; + return super.isExportDefaultSpecifier(); + } + + parseAssignableListItem(allowModifiers, decorators) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + let accessibility; + let readonly = false; + let override = false; + + if (allowModifiers !== undefined) { + const modified = {}; + this.tsParseModifiers({ + modified, + allowedModifiers: ["public", "private", "protected", "override", "readonly"] + }); + accessibility = modified.accessibility; + override = modified.override; + readonly = modified.readonly; + + if (allowModifiers === false && (accessibility || readonly || override)) { + this.raise(TSErrors.UnexpectedParameterModifier, { + at: startLoc + }); + } + } + + const left = this.parseMaybeDefault(); + this.parseAssignableListItemTypes(left); + const elt = this.parseMaybeDefault(left.start, left.loc.start, left); + + if (accessibility || readonly || override) { + const pp = this.startNodeAt(startPos, startLoc); + + if (decorators.length) { + pp.decorators = decorators; + } + + if (accessibility) pp.accessibility = accessibility; + if (readonly) pp.readonly = readonly; + if (override) pp.override = override; + + if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { + this.raise(TSErrors.UnsupportedParameterPropertyKind, { + at: pp + }); + } + + pp.parameter = elt; + return this.finishNode(pp, "TSParameterProperty"); + } + + if (decorators.length) { + left.decorators = decorators; + } + + return elt; + } + + isSimpleParameter(node) { + return node.type === "TSParameterProperty" && super.isSimpleParameter(node.parameter) || super.isSimpleParameter(node); + } + + parseFunctionBodyAndFinish(node, type, isMethod = false) { + if (this.match(14)) { + node.returnType = this.tsParseTypeOrTypePredicateAnnotation(14); + } + + const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" ? "TSDeclareMethod" : undefined; + + if (bodilessType && !this.match(5) && this.isLineTerminator()) { + this.finishNode(node, bodilessType); + return; + } + + if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) { + this.raise(TSErrors.DeclareFunctionHasImplementation, { + at: node + }); + + if (node.declare) { + super.parseFunctionBodyAndFinish(node, bodilessType, isMethod); + return; + } + } + + super.parseFunctionBodyAndFinish(node, type, isMethod); + } + + registerFunctionStatementId(node) { + if (!node.body && node.id) { + this.checkIdentifier(node.id, BIND_TS_AMBIENT); + } else { + super.registerFunctionStatementId(...arguments); + } + } + + tsCheckForInvalidTypeCasts(items) { + items.forEach(node => { + if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") { + this.raise(TSErrors.UnexpectedTypeAnnotation, { + at: node.typeAnnotation + }); + } + }); + } + + toReferencedList(exprList, isInParens) { + this.tsCheckForInvalidTypeCasts(exprList); + return exprList; + } + + parseArrayLike(...args) { + const node = super.parseArrayLike(...args); + + if (node.type === "ArrayExpression") { + this.tsCheckForInvalidTypeCasts(node.elements); + } + + return node; + } + + parseSubscript(base, startPos, startLoc, noCalls, state) { + if (!this.hasPrecedingLineBreak() && this.match(35)) { + this.state.canStartJSXElement = false; + this.next(); + const nonNullExpression = this.startNodeAt(startPos, startLoc); + nonNullExpression.expression = base; + return this.finishNode(nonNullExpression, "TSNonNullExpression"); + } + + let isOptionalCall = false; + + if (this.match(18) && this.lookaheadCharCode() === 60) { + if (noCalls) { + state.stop = true; + return base; + } + + state.optionalChainMember = isOptionalCall = true; + this.next(); + } + + if (this.match(47) || this.match(51)) { + let missingParenErrorLoc; + const result = this.tsTryParseAndCatch(() => { + if (!noCalls && this.atPossibleAsyncArrow(base)) { + const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startPos, startLoc); + + if (asyncArrowFn) { + return asyncArrowFn; + } + } + + const node = this.startNodeAt(startPos, startLoc); + node.callee = base; + const typeArguments = this.tsParseTypeArgumentsInExpression(); + + if (typeArguments) { + if (isOptionalCall && !this.match(10)) { + missingParenErrorLoc = this.state.curPosition(); + this.unexpected(); + } + + if (!noCalls && this.eat(10)) { + node.arguments = this.parseCallExpressionArguments(11, false); + this.tsCheckForInvalidTypeCasts(node.arguments); + node.typeParameters = typeArguments; + + if (state.optionalChainMember) { + node.optional = isOptionalCall; + } + + return this.finishCallExpression(node, state.optionalChainMember); + } else if (tokenIsTemplate(this.state.type)) { + const result = this.parseTaggedTemplateExpression(base, startPos, startLoc, state); + result.typeParameters = typeArguments; + return result; + } + } + + this.unexpected(); + }); + + if (missingParenErrorLoc) { + this.unexpected(missingParenErrorLoc, 10); + } + + if (result) return result; + } + + return super.parseSubscript(base, startPos, startLoc, noCalls, state); + } + + parseNewArguments(node) { + if (this.match(47) || this.match(51)) { + const typeParameters = this.tsTryParseAndCatch(() => { + const args = this.tsParseTypeArgumentsInExpression(); + if (!this.match(10)) this.unexpected(); + return args; + }); + + if (typeParameters) { + node.typeParameters = typeParameters; + } + } + + super.parseNewArguments(node); + } + + parseExprOp(left, leftStartPos, leftStartLoc, minPrec) { + if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && this.isContextual(93)) { + const node = this.startNodeAt(leftStartPos, leftStartLoc); + node.expression = left; + + const _const = this.tsTryNextParseConstantContext(); + + if (_const) { + node.typeAnnotation = _const; + } else { + node.typeAnnotation = this.tsNextThenParseType(); + } + + this.finishNode(node, "TSAsExpression"); + this.reScan_lt_gt(); + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec); + } + + return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec); + } + + checkReservedWord(word, startLoc, checkKeywords, isBinding) { + if (!this.state.isAmbientContext) { + super.checkReservedWord(word, startLoc, checkKeywords, isBinding); + } + } + + checkDuplicateExports() {} + + parseImport(node) { + node.importKind = "value"; + + if (tokenIsIdentifier(this.state.type) || this.match(55) || this.match(5)) { + let ahead = this.lookahead(); + + if (this.isContextual(126) && ahead.type !== 12 && ahead.type !== 97 && ahead.type !== 29) { + node.importKind = "type"; + this.next(); + ahead = this.lookahead(); + } + + if (tokenIsIdentifier(this.state.type) && ahead.type === 29) { + return this.tsParseImportEqualsDeclaration(node); + } + } + + const importNode = super.parseImport(node); + + if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") { + this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, { + at: importNode + }); + } + + return importNode; + } + + parseExport(node) { + if (this.match(83)) { + this.next(); + + if (this.isContextual(126) && this.lookaheadCharCode() !== 61) { + node.importKind = "type"; + this.next(); + } else { + node.importKind = "value"; + } + + return this.tsParseImportEqualsDeclaration(node, true); + } else if (this.eat(29)) { + const assign = node; + assign.expression = this.parseExpression(); + this.semicolon(); + return this.finishNode(assign, "TSExportAssignment"); + } else if (this.eatContextual(93)) { + const decl = node; + this.expectContextual(124); + decl.id = this.parseIdentifier(); + this.semicolon(); + return this.finishNode(decl, "TSNamespaceExportDeclaration"); + } else { + if (this.isContextual(126) && this.lookahead().type === 5) { + this.next(); + node.exportKind = "type"; + } else { + node.exportKind = "value"; + } + + return super.parseExport(node); + } + } + + isAbstractClass() { + return this.isContextual(120) && this.lookahead().type === 80; + } + + parseExportDefaultExpression() { + if (this.isAbstractClass()) { + const cls = this.startNode(); + this.next(); + cls.abstract = true; + this.parseClass(cls, true, true); + return cls; + } + + if (this.match(125)) { + const result = this.tsParseInterfaceDeclaration(this.startNode()); + if (result) return result; + } + + return super.parseExportDefaultExpression(); + } + + parseVarStatement(node, kind, allowMissingInitializer = false) { + const { + isAmbientContext + } = this.state; + const declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext); + if (!isAmbientContext) return declaration; + + for (const { + id, + init + } of declaration.declarations) { + if (!init) continue; + + if (kind !== "const" || !!id.typeAnnotation) { + this.raise(TSErrors.InitializerNotAllowedInAmbientContext, { + at: init + }); + } else if (init.type !== "StringLiteral" && init.type !== "BooleanLiteral" && init.type !== "NumericLiteral" && init.type !== "BigIntLiteral" && (init.type !== "TemplateLiteral" || init.expressions.length > 0) && !isPossiblyLiteralEnum(init)) { + this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, { + at: init + }); + } + } + + return declaration; + } + + parseStatementContent(context, topLevel) { + if (this.match(75) && this.isLookaheadContextual("enum")) { + const node = this.startNode(); + this.expect(75); + return this.tsParseEnumDeclaration(node, { + const: true + }); + } + + if (this.isContextual(122)) { + return this.tsParseEnumDeclaration(this.startNode()); + } + + if (this.isContextual(125)) { + const result = this.tsParseInterfaceDeclaration(this.startNode()); + if (result) return result; + } + + return super.parseStatementContent(context, topLevel); + } + + parseAccessModifier() { + return this.tsParseModifier(["public", "protected", "private"]); + } + + tsHasSomeModifiers(member, modifiers) { + return modifiers.some(modifier => { + if (tsIsAccessModifier(modifier)) { + return member.accessibility === modifier; + } + + return !!member[modifier]; + }); + } + + tsIsStartOfStaticBlocks() { + return this.isContextual(104) && this.lookaheadCharCode() === 123; + } + + parseClassMember(classBody, member, state) { + const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"]; + this.tsParseModifiers({ + modified: member, + allowedModifiers: modifiers, + stopOnStartOfClassStaticBlock: true + }); + + const callParseClassMemberWithIsStatic = () => { + if (this.tsIsStartOfStaticBlocks()) { + this.next(); + this.next(); + + if (this.tsHasSomeModifiers(member, modifiers)) { + this.raise(TSErrors.StaticBlockCannotHaveModifier, { + at: this.state.curPosition() + }); + } + + this.parseClassStaticBlock(classBody, member); + } else { + this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static); + } + }; + + if (member.declare) { + this.tsInAmbientContext(callParseClassMemberWithIsStatic); + } else { + callParseClassMemberWithIsStatic(); + } + } + + parseClassMemberWithIsStatic(classBody, member, state, isStatic) { + const idx = this.tsTryParseIndexSignature(member); + + if (idx) { + classBody.body.push(idx); + + if (member.abstract) { + this.raise(TSErrors.IndexSignatureHasAbstract, { + at: member + }); + } + + if (member.accessibility) { + this.raise(TSErrors.IndexSignatureHasAccessibility, { + at: member, + modifier: member.accessibility + }); + } + + if (member.declare) { + this.raise(TSErrors.IndexSignatureHasDeclare, { + at: member + }); + } + + if (member.override) { + this.raise(TSErrors.IndexSignatureHasOverride, { + at: member + }); + } + + return; + } + + if (!this.state.inAbstractClass && member.abstract) { + this.raise(TSErrors.NonAbstractClassHasAbstractMethod, { + at: member + }); + } + + if (member.override) { + if (!state.hadSuperClass) { + this.raise(TSErrors.OverrideNotInSubClass, { + at: member + }); + } + } + + super.parseClassMemberWithIsStatic(classBody, member, state, isStatic); + } + + parsePostMemberNameModifiers(methodOrProp) { + const optional = this.eat(17); + if (optional) methodOrProp.optional = true; + + if (methodOrProp.readonly && this.match(10)) { + this.raise(TSErrors.ClassMethodHasReadonly, { + at: methodOrProp + }); + } + + if (methodOrProp.declare && this.match(10)) { + this.raise(TSErrors.ClassMethodHasDeclare, { + at: methodOrProp + }); + } + } + + parseExpressionStatement(node, expr) { + const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr) : undefined; + return decl || super.parseExpressionStatement(node, expr); + } + + shouldParseExportDeclaration() { + if (this.tsIsDeclarationStart()) return true; + return super.shouldParseExportDeclaration(); + } + + parseConditional(expr, startPos, startLoc, refExpressionErrors) { + if (!this.state.maybeInArrowParameters || !this.match(17)) { + return super.parseConditional(expr, startPos, startLoc, refExpressionErrors); + } + + const result = this.tryParse(() => super.parseConditional(expr, startPos, startLoc)); + + if (!result.node) { + if (result.error) { + super.setOptionalParametersError(refExpressionErrors, result.error); + } + + return expr; + } + + if (result.error) this.state = result.failState; + return result.node; + } + + parseParenItem(node, startPos, startLoc) { + node = super.parseParenItem(node, startPos, startLoc); + + if (this.eat(17)) { + node.optional = true; + this.resetEndLocation(node); + } + + if (this.match(14)) { + const typeCastNode = this.startNodeAt(startPos, startLoc); + typeCastNode.expression = node; + typeCastNode.typeAnnotation = this.tsParseTypeAnnotation(); + return this.finishNode(typeCastNode, "TSTypeCastExpression"); + } + + return node; + } + + parseExportDeclaration(node) { + if (!this.state.isAmbientContext && this.isContextual(121)) { + return this.tsInAmbientContext(() => this.parseExportDeclaration(node)); + } + + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const isDeclare = this.eatContextual(121); + + if (isDeclare && (this.isContextual(121) || !this.shouldParseExportDeclaration())) { + throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, { + at: this.state.startLoc + }); + } + + const isIdentifier = tokenIsIdentifier(this.state.type); + const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node); + if (!declaration) return null; + + if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) { + node.exportKind = "type"; + } + + if (isDeclare) { + this.resetStartLocation(declaration, startPos, startLoc); + declaration.declare = true; + } + + return declaration; + } + + parseClassId(node, isStatement, optionalId) { + if ((!isStatement || optionalId) && this.isContextual(110)) { + return; + } + + super.parseClassId(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS); + const typeParameters = this.tsTryParseTypeParameters(); + if (typeParameters) node.typeParameters = typeParameters; + } + + parseClassPropertyAnnotation(node) { + if (!node.optional && this.eat(35)) { + node.definite = true; + } + + const type = this.tsTryParseTypeAnnotation(); + if (type) node.typeAnnotation = type; + } + + parseClassProperty(node) { + this.parseClassPropertyAnnotation(node); + + if (this.state.isAmbientContext && this.match(29)) { + this.raise(TSErrors.DeclareClassFieldHasInitializer, { + at: this.state.startLoc + }); + } + + if (node.abstract && this.match(29)) { + const { + key + } = node; + this.raise(TSErrors.AbstractPropertyHasInitializer, { + at: this.state.startLoc, + propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` + }); + } + + return super.parseClassProperty(node); + } + + parseClassPrivateProperty(node) { + if (node.abstract) { + this.raise(TSErrors.PrivateElementHasAbstract, { + at: node + }); + } + + if (node.accessibility) { + this.raise(TSErrors.PrivateElementHasAccessibility, { + at: node, + modifier: node.accessibility + }); + } + + this.parseClassPropertyAnnotation(node); + return super.parseClassPrivateProperty(node); + } + + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + const typeParameters = this.tsTryParseTypeParameters(); + + if (typeParameters && isConstructor) { + this.raise(TSErrors.ConstructorHasTypeParameters, { + at: typeParameters + }); + } + + const { + declare = false, + kind + } = method; + + if (declare && (kind === "get" || kind === "set")) { + this.raise(TSErrors.DeclareAccessor, { + at: method, + kind + }); + } + + if (typeParameters) method.typeParameters = typeParameters; + super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); + } + + pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { + const typeParameters = this.tsTryParseTypeParameters(); + if (typeParameters) method.typeParameters = typeParameters; + super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); + } + + declareClassPrivateMethodInScope(node, kind) { + if (node.type === "TSDeclareMethod") return; + if (node.type === "MethodDefinition" && !node.value.body) return; + super.declareClassPrivateMethodInScope(node, kind); + } + + parseClassSuper(node) { + super.parseClassSuper(node); + + if (node.superClass && (this.match(47) || this.match(51))) { + node.superTypeParameters = this.tsParseTypeArgumentsInExpression(); + } + + if (this.eatContextual(110)) { + node.implements = this.tsParseHeritageClause("implements"); + } + } + + parseObjPropValue(prop, ...args) { + const typeParameters = this.tsTryParseTypeParameters(); + if (typeParameters) prop.typeParameters = typeParameters; + super.parseObjPropValue(prop, ...args); + } + + parseFunctionParams(node, allowModifiers) { + const typeParameters = this.tsTryParseTypeParameters(); + if (typeParameters) node.typeParameters = typeParameters; + super.parseFunctionParams(node, allowModifiers); + } + + parseVarId(decl, kind) { + super.parseVarId(decl, kind); + + if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.eat(35)) { + decl.definite = true; + } + + const type = this.tsTryParseTypeAnnotation(); + + if (type) { + decl.id.typeAnnotation = type; + this.resetEndLocation(decl.id); + } + } + + parseAsyncArrowFromCallExpression(node, call) { + if (this.match(14)) { + node.returnType = this.tsParseTypeAnnotation(); + } + + return super.parseAsyncArrowFromCallExpression(node, call); + } + + parseMaybeAssign(...args) { + var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2, _jsx4, _typeCast3; + + let state; + let jsx; + let typeCast; + + if (this.hasPlugin("jsx") && (this.match(138) || this.match(47))) { + state = this.state.clone(); + jsx = this.tryParse(() => super.parseMaybeAssign(...args), state); + if (!jsx.error) return jsx.node; + const { + context + } = this.state; + const currentContext = context[context.length - 1]; + + if (currentContext === types.j_oTag || currentContext === types.j_expr) { + context.pop(); + } + } + + if (!((_jsx = jsx) != null && _jsx.error) && !this.match(47)) { + return super.parseMaybeAssign(...args); + } + + let typeParameters; + state = state || this.state.clone(); + const arrow = this.tryParse(abort => { + var _expr$extra, _typeParameters, _expr$typeParameters$; + + typeParameters = this.tsParseTypeParameters(); + const expr = super.parseMaybeAssign(...args); + + if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { + abort(); + } + + if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) { + this.resetStartLocationFromNode(expr, typeParameters); + } + + expr.typeParameters = typeParameters; + + if (this.hasPlugin("jsx") && expr.typeParameters.params.length === 1 && !((_expr$typeParameters$ = expr.typeParameters.extra) != null && _expr$typeParameters$.trailingComma)) { + const parameter = expr.typeParameters.params[0]; + + if (!parameter.constraint) ; + } + + return expr; + }, state); + + if (!arrow.error && !arrow.aborted) { + if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); + return arrow.node; + } + + if (!jsx) { + assert(!this.hasPlugin("jsx")); + typeCast = this.tryParse(() => super.parseMaybeAssign(...args), state); + if (!typeCast.error) return typeCast.node; + } + + if ((_jsx2 = jsx) != null && _jsx2.node) { + this.state = jsx.failState; + return jsx.node; + } + + if (arrow.node) { + this.state = arrow.failState; + if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); + return arrow.node; + } + + if ((_typeCast = typeCast) != null && _typeCast.node) { + this.state = typeCast.failState; + return typeCast.node; + } + + if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; + if (arrow.thrown) throw arrow.error; + if ((_typeCast2 = typeCast) != null && _typeCast2.thrown) throw typeCast.error; + throw ((_jsx4 = jsx) == null ? void 0 : _jsx4.error) || arrow.error || ((_typeCast3 = typeCast) == null ? void 0 : _typeCast3.error); + } + + reportReservedArrowTypeParam(node) { + var _node$extra; + + if (node.params.length === 1 && !((_node$extra = node.extra) != null && _node$extra.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { + this.raise(TSErrors.ReservedArrowTypeParam, { + at: node + }); + } + } + + parseMaybeUnary(refExpressionErrors) { + if (!this.hasPlugin("jsx") && this.match(47)) { + return this.tsParseTypeAssertion(); + } else { + return super.parseMaybeUnary(refExpressionErrors); + } + } + + parseArrow(node) { + if (this.match(14)) { + const result = this.tryParse(abort => { + const returnType = this.tsParseTypeOrTypePredicateAnnotation(14); + if (this.canInsertSemicolon() || !this.match(19)) abort(); + return returnType; + }); + if (result.aborted) return; + + if (!result.thrown) { + if (result.error) this.state = result.failState; + node.returnType = result.node; + } + } + + return super.parseArrow(node); + } + + parseAssignableListItemTypes(param) { + if (this.eat(17)) { + if (param.type !== "Identifier" && !this.state.isAmbientContext && !this.state.inType) { + this.raise(TSErrors.PatternIsOptional, { + at: param + }); + } + + param.optional = true; + } + + const type = this.tsTryParseTypeAnnotation(); + if (type) param.typeAnnotation = type; + this.resetEndLocation(param); + return param; + } + + isAssignable(node, isBinding) { + switch (node.type) { + case "TSTypeCastExpression": + return this.isAssignable(node.expression, isBinding); + + case "TSParameterProperty": + return true; + + default: + return super.isAssignable(node, isBinding); + } + } + + toAssignable(node, isLHS = false) { + switch (node.type) { + case "ParenthesizedExpression": + this.toAssignableParenthesizedExpression(node, isLHS); + break; + + case "TSAsExpression": + case "TSNonNullExpression": + case "TSTypeAssertion": + if (isLHS) { + this.expressionScope.recordArrowParemeterBindingError(TSErrors.UnexpectedTypeCastInParameter, { + at: node + }); + } else { + this.raise(TSErrors.UnexpectedTypeCastInParameter, { + at: node + }); + } + + this.toAssignable(node.expression, isLHS); + break; + + case "AssignmentExpression": + if (!isLHS && node.left.type === "TSTypeCastExpression") { + node.left = this.typeCastToParameter(node.left); + } + + default: + super.toAssignable(node, isLHS); + } + } + + toAssignableParenthesizedExpression(node, isLHS) { + switch (node.expression.type) { + case "TSAsExpression": + case "TSNonNullExpression": + case "TSTypeAssertion": + case "ParenthesizedExpression": + this.toAssignable(node.expression, isLHS); + break; + + default: + super.toAssignable(node, isLHS); + } + } + + checkToRestConversion(node, allowPattern) { + switch (node.type) { + case "TSAsExpression": + case "TSTypeAssertion": + case "TSNonNullExpression": + this.checkToRestConversion(node.expression, false); + break; + + default: + super.checkToRestConversion(node, allowPattern); + } + } + + isValidLVal(type, isUnparenthesizedInAssign, binding) { + return getOwn$1({ + TSTypeCastExpression: true, + TSParameterProperty: "parameter", + TSNonNullExpression: "expression", + TSAsExpression: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true], + TSTypeAssertion: (binding !== BIND_NONE || !isUnparenthesizedInAssign) && ["expression", true] + }, type) || super.isValidLVal(type, isUnparenthesizedInAssign, binding); + } + + parseBindingAtom() { + switch (this.state.type) { + case 78: + return this.parseIdentifier(true); + + default: + return super.parseBindingAtom(); + } + } + + parseMaybeDecoratorArguments(expr) { + if (this.match(47) || this.match(51)) { + const typeArguments = this.tsParseTypeArgumentsInExpression(); + + if (this.match(10)) { + const call = super.parseMaybeDecoratorArguments(expr); + call.typeParameters = typeArguments; + return call; + } + + this.unexpected(null, 10); + } + + return super.parseMaybeDecoratorArguments(expr); + } + + checkCommaAfterRest(close) { + if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close) { + this.next(); + return false; + } else { + return super.checkCommaAfterRest(close); + } + } + + isClassMethod() { + return this.match(47) || super.isClassMethod(); + } + + isClassProperty() { + return this.match(35) || this.match(14) || super.isClassProperty(); + } + + parseMaybeDefault(...args) { + const node = super.parseMaybeDefault(...args); + + if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { + this.raise(TSErrors.TypeAnnotationAfterAssign, { + at: node.typeAnnotation + }); + } + + return node; + } + + getTokenFromCode(code) { + if (this.state.inType) { + if (code === 62) { + return this.finishOp(48, 1); + } + + if (code === 60) { + return this.finishOp(47, 1); + } + } + + return super.getTokenFromCode(code); + } + + reScan_lt_gt() { + const { + type + } = this.state; + + if (type === 47) { + this.state.pos -= 1; + this.readToken_lt(); + } else if (type === 48) { + this.state.pos -= 1; + this.readToken_gt(); + } + } + + reScan_lt() { + const { + type + } = this.state; + + if (type === 51) { + this.state.pos -= 2; + this.finishOp(47, 1); + return 47; + } + + return type; + } + + toAssignableList(exprList) { + for (let i = 0; i < exprList.length; i++) { + const expr = exprList[i]; + + if ((expr == null ? void 0 : expr.type) === "TSTypeCastExpression") { + exprList[i] = this.typeCastToParameter(expr); + } + } + + super.toAssignableList(...arguments); + } + + typeCastToParameter(node) { + node.expression.typeAnnotation = node.typeAnnotation; + this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); + return node.expression; + } + + shouldParseArrow(params) { + if (this.match(14)) { + return params.every(expr => this.isAssignable(expr, true)); + } + + return super.shouldParseArrow(params); + } + + shouldParseAsyncArrow() { + return this.match(14) || super.shouldParseAsyncArrow(); + } + + canHaveLeadingDecorator() { + return super.canHaveLeadingDecorator() || this.isAbstractClass(); + } + + jsxParseOpeningElementAfterName(node) { + if (this.match(47) || this.match(51)) { + const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression()); + if (typeArguments) node.typeParameters = typeArguments; + } + + return super.jsxParseOpeningElementAfterName(node); + } + + getGetterSetterExpectedParamCount(method) { + const baseCount = super.getGetterSetterExpectedParamCount(method); + const params = this.getObjectOrClassMethodParams(method); + const firstParam = params[0]; + const hasContextParam = firstParam && this.isThisParam(firstParam); + return hasContextParam ? baseCount + 1 : baseCount; + } + + parseCatchClauseParam() { + const param = super.parseCatchClauseParam(); + const type = this.tsTryParseTypeAnnotation(); + + if (type) { + param.typeAnnotation = type; + this.resetEndLocation(param); + } + + return param; + } + + tsInAmbientContext(cb) { + const oldIsAmbientContext = this.state.isAmbientContext; + this.state.isAmbientContext = true; + + try { + return cb(); + } finally { + this.state.isAmbientContext = oldIsAmbientContext; + } + } + + parseClass(node, ...args) { + const oldInAbstractClass = this.state.inAbstractClass; + this.state.inAbstractClass = !!node.abstract; + + try { + return super.parseClass(node, ...args); + } finally { + this.state.inAbstractClass = oldInAbstractClass; + } + } + + tsParseAbstractDeclaration(node) { + if (this.match(80)) { + node.abstract = true; + return this.parseClass(node, true, false); + } else if (this.isContextual(125)) { + if (!this.hasFollowingLineBreak()) { + node.abstract = true; + this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, { + at: node + }); + return this.tsParseInterfaceDeclaration(node); + } + } else { + this.unexpected(null, 80); + } + } + + parseMethod(...args) { + const method = super.parseMethod(...args); + + if (method.abstract) { + const hasBody = this.hasPlugin("estree") ? !!method.value.body : !!method.body; + + if (hasBody) { + const { + key + } = method; + this.raise(TSErrors.AbstractMethodHasImplementation, { + at: method, + methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(key.start, key.end)}]` + }); + } + } + + return method; + } + + tsParseTypeParameterName() { + const typeName = this.parseIdentifier(); + return typeName.name; + } + + shouldParseAsAmbientContext() { + return !!this.getPluginOption("typescript", "dts"); + } + + parse() { + if (this.shouldParseAsAmbientContext()) { + this.state.isAmbientContext = true; + } + + return super.parse(); + } + + getExpression() { + if (this.shouldParseAsAmbientContext()) { + this.state.isAmbientContext = true; + } + + return super.getExpression(); + } + + parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { + if (!isString && isMaybeTypeOnly) { + this.parseTypeOnlyImportExportSpecifier(node, false, isInTypeExport); + return this.finishNode(node, "ExportSpecifier"); + } + + node.exportKind = "value"; + return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly); + } + + parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly) { + if (!importedIsString && isMaybeTypeOnly) { + this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport); + return this.finishNode(specifier, "ImportSpecifier"); + } + + specifier.importKind = "value"; + return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly); + } + + parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) { + const leftOfAsKey = isImport ? "imported" : "local"; + const rightOfAsKey = isImport ? "local" : "exported"; + let leftOfAs = node[leftOfAsKey]; + let rightOfAs; + let hasTypeSpecifier = false; + let canParseAsKeyword = true; + const loc = leftOfAs.loc.start; + + if (this.isContextual(93)) { + const firstAs = this.parseIdentifier(); + + if (this.isContextual(93)) { + const secondAs = this.parseIdentifier(); + + if (tokenIsKeywordOrIdentifier(this.state.type)) { + hasTypeSpecifier = true; + leftOfAs = firstAs; + rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); + canParseAsKeyword = false; + } else { + rightOfAs = secondAs; + canParseAsKeyword = false; + } + } else if (tokenIsKeywordOrIdentifier(this.state.type)) { + canParseAsKeyword = false; + rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); + } else { + hasTypeSpecifier = true; + leftOfAs = firstAs; + } + } else if (tokenIsKeywordOrIdentifier(this.state.type)) { + hasTypeSpecifier = true; + + if (isImport) { + leftOfAs = this.parseIdentifier(true); + + if (!this.isContextual(93)) { + this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true); + } + } else { + leftOfAs = this.parseModuleExportName(); + } + } + + if (hasTypeSpecifier && isInTypeOnlyImportExport) { + this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, { + at: loc + }); + } + + node[leftOfAsKey] = leftOfAs; + node[rightOfAsKey] = rightOfAs; + const kindKey = isImport ? "importKind" : "exportKind"; + node[kindKey] = hasTypeSpecifier ? "type" : "value"; + + if (canParseAsKeyword && this.eatContextual(93)) { + node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName(); + } + + if (!node[rightOfAsKey]) { + node[rightOfAsKey] = cloneIdentifier(node[leftOfAsKey]); + } + + if (isImport) { + this.checkIdentifier(node[rightOfAsKey], BIND_LEXICAL); + } + } + +}); + +function isPossiblyLiteralEnum(expression) { + if (expression.type !== "MemberExpression") return false; + const { + computed, + property + } = expression; + + if (computed && property.type !== "StringLiteral" && (property.type !== "TemplateLiteral" || property.expressions.length > 0)) { + return false; + } + + return isUncomputedMemberExpressionChain(expression.object); +} + +function isUncomputedMemberExpressionChain(expression) { + if (expression.type === "Identifier") return true; + if (expression.type !== "MemberExpression") return false; + if (expression.computed) return false; + return isUncomputedMemberExpressionChain(expression.object); +} + +const PlaceholderErrors = ParseErrorEnum`placeholders`(_ => ({ + ClassNameIsRequired: _("A class name is required."), + UnexpectedSpace: _("Unexpected space in placeholder.") +})); +var placeholders = (superClass => class extends superClass { + parsePlaceholder(expectedNode) { + if (this.match(140)) { + const node = this.startNode(); + this.next(); + this.assertNoSpace(); + node.name = super.parseIdentifier(true); + this.assertNoSpace(); + this.expect(140); + return this.finishPlaceholder(node, expectedNode); + } + } + + finishPlaceholder(node, expectedNode) { + const isFinished = !!(node.expectedNode && node.type === "Placeholder"); + node.expectedNode = expectedNode; + return isFinished ? node : this.finishNode(node, "Placeholder"); + } + + getTokenFromCode(code) { + if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) { + return this.finishOp(140, 2); + } + + return super.getTokenFromCode(...arguments); + } + + parseExprAtom() { + return this.parsePlaceholder("Expression") || super.parseExprAtom(...arguments); + } + + parseIdentifier() { + return this.parsePlaceholder("Identifier") || super.parseIdentifier(...arguments); + } + + checkReservedWord(word) { + if (word !== undefined) super.checkReservedWord(...arguments); + } + + parseBindingAtom() { + return this.parsePlaceholder("Pattern") || super.parseBindingAtom(...arguments); + } + + isValidLVal(type, ...rest) { + return type === "Placeholder" || super.isValidLVal(type, ...rest); + } + + toAssignable(node) { + if (node && node.type === "Placeholder" && node.expectedNode === "Expression") { + node.expectedNode = "Pattern"; + } else { + super.toAssignable(...arguments); + } + } + + isLet(context) { + if (super.isLet(context)) { + return true; + } + + if (!this.isContextual(99)) { + return false; + } + + if (context) return false; + const nextToken = this.lookahead(); + + if (nextToken.type === 140) { + return true; + } + + return false; + } + + verifyBreakContinue(node) { + if (node.label && node.label.type === "Placeholder") return; + super.verifyBreakContinue(...arguments); + } + + parseExpressionStatement(node, expr) { + if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) { + return super.parseExpressionStatement(...arguments); + } + + if (this.match(14)) { + const stmt = node; + stmt.label = this.finishPlaceholder(expr, "Identifier"); + this.next(); + stmt.body = this.parseStatement("label"); + return this.finishNode(stmt, "LabeledStatement"); + } + + this.semicolon(); + node.name = expr.name; + return this.finishPlaceholder(node, "Statement"); + } + + parseBlock() { + return this.parsePlaceholder("BlockStatement") || super.parseBlock(...arguments); + } + + parseFunctionId() { + return this.parsePlaceholder("Identifier") || super.parseFunctionId(...arguments); + } + + parseClass(node, isStatement, optionalId) { + const type = isStatement ? "ClassDeclaration" : "ClassExpression"; + this.next(); + this.takeDecorators(node); + const oldStrict = this.state.strict; + const placeholder = this.parsePlaceholder("Identifier"); + + if (placeholder) { + if (this.match(81) || this.match(140) || this.match(5)) { + node.id = placeholder; + } else if (optionalId || !isStatement) { + node.id = null; + node.body = this.finishPlaceholder(placeholder, "ClassBody"); + return this.finishNode(node, type); + } else { + throw this.raise(PlaceholderErrors.ClassNameIsRequired, { + at: this.state.startLoc + }); + } + } else { + this.parseClassId(node, isStatement, optionalId); + } + + this.parseClassSuper(node); + node.body = this.parsePlaceholder("ClassBody") || this.parseClassBody(!!node.superClass, oldStrict); + return this.finishNode(node, type); + } + + parseExport(node) { + const placeholder = this.parsePlaceholder("Identifier"); + if (!placeholder) return super.parseExport(...arguments); + + if (!this.isContextual(97) && !this.match(12)) { + node.specifiers = []; + node.source = null; + node.declaration = this.finishPlaceholder(placeholder, "Declaration"); + return this.finishNode(node, "ExportNamedDeclaration"); + } + + this.expectPlugin("exportDefaultFrom"); + const specifier = this.startNode(); + specifier.exported = placeholder; + node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; + return super.parseExport(node); + } + + isExportDefaultSpecifier() { + if (this.match(65)) { + const next = this.nextTokenStart(); + + if (this.isUnparsedContextual(next, "from")) { + if (this.input.startsWith(tokenLabelName(140), this.nextTokenStartSince(next + 4))) { + return true; + } + } + } + + return super.isExportDefaultSpecifier(); + } + + maybeParseExportDefaultSpecifier(node) { + if (node.specifiers && node.specifiers.length > 0) { + return true; + } + + return super.maybeParseExportDefaultSpecifier(...arguments); + } + + checkExport(node) { + const { + specifiers + } = node; + + if (specifiers != null && specifiers.length) { + node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder"); + } + + super.checkExport(node); + node.specifiers = specifiers; + } + + parseImport(node) { + const placeholder = this.parsePlaceholder("Identifier"); + if (!placeholder) return super.parseImport(...arguments); + node.specifiers = []; + + if (!this.isContextual(97) && !this.match(12)) { + node.source = this.finishPlaceholder(placeholder, "StringLiteral"); + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); + } + + const specifier = this.startNodeAtNode(placeholder); + specifier.local = placeholder; + this.finishNode(specifier, "ImportDefaultSpecifier"); + node.specifiers.push(specifier); + + if (this.eat(12)) { + const hasStarImport = this.maybeParseStarImportSpecifier(node); + if (!hasStarImport) this.parseNamedImportSpecifiers(node); + } + + this.expectContextual(97); + node.source = this.parseImportSource(); + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); + } + + parseImportSource() { + return this.parsePlaceholder("StringLiteral") || super.parseImportSource(...arguments); + } + + assertNoSpace() { + if (this.state.start > this.state.lastTokEndLoc.index) { + this.raise(PlaceholderErrors.UnexpectedSpace, { + at: this.state.lastTokEndLoc + }); + } + } + +}); + +var v8intrinsic = (superClass => class extends superClass { + parseV8Intrinsic() { + if (this.match(54)) { + const v8IntrinsicStartLoc = this.state.startLoc; + const node = this.startNode(); + this.next(); + + if (tokenIsIdentifier(this.state.type)) { + const name = this.parseIdentifierName(this.state.start); + const identifier = this.createIdentifier(node, name); + identifier.type = "V8IntrinsicIdentifier"; + + if (this.match(10)) { + return identifier; + } + } + + this.unexpected(v8IntrinsicStartLoc); + } + } + + parseExprAtom() { + return this.parseV8Intrinsic() || super.parseExprAtom(...arguments); + } + +}); + +function hasPlugin(plugins, expectedConfig) { + const [expectedName, expectedOptions] = typeof expectedConfig === "string" ? [expectedConfig, {}] : expectedConfig; + const expectedKeys = Object.keys(expectedOptions); + const expectedOptionsIsEmpty = expectedKeys.length === 0; + return plugins.some(p => { + if (typeof p === "string") { + return expectedOptionsIsEmpty && p === expectedName; + } else { + const [pluginName, pluginOptions] = p; + + if (pluginName !== expectedName) { + return false; + } + + for (const key of expectedKeys) { + if (pluginOptions[key] !== expectedOptions[key]) { + return false; + } + } + + return true; + } + }); +} +function getPluginOption(plugins, name, option) { + const plugin = plugins.find(plugin => { + if (Array.isArray(plugin)) { + return plugin[0] === name; + } else { + return plugin === name; + } + }); + + if (plugin && Array.isArray(plugin)) { + return plugin[1][option]; + } + + return null; +} +const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"]; +const TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"]; +const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"]; +function validatePlugins(plugins) { + if (hasPlugin(plugins, "decorators")) { + if (hasPlugin(plugins, "decorators-legacy")) { + throw new Error("Cannot use the decorators and decorators-legacy plugin together"); + } + + const decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport"); + + if (decoratorsBeforeExport == null) { + throw new Error("The 'decorators' plugin requires a 'decoratorsBeforeExport' option," + " whose value must be a boolean. If you are migrating from" + " Babylon/Babel 6 or want to use the old decorators proposal, you" + " should use the 'decorators-legacy' plugin instead of 'decorators'."); + } else if (typeof decoratorsBeforeExport !== "boolean") { + throw new Error("'decoratorsBeforeExport' must be a boolean."); + } + } + + if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) { + throw new Error("Cannot combine flow and typescript plugins."); + } + + if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) { + throw new Error("Cannot combine placeholders and v8intrinsic plugins."); + } + + if (hasPlugin(plugins, "pipelineOperator")) { + const proposal = getPluginOption(plugins, "pipelineOperator", "proposal"); + + if (!PIPELINE_PROPOSALS.includes(proposal)) { + const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", "); + throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`); + } + + const tupleSyntaxIsHash = hasPlugin(plugins, ["recordAndTuple", { + syntaxType: "hash" + }]); + + if (proposal === "hack") { + if (hasPlugin(plugins, "placeholders")) { + throw new Error("Cannot combine placeholders plugin and Hack-style pipes."); + } + + if (hasPlugin(plugins, "v8intrinsic")) { + throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes."); + } + + const topicToken = getPluginOption(plugins, "pipelineOperator", "topicToken"); + + if (!TOPIC_TOKENS.includes(topicToken)) { + const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", "); + throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`); + } + + if (topicToken === "#" && tupleSyntaxIsHash) { + throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.'); + } + } else if (proposal === "smart" && tupleSyntaxIsHash) { + throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.'); + } + } + + if (hasPlugin(plugins, "moduleAttributes")) { + { + if (hasPlugin(plugins, "importAssertions")) { + throw new Error("Cannot combine importAssertions and moduleAttributes plugins."); + } + + const moduleAttributesVerionPluginOption = getPluginOption(plugins, "moduleAttributes", "version"); + + if (moduleAttributesVerionPluginOption !== "may-2020") { + throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'."); + } + } + } + + if (hasPlugin(plugins, "recordAndTuple") && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, "recordAndTuple", "syntaxType"))) { + throw new Error("'recordAndTuple' requires 'syntaxType' option whose value should be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", ")); + } + + if (hasPlugin(plugins, "asyncDoExpressions") && !hasPlugin(plugins, "doExpressions")) { + const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins."); + error.missingPlugins = "doExpressions"; + throw error; + } +} +const mixinPlugins = { + estree, + jsx, + flow, + typescript, + v8intrinsic, + placeholders +}; +const mixinPluginNames = Object.keys(mixinPlugins); + +const defaultOptions = { + sourceType: "script", + sourceFilename: undefined, + startColumn: 0, + startLine: 1, + allowAwaitOutsideFunction: false, + allowReturnOutsideFunction: false, + allowImportExportEverywhere: false, + allowSuperOutsideMethod: false, + allowUndeclaredExports: false, + plugins: [], + strictMode: null, + ranges: false, + tokens: false, + createParenthesizedExpressions: false, + errorRecovery: false, + attachComment: true +}; +function getOptions(opts) { + const options = {}; + + for (const key of Object.keys(defaultOptions)) { + options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key]; + } + + return options; +} + +const getOwn = (object, key) => Object.hasOwnProperty.call(object, key) && object[key]; + +const unwrapParenthesizedExpression = node => { + return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node; +}; + +class LValParser extends NodeUtils { + toAssignable(node, isLHS = false) { + var _node$extra, _node$extra3; + + let parenthesized = undefined; + + if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) { + parenthesized = unwrapParenthesizedExpression(node); + + if (isLHS) { + if (parenthesized.type === "Identifier") { + this.expressionScope.recordArrowParemeterBindingError(Errors.InvalidParenthesizedAssignment, { + at: node + }); + } else if (parenthesized.type !== "MemberExpression") { + this.raise(Errors.InvalidParenthesizedAssignment, { + at: node + }); + } + } else { + this.raise(Errors.InvalidParenthesizedAssignment, { + at: node + }); + } + } + + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + break; + + case "ObjectExpression": + node.type = "ObjectPattern"; + + for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) { + var _node$extra2; + + const prop = node.properties[i]; + const isLast = i === last; + this.toAssignableObjectExpressionProp(prop, isLast, isLHS); + + if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) { + this.raise(Errors.RestTrailingComma, { + at: node.extra.trailingCommaLoc + }); + } + } + + break; + + case "ObjectProperty": + { + const { + key, + value + } = node; + + if (this.isPrivateName(key)) { + this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); + } + + this.toAssignable(value, isLHS); + break; + } + + case "SpreadElement": + { + throw new Error("Internal @babel/parser error (this is a bug, please report it)." + " SpreadElement should be converted by .toAssignable's caller."); + } + + case "ArrayExpression": + node.type = "ArrayPattern"; + this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS); + break; + + case "AssignmentExpression": + if (node.operator !== "=") { + this.raise(Errors.MissingEqInAssignment, { + at: node.left.loc.end + }); + } + + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isLHS); + break; + + case "ParenthesizedExpression": + this.toAssignable(parenthesized, isLHS); + break; + } + } + + toAssignableObjectExpressionProp(prop, isLast, isLHS) { + if (prop.type === "ObjectMethod") { + this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, { + at: prop.key + }); + } else if (prop.type === "SpreadElement") { + prop.type = "RestElement"; + const arg = prop.argument; + this.checkToRestConversion(arg, false); + this.toAssignable(arg, isLHS); + + if (!isLast) { + this.raise(Errors.RestTrailingComma, { + at: prop + }); + } + } else { + this.toAssignable(prop, isLHS); + } + } + + toAssignableList(exprList, trailingCommaLoc, isLHS) { + const end = exprList.length - 1; + + for (let i = 0; i <= end; i++) { + const elt = exprList[i]; + if (!elt) continue; + + if (elt.type === "SpreadElement") { + elt.type = "RestElement"; + const arg = elt.argument; + this.checkToRestConversion(arg, true); + this.toAssignable(arg, isLHS); + } else { + this.toAssignable(elt, isLHS); + } + + if (elt.type === "RestElement") { + if (i < end) { + this.raise(Errors.RestTrailingComma, { + at: elt + }); + } else if (trailingCommaLoc) { + this.raise(Errors.RestTrailingComma, { + at: trailingCommaLoc + }); + } + } + } + } + + isAssignable(node, isBinding) { + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + return true; + + case "ObjectExpression": + { + const last = node.properties.length - 1; + return node.properties.every((prop, i) => { + return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop); + }); + } + + case "ObjectProperty": + return this.isAssignable(node.value); + + case "SpreadElement": + return this.isAssignable(node.argument); + + case "ArrayExpression": + return node.elements.every(element => element === null || this.isAssignable(element)); + + case "AssignmentExpression": + return node.operator === "="; + + case "ParenthesizedExpression": + return this.isAssignable(node.expression); + + case "MemberExpression": + case "OptionalMemberExpression": + return !isBinding; + + default: + return false; + } + } + + toReferencedList(exprList, isParenthesizedExpr) { + return exprList; + } + + toReferencedListDeep(exprList, isParenthesizedExpr) { + this.toReferencedList(exprList, isParenthesizedExpr); + + for (const expr of exprList) { + if ((expr == null ? void 0 : expr.type) === "ArrayExpression") { + this.toReferencedListDeep(expr.elements); + } + } + } + + parseSpread(refExpressionErrors, refNeedsArrowPos) { + const node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined, refNeedsArrowPos); + return this.finishNode(node, "SpreadElement"); + } + + parseRestBinding() { + const node = this.startNode(); + this.next(); + node.argument = this.parseBindingAtom(); + return this.finishNode(node, "RestElement"); + } + + parseBindingAtom() { + switch (this.state.type) { + case 0: + { + const node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(3, 93, true); + return this.finishNode(node, "ArrayPattern"); + } + + case 5: + return this.parseObjectLike(8, true); + } + + return this.parseIdentifier(); + } + + parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) { + const elts = []; + let first = true; + + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(12); + } + + if (allowEmpty && this.match(12)) { + elts.push(null); + } else if (this.eat(close)) { + break; + } else if (this.match(21)) { + elts.push(this.parseAssignableListItemTypes(this.parseRestBinding())); + + if (!this.checkCommaAfterRest(closeCharCode)) { + this.expect(close); + break; + } + } else { + const decorators = []; + + if (this.match(26) && this.hasPlugin("decorators")) { + this.raise(Errors.UnsupportedParameterDecorator, { + at: this.state.startLoc + }); + } + + while (this.match(26)) { + decorators.push(this.parseDecorator()); + } + + elts.push(this.parseAssignableListItem(allowModifiers, decorators)); + } + } + + return elts; + } + + parseBindingRestProperty(prop) { + this.next(); + prop.argument = this.parseIdentifier(); + this.checkCommaAfterRest(125); + return this.finishNode(prop, "RestElement"); + } + + parseBindingProperty() { + const prop = this.startNode(); + const { + type, + start: startPos, + startLoc + } = this.state; + + if (type === 21) { + return this.parseBindingRestProperty(prop); + } else if (type === 134) { + this.expectPlugin("destructuringPrivate", startLoc); + this.classScope.usePrivateName(this.state.value, startLoc); + prop.key = this.parsePrivateName(); + } else { + this.parsePropertyName(prop); + } + + prop.method = false; + this.parseObjPropValue(prop, startPos, startLoc, false, false, true, false); + return prop; + } + + parseAssignableListItem(allowModifiers, decorators) { + const left = this.parseMaybeDefault(); + this.parseAssignableListItemTypes(left); + const elt = this.parseMaybeDefault(left.start, left.loc.start, left); + + if (decorators.length) { + left.decorators = decorators; + } + + return elt; + } + + parseAssignableListItemTypes(param) { + return param; + } + + parseMaybeDefault(startPos, startLoc, left) { + var _startLoc, _startPos, _left; + + startLoc = (_startLoc = startLoc) != null ? _startLoc : this.state.startLoc; + startPos = (_startPos = startPos) != null ? _startPos : this.state.start; + left = (_left = left) != null ? _left : this.parseBindingAtom(); + if (!this.eat(29)) return left; + const node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssignAllowIn(); + return this.finishNode(node, "AssignmentPattern"); + } + + isValidLVal(type, isUnparenthesizedInAssign, binding) { + return getOwn({ + AssignmentPattern: "left", + RestElement: "argument", + ObjectProperty: "value", + ParenthesizedExpression: "expression", + ArrayPattern: "elements", + ObjectPattern: "properties" + }, type); + } + + checkLVal(expression, { + in: ancestor, + binding = BIND_NONE, + checkClashes = false, + strictModeChanged = false, + allowingSloppyLetBinding = !(binding & BIND_SCOPE_LEXICAL), + hasParenthesizedAncestor = false + }) { + var _expression$extra; + + const type = expression.type; + if (this.isObjectMethod(expression)) return; + + if (type === "MemberExpression") { + if (binding !== BIND_NONE) { + this.raise(Errors.InvalidPropertyBindingPattern, { + at: expression + }); + } + + return; + } + + if (expression.type === "Identifier") { + this.checkIdentifier(expression, binding, strictModeChanged, allowingSloppyLetBinding); + const { + name + } = expression; + + if (checkClashes) { + if (checkClashes.has(name)) { + this.raise(Errors.ParamDupe, { + at: expression + }); + } else { + checkClashes.add(name); + } + } + + return; + } + + const validity = this.isValidLVal(expression.type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding); + if (validity === true) return; + + if (validity === false) { + const ParseErrorClass = binding === BIND_NONE ? Errors.InvalidLhs : Errors.InvalidLhsBinding; + this.raise(ParseErrorClass, { + at: expression, + ancestor: ancestor.type === "UpdateExpression" ? { + type: "UpdateExpression", + prefix: ancestor.prefix + } : { + type: ancestor.type + } + }); + return; + } + + const [key, isParenthesizedExpression] = Array.isArray(validity) ? validity : [validity, type === "ParenthesizedExpression"]; + const nextAncestor = expression.type === "ArrayPattern" || expression.type === "ObjectPattern" || expression.type === "ParenthesizedExpression" ? expression : ancestor; + + for (const child of [].concat(expression[key])) { + if (child) { + this.checkLVal(child, { + in: nextAncestor, + binding, + checkClashes, + allowingSloppyLetBinding, + strictModeChanged, + hasParenthesizedAncestor: isParenthesizedExpression + }); + } + } + } + + checkIdentifier(at, bindingType, strictModeChanged = false, allowLetBinding = !(bindingType & BIND_SCOPE_LEXICAL)) { + if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) { + if (bindingType === BIND_NONE) { + this.raise(Errors.StrictEvalArguments, { + at, + referenceName: at.name + }); + } else { + this.raise(Errors.StrictEvalArgumentsBinding, { + at, + bindingName: at.name + }); + } + } + + if (!allowLetBinding && at.name === "let") { + this.raise(Errors.LetInLexicalBinding, { + at + }); + } + + if (!(bindingType & BIND_NONE)) { + this.declareNameFromIdentifier(at, bindingType); + } + } + + declareNameFromIdentifier(identifier, binding) { + this.scope.declareName(identifier.name, binding, identifier.loc.start); + } + + checkToRestConversion(node, allowPattern) { + switch (node.type) { + case "ParenthesizedExpression": + this.checkToRestConversion(node.expression, allowPattern); + break; + + case "Identifier": + case "MemberExpression": + break; + + case "ArrayExpression": + case "ObjectExpression": + if (allowPattern) break; + + default: + this.raise(Errors.InvalidRestAssignmentPattern, { + at: node + }); + } + } + + checkCommaAfterRest(close) { + if (!this.match(12)) { + return false; + } + + this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, { + at: this.state.startLoc + }); + return true; + } + +} + +class ExpressionParser extends LValParser { + checkProto(prop, isRecord, protoRef, refExpressionErrors) { + if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) { + return; + } + + const key = prop.key; + const name = key.type === "Identifier" ? key.name : key.value; + + if (name === "__proto__") { + if (isRecord) { + this.raise(Errors.RecordNoProto, { + at: key + }); + return; + } + + if (protoRef.used) { + if (refExpressionErrors) { + if (refExpressionErrors.doubleProtoLoc === null) { + refExpressionErrors.doubleProtoLoc = key.loc.start; + } + } else { + this.raise(Errors.DuplicateProto, { + at: key + }); + } + } + + protoRef.used = true; + } + } + + shouldExitDescending(expr, potentialArrowAt) { + return expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt; + } + + getExpression() { + this.enterInitialScopes(); + this.nextToken(); + const expr = this.parseExpression(); + + if (!this.match(135)) { + this.unexpected(); + } + + this.finalizeRemainingComments(); + expr.comments = this.state.comments; + expr.errors = this.state.errors; + + if (this.options.tokens) { + expr.tokens = this.tokens; + } + + return expr; + } + + parseExpression(disallowIn, refExpressionErrors) { + if (disallowIn) { + return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)); + } + + return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors)); + } + + parseExpressionBase(refExpressionErrors) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const expr = this.parseMaybeAssign(refExpressionErrors); + + if (this.match(12)) { + const node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + + while (this.eat(12)) { + node.expressions.push(this.parseMaybeAssign(refExpressionErrors)); + } + + this.toReferencedList(node.expressions); + return this.finishNode(node, "SequenceExpression"); + } + + return expr; + } + + parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) { + return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); + } + + parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) { + return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); + } + + setOptionalParametersError(refExpressionErrors, resultError) { + var _resultError$loc; + + refExpressionErrors.optionalParametersLoc = (_resultError$loc = resultError == null ? void 0 : resultError.loc) != null ? _resultError$loc : this.state.startLoc; + } + + parseMaybeAssign(refExpressionErrors, afterLeftParse) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + + if (this.isContextual(105)) { + if (this.prodParam.hasYield) { + let left = this.parseYield(); + + if (afterLeftParse) { + left = afterLeftParse.call(this, left, startPos, startLoc); + } + + return left; + } + } + + let ownExpressionErrors; + + if (refExpressionErrors) { + ownExpressionErrors = false; + } else { + refExpressionErrors = new ExpressionErrors(); + ownExpressionErrors = true; + } + + const { + type + } = this.state; + + if (type === 10 || tokenIsIdentifier(type)) { + this.state.potentialArrowAt = this.state.start; + } + + let left = this.parseMaybeConditional(refExpressionErrors); + + if (afterLeftParse) { + left = afterLeftParse.call(this, left, startPos, startLoc); + } + + if (tokenIsAssignment(this.state.type)) { + const node = this.startNodeAt(startPos, startLoc); + const operator = this.state.value; + node.operator = operator; + + if (this.match(29)) { + this.toAssignable(left, true); + node.left = left; + + if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startPos) { + refExpressionErrors.doubleProtoLoc = null; + } + + if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startPos) { + refExpressionErrors.shorthandAssignLoc = null; + } + + if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startPos) { + this.checkDestructuringPrivate(refExpressionErrors); + refExpressionErrors.privateKeyLoc = null; + } + } else { + node.left = left; + } + + this.next(); + node.right = this.parseMaybeAssign(); + this.checkLVal(left, { + in: this.finishNode(node, "AssignmentExpression") + }); + return node; + } else if (ownExpressionErrors) { + this.checkExpressionErrors(refExpressionErrors, true); + } + + return left; + } + + parseMaybeConditional(refExpressionErrors) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const potentialArrowAt = this.state.potentialArrowAt; + const expr = this.parseExprOps(refExpressionErrors); + + if (this.shouldExitDescending(expr, potentialArrowAt)) { + return expr; + } + + return this.parseConditional(expr, startPos, startLoc, refExpressionErrors); + } + + parseConditional(expr, startPos, startLoc, refExpressionErrors) { + if (this.eat(17)) { + const node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssignAllowIn(); + this.expect(14); + node.alternate = this.parseMaybeAssign(); + return this.finishNode(node, "ConditionalExpression"); + } + + return expr; + } + + parseMaybeUnaryOrPrivate(refExpressionErrors) { + return this.match(134) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors); + } + + parseExprOps(refExpressionErrors) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const potentialArrowAt = this.state.potentialArrowAt; + const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors); + + if (this.shouldExitDescending(expr, potentialArrowAt)) { + return expr; + } + + return this.parseExprOp(expr, startPos, startLoc, -1); + } + + parseExprOp(left, leftStartPos, leftStartLoc, minPrec) { + if (this.isPrivateName(left)) { + const value = this.getPrivateNameSV(left); + + if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) { + this.raise(Errors.PrivateInExpectedIn, { + at: left, + identifierName: value + }); + } + + this.classScope.usePrivateName(value, left.loc.start); + } + + const op = this.state.type; + + if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(58))) { + let prec = tokenOperatorPrecedence(op); + + if (prec > minPrec) { + if (op === 39) { + this.expectPlugin("pipelineOperator"); + + if (this.state.inFSharpPipelineDirectBody) { + return left; + } + + this.checkPipelineAtInfixOperator(left, leftStartLoc); + } + + const node = this.startNodeAt(leftStartPos, leftStartLoc); + node.left = left; + node.operator = this.state.value; + const logical = op === 41 || op === 42; + const coalesce = op === 40; + + if (coalesce) { + prec = tokenOperatorPrecedence(42); + } + + this.next(); + + if (op === 39 && this.hasPlugin(["pipelineOperator", { + proposal: "minimal" + }])) { + if (this.state.type === 96 && this.prodParam.hasAwait) { + throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, { + at: this.state.startLoc + }); + } + } + + node.right = this.parseExprOpRightExpr(op, prec); + this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression"); + const nextOp = this.state.type; + + if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) { + throw this.raise(Errors.MixingCoalesceWithLogical, { + at: this.state.startLoc + }); + } + + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec); + } + } + + return left; + } + + parseExprOpRightExpr(op, prec) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + + switch (op) { + case 39: + switch (this.getPluginOption("pipelineOperator", "proposal")) { + case "hack": + return this.withTopicBindingContext(() => { + return this.parseHackPipeBody(); + }); + + case "smart": + return this.withTopicBindingContext(() => { + if (this.prodParam.hasYield && this.isContextual(105)) { + throw this.raise(Errors.PipeBodyIsTighter, { + at: this.state.startLoc + }); + } + + return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startPos, startLoc); + }); + + case "fsharp": + return this.withSoloAwaitPermittingContext(() => { + return this.parseFSharpPipelineBody(prec); + }); + } + + default: + return this.parseExprOpBaseRightExpr(op, prec); + } + } + + parseExprOpBaseRightExpr(op, prec) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startPos, startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec); + } + + parseHackPipeBody() { + var _body$extra; + + const { + startLoc + } = this.state; + const body = this.parseMaybeAssign(); + const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(body.type); + + if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) { + this.raise(Errors.PipeUnparenthesizedBody, { + at: startLoc, + type: body.type + }); + } + + if (!this.topicReferenceWasUsedInCurrentContext()) { + this.raise(Errors.PipeTopicUnused, { + at: startLoc + }); + } + + return body; + } + + checkExponentialAfterUnary(node) { + if (this.match(57)) { + this.raise(Errors.UnexpectedTokenUnaryExponentiation, { + at: node.argument + }); + } + } + + parseMaybeUnary(refExpressionErrors, sawUnary) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const isAwait = this.isContextual(96); + + if (isAwait && this.isAwaitAllowed()) { + this.next(); + const expr = this.parseAwait(startPos, startLoc); + if (!sawUnary) this.checkExponentialAfterUnary(expr); + return expr; + } + + const update = this.match(34); + const node = this.startNode(); + + if (tokenIsPrefix(this.state.type)) { + node.operator = this.state.value; + node.prefix = true; + + if (this.match(72)) { + this.expectPlugin("throwExpressions"); + } + + const isDelete = this.match(89); + this.next(); + node.argument = this.parseMaybeUnary(null, true); + this.checkExpressionErrors(refExpressionErrors, true); + + if (this.state.strict && isDelete) { + const arg = node.argument; + + if (arg.type === "Identifier") { + this.raise(Errors.StrictDelete, { + at: node + }); + } else if (this.hasPropertyAsPrivateName(arg)) { + this.raise(Errors.DeletePrivateField, { + at: node + }); + } + } + + if (!update) { + if (!sawUnary) this.checkExponentialAfterUnary(node); + return this.finishNode(node, "UnaryExpression"); + } + } + + const expr = this.parseUpdate(node, update, refExpressionErrors); + + if (isAwait) { + const { + type + } = this.state; + const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54); + + if (startsExpr && !this.isAmbiguousAwait()) { + this.raiseOverwrite(Errors.AwaitNotInAsyncContext, { + at: startLoc + }); + return this.parseAwait(startPos, startLoc); + } + } + + return expr; + } + + parseUpdate(node, update, refExpressionErrors) { + if (update) { + this.checkLVal(node.argument, { + in: this.finishNode(node, "UpdateExpression") + }); + return node; + } + + const startPos = this.state.start; + const startLoc = this.state.startLoc; + let expr = this.parseExprSubscripts(refExpressionErrors); + if (this.checkExpressionErrors(refExpressionErrors, false)) return expr; + + while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) { + const node = this.startNodeAt(startPos, startLoc); + node.operator = this.state.value; + node.prefix = false; + node.argument = expr; + this.next(); + this.checkLVal(expr, { + in: expr = this.finishNode(node, "UpdateExpression") + }); + } + + return expr; + } + + parseExprSubscripts(refExpressionErrors) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const potentialArrowAt = this.state.potentialArrowAt; + const expr = this.parseExprAtom(refExpressionErrors); + + if (this.shouldExitDescending(expr, potentialArrowAt)) { + return expr; + } + + return this.parseSubscripts(expr, startPos, startLoc); + } + + parseSubscripts(base, startPos, startLoc, noCalls) { + const state = { + optionalChainMember: false, + maybeAsyncArrow: this.atPossibleAsyncArrow(base), + stop: false + }; + + do { + base = this.parseSubscript(base, startPos, startLoc, noCalls, state); + state.maybeAsyncArrow = false; + } while (!state.stop); + + return base; + } + + parseSubscript(base, startPos, startLoc, noCalls, state) { + const { + type + } = this.state; + + if (!noCalls && type === 15) { + return this.parseBind(base, startPos, startLoc, noCalls, state); + } else if (tokenIsTemplate(type)) { + return this.parseTaggedTemplateExpression(base, startPos, startLoc, state); + } + + let optional = false; + + if (type === 18) { + if (noCalls && this.lookaheadCharCode() === 40) { + state.stop = true; + return base; + } + + state.optionalChainMember = optional = true; + this.next(); + } + + if (!noCalls && this.match(10)) { + return this.parseCoverCallAndAsyncArrowHead(base, startPos, startLoc, state, optional); + } else { + const computed = this.eat(0); + + if (computed || optional || this.eat(16)) { + return this.parseMember(base, startPos, startLoc, state, computed, optional); + } else { + state.stop = true; + return base; + } + } + } + + parseMember(base, startPos, startLoc, state, computed, optional) { + const node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.computed = computed; + + if (computed) { + node.property = this.parseExpression(); + this.expect(3); + } else if (this.match(134)) { + if (base.type === "Super") { + this.raise(Errors.SuperPrivateField, { + at: startLoc + }); + } + + this.classScope.usePrivateName(this.state.value, this.state.startLoc); + node.property = this.parsePrivateName(); + } else { + node.property = this.parseIdentifier(true); + } + + if (state.optionalChainMember) { + node.optional = optional; + return this.finishNode(node, "OptionalMemberExpression"); + } else { + return this.finishNode(node, "MemberExpression"); + } + } + + parseBind(base, startPos, startLoc, noCalls, state) { + const node = this.startNodeAt(startPos, startLoc); + node.object = base; + this.next(); + node.callee = this.parseNoCallExpr(); + state.stop = true; + return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls); + } + + parseCoverCallAndAsyncArrowHead(base, startPos, startLoc, state, optional) { + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + let refExpressionErrors = null; + this.state.maybeInArrowParameters = true; + this.next(); + let node = this.startNodeAt(startPos, startLoc); + node.callee = base; + const { + maybeAsyncArrow, + optionalChainMember + } = state; + + if (maybeAsyncArrow) { + this.expressionScope.enter(newAsyncArrowScope()); + refExpressionErrors = new ExpressionErrors(); + } + + if (optionalChainMember) { + node.optional = optional; + } + + if (optional) { + node.arguments = this.parseCallExpressionArguments(11); + } else { + node.arguments = this.parseCallExpressionArguments(11, base.type === "Import", base.type !== "Super", node, refExpressionErrors); + } + + this.finishCallExpression(node, optionalChainMember); + + if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) { + state.stop = true; + this.checkDestructuringPrivate(refExpressionErrors); + this.expressionScope.validateAsPattern(); + this.expressionScope.exit(); + node = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); + } else { + if (maybeAsyncArrow) { + this.checkExpressionErrors(refExpressionErrors, true); + this.expressionScope.exit(); + } + + this.toReferencedArguments(node); + } + + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + return node; + } + + toReferencedArguments(node, isParenthesizedExpr) { + this.toReferencedListDeep(node.arguments, isParenthesizedExpr); + } + + parseTaggedTemplateExpression(base, startPos, startLoc, state) { + const node = this.startNodeAt(startPos, startLoc); + node.tag = base; + node.quasi = this.parseTemplate(true); + + if (state.optionalChainMember) { + this.raise(Errors.OptionalChainingNoTemplate, { + at: startLoc + }); + } + + return this.finishNode(node, "TaggedTemplateExpression"); + } + + atPossibleAsyncArrow(base) { + return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt; + } + + finishCallExpression(node, optional) { + if (node.callee.type === "Import") { + if (node.arguments.length === 2) { + { + if (!this.hasPlugin("moduleAttributes")) { + this.expectPlugin("importAssertions"); + } + } + } + + if (node.arguments.length === 0 || node.arguments.length > 2) { + this.raise(Errors.ImportCallArity, { + at: node, + maxArgumentCount: this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? 2 : 1 + }); + } else { + for (const arg of node.arguments) { + if (arg.type === "SpreadElement") { + this.raise(Errors.ImportCallSpreadArgument, { + at: arg + }); + } + } + } + } + + return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression"); + } + + parseCallExpressionArguments(close, dynamicImport, allowPlaceholder, nodeForExtra, refExpressionErrors) { + const elts = []; + let first = true; + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = false; + + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(12); + + if (this.match(close)) { + if (dynamicImport && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) { + this.raise(Errors.ImportCallArgumentTrailingComma, { + at: this.state.lastTokStartLoc + }); + } + + if (nodeForExtra) { + this.addTrailingCommaExtraToNode(nodeForExtra); + } + + this.next(); + break; + } + } + + elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder)); + } + + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + return elts; + } + + shouldParseAsyncArrow() { + return this.match(19) && !this.canInsertSemicolon(); + } + + parseAsyncArrowFromCallExpression(node, call) { + var _call$extra; + + this.resetPreviousNodeTrailingComments(call); + this.expect(19); + this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingCommaLoc); + + if (call.innerComments) { + setInnerComments(node, call.innerComments); + } + + if (call.callee.trailingComments) { + setInnerComments(node, call.callee.trailingComments); + } + + return node; + } + + parseNoCallExpr() { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); + } + + parseExprAtom(refExpressionErrors) { + let node; + const { + type + } = this.state; + + switch (type) { + case 79: + return this.parseSuper(); + + case 83: + node = this.startNode(); + this.next(); + + if (this.match(16)) { + return this.parseImportMetaProperty(node); + } + + if (!this.match(10)) { + this.raise(Errors.UnsupportedImport, { + at: this.state.lastTokStartLoc + }); + } + + return this.finishNode(node, "Import"); + + case 78: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression"); + + case 90: + { + return this.parseDo(this.startNode(), false); + } + + case 56: + case 31: + { + this.readRegexp(); + return this.parseRegExpLiteral(this.state.value); + } + + case 130: + return this.parseNumericLiteral(this.state.value); + + case 131: + return this.parseBigIntLiteral(this.state.value); + + case 132: + return this.parseDecimalLiteral(this.state.value); + + case 129: + return this.parseStringLiteral(this.state.value); + + case 84: + return this.parseNullLiteral(); + + case 85: + return this.parseBooleanLiteral(true); + + case 86: + return this.parseBooleanLiteral(false); + + case 10: + { + const canBeArrow = this.state.potentialArrowAt === this.state.start; + return this.parseParenAndDistinguishExpression(canBeArrow); + } + + case 2: + case 1: + { + return this.parseArrayLike(this.state.type === 2 ? 4 : 3, false, true); + } + + case 0: + { + return this.parseArrayLike(3, true, false, refExpressionErrors); + } + + case 6: + case 7: + { + return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true); + } + + case 5: + { + return this.parseObjectLike(8, false, false, refExpressionErrors); + } + + case 68: + return this.parseFunctionOrFunctionSent(); + + case 26: + this.parseDecorators(); + + case 80: + node = this.startNode(); + this.takeDecorators(node); + return this.parseClass(node, false); + + case 77: + return this.parseNewOrNewTarget(); + + case 25: + case 24: + return this.parseTemplate(false); + + case 15: + { + node = this.startNode(); + this.next(); + node.object = null; + const callee = node.callee = this.parseNoCallExpr(); + + if (callee.type === "MemberExpression") { + return this.finishNode(node, "BindExpression"); + } else { + throw this.raise(Errors.UnsupportedBind, { + at: callee + }); + } + } + + case 134: + { + this.raise(Errors.PrivateInExpectedIn, { + at: this.state.startLoc, + identifierName: this.state.value + }); + return this.parsePrivateName(); + } + + case 33: + { + return this.parseTopicReferenceThenEqualsSign(54, "%"); + } + + case 32: + { + return this.parseTopicReferenceThenEqualsSign(44, "^"); + } + + case 37: + case 38: + { + return this.parseTopicReference("hack"); + } + + case 44: + case 54: + case 27: + { + const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); + + if (pipeProposal) { + return this.parseTopicReference(pipeProposal); + } else { + throw this.unexpected(); + } + } + + case 47: + { + const lookaheadCh = this.input.codePointAt(this.nextTokenStart()); + + if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) { + this.expectOnePlugin(["jsx", "flow", "typescript"]); + break; + } else { + throw this.unexpected(); + } + } + + default: + if (tokenIsIdentifier(type)) { + if (this.isContextual(123) && this.lookaheadCharCode() === 123 && !this.hasFollowingLineBreak()) { + return this.parseModuleExpression(); + } + + const canBeArrow = this.state.potentialArrowAt === this.state.start; + const containsEsc = this.state.containsEsc; + const id = this.parseIdentifier(); + + if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) { + const { + type + } = this.state; + + if (type === 68) { + this.resetPreviousNodeTrailingComments(id); + this.next(); + return this.parseFunction(this.startNodeAtNode(id), undefined, true); + } else if (tokenIsIdentifier(type)) { + if (this.lookaheadCharCode() === 61) { + return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id)); + } else { + return id; + } + } else if (type === 90) { + this.resetPreviousNodeTrailingComments(id); + return this.parseDo(this.startNodeAtNode(id), true); + } + } + + if (canBeArrow && this.match(19) && !this.canInsertSemicolon()) { + this.next(); + return this.parseArrowExpression(this.startNodeAtNode(id), [id], false); + } + + return id; + } else { + throw this.unexpected(); + } + + } + } + + parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) { + const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); + + if (pipeProposal) { + this.state.type = topicTokenType; + this.state.value = topicTokenValue; + this.state.pos--; + this.state.end--; + this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1); + return this.parseTopicReference(pipeProposal); + } else { + throw this.unexpected(); + } + } + + parseTopicReference(pipeProposal) { + const node = this.startNode(); + const startLoc = this.state.startLoc; + const tokenType = this.state.type; + this.next(); + return this.finishTopicReference(node, startLoc, pipeProposal, tokenType); + } + + finishTopicReference(node, startLoc, pipeProposal, tokenType) { + if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) { + const nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" : "TopicReference"; + + if (!this.topicReferenceIsAllowedInCurrentContext()) { + this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound, { + at: startLoc + }); + } + + this.registerTopicReference(); + return this.finishNode(node, nodeType); + } else { + throw this.raise(Errors.PipeTopicUnconfiguredToken, { + at: startLoc, + token: tokenLabelName(tokenType) + }); + } + } + + testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) { + switch (pipeProposal) { + case "hack": + { + return this.hasPlugin(["pipelineOperator", { + topicToken: tokenLabelName(tokenType) + }]); + } + + case "smart": + return tokenType === 27; + + default: + throw this.raise(Errors.PipeTopicRequiresHackPipes, { + at: startLoc + }); + } + } + + parseAsyncArrowUnaryFunction(node) { + this.prodParam.enter(functionFlags(true, this.prodParam.hasYield)); + const params = [this.parseIdentifier()]; + this.prodParam.exit(); + + if (this.hasPrecedingLineBreak()) { + this.raise(Errors.LineTerminatorBeforeArrow, { + at: this.state.curPosition() + }); + } + + this.expect(19); + this.parseArrowExpression(node, params, true); + return node; + } + + parseDo(node, isAsync) { + this.expectPlugin("doExpressions"); + + if (isAsync) { + this.expectPlugin("asyncDoExpressions"); + } + + node.async = isAsync; + this.next(); + const oldLabels = this.state.labels; + this.state.labels = []; + + if (isAsync) { + this.prodParam.enter(PARAM_AWAIT); + node.body = this.parseBlock(); + this.prodParam.exit(); + } else { + node.body = this.parseBlock(); + } + + this.state.labels = oldLabels; + return this.finishNode(node, "DoExpression"); + } + + parseSuper() { + const node = this.startNode(); + this.next(); + + if (this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) { + this.raise(Errors.SuperNotAllowed, { + at: node + }); + } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) { + this.raise(Errors.UnexpectedSuper, { + at: node + }); + } + + if (!this.match(10) && !this.match(0) && !this.match(16)) { + this.raise(Errors.UnsupportedSuper, { + at: node + }); + } + + return this.finishNode(node, "Super"); + } + + parsePrivateName() { + const node = this.startNode(); + const id = this.startNodeAt(this.state.start + 1, new Position(this.state.curLine, this.state.start + 1 - this.state.lineStart, this.state.start + 1)); + const name = this.state.value; + this.next(); + node.id = this.createIdentifier(id, name); + return this.finishNode(node, "PrivateName"); + } + + parseFunctionOrFunctionSent() { + const node = this.startNode(); + this.next(); + + if (this.prodParam.hasYield && this.match(16)) { + const meta = this.createIdentifier(this.startNodeAtNode(node), "function"); + this.next(); + + if (this.match(102)) { + this.expectPlugin("functionSent"); + } else if (!this.hasPlugin("functionSent")) { + this.unexpected(); + } + + return this.parseMetaProperty(node, meta, "sent"); + } + + return this.parseFunction(node); + } + + parseMetaProperty(node, meta, propertyName) { + node.meta = meta; + const containsEsc = this.state.containsEsc; + node.property = this.parseIdentifier(true); + + if (node.property.name !== propertyName || containsEsc) { + this.raise(Errors.UnsupportedMetaProperty, { + at: node.property, + target: meta.name, + onlyValidPropertyName: propertyName + }); + } + + return this.finishNode(node, "MetaProperty"); + } + + parseImportMetaProperty(node) { + const id = this.createIdentifier(this.startNodeAtNode(node), "import"); + this.next(); + + if (this.isContextual(100)) { + if (!this.inModule) { + this.raise(Errors.ImportMetaOutsideModule, { + at: id + }); + } + + this.sawUnambiguousESM = true; + } + + return this.parseMetaProperty(node, id, "meta"); + } + + parseLiteralAtNode(value, type, node) { + this.addExtra(node, "rawValue", value); + this.addExtra(node, "raw", this.input.slice(node.start, this.state.end)); + node.value = value; + this.next(); + return this.finishNode(node, type); + } + + parseLiteral(value, type) { + const node = this.startNode(); + return this.parseLiteralAtNode(value, type, node); + } + + parseStringLiteral(value) { + return this.parseLiteral(value, "StringLiteral"); + } + + parseNumericLiteral(value) { + return this.parseLiteral(value, "NumericLiteral"); + } + + parseBigIntLiteral(value) { + return this.parseLiteral(value, "BigIntLiteral"); + } + + parseDecimalLiteral(value) { + return this.parseLiteral(value, "DecimalLiteral"); + } + + parseRegExpLiteral(value) { + const node = this.parseLiteral(value.value, "RegExpLiteral"); + node.pattern = value.pattern; + node.flags = value.flags; + return node; + } + + parseBooleanLiteral(value) { + const node = this.startNode(); + node.value = value; + this.next(); + return this.finishNode(node, "BooleanLiteral"); + } + + parseNullLiteral() { + const node = this.startNode(); + this.next(); + return this.finishNode(node, "NullLiteral"); + } + + parseParenAndDistinguishExpression(canBeArrow) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + let val; + this.next(); + this.expressionScope.enter(newArrowHeadScope()); + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.maybeInArrowParameters = true; + this.state.inFSharpPipelineDirectBody = false; + const innerStartPos = this.state.start; + const innerStartLoc = this.state.startLoc; + const exprList = []; + const refExpressionErrors = new ExpressionErrors(); + let first = true; + let spreadStartLoc; + let optionalCommaStartLoc; + + while (!this.match(11)) { + if (first) { + first = false; + } else { + this.expect(12, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc); + + if (this.match(11)) { + optionalCommaStartLoc = this.state.startLoc; + break; + } + } + + if (this.match(21)) { + const spreadNodeStartPos = this.state.start; + const spreadNodeStartLoc = this.state.startLoc; + spreadStartLoc = this.state.startLoc; + exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartPos, spreadNodeStartLoc)); + + if (!this.checkCommaAfterRest(41)) { + break; + } + } else { + exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem)); + } + } + + const innerEndLoc = this.state.lastTokEndLoc; + this.expect(11); + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + let arrowNode = this.startNodeAt(startPos, startLoc); + + if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) { + this.checkDestructuringPrivate(refExpressionErrors); + this.expressionScope.validateAsPattern(); + this.expressionScope.exit(); + this.parseArrowExpression(arrowNode, exprList, false); + return arrowNode; + } + + this.expressionScope.exit(); + + if (!exprList.length) { + this.unexpected(this.state.lastTokStartLoc); + } + + if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc); + if (spreadStartLoc) this.unexpected(spreadStartLoc); + this.checkExpressionErrors(refExpressionErrors, true); + this.toReferencedListDeep(exprList, true); + + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNode(val, "SequenceExpression"); + this.resetEndLocation(val, innerEndLoc); + } else { + val = exprList[0]; + } + + return this.wrapParenthesis(startPos, startLoc, val); + } + + wrapParenthesis(startPos, startLoc, expression) { + if (!this.options.createParenthesizedExpressions) { + this.addExtra(expression, "parenthesized", true); + this.addExtra(expression, "parenStart", startPos); + this.takeSurroundingComments(expression, startPos, this.state.lastTokEndLoc.index); + return expression; + } + + const parenExpression = this.startNodeAt(startPos, startLoc); + parenExpression.expression = expression; + this.finishNode(parenExpression, "ParenthesizedExpression"); + return parenExpression; + } + + shouldParseArrow(params) { + return !this.canInsertSemicolon(); + } + + parseArrow(node) { + if (this.eat(19)) { + return node; + } + } + + parseParenItem(node, startPos, startLoc) { + return node; + } + + parseNewOrNewTarget() { + const node = this.startNode(); + this.next(); + + if (this.match(16)) { + const meta = this.createIdentifier(this.startNodeAtNode(node), "new"); + this.next(); + const metaProp = this.parseMetaProperty(node, meta, "target"); + + if (!this.scope.inNonArrowFunction && !this.scope.inClass) { + this.raise(Errors.UnexpectedNewTarget, { + at: metaProp + }); + } + + return metaProp; + } + + return this.parseNew(node); + } + + parseNew(node) { + node.callee = this.parseNoCallExpr(); + + if (node.callee.type === "Import") { + this.raise(Errors.ImportCallNotNewExpression, { + at: node.callee + }); + } else if (this.isOptionalChain(node.callee)) { + this.raise(Errors.OptionalChainingNoNew, { + at: this.state.lastTokEndLoc + }); + } else if (this.eat(18)) { + this.raise(Errors.OptionalChainingNoNew, { + at: this.state.startLoc + }); + } + + this.parseNewArguments(node); + return this.finishNode(node, "NewExpression"); + } + + parseNewArguments(node) { + if (this.eat(10)) { + const args = this.parseExprList(11); + this.toReferencedList(args); + node.arguments = args; + } else { + node.arguments = []; + } + } + + parseTemplateElement(isTagged) { + const { + start, + startLoc, + end, + value + } = this.state; + const elemStart = start + 1; + const elem = this.startNodeAt(elemStart, createPositionWithColumnOffset(startLoc, 1)); + + if (value === null) { + if (!isTagged) { + this.raise(Errors.InvalidEscapeSequenceTemplate, { + at: createPositionWithColumnOffset(startLoc, 2) + }); + } + } + + const isTail = this.match(24); + const endOffset = isTail ? -1 : -2; + const elemEnd = end + endOffset; + elem.value = { + raw: this.input.slice(elemStart, elemEnd).replace(/\r\n?/g, "\n"), + cooked: value === null ? null : value.slice(1, endOffset) + }; + elem.tail = isTail; + this.next(); + this.finishNode(elem, "TemplateElement"); + this.resetEndLocation(elem, createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset)); + return elem; + } + + parseTemplate(isTagged) { + const node = this.startNode(); + node.expressions = []; + let curElt = this.parseTemplateElement(isTagged); + node.quasis = [curElt]; + + while (!curElt.tail) { + node.expressions.push(this.parseTemplateSubstitution()); + this.readTemplateContinuation(); + node.quasis.push(curElt = this.parseTemplateElement(isTagged)); + } + + return this.finishNode(node, "TemplateLiteral"); + } + + parseTemplateSubstitution() { + return this.parseExpression(); + } + + parseObjectLike(close, isPattern, isRecord, refExpressionErrors) { + if (isRecord) { + this.expectPlugin("recordAndTuple"); + } + + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = false; + const propHash = Object.create(null); + let first = true; + const node = this.startNode(); + node.properties = []; + this.next(); + + while (!this.match(close)) { + if (first) { + first = false; + } else { + this.expect(12); + + if (this.match(close)) { + this.addTrailingCommaExtraToNode(node); + break; + } + } + + let prop; + + if (isPattern) { + prop = this.parseBindingProperty(); + } else { + prop = this.parsePropertyDefinition(refExpressionErrors); + this.checkProto(prop, isRecord, propHash, refExpressionErrors); + } + + if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") { + this.raise(Errors.InvalidRecordProperty, { + at: prop + }); + } + + if (prop.shorthand) { + this.addExtra(prop, "shorthand", true); + } + + node.properties.push(prop); + } + + this.next(); + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + let type = "ObjectExpression"; + + if (isPattern) { + type = "ObjectPattern"; + } else if (isRecord) { + type = "RecordExpression"; + } + + return this.finishNode(node, type); + } + + addTrailingCommaExtraToNode(node) { + this.addExtra(node, "trailingComma", this.state.lastTokStart); + this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false); + } + + maybeAsyncOrAccessorProp(prop) { + return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(55)); + } + + parsePropertyDefinition(refExpressionErrors) { + let decorators = []; + + if (this.match(26)) { + if (this.hasPlugin("decorators")) { + this.raise(Errors.UnsupportedPropertyDecorator, { + at: this.state.startLoc + }); + } + + while (this.match(26)) { + decorators.push(this.parseDecorator()); + } + } + + const prop = this.startNode(); + let isAsync = false; + let isAccessor = false; + let startPos; + let startLoc; + + if (this.match(21)) { + if (decorators.length) this.unexpected(); + return this.parseSpread(); + } + + if (decorators.length) { + prop.decorators = decorators; + decorators = []; + } + + prop.method = false; + + if (refExpressionErrors) { + startPos = this.state.start; + startLoc = this.state.startLoc; + } + + let isGenerator = this.eat(55); + this.parsePropertyNamePrefixOperator(prop); + const containsEsc = this.state.containsEsc; + const key = this.parsePropertyName(prop, refExpressionErrors); + + if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) { + const keyName = key.name; + + if (keyName === "async" && !this.hasPrecedingLineBreak()) { + isAsync = true; + this.resetPreviousNodeTrailingComments(key); + isGenerator = this.eat(55); + this.parsePropertyName(prop); + } + + if (keyName === "get" || keyName === "set") { + isAccessor = true; + this.resetPreviousNodeTrailingComments(key); + prop.kind = keyName; + + if (this.match(55)) { + isGenerator = true; + this.raise(Errors.AccessorIsGenerator, { + at: this.state.curPosition(), + kind: keyName + }); + this.next(); + } + + this.parsePropertyName(prop); + } + } + + this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, false, isAccessor, refExpressionErrors); + return prop; + } + + getGetterSetterExpectedParamCount(method) { + return method.kind === "get" ? 0 : 1; + } + + getObjectOrClassMethodParams(method) { + return method.params; + } + + checkGetterSetterParams(method) { + var _params; + + const paramCount = this.getGetterSetterExpectedParamCount(method); + const params = this.getObjectOrClassMethodParams(method); + + if (params.length !== paramCount) { + this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, { + at: method + }); + } + + if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") { + this.raise(Errors.BadSetterRestParameter, { + at: method + }); + } + } + + parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { + if (isAccessor) { + this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod"); + this.checkGetterSetterParams(prop); + return prop; + } + + if (isAsync || isGenerator || this.match(10)) { + if (isPattern) this.unexpected(); + prop.kind = "method"; + prop.method = true; + return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod"); + } + } + + parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) { + prop.shorthand = false; + + if (this.eat(14)) { + prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors); + return this.finishNode(prop, "ObjectProperty"); + } + + if (!prop.computed && prop.key.type === "Identifier") { + this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false); + + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, cloneIdentifier(prop.key)); + } else if (this.match(29)) { + const shorthandAssignLoc = this.state.startLoc; + + if (refExpressionErrors != null) { + if (refExpressionErrors.shorthandAssignLoc === null) { + refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc; + } + } else { + this.raise(Errors.InvalidCoverInitializedName, { + at: shorthandAssignLoc + }); + } + + prop.value = this.parseMaybeDefault(startPos, startLoc, cloneIdentifier(prop.key)); + } else { + prop.value = cloneIdentifier(prop.key); + } + + prop.shorthand = true; + return this.finishNode(prop, "ObjectProperty"); + } + } + + parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { + const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors); + if (!node) this.unexpected(); + return node; + } + + parsePropertyName(prop, refExpressionErrors) { + if (this.eat(0)) { + prop.computed = true; + prop.key = this.parseMaybeAssignAllowIn(); + this.expect(3); + } else { + const { + type, + value + } = this.state; + let key; + + if (tokenIsKeywordOrIdentifier(type)) { + key = this.parseIdentifier(true); + } else { + switch (type) { + case 130: + key = this.parseNumericLiteral(value); + break; + + case 129: + key = this.parseStringLiteral(value); + break; + + case 131: + key = this.parseBigIntLiteral(value); + break; + + case 132: + key = this.parseDecimalLiteral(value); + break; + + case 134: + { + const privateKeyLoc = this.state.startLoc; + + if (refExpressionErrors != null) { + if (refExpressionErrors.privateKeyLoc === null) { + refExpressionErrors.privateKeyLoc = privateKeyLoc; + } + } else { + this.raise(Errors.UnexpectedPrivateField, { + at: privateKeyLoc + }); + } + + key = this.parsePrivateName(); + break; + } + + default: + throw this.unexpected(); + } + } + + prop.key = key; + + if (type !== 134) { + prop.computed = false; + } + } + + return prop.key; + } + + initFunction(node, isAsync) { + node.id = null; + node.generator = false; + node.async = !!isAsync; + } + + parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { + this.initFunction(node, isAsync); + node.generator = !!isGenerator; + const allowModifiers = isConstructor; + this.scope.enter(SCOPE_FUNCTION | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); + this.prodParam.enter(functionFlags(isAsync, node.generator)); + this.parseFunctionParams(node, allowModifiers); + this.parseFunctionBodyAndFinish(node, type, true); + this.prodParam.exit(); + this.scope.exit(); + return node; + } + + parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { + if (isTuple) { + this.expectPlugin("recordAndTuple"); + } + + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = false; + const node = this.startNode(); + this.next(); + node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node); + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression"); + } + + parseArrowExpression(node, params, isAsync, trailingCommaLoc) { + this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW); + let flags = functionFlags(isAsync, false); + + if (!this.match(5) && this.prodParam.hasIn) { + flags |= PARAM_IN; + } + + this.prodParam.enter(flags); + this.initFunction(node, isAsync); + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + + if (params) { + this.state.maybeInArrowParameters = true; + this.setArrowFunctionParameters(node, params, trailingCommaLoc); + } + + this.state.maybeInArrowParameters = false; + this.parseFunctionBody(node, true); + this.prodParam.exit(); + this.scope.exit(); + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + return this.finishNode(node, "ArrowFunctionExpression"); + } + + setArrowFunctionParameters(node, params, trailingCommaLoc) { + this.toAssignableList(params, trailingCommaLoc, false); + node.params = params; + } + + parseFunctionBodyAndFinish(node, type, isMethod = false) { + this.parseFunctionBody(node, false, isMethod); + this.finishNode(node, type); + } + + parseFunctionBody(node, allowExpression, isMethod = false) { + const isExpression = allowExpression && !this.match(5); + this.expressionScope.enter(newExpressionScope()); + + if (isExpression) { + node.body = this.parseMaybeAssign(); + this.checkParams(node, false, allowExpression, false); + } else { + const oldStrict = this.state.strict; + const oldLabels = this.state.labels; + this.state.labels = []; + this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN); + node.body = this.parseBlock(true, false, hasStrictModeDirective => { + const nonSimple = !this.isSimpleParamList(node.params); + + if (hasStrictModeDirective && nonSimple) { + this.raise(Errors.IllegalLanguageModeDirective, { + at: (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node + }); + } + + const strictModeChanged = !oldStrict && this.state.strict; + this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged); + + if (this.state.strict && node.id) { + this.checkIdentifier(node.id, BIND_OUTSIDE, strictModeChanged); + } + }); + this.prodParam.exit(); + this.state.labels = oldLabels; + } + + this.expressionScope.exit(); + } + + isSimpleParameter(node) { + return node.type === "Identifier"; + } + + isSimpleParamList(params) { + for (let i = 0, len = params.length; i < len; i++) { + if (!this.isSimpleParameter(params[i])) return false; + } + + return true; + } + + checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { + const checkClashes = !allowDuplicates && new Set(); + const formalParameters = { + type: "FormalParameters" + }; + + for (const param of node.params) { + this.checkLVal(param, { + in: formalParameters, + binding: BIND_VAR, + checkClashes, + strictModeChanged + }); + } + } + + parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) { + const elts = []; + let first = true; + + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(12); + + if (this.match(close)) { + if (nodeForExtra) { + this.addTrailingCommaExtraToNode(nodeForExtra); + } + + this.next(); + break; + } + } + + elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors)); + } + + return elts; + } + + parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) { + let elt; + + if (this.match(12)) { + if (!allowEmpty) { + this.raise(Errors.UnexpectedToken, { + at: this.state.curPosition(), + unexpected: "," + }); + } + + elt = null; + } else if (this.match(21)) { + const spreadNodeStartPos = this.state.start; + const spreadNodeStartLoc = this.state.startLoc; + elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartPos, spreadNodeStartLoc); + } else if (this.match(17)) { + this.expectPlugin("partialApplication"); + + if (!allowPlaceholder) { + this.raise(Errors.UnexpectedArgumentPlaceholder, { + at: this.state.startLoc + }); + } + + const node = this.startNode(); + this.next(); + elt = this.finishNode(node, "ArgumentPlaceholder"); + } else { + elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem); + } + + return elt; + } + + parseIdentifier(liberal) { + const node = this.startNode(); + const name = this.parseIdentifierName(node.start, liberal); + return this.createIdentifier(node, name); + } + + createIdentifier(node, name) { + node.name = name; + node.loc.identifierName = name; + return this.finishNode(node, "Identifier"); + } + + parseIdentifierName(pos, liberal) { + let name; + const { + startLoc, + type + } = this.state; + + if (tokenIsKeywordOrIdentifier(type)) { + name = this.state.value; + } else { + throw this.unexpected(); + } + + const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type); + + if (liberal) { + if (tokenIsKeyword) { + this.replaceToken(128); + } + } else { + this.checkReservedWord(name, startLoc, tokenIsKeyword, false); + } + + this.next(); + return name; + } + + checkReservedWord(word, startLoc, checkKeywords, isBinding) { + if (word.length > 10) { + return; + } + + if (!canBeReservedWord(word)) { + return; + } + + if (word === "yield") { + if (this.prodParam.hasYield) { + this.raise(Errors.YieldBindingIdentifier, { + at: startLoc + }); + return; + } + } else if (word === "await") { + if (this.prodParam.hasAwait) { + this.raise(Errors.AwaitBindingIdentifier, { + at: startLoc + }); + return; + } + + if (this.scope.inStaticBlock) { + this.raise(Errors.AwaitBindingIdentifierInStaticBlock, { + at: startLoc + }); + return; + } + + this.expressionScope.recordAsyncArrowParametersError({ + at: startLoc + }); + } else if (word === "arguments") { + if (this.scope.inClassAndNotInNonArrowFunction) { + this.raise(Errors.ArgumentsInClass, { + at: startLoc + }); + return; + } + } + + if (checkKeywords && isKeyword(word)) { + this.raise(Errors.UnexpectedKeyword, { + at: startLoc, + keyword: word + }); + return; + } + + const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord; + + if (reservedTest(word, this.inModule)) { + this.raise(Errors.UnexpectedReservedWord, { + at: startLoc, + reservedWord: word + }); + } + } + + isAwaitAllowed() { + if (this.prodParam.hasAwait) return true; + + if (this.options.allowAwaitOutsideFunction && !this.scope.inFunction) { + return true; + } + + return false; + } + + parseAwait(startPos, startLoc) { + const node = this.startNodeAt(startPos, startLoc); + this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, { + at: node + }); + + if (this.eat(55)) { + this.raise(Errors.ObsoleteAwaitStar, { + at: node + }); + } + + if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) { + if (this.isAmbiguousAwait()) { + this.ambiguousScriptDifferentAst = true; + } else { + this.sawUnambiguousESM = true; + } + } + + if (!this.state.soloAwait) { + node.argument = this.parseMaybeUnary(null, true); + } + + return this.finishNode(node, "AwaitExpression"); + } + + isAmbiguousAwait() { + if (this.hasPrecedingLineBreak()) return true; + const { + type + } = this.state; + return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 133 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54; + } + + parseYield() { + const node = this.startNode(); + this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, { + at: node + }); + this.next(); + let delegating = false; + let argument = null; + + if (!this.hasPrecedingLineBreak()) { + delegating = this.eat(55); + + switch (this.state.type) { + case 13: + case 135: + case 8: + case 11: + case 3: + case 9: + case 14: + case 12: + if (!delegating) break; + + default: + argument = this.parseMaybeAssign(); + } + } + + node.delegate = delegating; + node.argument = argument; + return this.finishNode(node, "YieldExpression"); + } + + checkPipelineAtInfixOperator(left, leftStartLoc) { + if (this.hasPlugin(["pipelineOperator", { + proposal: "smart" + }])) { + if (left.type === "SequenceExpression") { + this.raise(Errors.PipelineHeadSequenceExpression, { + at: leftStartLoc + }); + } + } + } + + parseSmartPipelineBodyInStyle(childExpr, startPos, startLoc) { + const bodyNode = this.startNodeAt(startPos, startLoc); + + if (this.isSimpleReference(childExpr)) { + bodyNode.callee = childExpr; + return this.finishNode(bodyNode, "PipelineBareFunction"); + } else { + this.checkSmartPipeTopicBodyEarlyErrors(startLoc); + bodyNode.expression = childExpr; + return this.finishNode(bodyNode, "PipelineTopicExpression"); + } + } + + isSimpleReference(expression) { + switch (expression.type) { + case "MemberExpression": + return !expression.computed && this.isSimpleReference(expression.object); + + case "Identifier": + return true; + + default: + return false; + } + } + + checkSmartPipeTopicBodyEarlyErrors(startLoc) { + if (this.match(19)) { + throw this.raise(Errors.PipelineBodyNoArrow, { + at: this.state.startLoc + }); + } + + if (!this.topicReferenceWasUsedInCurrentContext()) { + this.raise(Errors.PipelineTopicUnused, { + at: startLoc + }); + } + } + + withTopicBindingContext(callback) { + const outerContextTopicState = this.state.topicContext; + this.state.topicContext = { + maxNumOfResolvableTopics: 1, + maxTopicIndex: null + }; + + try { + return callback(); + } finally { + this.state.topicContext = outerContextTopicState; + } + } + + withSmartMixTopicForbiddingContext(callback) { + if (this.hasPlugin(["pipelineOperator", { + proposal: "smart" + }])) { + const outerContextTopicState = this.state.topicContext; + this.state.topicContext = { + maxNumOfResolvableTopics: 0, + maxTopicIndex: null + }; + + try { + return callback(); + } finally { + this.state.topicContext = outerContextTopicState; + } + } else { + return callback(); + } + } + + withSoloAwaitPermittingContext(callback) { + const outerContextSoloAwaitState = this.state.soloAwait; + this.state.soloAwait = true; + + try { + return callback(); + } finally { + this.state.soloAwait = outerContextSoloAwaitState; + } + } + + allowInAnd(callback) { + const flags = this.prodParam.currentFlags(); + const prodParamToSet = PARAM_IN & ~flags; + + if (prodParamToSet) { + this.prodParam.enter(flags | PARAM_IN); + + try { + return callback(); + } finally { + this.prodParam.exit(); + } + } + + return callback(); + } + + disallowInAnd(callback) { + const flags = this.prodParam.currentFlags(); + const prodParamToClear = PARAM_IN & flags; + + if (prodParamToClear) { + this.prodParam.enter(flags & ~PARAM_IN); + + try { + return callback(); + } finally { + this.prodParam.exit(); + } + } + + return callback(); + } + + registerTopicReference() { + this.state.topicContext.maxTopicIndex = 0; + } + + topicReferenceIsAllowedInCurrentContext() { + return this.state.topicContext.maxNumOfResolvableTopics >= 1; + } + + topicReferenceWasUsedInCurrentContext() { + return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0; + } + + parseFSharpPipelineBody(prec) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + this.state.potentialArrowAt = this.state.start; + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = true; + const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startPos, startLoc, prec); + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + return ret; + } + + parseModuleExpression() { + this.expectPlugin("moduleBlocks"); + const node = this.startNode(); + this.next(); + this.eat(5); + const revertScopes = this.initializeScopes(true); + this.enterInitialScopes(); + const program = this.startNode(); + + try { + node.body = this.parseProgram(program, 8, "module"); + } finally { + revertScopes(); + } + + this.eat(8); + return this.finishNode(node, "ModuleExpression"); + } + + parsePropertyNamePrefixOperator(prop) {} + +} + +const loopLabel = { + kind: "loop" +}, + switchLabel = { + kind: "switch" +}; +const FUNC_NO_FLAGS = 0b000, + FUNC_STATEMENT = 0b001, + FUNC_HANGING_STATEMENT = 0b010, + FUNC_NULLABLE_ID = 0b100; +const loneSurrogate = /[\uD800-\uDFFF]/u; +const keywordRelationalOperator = /in(?:stanceof)?/y; + +function babel7CompatTokens(tokens, input) { + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + const { + type + } = token; + + if (typeof type === "number") { + { + if (type === 134) { + const { + loc, + start, + value, + end + } = token; + const hashEndPos = start + 1; + const hashEndLoc = createPositionWithColumnOffset(loc.start, 1); + tokens.splice(i, 1, new Token({ + type: getExportedToken(27), + value: "#", + start: start, + end: hashEndPos, + startLoc: loc.start, + endLoc: hashEndLoc + }), new Token({ + type: getExportedToken(128), + value: value, + start: hashEndPos, + end: end, + startLoc: hashEndLoc, + endLoc: loc.end + })); + i++; + continue; + } + + if (tokenIsTemplate(type)) { + const { + loc, + start, + value, + end + } = token; + const backquoteEnd = start + 1; + const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1); + let startToken; + + if (input.charCodeAt(start) === 96) { + startToken = new Token({ + type: getExportedToken(22), + value: "`", + start: start, + end: backquoteEnd, + startLoc: loc.start, + endLoc: backquoteEndLoc + }); + } else { + startToken = new Token({ + type: getExportedToken(8), + value: "}", + start: start, + end: backquoteEnd, + startLoc: loc.start, + endLoc: backquoteEndLoc + }); + } + + let templateValue, templateElementEnd, templateElementEndLoc, endToken; + + if (type === 24) { + templateElementEnd = end - 1; + templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1); + templateValue = value === null ? null : value.slice(1, -1); + endToken = new Token({ + type: getExportedToken(22), + value: "`", + start: templateElementEnd, + end: end, + startLoc: templateElementEndLoc, + endLoc: loc.end + }); + } else { + templateElementEnd = end - 2; + templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2); + templateValue = value === null ? null : value.slice(1, -2); + endToken = new Token({ + type: getExportedToken(23), + value: "${", + start: templateElementEnd, + end: end, + startLoc: templateElementEndLoc, + endLoc: loc.end + }); + } + + tokens.splice(i, 1, startToken, new Token({ + type: getExportedToken(20), + value: templateValue, + start: backquoteEnd, + end: templateElementEnd, + startLoc: backquoteEndLoc, + endLoc: templateElementEndLoc + }), endToken); + i += 2; + continue; + } + } + token.type = getExportedToken(type); + } + } + + return tokens; +} + +class StatementParser extends ExpressionParser { + parseTopLevel(file, program) { + file.program = this.parseProgram(program); + file.comments = this.state.comments; + + if (this.options.tokens) { + file.tokens = babel7CompatTokens(this.tokens, this.input); + } + + return this.finishNode(file, "File"); + } + + parseProgram(program, end = 135, sourceType = this.options.sourceType) { + program.sourceType = sourceType; + program.interpreter = this.parseInterpreterDirective(); + this.parseBlockBody(program, true, true, end); + + if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) { + for (const [localName, at] of Array.from(this.scope.undefinedExports)) { + this.raise(Errors.ModuleExportUndefined, { + at, + localName + }); + } + } + + return this.finishNode(program, "Program"); + } + + stmtToDirective(stmt) { + const directive = stmt; + directive.type = "Directive"; + directive.value = directive.expression; + delete directive.expression; + const directiveLiteral = directive.value; + const expressionValue = directiveLiteral.value; + const raw = this.input.slice(directiveLiteral.start, directiveLiteral.end); + const val = directiveLiteral.value = raw.slice(1, -1); + this.addExtra(directiveLiteral, "raw", raw); + this.addExtra(directiveLiteral, "rawValue", val); + this.addExtra(directiveLiteral, "expressionValue", expressionValue); + directiveLiteral.type = "DirectiveLiteral"; + return directive; + } + + parseInterpreterDirective() { + if (!this.match(28)) { + return null; + } + + const node = this.startNode(); + node.value = this.state.value; + this.next(); + return this.finishNode(node, "InterpreterDirective"); + } + + isLet(context) { + if (!this.isContextual(99)) { + return false; + } + + return this.isLetKeyword(context); + } + + isLetKeyword(context) { + const next = this.nextTokenStart(); + const nextCh = this.codePointAtPos(next); + + if (nextCh === 92 || nextCh === 91) { + return true; + } + + if (context) return false; + if (nextCh === 123) return true; + + if (isIdentifierStart(nextCh)) { + keywordRelationalOperator.lastIndex = next; + + if (keywordRelationalOperator.test(this.input)) { + const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex); + + if (!isIdentifierChar(endCh) && endCh !== 92) { + return false; + } + } + + return true; + } + + return false; + } + + parseStatement(context, topLevel) { + if (this.match(26)) { + this.parseDecorators(true); + } + + return this.parseStatementContent(context, topLevel); + } + + parseStatementContent(context, topLevel) { + let starttype = this.state.type; + const node = this.startNode(); + let kind; + + if (this.isLet(context)) { + starttype = 74; + kind = "let"; + } + + switch (starttype) { + case 60: + return this.parseBreakContinueStatement(node, true); + + case 63: + return this.parseBreakContinueStatement(node, false); + + case 64: + return this.parseDebuggerStatement(node); + + case 90: + return this.parseDoStatement(node); + + case 91: + return this.parseForStatement(node); + + case 68: + if (this.lookaheadCharCode() === 46) break; + + if (context) { + if (this.state.strict) { + this.raise(Errors.StrictFunction, { + at: this.state.startLoc + }); + } else if (context !== "if" && context !== "label") { + this.raise(Errors.SloppyFunction, { + at: this.state.startLoc + }); + } + } + + return this.parseFunctionStatement(node, false, !context); + + case 80: + if (context) this.unexpected(); + return this.parseClass(node, true); + + case 69: + return this.parseIfStatement(node); + + case 70: + return this.parseReturnStatement(node); + + case 71: + return this.parseSwitchStatement(node); + + case 72: + return this.parseThrowStatement(node); + + case 73: + return this.parseTryStatement(node); + + case 75: + case 74: + kind = kind || this.state.value; + + if (context && kind !== "var") { + this.raise(Errors.UnexpectedLexicalDeclaration, { + at: this.state.startLoc + }); + } + + return this.parseVarStatement(node, kind); + + case 92: + return this.parseWhileStatement(node); + + case 76: + return this.parseWithStatement(node); + + case 5: + return this.parseBlock(); + + case 13: + return this.parseEmptyStatement(node); + + case 83: + { + const nextTokenCharCode = this.lookaheadCharCode(); + + if (nextTokenCharCode === 40 || nextTokenCharCode === 46) { + break; + } + } + + case 82: + { + if (!this.options.allowImportExportEverywhere && !topLevel) { + this.raise(Errors.UnexpectedImportExport, { + at: this.state.startLoc + }); + } + + this.next(); + let result; + + if (starttype === 83) { + result = this.parseImport(node); + + if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) { + this.sawUnambiguousESM = true; + } + } else { + result = this.parseExport(node); + + if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") { + this.sawUnambiguousESM = true; + } + } + + this.assertModuleNodeAllowed(node); + return result; + } + + default: + { + if (this.isAsyncFunction()) { + if (context) { + this.raise(Errors.AsyncFunctionInSingleStatementContext, { + at: this.state.startLoc + }); + } + + this.next(); + return this.parseFunctionStatement(node, true, !context); + } + } + } + + const maybeName = this.state.value; + const expr = this.parseExpression(); + + if (tokenIsIdentifier(starttype) && expr.type === "Identifier" && this.eat(14)) { + return this.parseLabeledStatement(node, maybeName, expr, context); + } else { + return this.parseExpressionStatement(node, expr); + } + } + + assertModuleNodeAllowed(node) { + if (!this.options.allowImportExportEverywhere && !this.inModule) { + this.raise(Errors.ImportOutsideModule, { + at: node + }); + } + } + + takeDecorators(node) { + const decorators = this.state.decoratorStack[this.state.decoratorStack.length - 1]; + + if (decorators.length) { + node.decorators = decorators; + this.resetStartLocationFromNode(node, decorators[0]); + this.state.decoratorStack[this.state.decoratorStack.length - 1] = []; + } + } + + canHaveLeadingDecorator() { + return this.match(80); + } + + parseDecorators(allowExport) { + const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1]; + + while (this.match(26)) { + const decorator = this.parseDecorator(); + currentContextDecorators.push(decorator); + } + + if (this.match(82)) { + if (!allowExport) { + this.unexpected(); + } + + if (this.hasPlugin("decorators") && !this.getPluginOption("decorators", "decoratorsBeforeExport")) { + this.raise(Errors.DecoratorExportClass, { + at: this.state.startLoc + }); + } + } else if (!this.canHaveLeadingDecorator()) { + throw this.raise(Errors.UnexpectedLeadingDecorator, { + at: this.state.startLoc + }); + } + } + + parseDecorator() { + this.expectOnePlugin(["decorators-legacy", "decorators"]); + const node = this.startNode(); + this.next(); + + if (this.hasPlugin("decorators")) { + this.state.decoratorStack.push([]); + const startPos = this.state.start; + const startLoc = this.state.startLoc; + let expr; + + if (this.match(10)) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + this.next(); + expr = this.parseExpression(); + this.expect(11); + expr = this.wrapParenthesis(startPos, startLoc, expr); + } else { + expr = this.parseIdentifier(false); + + while (this.eat(16)) { + const node = this.startNodeAt(startPos, startLoc); + node.object = expr; + node.property = this.parseIdentifier(true); + node.computed = false; + expr = this.finishNode(node, "MemberExpression"); + } + } + + node.expression = this.parseMaybeDecoratorArguments(expr); + this.state.decoratorStack.pop(); + } else { + node.expression = this.parseExprSubscripts(); + } + + return this.finishNode(node, "Decorator"); + } + + parseMaybeDecoratorArguments(expr) { + if (this.eat(10)) { + const node = this.startNodeAtNode(expr); + node.callee = expr; + node.arguments = this.parseCallExpressionArguments(11, false); + this.toReferencedList(node.arguments); + return this.finishNode(node, "CallExpression"); + } + + return expr; + } + + parseBreakContinueStatement(node, isBreak) { + this.next(); + + if (this.isLineTerminator()) { + node.label = null; + } else { + node.label = this.parseIdentifier(); + this.semicolon(); + } + + this.verifyBreakContinue(node, isBreak); + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); + } + + verifyBreakContinue(node, isBreak) { + let i; + + for (i = 0; i < this.state.labels.length; ++i) { + const lab = this.state.labels[i]; + + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) break; + if (node.label && isBreak) break; + } + } + + if (i === this.state.labels.length) { + const type = isBreak ? "BreakStatement" : "ContinueStatement"; + this.raise(Errors.IllegalBreakContinue, { + at: node, + type + }); + } + } + + parseDebuggerStatement(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement"); + } + + parseHeaderExpression() { + this.expect(10); + const val = this.parseExpression(); + this.expect(11); + return val; + } + + parseDoStatement(node) { + this.next(); + this.state.labels.push(loopLabel); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("do")); + this.state.labels.pop(); + this.expect(92); + node.test = this.parseHeaderExpression(); + this.eat(13); + return this.finishNode(node, "DoWhileStatement"); + } + + parseForStatement(node) { + this.next(); + this.state.labels.push(loopLabel); + let awaitAt = null; + + if (this.isAwaitAllowed() && this.eatContextual(96)) { + awaitAt = this.state.lastTokStartLoc; + } + + this.scope.enter(SCOPE_OTHER); + this.expect(10); + + if (this.match(13)) { + if (awaitAt !== null) { + this.unexpected(awaitAt); + } + + return this.parseFor(node, null); + } + + const startsWithLet = this.isContextual(99); + const isLet = startsWithLet && this.isLetKeyword(); + + if (this.match(74) || this.match(75) || isLet) { + const init = this.startNode(); + const kind = isLet ? "let" : this.state.value; + this.next(); + this.parseVar(init, true, kind); + this.finishNode(init, "VariableDeclaration"); + + if ((this.match(58) || this.isContextual(101)) && init.declarations.length === 1) { + return this.parseForIn(node, init, awaitAt); + } + + if (awaitAt !== null) { + this.unexpected(awaitAt); + } + + return this.parseFor(node, init); + } + + const startsWithAsync = this.isContextual(95); + const refExpressionErrors = new ExpressionErrors(); + const init = this.parseExpression(true, refExpressionErrors); + const isForOf = this.isContextual(101); + + if (isForOf) { + if (startsWithLet) { + this.raise(Errors.ForOfLet, { + at: init + }); + } + + if (awaitAt === null && startsWithAsync && init.type === "Identifier") { + this.raise(Errors.ForOfAsync, { + at: init + }); + } + } + + if (isForOf || this.match(58)) { + this.checkDestructuringPrivate(refExpressionErrors); + this.toAssignable(init, true); + const type = isForOf ? "ForOfStatement" : "ForInStatement"; + this.checkLVal(init, { + in: { + type + } + }); + return this.parseForIn(node, init, awaitAt); + } else { + this.checkExpressionErrors(refExpressionErrors, true); + } + + if (awaitAt !== null) { + this.unexpected(awaitAt); + } + + return this.parseFor(node, init); + } + + parseFunctionStatement(node, isAsync, declarationPosition) { + this.next(); + return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), isAsync); + } + + parseIfStatement(node) { + this.next(); + node.test = this.parseHeaderExpression(); + node.consequent = this.parseStatement("if"); + node.alternate = this.eat(66) ? this.parseStatement("if") : null; + return this.finishNode(node, "IfStatement"); + } + + parseReturnStatement(node) { + if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) { + this.raise(Errors.IllegalReturn, { + at: this.state.startLoc + }); + } + + this.next(); + + if (this.isLineTerminator()) { + node.argument = null; + } else { + node.argument = this.parseExpression(); + this.semicolon(); + } + + return this.finishNode(node, "ReturnStatement"); + } + + parseSwitchStatement(node) { + this.next(); + node.discriminant = this.parseHeaderExpression(); + const cases = node.cases = []; + this.expect(5); + this.state.labels.push(switchLabel); + this.scope.enter(SCOPE_OTHER); + let cur; + + for (let sawDefault; !this.match(8);) { + if (this.match(61) || this.match(65)) { + const isCase = this.match(61); + if (cur) this.finishNode(cur, "SwitchCase"); + cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) { + this.raise(Errors.MultipleDefaultsInSwitch, { + at: this.state.lastTokStartLoc + }); + } + + sawDefault = true; + cur.test = null; + } + + this.expect(14); + } else { + if (cur) { + cur.consequent.push(this.parseStatement(null)); + } else { + this.unexpected(); + } + } + } + + this.scope.exit(); + if (cur) this.finishNode(cur, "SwitchCase"); + this.next(); + this.state.labels.pop(); + return this.finishNode(node, "SwitchStatement"); + } + + parseThrowStatement(node) { + this.next(); + + if (this.hasPrecedingLineBreak()) { + this.raise(Errors.NewlineAfterThrow, { + at: this.state.lastTokEndLoc + }); + } + + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement"); + } + + parseCatchClauseParam() { + const param = this.parseBindingAtom(); + const simple = param.type === "Identifier"; + this.scope.enter(simple ? SCOPE_SIMPLE_CATCH : 0); + this.checkLVal(param, { + in: { + type: "CatchClause" + }, + binding: BIND_LEXICAL, + allowingSloppyLetBinding: true + }); + return param; + } + + parseTryStatement(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + + if (this.match(62)) { + const clause = this.startNode(); + this.next(); + + if (this.match(10)) { + this.expect(10); + clause.param = this.parseCatchClauseParam(); + this.expect(11); + } else { + clause.param = null; + this.scope.enter(SCOPE_OTHER); + } + + clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false)); + this.scope.exit(); + node.handler = this.finishNode(clause, "CatchClause"); + } + + node.finalizer = this.eat(67) ? this.parseBlock() : null; + + if (!node.handler && !node.finalizer) { + this.raise(Errors.NoCatchOrFinally, { + at: node + }); + } + + return this.finishNode(node, "TryStatement"); + } + + parseVarStatement(node, kind, allowMissingInitializer = false) { + this.next(); + this.parseVar(node, false, kind, allowMissingInitializer); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration"); + } + + parseWhileStatement(node) { + this.next(); + node.test = this.parseHeaderExpression(); + this.state.labels.push(loopLabel); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("while")); + this.state.labels.pop(); + return this.finishNode(node, "WhileStatement"); + } + + parseWithStatement(node) { + if (this.state.strict) { + this.raise(Errors.StrictWith, { + at: this.state.startLoc + }); + } + + this.next(); + node.object = this.parseHeaderExpression(); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("with")); + return this.finishNode(node, "WithStatement"); + } + + parseEmptyStatement(node) { + this.next(); + return this.finishNode(node, "EmptyStatement"); + } + + parseLabeledStatement(node, maybeName, expr, context) { + for (const label of this.state.labels) { + if (label.name === maybeName) { + this.raise(Errors.LabelRedeclaration, { + at: expr, + labelName: maybeName + }); + } + } + + const kind = tokenIsLoop(this.state.type) ? "loop" : this.match(71) ? "switch" : null; + + for (let i = this.state.labels.length - 1; i >= 0; i--) { + const label = this.state.labels[i]; + + if (label.statementStart === node.start) { + label.statementStart = this.state.start; + label.kind = kind; + } else { + break; + } + } + + this.state.labels.push({ + name: maybeName, + kind: kind, + statementStart: this.state.start + }); + node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); + this.state.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement"); + } + + parseExpressionStatement(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement"); + } + + parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) { + const node = this.startNode(); + + if (allowDirectives) { + this.state.strictErrors.clear(); + } + + this.expect(5); + + if (createNewLexicalScope) { + this.scope.enter(SCOPE_OTHER); + } + + this.parseBlockBody(node, allowDirectives, false, 8, afterBlockParse); + + if (createNewLexicalScope) { + this.scope.exit(); + } + + return this.finishNode(node, "BlockStatement"); + } + + isValidDirective(stmt) { + return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized; + } + + parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { + const body = node.body = []; + const directives = node.directives = []; + this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse); + } + + parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) { + const oldStrict = this.state.strict; + let hasStrictModeDirective = false; + let parsedNonDirective = false; + + while (!this.match(end)) { + const stmt = this.parseStatement(null, topLevel); + + if (directives && !parsedNonDirective) { + if (this.isValidDirective(stmt)) { + const directive = this.stmtToDirective(stmt); + directives.push(directive); + + if (!hasStrictModeDirective && directive.value.value === "use strict") { + hasStrictModeDirective = true; + this.setStrict(true); + } + + continue; + } + + parsedNonDirective = true; + this.state.strictErrors.clear(); + } + + body.push(stmt); + } + + if (afterBlockParse) { + afterBlockParse.call(this, hasStrictModeDirective); + } + + if (!oldStrict) { + this.setStrict(false); + } + + this.next(); + } + + parseFor(node, init) { + node.init = init; + this.semicolon(false); + node.test = this.match(13) ? null : this.parseExpression(); + this.semicolon(false); + node.update = this.match(11) ? null : this.parseExpression(); + this.expect(11); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("for")); + this.scope.exit(); + this.state.labels.pop(); + return this.finishNode(node, "ForStatement"); + } + + parseForIn(node, init, awaitAt) { + const isForIn = this.match(58); + this.next(); + + if (isForIn) { + if (awaitAt !== null) this.unexpected(awaitAt); + } else { + node.await = awaitAt !== null; + } + + if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { + this.raise(Errors.ForInOfLoopInitializer, { + at: init, + type: isForIn ? "ForInStatement" : "ForOfStatement" + }); + } + + if (init.type === "AssignmentPattern") { + this.raise(Errors.InvalidLhs, { + at: init, + ancestor: { + type: "ForStatement" + } + }); + } + + node.left = init; + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn(); + this.expect(11); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("for")); + this.scope.exit(); + this.state.labels.pop(); + return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); + } + + parseVar(node, isFor, kind, allowMissingInitializer = false) { + const declarations = node.declarations = []; + node.kind = kind; + + for (;;) { + const decl = this.startNode(); + this.parseVarId(decl, kind); + decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn(); + + if (decl.init === null && !allowMissingInitializer) { + if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(101)))) { + this.raise(Errors.DeclarationMissingInitializer, { + at: this.state.lastTokEndLoc, + kind: "destructuring" + }); + } else if (kind === "const" && !(this.match(58) || this.isContextual(101))) { + this.raise(Errors.DeclarationMissingInitializer, { + at: this.state.lastTokEndLoc, + kind: "const" + }); + } + } + + declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(12)) break; + } + + return node; + } + + parseVarId(decl, kind) { + decl.id = this.parseBindingAtom(); + this.checkLVal(decl.id, { + in: { + type: "VariableDeclarator" + }, + binding: kind === "var" ? BIND_VAR : BIND_LEXICAL + }); + } + + parseFunction(node, statement = FUNC_NO_FLAGS, isAsync = false) { + const isStatement = statement & FUNC_STATEMENT; + const isHangingStatement = statement & FUNC_HANGING_STATEMENT; + const requireId = !!isStatement && !(statement & FUNC_NULLABLE_ID); + this.initFunction(node, isAsync); + + if (this.match(55) && isHangingStatement) { + this.raise(Errors.GeneratorInSingleStatementContext, { + at: this.state.startLoc + }); + } + + node.generator = this.eat(55); + + if (isStatement) { + node.id = this.parseFunctionId(requireId); + } + + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + this.state.maybeInArrowParameters = false; + this.scope.enter(SCOPE_FUNCTION); + this.prodParam.enter(functionFlags(isAsync, node.generator)); + + if (!isStatement) { + node.id = this.parseFunctionId(); + } + + this.parseFunctionParams(node, false); + this.withSmartMixTopicForbiddingContext(() => { + this.parseFunctionBodyAndFinish(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); + }); + this.prodParam.exit(); + this.scope.exit(); + + if (isStatement && !isHangingStatement) { + this.registerFunctionStatementId(node); + } + + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + return node; + } + + parseFunctionId(requireId) { + return requireId || tokenIsIdentifier(this.state.type) ? this.parseIdentifier() : null; + } + + parseFunctionParams(node, allowModifiers) { + this.expect(10); + this.expressionScope.enter(newParameterDeclarationScope()); + node.params = this.parseBindingList(11, 41, false, allowModifiers); + this.expressionScope.exit(); + } + + registerFunctionStatementId(node) { + if (!node.id) return; + this.scope.declareName(node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.loc.start); + } + + parseClass(node, isStatement, optionalId) { + this.next(); + this.takeDecorators(node); + const oldStrict = this.state.strict; + this.state.strict = true; + this.parseClassId(node, isStatement, optionalId); + this.parseClassSuper(node); + node.body = this.parseClassBody(!!node.superClass, oldStrict); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); + } + + isClassProperty() { + return this.match(29) || this.match(13) || this.match(8); + } + + isClassMethod() { + return this.match(10); + } + + isNonstaticConstructor(method) { + return !method.computed && !method.static && (method.key.name === "constructor" || method.key.value === "constructor"); + } + + parseClassBody(hadSuperClass, oldStrict) { + this.classScope.enter(); + const state = { + hadConstructor: false, + hadSuperClass + }; + let decorators = []; + const classBody = this.startNode(); + classBody.body = []; + this.expect(5); + this.withSmartMixTopicForbiddingContext(() => { + while (!this.match(8)) { + if (this.eat(13)) { + if (decorators.length > 0) { + throw this.raise(Errors.DecoratorSemicolon, { + at: this.state.lastTokEndLoc + }); + } + + continue; + } + + if (this.match(26)) { + decorators.push(this.parseDecorator()); + continue; + } + + const member = this.startNode(); + + if (decorators.length) { + member.decorators = decorators; + this.resetStartLocationFromNode(member, decorators[0]); + decorators = []; + } + + this.parseClassMember(classBody, member, state); + + if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) { + this.raise(Errors.DecoratorConstructor, { + at: member + }); + } + } + }); + this.state.strict = oldStrict; + this.next(); + + if (decorators.length) { + throw this.raise(Errors.TrailingDecorator, { + at: this.state.startLoc + }); + } + + this.classScope.exit(); + return this.finishNode(classBody, "ClassBody"); + } + + parseClassMemberFromModifier(classBody, member) { + const key = this.parseIdentifier(true); + + if (this.isClassMethod()) { + const method = member; + method.kind = "method"; + method.computed = false; + method.key = key; + method.static = false; + this.pushClassMethod(classBody, method, false, false, false, false); + return true; + } else if (this.isClassProperty()) { + const prop = member; + prop.computed = false; + prop.key = key; + prop.static = false; + classBody.body.push(this.parseClassProperty(prop)); + return true; + } + + this.resetPreviousNodeTrailingComments(key); + return false; + } + + parseClassMember(classBody, member, state) { + const isStatic = this.isContextual(104); + + if (isStatic) { + if (this.parseClassMemberFromModifier(classBody, member)) { + return; + } + + if (this.eat(5)) { + this.parseClassStaticBlock(classBody, member); + return; + } + } + + this.parseClassMemberWithIsStatic(classBody, member, state, isStatic); + } + + parseClassMemberWithIsStatic(classBody, member, state, isStatic) { + const publicMethod = member; + const privateMethod = member; + const publicProp = member; + const privateProp = member; + const accessorProp = member; + const method = publicMethod; + const publicMember = publicMethod; + member.static = isStatic; + this.parsePropertyNamePrefixOperator(member); + + if (this.eat(55)) { + method.kind = "method"; + const isPrivateName = this.match(134); + this.parseClassElementName(method); + + if (isPrivateName) { + this.pushClassPrivateMethod(classBody, privateMethod, true, false); + return; + } + + if (this.isNonstaticConstructor(publicMethod)) { + this.raise(Errors.ConstructorIsGenerator, { + at: publicMethod.key + }); + } + + this.pushClassMethod(classBody, publicMethod, true, false, false, false); + return; + } + + const isContextual = tokenIsIdentifier(this.state.type) && !this.state.containsEsc; + const isPrivate = this.match(134); + const key = this.parseClassElementName(member); + const maybeQuestionTokenStartLoc = this.state.startLoc; + this.parsePostMemberNameModifiers(publicMember); + + if (this.isClassMethod()) { + method.kind = "method"; + + if (isPrivate) { + this.pushClassPrivateMethod(classBody, privateMethod, false, false); + return; + } + + const isConstructor = this.isNonstaticConstructor(publicMethod); + let allowsDirectSuper = false; + + if (isConstructor) { + publicMethod.kind = "constructor"; + + if (state.hadConstructor && !this.hasPlugin("typescript")) { + this.raise(Errors.DuplicateConstructor, { + at: key + }); + } + + if (isConstructor && this.hasPlugin("typescript") && member.override) { + this.raise(Errors.OverrideOnConstructor, { + at: key + }); + } + + state.hadConstructor = true; + allowsDirectSuper = state.hadSuperClass; + } + + this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper); + } else if (this.isClassProperty()) { + if (isPrivate) { + this.pushClassPrivateProperty(classBody, privateProp); + } else { + this.pushClassProperty(classBody, publicProp); + } + } else if (isContextual && key.name === "async" && !this.isLineTerminator()) { + this.resetPreviousNodeTrailingComments(key); + const isGenerator = this.eat(55); + + if (publicMember.optional) { + this.unexpected(maybeQuestionTokenStartLoc); + } + + method.kind = "method"; + const isPrivate = this.match(134); + this.parseClassElementName(method); + this.parsePostMemberNameModifiers(publicMember); + + if (isPrivate) { + this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true); + } else { + if (this.isNonstaticConstructor(publicMethod)) { + this.raise(Errors.ConstructorIsAsync, { + at: publicMethod.key + }); + } + + this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false); + } + } else if (isContextual && (key.name === "get" || key.name === "set") && !(this.match(55) && this.isLineTerminator())) { + this.resetPreviousNodeTrailingComments(key); + method.kind = key.name; + const isPrivate = this.match(134); + this.parseClassElementName(publicMethod); + + if (isPrivate) { + this.pushClassPrivateMethod(classBody, privateMethod, false, false); + } else { + if (this.isNonstaticConstructor(publicMethod)) { + this.raise(Errors.ConstructorIsAccessor, { + at: publicMethod.key + }); + } + + this.pushClassMethod(classBody, publicMethod, false, false, false, false); + } + + this.checkGetterSetterParams(publicMethod); + } else if (isContextual && key.name === "accessor" && !this.isLineTerminator()) { + this.expectPlugin("decoratorAutoAccessors"); + this.resetPreviousNodeTrailingComments(key); + const isPrivate = this.match(134); + this.parseClassElementName(publicProp); + this.pushClassAccessorProperty(classBody, accessorProp, isPrivate); + } else if (this.isLineTerminator()) { + if (isPrivate) { + this.pushClassPrivateProperty(classBody, privateProp); + } else { + this.pushClassProperty(classBody, publicProp); + } + } else { + this.unexpected(); + } + } + + parseClassElementName(member) { + const { + type, + value + } = this.state; + + if ((type === 128 || type === 129) && member.static && value === "prototype") { + this.raise(Errors.StaticPrototype, { + at: this.state.startLoc + }); + } + + if (type === 134) { + if (value === "constructor") { + this.raise(Errors.ConstructorClassPrivateField, { + at: this.state.startLoc + }); + } + + const key = this.parsePrivateName(); + member.key = key; + return key; + } + + return this.parsePropertyName(member); + } + + parseClassStaticBlock(classBody, member) { + var _member$decorators; + + this.scope.enter(SCOPE_CLASS | SCOPE_STATIC_BLOCK | SCOPE_SUPER); + const oldLabels = this.state.labels; + this.state.labels = []; + this.prodParam.enter(PARAM); + const body = member.body = []; + this.parseBlockOrModuleBlockBody(body, undefined, false, 8); + this.prodParam.exit(); + this.scope.exit(); + this.state.labels = oldLabels; + classBody.body.push(this.finishNode(member, "StaticBlock")); + + if ((_member$decorators = member.decorators) != null && _member$decorators.length) { + this.raise(Errors.DecoratorStaticBlock, { + at: member + }); + } + } + + pushClassProperty(classBody, prop) { + if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) { + this.raise(Errors.ConstructorClassField, { + at: prop.key + }); + } + + classBody.body.push(this.parseClassProperty(prop)); + } + + pushClassPrivateProperty(classBody, prop) { + const node = this.parseClassPrivateProperty(prop); + classBody.body.push(node); + this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start); + } + + pushClassAccessorProperty(classBody, prop, isPrivate) { + if (!isPrivate && !prop.computed) { + const key = prop.key; + + if (key.name === "constructor" || key.value === "constructor") { + this.raise(Errors.ConstructorClassField, { + at: key + }); + } + } + + const node = this.parseClassAccessorProperty(prop); + classBody.body.push(node); + + if (isPrivate) { + this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start); + } + } + + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true)); + } + + pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { + const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true); + classBody.body.push(node); + const kind = node.kind === "get" ? node.static ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" ? node.static ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER; + this.declareClassPrivateMethodInScope(node, kind); + } + + declareClassPrivateMethodInScope(node, kind) { + this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start); + } + + parsePostMemberNameModifiers(methodOrProp) {} + + parseClassPrivateProperty(node) { + this.parseInitializer(node); + this.semicolon(); + return this.finishNode(node, "ClassPrivateProperty"); + } + + parseClassProperty(node) { + this.parseInitializer(node); + this.semicolon(); + return this.finishNode(node, "ClassProperty"); + } + + parseClassAccessorProperty(node) { + this.parseInitializer(node); + this.semicolon(); + return this.finishNode(node, "ClassAccessorProperty"); + } + + parseInitializer(node) { + this.scope.enter(SCOPE_CLASS | SCOPE_SUPER); + this.expressionScope.enter(newExpressionScope()); + this.prodParam.enter(PARAM); + node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null; + this.expressionScope.exit(); + this.prodParam.exit(); + this.scope.exit(); + } + + parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS) { + if (tokenIsIdentifier(this.state.type)) { + node.id = this.parseIdentifier(); + + if (isStatement) { + this.declareNameFromIdentifier(node.id, bindingType); + } + } else { + if (optionalId || !isStatement) { + node.id = null; + } else { + throw this.raise(Errors.MissingClassName, { + at: this.state.startLoc + }); + } + } + } + + parseClassSuper(node) { + node.superClass = this.eat(81) ? this.parseExprSubscripts() : null; + } + + parseExport(node) { + const hasDefault = this.maybeParseExportDefaultSpecifier(node); + const parseAfterDefault = !hasDefault || this.eat(12); + const hasStar = parseAfterDefault && this.eatExportStar(node); + const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node); + const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12)); + const isFromRequired = hasDefault || hasStar; + + if (hasStar && !hasNamespace) { + if (hasDefault) this.unexpected(); + this.parseExportFrom(node, true); + return this.finishNode(node, "ExportAllDeclaration"); + } + + const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node); + + if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers || hasNamespace && parseAfterNamespace && !hasSpecifiers) { + throw this.unexpected(null, 5); + } + + let hasDeclaration; + + if (isFromRequired || hasSpecifiers) { + hasDeclaration = false; + this.parseExportFrom(node, isFromRequired); + } else { + hasDeclaration = this.maybeParseExportDeclaration(node); + } + + if (isFromRequired || hasSpecifiers || hasDeclaration) { + this.checkExport(node, true, false, !!node.source); + return this.finishNode(node, "ExportNamedDeclaration"); + } + + if (this.eat(65)) { + node.declaration = this.parseExportDefaultExpression(); + this.checkExport(node, true, true); + return this.finishNode(node, "ExportDefaultDeclaration"); + } + + throw this.unexpected(null, 5); + } + + eatExportStar(node) { + return this.eat(55); + } + + maybeParseExportDefaultSpecifier(node) { + if (this.isExportDefaultSpecifier()) { + this.expectPlugin("exportDefaultFrom"); + const specifier = this.startNode(); + specifier.exported = this.parseIdentifier(true); + node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; + return true; + } + + return false; + } + + maybeParseExportNamespaceSpecifier(node) { + if (this.isContextual(93)) { + if (!node.specifiers) node.specifiers = []; + const specifier = this.startNodeAt(this.state.lastTokStart, this.state.lastTokStartLoc); + this.next(); + specifier.exported = this.parseModuleExportName(); + node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); + return true; + } + + return false; + } + + maybeParseExportNamedSpecifiers(node) { + if (this.match(5)) { + if (!node.specifiers) node.specifiers = []; + const isTypeExport = node.exportKind === "type"; + node.specifiers.push(...this.parseExportSpecifiers(isTypeExport)); + node.source = null; + node.declaration = null; + + if (this.hasPlugin("importAssertions")) { + node.assertions = []; + } + + return true; + } + + return false; + } + + maybeParseExportDeclaration(node) { + if (this.shouldParseExportDeclaration()) { + node.specifiers = []; + node.source = null; + + if (this.hasPlugin("importAssertions")) { + node.assertions = []; + } + + node.declaration = this.parseExportDeclaration(node); + return true; + } + + return false; + } + + isAsyncFunction() { + if (!this.isContextual(95)) return false; + const next = this.nextTokenStart(); + return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, "function"); + } + + parseExportDefaultExpression() { + const expr = this.startNode(); + const isAsync = this.isAsyncFunction(); + + if (this.match(68) || isAsync) { + this.next(); + + if (isAsync) { + this.next(); + } + + return this.parseFunction(expr, FUNC_STATEMENT | FUNC_NULLABLE_ID, isAsync); + } + + if (this.match(80)) { + return this.parseClass(expr, true, true); + } + + if (this.match(26)) { + if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport")) { + this.raise(Errors.DecoratorBeforeExport, { + at: this.state.startLoc + }); + } + + this.parseDecorators(false); + return this.parseClass(expr, true, true); + } + + if (this.match(75) || this.match(74) || this.isLet()) { + throw this.raise(Errors.UnsupportedDefaultExport, { + at: this.state.startLoc + }); + } + + const res = this.parseMaybeAssignAllowIn(); + this.semicolon(); + return res; + } + + parseExportDeclaration(node) { + return this.parseStatement(null); + } + + isExportDefaultSpecifier() { + const { + type + } = this.state; + + if (tokenIsIdentifier(type)) { + if (type === 95 && !this.state.containsEsc || type === 99) { + return false; + } + + if ((type === 126 || type === 125) && !this.state.containsEsc) { + const { + type: nextType + } = this.lookahead(); + + if (tokenIsIdentifier(nextType) && nextType !== 97 || nextType === 5) { + this.expectOnePlugin(["flow", "typescript"]); + return false; + } + } + } else if (!this.match(65)) { + return false; + } + + const next = this.nextTokenStart(); + const hasFrom = this.isUnparsedContextual(next, "from"); + + if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.state.type) && hasFrom) { + return true; + } + + if (this.match(65) && hasFrom) { + const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4)); + return nextAfterFrom === 34 || nextAfterFrom === 39; + } + + return false; + } + + parseExportFrom(node, expect) { + if (this.eatContextual(97)) { + node.source = this.parseImportSource(); + this.checkExport(node); + const assertions = this.maybeParseImportAssertions(); + + if (assertions) { + node.assertions = assertions; + } + } else if (expect) { + this.unexpected(); + } + + this.semicolon(); + } + + shouldParseExportDeclaration() { + const { + type + } = this.state; + + if (type === 26) { + this.expectOnePlugin(["decorators", "decorators-legacy"]); + + if (this.hasPlugin("decorators")) { + if (this.getPluginOption("decorators", "decoratorsBeforeExport")) { + throw this.raise(Errors.DecoratorBeforeExport, { + at: this.state.startLoc + }); + } + + return true; + } + } + + return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction(); + } + + checkExport(node, checkNames, isDefault, isFrom) { + if (checkNames) { + if (isDefault) { + this.checkDuplicateExports(node, "default"); + + if (this.hasPlugin("exportDefaultFrom")) { + var _declaration$extra; + + const declaration = node.declaration; + + if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) { + this.raise(Errors.ExportDefaultFromAsIdentifier, { + at: declaration + }); + } + } + } else if (node.specifiers && node.specifiers.length) { + for (const specifier of node.specifiers) { + const { + exported + } = specifier; + const exportName = exported.type === "Identifier" ? exported.name : exported.value; + this.checkDuplicateExports(specifier, exportName); + + if (!isFrom && specifier.local) { + const { + local + } = specifier; + + if (local.type !== "Identifier") { + this.raise(Errors.ExportBindingIsString, { + at: specifier, + localName: local.value, + exportName + }); + } else { + this.checkReservedWord(local.name, local.loc.start, true, false); + this.scope.checkLocalExport(local); + } + } + } + } else if (node.declaration) { + if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") { + const id = node.declaration.id; + if (!id) throw new Error("Assertion failure"); + this.checkDuplicateExports(node, id.name); + } else if (node.declaration.type === "VariableDeclaration") { + for (const declaration of node.declaration.declarations) { + this.checkDeclaration(declaration.id); + } + } + } + } + + const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1]; + + if (currentContextDecorators.length) { + throw this.raise(Errors.UnsupportedDecoratorExport, { + at: node + }); + } + } + + checkDeclaration(node) { + if (node.type === "Identifier") { + this.checkDuplicateExports(node, node.name); + } else if (node.type === "ObjectPattern") { + for (const prop of node.properties) { + this.checkDeclaration(prop); + } + } else if (node.type === "ArrayPattern") { + for (const elem of node.elements) { + if (elem) { + this.checkDeclaration(elem); + } + } + } else if (node.type === "ObjectProperty") { + this.checkDeclaration(node.value); + } else if (node.type === "RestElement") { + this.checkDeclaration(node.argument); + } else if (node.type === "AssignmentPattern") { + this.checkDeclaration(node.left); + } + } + + checkDuplicateExports(node, exportName) { + if (this.exportedIdentifiers.has(exportName)) { + if (exportName === "default") { + this.raise(Errors.DuplicateDefaultExport, { + at: node + }); + } else { + this.raise(Errors.DuplicateExport, { + at: node, + exportName + }); + } + } + + this.exportedIdentifiers.add(exportName); + } + + parseExportSpecifiers(isInTypeExport) { + const nodes = []; + let first = true; + this.expect(5); + + while (!this.eat(8)) { + if (first) { + first = false; + } else { + this.expect(12); + if (this.eat(8)) break; + } + + const isMaybeTypeOnly = this.isContextual(126); + const isString = this.match(129); + const node = this.startNode(); + node.local = this.parseModuleExportName(); + nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly)); + } + + return nodes; + } + + parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { + if (this.eatContextual(93)) { + node.exported = this.parseModuleExportName(); + } else if (isString) { + node.exported = cloneStringLiteral(node.local); + } else if (!node.exported) { + node.exported = cloneIdentifier(node.local); + } + + return this.finishNode(node, "ExportSpecifier"); + } + + parseModuleExportName() { + if (this.match(129)) { + const result = this.parseStringLiteral(this.state.value); + const surrogate = result.value.match(loneSurrogate); + + if (surrogate) { + this.raise(Errors.ModuleExportNameHasLoneSurrogate, { + at: result, + surrogateCharCode: surrogate[0].charCodeAt(0) + }); + } + + return result; + } + + return this.parseIdentifier(true); + } + + parseImport(node) { + node.specifiers = []; + + if (!this.match(129)) { + const hasDefault = this.maybeParseDefaultImportSpecifier(node); + const parseNext = !hasDefault || this.eat(12); + const hasStar = parseNext && this.maybeParseStarImportSpecifier(node); + if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node); + this.expectContextual(97); + } + + node.source = this.parseImportSource(); + const assertions = this.maybeParseImportAssertions(); + + if (assertions) { + node.assertions = assertions; + } else { + const attributes = this.maybeParseModuleAttributes(); + + if (attributes) { + node.attributes = attributes; + } + } + + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); + } + + parseImportSource() { + if (!this.match(129)) this.unexpected(); + return this.parseExprAtom(); + } + + shouldParseDefaultImport(node) { + return tokenIsIdentifier(this.state.type); + } + + parseImportSpecifierLocal(node, specifier, type) { + specifier.local = this.parseIdentifier(); + node.specifiers.push(this.finishImportSpecifier(specifier, type)); + } + + finishImportSpecifier(specifier, type) { + this.checkLVal(specifier.local, { + in: specifier, + binding: BIND_LEXICAL + }); + return this.finishNode(specifier, type); + } + + parseAssertEntries() { + const attrs = []; + const attrNames = new Set(); + + do { + if (this.match(8)) { + break; + } + + const node = this.startNode(); + const keyName = this.state.value; + + if (attrNames.has(keyName)) { + this.raise(Errors.ModuleAttributesWithDuplicateKeys, { + at: this.state.startLoc, + key: keyName + }); + } + + attrNames.add(keyName); + + if (this.match(129)) { + node.key = this.parseStringLiteral(keyName); + } else { + node.key = this.parseIdentifier(true); + } + + this.expect(14); + + if (!this.match(129)) { + throw this.raise(Errors.ModuleAttributeInvalidValue, { + at: this.state.startLoc + }); + } + + node.value = this.parseStringLiteral(this.state.value); + this.finishNode(node, "ImportAttribute"); + attrs.push(node); + } while (this.eat(12)); + + return attrs; + } + + maybeParseModuleAttributes() { + if (this.match(76) && !this.hasPrecedingLineBreak()) { + this.expectPlugin("moduleAttributes"); + this.next(); + } else { + if (this.hasPlugin("moduleAttributes")) return []; + return null; + } + + const attrs = []; + const attributes = new Set(); + + do { + const node = this.startNode(); + node.key = this.parseIdentifier(true); + + if (node.key.name !== "type") { + this.raise(Errors.ModuleAttributeDifferentFromType, { + at: node.key + }); + } + + if (attributes.has(node.key.name)) { + this.raise(Errors.ModuleAttributesWithDuplicateKeys, { + at: node.key, + key: node.key.name + }); + } + + attributes.add(node.key.name); + this.expect(14); + + if (!this.match(129)) { + throw this.raise(Errors.ModuleAttributeInvalidValue, { + at: this.state.startLoc + }); + } + + node.value = this.parseStringLiteral(this.state.value); + this.finishNode(node, "ImportAttribute"); + attrs.push(node); + } while (this.eat(12)); + + return attrs; + } + + maybeParseImportAssertions() { + if (this.isContextual(94) && !this.hasPrecedingLineBreak()) { + this.expectPlugin("importAssertions"); + this.next(); + } else { + if (this.hasPlugin("importAssertions")) return []; + return null; + } + + this.eat(5); + const attrs = this.parseAssertEntries(); + this.eat(8); + return attrs; + } + + maybeParseDefaultImportSpecifier(node) { + if (this.shouldParseDefaultImport(node)) { + this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier"); + return true; + } + + return false; + } + + maybeParseStarImportSpecifier(node) { + if (this.match(55)) { + const specifier = this.startNode(); + this.next(); + this.expectContextual(93); + this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier"); + return true; + } + + return false; + } + + parseNamedImportSpecifiers(node) { + let first = true; + this.expect(5); + + while (!this.eat(8)) { + if (first) { + first = false; + } else { + if (this.eat(14)) { + throw this.raise(Errors.DestructureNamedImport, { + at: this.state.startLoc + }); + } + + this.expect(12); + if (this.eat(8)) break; + } + + const specifier = this.startNode(); + const importedIsString = this.match(129); + const isMaybeTypeOnly = this.isContextual(126); + specifier.imported = this.parseModuleExportName(); + const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly); + node.specifiers.push(importSpecifier); + } + } + + parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly) { + if (this.eatContextual(93)) { + specifier.local = this.parseIdentifier(); + } else { + const { + imported + } = specifier; + + if (importedIsString) { + throw this.raise(Errors.ImportBindingIsString, { + at: specifier, + importName: imported.value + }); + } + + this.checkReservedWord(imported.name, specifier.loc.start, true, true); + + if (!specifier.local) { + specifier.local = cloneIdentifier(imported); + } + } + + return this.finishImportSpecifier(specifier, "ImportSpecifier"); + } + + isThisParam(param) { + return param.type === "Identifier" && param.name === "this"; + } + +} + +class Parser extends StatementParser { + constructor(options, input) { + options = getOptions(options); + super(options, input); + this.options = options; + this.initializeScopes(); + this.plugins = pluginsMap(this.options.plugins); + this.filename = options.sourceFilename; + } + + getScopeHandler() { + return ScopeHandler; + } + + parse() { + this.enterInitialScopes(); + const file = this.startNode(); + const program = this.startNode(); + this.nextToken(); + file.errors = null; + this.parseTopLevel(file, program); + file.errors = this.state.errors; + return file; + } + +} + +function pluginsMap(plugins) { + const pluginMap = new Map(); + + for (const plugin of plugins) { + const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}]; + if (!pluginMap.has(name)) pluginMap.set(name, options || {}); + } + + return pluginMap; +} + +function parse(input, options) { + var _options; + + if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") { + options = Object.assign({}, options); + + try { + options.sourceType = "module"; + const parser = getParser(options, input); + const ast = parser.parse(); + + if (parser.sawUnambiguousESM) { + return ast; + } + + if (parser.ambiguousScriptDifferentAst) { + try { + options.sourceType = "script"; + return getParser(options, input).parse(); + } catch (_unused) {} + } else { + ast.program.sourceType = "script"; + } + + return ast; + } catch (moduleError) { + try { + options.sourceType = "script"; + return getParser(options, input).parse(); + } catch (_unused2) {} + + throw moduleError; + } + } else { + return getParser(options, input).parse(); + } +} +function parseExpression(input, options) { + const parser = getParser(options, input); + + if (parser.options.strictMode) { + parser.state.strict = true; + } + + return parser.getExpression(); +} + +function generateExportedTokenTypes(internalTokenTypes) { + const tokenTypes = {}; + + for (const typeName of Object.keys(internalTokenTypes)) { + tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]); + } + + return tokenTypes; +} + +const tokTypes = generateExportedTokenTypes(tt); + +function getParser(options, input) { + let cls = Parser; + + if (options != null && options.plugins) { + validatePlugins(options.plugins); + cls = getParserClass(options.plugins); + } + + return new cls(options, input); +} + +const parserClassCache = {}; + +function getParserClass(pluginsFromOptions) { + const pluginList = mixinPluginNames.filter(name => hasPlugin(pluginsFromOptions, name)); + const key = pluginList.join("/"); + let cls = parserClassCache[key]; + + if (!cls) { + cls = Parser; + + for (const plugin of pluginList) { + cls = mixinPlugins[plugin](cls); + } + + parserClassCache[key] = cls; + } + + return cls; +} + +exports.parse = parse; +exports.parseExpression = parseExpression; +exports.tokTypes = tokTypes; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/parser/lib/index.js.map b/node_modules/@babel/parser/lib/index.js.map new file mode 100644 index 0000000000..fdec7eb3be --- /dev/null +++ b/node_modules/@babel/parser/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../src/util/location.js","../src/parse-error/credentials.js","../src/parse-error/module-errors.js","../src/parse-error/to-node-description.js","../src/parse-error/standard-errors.js","../src/parse-error/strict-mode-errors.js","../src/parse-error/pipeline-operator-errors.js","../src/parse-error.js","../src/plugins/estree.js","../src/tokenizer/context.js","../src/tokenizer/types.js","../../babel-helper-validator-identifier/src/identifier.ts","../../babel-helper-validator-identifier/src/keyword.ts","../src/util/identifier.js","../src/util/scopeflags.js","../src/parser/base.js","../src/parser/comments.js","../src/util/whitespace.js","../src/tokenizer/state.js","../src/tokenizer/index.js","../src/util/scope.js","../src/plugins/flow/scope.js","../src/util/class-scope.js","../src/util/expression-scope.js","../src/util/production-parameter.js","../src/parser/util.js","../src/parser/node.js","../src/plugins/flow/index.js","../src/plugins/jsx/xhtml.js","../src/plugins/jsx/index.js","../src/plugins/typescript/scope.js","../src/plugins/typescript/index.js","../src/plugins/placeholders.js","../src/plugins/v8intrinsic.js","../src/plugin-utils.js","../src/options.js","../src/parser/lval.js","../src/parser/expression.js","../src/parser/statement.js","../src/parser/index.js","../src/index.js"],"sourcesContent":["// @flow\n\nexport type Pos = {\n start: number,\n};\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n line: number;\n column: number;\n index: number;\n\n constructor(line: number, col: number, index: number) {\n this.line = line;\n this.column = col;\n this.index = index;\n }\n}\n\nexport class SourceLocation {\n start: Position;\n end: Position;\n filename: string;\n identifierName: ?string;\n\n constructor(start: Position, end?: Position) {\n this.start = start;\n // $FlowIgnore (may start as null, but initialized later)\n this.end = end;\n }\n}\n\n/**\n * creates a new position with a non-zero column offset from the given position.\n * This function should be only be used when we create AST node out of the token\n * boundaries, such as TemplateElement ends before tt.templateNonTail. This\n * function does not skip whitespaces.\n *\n * @export\n * @param {Position} position\n * @param {number} columnOffset\n * @returns {Position}\n */\nexport function createPositionWithColumnOffset(\n position: Position,\n columnOffset: number,\n) {\n const { line, column, index } = position;\n return new Position(line, column + columnOffset, index + columnOffset);\n}\n","// @flow\n\nexport const ParseErrorCodes = Object.freeze({\n SyntaxError: \"BABEL_PARSER_SYNTAX_ERROR\",\n SourceTypeModuleError: \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\",\n});\n\nexport type ParseErrorCode = $Values;\n\nexport type SyntaxPlugin =\n | \"flow\"\n | \"typescript\"\n | \"jsx\"\n | \"pipelineOperator\"\n | \"placeholders\";\n\nexport type ToMessage = (self: ErrorDetails) => string;\n\nexport type ParseErrorCredentials = {\n code: ParseErrorCode,\n reasonCode: string,\n syntaxPlugin?: SyntaxPlugin,\n\n toMessage: ToMessage,\n};\n\nconst reflect = (keys: string[], last = keys.length - 1) => ({\n get() {\n return keys.reduce((object, key) => object[key], this);\n },\n set(value) {\n keys.reduce(\n (item, key, i) => (i === last ? (item[key] = value) : item[key]),\n this,\n );\n },\n});\n\nconst instantiate = (\n constructor: () => any,\n properties: Object,\n descriptors: Object,\n) =>\n Object.keys(descriptors)\n .map(key => [key, descriptors[key]])\n .filter(([, descriptor]) => !!descriptor)\n .map(([key, descriptor]) => [\n key,\n typeof descriptor === \"function\"\n ? { value: descriptor, enumerable: false }\n : typeof descriptor.reflect === \"string\"\n ? { ...descriptor, ...reflect(descriptor.reflect.split(\".\")) }\n : descriptor,\n ])\n .reduce(\n (instance, [key, descriptor]) =>\n Object.defineProperty(instance, key, {\n configurable: true,\n ...descriptor,\n }),\n Object.assign((new constructor(): T), properties),\n );\n\nexport { instantiate };\n","// @flow\n\nimport { ParseErrorCodes, toParseErrorCredentials } from \"../parse-error\";\n\nexport default (_: typeof toParseErrorCredentials) => ({\n ImportMetaOutsideModule: _(\n `import.meta may appear only with 'sourceType: \"module\"'`,\n { code: ParseErrorCodes.SourceTypeModuleError },\n ),\n ImportOutsideModule: _(\n `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n { code: ParseErrorCodes.SourceTypeModuleError },\n ),\n});\n","const NodeDescriptions = {\n ArrayPattern: \"array destructuring pattern\",\n AssignmentExpression: \"assignment expression\",\n AssignmentPattern: \"assignment expression\",\n ArrowFunctionExpression: \"arrow function expression\",\n ConditionalExpression: \"conditional expression\",\n ForOfStatement: \"for-of statement\",\n ForInStatement: \"for-in statement\",\n ForStatement: \"for-loop\",\n FormalParameters: \"function parameter list\",\n Identifier: \"identifier\",\n ObjectPattern: \"object destructuring pattern\",\n ParenthesizedExpression: \"parenthesized expression\",\n RestElement: \"rest element\",\n UpdateExpression: {\n true: \"prefix operation\",\n false: \"postfix operation\",\n },\n VariableDeclarator: \"variable declaration\",\n YieldExpression: \"yield expression\",\n};\n\ntype NodeTypesWithDescriptions = $Keys<\n $Diff,\n>;\ntype NodeWithDescription =\n | { type: \"UpdateExpression\", prefix: boolean }\n | { type: NodeTypesWithDescriptions };\n\n// eslint-disable-next-line no-confusing-arrow\nconst toNodeDescription = ({ type, prefix }: NodeWithDescription) =>\n type === \"UpdateExpression\"\n ? NodeDescriptions.UpdateExpression[String(prefix)]\n : NodeDescriptions[type];\n\nexport default toNodeDescription;\n","// @flow\n\nimport { toParseErrorCredentials } from \"../parse-error\";\nimport toNodeDescription from \"./to-node-description\";\n\nexport type LValAncestor =\n | { type: \"UpdateExpression\", prefix: boolean }\n | {\n type:\n | \"ArrayPattern\"\n | \"AssignmentExpression\"\n | \"CatchClause\"\n | \"ForOfStatement\"\n | \"FormalParameters\"\n | \"ForInStatement\"\n | \"ForStatement\"\n | \"Identfier\"\n | \"ObjectPattern\"\n | \"RestElement\"\n | \"VariableDeclarator\",\n };\n\nexport default (_: typeof toParseErrorCredentials) => ({\n AccessorIsGenerator: _<{| kind: \"get\" | \"set\" |}>(\n ({ kind }) => `A ${kind}ter cannot be a generator.`,\n ),\n\n ArgumentsInClass: _(\n \"'arguments' is only allowed in functions and class methods.\",\n ),\n AsyncFunctionInSingleStatementContext: _(\n \"Async functions can only be declared at the top level or inside a block.\",\n ),\n AwaitBindingIdentifier: _(\n \"Can not use 'await' as identifier inside an async function.\",\n ),\n AwaitBindingIdentifierInStaticBlock: _(\n \"Can not use 'await' as identifier inside a static block.\",\n ),\n AwaitExpressionFormalParameter: _(\n \"'await' is not allowed in async function parameters.\",\n ),\n AwaitNotInAsyncContext: _(\n \"'await' is only allowed within async functions and at the top levels of modules.\",\n ),\n AwaitNotInAsyncFunction: _(\"'await' is only allowed within async functions.\"),\n BadGetterArity: _(\"A 'get' accesor must not have any formal parameters.\"),\n BadSetterArity: _(\"A 'set' accesor must have exactly one formal parameter.\"),\n BadSetterRestParameter: _(\n \"A 'set' accesor function argument must not be a rest parameter.\",\n ),\n ConstructorClassField: _(\"Classes may not have a field named 'constructor'.\"),\n ConstructorClassPrivateField: _(\n \"Classes may not have a private field named '#constructor'.\",\n ),\n ConstructorIsAccessor: _(\"Class constructor may not be an accessor.\"),\n ConstructorIsAsync: _(\"Constructor can't be an async function.\"),\n ConstructorIsGenerator: _(\"Constructor can't be a generator.\"),\n DeclarationMissingInitializer: _<{| kind: \"const\" | \"destructuring\" |}>(\n ({ kind }) => `Missing initializer in ${kind} declaration.`,\n ),\n DecoratorBeforeExport: _(\n \"Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax.\",\n ),\n DecoratorConstructor: _(\n \"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?\",\n ),\n DecoratorExportClass: _(\n \"Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.\",\n ),\n DecoratorSemicolon: _(\"Decorators must not be followed by a semicolon.\"),\n DecoratorStaticBlock: _(\"Decorators can't be used with a static block.\"),\n DeletePrivateField: _(\"Deleting a private field is not allowed.\"),\n DestructureNamedImport: _(\n \"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\",\n ),\n DuplicateConstructor: _(\"Duplicate constructor in the same class.\"),\n DuplicateDefaultExport: _(\"Only one default export allowed per module.\"),\n DuplicateExport: _<{| exportName: string |}>(\n ({ exportName }) =>\n `\\`${exportName}\\` has already been exported. Exported identifiers must be unique.`,\n ),\n DuplicateProto: _(\"Redefinition of __proto__ property.\"),\n DuplicateRegExpFlags: _(\"Duplicate regular expression flag.\"),\n ElementAfterRest: _(\"Rest element must be last element.\"),\n EscapedCharNotAnIdentifier: _(\"Invalid Unicode escape.\"),\n ExportBindingIsString: _<{| localName: string, exportName: string |}>(\n ({ localName, exportName }) =>\n `A string literal cannot be used as an exported binding without \\`from\\`.\\n- Did you mean \\`export { '${localName}' as '${exportName}' } from 'some-module'\\`?`,\n ),\n ExportDefaultFromAsIdentifier: _(\n \"'from' is not allowed as an identifier after 'export default'.\",\n ),\n\n ForInOfLoopInitializer: _<{| type: \"ForInStatement\" | \"ForOfStatement\" |}>(\n ({ type }) =>\n `'${\n type === \"ForInStatement\" ? \"for-in\" : \"for-of\"\n }' loop variable declaration may not have an initializer.`,\n ),\n\n ForOfAsync: _(\"The left-hand side of a for-of loop may not be 'async'.\"),\n ForOfLet: _(\"The left-hand side of a for-of loop may not start with 'let'.\"),\n GeneratorInSingleStatementContext: _(\n \"Generators can only be declared at the top level or inside a block.\",\n ),\n\n IllegalBreakContinue: _<{| type: \"BreakStatement\" | \"ContinueStatement\" |}>(\n ({ type }) =>\n `Unsyntactic ${type === \"BreakStatement\" ? \"break\" : \"continue\"}.`,\n ),\n\n IllegalLanguageModeDirective: _(\n \"Illegal 'use strict' directive in function with non-simple parameter list.\",\n ),\n IllegalReturn: _(\"'return' outside of function.\"),\n ImportBindingIsString: _<{| importName: string |}>(\n ({ importName }) =>\n `A string literal cannot be used as an imported binding.\\n- Did you mean \\`import { \"${importName}\" as foo }\\`?`,\n ),\n ImportCallArgumentTrailingComma: _(\n \"Trailing comma is disallowed inside import(...) arguments.\",\n ),\n ImportCallArity: _<{| maxArgumentCount: 1 | 2 |}>(\n ({ maxArgumentCount }) =>\n `\\`import()\\` requires exactly ${\n maxArgumentCount === 1 ? \"one argument\" : \"one or two arguments\"\n }.`,\n ),\n ImportCallNotNewExpression: _(\"Cannot use new with import(...).\"),\n ImportCallSpreadArgument: _(\"`...` is not allowed in `import()`.\"),\n IncompatibleRegExpUVFlags: _(\n \"The 'u' and 'v' regular expression flags cannot be enabled at the same time.\",\n ),\n InvalidBigIntLiteral: _(\"Invalid BigIntLiteral.\"),\n InvalidCodePoint: _(\"Code point out of bounds.\"),\n InvalidCoverInitializedName: _(\"Invalid shorthand property initializer.\"),\n InvalidDecimal: _(\"Invalid decimal.\"),\n InvalidDigit: _<{| radix: number |}>(\n ({ radix }) => `Expected number in radix ${radix}.`,\n ),\n InvalidEscapeSequence: _(\"Bad character escape sequence.\"),\n InvalidEscapeSequenceTemplate: _(\"Invalid escape sequence in template.\"),\n InvalidEscapedReservedWord: _<{| reservedWord: string |}>(\n ({ reservedWord }) => `Escape sequence in keyword ${reservedWord}.`,\n ),\n InvalidIdentifier: _<{| identifierName: string |}>(\n ({ identifierName }) => `Invalid identifier ${identifierName}.`,\n ),\n InvalidLhs: _<{| ancestor: LValAncestor |}>(\n ({ ancestor }) =>\n `Invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n ),\n InvalidLhsBinding: _<{| ancestor: LValAncestor |}>(\n ({ ancestor }) =>\n `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n ),\n InvalidNumber: _(\"Invalid number.\"),\n InvalidOrMissingExponent: _(\n \"Floating-point numbers require a valid exponent after the 'e'.\",\n ),\n InvalidOrUnexpectedToken: _<{| unexpected: string |}>(\n ({ unexpected }) => `Unexpected character '${unexpected}'.`,\n ),\n InvalidParenthesizedAssignment: _(\n \"Invalid parenthesized assignment pattern.\",\n ),\n InvalidPrivateFieldResolution: _<{| identifierName: string |}>(\n ({ identifierName }) => `Private name #${identifierName} is not defined.`,\n ),\n InvalidPropertyBindingPattern: _(\"Binding member expression.\"),\n InvalidRecordProperty: _(\n \"Only properties and spread elements are allowed in record definitions.\",\n ),\n InvalidRestAssignmentPattern: _(\"Invalid rest operator's argument.\"),\n LabelRedeclaration: _<{| labelName: string |}>(\n ({ labelName }) => `Label '${labelName}' is already declared.`,\n ),\n LetInLexicalBinding: _(\n \"'let' is not allowed to be used as a name in 'let' or 'const' declarations.\",\n ),\n LineTerminatorBeforeArrow: _(\"No line break is allowed before '=>'.\"),\n MalformedRegExpFlags: _(\"Invalid regular expression flag.\"),\n MissingClassName: _(\"A class name is required.\"),\n MissingEqInAssignment: _(\n \"Only '=' operator can be used for specifying default value.\",\n ),\n MissingSemicolon: _(\"Missing semicolon.\"),\n MissingPlugin: _<{| missingPlugin: [string] |}>(\n ({ missingPlugin }) =>\n `This experimental syntax requires enabling the parser plugin: ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n ),\n // FIXME: Would be nice to make this \"missingPlugins\" instead.\n // Also), seems like we can drop the \"(s)\" from the message and just make it \"s\".\n MissingOneOfPlugins: _<{| missingPlugin: string[] |}>(\n ({ missingPlugin }) =>\n `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n ),\n MissingUnicodeEscape: _(\"Expecting Unicode escape sequence \\\\uXXXX.\"),\n MixingCoalesceWithLogical: _(\n \"Nullish coalescing operator(??) requires parens when mixing with logical operators.\",\n ),\n ModuleAttributeDifferentFromType: _(\n \"The only accepted module attribute is `type`.\",\n ),\n ModuleAttributeInvalidValue: _(\n \"Only string literals are allowed as module attribute values.\",\n ),\n ModuleAttributesWithDuplicateKeys: _<{| key: string |}>(\n ({ key }) => `Duplicate key \"${key}\" is not allowed in module attributes.`,\n ),\n ModuleExportNameHasLoneSurrogate: _<{| surrogateCharCode: number |}>(\n ({ surrogateCharCode }) =>\n `An export name cannot include a lone surrogate, found '\\\\u${surrogateCharCode.toString(\n 16,\n )}'.`,\n ),\n ModuleExportUndefined: _<{| localName: string |}>(\n ({ localName }) => `Export '${localName}' is not defined.`,\n ),\n MultipleDefaultsInSwitch: _(\"Multiple default clauses.\"),\n NewlineAfterThrow: _(\"Illegal newline after throw.\"),\n NoCatchOrFinally: _(\"Missing catch or finally clause.\"),\n NumberIdentifier: _(\"Identifier directly after number.\"),\n NumericSeparatorInEscapeSequence: _(\n \"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.\",\n ),\n ObsoleteAwaitStar: _(\n \"'await*' has been removed from the async functions proposal. Use Promise.all() instead.\",\n ),\n OptionalChainingNoNew: _(\n \"Constructors in/after an Optional Chain are not allowed.\",\n ),\n OptionalChainingNoTemplate: _(\n \"Tagged Template Literals are not allowed in optionalChain.\",\n ),\n OverrideOnConstructor: _(\n \"'override' modifier cannot appear on a constructor declaration.\",\n ),\n ParamDupe: _(\"Argument name clash.\"),\n PatternHasAccessor: _(\"Object pattern can't contain getter or setter.\"),\n PatternHasMethod: _(\"Object pattern can't contain methods.\"),\n PrivateInExpectedIn: _<{| identifierName: string |}>(\n ({ identifierName }) =>\n `Private names are only allowed in property accesses (\\`obj.#${identifierName}\\`) or in \\`in\\` expressions (\\`#${identifierName} in obj\\`).`,\n ),\n PrivateNameRedeclaration: _<{| identifierName: string |}>(\n ({ identifierName }) => `Duplicate private name #${identifierName}.`,\n ),\n RecordExpressionBarIncorrectEndSyntaxType: _(\n \"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n ),\n RecordExpressionBarIncorrectStartSyntaxType: _(\n \"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n ),\n RecordExpressionHashIncorrectStartSyntaxType: _(\n \"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n ),\n RecordNoProto: _(\"'__proto__' is not allowed in Record expressions.\"),\n RestTrailingComma: _(\"Unexpected trailing comma after rest element.\"),\n SloppyFunction: _(\n \"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.\",\n ),\n StaticPrototype: _(\"Classes may not have static property named prototype.\"),\n SuperNotAllowed: _(\n \"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?\",\n ),\n SuperPrivateField: _(\"Private fields can't be accessed on super.\"),\n TrailingDecorator: _(\"Decorators must be attached to a class element.\"),\n TupleExpressionBarIncorrectEndSyntaxType: _(\n \"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n ),\n TupleExpressionBarIncorrectStartSyntaxType: _(\n \"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n ),\n TupleExpressionHashIncorrectStartSyntaxType: _(\n \"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n ),\n UnexpectedArgumentPlaceholder: _(\"Unexpected argument placeholder.\"),\n UnexpectedAwaitAfterPipelineBody: _(\n 'Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal.',\n ),\n UnexpectedDigitAfterHash: _(\"Unexpected digit after hash token.\"),\n UnexpectedImportExport: _(\n \"'import' and 'export' may only appear at the top level.\",\n ),\n UnexpectedKeyword: _<{| keyword: string |}>(\n ({ keyword }) => `Unexpected keyword '${keyword}'.`,\n ),\n UnexpectedLeadingDecorator: _(\n \"Leading decorators must be attached to a class declaration.\",\n ),\n UnexpectedLexicalDeclaration: _(\n \"Lexical declaration cannot appear in a single-statement context.\",\n ),\n UnexpectedNewTarget: _(\n \"`new.target` can only be used in functions or class properties.\",\n ),\n UnexpectedNumericSeparator: _(\n \"A numeric separator is only allowed between two digits.\",\n ),\n UnexpectedPrivateField: _(\"Unexpected private name.\"),\n UnexpectedReservedWord: _<{| reservedWord: string |}>(\n ({ reservedWord }) => `Unexpected reserved word '${reservedWord}'.`,\n ),\n UnexpectedSuper: _(\"'super' is only allowed in object methods and classes.\"),\n UnexpectedToken: _<{|\n expected?: ?string,\n unexpected?: ?string,\n |}>(\n ({ expected, unexpected }) =>\n `Unexpected token${unexpected ? ` '${unexpected}'.` : \"\"}${\n expected ? `, expected \"${expected}\"` : \"\"\n }`,\n ),\n UnexpectedTokenUnaryExponentiation: _(\n \"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.\",\n ),\n UnsupportedBind: _(\"Binding should be performed on object property.\"),\n UnsupportedDecoratorExport: _(\n \"A decorated export must export a class declaration.\",\n ),\n UnsupportedDefaultExport: _(\n \"Only expressions, functions or classes are allowed as the `default` export.\",\n ),\n UnsupportedImport: _(\n \"`import` can only be used in `import()` or `import.meta`.\",\n ),\n UnsupportedMetaProperty: _<{|\n target: string,\n onlyValidPropertyName: string,\n |}>(\n ({ target, onlyValidPropertyName }) =>\n `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,\n ),\n UnsupportedParameterDecorator: _(\n \"Decorators cannot be used to decorate parameters.\",\n ),\n UnsupportedPropertyDecorator: _(\n \"Decorators cannot be used to decorate object literal properties.\",\n ),\n UnsupportedSuper: _(\n \"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).\",\n ),\n UnterminatedComment: _(\"Unterminated comment.\"),\n UnterminatedRegExp: _(\"Unterminated regular expression.\"),\n UnterminatedString: _(\"Unterminated string constant.\"),\n UnterminatedTemplate: _(\"Unterminated template.\"),\n VarRedeclaration: _<{| identifierName: string |}>(\n ({ identifierName }) =>\n `Identifier '${identifierName}' has already been declared.`,\n ),\n YieldBindingIdentifier: _(\n \"Can not use 'yield' as identifier inside a generator.\",\n ),\n YieldInParameter: _(\"Yield expression is not allowed in formal parameters.\"),\n ZeroDigitNumericSeparator: _(\n \"Numeric separator can not be used after leading 0.\",\n ),\n});\n","// @flow\n\nimport { toParseErrorCredentials } from \"../parse-error\";\n\nexport default (_: typeof toParseErrorCredentials) => ({\n StrictDelete: _(\"Deleting local variable in strict mode.\"),\n\n // `referenceName` is the StringValue[1] of an IdentifierReference[2], which\n // is represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-IdentifierReference\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArguments: _<{| referenceName: string |}>(\n ({ referenceName }) => `Assigning to '${referenceName}' in strict mode.`,\n ),\n // `bindingName` is the StringValue[1] of a BindingIdentifier[2], which is\n // represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-BindingIdentifier\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArgumentsBinding: _<{| bindingName: string |}>(\n ({ bindingName }) => `Binding '${bindingName}' in strict mode.`,\n ),\n\n StrictFunction: _(\n \"In strict mode code, functions can only be declared at top level or inside a block.\",\n ),\n StrictNumericEscape: _(\n \"The only valid numeric escape in strict mode is '\\\\0'.\",\n ),\n StrictOctalLiteral: _(\n \"Legacy octal literals are not allowed in strict mode.\",\n ),\n StrictWith: _(\"'with' in strict mode.\"),\n});\n","// @flow\n\nimport { toParseErrorCredentials } from \"../parse-error\";\nimport toNodeDescription from \"./to-node-description\";\n\nexport const UnparenthesizedPipeBodyDescriptions = new Set([\n \"ArrowFunctionExpression\",\n \"AssignmentExpression\",\n \"ConditionalExpression\",\n \"YieldExpression\",\n]);\n\nexport default (_: typeof toParseErrorCredentials) => ({\n // This error is only used by the smart-mix proposal\n PipeBodyIsTighter: _(\n \"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.\",\n ),\n PipeTopicRequiresHackPipes: _(\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n ),\n PipeTopicUnbound: _(\n \"Topic reference is unbound; it must be inside a pipe body.\",\n ),\n PipeTopicUnconfiguredToken: _<{| token: string |}>(\n ({ token }) =>\n `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { \"proposal\": \"hack\", \"topicToken\": \"${token}\" }.`,\n ),\n PipeTopicUnused: _(\n \"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.\",\n ),\n PipeUnparenthesizedBody: _<{| type: string |}>(\n ({ type }) =>\n `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({\n type,\n })}; please wrap it in parentheses.`,\n ),\n\n // Messages whose codes start with “Pipeline” or “PrimaryTopic”\n // are retained for backwards compatibility\n // with the deprecated smart-mix pipe operator proposal plugin.\n // They are subject to removal in a future major version.\n PipelineBodyNoArrow: _(\n 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized.',\n ),\n PipelineBodySequenceExpression: _(\n \"Pipeline body may not be a comma-separated sequence expression.\",\n ),\n PipelineHeadSequenceExpression: _(\n \"Pipeline head should not be a comma-separated sequence expression.\",\n ),\n PipelineTopicUnused: _(\n \"Pipeline is in topic style but does not use topic reference.\",\n ),\n PrimaryTopicNotAllowed: _(\n \"Topic reference was used in a lexical context without topic binding.\",\n ),\n PrimaryTopicRequiresSmartPipeline: _(\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n ),\n});\n","// @flow\n\nimport { Position } from \"./util/location\";\nimport type { NodeBase } from \"./types\";\nimport {\n instantiate,\n type ParseErrorCode,\n ParseErrorCodes,\n type ParseErrorCredentials,\n} from \"./parse-error/credentials\";\n\n// Babel uses \"normal\" SyntaxErrors for it's errors, but adds some extra\n// functionality. This functionality is defined in the\n// `ParseErrorSpecification` interface below. We may choose to change to someday\n// give our errors their own full-blown class, but until then this allow us to\n// keep all the desirable properties of SyntaxErrors (like their name in stack\n// traces, etc.), and also allows us to punt on any publicly facing\n// class-hierarchy decisions until Babel 8.\ninterface ParseErrorSpecification {\n // Look, these *could* be readonly, but then Flow complains when we initially\n // set them. We could do a whole dance and make a special interface that's not\n // readonly for when we create the error, then cast it to the readonly\n // interface for public use, but the previous implementation didn't have them\n // as readonly, so let's just not worry about it for now.\n code: ParseErrorCode;\n reasonCode: string;\n syntaxPlugin?: string;\n\n missingPlugin?: string | string[];\n\n loc: Position;\n details: ErrorDetails;\n\n // We should consider removing this as it now just contains the same\n // information as `loc.index`.\n // pos: number;\n}\n\nexport type ParseError = SyntaxError &\n ParseErrorSpecification;\n\n// By `ParseErrorConstructor`, we mean something like the new-less style\n// `ErrorConstructor`[1], since `ParseError`'s are not themselves actually\n// separate classes from `SyntaxError`'s.\n//\n// 1. https://github.com/microsoft/TypeScript/blob/v4.5.5/lib/lib.es5.d.ts#L1027\nexport type ParseErrorConstructor = ({\n loc: Position,\n details: ErrorDetails,\n}) => ParseError;\n\nfunction toParseErrorConstructor({\n toMessage,\n ...properties\n}: ParseErrorCredentials): ParseErrorConstructor {\n type ConstructorArgument = { loc: Position, details: ErrorDetails };\n return function constructor({ loc, details }: ConstructorArgument) {\n return instantiate>(\n SyntaxError,\n { ...properties, loc },\n {\n clone(overrides: { loc?: Position, details?: ErrorDetails } = {}) {\n const loc = overrides.loc || {};\n return constructor({\n loc: new Position(\n \"line\" in loc ? loc.line : this.loc.line,\n \"column\" in loc ? loc.column : this.loc.column,\n \"index\" in loc ? loc.index : this.loc.index,\n ),\n details: { ...this.details, ...overrides.details },\n });\n },\n details: { value: details, enumerable: false },\n message: {\n get() {\n return `${toMessage(this.details)} (${this.loc.line}:${\n this.loc.column\n })`;\n },\n set(value: string) {\n Object.defineProperty(this, \"message\", { value });\n },\n },\n pos: { reflect: \"loc.index\", enumerable: true },\n missingPlugin: \"missingPlugin\" in details && {\n reflect: \"details.missingPlugin\",\n enumerable: true,\n },\n },\n );\n };\n}\n\n// This part is tricky. You'll probably notice from the name of this function\n// that it is supposed to return `ParseErrorCredentials`, but instead these.\n// declarations seem to instead imply that they return\n// `ParseErrorConstructor` instead. This is because in Flow we\n// can't easily extract parameter types (either from functions, like with\n// Typescript's Parameters utility type, or from generic types either). As\n// such, this function does double duty: packaging up the credentials during\n// its actual runtime operation, but pretending to return the\n// `ParseErrorConstructor` that we won't actually have until later\n// to the type system, avoiding the need to do so with $ObjMap (which doesn't\n// work) in `ParseErrorEnum`. This hack won't be necessary when we switch to\n// Typescript.\ndeclare function toParseErrorCredentials(\n T,\n ?{ code?: ParseErrorCode, reasonCode?: string } | boolean,\n): ParseErrorConstructor<{||}>;\n\n// ESLint seems to erroneously think that Flow's overloading syntax is an\n// accidental redeclaration of the function:\n// https://github.com/babel/eslint-plugin-babel/issues/162\n// eslint-disable-next-line no-redeclare\ndeclare function toParseErrorCredentials(\n (ErrorDetails) => string,\n ?{ code?: ParseErrorCode, reasonCode?: string } | boolean,\n): ParseErrorConstructor;\n\n// See comment about eslint and Flow overloading above.\n// eslint-disable-next-line no-redeclare\nexport function toParseErrorCredentials(toMessageOrMessage, credentials) {\n return {\n toMessage:\n typeof toMessageOrMessage === \"string\"\n ? () => toMessageOrMessage\n : toMessageOrMessage,\n ...credentials,\n };\n}\n\n// This is the templated form.\ndeclare function ParseErrorEnum(string[]): typeof ParseErrorEnum;\n\n// See comment about eslint and Flow overloading above.\n// eslint-disable-next-line no-redeclare\ndeclare function ParseErrorEnum(\n toParseErrorCredentials: (typeof toParseErrorCredentials) => T,\n syntaxPlugin?: string,\n): T;\n\n// You call `ParseErrorEnum` with a mapping from `ReasonCode`'s to either error\n// messages, or `toMessage` functions that define additional necessary `details`\n// needed by the `ParseError`:\n//\n// ParseErrorEnum`optionalSyntaxPlugin` (_ => ({\n// ErrorWithStaticMessage: _(\"message\"),\n// ErrorWithDynamicMessage: _<{ type: string }>(({ type }) => `${type}`),\n// });\n//\n// See comment about eslint and Flow overloading above.\n// eslint-disable-next-line no-redeclare\nexport function ParseErrorEnum(argument, syntaxPlugin) {\n // If the first parameter is an array, that means we were called with a tagged\n // template literal. Extract the syntaxPlugin from this, and call again in\n // the \"normalized\" form.\n if (Array.isArray(argument)) {\n return toParseErrorCredentialsMap =>\n ParseErrorEnum(toParseErrorCredentialsMap, argument[0]);\n }\n\n const partialCredentials = argument(toParseErrorCredentials);\n const ParseErrorConstructors = {};\n\n for (const reasonCode of Object.keys(partialCredentials)) {\n ParseErrorConstructors[reasonCode] = toParseErrorConstructor({\n code: ParseErrorCodes.SyntaxError,\n reasonCode,\n ...(syntaxPlugin ? { syntaxPlugin } : {}),\n ...partialCredentials[reasonCode],\n });\n }\n\n return ParseErrorConstructors;\n}\n\nexport type RaiseProperties = {|\n ...ErrorDetails,\n at: Position | NodeBase,\n|};\n\nimport ModuleErrors from \"./parse-error/module-errors\";\nimport StandardErrors from \"./parse-error/standard-errors\";\nimport StrictModeErrors from \"./parse-error/strict-mode-errors\";\nimport PipelineOperatorErrors from \"./parse-error/pipeline-operator-errors\";\n\nexport const Errors = {\n ...ParseErrorEnum(ModuleErrors),\n ...ParseErrorEnum(StandardErrors),\n ...ParseErrorEnum(StrictModeErrors),\n ...ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors),\n};\n\nexport type { LValAncestor } from \"./parse-error/standard-errors\";\n\nexport * from \"./parse-error/credentials\";\n","// @flow\n\nimport { type TokenType } from \"../tokenizer/types\";\nimport type Parser from \"../parser\";\nimport type { ExpressionErrors } from \"../parser/util\";\nimport * as N from \"../types\";\nimport type { Node as NodeType, NodeBase, File } from \"../types\";\nimport type { Position } from \"../util/location\";\nimport { Errors } from \"../parse-error\";\n\nconst { defineProperty } = Object;\nconst toUnenumerable = (object, key) =>\n defineProperty(object, key, { enumerable: false, value: object[key] });\n\nfunction toESTreeLocation(node: any) {\n toUnenumerable(node.loc.start, \"index\");\n toUnenumerable(node.loc.end, \"index\");\n\n return node;\n}\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n parse(): File {\n const file = toESTreeLocation(super.parse());\n\n if (this.options.tokens) {\n file.tokens = file.tokens.map(toESTreeLocation);\n }\n\n return file;\n }\n\n parseRegExpLiteral({ pattern, flags }): N.Node {\n let regex = null;\n try {\n regex = new RegExp(pattern, flags);\n } catch (e) {\n // In environments that don't support these flags value will\n // be null as the regex can't be represented natively.\n }\n const node = this.estreeParseLiteral(regex);\n node.regex = { pattern, flags };\n\n return node;\n }\n\n parseBigIntLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/es2020.md#bigintliteral\n let bigInt;\n try {\n // $FlowIgnore\n bigInt = BigInt(value);\n } catch {\n bigInt = null;\n }\n const node = this.estreeParseLiteral(bigInt);\n node.bigint = String(node.value || value);\n\n return node;\n }\n\n parseDecimalLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/experimental/decimal.md\n // todo: use BigDecimal when node supports it.\n const decimal = null;\n const node = this.estreeParseLiteral(decimal);\n node.decimal = String(node.value || value);\n\n return node;\n }\n\n estreeParseLiteral(value: any) {\n return this.parseLiteral(value, \"Literal\");\n }\n\n parseStringLiteral(value: any): N.Node {\n return this.estreeParseLiteral(value);\n }\n\n parseNumericLiteral(value: any): any {\n return this.estreeParseLiteral(value);\n }\n\n parseNullLiteral(): N.Node {\n return this.estreeParseLiteral(null);\n }\n\n parseBooleanLiteral(value: boolean): N.BooleanLiteral {\n return this.estreeParseLiteral(value);\n }\n\n directiveToStmt(directive: N.Directive): N.ExpressionStatement {\n const directiveLiteral = directive.value;\n\n const stmt = this.startNodeAt(directive.start, directive.loc.start);\n const expression = this.startNodeAt(\n directiveLiteral.start,\n directiveLiteral.loc.start,\n );\n\n expression.value = directiveLiteral.extra.expressionValue;\n expression.raw = directiveLiteral.extra.raw;\n\n stmt.expression = this.finishNodeAt(\n expression,\n \"Literal\",\n directiveLiteral.loc.end,\n );\n stmt.directive = directiveLiteral.extra.raw.slice(1, -1);\n\n return this.finishNodeAt(stmt, \"ExpressionStatement\", directive.loc.end);\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n initFunction(\n node: N.BodilessFunctionOrMethodBase,\n isAsync: ?boolean,\n ): void {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n\n checkDeclaration(node: N.Pattern | N.ObjectProperty): void {\n if (node != null && this.isObjectProperty(node)) {\n this.checkDeclaration(((node: any): N.EstreeProperty).value);\n } else {\n super.checkDeclaration(node);\n }\n }\n\n getObjectOrClassMethodParams(method: N.ObjectMethod | N.ClassMethod) {\n return ((method: any): N.EstreeProperty | N.EstreeMethodDefinition).value\n .params;\n }\n\n isValidDirective(stmt: N.Statement): boolean {\n return (\n stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"Literal\" &&\n typeof stmt.expression.value === \"string\" &&\n !stmt.expression.extra?.parenthesized\n );\n }\n\n parseBlockBody(\n node: N.BlockStatementLike,\n ...args: [?boolean, boolean, TokenType, void | (boolean => void)]\n ): void {\n super.parseBlockBody(node, ...args);\n\n const directiveStatements = node.directives.map(d =>\n this.directiveToStmt(d),\n );\n node.body = directiveStatements.concat(node.body);\n // $FlowIgnore - directives isn't optional in the type definition\n delete node.directives;\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n this.parseMethod(\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n \"ClassMethod\",\n true,\n );\n if (method.typeParameters) {\n // $FlowIgnore\n method.value.typeParameters = method.typeParameters;\n delete method.typeParameters;\n }\n classBody.body.push(method);\n }\n\n parsePrivateName(): any {\n const node = super.parsePrivateName();\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return node;\n }\n }\n return this.convertPrivateNameToPrivateIdentifier(node);\n }\n\n convertPrivateNameToPrivateIdentifier(\n node: N.PrivateName,\n ): N.EstreePrivateIdentifier {\n const name = super.getPrivateNameSV(node);\n node = (node: any);\n delete node.id;\n node.name = name;\n node.type = \"PrivateIdentifier\";\n return node;\n }\n\n isPrivateName(node: N.Node): boolean {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.isPrivateName(node);\n }\n }\n return node.type === \"PrivateIdentifier\";\n }\n\n getPrivateNameSV(node: N.Node): string {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.getPrivateNameSV(node);\n }\n }\n return node.name;\n }\n\n parseLiteral(value: any, type: $ElementType): T {\n const node = super.parseLiteral(value, type);\n node.raw = node.extra.raw;\n delete node.extra;\n\n return node;\n }\n\n parseFunctionBody(\n node: N.Function,\n allowExpression: ?boolean,\n isMethod?: boolean = false,\n ): void {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n parseMethod(\n node: T,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: string,\n inClassScope: boolean = false,\n ): T {\n let funcNode = this.startNode();\n funcNode.kind = node.kind; // provide kind, so super method correctly sets state\n funcNode = super.parseMethod(\n funcNode,\n isGenerator,\n isAsync,\n isConstructor,\n allowDirectSuper,\n type,\n inClassScope,\n );\n funcNode.type = \"FunctionExpression\";\n delete funcNode.kind;\n // $FlowIgnore\n node.value = funcNode;\n if (type === \"ClassPrivateMethod\") {\n // $FlowIgnore\n node.computed = false;\n }\n type = \"MethodDefinition\";\n return this.finishNode(node, type);\n }\n\n parseClassProperty(...args: [N.ClassProperty]): any {\n const propertyNode = (super.parseClassProperty(...args): any);\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return (propertyNode: N.EstreePropertyDefinition);\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n return (propertyNode: N.EstreePropertyDefinition);\n }\n\n parseClassPrivateProperty(...args: [N.ClassPrivateProperty]): any {\n const propertyNode = (super.parseClassPrivateProperty(...args): any);\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return (propertyNode: N.EstreePropertyDefinition);\n }\n }\n propertyNode.type = \"PropertyDefinition\";\n propertyNode.computed = false;\n return (propertyNode: N.EstreePropertyDefinition);\n }\n\n parseObjectMethod(\n prop: N.ObjectMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n ): ?N.ObjectMethod {\n const node: N.EstreeProperty = (super.parseObjectMethod(\n prop,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n ): any);\n\n if (node) {\n node.type = \"Property\";\n if (((node: any): N.ClassMethod).kind === \"method\") node.kind = \"init\";\n node.shorthand = false;\n }\n\n return (node: any);\n }\n\n parseObjectProperty(\n prop: N.ObjectProperty,\n startPos: ?number,\n startLoc: ?Position,\n isPattern: boolean,\n refExpressionErrors: ?ExpressionErrors,\n ): ?N.ObjectProperty {\n const node: N.EstreeProperty = (super.parseObjectProperty(\n prop,\n startPos,\n startLoc,\n isPattern,\n refExpressionErrors,\n ): any);\n\n if (node) {\n node.kind = \"init\";\n node.type = \"Property\";\n }\n\n return (node: any);\n }\n\n isValidLVal(type: string, ...rest) {\n return type === \"Property\" ? \"value\" : super.isValidLVal(type, ...rest);\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n if (node != null && this.isObjectProperty(node)) {\n return this.isAssignable(node.value, isBinding);\n }\n return super.isAssignable(node, isBinding);\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): void {\n if (node != null && this.isObjectProperty(node)) {\n const { key, value } = node;\n if (this.isPrivateName(key)) {\n this.classScope.usePrivateName(\n this.getPrivateNameSV(key),\n key.loc.start,\n );\n }\n this.toAssignable(value, isLHS);\n } else {\n super.toAssignable(node, isLHS);\n }\n }\n\n toAssignableObjectExpressionProp(prop: N.Node) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n this.raise(Errors.PatternHasAccessor, { at: prop.key });\n } else if (prop.method) {\n this.raise(Errors.PatternHasMethod, { at: prop.key });\n } else {\n super.toAssignableObjectExpressionProp(...arguments);\n }\n }\n\n finishCallExpression(\n node: T,\n optional: boolean,\n ): N.Expression {\n super.finishCallExpression(node, optional);\n\n if (node.callee.type === \"Import\") {\n ((node: N.Node): N.EstreeImportExpression).type = \"ImportExpression\";\n ((node: N.Node): N.EstreeImportExpression).source = node.arguments[0];\n if (this.hasPlugin(\"importAssertions\")) {\n ((node: N.Node): N.EstreeImportExpression).attributes =\n node.arguments[1] ?? null;\n }\n // $FlowIgnore - arguments isn't optional in the type definition\n delete node.arguments;\n // $FlowIgnore - callee isn't optional in the type definition\n delete node.callee;\n }\n\n return node;\n }\n\n toReferencedArguments(\n node:\n | N.CallExpression\n | N.OptionalCallExpression\n | N.EstreeImportExpression,\n /* isParenthesizedExpr?: boolean, */\n ) {\n // ImportExpressions do not have an arguments array.\n if (node.type === \"ImportExpression\") {\n return;\n }\n\n super.toReferencedArguments(node);\n }\n\n parseExport(node: N.Node) {\n super.parseExport(node);\n\n switch (node.type) {\n case \"ExportAllDeclaration\":\n node.exported = null;\n break;\n\n case \"ExportNamedDeclaration\":\n if (\n node.specifiers.length === 1 &&\n node.specifiers[0].type === \"ExportNamespaceSpecifier\"\n ) {\n node.type = \"ExportAllDeclaration\";\n node.exported = node.specifiers[0].exported;\n delete node.specifiers;\n }\n\n break;\n }\n\n return node;\n }\n\n parseSubscript(\n base: N.Expression,\n startPos: number,\n startLoc: Position,\n noCalls: ?boolean,\n state: N.ParseSubscriptState,\n ) {\n const node = super.parseSubscript(\n base,\n startPos,\n startLoc,\n noCalls,\n state,\n );\n\n if (state.optionalChainMember) {\n // https://github.com/estree/estree/blob/master/es2020.md#chainexpression\n if (\n node.type === \"OptionalMemberExpression\" ||\n node.type === \"OptionalCallExpression\"\n ) {\n node.type = node.type.substring(8); // strip Optional prefix\n }\n if (state.stop) {\n const chain = this.startNodeAtNode(node);\n chain.expression = node;\n return this.finishNode(chain, \"ChainExpression\");\n }\n } else if (\n node.type === \"MemberExpression\" ||\n node.type === \"CallExpression\"\n ) {\n node.optional = false;\n }\n\n return node;\n }\n\n hasPropertyAsPrivateName(node: N.Node): boolean {\n if (node.type === \"ChainExpression\") {\n node = node.expression;\n }\n return super.hasPropertyAsPrivateName(node);\n }\n\n isOptionalChain(node: N.Node): boolean {\n return node.type === \"ChainExpression\";\n }\n\n isObjectProperty(node: N.Node): boolean {\n return node.type === \"Property\" && node.kind === \"init\" && !node.method;\n }\n\n isObjectMethod(node: N.Node): boolean {\n return node.method || node.kind === \"get\" || node.kind === \"set\";\n }\n\n finishNodeAt(node: T, type: string, endLoc: Position): T {\n return toESTreeLocation(super.finishNodeAt(node, type, endLoc));\n }\n\n resetEndLocation(\n node: NodeBase,\n endLoc?: Position = this.state.lastTokEndLoc,\n ): void {\n super.resetEndLocation(node, endLoc);\n toESTreeLocation(node);\n }\n };\n","// @flow\n\n// The token context is used in JSX plugin to track\n// jsx tag / jsx text / normal JavaScript expression\n\nexport class TokContext {\n constructor(token: string, preserveSpace?: boolean) {\n this.token = token;\n this.preserveSpace = !!preserveSpace;\n }\n\n token: string;\n preserveSpace: boolean;\n}\n\nconst types: {\n [key: string]: TokContext,\n} = {\n brace: new TokContext(\"{\"), // normal JavaScript expression\n j_oTag: new TokContext(\"...\", true), // JSX expressions\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n types.template = new TokContext(\"`\", true);\n}\n\nexport { types };\n","// @flow\nimport { types as tc, type TokContext } from \"./context\";\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between 1) binary\n// expression (<) and JSX Tag start (); 2) object literal and JSX\n// texts. It is set on the `updateContext` function in the JSX plugin.\n\n// The `startsExpr` property is used to determine whether an expression\n// may be the “argument” subexpression of a `yield` expression or\n// `yield` statement. It is set on all token types that may be at the\n// start of a subexpression.\n\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\n\ntype TokenOptions = {\n keyword?: string,\n beforeExpr?: boolean,\n startsExpr?: boolean,\n rightAssociative?: boolean,\n isLoop?: boolean,\n isAssign?: boolean,\n prefix?: boolean,\n postfix?: boolean,\n binop?: ?number,\n};\n\n// Internally the tokenizer stores token as a number\nexport opaque type TokenType = number;\n\n// The `ExportedTokenType` is exported via `tokTypes` and accessible\n// when `tokens: true` is enabled. Unlike internal token type, it provides\n// metadata of the tokens.\nexport class ExportedTokenType {\n label: string;\n keyword: ?string;\n beforeExpr: boolean;\n startsExpr: boolean;\n rightAssociative: boolean;\n isLoop: boolean;\n isAssign: boolean;\n prefix: boolean;\n postfix: boolean;\n binop: ?number;\n // todo(Babel 8): remove updateContext from exposed token layout\n declare updateContext: ?(context: Array) => void;\n\n constructor(label: string, conf: TokenOptions = {}) {\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n if (!process.env.BABEL_8_BREAKING) {\n this.updateContext = null;\n }\n }\n}\n\n// A map from keyword/keyword-like string value to the token type\nexport const keywords = new Map();\n\nfunction createKeyword(name: string, options: TokenOptions = {}): TokenType {\n options.keyword = name;\n const token = createToken(name, options);\n keywords.set(name, token);\n return token;\n}\n\nfunction createBinop(name: string, binop: number) {\n return createToken(name, { beforeExpr, binop });\n}\n\nlet tokenTypeCounter = -1;\nexport const tokenTypes: ExportedTokenType[] = [];\nconst tokenLabels: string[] = [];\nconst tokenBinops: number[] = [];\nconst tokenBeforeExprs: boolean[] = [];\nconst tokenStartsExprs: boolean[] = [];\nconst tokenPrefixes: boolean[] = [];\n\nfunction createToken(name: string, options: TokenOptions = {}): TokenType {\n ++tokenTypeCounter;\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n tokenTypes.push(new ExportedTokenType(name, options));\n\n return tokenTypeCounter;\n}\n\nfunction createKeywordLike(\n name: string,\n options: TokenOptions = {},\n): TokenType {\n ++tokenTypeCounter;\n keywords.set(name, tokenTypeCounter);\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n // In the exported token type, we set the label as \"name\" for backward compatibility with Babel 7\n tokenTypes.push(new ExportedTokenType(\"name\", options));\n\n return tokenTypeCounter;\n}\n\n// For performance the token type helpers depend on the following declarations order.\n// When adding new token types, please also check if the token helpers need update.\n\nexport const tt: { [name: string]: TokenType } = {\n // Punctuation token types.\n bracketL: createToken(\"[\", { beforeExpr, startsExpr }),\n bracketHashL: createToken(\"#[\", { beforeExpr, startsExpr }),\n bracketBarL: createToken(\"[|\", { beforeExpr, startsExpr }),\n bracketR: createToken(\"]\"),\n bracketBarR: createToken(\"|]\"),\n braceL: createToken(\"{\", { beforeExpr, startsExpr }),\n braceBarL: createToken(\"{|\", { beforeExpr, startsExpr }),\n braceHashL: createToken(\"#{\", { beforeExpr, startsExpr }),\n braceR: createToken(\"}\", { beforeExpr }),\n braceBarR: createToken(\"|}\"),\n parenL: createToken(\"(\", { beforeExpr, startsExpr }),\n parenR: createToken(\")\"),\n comma: createToken(\",\", { beforeExpr }),\n semi: createToken(\";\", { beforeExpr }),\n colon: createToken(\":\", { beforeExpr }),\n doubleColon: createToken(\"::\", { beforeExpr }),\n dot: createToken(\".\"),\n question: createToken(\"?\", { beforeExpr }),\n questionDot: createToken(\"?.\"),\n arrow: createToken(\"=>\", { beforeExpr }),\n template: createToken(\"template\"),\n ellipsis: createToken(\"...\", { beforeExpr }),\n backQuote: createToken(\"`\", { startsExpr }),\n dollarBraceL: createToken(\"${\", { beforeExpr, startsExpr }),\n // start: isTemplate\n templateTail: createToken(\"...`\", { startsExpr }),\n templateNonTail: createToken(\"...${\", { beforeExpr, startsExpr }),\n // end: isTemplate\n at: createToken(\"@\"),\n hash: createToken(\"#\", { startsExpr }),\n\n // Special hashbang token.\n interpreterDirective: createToken(\"#!...\"),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n // start: isAssign\n eq: createToken(\"=\", { beforeExpr, isAssign }),\n assign: createToken(\"_=\", { beforeExpr, isAssign }),\n slashAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // These are only needed to support % and ^ as a Hack-pipe topic token.\n // When the proposal settles on a token, the others can be merged with\n // tt.assign.\n xorAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n moduloAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // end: isAssign\n\n incDec: createToken(\"++/--\", { prefix, postfix, startsExpr }),\n bang: createToken(\"!\", { beforeExpr, prefix, startsExpr }),\n tilde: createToken(\"~\", { beforeExpr, prefix, startsExpr }),\n\n // More possible topic tokens.\n // When the proposal settles on a token, at least one of these may be removed.\n doubleCaret: createToken(\"^^\", { startsExpr }),\n doubleAt: createToken(\"@@\", { startsExpr }),\n\n // start: isBinop\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n lt: createBinop(\"/<=/>=\", 7),\n gt: createBinop(\"/<=/>=\", 7),\n relational: createBinop(\"/<=/>=\", 7),\n bitShift: createBinop(\"<>/>>>\", 8),\n bitShiftL: createBinop(\"<>/>>>\", 8),\n bitShiftR: createBinop(\"<>/>>>\", 8),\n plusMin: createToken(\"+/-\", { beforeExpr, binop: 9, prefix, startsExpr }),\n // startsExpr: required by v8intrinsic plugin\n modulo: createToken(\"%\", { binop: 10, startsExpr }),\n // unset `beforeExpr` as it can be `function *`\n star: createToken(\"*\", { binop: 10 }),\n slash: createBinop(\"/\", 10),\n exponent: createToken(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true,\n }),\n\n // Keywords\n // Don't forget to update packages/babel-helper-validator-identifier/src/keyword.js\n // when new keywords are added\n // start: isLiteralPropertyName\n // start: isKeyword\n _in: createKeyword(\"in\", { beforeExpr, binop: 7 }),\n _instanceof: createKeyword(\"instanceof\", { beforeExpr, binop: 7 }),\n // end: isBinop\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", { beforeExpr }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", { beforeExpr }),\n _else: createKeyword(\"else\", { beforeExpr }),\n _finally: createKeyword(\"finally\"),\n _function: createKeyword(\"function\", { startsExpr }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", { beforeExpr }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", { beforeExpr, prefix, startsExpr }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", { beforeExpr, startsExpr }),\n _this: createKeyword(\"this\", { startsExpr }),\n _super: createKeyword(\"super\", { startsExpr }),\n _class: createKeyword(\"class\", { startsExpr }),\n _extends: createKeyword(\"extends\", { beforeExpr }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", { startsExpr }),\n _null: createKeyword(\"null\", { startsExpr }),\n _true: createKeyword(\"true\", { startsExpr }),\n _false: createKeyword(\"false\", { startsExpr }),\n _typeof: createKeyword(\"typeof\", { beforeExpr, prefix, startsExpr }),\n _void: createKeyword(\"void\", { beforeExpr, prefix, startsExpr }),\n _delete: createKeyword(\"delete\", { beforeExpr, prefix, startsExpr }),\n // start: isLoop\n _do: createKeyword(\"do\", { isLoop, beforeExpr }),\n _for: createKeyword(\"for\", { isLoop }),\n _while: createKeyword(\"while\", { isLoop }),\n // end: isLoop\n // end: isKeyword\n\n // Primary literals\n // start: isIdentifier\n _as: createKeywordLike(\"as\", { startsExpr }),\n _assert: createKeywordLike(\"assert\", { startsExpr }),\n _async: createKeywordLike(\"async\", { startsExpr }),\n _await: createKeywordLike(\"await\", { startsExpr }),\n _from: createKeywordLike(\"from\", { startsExpr }),\n _get: createKeywordLike(\"get\", { startsExpr }),\n _let: createKeywordLike(\"let\", { startsExpr }),\n _meta: createKeywordLike(\"meta\", { startsExpr }),\n _of: createKeywordLike(\"of\", { startsExpr }),\n _sent: createKeywordLike(\"sent\", { startsExpr }),\n _set: createKeywordLike(\"set\", { startsExpr }),\n _static: createKeywordLike(\"static\", { startsExpr }),\n _yield: createKeywordLike(\"yield\", { startsExpr }),\n\n // Flow and TypeScript Keywordlike\n _asserts: createKeywordLike(\"asserts\", { startsExpr }),\n _checks: createKeywordLike(\"checks\", { startsExpr }),\n _exports: createKeywordLike(\"exports\", { startsExpr }),\n _global: createKeywordLike(\"global\", { startsExpr }),\n _implements: createKeywordLike(\"implements\", { startsExpr }),\n _intrinsic: createKeywordLike(\"intrinsic\", { startsExpr }),\n _infer: createKeywordLike(\"infer\", { startsExpr }),\n _is: createKeywordLike(\"is\", { startsExpr }),\n _mixins: createKeywordLike(\"mixins\", { startsExpr }),\n _proto: createKeywordLike(\"proto\", { startsExpr }),\n _require: createKeywordLike(\"require\", { startsExpr }),\n // start: isTSTypeOperator\n _keyof: createKeywordLike(\"keyof\", { startsExpr }),\n _readonly: createKeywordLike(\"readonly\", { startsExpr }),\n _unique: createKeywordLike(\"unique\", { startsExpr }),\n // end: isTSTypeOperator\n // start: isTSDeclarationStart\n _abstract: createKeywordLike(\"abstract\", { startsExpr }),\n _declare: createKeywordLike(\"declare\", { startsExpr }),\n _enum: createKeywordLike(\"enum\", { startsExpr }),\n _module: createKeywordLike(\"module\", { startsExpr }),\n _namespace: createKeywordLike(\"namespace\", { startsExpr }),\n // start: isFlowInterfaceOrTypeOrOpaque\n _interface: createKeywordLike(\"interface\", { startsExpr }),\n _type: createKeywordLike(\"type\", { startsExpr }),\n // end: isTSDeclarationStart\n _opaque: createKeywordLike(\"opaque\", { startsExpr }),\n // end: isFlowInterfaceOrTypeOrOpaque\n name: createToken(\"name\", { startsExpr }),\n // end: isIdentifier\n\n string: createToken(\"string\", { startsExpr }),\n num: createToken(\"num\", { startsExpr }),\n bigint: createToken(\"bigint\", { startsExpr }),\n decimal: createToken(\"decimal\", { startsExpr }),\n // end: isLiteralPropertyName\n regexp: createToken(\"regexp\", { startsExpr }),\n privateName: createToken(\"#name\", { startsExpr }),\n eof: createToken(\"eof\"),\n\n // jsx plugin\n jsxName: createToken(\"jsxName\"),\n jsxText: createToken(\"jsxText\", { beforeExpr: true }),\n jsxTagStart: createToken(\"jsxTagStart\", { startsExpr: true }),\n jsxTagEnd: createToken(\"jsxTagEnd\"),\n\n // placeholder plugin\n placeholder: createToken(\"%%\", { startsExpr: true }),\n};\n\nexport function tokenIsIdentifier(token: TokenType): boolean {\n return token >= tt._as && token <= tt.name;\n}\n\nexport function tokenKeywordOrIdentifierIsKeyword(token: TokenType): boolean {\n // we can remove the token >= tt._in check when we\n // know a token is either keyword or identifier\n return token <= tt._while;\n}\n\nexport function tokenIsKeywordOrIdentifier(token: TokenType): boolean {\n return token >= tt._in && token <= tt.name;\n}\n\nexport function tokenIsLiteralPropertyName(token: TokenType): boolean {\n return token >= tt._in && token <= tt.decimal;\n}\n\nexport function tokenComesBeforeExpression(token: TokenType): boolean {\n return tokenBeforeExprs[token];\n}\n\nexport function tokenCanStartExpression(token: TokenType): boolean {\n return tokenStartsExprs[token];\n}\n\nexport function tokenIsAssignment(token: TokenType): boolean {\n return token >= tt.eq && token <= tt.moduloAssign;\n}\n\nexport function tokenIsFlowInterfaceOrTypeOrOpaque(token: TokenType): boolean {\n return token >= tt._interface && token <= tt._opaque;\n}\n\nexport function tokenIsLoop(token: TokenType): boolean {\n return token >= tt._do && token <= tt._while;\n}\n\nexport function tokenIsKeyword(token: TokenType): boolean {\n return token >= tt._in && token <= tt._while;\n}\n\nexport function tokenIsOperator(token: TokenType): boolean {\n return token >= tt.pipeline && token <= tt._instanceof;\n}\n\nexport function tokenIsPostfix(token: TokenType): boolean {\n return token === tt.incDec;\n}\n\nexport function tokenIsPrefix(token: TokenType): boolean {\n return tokenPrefixes[token];\n}\n\nexport function tokenIsTSTypeOperator(token: TokenType): boolean {\n return token >= tt._keyof && token <= tt._unique;\n}\n\nexport function tokenIsTSDeclarationStart(token: TokenType): boolean {\n return token >= tt._abstract && token <= tt._type;\n}\n\nexport function tokenLabelName(token: TokenType): string {\n return tokenLabels[token];\n}\n\nexport function tokenOperatorPrecedence(token: TokenType): number {\n return tokenBinops[token];\n}\n\nexport function tokenIsRightAssociative(token: TokenType): boolean {\n return token === tt.exponent;\n}\n\nexport function tokenIsTemplate(token: TokenType): boolean {\n return token >= tt.templateTail && token <= tt.templateNonTail;\n}\n\nexport function getExportedToken(token: TokenType): ExportedTokenType {\n return tokenTypes[token];\n}\n\nexport function isTokenType(obj: any): boolean {\n return typeof obj === \"number\";\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n tokenTypes[tt.braceR].updateContext = context => {\n context.pop();\n };\n\n tokenTypes[tt.braceL].updateContext =\n tokenTypes[tt.braceHashL].updateContext =\n tokenTypes[tt.dollarBraceL].updateContext =\n context => {\n context.push(tc.brace);\n };\n\n tokenTypes[tt.backQuote].updateContext = context => {\n if (context[context.length - 1] === tc.template) {\n context.pop();\n } else {\n context.push(tc.template);\n }\n };\n\n tokenTypes[tt.jsxTagStart].updateContext = context => {\n context.push(tc.j_expr, tc.j_oTag);\n };\n}\n","import * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.js`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0898-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.js`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2637,96,16,1070,4050,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,46,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,482,44,11,6,17,0,322,29,19,43,1269,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4152,8,221,3,5761,15,7472,3104,541,1507,4938];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,357,0,62,13,1495,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n","const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n","/* eslint max-len: 0 */\n\n// @flow\n\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart } from \"@babel/helper-validator-identifier\";\n\nexport {\n isIdentifierStart,\n isIdentifierChar,\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/;\n\n// Test whether a current state character code and next character code is @\n\nexport function isIteratorStart(\n current: number,\n next: number,\n next2: number,\n): boolean {\n return (\n current === charCodes.atSign &&\n next === charCodes.atSign &&\n isIdentifierStart(next2)\n );\n}\n\n// This is the comprehensive set of JavaScript reserved words\n// If a word is in this set, it could be a reserved word,\n// depending on sourceType/strictMode/binding info. In other words\n// if a word is not in this set, it is not a reserved word under\n// any circumstance.\nconst reservedWordLikeSet = new Set([\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n // strict\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n // strictBind\n \"eval\",\n \"arguments\",\n // reservedWorkLike\n \"enum\",\n \"await\",\n]);\n\nexport function canBeReservedWord(word: string): boolean {\n return reservedWordLikeSet.has(word);\n}\n","// @flow\n\n// Each scope gets a bitset that may contain these flags\n// prettier-ignore\nexport const SCOPE_OTHER = 0b000000000,\n SCOPE_PROGRAM = 0b000000001,\n SCOPE_FUNCTION = 0b000000010,\n SCOPE_ARROW = 0b000000100,\n SCOPE_SIMPLE_CATCH = 0b000001000,\n SCOPE_SUPER = 0b000010000,\n SCOPE_DIRECT_SUPER = 0b000100000,\n SCOPE_CLASS = 0b001000000,\n SCOPE_STATIC_BLOCK = 0b010000000,\n SCOPE_TS_MODULE = 0b100000000,\n SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE;\n\nexport type ScopeFlags =\n | typeof SCOPE_OTHER\n | typeof SCOPE_PROGRAM\n | typeof SCOPE_FUNCTION\n | typeof SCOPE_VAR\n | typeof SCOPE_ARROW\n | typeof SCOPE_SIMPLE_CATCH\n | typeof SCOPE_SUPER\n | typeof SCOPE_DIRECT_SUPER\n | typeof SCOPE_CLASS\n | typeof SCOPE_STATIC_BLOCK;\n\n// These flags are meant to be _only_ used inside the Scope class (or subclasses).\n// prettier-ignore\nexport const BIND_KIND_VALUE = 0b000000_0000_01,\n BIND_KIND_TYPE = 0b000000_0000_10,\n // Used in checkLVal and declareName to determine the type of a binding\n BIND_SCOPE_VAR = 0b000000_0001_00, // Var-style binding\n BIND_SCOPE_LEXICAL = 0b000000_0010_00, // Let- or const-style binding\n BIND_SCOPE_FUNCTION = 0b000000_0100_00, // Function declaration\n BIND_SCOPE_OUTSIDE = 0b000000_1000_00, // Special case for function names as\n // bound inside the function\n // Misc flags\n BIND_FLAGS_NONE = 0b000001_0000_00,\n BIND_FLAGS_CLASS = 0b000010_0000_00,\n BIND_FLAGS_TS_ENUM = 0b000100_0000_00,\n BIND_FLAGS_TS_CONST_ENUM = 0b001000_0000_00,\n BIND_FLAGS_TS_EXPORT_ONLY = 0b010000_0000_00,\n BIND_FLAGS_FLOW_DECLARE_FN = 0b100000_0000_00;\n\n// These flags are meant to be _only_ used by Scope consumers\n// prettier-ignore\n/* = is value? | is type? | scope | misc flags */\nexport const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS ,\n BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0 ,\n BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0 ,\n BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0 ,\n BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS ,\n BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0 ,\n BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM,\n BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n // These bindings don't introduce anything in the scope. They are used for assignments and\n // function expressions IDs.\n BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE ,\n BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE ,\n\n BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM,\n BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n\n BIND_FLOW_DECLARE_FN = BIND_FLAGS_FLOW_DECLARE_FN;\n\nexport type BindingTypes =\n | typeof BIND_NONE\n | typeof BIND_OUTSIDE\n | typeof BIND_VAR\n | typeof BIND_LEXICAL\n | typeof BIND_CLASS\n | typeof BIND_FUNCTION\n | typeof BIND_TS_INTERFACE\n | typeof BIND_TS_TYPE\n | typeof BIND_TS_ENUM\n | typeof BIND_TS_AMBIENT\n | typeof BIND_TS_NAMESPACE;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_FLAG_STATIC = 0b1_00,\n CLASS_ELEMENT_KIND_GETTER = 0b0_10,\n CLASS_ELEMENT_KIND_SETTER = 0b0_01,\n CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,\n CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,\n CLASS_ELEMENT_OTHER = 0;\n\nexport type ClassElementTypes =\n | typeof CLASS_ELEMENT_STATIC_GETTER\n | typeof CLASS_ELEMENT_STATIC_SETTER\n | typeof CLASS_ELEMENT_INSTANCE_GETTER\n | typeof CLASS_ELEMENT_INSTANCE_SETTER\n | typeof CLASS_ELEMENT_OTHER;\n","// @flow\n\nimport type { Options } from \"../options\";\nimport type State from \"../tokenizer/state\";\nimport type { PluginsMap } from \"./index\";\nimport type ScopeHandler from \"../util/scope\";\nimport type ExpressionScopeHandler from \"../util/expression-scope\";\nimport type ClassScopeHandler from \"../util/class-scope\";\nimport type ProductionParameterHandler from \"../util/production-parameter\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n declare options: Options;\n declare inModule: boolean;\n declare scope: ScopeHandler<*>;\n declare classScope: ClassScopeHandler;\n declare prodParam: ProductionParameterHandler;\n declare expressionScope: ExpressionScopeHandler;\n declare plugins: PluginsMap;\n declare filename: ?string;\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n declare exportedIdentifiers: Set;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n declare state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n declare input: string;\n declare length: number;\n\n // This method accepts either a string (plugin name) or an array pair\n // (plugin name and options object). If an options object is given,\n // then each value is non-recursively checked for identity with that\n // plugin’s actual option value.\n hasPlugin(pluginConfig: PluginConfig): boolean {\n if (typeof pluginConfig === \"string\") {\n return this.plugins.has(pluginConfig);\n } else {\n const [pluginName, pluginOptions] = pluginConfig;\n if (!this.hasPlugin(pluginName)) {\n return false;\n }\n const actualOptions = this.plugins.get(pluginName);\n for (const key of Object.keys(pluginOptions)) {\n if (actualOptions?.[key] !== pluginOptions[key]) {\n return false;\n }\n }\n return true;\n }\n }\n\n getPluginOption(plugin: string, name: string) {\n return this.plugins.get(plugin)?.[name];\n }\n}\n\nexport type PluginConfig = string | [string, { [string]: any }];\n","// @flow\n\n/*:: declare var invariant; */\n\nimport BaseParser from \"./base\";\nimport type { Comment, Node } from \"../types\";\nimport * as charCodes from \"charcodes\";\n\n/**\n * A whitespace token containing comments\n * @typedef CommentWhitespace\n * @type {object}\n * @property {number} start - the start of the whitespace token.\n * @property {number} end - the end of the whitespace token.\n * @property {Array} comments - the containing comments\n * @property {Node | null} leadingNode - the immediately preceding AST node of the whitespace token\n * @property {Node | null} trailingNode - the immediately following AST node of the whitespace token\n * @property {Node | null} containingNode - the innermost AST node containing the whitespace\n * with minimal size (|end - start|)\n */\nexport type CommentWhitespace = {\n start: number,\n end: number,\n comments: Array,\n leadingNode: Node | null,\n trailingNode: Node | null,\n containingNode: Node | null,\n};\n\n/**\n * Merge comments with node's trailingComments or assign comments to be\n * trailingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n *\n * @param {Node} node\n * @param {Array} comments\n */\nfunction setTrailingComments(node: Node, comments: Array) {\n if (node.trailingComments === undefined) {\n node.trailingComments = comments;\n } else {\n node.trailingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's leadingComments or assign comments to be\n * leadingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n *\n * @param {Node} node\n * @param {Array} comments\n */\nfunction setLeadingComments(node: Node, comments: Array) {\n if (node.leadingComments === undefined) {\n node.leadingComments = comments;\n } else {\n node.leadingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's innerComments or assign comments to be\n * innerComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n *\n * @param {Node} node\n * @param {Array} comments\n */\nexport function setInnerComments(node: Node, comments: Array) {\n if (node.innerComments === undefined) {\n node.innerComments = comments;\n } else {\n node.innerComments.unshift(...comments);\n }\n}\n\n/**\n * Given node and elements array, if elements has non-null element,\n * merge comments to its trailingComments, otherwise merge comments\n * to node's innerComments\n *\n * @param {Node} node\n * @param {Array} elements\n * @param {Array} comments\n */\nfunction adjustInnerComments(\n node: Node,\n elements: Array,\n commentWS: CommentWhitespace,\n) {\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null || lastElement.start > commentWS.start) {\n setInnerComments(node, commentWS.comments);\n } else {\n setTrailingComments(lastElement, commentWS.comments);\n }\n}\n\n/** @class CommentsParser */\nexport default class CommentsParser extends BaseParser {\n addComment(comment: Comment): void {\n if (this.filename) comment.loc.filename = this.filename;\n this.state.comments.push(comment);\n }\n\n /**\n * Given a newly created AST node _n_, attach _n_ to a comment whitespace _w_ if applicable\n * {@see {@link CommentWhitespace}}\n *\n * @param {Node} node\n * @returns {void}\n * @memberof CommentsParser\n */\n processComment(node: Node): void {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n const lastCommentWS = commentStack[i];\n\n if (lastCommentWS.start === node.end) {\n lastCommentWS.leadingNode = node;\n i--;\n }\n\n const { start: nodeStart } = node;\n // invariant: for all 0 <= j <= i, let c = commentStack[j], c must satisfy c.end < node.end\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n if (commentEnd > nodeStart) {\n // by definition of commentWhiteSpace, this implies commentWS.start > nodeStart\n // so node can be a containingNode candidate. At this time we can finalize the comment\n // whitespace, because\n // 1) its leadingNode or trailingNode, if exists, will not change\n // 2) its containingNode have been assigned and will not change because it is the\n // innermost minimal-sized AST node\n commentWS.containingNode = node;\n this.finalizeComment(commentWS);\n commentStack.splice(i, 1);\n } else {\n if (commentEnd === nodeStart) {\n commentWS.trailingNode = node;\n }\n // stop the loop when commentEnd <= nodeStart\n break;\n }\n }\n }\n\n /**\n * Assign the comments of comment whitespaces to related AST nodes.\n * Also adjust innerComments following trailing comma.\n *\n * @memberof CommentsParser\n */\n finalizeComment(commentWS: CommentWhitespace) {\n const { comments } = commentWS;\n if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {\n if (commentWS.leadingNode !== null) {\n setTrailingComments(commentWS.leadingNode, comments);\n }\n if (commentWS.trailingNode !== null) {\n setLeadingComments(commentWS.trailingNode, comments);\n }\n } else {\n /*:: invariant(commentWS.containingNode !== null) */\n const { containingNode: node, start: commentStart } = commentWS;\n if (this.input.charCodeAt(commentStart - 1) === charCodes.comma) {\n // If a commentWhitespace follows a comma and the containingNode allows\n // list structures with trailing comma, merge it to the trailingComment\n // of the last non-null list element\n switch (node.type) {\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n case \"RecordExpression\":\n adjustInnerComments(node, node.properties, commentWS);\n break;\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n adjustInnerComments(node, node.arguments, commentWS);\n break;\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"ArrowFunctionExpression\":\n case \"ObjectMethod\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n adjustInnerComments(node, node.params, commentWS);\n break;\n case \"ArrayExpression\":\n case \"ArrayPattern\":\n case \"TupleExpression\":\n adjustInnerComments(node, node.elements, commentWS);\n break;\n case \"ExportNamedDeclaration\":\n case \"ImportDeclaration\":\n adjustInnerComments(node, node.specifiers, commentWS);\n break;\n default: {\n setInnerComments(node, comments);\n }\n }\n } else {\n setInnerComments(node, comments);\n }\n }\n }\n\n /**\n * Drains remaining commentStack and applies finalizeComment\n * to each comment whitespace. Used only in parseExpression\n * where the top level AST node is _not_ Program\n * {@see {@link CommentsParser#finalizeComment}}\n *\n * @memberof CommentsParser\n */\n finalizeRemainingComments() {\n const { commentStack } = this.state;\n for (let i = commentStack.length - 1; i >= 0; i--) {\n this.finalizeComment(commentStack[i]);\n }\n this.state.commentStack = [];\n }\n\n /**\n * Reset previous node trailing comments. Used in object / class\n * property parsing. We parse `async`, `static`, `set` and `get`\n * as an identifier but may reinterpret it into an async/static/accessor\n * method later. In this case the identifier is not part of the AST and we\n * should sync the knowledge to commentStacks\n *\n * For example, when parsing */\n // async /* 1 */ function f() {}\n /*\n * the comment whitespace \"* 1 *\" has leading node Identifier(async). When\n * we see the function token, we create a Function node and mark \"* 1 *\" as\n * inner comments. So \"* 1 *\" should be detached from the Identifier node.\n *\n * @param {N.Node} node the last finished AST node _before_ current token\n * @returns\n * @memberof CommentsParser\n */\n resetPreviousNodeTrailingComments(node: Node) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n const commentWS = commentStack[length - 1];\n if (commentWS.leadingNode === node) {\n commentWS.leadingNode = null;\n }\n }\n\n /**\n * Attach a node to the comment whitespaces right before/after\n * the given range.\n *\n * This is used to properly attach comments around parenthesized\n * expressions as leading/trailing comments of the inner expression.\n *\n * @param {Node} node\n * @param {number} start\n * @param {number} end\n */\n takeSurroundingComments(node: Node, start: number, end: number) {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n const commentStart = commentWS.start;\n\n if (commentStart === end) {\n commentWS.leadingNode = node;\n } else if (commentEnd === start) {\n commentWS.trailingNode = node;\n } else if (commentEnd < start) {\n break;\n }\n }\n }\n}\n","// @flow\n\nimport * as charCodes from \"charcodes\";\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\nexport const lineBreak = /\\r\\n?|[\\n\\u2028\\u2029]/;\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n// https://tc39.github.io/ecma262/#sec-line-terminators\nexport function isNewLine(code: number): boolean {\n switch (code) {\n case charCodes.lineFeed:\n case charCodes.carriageReturn:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return true;\n\n default:\n return false;\n }\n}\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\nexport const skipWhiteSpaceInLine =\n /(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*/y;\n\n// Skip whitespace and single-line comments, including /* no newline here */.\n// After this RegExp matches, its lastIndex points to a line terminator, or\n// the start of multi-line comment (which is effectively a line terminator),\n// or the end of string.\nexport const skipWhiteSpaceToLineBreak = new RegExp(\n // Unfortunately JS doesn't support Perl's atomic /(?>pattern)/ or\n // possessive quantifiers, so we use a trick to prevent backtracking\n // when the look-ahead for line terminator fails.\n \"(?=(\" +\n // Capture the whitespace and comments that should be skipped inside\n // a look-ahead assertion, and then re-match the group as a unit.\n skipWhiteSpaceInLine.source +\n \"))\\\\1\" +\n // Look-ahead for either line terminator, start of multi-line comment,\n // or end of string.\n /(?=[\\n\\r\\u2028\\u2029]|\\/\\*(?!.*?\\*\\/)|$)/.source,\n \"y\", // sticky\n);\n\n// https://tc39.github.io/ecma262/#sec-white-space\nexport function isWhitespace(code: number): boolean {\n switch (code) {\n case 0x0009: // CHARACTER TABULATION\n case 0x000b: // LINE TABULATION\n case 0x000c: // FORM FEED\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.oghamSpaceMark:\n case 0x2000: // EN QUAD\n case 0x2001: // EM QUAD\n case 0x2002: // EN SPACE\n case 0x2003: // EM SPACE\n case 0x2004: // THREE-PER-EM SPACE\n case 0x2005: // FOUR-PER-EM SPACE\n case 0x2006: // SIX-PER-EM SPACE\n case 0x2007: // FIGURE SPACE\n case 0x2008: // PUNCTUATION SPACE\n case 0x2009: // THIN SPACE\n case 0x200a: // HAIR SPACE\n case 0x202f: // NARROW NO-BREAK SPACE\n case 0x205f: // MEDIUM MATHEMATICAL SPACE\n case 0x3000: // IDEOGRAPHIC SPACE\n case 0xfeff: // ZERO WIDTH NO-BREAK SPACE\n return true;\n\n default:\n return false;\n }\n}\n","// @flow\n\nimport type { Options } from \"../options\";\nimport * as N from \"../types\";\nimport type { CommentWhitespace } from \"../parser/comments\";\nimport { Position } from \"../util/location\";\n\nimport { types as ct, type TokContext } from \"./context\";\nimport { tt, type TokenType } from \"./types\";\nimport { Errors, type ParseError } from \"../parse-error\";\n\nexport type DeferredStrictError =\n | typeof Errors.StrictNumericEscape\n | typeof Errors.StrictOctalLiteral;\n\ntype TopicContextState = {\n // When a topic binding has been currently established,\n // then this is 1. Otherwise, it is 0. This is forwards compatible\n // with a future plugin for multiple lexical topics.\n maxNumOfResolvableTopics: number,\n\n // When a topic binding has been currently established, and if that binding\n // has been used as a topic reference `#`, then this is 0. Otherwise, it is\n // `null`. This is forwards compatible with a future plugin for multiple\n // lexical topics.\n maxTopicIndex: null | 0,\n};\n\nexport default class State {\n strict: boolean;\n curLine: number;\n lineStart: number;\n\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n startLoc: Position;\n endLoc: Position;\n\n init({ strictMode, sourceType, startLine, startColumn }: Options): void {\n this.strict =\n strictMode === false\n ? false\n : strictMode === true\n ? true\n : sourceType === \"module\";\n\n this.curLine = startLine;\n this.lineStart = -startColumn;\n this.startLoc = this.endLoc = new Position(startLine, startColumn, 0);\n }\n\n errors: ParseError[] = [];\n\n // Used to signify the start of a potential arrow function\n potentialArrowAt: number = -1;\n\n // Used to signify the start of an expression which looks like a\n // typed arrow function, but it isn't\n // e.g. a ? (b) : c => d\n // ^\n noArrowAt: number[] = [];\n\n // Used to signify the start of an expression whose params, if it looks like\n // an arrow function, shouldn't be converted to assignable nodes.\n // This is used to defer the validation of typed arrow functions inside\n // conditional expressions.\n // e.g. a ? (b) : c => d\n // ^\n noArrowParamsConversionAt: number[] = [];\n\n // Flags to track\n maybeInArrowParameters: boolean = false;\n inType: boolean = false;\n noAnonFunctionType: boolean = false;\n hasFlowComment: boolean = false;\n isAmbientContext: boolean = false;\n inAbstractClass: boolean = false;\n\n // For the Hack-style pipelines plugin\n topicContext: TopicContextState = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null,\n };\n\n // For the F#-style pipelines plugin\n soloAwait: boolean = false;\n inFSharpPipelineDirectBody: boolean = false;\n\n // Labels in scope.\n labels: Array<{\n kind: ?(\"loop\" | \"switch\"),\n name?: ?string,\n statementStart?: number,\n }> = [];\n\n // Leading decorators. Last element of the stack represents the decorators in current context.\n // Supports nesting of decorators, e.g. @foo(@bar class inner {}) class outer {}\n // where @foo belongs to the outer class and @bar to the inner\n decoratorStack: Array> = [[]];\n\n // Comment store for Program.comments\n comments: Array = [];\n\n // Comment attachment store\n commentStack: Array = [];\n\n // The current position of the tokenizer in the input.\n pos: number = 0;\n\n // Properties of the current token:\n // Its type\n type: TokenType = tt.eof;\n\n // For tokens that include more information than their type, the value\n value: any = null;\n\n // Its start and end offset\n start: number = 0;\n end: number = 0;\n\n // Position information for the previous token\n // $FlowIgnore this is initialized when generating the second token.\n lastTokEndLoc: Position = null;\n // $FlowIgnore this is initialized when generating the second token.\n lastTokStartLoc: Position = null;\n lastTokStart: number = 0;\n\n // The context stack is used to track whether the apostrophe \"`\" starts\n // or ends a string template\n context: Array = [ct.brace];\n // Used to track whether a JSX element is allowed to form\n canStartJSXElement: boolean = true;\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n containsEsc: boolean = false;\n\n // This property is used to track the following errors\n // - StrictNumericEscape\n // - StrictOctalLiteral\n //\n // in a literal that occurs prior to/immediately after a \"use strict\" directive.\n\n // todo(JLHwung): set strictErrors to null and avoid recording string errors\n // after a non-directive is parsed\n strictErrors: Map = new Map();\n\n // Tokens length in token store\n tokensLength: number = 0;\n\n curPosition(): Position {\n return new Position(this.curLine, this.pos - this.lineStart, this.pos);\n }\n\n clone(skipArrays?: boolean): State {\n const state = new State();\n const keys = Object.keys(this);\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n // $FlowIgnore\n let val = this[key];\n\n if (!skipArrays && Array.isArray(val)) {\n val = val.slice();\n }\n\n // $FlowIgnore\n state[key] = val;\n }\n\n return state;\n }\n}\n\nexport type LookaheadState = {\n pos: number,\n value: any,\n type: TokenType,\n start: number,\n end: number,\n /* Used only in readToken_mult_modulo */\n inType: boolean,\n};\n","// @flow\n\n/*:: declare var invariant; */\n\nimport type { Options } from \"../options\";\nimport {\n Position,\n SourceLocation,\n createPositionWithColumnOffset,\n} from \"../util/location\";\nimport CommentsParser from \"../parser/comments\";\nimport * as N from \"../types\";\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart, isIdentifierChar } from \"../util/identifier\";\nimport {\n tokenIsKeyword,\n tokenLabelName,\n tt,\n keywords as keywordTypes,\n type TokenType,\n} from \"./types\";\nimport { type TokContext } from \"./context\";\nimport {\n Errors,\n type ParseError,\n type ParseErrorConstructor,\n type RaiseProperties,\n} from \"../parse-error\";\nimport {\n lineBreakG,\n isNewLine,\n isWhitespace,\n skipWhiteSpace,\n} from \"../util/whitespace\";\nimport State from \"./state\";\nimport type { LookaheadState, DeferredStrictError } from \"./state\";\n\nconst VALID_REGEX_FLAGS = new Set([\n charCodes.lowercaseG,\n charCodes.lowercaseM,\n charCodes.lowercaseS,\n charCodes.lowercaseI,\n charCodes.lowercaseY,\n charCodes.lowercaseU,\n charCodes.lowercaseD,\n // This is only valid when using the regexpUnicodeSets plugin\n charCodes.lowercaseV,\n]);\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\n\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set([\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ]),\n hex: new Set([\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ]),\n};\n\nconst isAllowedNumericSeparatorSibling = {\n // 0 - 1\n bin: ch => ch === charCodes.digit0 || ch === charCodes.digit1,\n\n // 0 - 7\n oct: ch => ch >= charCodes.digit0 && ch <= charCodes.digit7,\n\n // 0 - 9\n dec: ch => ch >= charCodes.digit0 && ch <= charCodes.digit9,\n\n // 0 - 9, A - F, a - f,\n hex: ch =>\n (ch >= charCodes.digit0 && ch <= charCodes.digit9) ||\n (ch >= charCodes.uppercaseA && ch <= charCodes.uppercaseF) ||\n (ch >= charCodes.lowercaseA && ch <= charCodes.lowercaseF),\n};\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(state: State) {\n this.type = state.type;\n this.value = state.value;\n this.start = state.start;\n this.end = state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n\n declare type: TokenType;\n declare value: any;\n declare start: number;\n declare end: number;\n declare loc: SourceLocation;\n}\n\n// ## Tokenizer\n\nexport default class Tokenizer extends CommentsParser {\n isLookahead: boolean;\n\n // Token store.\n tokens: Array = [];\n\n constructor(options: Options, input: string) {\n super();\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.isLookahead = false;\n }\n\n pushToken(token: Token | N.Comment) {\n // Pop out invalid tokens trapped by try-catch parsing.\n // Those parsing branches are mainly created by typescript and flow plugins.\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n // Move to the next token\n\n next(): void {\n this.checkKeywordEscapes();\n if (this.options.tokens) {\n this.pushToken(new Token(this.state));\n }\n\n this.state.lastTokStart = this.state.start;\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n // TODO\n\n eat(type: TokenType): boolean {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Whether current token matches given type\n *\n * @param {TokenType} type\n * @returns {boolean}\n * @memberof Tokenizer\n */\n match(type: TokenType): boolean {\n return this.state.type === type;\n }\n\n /**\n * Create a LookaheadState from current parser state\n *\n * @param {State} state\n * @returns {LookaheadState}\n * @memberof Tokenizer\n */\n createLookaheadState(state: State): LookaheadState {\n return {\n pos: state.pos,\n value: null,\n type: state.type,\n start: state.start,\n end: state.end,\n context: [this.curContext()],\n inType: state.inType,\n startLoc: state.startLoc,\n lastTokEndLoc: state.lastTokEndLoc,\n curLine: state.curLine,\n lineStart: state.lineStart,\n curPosition: state.curPosition,\n };\n }\n\n /**\n * lookahead peeks the next token, skipping changes to token context and\n * comment stack. For performance it returns a limited LookaheadState\n * instead of full parser state.\n *\n * The { column, line } Loc info is not included in lookahead since such usage\n * is rare. Although it may return other location properties e.g. `curLine` and\n * `lineStart`, these properties are not listed in the LookaheadState interface\n * and thus the returned value is _NOT_ reliable.\n *\n * The tokenizer should make best efforts to avoid using any parser state\n * other than those defined in LookaheadState\n *\n * @returns {LookaheadState}\n * @memberof Tokenizer\n */\n lookahead(): LookaheadState {\n const old = this.state;\n // For performance we use a simplified tokenizer state structure\n // $FlowIgnore\n this.state = this.createLookaheadState(old);\n\n this.isLookahead = true;\n this.nextToken();\n this.isLookahead = false;\n\n const curr = this.state;\n this.state = old;\n return curr;\n }\n\n nextTokenStart(): number {\n return this.nextTokenStartSince(this.state.pos);\n }\n\n nextTokenStartSince(pos: number): number {\n skipWhiteSpace.lastIndex = pos;\n return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;\n }\n\n lookaheadCharCode(): number {\n return this.input.charCodeAt(this.nextTokenStart());\n }\n\n codePointAtPos(pos: number): number {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `input` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = this.input.charCodeAt(pos);\n if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {\n const trail = this.input.charCodeAt(pos);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n return cp;\n }\n\n // Toggle strict mode. Re-reads the next number or string to please\n // pedantic tests (`\"use strict\"; 010;` should fail).\n\n setStrict(strict: boolean): void {\n this.state.strict = strict;\n if (strict) {\n // Throw an error for any string decimal escape found before/immediately\n // after a \"use strict\" directive. Strict mode will be set at parse\n // time for any literals that occur after the next node of the strict\n // directive.\n this.state.strictErrors.forEach(([toParseError, at]) =>\n this.raise(toParseError, { at }),\n );\n this.state.strictErrors.clear();\n }\n }\n\n curContext(): TokContext {\n return this.state.context[this.state.context.length - 1];\n }\n\n // Read a single token, updating the parser object's token-related\n // properties.\n\n nextToken(): void {\n this.skipSpace();\n this.state.start = this.state.pos;\n if (!this.isLookahead) this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(tt.eof);\n return;\n }\n\n this.getTokenFromCode(this.codePointAtPos(this.state.pos));\n }\n\n skipBlockComment(): N.CommentBlock | void {\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(\"*/\", start + 2);\n if (end === -1) {\n // We have to call this again here because startLoc may not be set...\n // This seems to be for performance reasons:\n // https://github.com/babel/babel/commit/acf2a10899f696a8aaf34df78bf9725b5ea7f2da\n throw this.raise(Errors.UnterminatedComment, {\n at: this.state.curPosition(),\n });\n }\n\n this.state.pos = end + 2;\n lineBreakG.lastIndex = start + 2;\n while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {\n ++this.state.curLine;\n this.state.lineStart = lineBreakG.lastIndex;\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const comment = {\n type: \"CommentBlock\",\n value: this.input.slice(start + 2, end),\n start,\n end: end + 2,\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n skipLineComment(startSkip: number): N.CommentLine | void {\n const start = this.state.pos;\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt((this.state.pos += startSkip));\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const end = this.state.pos;\n const value = this.input.slice(start + startSkip, end);\n\n const comment = {\n type: \"CommentLine\",\n value,\n start,\n end,\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.options.tokens) this.pushToken(comment);\n return comment;\n }\n\n // Called at the start of the parse and after every token. Skips\n // whitespace and comments, and.\n\n skipSpace(): void {\n const spaceStart = this.state.pos;\n const comments = [];\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.tab:\n ++this.state.pos;\n break;\n case charCodes.carriageReturn:\n if (\n this.input.charCodeAt(this.state.pos + 1) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n }\n // fall through\n case charCodes.lineFeed:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n\n case charCodes.slash:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case charCodes.asterisk: {\n const comment = this.skipBlockComment();\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n case charCodes.slash: {\n const comment = this.skipLineComment(2);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n break;\n }\n\n default:\n break loop;\n }\n break;\n\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else if (ch === charCodes.dash && !this.inModule) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.dash &&\n this.input.charCodeAt(pos + 2) === charCodes.greaterThan &&\n (spaceStart === 0 || this.state.lineStart > spaceStart)\n ) {\n // A `-->` line comment\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else if (ch === charCodes.lessThan && !this.inModule) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.exclamationMark &&\n this.input.charCodeAt(pos + 2) === charCodes.dash &&\n this.input.charCodeAt(pos + 3) === charCodes.dash\n ) {\n // ` R1 |\n // | 300ms |\n // | run(2) +-------------> R2 (SKIP) |\n // | 200ms |\n // | run(3) +--------> R3 |\n // +----------------------------------+\n if (latestResolvedValue && currentPromiseId < latestResolvedId) {\n return latestResolvedValue;\n }\n\n latestResolvedId = currentPromiseId;\n latestResolvedValue = x;\n return x;\n });\n };\n}","var _excluded = [\"event\", \"props\", \"refresh\", \"store\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { onInput } from './onInput';\nimport { getActiveItem } from './utils';\nexport function onKeyDown(_ref) {\n var event = _ref.event,\n props = _ref.props,\n refresh = _ref.refresh,\n store = _ref.store,\n setters = _objectWithoutProperties(_ref, _excluded);\n\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n // eslint-disable-next-line no-inner-declarations\n var triggerScrollIntoView = function triggerScrollIntoView() {\n var nodeItem = props.environment.document.getElementById(\"\".concat(props.id, \"-item-\").concat(store.getState().activeItemId));\n\n if (nodeItem) {\n if (nodeItem.scrollIntoViewIfNeeded) {\n nodeItem.scrollIntoViewIfNeeded(false);\n } else {\n nodeItem.scrollIntoView(false);\n }\n }\n }; // eslint-disable-next-line no-inner-declarations\n\n\n var triggerOnActive = function triggerOnActive() {\n var highlightedItem = getActiveItem(store.getState());\n\n if (store.getState().activeItemId !== null && highlightedItem) {\n var item = highlightedItem.item,\n itemInputValue = highlightedItem.itemInputValue,\n itemUrl = highlightedItem.itemUrl,\n source = highlightedItem.source;\n source.onActive(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n }\n }; // Default browser behavior changes the caret placement on ArrowUp and\n // ArrowDown.\n\n\n event.preventDefault(); // When re-opening the panel, we need to split the logic to keep the actions\n // synchronized as `onInput` returns a promise.\n\n if (store.getState().isOpen === false && (props.openOnFocus || Boolean(store.getState().query))) {\n onInput(_objectSpread({\n event: event,\n props: props,\n query: store.getState().query,\n refresh: refresh,\n store: store\n }, setters)).then(function () {\n store.dispatch(event.key, {\n nextActiveItemId: props.defaultActiveItemId\n });\n triggerOnActive(); // Since we rely on the DOM, we need to wait for all the micro tasks to\n // finish (which include re-opening the panel) to make sure all the\n // elements are available.\n\n setTimeout(triggerScrollIntoView, 0);\n });\n } else {\n store.dispatch(event.key, {});\n triggerOnActive();\n triggerScrollIntoView();\n }\n } else if (event.key === 'Escape') {\n // This prevents the default browser behavior on `input[type=\"search\"]`\n // from removing the query right away because we first want to close the\n // panel.\n event.preventDefault();\n store.dispatch(event.key, null); // Hitting the `Escape` key signals the end of a user interaction with the\n // autocomplete. At this point, we should ignore any requests that are still\n // pending and could reopen the panel once they resolve, because that would\n // result in an unsolicited UI behavior.\n\n store.pendingRequests.cancelAll();\n } else if (event.key === 'Enter') {\n // No active item, so we let the browser handle the native `onSubmit` form\n // event.\n if (store.getState().activeItemId === null || store.getState().collections.every(function (collection) {\n return collection.items.length === 0;\n })) {\n return;\n } // This prevents the `onSubmit` event to be sent because an item is\n // highlighted.\n\n\n event.preventDefault();\n\n var _ref2 = getActiveItem(store.getState()),\n item = _ref2.item,\n itemInputValue = _ref2.itemInputValue,\n itemUrl = _ref2.itemUrl,\n source = _ref2.source;\n\n if (event.metaKey || event.ctrlKey) {\n if (itemUrl !== undefined) {\n source.onSelect(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n props.navigator.navigateNewTab({\n itemUrl: itemUrl,\n item: item,\n state: store.getState()\n });\n }\n } else if (event.shiftKey) {\n if (itemUrl !== undefined) {\n source.onSelect(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n props.navigator.navigateNewWindow({\n itemUrl: itemUrl,\n item: item,\n state: store.getState()\n });\n }\n } else if (event.altKey) {// Keep native browser behavior\n } else {\n if (itemUrl !== undefined) {\n source.onSelect(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n props.navigator.navigate({\n itemUrl: itemUrl,\n item: item,\n state: store.getState()\n });\n return;\n }\n\n onInput(_objectSpread({\n event: event,\n nextState: {\n isOpen: false\n },\n props: props,\n query: itemInputValue,\n refresh: refresh,\n store: store\n }, setters)).then(function () {\n source.onSelect(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n });\n }\n }\n}","var _excluded = [\"props\", \"refresh\", \"store\"],\n _excluded2 = [\"inputElement\", \"formElement\", \"panelElement\"],\n _excluded3 = [\"inputElement\"],\n _excluded4 = [\"inputElement\", \"maxLength\"],\n _excluded5 = [\"item\", \"source\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { onInput } from './onInput';\nimport { onKeyDown as _onKeyDown } from './onKeyDown';\nimport { getActiveItem, isOrContainsNode } from './utils';\nexport function getPropGetters(_ref) {\n var props = _ref.props,\n refresh = _ref.refresh,\n store = _ref.store,\n setters = _objectWithoutProperties(_ref, _excluded);\n\n var getEnvironmentProps = function getEnvironmentProps(providedProps) {\n var inputElement = providedProps.inputElement,\n formElement = providedProps.formElement,\n panelElement = providedProps.panelElement,\n rest = _objectWithoutProperties(providedProps, _excluded2);\n\n return _objectSpread({\n // On touch devices, we do not rely on the native `blur` event of the\n // input to close the panel, but rather on a custom `touchstart` event\n // outside of the autocomplete elements.\n // This ensures a working experience on mobile because we blur the input\n // on touch devices when the user starts scrolling (`touchmove`).\n // @TODO: support cases where there are multiple Autocomplete instances.\n // Right now, a second instance makes this computation return false.\n onTouchStart: function onTouchStart(event) {\n // The `onTouchStart` event shouldn't trigger the `blur` handler when\n // it's not an interaction with Autocomplete. We detect it with the\n // following heuristics:\n // - the panel is closed AND there are no pending requests\n // (no interaction with the autocomplete, no future state updates)\n // - OR the touched target is the input element (should open the panel)\n var isAutocompleteInteraction = store.getState().isOpen || !store.pendingRequests.isEmpty();\n\n if (!isAutocompleteInteraction || event.target === inputElement) {\n return;\n }\n\n var isTargetWithinAutocomplete = [formElement, panelElement].some(function (contextNode) {\n return isOrContainsNode(contextNode, event.target);\n });\n\n if (isTargetWithinAutocomplete === false) {\n store.dispatch('blur', null); // If requests are still pending when the user closes the panel, they\n // could reopen the panel once they resolve.\n // We want to prevent any subsequent query from reopening the panel\n // because it would result in an unsolicited UI behavior.\n\n if (!props.debug) {\n store.pendingRequests.cancelAll();\n }\n }\n },\n // When scrolling on touch devices (mobiles, tablets, etc.), we want to\n // mimic the native platform behavior where the input is blurred to\n // hide the virtual keyboard. This gives more vertical space to\n // discover all the suggestions showing up in the panel.\n onTouchMove: function onTouchMove(event) {\n if (store.getState().isOpen === false || inputElement !== props.environment.document.activeElement || event.target === inputElement) {\n return;\n }\n\n inputElement.blur();\n }\n }, rest);\n };\n\n var getRootProps = function getRootProps(rest) {\n return _objectSpread({\n role: 'combobox',\n 'aria-expanded': store.getState().isOpen,\n 'aria-haspopup': 'listbox',\n 'aria-owns': store.getState().isOpen ? \"\".concat(props.id, \"-list\") : undefined,\n 'aria-labelledby': \"\".concat(props.id, \"-label\")\n }, rest);\n };\n\n var getFormProps = function getFormProps(providedProps) {\n var inputElement = providedProps.inputElement,\n rest = _objectWithoutProperties(providedProps, _excluded3);\n\n return _objectSpread({\n action: '',\n noValidate: true,\n role: 'search',\n onSubmit: function onSubmit(event) {\n var _providedProps$inputE;\n\n event.preventDefault();\n props.onSubmit(_objectSpread({\n event: event,\n refresh: refresh,\n state: store.getState()\n }, setters));\n store.dispatch('submit', null);\n (_providedProps$inputE = providedProps.inputElement) === null || _providedProps$inputE === void 0 ? void 0 : _providedProps$inputE.blur();\n },\n onReset: function onReset(event) {\n var _providedProps$inputE2;\n\n event.preventDefault();\n props.onReset(_objectSpread({\n event: event,\n refresh: refresh,\n state: store.getState()\n }, setters));\n store.dispatch('reset', null);\n (_providedProps$inputE2 = providedProps.inputElement) === null || _providedProps$inputE2 === void 0 ? void 0 : _providedProps$inputE2.focus();\n }\n }, rest);\n };\n\n var getInputProps = function getInputProps(providedProps) {\n function onFocus(event) {\n // We want to trigger a query when `openOnFocus` is true\n // because the panel should open with the current query.\n if (props.openOnFocus || Boolean(store.getState().query)) {\n onInput(_objectSpread({\n event: event,\n props: props,\n query: store.getState().completion || store.getState().query,\n refresh: refresh,\n store: store\n }, setters));\n }\n\n store.dispatch('focus', null);\n }\n\n var isTouchDevice = ('ontouchstart' in props.environment);\n\n var _ref2 = providedProps || {},\n inputElement = _ref2.inputElement,\n _ref2$maxLength = _ref2.maxLength,\n maxLength = _ref2$maxLength === void 0 ? 512 : _ref2$maxLength,\n rest = _objectWithoutProperties(_ref2, _excluded4);\n\n var activeItem = getActiveItem(store.getState());\n return _objectSpread({\n 'aria-autocomplete': 'both',\n 'aria-activedescendant': store.getState().isOpen && store.getState().activeItemId !== null ? \"\".concat(props.id, \"-item-\").concat(store.getState().activeItemId) : undefined,\n 'aria-controls': store.getState().isOpen ? \"\".concat(props.id, \"-list\") : undefined,\n 'aria-labelledby': \"\".concat(props.id, \"-label\"),\n value: store.getState().completion || store.getState().query,\n id: \"\".concat(props.id, \"-input\"),\n autoComplete: 'off',\n autoCorrect: 'off',\n autoCapitalize: 'off',\n enterKeyHint: activeItem !== null && activeItem !== void 0 && activeItem.itemUrl ? 'go' : 'search',\n spellCheck: 'false',\n autoFocus: props.autoFocus,\n placeholder: props.placeholder,\n maxLength: maxLength,\n type: 'search',\n onChange: function onChange(event) {\n onInput(_objectSpread({\n event: event,\n props: props,\n query: event.currentTarget.value.slice(0, maxLength),\n refresh: refresh,\n store: store\n }, setters));\n },\n onKeyDown: function onKeyDown(event) {\n _onKeyDown(_objectSpread({\n event: event,\n props: props,\n refresh: refresh,\n store: store\n }, setters));\n },\n onFocus: onFocus,\n onBlur: function onBlur() {\n // We do rely on the `blur` event on touch devices.\n // See explanation in `onTouchStart`.\n if (!isTouchDevice) {\n store.dispatch('blur', null); // If requests are still pending when the user closes the panel, they\n // could reopen the panel once they resolve.\n // We want to prevent any subsequent query from reopening the panel\n // because it would result in an unsolicited UI behavior.\n\n if (!props.debug) {\n store.pendingRequests.cancelAll();\n }\n }\n },\n onClick: function onClick(event) {\n // When the panel is closed and you click on the input while\n // the input is focused, the `onFocus` event is not triggered\n // (default browser behavior).\n // In an autocomplete context, it makes sense to open the panel in this\n // case.\n // We mimic this event by catching the `onClick` event which\n // triggers the `onFocus` for the panel to open.\n if (providedProps.inputElement === props.environment.document.activeElement && !store.getState().isOpen) {\n onFocus(event);\n }\n }\n }, rest);\n };\n\n var getLabelProps = function getLabelProps(rest) {\n return _objectSpread({\n htmlFor: \"\".concat(props.id, \"-input\"),\n id: \"\".concat(props.id, \"-label\")\n }, rest);\n };\n\n var getListProps = function getListProps(rest) {\n return _objectSpread({\n role: 'listbox',\n 'aria-labelledby': \"\".concat(props.id, \"-label\"),\n id: \"\".concat(props.id, \"-list\")\n }, rest);\n };\n\n var getPanelProps = function getPanelProps(rest) {\n return _objectSpread({\n onMouseDown: function onMouseDown(event) {\n // Prevents the `activeElement` from being changed to the panel so\n // that the blur event is not triggered, otherwise it closes the\n // panel.\n event.preventDefault();\n },\n onMouseLeave: function onMouseLeave() {\n store.dispatch('mouseleave', null);\n }\n }, rest);\n };\n\n var getItemProps = function getItemProps(providedProps) {\n var item = providedProps.item,\n source = providedProps.source,\n rest = _objectWithoutProperties(providedProps, _excluded5);\n\n return _objectSpread({\n id: \"\".concat(props.id, \"-item-\").concat(item.__autocomplete_id),\n role: 'option',\n 'aria-selected': store.getState().activeItemId === item.__autocomplete_id,\n onMouseMove: function onMouseMove(event) {\n if (item.__autocomplete_id === store.getState().activeItemId) {\n return;\n }\n\n store.dispatch('mousemove', item.__autocomplete_id);\n var activeItem = getActiveItem(store.getState());\n\n if (store.getState().activeItemId !== null && activeItem) {\n var _item = activeItem.item,\n itemInputValue = activeItem.itemInputValue,\n itemUrl = activeItem.itemUrl,\n _source = activeItem.source;\n\n _source.onActive(_objectSpread({\n event: event,\n item: _item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: _source,\n state: store.getState()\n }, setters));\n }\n },\n onMouseDown: function onMouseDown(event) {\n // Prevents the `activeElement` from being changed to the item so it\n // can remain with the current `activeElement`.\n event.preventDefault();\n },\n onClick: function onClick(event) {\n var itemInputValue = source.getItemInputValue({\n item: item,\n state: store.getState()\n });\n var itemUrl = source.getItemUrl({\n item: item,\n state: store.getState()\n }); // If `getItemUrl` is provided, it means that the suggestion\n // is a link, not plain text that aims at updating the query.\n // We can therefore skip the state change because it will update\n // the `activeItemId`, resulting in a UI flash, especially\n // noticeable on mobile.\n\n var runPreCommand = itemUrl ? Promise.resolve() : onInput(_objectSpread({\n event: event,\n nextState: {\n isOpen: false\n },\n props: props,\n query: itemInputValue,\n refresh: refresh,\n store: store\n }, setters));\n runPreCommand.then(function () {\n source.onSelect(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n });\n }\n }, rest);\n };\n\n return {\n getEnvironmentProps: getEnvironmentProps,\n getRootProps: getRootProps,\n getFormProps: getFormProps,\n getLabelProps: getLabelProps,\n getInputProps: getInputProps,\n getPanelProps: getPanelProps,\n getListProps: getListProps,\n getItemProps: getItemProps\n };\n}","export function isOrContainsNode(parent, child) {\n return parent === child || parent.contains(child);\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { userAgents } from '@algolia/autocomplete-shared';\nexport function getMetadata(_ref) {\n var _, _options$__autocomple, _options$__autocomple2, _options$__autocomple3;\n\n var plugins = _ref.plugins,\n options = _ref.options;\n var optionsKey = (_ = (((_options$__autocomple = options.__autocomplete_metadata) === null || _options$__autocomple === void 0 ? void 0 : _options$__autocomple.userAgents) || [])[0]) === null || _ === void 0 ? void 0 : _.segment;\n var extraOptions = optionsKey ? _defineProperty({}, optionsKey, Object.keys(((_options$__autocomple2 = options.__autocomplete_metadata) === null || _options$__autocomple2 === void 0 ? void 0 : _options$__autocomple2.options) || {})) : {};\n return {\n plugins: plugins.map(function (plugin) {\n return {\n name: plugin.name,\n options: Object.keys(plugin.__autocomplete_pluginOptions || [])\n };\n }),\n options: _objectSpread({\n 'autocomplete-core': Object.keys(options)\n }, extraOptions),\n ua: userAgents.concat(((_options$__autocomple3 = options.__autocomplete_metadata) === null || _options$__autocomple3 === void 0 ? void 0 : _options$__autocomple3.userAgents) || [])\n };\n}\nexport function injectMetadata(_ref3) {\n var _environment$navigato;\n\n var metadata = _ref3.metadata,\n environment = _ref3.environment;\n var isMetadataEnabled = (_environment$navigato = environment.navigator) === null || _environment$navigato === void 0 ? void 0 : _environment$navigato.userAgent.includes('Algolia Crawler');\n\n if (isMetadataEnabled) {\n var metadataContainer = environment.document.createElement('meta');\n var headRef = environment.document.querySelector('head');\n metadataContainer.name = 'algolia:metadata';\n setTimeout(function () {\n metadataContainer.content = JSON.stringify(metadata);\n headRef.appendChild(metadataContainer);\n }, 0);\n }\n}","import { getActiveItem } from './utils';\nexport function getCompletion(_ref) {\n var _getActiveItem;\n\n var state = _ref.state;\n\n if (state.isOpen === false || state.activeItemId === null) {\n return null;\n }\n\n return ((_getActiveItem = getActiveItem(state)) === null || _getActiveItem === void 0 ? void 0 : _getActiveItem.itemInputValue) || null;\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { getItemsCount, invariant } from '@algolia/autocomplete-shared';\nimport { getCompletion } from './getCompletion';\nimport { getNextActiveItemId } from './utils';\nexport var stateReducer = function stateReducer(state, action) {\n switch (action.type) {\n case 'setActiveItemId':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: action.payload\n });\n }\n\n case 'setQuery':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n query: action.payload,\n completion: null\n });\n }\n\n case 'setCollections':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n collections: action.payload\n });\n }\n\n case 'setIsOpen':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n isOpen: action.payload\n });\n }\n\n case 'setStatus':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n status: action.payload\n });\n }\n\n case 'setContext':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n context: _objectSpread(_objectSpread({}, state.context), action.payload)\n });\n }\n\n case 'ArrowDown':\n {\n var nextState = _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: action.payload.hasOwnProperty('nextActiveItemId') ? action.payload.nextActiveItemId : getNextActiveItemId(1, state.activeItemId, getItemsCount(state), action.props.defaultActiveItemId)\n });\n\n return _objectSpread(_objectSpread({}, nextState), {}, {\n completion: getCompletion({\n state: nextState\n })\n });\n }\n\n case 'ArrowUp':\n {\n var _nextState = _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: getNextActiveItemId(-1, state.activeItemId, getItemsCount(state), action.props.defaultActiveItemId)\n });\n\n return _objectSpread(_objectSpread({}, _nextState), {}, {\n completion: getCompletion({\n state: _nextState\n })\n });\n }\n\n case 'Escape':\n {\n if (state.isOpen) {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: null,\n isOpen: false,\n completion: null\n });\n }\n\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: null,\n query: '',\n status: 'idle',\n collections: []\n });\n }\n\n case 'submit':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: null,\n isOpen: false,\n status: 'idle'\n });\n }\n\n case 'reset':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: // Since we open the panel on reset when openOnFocus=true\n // we need to restore the highlighted index to the defaultActiveItemId. (DocSearch use-case)\n // Since we close the panel when openOnFocus=false\n // we lose track of the highlighted index. (Query-suggestions use-case)\n action.props.openOnFocus === true ? action.props.defaultActiveItemId : null,\n status: 'idle',\n query: ''\n });\n }\n\n case 'focus':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: action.props.defaultActiveItemId,\n isOpen: (action.props.openOnFocus || Boolean(state.query)) && action.props.shouldPanelOpen({\n state: state\n })\n });\n }\n\n case 'blur':\n {\n if (action.props.debug) {\n return state;\n }\n\n return _objectSpread(_objectSpread({}, state), {}, {\n isOpen: false,\n activeItemId: null\n });\n }\n\n case 'mousemove':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: action.payload\n });\n }\n\n case 'mouseleave':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: action.props.defaultActiveItemId\n });\n }\n\n default:\n invariant(false, \"The reducer action \".concat(JSON.stringify(action.type), \" is not supported.\"));\n return state;\n }\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { checkOptions } from './checkOptions';\nimport { createStore } from './createStore';\nimport { getAutocompleteSetters } from './getAutocompleteSetters';\nimport { getDefaultProps } from './getDefaultProps';\nimport { getPropGetters } from './getPropGetters';\nimport { getMetadata, injectMetadata } from './metadata';\nimport { onInput } from './onInput';\nimport { stateReducer } from './stateReducer';\nexport function createAutocomplete(options) {\n checkOptions(options);\n var subscribers = [];\n var props = getDefaultProps(options, subscribers);\n var store = createStore(stateReducer, props, onStoreStateChange);\n var setters = getAutocompleteSetters({\n store: store\n });\n var propGetters = getPropGetters(_objectSpread({\n props: props,\n refresh: refresh,\n store: store\n }, setters));\n\n function onStoreStateChange(_ref) {\n var prevState = _ref.prevState,\n state = _ref.state;\n props.onStateChange(_objectSpread({\n prevState: prevState,\n state: state,\n refresh: refresh\n }, setters));\n }\n\n function refresh() {\n return onInput(_objectSpread({\n event: new Event('input'),\n nextState: {\n isOpen: store.getState().isOpen\n },\n props: props,\n query: store.getState().query,\n refresh: refresh,\n store: store\n }, setters));\n }\n\n props.plugins.forEach(function (plugin) {\n var _plugin$subscribe;\n\n return (_plugin$subscribe = plugin.subscribe) === null || _plugin$subscribe === void 0 ? void 0 : _plugin$subscribe.call(plugin, _objectSpread(_objectSpread({}, setters), {}, {\n refresh: refresh,\n onSelect: function onSelect(fn) {\n subscribers.push({\n onSelect: fn\n });\n },\n onActive: function onActive(fn) {\n subscribers.push({\n onActive: fn\n });\n }\n }));\n });\n injectMetadata({\n metadata: getMetadata({\n plugins: props.plugins,\n options: options\n }),\n environment: props.environment\n });\n return _objectSpread(_objectSpread({\n refresh: refresh\n }, propGetters), setters);\n}","import React from 'react';\nexport function AlgoliaLogo(_ref) {\n var _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations;\n var _translations$searchB = translations.searchByText,\n searchByText = _translations$searchB === void 0 ? 'Search by' : _translations$searchB;\n return /*#__PURE__*/React.createElement(\"a\", {\n href: \"https://www.algolia.com/ref/docsearch/?utm_source=\".concat(window.location.hostname, \"&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch\"),\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Label\"\n }, searchByText), /*#__PURE__*/React.createElement(\"svg\", {\n width: \"77\",\n height: \"19\",\n \"aria-label\": \"Algolia\",\n role: \"img\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M2.5067 0h14.0245c1.384.001 2.5058 1.1205 2.5068 2.5017V16.5c-.0014 1.3808-1.1232 2.4995-2.5068 2.5H2.5067C1.1232 18.9995.0014 17.8808 0 16.5V2.4958A2.495 2.495 0 01.735.7294 2.505 2.505 0 012.5068 0zM37.95 15.0695c-3.7068.0168-3.7068-2.986-3.7068-3.4634L34.2372.3576 36.498 0v11.1794c0 .2715 0 1.9889 1.452 1.994v1.8961zm-9.1666-1.8388c.694 0 1.2086-.0397 1.5678-.1088v-2.2934a5.3639 5.3639 0 00-1.3303-.1679 4.8283 4.8283 0 00-.758.0582 2.2845 2.2845 0 00-.688.2024c-.2029.0979-.371.2362-.4919.4142-.1268.1788-.185.2826-.185.5533 0 .5297.185.8359.5205 1.0375.3355.2016.7928.3053 1.365.3053v-.0008zm-.1969-8.1817c.7463 0 1.3768.092 1.8856.2767.5088.1838.9195.4428 1.2204.7717.3068.334.5147.7777.6423 1.251.1327.4723.196.991.196 1.5603v5.798c-.5235.1036-1.05.192-1.5787.2649-.7048.1037-1.4976.156-2.3774.156-.5832 0-1.1215-.0582-1.6016-.167a3.385 3.385 0 01-1.2432-.5364 2.6034 2.6034 0 01-.8037-.9565c-.191-.3922-.29-.9447-.29-1.5208 0-.5533.11-.905.3246-1.2863a2.7351 2.7351 0 01.8849-.9329c.376-.242.8029-.415 1.2948-.5187a7.4517 7.4517 0 011.5381-.156 7.1162 7.1162 0 011.6667.2024V8.886c0-.259-.0296-.5061-.093-.7372a1.5847 1.5847 0 00-.3245-.6158 1.5079 1.5079 0 00-.6119-.4158 2.6788 2.6788 0 00-.966-.173c-.5206 0-.9948.0634-1.4283.1384a6.5481 6.5481 0 00-1.065.259l-.2712-1.849c.2831-.0986.7048-.1964 1.2491-.2943a9.2979 9.2979 0 011.752-.1501v.0008zm44.6597 8.1193c.6947 0 1.2086-.0405 1.567-.1097v-2.2942a5.3743 5.3743 0 00-1.3303-.1679c-.2485 0-.503.0177-.7573.0582a2.2853 2.2853 0 00-.688.2024 1.2333 1.2333 0 00-.4918.4142c-.1268.1788-.1843.2826-.1843.5533 0 .5297.1843.8359.5198 1.0375.3414.2066.7927.3053 1.365.3053v.0009zm-.191-8.1767c.7463 0 1.3768.0912 1.8856.2759.5087.1847.9195.4436 1.2204.7717.3.329.5147.7786.6414 1.251a5.7248 5.7248 0 01.197 1.562v5.7972c-.3466.0742-.874.1602-1.5788.2648-.7049.1038-1.4976.1552-2.3774.1552-.5832 0-1.1215-.0573-1.6016-.167a3.385 3.385 0 01-1.2432-.5356 2.6034 2.6034 0 01-.8038-.9565c-.191-.3922-.2898-.9447-.2898-1.5216 0-.5533.1098-.905.3245-1.2854a2.7373 2.7373 0 01.8849-.9338c.376-.2412.8029-.4141 1.2947-.5178a7.4545 7.4545 0 012.325-.1097c.2781.0287.5672.081.879.156v-.3686a2.7781 2.7781 0 00-.092-.738 1.5788 1.5788 0 00-.3246-.6166 1.5079 1.5079 0 00-.612-.415 2.6797 2.6797 0 00-.966-.1729c-.5205 0-.9947.0633-1.4282.1384a6.5608 6.5608 0 00-1.065.259l-.2712-1.8498c.283-.0979.7048-.1957 1.2491-.2935a9.8597 9.8597 0 011.752-.1494zm-6.79-1.072c-.7576.001-1.373-.6103-1.3759-1.3664 0-.755.6128-1.3664 1.376-1.3664.764 0 1.3775.6115 1.3775 1.3664s-.6195 1.3664-1.3776 1.3664zm1.1393 11.1507h-2.2726V5.3409l2.2734-.3568v10.0845l-.0008.0017zm-3.984 0c-3.707.0168-3.707-2.986-3.707-3.4642L59.7069.3576 61.9685 0v11.1794c0 .2715 0 1.9889 1.452 1.994V15.0703zm-7.3512-4.979c0-.975-.2138-1.7873-.6305-2.3516-.4167-.571-.9998-.852-1.747-.852-.7454 0-1.3302.281-1.7452.852-.4166.5702-.6195 1.3765-.6195 2.3516 0 .9851.208 1.6473.6254 2.2183.4158.576.9998.8587 1.7461.8587.7454 0 1.3303-.2885 1.747-.8595.4158-.5761.6237-1.2315.6237-2.2184v.0009zm2.3132-.006c0 .7609-.1099 1.3361-.3356 1.9654a4.654 4.654 0 01-.9533 1.6076A4.214 4.214 0 0155.613 14.69c-.579.2412-1.4697.3795-1.9143.3795-.4462-.005-1.3303-.1324-1.9033-.3795a4.307 4.307 0 01-1.474-1.0316c-.4115-.4445-.7293-.9801-.9609-1.6076a5.3423 5.3423 0 01-.3465-1.9653c0-.7608.104-1.493.3356-2.1155a4.683 4.683 0 01.9719-1.5958 4.3383 4.3383 0 011.479-1.0257c.5739-.242 1.2043-.3567 1.8864-.3567.6829 0 1.3125.1197 1.8906.3567a4.1245 4.1245 0 011.4816 1.0257 4.7587 4.7587 0 01.9592 1.5958c.2426.6225.3643 1.3547.3643 2.1155zm-17.0198 0c0 .9448.208 1.9932.6238 2.431.4166.4386.955.6579 1.6142.6579.3584 0 .6998-.0523 1.0176-.1502.3186-.0978.5721-.2134.775-.3517V7.0784a8.8706 8.8706 0 00-1.4926-.1906c-.8206-.0236-1.4452.312-1.8847.8468-.4335.5365-.6533 1.476-.6533 2.3516v-.0008zm6.2863 4.4485c0 1.5385-.3938 2.662-1.1866 3.3773-.791.7136-2.0005 1.0712-3.6308 1.0712-.5958 0-1.834-.1156-2.8228-.334l.3643-1.7865c.8282.173 1.9202.2193 2.4932.2193.9077 0 1.555-.1847 1.943-.5533.388-.3686.578-.916.578-1.643v-.3687a6.8289 6.8289 0 01-.8848.3349c-.3634.1096-.786.167-1.261.167-.6246 0-1.1917-.0979-1.7055-.2944a3.5554 3.5554 0 01-1.3244-.8645c-.3642-.3796-.6541-.8579-.8561-1.4289-.2028-.571-.3068-1.59-.3068-2.339 0-.7034.1099-1.5856.3245-2.1735.2198-.5871.5316-1.0949.9542-1.515.4167-.42.9255-.743 1.5213-.98a5.5923 5.5923 0 012.052-.3855c.7353 0 1.4114.092 2.0707.2024.6592.1088 1.2204.2236 1.6776.35v8.945-.0008zM11.5026 4.2418v-.6511c-.0005-.4553-.3704-.8241-.8266-.8241H8.749c-.4561 0-.826.3688-.8265.824v.669c0 .0742.0693.1264.1445.1096a6.0346 6.0346 0 011.6768-.2362 6.125 6.125 0 011.6202.2185.1116.1116 0 00.1386-.1097zm-5.2806.852l-.3296-.3282a.8266.8266 0 00-1.168 0l-.393.3922a.8199.8199 0 000 1.164l.3237.323c.0524.0515.1268.0397.1733-.0117.191-.259.3989-.507.6305-.7372.2374-.2362.48-.4437.7462-.6335.0575-.0354.0634-.1155.017-.1687zm3.5159 2.069v2.818c0 .081.0879.1392.1622.0987l2.5102-1.2964c.0574-.0287.0752-.0987.0464-.1552a3.1237 3.1237 0 00-2.603-1.574c-.0575 0-.115.0456-.115.1097l-.0008-.0009zm.0008 6.789c-2.0933.0005-3.7915-1.6912-3.7947-3.7804C5.9468 8.0821 7.6452 6.39 9.7387 6.391c2.0932-.0005 3.7911 1.6914 3.794 3.7804a3.7783 3.7783 0 01-1.1124 2.675 3.7936 3.7936 0 01-2.6824 1.1054h.0008zM9.738 4.8002c-1.9218 0-3.6975 1.0232-4.6584 2.6841a5.359 5.359 0 000 5.3683c.9609 1.661 2.7366 2.6841 4.6584 2.6841a5.3891 5.3891 0 003.8073-1.5725 5.3675 5.3675 0 001.578-3.7987 5.3574 5.3574 0 00-1.5771-3.797A5.379 5.379 0 009.7387 4.801l-.0008-.0008z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\"\n })));\n}","import React from 'react';\nimport { AlgoliaLogo } from './AlgoliaLogo';\n\nfunction CommandIcon(props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"15\",\n height: \"15\",\n \"aria-label\": props.ariaLabel,\n role: \"img\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n fill: \"none\",\n stroke: \"currentColor\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: \"1.2\"\n }, props.children));\n}\n\nexport function Footer(_ref) {\n var _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations;\n var _translations$selectT = translations.selectText,\n selectText = _translations$selectT === void 0 ? 'to select' : _translations$selectT,\n _translations$selectK = translations.selectKeyAriaLabel,\n selectKeyAriaLabel = _translations$selectK === void 0 ? 'Enter key' : _translations$selectK,\n _translations$navigat = translations.navigateText,\n navigateText = _translations$navigat === void 0 ? 'to navigate' : _translations$navigat,\n _translations$navigat2 = translations.navigateUpKeyAriaLabel,\n navigateUpKeyAriaLabel = _translations$navigat2 === void 0 ? 'Arrow up' : _translations$navigat2,\n _translations$navigat3 = translations.navigateDownKeyAriaLabel,\n navigateDownKeyAriaLabel = _translations$navigat3 === void 0 ? 'Arrow down' : _translations$navigat3,\n _translations$closeTe = translations.closeText,\n closeText = _translations$closeTe === void 0 ? 'to close' : _translations$closeTe,\n _translations$closeKe = translations.closeKeyAriaLabel,\n closeKeyAriaLabel = _translations$closeKe === void 0 ? 'Escape key' : _translations$closeKe,\n _translations$searchB = translations.searchByText,\n searchByText = _translations$searchB === void 0 ? 'Search by' : _translations$searchB;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Logo\"\n }, /*#__PURE__*/React.createElement(AlgoliaLogo, {\n translations: {\n searchByText: searchByText\n }\n })), /*#__PURE__*/React.createElement(\"ul\", {\n className: \"DocSearch-Commands\"\n }, /*#__PURE__*/React.createElement(\"li\", null, /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Commands-Key\"\n }, /*#__PURE__*/React.createElement(CommandIcon, {\n ariaLabel: selectKeyAriaLabel\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 3.53088v3c0 1-1 2-2 2H4M7 11.53088l-3-3 3-3\"\n }))), /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Label\"\n }, selectText)), /*#__PURE__*/React.createElement(\"li\", null, /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Commands-Key\"\n }, /*#__PURE__*/React.createElement(CommandIcon, {\n ariaLabel: navigateDownKeyAriaLabel\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.5 3.5v8M10.5 8.5l-3 3-3-3\"\n }))), /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Commands-Key\"\n }, /*#__PURE__*/React.createElement(CommandIcon, {\n ariaLabel: navigateUpKeyAriaLabel\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.5 11.5v-8M10.5 6.5l-3-3-3 3\"\n }))), /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Label\"\n }, navigateText)), /*#__PURE__*/React.createElement(\"li\", null, /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Commands-Key\"\n }, /*#__PURE__*/React.createElement(CommandIcon, {\n ariaLabel: closeKeyAriaLabel\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.6167 8.936c-.1065.3583-.6883.962-1.4875.962-.7993 0-1.653-.9165-1.653-2.1258v-.5678c0-1.2548.7896-2.1016 1.653-2.1016.8634 0 1.3601.4778 1.4875 1.0724M9 6c-.1352-.4735-.7506-.9219-1.46-.8972-.7092.0246-1.344.57-1.344 1.2166s.4198.8812 1.3445.9805C8.465 7.3992 8.968 7.9337 9 8.5c.032.5663-.454 1.398-1.4595 1.398C6.6593 9.898 6 9 5.963 8.4851m-1.4748.5368c-.2635.5941-.8099.876-1.5443.876s-1.7073-.6248-1.7073-2.204v-.4603c0-1.0416.721-2.131 1.7073-2.131.9864 0 1.6425 1.031 1.5443 2.2492h-2.956\"\n }))), /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Label\"\n }, closeText))));\n}","import React from 'react';\nexport function Hit(_ref) {\n var hit = _ref.hit,\n children = _ref.children;\n return /*#__PURE__*/React.createElement(\"a\", {\n href: hit.url\n }, children);\n}","import React from 'react';\nexport function LoadingIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n viewBox: \"0 0 38 38\",\n stroke: \"currentColor\",\n strokeOpacity: \".5\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n fill: \"none\",\n fillRule: \"evenodd\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(1 1)\",\n strokeWidth: \"2\"\n }, /*#__PURE__*/React.createElement(\"circle\", {\n strokeOpacity: \".3\",\n cx: \"18\",\n cy: \"18\",\n r: \"18\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36 18c0-9.94-8.06-18-18-18\"\n }, /*#__PURE__*/React.createElement(\"animateTransform\", {\n attributeName: \"transform\",\n type: \"rotate\",\n from: \"0 18 18\",\n to: \"360 18 18\",\n dur: \"1s\",\n repeatCount: \"indefinite\"\n })))));\n}","import React from 'react';\nexport function RecentIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 20 20\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3.18 6.6a8.23 8.23 0 1112.93 9.94h0a8.23 8.23 0 01-11.63 0\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6.44 7.25H2.55V3.36M10.45 6v5.6M10.45 11.6L13 13\"\n })));\n}","import React from 'react';\nexport function ResetIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 20 20\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z\",\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }));\n}","import React from 'react';\nexport function SelectIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n className: \"DocSearch-Hit-Select-Icon\",\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 20 20\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18 3v4c0 2-2 4-4 4H2\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8 17l-6-6 6-6\"\n })));\n}","import React from 'react';\n\nvar LvlIcon = function LvlIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 20 20\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4\",\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinejoin: \"round\"\n }));\n};\n\nexport function SourceIcon(props) {\n switch (props.type) {\n case 'lvl1':\n return /*#__PURE__*/React.createElement(LvlIcon, null);\n\n case 'content':\n return /*#__PURE__*/React.createElement(ContentIcon, null);\n\n default:\n return /*#__PURE__*/React.createElement(AnchorIcon, null);\n }\n}\n\nfunction AnchorIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 20 20\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z\",\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }));\n}\n\nfunction ContentIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 20 20\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17 5H3h14zm0 5H3h14zm0 5H3h14z\",\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinejoin: \"round\"\n }));\n}","import React from 'react';\nexport function StarIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 20 20\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10 14.2L5 17l1-5.6-4-4 5.5-.7 2.5-5 2.5 5 5.6.8-4 4 .9 5.5z\",\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinejoin: \"round\"\n }));\n}","import React from 'react';\nexport function ErrorIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"40\",\n height: \"40\",\n viewBox: \"0 0 20 20\",\n fill: \"none\",\n fillRule: \"evenodd\",\n stroke: \"currentColor\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19 4.8a16 16 0 00-2-1.2m-3.3-1.2A16 16 0 001.1 4.7M16.7 8a12 12 0 00-2.8-1.4M10 6a12 12 0 00-6.7 2M12.3 14.7a4 4 0 00-4.5 0M14.5 11.4A8 8 0 0010 10M3 16L18 2M10 18h0\"\n }));\n}","import React from 'react';\nexport function NoResultsIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"40\",\n height: \"40\",\n viewBox: \"0 0 20 20\",\n fill: \"none\",\n fillRule: \"evenodd\",\n stroke: \"currentColor\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.5 4.8c2 3 1.7 7-1 9.7h0l4.3 4.3-4.3-4.3a7.8 7.8 0 01-9.8 1m-2.2-2.2A7.8 7.8 0 0113.2 2.4M2 18L18 2\"\n }));\n}","import React from 'react';\nimport { ErrorIcon } from './icons';\nexport function ErrorScreen(_ref) {\n var _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations;\n var _translations$titleTe = translations.titleText,\n titleText = _translations$titleTe === void 0 ? 'Unable to fetch results' : _translations$titleTe,\n _translations$helpTex = translations.helpText,\n helpText = _translations$helpTex === void 0 ? 'You might want to check your network connection.' : _translations$helpTex;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-ErrorScreen\"\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Screen-Icon\"\n }, /*#__PURE__*/React.createElement(ErrorIcon, null)), /*#__PURE__*/React.createElement(\"p\", {\n className: \"DocSearch-Title\"\n }, titleText), /*#__PURE__*/React.createElement(\"p\", {\n className: \"DocSearch-Help\"\n }, helpText));\n}","var _excluded = [\"translations\"];\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from 'react';\nimport { NoResultsIcon } from './icons';\nexport function NoResultsScreen(_ref) {\n var _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations,\n props = _objectWithoutProperties(_ref, _excluded);\n\n var _translations$noResul = translations.noResultsText,\n noResultsText = _translations$noResul === void 0 ? 'No results for' : _translations$noResul,\n _translations$suggest = translations.suggestedQueryText,\n suggestedQueryText = _translations$suggest === void 0 ? 'Try searching for' : _translations$suggest,\n _translations$reportM = translations.reportMissingResultsText,\n reportMissingResultsText = _translations$reportM === void 0 ? 'Believe this query should return results?' : _translations$reportM,\n _translations$reportM2 = translations.reportMissingResultsLinkText,\n reportMissingResultsLinkText = _translations$reportM2 === void 0 ? 'Let us know.' : _translations$reportM2;\n var searchSuggestions = props.state.context.searchSuggestions;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-NoResults\"\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Screen-Icon\"\n }, /*#__PURE__*/React.createElement(NoResultsIcon, null)), /*#__PURE__*/React.createElement(\"p\", {\n className: \"DocSearch-Title\"\n }, noResultsText, \" \\\"\", /*#__PURE__*/React.createElement(\"strong\", null, props.state.query), \"\\\"\"), searchSuggestions && searchSuggestions.length > 0 && /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-NoResults-Prefill-List\"\n }, /*#__PURE__*/React.createElement(\"p\", {\n className: \"DocSearch-Help\"\n }, suggestedQueryText, \":\"), /*#__PURE__*/React.createElement(\"ul\", null, searchSuggestions.slice(0, 3).reduce(function (acc, search) {\n return [].concat(_toConsumableArray(acc), [/*#__PURE__*/React.createElement(\"li\", {\n key: search\n }, /*#__PURE__*/React.createElement(\"button\", {\n className: \"DocSearch-Prefill\",\n key: search,\n type: \"button\",\n onClick: function onClick() {\n props.setQuery(search.toLowerCase() + ' ');\n props.refresh();\n props.inputRef.current.focus();\n }\n }, search))]);\n }, []))), props.getMissingResultsUrl && /*#__PURE__*/React.createElement(\"p\", {\n className: \"DocSearch-Help\"\n }, \"\".concat(reportMissingResultsText, \" \"), /*#__PURE__*/React.createElement(\"a\", {\n href: props.getMissingResultsUrl({\n query: props.state.query\n }),\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, reportMissingResultsLinkText)));\n}","var _excluded = [\"hit\", \"attribute\", \"tagName\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { createElement } from 'react';\n\nfunction getPropertyByPath(object, path) {\n var parts = path.split('.');\n return parts.reduce(function (prev, current) {\n if (prev !== null && prev !== void 0 && prev[current]) return prev[current];\n return null;\n }, object);\n}\n\nexport function Snippet(_ref) {\n var hit = _ref.hit,\n attribute = _ref.attribute,\n _ref$tagName = _ref.tagName,\n tagName = _ref$tagName === void 0 ? 'span' : _ref$tagName,\n rest = _objectWithoutProperties(_ref, _excluded);\n\n return createElement(tagName, _objectSpread(_objectSpread({}, rest), {}, {\n dangerouslySetInnerHTML: {\n __html: getPropertyByPath(hit, \"_snippetResult.\".concat(attribute, \".value\")) || getPropertyByPath(hit, attribute)\n }\n }));\n}","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport React from 'react';\nimport { Snippet } from './Snippet';\nexport function Results(props) {\n if (!props.collection || props.collection.items.length === 0) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(\"section\", {\n className: \"DocSearch-Hits\"\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-source\"\n }, props.title), /*#__PURE__*/React.createElement(\"ul\", props.getListProps(), props.collection.items.map(function (item, index) {\n return /*#__PURE__*/React.createElement(Result, _extends({\n key: [props.title, item.objectID].join(':'),\n item: item,\n index: index\n }, props));\n })));\n}\n\nfunction Result(_ref) {\n var item = _ref.item,\n index = _ref.index,\n renderIcon = _ref.renderIcon,\n renderAction = _ref.renderAction,\n getItemProps = _ref.getItemProps,\n onItemClick = _ref.onItemClick,\n collection = _ref.collection,\n hitComponent = _ref.hitComponent;\n\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n isDeleting = _React$useState2[0],\n setIsDeleting = _React$useState2[1];\n\n var _React$useState3 = React.useState(false),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n isFavoriting = _React$useState4[0],\n setIsFavoriting = _React$useState4[1];\n\n var action = React.useRef(null);\n var Hit = hitComponent;\n\n function runDeleteTransition(cb) {\n setIsDeleting(true);\n action.current = cb;\n }\n\n function runFavoriteTransition(cb) {\n setIsFavoriting(true);\n action.current = cb;\n }\n\n return /*#__PURE__*/React.createElement(\"li\", _extends({\n className: ['DocSearch-Hit', item.__docsearch_parent && 'DocSearch-Hit--Child', isDeleting && 'DocSearch-Hit--deleting', isFavoriting && 'DocSearch-Hit--favoriting'].filter(Boolean).join(' '),\n onTransitionEnd: function onTransitionEnd() {\n if (action.current) {\n action.current();\n }\n }\n }, getItemProps({\n item: item,\n source: collection.source,\n onClick: function onClick() {\n onItemClick(item);\n }\n })), /*#__PURE__*/React.createElement(Hit, {\n hit: item\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-Container\"\n }, renderIcon({\n item: item,\n index: index\n }), item.hierarchy[item.type] && item.type === 'lvl1' && /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-content-wrapper\"\n }, /*#__PURE__*/React.createElement(Snippet, {\n className: \"DocSearch-Hit-title\",\n hit: item,\n attribute: \"hierarchy.lvl1\"\n }), item.content && /*#__PURE__*/React.createElement(Snippet, {\n className: \"DocSearch-Hit-path\",\n hit: item,\n attribute: \"content\"\n })), item.hierarchy[item.type] && (item.type === 'lvl2' || item.type === 'lvl3' || item.type === 'lvl4' || item.type === 'lvl5' || item.type === 'lvl6') && /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-content-wrapper\"\n }, /*#__PURE__*/React.createElement(Snippet, {\n className: \"DocSearch-Hit-title\",\n hit: item,\n attribute: \"hierarchy.\".concat(item.type)\n }), /*#__PURE__*/React.createElement(Snippet, {\n className: \"DocSearch-Hit-path\",\n hit: item,\n attribute: \"hierarchy.lvl1\"\n })), item.type === 'content' && /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-content-wrapper\"\n }, /*#__PURE__*/React.createElement(Snippet, {\n className: \"DocSearch-Hit-title\",\n hit: item,\n attribute: \"content\"\n }), /*#__PURE__*/React.createElement(Snippet, {\n className: \"DocSearch-Hit-path\",\n hit: item,\n attribute: \"hierarchy.lvl1\"\n })), renderAction({\n item: item,\n runDeleteTransition: runDeleteTransition,\n runFavoriteTransition: runFavoriteTransition\n }))));\n}","export function groupBy(values, predicate) {\n return values.reduce(function (acc, item) {\n var key = predicate(item);\n\n if (!acc.hasOwnProperty(key)) {\n acc[key] = [];\n } // We limit each section to show 5 hits maximum.\n // This acts as a frontend alternative to `distinct`.\n\n\n if (acc[key].length < 5) {\n acc[key].push(item);\n }\n\n return acc;\n }, {});\n}","export function identity(x) {\n return x;\n}","export function noop() {}","var regexHighlightTags = /(|<\\/mark>)/g;\nvar regexHasHighlightTags = RegExp(regexHighlightTags.source);\nexport function removeHighlightTags(hit) {\n var _internalDocSearchHit, _internalDocSearchHit2, _internalDocSearchHit3, _hit$_highlightResult, _hit$_highlightResult2;\n\n var internalDocSearchHit = hit;\n\n if (!internalDocSearchHit.__docsearch_parent && !hit._highlightResult) {\n return hit.hierarchy.lvl0;\n }\n\n var _ref = (internalDocSearchHit.__docsearch_parent ? (_internalDocSearchHit = internalDocSearchHit.__docsearch_parent) === null || _internalDocSearchHit === void 0 ? void 0 : (_internalDocSearchHit2 = _internalDocSearchHit._highlightResult) === null || _internalDocSearchHit2 === void 0 ? void 0 : (_internalDocSearchHit3 = _internalDocSearchHit2.hierarchy) === null || _internalDocSearchHit3 === void 0 ? void 0 : _internalDocSearchHit3.lvl0 : (_hit$_highlightResult = hit._highlightResult) === null || _hit$_highlightResult === void 0 ? void 0 : (_hit$_highlightResult2 = _hit$_highlightResult.hierarchy) === null || _hit$_highlightResult2 === void 0 ? void 0 : _hit$_highlightResult2.lvl0) || {},\n value = _ref.value;\n\n return value && regexHasHighlightTags.test(value) ? value.replace(regexHighlightTags, '') : value;\n}","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport React from 'react';\nimport { SelectIcon, SourceIcon } from './icons';\nimport { Results } from './Results';\nimport { removeHighlightTags } from './utils';\nexport function ResultsScreen(props) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Dropdown-Container\"\n }, props.state.collections.map(function (collection) {\n if (collection.items.length === 0) {\n return null;\n }\n\n var title = removeHighlightTags(collection.items[0]);\n return /*#__PURE__*/React.createElement(Results, _extends({}, props, {\n key: collection.source.sourceId,\n title: title,\n collection: collection,\n renderIcon: function renderIcon(_ref) {\n var _collection$items;\n\n var item = _ref.item,\n index = _ref.index;\n return /*#__PURE__*/React.createElement(React.Fragment, null, item.__docsearch_parent && /*#__PURE__*/React.createElement(\"svg\", {\n className: \"DocSearch-Hit-Tree\",\n viewBox: \"0 0 24 54\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }, item.__docsearch_parent !== ((_collection$items = collection.items[index + 1]) === null || _collection$items === void 0 ? void 0 : _collection$items.__docsearch_parent) ? /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8 6v21M20 27H8.3\"\n }) : /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8 6v42M20 27H8.3\"\n }))), /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-icon\"\n }, /*#__PURE__*/React.createElement(SourceIcon, {\n type: item.type\n })));\n },\n renderAction: function renderAction() {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-action\"\n }, /*#__PURE__*/React.createElement(SelectIcon, null));\n }\n }));\n }), props.resultsFooterComponent && /*#__PURE__*/React.createElement(\"section\", {\n className: \"DocSearch-HitsFooter\"\n }, /*#__PURE__*/React.createElement(props.resultsFooterComponent, {\n state: props.state\n })));\n}","var _excluded = [\"translations\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from 'react';\nimport { RecentIcon, ResetIcon, StarIcon } from './icons';\nimport { Results } from './Results';\nexport function StartScreen(_ref) {\n var _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations,\n props = _objectWithoutProperties(_ref, _excluded);\n\n var _translations$recentS = translations.recentSearchesTitle,\n recentSearchesTitle = _translations$recentS === void 0 ? 'Recent' : _translations$recentS,\n _translations$noRecen = translations.noRecentSearchesText,\n noRecentSearchesText = _translations$noRecen === void 0 ? 'No recent searches' : _translations$noRecen,\n _translations$saveRec = translations.saveRecentSearchButtonTitle,\n saveRecentSearchButtonTitle = _translations$saveRec === void 0 ? 'Save this search' : _translations$saveRec,\n _translations$removeR = translations.removeRecentSearchButtonTitle,\n removeRecentSearchButtonTitle = _translations$removeR === void 0 ? 'Remove this search from history' : _translations$removeR,\n _translations$favorit = translations.favoriteSearchesTitle,\n favoriteSearchesTitle = _translations$favorit === void 0 ? 'Favorite' : _translations$favorit,\n _translations$removeF = translations.removeFavoriteSearchButtonTitle,\n removeFavoriteSearchButtonTitle = _translations$removeF === void 0 ? 'Remove this search from favorites' : _translations$removeF;\n\n if (props.state.status === 'idle' && props.hasCollections === false) {\n if (props.disableUserPersonalization) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-StartScreen\"\n }, /*#__PURE__*/React.createElement(\"p\", {\n className: \"DocSearch-Help\"\n }, noRecentSearchesText));\n }\n\n if (props.hasCollections === false) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Dropdown-Container\"\n }, /*#__PURE__*/React.createElement(Results, _extends({}, props, {\n title: recentSearchesTitle,\n collection: props.state.collections[0],\n renderIcon: function renderIcon() {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-icon\"\n }, /*#__PURE__*/React.createElement(RecentIcon, null));\n },\n renderAction: function renderAction(_ref2) {\n var item = _ref2.item,\n runFavoriteTransition = _ref2.runFavoriteTransition,\n runDeleteTransition = _ref2.runDeleteTransition;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-action\"\n }, /*#__PURE__*/React.createElement(\"button\", {\n className: \"DocSearch-Hit-action-button\",\n title: saveRecentSearchButtonTitle,\n type: \"submit\",\n onClick: function onClick(event) {\n event.preventDefault();\n event.stopPropagation();\n runFavoriteTransition(function () {\n props.favoriteSearches.add(item);\n props.recentSearches.remove(item);\n props.refresh();\n });\n }\n }, /*#__PURE__*/React.createElement(StarIcon, null))), /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-action\"\n }, /*#__PURE__*/React.createElement(\"button\", {\n className: \"DocSearch-Hit-action-button\",\n title: removeRecentSearchButtonTitle,\n type: \"submit\",\n onClick: function onClick(event) {\n event.preventDefault();\n event.stopPropagation();\n runDeleteTransition(function () {\n props.recentSearches.remove(item);\n props.refresh();\n });\n }\n }, /*#__PURE__*/React.createElement(ResetIcon, null))));\n }\n })), /*#__PURE__*/React.createElement(Results, _extends({}, props, {\n title: favoriteSearchesTitle,\n collection: props.state.collections[1],\n renderIcon: function renderIcon() {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-icon\"\n }, /*#__PURE__*/React.createElement(StarIcon, null));\n },\n renderAction: function renderAction(_ref3) {\n var item = _ref3.item,\n runDeleteTransition = _ref3.runDeleteTransition;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-action\"\n }, /*#__PURE__*/React.createElement(\"button\", {\n className: \"DocSearch-Hit-action-button\",\n title: removeFavoriteSearchButtonTitle,\n type: \"submit\",\n onClick: function onClick(event) {\n event.preventDefault();\n event.stopPropagation();\n runDeleteTransition(function () {\n props.favoriteSearches.remove(item);\n props.refresh();\n });\n }\n }, /*#__PURE__*/React.createElement(ResetIcon, null)));\n }\n })));\n}","var _excluded = [\"translations\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from 'react';\nimport { ErrorScreen } from './ErrorScreen';\nimport { NoResultsScreen } from './NoResultsScreen';\nimport { ResultsScreen } from './ResultsScreen';\nimport { StartScreen } from './StartScreen';\nexport var ScreenState = React.memo(function (_ref) {\n var _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations,\n props = _objectWithoutProperties(_ref, _excluded);\n\n if (props.state.status === 'error') {\n return /*#__PURE__*/React.createElement(ErrorScreen, {\n translations: translations === null || translations === void 0 ? void 0 : translations.errorScreen\n });\n }\n\n var hasCollections = props.state.collections.some(function (collection) {\n return collection.items.length > 0;\n });\n\n if (!props.state.query) {\n return /*#__PURE__*/React.createElement(StartScreen, _extends({}, props, {\n hasCollections: hasCollections,\n translations: translations === null || translations === void 0 ? void 0 : translations.startScreen\n }));\n }\n\n if (hasCollections === false) {\n return /*#__PURE__*/React.createElement(NoResultsScreen, _extends({}, props, {\n translations: translations === null || translations === void 0 ? void 0 : translations.noResultsScreen\n }));\n }\n\n return /*#__PURE__*/React.createElement(ResultsScreen, props);\n}, function areEqual(_prevProps, nextProps) {\n // We don't update the screen when Autocomplete is loading or stalled to\n // avoid UI flashes:\n // - Empty screen → Results screen\n // - NoResults screen → NoResults screen with another query\n return nextProps.state.status === 'loading' || nextProps.state.status === 'stalled';\n});","var _excluded = [\"translations\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from 'react';\nimport { MAX_QUERY_SIZE } from './constants';\nimport { LoadingIcon } from './icons/LoadingIcon';\nimport { ResetIcon } from './icons/ResetIcon';\nimport { SearchIcon } from './icons/SearchIcon';\nexport function SearchBox(_ref) {\n var _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations,\n props = _objectWithoutProperties(_ref, _excluded);\n\n var _translations$resetBu = translations.resetButtonTitle,\n resetButtonTitle = _translations$resetBu === void 0 ? 'Clear the query' : _translations$resetBu,\n _translations$resetBu2 = translations.resetButtonAriaLabel,\n resetButtonAriaLabel = _translations$resetBu2 === void 0 ? 'Clear the query' : _translations$resetBu2,\n _translations$cancelB = translations.cancelButtonText,\n cancelButtonText = _translations$cancelB === void 0 ? 'Cancel' : _translations$cancelB,\n _translations$cancelB2 = translations.cancelButtonAriaLabel,\n cancelButtonAriaLabel = _translations$cancelB2 === void 0 ? 'Cancel' : _translations$cancelB2;\n\n var _props$getFormProps = props.getFormProps({\n inputElement: props.inputRef.current\n }),\n onReset = _props$getFormProps.onReset;\n\n React.useEffect(function () {\n if (props.autoFocus && props.inputRef.current) {\n props.inputRef.current.focus();\n }\n }, [props.autoFocus, props.inputRef]);\n React.useEffect(function () {\n if (props.isFromSelection && props.inputRef.current) {\n props.inputRef.current.select();\n }\n }, [props.isFromSelection, props.inputRef]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"form\", {\n className: \"DocSearch-Form\",\n onSubmit: function onSubmit(event) {\n event.preventDefault();\n },\n onReset: onReset\n }, /*#__PURE__*/React.createElement(\"label\", _extends({\n className: \"DocSearch-MagnifierLabel\"\n }, props.getLabelProps()), /*#__PURE__*/React.createElement(SearchIcon, null)), /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-LoadingIndicator\"\n }, /*#__PURE__*/React.createElement(LoadingIcon, null)), /*#__PURE__*/React.createElement(\"input\", _extends({\n className: \"DocSearch-Input\",\n ref: props.inputRef\n }, props.getInputProps({\n inputElement: props.inputRef.current,\n autoFocus: props.autoFocus,\n maxLength: MAX_QUERY_SIZE\n }))), /*#__PURE__*/React.createElement(\"button\", {\n type: \"reset\",\n title: resetButtonTitle,\n className: \"DocSearch-Reset\",\n \"aria-label\": resetButtonAriaLabel,\n hidden: !props.state.query\n }, /*#__PURE__*/React.createElement(ResetIcon, null))), /*#__PURE__*/React.createElement(\"button\", {\n className: \"DocSearch-Cancel\",\n type: \"reset\",\n \"aria-label\": cancelButtonAriaLabel,\n onClick: props.onClose\n }, cancelButtonText));\n}","export var MAX_QUERY_SIZE = 64;","var _excluded = [\"_highlightResult\", \"_snippetResult\"];\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction isLocalStorageSupported() {\n var key = '__TEST_KEY__';\n\n try {\n localStorage.setItem(key, '');\n localStorage.removeItem(key);\n return true;\n } catch (error) {\n return false;\n }\n}\n\nfunction createStorage(key) {\n if (isLocalStorageSupported() === false) {\n return {\n setItem: function setItem() {},\n getItem: function getItem() {\n return [];\n }\n };\n }\n\n return {\n setItem: function setItem(item) {\n return window.localStorage.setItem(key, JSON.stringify(item));\n },\n getItem: function getItem() {\n var item = window.localStorage.getItem(key);\n return item ? JSON.parse(item) : [];\n }\n };\n}\n\nexport function createStoredSearches(_ref) {\n var key = _ref.key,\n _ref$limit = _ref.limit,\n limit = _ref$limit === void 0 ? 5 : _ref$limit;\n var storage = createStorage(key);\n var items = storage.getItem().slice(0, limit);\n return {\n add: function add(item) {\n var _ref2 = item,\n _highlightResult = _ref2._highlightResult,\n _snippetResult = _ref2._snippetResult,\n hit = _objectWithoutProperties(_ref2, _excluded);\n\n var isQueryAlreadySaved = items.findIndex(function (x) {\n return x.objectID === hit.objectID;\n });\n\n if (isQueryAlreadySaved > -1) {\n items.splice(isQueryAlreadySaved, 1);\n }\n\n items.unshift(hit);\n items = items.slice(0, limit);\n storage.setItem(items);\n },\n remove: function remove(item) {\n items = items.filter(function (x) {\n return x.objectID !== item.objectID;\n });\n storage.setItem(items);\n },\n getAll: function getAll() {\n return items;\n }\n };\n}","function createBrowserLocalStorageCache(options) {\r\n const namespaceKey = `algoliasearch-client-js-${options.key}`;\r\n // eslint-disable-next-line functional/no-let\r\n let storage;\r\n const getStorage = () => {\r\n if (storage === undefined) {\r\n storage = options.localStorage || window.localStorage;\r\n }\r\n return storage;\r\n };\r\n const getNamespace = () => {\r\n return JSON.parse(getStorage().getItem(namespaceKey) || '{}');\r\n };\r\n return {\r\n get(key, defaultValue, events = {\r\n miss: () => Promise.resolve(),\r\n }) {\r\n return Promise.resolve()\r\n .then(() => {\r\n const keyAsString = JSON.stringify(key);\r\n const value = getNamespace()[keyAsString];\r\n return Promise.all([value || defaultValue(), value !== undefined]);\r\n })\r\n .then(([value, exists]) => {\r\n return Promise.all([value, exists || events.miss(value)]);\r\n })\r\n .then(([value]) => value);\r\n },\r\n set(key, value) {\r\n return Promise.resolve().then(() => {\r\n const namespace = getNamespace();\r\n // eslint-disable-next-line functional/immutable-data\r\n namespace[JSON.stringify(key)] = value;\r\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\r\n return value;\r\n });\r\n },\r\n delete(key) {\r\n return Promise.resolve().then(() => {\r\n const namespace = getNamespace();\r\n // eslint-disable-next-line functional/immutable-data\r\n delete namespace[JSON.stringify(key)];\r\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\r\n });\r\n },\r\n clear() {\r\n return Promise.resolve().then(() => {\r\n getStorage().removeItem(namespaceKey);\r\n });\r\n },\r\n };\r\n}\n\n// @todo Add logger on options to debug when caches go wrong.\r\nfunction createFallbackableCache(options) {\r\n const caches = [...options.caches];\r\n const current = caches.shift(); // eslint-disable-line functional/immutable-data\r\n if (current === undefined) {\r\n return createNullCache();\r\n }\r\n return {\r\n get(key, defaultValue, events = {\r\n miss: () => Promise.resolve(),\r\n }) {\r\n return current.get(key, defaultValue, events).catch(() => {\r\n return createFallbackableCache({ caches }).get(key, defaultValue, events);\r\n });\r\n },\r\n set(key, value) {\r\n return current.set(key, value).catch(() => {\r\n return createFallbackableCache({ caches }).set(key, value);\r\n });\r\n },\r\n delete(key) {\r\n return current.delete(key).catch(() => {\r\n return createFallbackableCache({ caches }).delete(key);\r\n });\r\n },\r\n clear() {\r\n return current.clear().catch(() => {\r\n return createFallbackableCache({ caches }).clear();\r\n });\r\n },\r\n };\r\n}\n\nfunction createNullCache() {\r\n return {\r\n get(_key, defaultValue, events = {\r\n miss: () => Promise.resolve(),\r\n }) {\r\n const value = defaultValue();\r\n return value\r\n .then(result => Promise.all([result, events.miss(result)]))\r\n .then(([result]) => result);\r\n },\r\n set(_key, value) {\r\n return Promise.resolve(value);\r\n },\r\n delete(_key) {\r\n return Promise.resolve();\r\n },\r\n clear() {\r\n return Promise.resolve();\r\n },\r\n };\r\n}\n\nfunction createInMemoryCache(options = { serializable: true }) {\r\n // eslint-disable-next-line functional/no-let\r\n let cache = {};\r\n return {\r\n get(key, defaultValue, events = {\r\n miss: () => Promise.resolve(),\r\n }) {\r\n const keyAsString = JSON.stringify(key);\r\n if (keyAsString in cache) {\r\n return Promise.resolve(options.serializable ? JSON.parse(cache[keyAsString]) : cache[keyAsString]);\r\n }\r\n const promise = defaultValue();\r\n const miss = (events && events.miss) || (() => Promise.resolve());\r\n return promise.then((value) => miss(value)).then(() => promise);\r\n },\r\n set(key, value) {\r\n // eslint-disable-next-line functional/immutable-data\r\n cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value;\r\n return Promise.resolve(value);\r\n },\r\n delete(key) {\r\n // eslint-disable-next-line functional/immutable-data\r\n delete cache[JSON.stringify(key)];\r\n return Promise.resolve();\r\n },\r\n clear() {\r\n cache = {};\r\n return Promise.resolve();\r\n },\r\n };\r\n}\n\nfunction createAuth(authMode, appId, apiKey) {\r\n const credentials = {\r\n 'x-algolia-api-key': apiKey,\r\n 'x-algolia-application-id': appId,\r\n };\r\n return {\r\n headers() {\r\n return authMode === AuthMode.WithinHeaders ? credentials : {};\r\n },\r\n queryParameters() {\r\n return authMode === AuthMode.WithinQueryParameters ? credentials : {};\r\n },\r\n };\r\n}\n\n// eslint-disable-next-line functional/prefer-readonly-type\r\nfunction shuffle(array) {\r\n let c = array.length - 1; // eslint-disable-line functional/no-let\r\n // eslint-disable-next-line functional/no-loop-statement\r\n for (c; c > 0; c--) {\r\n const b = Math.floor(Math.random() * (c + 1));\r\n const a = array[c];\r\n array[c] = array[b]; // eslint-disable-line functional/immutable-data, no-param-reassign\r\n array[b] = a; // eslint-disable-line functional/immutable-data, no-param-reassign\r\n }\r\n return array;\r\n}\r\nfunction addMethods(base, methods) {\r\n if (!methods) {\r\n return base;\r\n }\r\n Object.keys(methods).forEach(key => {\r\n // eslint-disable-next-line functional/immutable-data, no-param-reassign\r\n base[key] = methods[key](base);\r\n });\r\n return base;\r\n}\r\nfunction encode(format, ...args) {\r\n // eslint-disable-next-line functional/no-let\r\n let i = 0;\r\n return format.replace(/%s/g, () => encodeURIComponent(args[i++]));\r\n}\n\nconst version = '4.8.5';\n\nconst AuthMode = {\r\n /**\r\n * If auth credentials should be in query parameters.\r\n */\r\n WithinQueryParameters: 0,\r\n /**\r\n * If auth credentials should be in headers.\r\n */\r\n WithinHeaders: 1,\r\n};\n\nfunction createMappedRequestOptions(requestOptions, timeout) {\r\n const options = requestOptions || {};\r\n const data = options.data || {};\r\n Object.keys(options).forEach(key => {\r\n if (['timeout', 'headers', 'queryParameters', 'data', 'cacheable'].indexOf(key) === -1) {\r\n data[key] = options[key]; // eslint-disable-line functional/immutable-data\r\n }\r\n });\r\n return {\r\n data: Object.entries(data).length > 0 ? data : undefined,\r\n timeout: options.timeout || timeout,\r\n headers: options.headers || {},\r\n queryParameters: options.queryParameters || {},\r\n cacheable: options.cacheable,\r\n };\r\n}\n\nconst CallEnum = {\r\n /**\r\n * If the host is read only.\r\n */\r\n Read: 1,\r\n /**\r\n * If the host is write only.\r\n */\r\n Write: 2,\r\n /**\r\n * If the host is both read and write.\r\n */\r\n Any: 3,\r\n};\n\nconst HostStatusEnum = {\r\n Up: 1,\r\n Down: 2,\r\n Timeouted: 3,\r\n};\n\n// By default, API Clients at Algolia have expiration delay\r\n// of 5 mins. In the JavaScript client, we have 2 mins.\r\nconst EXPIRATION_DELAY = 2 * 60 * 1000;\r\nfunction createStatefulHost(host, status = HostStatusEnum.Up) {\r\n return {\r\n ...host,\r\n status,\r\n lastUpdate: Date.now(),\r\n };\r\n}\r\nfunction isStatefulHostUp(host) {\r\n return host.status === HostStatusEnum.Up || Date.now() - host.lastUpdate > EXPIRATION_DELAY;\r\n}\r\nfunction isStatefulHostTimeouted(host) {\r\n return (host.status === HostStatusEnum.Timeouted && Date.now() - host.lastUpdate <= EXPIRATION_DELAY);\r\n}\n\nfunction createStatelessHost(options) {\r\n if (typeof options === 'string') {\r\n return {\r\n protocol: 'https',\r\n url: options,\r\n accept: CallEnum.Any,\r\n };\r\n }\r\n return {\r\n protocol: options.protocol || 'https',\r\n url: options.url,\r\n accept: options.accept || CallEnum.Any,\r\n };\r\n}\n\nconst MethodEnum = {\r\n Delete: 'DELETE',\r\n Get: 'GET',\r\n Post: 'POST',\r\n Put: 'PUT',\r\n};\n\nfunction createRetryableOptions(hostsCache, statelessHosts) {\r\n return Promise.all(statelessHosts.map(statelessHost => {\r\n return hostsCache.get(statelessHost, () => {\r\n return Promise.resolve(createStatefulHost(statelessHost));\r\n });\r\n })).then(statefulHosts => {\r\n const hostsUp = statefulHosts.filter(host => isStatefulHostUp(host));\r\n const hostsTimeouted = statefulHosts.filter(host => isStatefulHostTimeouted(host));\r\n /**\r\n * Note, we put the hosts that previously timeouted on the end of the list.\r\n */\r\n const hostsAvailable = [...hostsUp, ...hostsTimeouted];\r\n const statelessHostsAvailable = hostsAvailable.length > 0\r\n ? hostsAvailable.map(host => createStatelessHost(host))\r\n : statelessHosts;\r\n return {\r\n getTimeout(timeoutsCount, baseTimeout) {\r\n /**\r\n * Imagine that you have 4 hosts, if timeouts will increase\r\n * on the following way: 1 (timeouted) > 4 (timeouted) > 5 (200)\r\n *\r\n * Note that, the very next request, we start from the previous timeout\r\n *\r\n * 5 (timeouted) > 6 (timeouted) > 7 ...\r\n *\r\n * This strategy may need to be reviewed, but is the strategy on the our\r\n * current v3 version.\r\n */\r\n const timeoutMultiplier = hostsTimeouted.length === 0 && timeoutsCount === 0\r\n ? 1\r\n : hostsTimeouted.length + 3 + timeoutsCount;\r\n return timeoutMultiplier * baseTimeout;\r\n },\r\n statelessHosts: statelessHostsAvailable,\r\n };\r\n });\r\n}\n\nconst isNetworkError = ({ isTimedOut, status }) => {\r\n return !isTimedOut && ~~status === 0;\r\n};\r\nconst isRetryable = (response) => {\r\n const status = response.status;\r\n const isTimedOut = response.isTimedOut;\r\n return (isTimedOut || isNetworkError(response) || (~~(status / 100) !== 2 && ~~(status / 100) !== 4));\r\n};\r\nconst isSuccess = ({ status }) => {\r\n return ~~(status / 100) === 2;\r\n};\r\nconst retryDecision = (response, outcomes) => {\r\n if (isRetryable(response)) {\r\n return outcomes.onRetry(response);\r\n }\r\n if (isSuccess(response)) {\r\n return outcomes.onSucess(response);\r\n }\r\n return outcomes.onFail(response);\r\n};\n\nfunction retryableRequest(transporter, statelessHosts, request, requestOptions) {\r\n const stackTrace = []; // eslint-disable-line functional/prefer-readonly-type\r\n /**\r\n * First we prepare the payload that do not depend from hosts.\r\n */\r\n const data = serializeData(request, requestOptions);\r\n const headers = serializeHeaders(transporter, requestOptions);\r\n const method = request.method;\r\n // On `GET`, the data is proxied to query parameters.\r\n const dataQueryParameters = request.method !== MethodEnum.Get\r\n ? {}\r\n : {\r\n ...request.data,\r\n ...requestOptions.data,\r\n };\r\n const queryParameters = {\r\n 'x-algolia-agent': transporter.userAgent.value,\r\n ...transporter.queryParameters,\r\n ...dataQueryParameters,\r\n ...requestOptions.queryParameters,\r\n };\r\n let timeoutsCount = 0; // eslint-disable-line functional/no-let\r\n const retry = (hosts, // eslint-disable-line functional/prefer-readonly-type\r\n getTimeout) => {\r\n /**\r\n * We iterate on each host, until there is no host left.\r\n */\r\n const host = hosts.pop(); // eslint-disable-line functional/immutable-data\r\n if (host === undefined) {\r\n throw createRetryError(stackTraceWithoutCredentials(stackTrace));\r\n }\r\n const payload = {\r\n data,\r\n headers,\r\n method,\r\n url: serializeUrl(host, request.path, queryParameters),\r\n connectTimeout: getTimeout(timeoutsCount, transporter.timeouts.connect),\r\n responseTimeout: getTimeout(timeoutsCount, requestOptions.timeout),\r\n };\r\n /**\r\n * The stackFrame is pushed to the stackTrace so we\r\n * can have information about onRetry and onFailure\r\n * decisions.\r\n */\r\n const pushToStackTrace = (response) => {\r\n const stackFrame = {\r\n request: payload,\r\n response,\r\n host,\r\n triesLeft: hosts.length,\r\n };\r\n // eslint-disable-next-line functional/immutable-data\r\n stackTrace.push(stackFrame);\r\n return stackFrame;\r\n };\r\n const decisions = {\r\n onSucess: response => deserializeSuccess(response),\r\n onRetry(response) {\r\n const stackFrame = pushToStackTrace(response);\r\n /**\r\n * If response is a timeout, we increaset the number of\r\n * timeouts so we can increase the timeout later.\r\n */\r\n if (response.isTimedOut) {\r\n timeoutsCount++;\r\n }\r\n return Promise.all([\r\n /**\r\n * Failures are individually send the logger, allowing\r\n * the end user to debug / store stack frames even\r\n * when a retry error does not happen.\r\n */\r\n transporter.logger.info('Retryable failure', stackFrameWithoutCredentials(stackFrame)),\r\n /**\r\n * We also store the state of the host in failure cases. If the host, is\r\n * down it will remain down for the next 2 minutes. In a timeout situation,\r\n * this host will be added end of the list of hosts on the next request.\r\n */\r\n transporter.hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? HostStatusEnum.Timeouted : HostStatusEnum.Down)),\r\n ]).then(() => retry(hosts, getTimeout));\r\n },\r\n onFail(response) {\r\n pushToStackTrace(response);\r\n throw deserializeFailure(response, stackTraceWithoutCredentials(stackTrace));\r\n },\r\n };\r\n return transporter.requester.send(payload).then(response => {\r\n return retryDecision(response, decisions);\r\n });\r\n };\r\n /**\r\n * Finally, for each retryable host perform request until we got a non\r\n * retryable response. Some notes here:\r\n *\r\n * 1. The reverse here is applied so we can apply a `pop` later on => more performant.\r\n * 2. We also get from the retryable options a timeout multiplier that is tailored\r\n * for the current context.\r\n */\r\n return createRetryableOptions(transporter.hostsCache, statelessHosts).then(options => {\r\n return retry([...options.statelessHosts].reverse(), options.getTimeout);\r\n });\r\n}\n\nfunction createTransporter(options) {\r\n const { hostsCache, logger, requester, requestsCache, responsesCache, timeouts, userAgent, hosts, queryParameters, headers, } = options;\r\n const transporter = {\r\n hostsCache,\r\n logger,\r\n requester,\r\n requestsCache,\r\n responsesCache,\r\n timeouts,\r\n userAgent,\r\n headers,\r\n queryParameters,\r\n hosts: hosts.map(host => createStatelessHost(host)),\r\n read(request, requestOptions) {\r\n /**\r\n * First, we compute the user request options. Now, keep in mind,\r\n * that using request options the user is able to modified the intire\r\n * payload of the request. Such as headers, query parameters, and others.\r\n */\r\n const mappedRequestOptions = createMappedRequestOptions(requestOptions, transporter.timeouts.read);\r\n const createRetryableRequest = () => {\r\n /**\r\n * Then, we prepare a function factory that contains the construction of\r\n * the retryable request. At this point, we may *not* perform the actual\r\n * request. But we want to have the function factory ready.\r\n */\r\n return retryableRequest(transporter, transporter.hosts.filter(host => (host.accept & CallEnum.Read) !== 0), request, mappedRequestOptions);\r\n };\r\n /**\r\n * Once we have the function factory ready, we need to determine of the\r\n * request is \"cacheable\" - should be cached. Note that, once again,\r\n * the user can force this option.\r\n */\r\n const cacheable = mappedRequestOptions.cacheable !== undefined\r\n ? mappedRequestOptions.cacheable\r\n : request.cacheable;\r\n /**\r\n * If is not \"cacheable\", we immediatly trigger the retryable request, no\r\n * need to check cache implementations.\r\n */\r\n if (cacheable !== true) {\r\n return createRetryableRequest();\r\n }\r\n /**\r\n * If the request is \"cacheable\", we need to first compute the key to ask\r\n * the cache implementations if this request is on progress or if the\r\n * response already exists on the cache.\r\n */\r\n const key = {\r\n request,\r\n mappedRequestOptions,\r\n transporter: {\r\n queryParameters: transporter.queryParameters,\r\n headers: transporter.headers,\r\n },\r\n };\r\n /**\r\n * With the computed key, we first ask the responses cache\r\n * implemention if this request was been resolved before.\r\n */\r\n return transporter.responsesCache.get(key, () => {\r\n /**\r\n * If the request has never resolved before, we actually ask if there\r\n * is a current request with the same key on progress.\r\n */\r\n return transporter.requestsCache.get(key, () => {\r\n return (transporter.requestsCache\r\n /**\r\n * Finally, if there is no request in progress with the same key,\r\n * this `createRetryableRequest()` will actually trigger the\r\n * retryable request.\r\n */\r\n .set(key, createRetryableRequest())\r\n .then(response => Promise.all([transporter.requestsCache.delete(key), response]), err => Promise.all([transporter.requestsCache.delete(key), Promise.reject(err)]))\r\n .then(([_, response]) => response));\r\n });\r\n }, {\r\n /**\r\n * Of course, once we get this response back from the server, we\r\n * tell response cache to actually store the received response\r\n * to be used later.\r\n */\r\n miss: response => transporter.responsesCache.set(key, response),\r\n });\r\n },\r\n write(request, requestOptions) {\r\n /**\r\n * On write requests, no cache mechanisms are applied, and we\r\n * proxy the request immediately to the requester.\r\n */\r\n return retryableRequest(transporter, transporter.hosts.filter(host => (host.accept & CallEnum.Write) !== 0), request, createMappedRequestOptions(requestOptions, transporter.timeouts.write));\r\n },\r\n };\r\n return transporter;\r\n}\n\nfunction createUserAgent(version) {\r\n const userAgent = {\r\n value: `Algolia for JavaScript (${version})`,\r\n add(options) {\r\n const addedUserAgent = `; ${options.segment}${options.version !== undefined ? ` (${options.version})` : ''}`;\r\n if (userAgent.value.indexOf(addedUserAgent) === -1) {\r\n // eslint-disable-next-line functional/immutable-data\r\n userAgent.value = `${userAgent.value}${addedUserAgent}`;\r\n }\r\n return userAgent;\r\n },\r\n };\r\n return userAgent;\r\n}\n\nfunction deserializeSuccess(response) {\r\n // eslint-disable-next-line functional/no-try-statement\r\n try {\r\n return JSON.parse(response.content);\r\n }\r\n catch (e) {\r\n throw createDeserializationError(e.message, response);\r\n }\r\n}\r\nfunction deserializeFailure({ content, status }, stackFrame) {\r\n // eslint-disable-next-line functional/no-let\r\n let message = content;\r\n // eslint-disable-next-line functional/no-try-statement\r\n try {\r\n message = JSON.parse(content).message;\r\n }\r\n catch (e) {\r\n // ..\r\n }\r\n return createApiError(message, status, stackFrame);\r\n}\n\nfunction serializeUrl(host, path, queryParameters) {\r\n const queryParametersAsString = serializeQueryParameters(queryParameters);\r\n // eslint-disable-next-line functional/no-let\r\n let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.substr(1) : path}`;\r\n if (queryParametersAsString.length) {\r\n url += `?${queryParametersAsString}`;\r\n }\r\n return url;\r\n}\r\nfunction serializeQueryParameters(parameters) {\r\n const isObjectOrArray = (value) => Object.prototype.toString.call(value) === '[object Object]' ||\r\n Object.prototype.toString.call(value) === '[object Array]';\r\n return Object.keys(parameters)\r\n .map(key => encode('%s=%s', key, isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]))\r\n .join('&');\r\n}\r\nfunction serializeData(request, requestOptions) {\r\n if (request.method === MethodEnum.Get ||\r\n (request.data === undefined && requestOptions.data === undefined)) {\r\n return undefined;\r\n }\r\n const data = Array.isArray(request.data)\r\n ? request.data\r\n : { ...request.data, ...requestOptions.data };\r\n return JSON.stringify(data);\r\n}\r\nfunction serializeHeaders(transporter, requestOptions) {\r\n const headers = {\r\n ...transporter.headers,\r\n ...requestOptions.headers,\r\n };\r\n const serializedHeaders = {};\r\n Object.keys(headers).forEach(header => {\r\n const value = headers[header];\r\n // @ts-ignore\r\n // eslint-disable-next-line functional/immutable-data\r\n serializedHeaders[header.toLowerCase()] = value;\r\n });\r\n return serializedHeaders;\r\n}\n\nfunction stackTraceWithoutCredentials(stackTrace) {\r\n return stackTrace.map(stackFrame => stackFrameWithoutCredentials(stackFrame));\r\n}\r\nfunction stackFrameWithoutCredentials(stackFrame) {\r\n const modifiedHeaders = stackFrame.request.headers['x-algolia-api-key']\r\n ? { 'x-algolia-api-key': '*****' }\r\n : {};\r\n return {\r\n ...stackFrame,\r\n request: {\r\n ...stackFrame.request,\r\n headers: {\r\n ...stackFrame.request.headers,\r\n ...modifiedHeaders,\r\n },\r\n },\r\n };\r\n}\n\nfunction createApiError(message, status, transporterStackTrace) {\r\n return {\r\n name: 'ApiError',\r\n message,\r\n status,\r\n transporterStackTrace,\r\n };\r\n}\n\nfunction createDeserializationError(message, response) {\r\n return {\r\n name: 'DeserializationError',\r\n message,\r\n response,\r\n };\r\n}\n\nfunction createRetryError(transporterStackTrace) {\r\n return {\r\n name: 'RetryError',\r\n message: 'Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.',\r\n transporterStackTrace,\r\n };\r\n}\n\nconst createSearchClient = options => {\r\n const appId = options.appId;\r\n const auth = createAuth(options.authMode !== undefined ? options.authMode : AuthMode.WithinHeaders, appId, options.apiKey);\r\n const transporter = createTransporter({\r\n hosts: [\r\n { url: `${appId}-dsn.algolia.net`, accept: CallEnum.Read },\r\n { url: `${appId}.algolia.net`, accept: CallEnum.Write },\r\n ].concat(shuffle([\r\n { url: `${appId}-1.algolianet.com` },\r\n { url: `${appId}-2.algolianet.com` },\r\n { url: `${appId}-3.algolianet.com` },\r\n ])),\r\n ...options,\r\n headers: {\r\n ...auth.headers(),\r\n ...{ 'content-type': 'application/x-www-form-urlencoded' },\r\n ...options.headers,\r\n },\r\n queryParameters: {\r\n ...auth.queryParameters(),\r\n ...options.queryParameters,\r\n },\r\n });\r\n const base = {\r\n transporter,\r\n appId,\r\n addAlgoliaAgent(segment, version) {\r\n transporter.userAgent.add({ segment, version });\r\n },\r\n clearCache() {\r\n return Promise.all([\r\n transporter.requestsCache.clear(),\r\n transporter.responsesCache.clear(),\r\n ]).then(() => undefined);\r\n },\r\n };\r\n return addMethods(base, options.methods);\r\n};\n\nconst initIndex = (base) => {\r\n return (indexName, options = {}) => {\r\n const searchIndex = {\r\n transporter: base.transporter,\r\n appId: base.appId,\r\n indexName,\r\n };\r\n return addMethods(searchIndex, options.methods);\r\n };\r\n};\n\nconst multipleQueries = (base) => {\r\n return (queries, requestOptions) => {\r\n const requests = queries.map(query => {\r\n return {\r\n ...query,\r\n params: serializeQueryParameters(query.params || {}),\r\n };\r\n });\r\n return base.transporter.read({\r\n method: MethodEnum.Post,\r\n path: '1/indexes/*/queries',\r\n data: {\r\n requests,\r\n },\r\n cacheable: true,\r\n }, requestOptions);\r\n };\r\n};\n\nconst multipleSearchForFacetValues = (base) => {\r\n return (queries, requestOptions) => {\r\n return Promise.all(queries.map(query => {\r\n const { facetName, facetQuery, ...params } = query.params;\r\n return initIndex(base)(query.indexName, {\r\n methods: { searchForFacetValues },\r\n }).searchForFacetValues(facetName, facetQuery, {\r\n ...requestOptions,\r\n ...params,\r\n });\r\n }));\r\n };\r\n};\n\nconst findAnswers = (base) => {\r\n return (query, queryLanguages, requestOptions) => {\r\n return base.transporter.read({\r\n method: MethodEnum.Post,\r\n path: encode('1/answers/%s/prediction', base.indexName),\r\n data: {\r\n query,\r\n queryLanguages,\r\n },\r\n cacheable: true,\r\n }, requestOptions);\r\n };\r\n};\n\nconst search = (base) => {\r\n return (query, requestOptions) => {\r\n return base.transporter.read({\r\n method: MethodEnum.Post,\r\n path: encode('1/indexes/%s/query', base.indexName),\r\n data: {\r\n query,\r\n },\r\n cacheable: true,\r\n }, requestOptions);\r\n };\r\n};\n\nconst searchForFacetValues = (base) => {\r\n return (facetName, facetQuery, requestOptions) => {\r\n return base.transporter.read({\r\n method: MethodEnum.Post,\r\n path: encode('1/indexes/%s/facets/%s/query', base.indexName, facetName),\r\n data: {\r\n facetQuery,\r\n },\r\n cacheable: true,\r\n }, requestOptions);\r\n };\r\n};\n\nconst LogLevelEnum = {\r\n Debug: 1,\r\n Info: 2,\r\n Error: 3,\r\n};\n\n/* eslint no-console: 0 */\r\nfunction createConsoleLogger(logLevel) {\r\n return {\r\n debug(message, args) {\r\n if (LogLevelEnum.Debug >= logLevel) {\r\n console.debug(message, args);\r\n }\r\n return Promise.resolve();\r\n },\r\n info(message, args) {\r\n if (LogLevelEnum.Info >= logLevel) {\r\n console.info(message, args);\r\n }\r\n return Promise.resolve();\r\n },\r\n error(message, args) {\r\n console.error(message, args);\r\n return Promise.resolve();\r\n },\r\n };\r\n}\n\nfunction createBrowserXhrRequester() {\r\n return {\r\n send(request) {\r\n return new Promise((resolve) => {\r\n const baseRequester = new XMLHttpRequest();\r\n baseRequester.open(request.method, request.url, true);\r\n Object.keys(request.headers).forEach(key => baseRequester.setRequestHeader(key, request.headers[key]));\r\n const createTimeout = (timeout, content) => {\r\n return setTimeout(() => {\r\n baseRequester.abort();\r\n resolve({\r\n status: 0,\r\n content,\r\n isTimedOut: true,\r\n });\r\n }, timeout * 1000);\r\n };\r\n const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');\r\n // eslint-disable-next-line functional/no-let\r\n let responseTimeout;\r\n // eslint-disable-next-line functional/immutable-data\r\n baseRequester.onreadystatechange = () => {\r\n if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) {\r\n clearTimeout(connectTimeout);\r\n responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');\r\n }\r\n };\r\n // eslint-disable-next-line functional/immutable-data\r\n baseRequester.onerror = () => {\r\n // istanbul ignore next\r\n if (baseRequester.status === 0) {\r\n clearTimeout(connectTimeout);\r\n clearTimeout(responseTimeout);\r\n resolve({\r\n content: baseRequester.responseText || 'Network request failed',\r\n status: baseRequester.status,\r\n isTimedOut: false,\r\n });\r\n }\r\n };\r\n // eslint-disable-next-line functional/immutable-data\r\n baseRequester.onload = () => {\r\n clearTimeout(connectTimeout);\r\n clearTimeout(responseTimeout);\r\n resolve({\r\n content: baseRequester.responseText,\r\n status: baseRequester.status,\r\n isTimedOut: false,\r\n });\r\n };\r\n baseRequester.send(request.data);\r\n });\r\n },\r\n };\r\n}\n\nfunction algoliasearch(appId, apiKey, options) {\r\n const commonOptions = {\r\n appId,\r\n apiKey,\r\n timeouts: {\r\n connect: 1,\r\n read: 2,\r\n write: 30,\r\n },\r\n requester: createBrowserXhrRequester(),\r\n logger: createConsoleLogger(LogLevelEnum.Error),\r\n responsesCache: createInMemoryCache(),\r\n requestsCache: createInMemoryCache({ serializable: false }),\r\n hostsCache: createFallbackableCache({\r\n caches: [\r\n createBrowserLocalStorageCache({ key: `${version}-${appId}` }),\r\n createInMemoryCache(),\r\n ],\r\n }),\r\n userAgent: createUserAgent(version).add({\r\n segment: 'Browser',\r\n version: 'lite',\r\n }),\r\n authMode: AuthMode.WithinQueryParameters,\r\n };\r\n return createSearchClient({\r\n ...commonOptions,\r\n ...options,\r\n methods: {\r\n search: multipleQueries,\r\n searchForFacetValues: multipleSearchForFacetValues,\r\n multipleQueries,\r\n multipleSearchForFacetValues,\r\n initIndex: base => (indexName) => {\r\n return initIndex(base)(indexName, {\r\n methods: { search, searchForFacetValues, findAnswers },\r\n });\r\n },\r\n },\r\n });\r\n}\r\n// eslint-disable-next-line functional/immutable-data\r\nalgoliasearch.version = version;\n\nexport default algoliasearch;\n","var _excluded = [\"footer\", \"searchBox\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { createAutocomplete } from '@algolia/autocomplete-core';\nimport React from 'react';\nimport { MAX_QUERY_SIZE } from './constants';\nimport { Footer } from './Footer';\nimport { Hit } from './Hit';\nimport { ScreenState } from './ScreenState';\nimport { SearchBox } from './SearchBox';\nimport { createStoredSearches } from './stored-searches';\nimport { useSearchClient } from './useSearchClient';\nimport { useTouchEvents } from './useTouchEvents';\nimport { useTrapFocus } from './useTrapFocus';\nimport { groupBy, identity, noop, removeHighlightTags } from './utils';\nexport function DocSearchModal(_ref) {\n var appId = _ref.appId,\n apiKey = _ref.apiKey,\n indexName = _ref.indexName,\n _ref$placeholder = _ref.placeholder,\n placeholder = _ref$placeholder === void 0 ? 'Search docs' : _ref$placeholder,\n searchParameters = _ref.searchParameters,\n _ref$onClose = _ref.onClose,\n onClose = _ref$onClose === void 0 ? noop : _ref$onClose,\n _ref$transformItems = _ref.transformItems,\n transformItems = _ref$transformItems === void 0 ? identity : _ref$transformItems,\n _ref$hitComponent = _ref.hitComponent,\n hitComponent = _ref$hitComponent === void 0 ? Hit : _ref$hitComponent,\n _ref$resultsFooterCom = _ref.resultsFooterComponent,\n resultsFooterComponent = _ref$resultsFooterCom === void 0 ? function () {\n return null;\n } : _ref$resultsFooterCom,\n navigator = _ref.navigator,\n _ref$initialScrollY = _ref.initialScrollY,\n initialScrollY = _ref$initialScrollY === void 0 ? 0 : _ref$initialScrollY,\n _ref$transformSearchC = _ref.transformSearchClient,\n transformSearchClient = _ref$transformSearchC === void 0 ? identity : _ref$transformSearchC,\n _ref$disableUserPerso = _ref.disableUserPersonalization,\n disableUserPersonalization = _ref$disableUserPerso === void 0 ? false : _ref$disableUserPerso,\n _ref$initialQuery = _ref.initialQuery,\n initialQueryFromProp = _ref$initialQuery === void 0 ? '' : _ref$initialQuery,\n _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations,\n getMissingResultsUrl = _ref.getMissingResultsUrl;\n\n var footerTranslations = translations.footer,\n searchBoxTranslations = translations.searchBox,\n screenStateTranslations = _objectWithoutProperties(translations, _excluded);\n\n var _React$useState = React.useState({\n query: '',\n collections: [],\n completion: null,\n context: {},\n isOpen: false,\n activeItemId: null,\n status: 'idle'\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n state = _React$useState2[0],\n setState = _React$useState2[1];\n\n var containerRef = React.useRef(null);\n var modalRef = React.useRef(null);\n var formElementRef = React.useRef(null);\n var dropdownRef = React.useRef(null);\n var inputRef = React.useRef(null);\n var snippetLength = React.useRef(10);\n var initialQueryFromSelection = React.useRef(typeof window !== 'undefined' ? window.getSelection().toString().slice(0, MAX_QUERY_SIZE) : '').current;\n var initialQuery = React.useRef(initialQueryFromProp || initialQueryFromSelection).current;\n var searchClient = useSearchClient(appId, apiKey, transformSearchClient);\n var favoriteSearches = React.useRef(createStoredSearches({\n key: \"__DOCSEARCH_FAVORITE_SEARCHES__\".concat(indexName),\n limit: 10\n })).current;\n var recentSearches = React.useRef(createStoredSearches({\n key: \"__DOCSEARCH_RECENT_SEARCHES__\".concat(indexName),\n // We display 7 recent searches and there's no favorites, but only\n // 4 when there are favorites.\n limit: favoriteSearches.getAll().length === 0 ? 7 : 4\n })).current;\n var saveRecentSearch = React.useCallback(function saveRecentSearch(item) {\n if (disableUserPersonalization) {\n return;\n } // We don't store `content` record, but their parent if available.\n\n\n var search = item.type === 'content' ? item.__docsearch_parent : item; // We save the recent search only if it's not favorited.\n\n if (search && favoriteSearches.getAll().findIndex(function (x) {\n return x.objectID === search.objectID;\n }) === -1) {\n recentSearches.add(search);\n }\n }, [favoriteSearches, recentSearches, disableUserPersonalization]);\n var autocomplete = React.useMemo(function () {\n return createAutocomplete({\n id: 'docsearch',\n defaultActiveItemId: 0,\n placeholder: placeholder,\n openOnFocus: true,\n initialState: {\n query: initialQuery,\n context: {\n searchSuggestions: []\n }\n },\n navigator: navigator,\n onStateChange: function onStateChange(props) {\n setState(props.state);\n },\n getSources: function getSources(_ref2) {\n var query = _ref2.query,\n sourcesState = _ref2.state,\n setContext = _ref2.setContext,\n setStatus = _ref2.setStatus;\n\n if (!query) {\n if (disableUserPersonalization) {\n return [];\n }\n\n return [{\n sourceId: 'recentSearches',\n onSelect: function onSelect(_ref3) {\n var item = _ref3.item,\n event = _ref3.event;\n saveRecentSearch(item);\n\n if (!event.shiftKey && !event.ctrlKey && !event.metaKey) {\n onClose();\n }\n },\n getItemUrl: function getItemUrl(_ref4) {\n var item = _ref4.item;\n return item.url;\n },\n getItems: function getItems() {\n return recentSearches.getAll();\n }\n }, {\n sourceId: 'favoriteSearches',\n onSelect: function onSelect(_ref5) {\n var item = _ref5.item,\n event = _ref5.event;\n saveRecentSearch(item);\n\n if (!event.shiftKey && !event.ctrlKey && !event.metaKey) {\n onClose();\n }\n },\n getItemUrl: function getItemUrl(_ref6) {\n var item = _ref6.item;\n return item.url;\n },\n getItems: function getItems() {\n return favoriteSearches.getAll();\n }\n }];\n }\n\n return searchClient.search([{\n query: query,\n indexName: indexName,\n params: _objectSpread({\n attributesToRetrieve: ['hierarchy.lvl0', 'hierarchy.lvl1', 'hierarchy.lvl2', 'hierarchy.lvl3', 'hierarchy.lvl4', 'hierarchy.lvl5', 'hierarchy.lvl6', 'content', 'type', 'url'],\n attributesToSnippet: [\"hierarchy.lvl1:\".concat(snippetLength.current), \"hierarchy.lvl2:\".concat(snippetLength.current), \"hierarchy.lvl3:\".concat(snippetLength.current), \"hierarchy.lvl4:\".concat(snippetLength.current), \"hierarchy.lvl5:\".concat(snippetLength.current), \"hierarchy.lvl6:\".concat(snippetLength.current), \"content:\".concat(snippetLength.current)],\n snippetEllipsisText: '…',\n highlightPreTag: '',\n highlightPostTag: '',\n hitsPerPage: 20\n }, searchParameters)\n }]).catch(function (error) {\n // The Algolia `RetryError` happens when all the servers have\n // failed, meaning that there's no chance the response comes\n // back. This is the right time to display an error.\n // See https://github.com/algolia/algoliasearch-client-javascript/blob/2ffddf59bc765cd1b664ee0346b28f00229d6e12/packages/transporter/src/errors/createRetryError.ts#L5\n if (error.name === 'RetryError') {\n setStatus('error');\n }\n\n throw error;\n }).then(function (_ref7) {\n var results = _ref7.results;\n var _results$ = results[0],\n hits = _results$.hits,\n nbHits = _results$.nbHits;\n var sources = groupBy(hits, function (hit) {\n return removeHighlightTags(hit);\n }); // We store the `lvl0`s to display them as search suggestions\n // in the \"no results\" screen.\n\n if (sourcesState.context.searchSuggestions.length < Object.keys(sources).length) {\n setContext({\n searchSuggestions: Object.keys(sources)\n });\n }\n\n setContext({\n nbHits: nbHits\n });\n return Object.values(sources).map(function (items, index) {\n return {\n sourceId: \"hits\".concat(index),\n onSelect: function onSelect(_ref8) {\n var item = _ref8.item,\n event = _ref8.event;\n saveRecentSearch(item);\n\n if (!event.shiftKey && !event.ctrlKey && !event.metaKey) {\n onClose();\n }\n },\n getItemUrl: function getItemUrl(_ref9) {\n var item = _ref9.item;\n return item.url;\n },\n getItems: function getItems() {\n return Object.values(groupBy(items, function (item) {\n return item.hierarchy.lvl1;\n })).map(transformItems).map(function (groupedHits) {\n return groupedHits.map(function (item) {\n return _objectSpread(_objectSpread({}, item), {}, {\n __docsearch_parent: item.type !== 'lvl1' && groupedHits.find(function (siblingItem) {\n return siblingItem.type === 'lvl1' && siblingItem.hierarchy.lvl1 === item.hierarchy.lvl1;\n })\n });\n });\n }).flat();\n }\n };\n });\n });\n }\n });\n }, [indexName, searchParameters, searchClient, onClose, recentSearches, favoriteSearches, saveRecentSearch, initialQuery, placeholder, navigator, transformItems, disableUserPersonalization]);\n var getEnvironmentProps = autocomplete.getEnvironmentProps,\n getRootProps = autocomplete.getRootProps,\n refresh = autocomplete.refresh;\n useTouchEvents({\n getEnvironmentProps: getEnvironmentProps,\n panelElement: dropdownRef.current,\n formElement: formElementRef.current,\n inputElement: inputRef.current\n });\n useTrapFocus({\n container: containerRef.current\n });\n React.useEffect(function () {\n document.body.classList.add('DocSearch--active');\n return function () {\n var _window$scrollTo, _window;\n\n document.body.classList.remove('DocSearch--active'); // IE11 doesn't support `scrollTo` so we check that the method exists\n // first.\n\n (_window$scrollTo = (_window = window).scrollTo) === null || _window$scrollTo === void 0 ? void 0 : _window$scrollTo.call(_window, 0, initialScrollY);\n }; // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n React.useEffect(function () {\n var isMobileMediaQuery = window.matchMedia('(max-width: 750px)');\n\n if (isMobileMediaQuery.matches) {\n snippetLength.current = 5;\n }\n }, []);\n React.useEffect(function () {\n if (dropdownRef.current) {\n dropdownRef.current.scrollTop = 0;\n }\n }, [state.query]); // We don't focus the input when there's an initial query (i.e. Selection\n // Search) because users rather want to see the results directly, without the\n // keyboard appearing.\n // We therefore need to refresh the autocomplete instance to load all the\n // results, which is usually triggered on focus.\n\n React.useEffect(function () {\n if (initialQuery.length > 0) {\n refresh();\n\n if (inputRef.current) {\n inputRef.current.focus();\n }\n }\n }, [initialQuery, refresh]); // We rely on a CSS property to set the modal height to the full viewport height\n // because all mobile browsers don't compute their height the same way.\n // See https://css-tricks.com/the-trick-to-viewport-units-on-mobile/\n\n React.useEffect(function () {\n function setFullViewportHeight() {\n if (modalRef.current) {\n var vh = window.innerHeight * 0.01;\n modalRef.current.style.setProperty('--docsearch-vh', \"\".concat(vh, \"px\"));\n }\n }\n\n setFullViewportHeight();\n window.addEventListener('resize', setFullViewportHeight);\n return function () {\n window.removeEventListener('resize', setFullViewportHeight);\n };\n }, []);\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: containerRef\n }, getRootProps({\n 'aria-expanded': true\n }), {\n className: ['DocSearch', 'DocSearch-Container', state.status === 'stalled' && 'DocSearch-Container--Stalled', state.status === 'error' && 'DocSearch-Container--Errored'].filter(Boolean).join(' '),\n role: \"button\",\n tabIndex: 0,\n onMouseDown: function onMouseDown(event) {\n if (event.target === event.currentTarget) {\n onClose();\n }\n }\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Modal\",\n ref: modalRef\n }, /*#__PURE__*/React.createElement(\"header\", {\n className: \"DocSearch-SearchBar\",\n ref: formElementRef\n }, /*#__PURE__*/React.createElement(SearchBox, _extends({}, autocomplete, {\n state: state,\n autoFocus: initialQuery.length === 0,\n inputRef: inputRef,\n isFromSelection: Boolean(initialQuery) && initialQuery === initialQueryFromSelection,\n translations: searchBoxTranslations,\n onClose: onClose\n }))), /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Dropdown\",\n ref: dropdownRef\n }, /*#__PURE__*/React.createElement(ScreenState, _extends({}, autocomplete, {\n indexName: indexName,\n state: state,\n hitComponent: hitComponent,\n resultsFooterComponent: resultsFooterComponent,\n disableUserPersonalization: disableUserPersonalization,\n recentSearches: recentSearches,\n favoriteSearches: favoriteSearches,\n inputRef: inputRef,\n translations: screenStateTranslations,\n getMissingResultsUrl: getMissingResultsUrl,\n onItemClick: function onItemClick(item) {\n saveRecentSearch(item);\n onClose();\n }\n }))), /*#__PURE__*/React.createElement(\"footer\", {\n className: \"DocSearch-Footer\"\n }, /*#__PURE__*/React.createElement(Footer, {\n translations: footerTranslations\n }))));\n}","import algoliasearch from 'algoliasearch/dist/algoliasearch-lite.esm.browser';\nimport React from 'react';\nimport { version } from './version';\nexport function useSearchClient(appId, apiKey, transformSearchClient) {\n var searchClient = React.useMemo(function () {\n var client = algoliasearch(appId, apiKey);\n client.addAlgoliaAgent('docsearch', version); // Since DocSearch.js relies on DocSearch React with an alias to Preact,\n // we cannot add the `docsearch-react` user agent by default, otherwise\n // it would also be sent on a DocSearch.js integration.\n // We therefore only add the `docsearch-react` user agent if `docsearch.js`\n // is not present.\n\n if (/docsearch.js \\(.*\\)/.test(client.transporter.userAgent.value) === false) {\n client.addAlgoliaAgent('docsearch-react', version);\n }\n\n return transformSearchClient(client);\n }, [appId, apiKey, transformSearchClient]);\n return searchClient;\n}","export var version = '3.0.0';","import React from 'react';\nexport function useTouchEvents(_ref) {\n var getEnvironmentProps = _ref.getEnvironmentProps,\n panelElement = _ref.panelElement,\n formElement = _ref.formElement,\n inputElement = _ref.inputElement;\n React.useEffect(function () {\n if (!(panelElement && formElement && inputElement)) {\n return undefined;\n }\n\n var _getEnvironmentProps = getEnvironmentProps({\n panelElement: panelElement,\n formElement: formElement,\n inputElement: inputElement\n }),\n onTouchStart = _getEnvironmentProps.onTouchStart,\n onTouchMove = _getEnvironmentProps.onTouchMove;\n\n window.addEventListener('touchstart', onTouchStart);\n window.addEventListener('touchmove', onTouchMove);\n return function () {\n window.removeEventListener('touchstart', onTouchStart);\n window.removeEventListener('touchmove', onTouchMove);\n };\n }, [getEnvironmentProps, panelElement, formElement, inputElement]);\n}","import React from 'react';\nexport function useTrapFocus(_ref) {\n var container = _ref.container;\n React.useEffect(function () {\n if (!container) {\n return undefined;\n }\n\n var focusableElements = container.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), input:not([disabled])');\n var firstElement = focusableElements[0];\n var lastElement = focusableElements[focusableElements.length - 1];\n\n function trapFocus(event) {\n if (event.key !== 'Tab') {\n return;\n }\n\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n\n container.addEventListener('keydown', trapFocus);\n return function () {\n container.removeEventListener('keydown', trapFocus);\n };\n }, [container]);\n}","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport React from 'react';\nimport { createPortal } from 'react-dom';\nimport { DocSearchButton } from './DocSearchButton';\nimport { DocSearchModal } from './DocSearchModal';\nimport { useDocSearchKeyboardEvents } from './useDocSearchKeyboardEvents';\nexport function DocSearch(props) {\n var _props$translations, _props$translations2;\n\n var searchButtonRef = React.useRef(null);\n\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n isOpen = _React$useState2[0],\n setIsOpen = _React$useState2[1];\n\n var _React$useState3 = React.useState((props === null || props === void 0 ? void 0 : props.initialQuery) || undefined),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n initialQuery = _React$useState4[0],\n setInitialQuery = _React$useState4[1];\n\n var onOpen = React.useCallback(function () {\n setIsOpen(true);\n }, [setIsOpen]);\n var onClose = React.useCallback(function () {\n setIsOpen(false);\n }, [setIsOpen]);\n var onInput = React.useCallback(function (event) {\n setIsOpen(true);\n setInitialQuery(event.key);\n }, [setIsOpen, setInitialQuery]);\n useDocSearchKeyboardEvents({\n isOpen: isOpen,\n onOpen: onOpen,\n onClose: onClose,\n onInput: onInput,\n searchButtonRef: searchButtonRef\n });\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DocSearchButton, {\n ref: searchButtonRef,\n translations: props === null || props === void 0 ? void 0 : (_props$translations = props.translations) === null || _props$translations === void 0 ? void 0 : _props$translations.button,\n onClick: onOpen\n }), isOpen && createPortal( /*#__PURE__*/React.createElement(DocSearchModal, _extends({}, props, {\n initialScrollY: window.scrollY,\n initialQuery: initialQuery,\n translations: props === null || props === void 0 ? void 0 : (_props$translations2 = props.translations) === null || _props$translations2 === void 0 ? void 0 : _props$translations2.modal,\n onClose: onClose\n })), document.body));\n}","import React from 'react';\n\nfunction isEditingContent(event) {\n var element = event.target;\n var tagName = element.tagName;\n return element.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA';\n}\n\nexport function useDocSearchKeyboardEvents(_ref) {\n var isOpen = _ref.isOpen,\n onOpen = _ref.onOpen,\n onClose = _ref.onClose,\n onInput = _ref.onInput,\n searchButtonRef = _ref.searchButtonRef;\n React.useEffect(function () {\n function onKeyDown(event) {\n function open() {\n // We check that no other DocSearch modal is showing before opening\n // another one.\n if (!document.body.classList.contains('DocSearch--active')) {\n onOpen();\n }\n }\n\n if (event.keyCode === 27 && isOpen || // The `Cmd+K` shortcut both opens and closes the modal.\n event.key === 'k' && (event.metaKey || event.ctrlKey) || // The `/` shortcut opens but doesn't close the modal because it's\n // a character.\n !isEditingContent(event) && event.key === '/' && !isOpen) {\n event.preventDefault();\n\n if (isOpen) {\n onClose();\n } else if (!document.body.classList.contains('DocSearch--active')) {\n open();\n }\n }\n\n if (searchButtonRef && searchButtonRef.current === document.activeElement && onInput) {\n if (/[a-zA-Z0-9]/.test(String.fromCharCode(event.keyCode))) {\n onInput(event);\n }\n }\n }\n\n window.addEventListener('keydown', onKeyDown);\n return function () {\n window.removeEventListener('keydown', onKeyDown);\n };\n }, [isOpen, onOpen, onClose, onInput, searchButtonRef]);\n}","import type { DocSearchProps as DocSearchComponentProps } from '@docsearch/react';\nimport { DocSearch, version } from '@docsearch/react';\nimport React, { render } from 'preact/compat';\n\nfunction getHTMLElement(\n value: HTMLElement | string,\n environment: DocSearchProps['environment'] = window\n): HTMLElement {\n if (typeof value === 'string') {\n return environment.document.querySelector(value)!;\n }\n\n return value;\n}\n\ninterface DocSearchProps extends DocSearchComponentProps {\n container: HTMLElement | string;\n environment?: typeof window;\n}\n\nexport function docsearch(props: DocSearchProps) {\n render(\n {\n searchClient.addAlgoliaAgent('docsearch.js', version);\n\n return props.transformSearchClient\n ? props.transformSearchClient(searchClient)\n : searchClient;\n }}\n />,\n getHTMLElement(props.container, props.environment)\n );\n}\n"],"names":["EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","currentIndex","currentComponent","prevRaf","currentHook","afterPaintEffects","oldBeforeDiff","options","oldBeforeRender","oldAfterDiff","diffed","oldCommit","oldBeforeUnmount","unmount","getHookState","index","type","hooks","__","__h","length","push","useReducer","reducer","initialState","init","hookState","_reducer","invokeOrReturn","n","nextValue","action","setState","useLayoutEffect","callback","args","state","argsChanged","useMemo","factory","flushAfterPaintEffects","forEach","t","component","invokeCleanup","invokeEffect","e","vnode","c","requestAnimationFrame","raf","done","clearTimeout","timeout","HAS_RAF","cancelAnimationFrame","setTimeout","commitQueue","some","filter","cb","hook","comp","oldArgs","newArgs","arg","f","assign","obj","props","i","shallowDiffers","a","b","initialValue","current","ref","createHandle","concat","context","provider","sub","value","formatter","useDebugValue","ControlKeyIcon","React","createElement","width","height","className","d","strokeWidth","stroke","fill","strokeLinecap","SearchIcon","viewBox","fillRule","strokeLinejoin","_excluded","_extends","Object","target","arguments","source","key","prototype","hasOwnProperty","call","apply","this","_objectWithoutProperties","excluded","sourceKeys","keys","indexOf","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","DocSearchButton","forwardRef","_ref","_ref$translations","translations","_translations$buttonT","buttonText","_translations$buttonA","buttonAriaLabel","navigator","test","platform","Fragment","_slicedToArray","arr","Array","isArray","_arrayWithHoles","_i","Symbol","iterator","_s","_e","_arr","_n","_d","next","err","_iterableToArrayLimit","o","minLen","_arrayLikeToArray","toString","slice","constructor","name","from","_unsupportedIterableToArray","TypeError","_nonIterableRest","len","arr2","_typeof","decycle","seen","undefined","Set","process","env","NODE_ENV","has","newSeen","add","map","x","fromEntries","entries","_ref2","flatten","values","reduce","autocompleteId","getItemsCount","collections","sum","collection","items","invariant","condition","message","Error","noop","userAgents","segment","version","warnCache","checkOptions","sanitizedMessage","trim","console","warn","debug","createInternalCancelablePromise","promise","then","onfulfilled","onrejected","createCallback","catch","finally","onfinally","onCancelList","cancel","isCanceled","callbacks","cancelable","onResult","fallback","getNextActiveItemId","moveAmount","baseIndex","itemCount","defaultActiveItemId","numericIndex","ownKeys","object","enumerableOnly","symbols","sym","getOwnPropertyDescriptor","enumerable","_defineProperty","defineProperty","configurable","writable","getNormalizedSources","getSources","params","seenSourceIds","Promise","resolve","sources","JSON","stringify","all","maybeSource","Boolean","sourceId","includes","normalizedSource","getOwnPropertyDescriptors","defineProperties","_objectSpread","getItemInputValue","query","getItemUrl","onSelect","setIsOpen","onActive","getActiveItem","collectionIndex","acc","collectionsCount","activeItemId","getCollectionFromActiveItemId","item","isOffsetFound","counter","previousItemsOffset","currentCollection","getRelativeActiveItemId","itemInputValue","itemUrl","createStore","onStoreStateChange","list","getState","dispatch","payload","prevState","pendingRequests","cancelablePromise","cancelAll","isEmpty","_toConsumableArray","_arrayWithoutHoles","iter","_iterableToArray","_nonIterableSpread","isDescription","execute","preResolve","itemsOrDescription","description","requests","queries","transformResponse","searchClient","container","find","_container$items","request","maybeDescription","responses","postResolve","matches","response","results","transform","rawResults","result","_hits","hits","hit","__autocomplete_indexName","__autocomplete_queryID","queryID","facetHits","_facetHits","facetHit","label","count","_highlightResult","highlighted","mapToAlgoliaResponse","every","basePromiseId","latestResolvedId","latestResolvedValue","lastStalledId","runConcurrentSafePromise","currentPromiseId","onInput","event","_ref$nextState","nextState","refresh","store","setters","environment","setCollections","setQuery","setActiveItemId","setStatus","openOnFocus","_nextState$isOpen","isOpen","shouldPanelOpen","_request","stallThreshold","getItems","sourcesBySourceId","reshape","_nextState$isOpen2","isPanelOpen","highlightedItem","_excluded2","_excluded3","_excluded4","_excluded5","getPropGetters","getEnvironmentProps","providedProps","inputElement","formElement","panelElement","onTouchStart","contextNode","parent","child","contains","onTouchMove","document","activeElement","blur","getRootProps","rest","role","id","getFormProps","noValidate","onSubmit","_providedProps$inputE","preventDefault","onReset","_providedProps$inputE2","focus","getLabelProps","htmlFor","getInputProps","onFocus","completion","isTouchDevice","_ref2$maxLength","maxLength","activeItem","autoComplete","autoCorrect","autoCapitalize","enterKeyHint","spellCheck","autoFocus","placeholder","onChange","currentTarget","onKeyDown","triggerScrollIntoView","nodeItem","getElementById","scrollIntoViewIfNeeded","scrollIntoView","triggerOnActive","nextActiveItemId","metaKey","ctrlKey","navigateNewTab","shiftKey","navigateNewWindow","altKey","navigate","_onKeyDown","onBlur","onClick","getPanelProps","onMouseDown","onMouseLeave","getListProps","getItemProps","__autocomplete_id","onMouseMove","_item","_source","getMetadata","_","_options$__autocomple","_options$__autocomple2","_options$__autocomple3","plugins","optionsKey","__autocomplete_metadata","extraOptions","plugin","__autocomplete_pluginOptions","ua","getCompletion","_getActiveItem","stateReducer","status","_nextState","createAutocomplete","subscribers","pluginSubscribers","_props$id","window","onStateChange","_props$onStateChange","_x$onStateChange","_props$onSubmit","_x$onSubmit","_props$onReset","_x$onReset","nested","_x$onSelect","_x$onActive","_ref3","location","_ref4","windowReference","open","_ref5","getDefaultProps","rawValue","baseItemId","setContext","getAutocompleteSetters","propGetters","Event","_plugin$subscribe","subscribe","fn","_environment$navigato","metadata","userAgent","metadataContainer","headRef","querySelector","content","appendChild","injectMetadata","AlgoliaLogo","_translations$searchB","searchByText","href","hostname","rel","CommandIcon","ariaLabel","children","Footer","_translations$selectT","selectText","_translations$selectK","selectKeyAriaLabel","_translations$navigat","navigateText","_translations$navigat2","navigateUpKeyAriaLabel","_translations$navigat3","navigateDownKeyAriaLabel","_translations$closeTe","closeText","_translations$closeKe","closeKeyAriaLabel","Hit","url","LoadingIcon","strokeOpacity","cx","cy","r","attributeName","to","dur","repeatCount","RecentIcon","ResetIcon","SelectIcon","LvlIcon","SourceIcon","ContentIcon","AnchorIcon","StarIcon","ErrorIcon","NoResultsIcon","ErrorScreen","_translations$titleTe","titleText","_translations$helpTex","helpText","NoResultsScreen","_translations$noResul","noResultsText","_translations$suggest","suggestedQueryText","_translations$reportM","reportMissingResultsText","_translations$reportM2","reportMissingResultsLinkText","searchSuggestions","search","toLowerCase","inputRef","getMissingResultsUrl","getPropertyByPath","path","split","prev","Snippet","attribute","_ref$tagName","tagName","dangerouslySetInnerHTML","__html","Results","title","Result","objectID","join","renderIcon","renderAction","onItemClick","hitComponent","_React$useState2","useState","isDeleting","setIsDeleting","_React$useState4","isFavoriting","setIsFavoriting","useRef","__docsearch_parent","onTransitionEnd","hierarchy","runDeleteTransition","runFavoriteTransition","groupBy","predicate","identity","regexHighlightTags","regexHasHighlightTags","RegExp","removeHighlightTags","_internalDocSearchHit","_internalDocSearchHit2","_internalDocSearchHit3","_hit$_highlightResult","_hit$_highlightResult2","internalDocSearchHit","lvl0","replace","ResultsScreen","_collection$items","resultsFooterComponent","StartScreen","_translations$recentS","recentSearchesTitle","_translations$noRecen","noRecentSearchesText","_translations$saveRec","saveRecentSearchButtonTitle","_translations$removeR","removeRecentSearchButtonTitle","_translations$favorit","favoriteSearchesTitle","_translations$removeF","removeFavoriteSearchButtonTitle","hasCollections","disableUserPersonalization","stopPropagation","favoriteSearches","recentSearches","remove","ScreenState","memo","errorScreen","noResultsScreen","startScreen","_prevProps","nextProps","SearchBox","_translations$resetBu","resetButtonTitle","_translations$resetBu2","resetButtonAriaLabel","_translations$cancelB","cancelButtonText","_translations$cancelB2","cancelButtonAriaLabel","useEffect","isFromSelection","select","hidden","onClose","createStorage","localStorage","setItem","removeItem","error","isLocalStorageSupported","getItem","parse","createStoredSearches","_ref$limit","limit","storage","_snippetResult","isQueryAlreadySaved","findIndex","splice","unshift","getAll","createBrowserLocalStorageCache","namespaceKey","getStorage","getNamespace","get","defaultValue","events","miss","keyAsString","exists","set","namespace","delete","clear","createFallbackableCache","caches","shift","_key","createInMemoryCache","serializable","cache","shuffle","array","Math","floor","random","addMethods","base","methods","encode","format","encodeURIComponent","AuthMode","WithinQueryParameters","WithinHeaders","createMappedRequestOptions","requestOptions","data","headers","queryParameters","cacheable","CallEnum","Read","Write","Any","HostStatusEnum","createStatefulHost","host","lastUpdate","Date","now","createStatelessHost","protocol","accept","MethodEnum","createRetryableOptions","hostsCache","statelessHosts","statelessHost","statefulHosts","hostsUp","isStatefulHostUp","hostsTimeouted","isStatefulHostTimeouted","hostsAvailable","getTimeout","timeoutsCount","baseTimeout","retryableRequest","transporter","stackTrace","method","serializeData","serializedHeaders","header","serializeHeaders","dataQueryParameters","retry","hosts","pop","transporterStackTrace","stackTraceWithoutCredentials","serializeUrl","connectTimeout","timeouts","connect","responseTimeout","pushToStackTrace","stackFrame","triesLeft","decisions","onSucess","createDeserializationError","deserializeSuccess","onRetry","isTimedOut","logger","info","stackFrameWithoutCredentials","onFail","createApiError","deserializeFailure","requester","send","outcomes","isNetworkError","isRetryable","retryDecision","reverse","createUserAgent","addedUserAgent","queryParametersAsString","serializeQueryParameters","charAt","substr","parameters","modifiedHeaders","createSearchClient","appId","auth","authMode","apiKey","credentials","createAuth","requestsCache","responsesCache","read","mappedRequestOptions","createRetryableRequest","reject","write","createTransporter","addAlgoliaAgent","clearCache","initIndex","indexName","searchIndex","multipleQueries","multipleSearchForFacetValues","facetName","facetQuery","searchForFacetValues","findAnswers","queryLanguages","LogLevelEnum","algoliasearch","logLevel","commonOptions","baseRequester","XMLHttpRequest","setRequestHeader","createTimeout","abort","onreadystatechange","readyState","OPENED","onerror","responseText","onload","DocSearchModal","_ref$placeholder","searchParameters","_ref$onClose","_ref$transformItems","transformItems","_ref$hitComponent","_ref$resultsFooterCom","_ref$initialScrollY","initialScrollY","_ref$transformSearchC","transformSearchClient","_ref$disableUserPerso","_ref$initialQuery","initialQuery","initialQueryFromProp","footerTranslations","footer","searchBoxTranslations","searchBox","screenStateTranslations","containerRef","modalRef","formElementRef","dropdownRef","snippetLength","initialQueryFromSelection","getSelection","client","useSearchClient","saveRecentSearch","useCallback","autocomplete","sourcesState","attributesToRetrieve","attributesToSnippet","snippetEllipsisText","highlightPreTag","highlightPostTag","hitsPerPage","_ref7","_results$","nbHits","_ref8","_ref9","lvl1","groupedHits","siblingItem","flat","_ref6","_getEnvironmentProps","addEventListener","removeEventListener","useTouchEvents","focusableElements","querySelectorAll","firstElement","lastElement","trapFocus","useTrapFocus","body","classList","_window$scrollTo","_window","scrollTo","matchMedia","scrollTop","setFullViewportHeight","vh","innerHeight","style","setProperty","tabIndex","DocSearch","_props$translations","_props$translations2","searchButtonRef","setInitialQuery","onOpen","keyCode","element","isContentEditable","isEditingContent","String","fromCharCode","useDocSearchKeyboardEvents","button","createPortal","scrollY","modal","docsearch","render","getHTMLElement"],"mappings":";gyFAAaA,EAAY,GACZC,EAAY,GACZC,EAAqB,6+RCClC,IAAIC,EAGAC,EAsBAC,EAZAC,EAAc,EAGdC,EAAoB,GAEpBC,EAAgBC,EAAAA,IAChBC,EAAkBD,EAAAA,IAClBE,EAAeF,EAAQG,OACvBC,EAAYJ,EAAAA,IACZK,GAAmBL,EAAQM,QAwE/B,SAASC,GAAaC,EAAOC,GACxBT,EAAAA,KACHA,EAAAA,IAAcL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,EAAStT,EAASojB,IDJtCS,CAA2B,CACzB/iB,OAAQA,EACRwiB,OAAQA,EACRhQ,QAASA,EACTtT,QARYvP,GAAM8vB,aAAY,SAAUtgB,GACxC5E,GAAU,GACVgoB,EAAgBpjB,EAAMpO,OACrB,CAACwJ,EAAWgoB,IAMbD,gBAAiBA,IAEC3yB,GAAMC,cAAcD,GAAM+C,SAAU,KAAmB/C,GAAMC,cAAckC,GAAiB,CAC9G7C,IAAKqzB,EACLpwB,aAAcxD,MAAAA,GAA6F,QAA9C0zB,EAAsB1zB,EAAMwD,oBAAkD,IAAxBkwB,OAAhE,EAA0GA,EAAoBY,OACjLpe,QAAS4d,IACPxiB,GAAUijB,GAA2BtzB,GAAMC,cAAc8tB,GAAgBhtB,GAAS,GAAIhC,EAAO,CAC/FyvB,eAAgBxX,OAAOuc,QACvB1E,aAAcA,EACdtsB,aAAcxD,MAAAA,GAA8F,QAA/C2zB,EAAuB3zB,EAAMwD,oBAAmD,IAAzBmwB,OAAjE,EAA4GA,EAAqBc,MACpL3Q,QAASA,KACN9Q,SAAS4f,OExCT,SAAS8B,GAAU10B,GACxB20B,GACE1zB,iBAACwyB,QACKzzB,GACJ2vB,sBAAuB,SAACthB,UACtBA,EAAagf,gBAAgB,eLzBhB,SK2BNrtB,EAAM2vB,sBACT3vB,EAAM2vB,sBAAsBthB,GAC5BA,MAzBZ,SACExN,OACAkQ,yDAA6CkH,aAExB,iBAAVpX,EACFkQ,EAAYiC,SAASiH,cAA2BpZ,GAGlDA,EAoBL+zB,CAAe50B,EAAMsO,UAAWtO,EAAM+Q"} \ No newline at end of file diff --git a/node_modules/@docsearch/js/dist/umd/index.js b/node_modules/@docsearch/js/dist/umd/index.js new file mode 100644 index 0000000000..b6469a9148 --- /dev/null +++ b/node_modules/@docsearch/js/dist/umd/index.js @@ -0,0 +1,3 @@ +/*! @docsearch/js 3.0.0 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).docsearch=t()}(this,(function(){"use strict";function e(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 t(t){for(var n=1;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,c=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return c}(e,t)||u(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n3)for(n=[n],c=3;c0?O(m.type,m.props,m.key,null,m.__v):m)){if(m.__=n,m.__b=n.__b+1,null===(p=b[s])||p&&m.key==p.key&&m.type===p.type)b[s]=void 0;else for(f=0;f3)for(n=[n],c=3;c=n.__.length&&n.__.push({}),n.__[e]}function ne(e,t,n){var r=te(W++,2);return r.t=e,r.__c||(r.__=[n?n(t):se(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}],r.__c=K),r.__}function re(e,t){var n=te(W++,4);!s.__s&&le(n.__H,t)&&(n.__=e,n.__H=t,K.__h.push(n))}function oe(e,t){var n=te(W++,7);return le(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ce(){Q.forEach((function(e){if(e.__P)try{e.__H.__h.forEach(ae),e.__H.__h.forEach(ue),e.__H.__h=[]}catch(t){e.__H.__h=[],s.__e(t,e.__v)}})),Q=[]}s.__b=function(e){K=null,Y&&Y(e)},s.__r=function(e){G&&G(e),W=0;var t=(K=e.__c).__H;t&&(t.__h.forEach(ae),t.__h.forEach(ue),t.__h=[])},s.diffed=function(e){Z&&Z(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==Q.push(t)&&J===s.requestAnimationFrame||((J=s.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),ie&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);ie&&(t=requestAnimationFrame(n))})(ce)),K=void 0},s.__c=function(e,t){t.some((function(e){try{e.__h.forEach(ae),e.__h=e.__h.filter((function(e){return!e.__||ue(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],s.__e(n,e.__v)}})),X&&X(e,t)},s.unmount=function(e){ee&&ee(e);var t=e.__c;if(t&&t.__H)try{t.__H.__.forEach(ae)}catch(e){s.__e(e,t.__v)}};var ie="function"==typeof requestAnimationFrame;function ae(e){var t=K;"function"==typeof e.__c&&e.__c(),K=t}function ue(e){var t=K;e.__c=e.__(),K=t}function le(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function se(e,t){return"function"==typeof t?t(e):t}function fe(e,t){for(var n in t)e[n]=t[n];return e}function pe(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function me(e){this.props=e}(me.prototype=new E).isPureReactComponent=!0,me.prototype.shouldComponentUpdate=function(e,t){return pe(this.props,e)||pe(this.state,t)};var de=s.__b;s.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),de&&de(e)};var he="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var ve=function(e,t){return null==e?null:C(C(e).map(t))},ye={map:ve,forEach:ve,count:function(e){return e?C(e).length:0},only:function(e){var t=C(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:C},_e=s.__e;function be(){this.__u=0,this.t=null,this.__b=null}function ge(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function Oe(){this.u=null,this.o=null}s.__e=function(e,t,n){if(e.then)for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);_e(e,t,n)},(be.prototype=new E).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=ge(r.__v),c=!1,i=function(){c||(c=!0,n.componentWillUnmount=n.__c,o?o(a):a())};n.__c=n.componentWillUnmount,n.componentWillUnmount=function(){i(),n.__c&&n.__c()};var a=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},u=!0===t.__h;r.__u++||u||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(i,i)},be.prototype.componentWillUnmount=function(){this.t=[]},be.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=fe({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__e&&g(S,null,e.fallback);return o&&(o.__h=null),[g(S,null,t.__e?null:e.children),o]};var Se=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(e)}}),B(g(Ee,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function je(e,t){return g(we,{__v:e,i:t})}(Oe.prototype=new E).__e=function(e){var t=this,n=ge(t.__v),r=t.o.get(e);return r[0]++,function(o){var c=function(){t.props.revealOrder?(r.push(o),Se(t,e,r)):o()};n?n(c):c()}},Oe.prototype.render=function(e){this.u=null,this.o=new Map;var t=C(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Oe.prototype.componentDidUpdate=Oe.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){Se(e,n,t)}))};var Pe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Ie=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,ke=function(e){return("undefined"!=typeof Symbol&&"symbol"==n(Symbol())?/fil|che|rad/i:/fil|che|ra/i).test(e)};function De(e,t,n){return null==t.__k&&(t.textContent=""),B(e,t),"function"==typeof n&&n(),e?e.__c:null}E.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(E.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Ce=s.event;function Ae(){}function xe(){return this.cancelBubble}function Ne(){return this.defaultPrevented}s.event=function(e){return Ce&&(e=Ce(e)),e.persist=Ae,e.isPropagationStopped=xe,e.isDefaultPrevented=Ne,e.nativeEvent=e};var Re,Te={configurable:!0,get:function(){return this.class}},Le=s.vnode;s.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){for(var o in r={},n){var c=n[o];"value"===o&&"defaultValue"in n&&null==c||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===c?c="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!ke(n.type)?o="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():Ie.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===c&&(c=void 0),r[o]=c)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=C(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=C(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r}t&&n.class!=n.className&&(Te.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",Te)),e.$$typeof=Pe,Le&&Le(e)};var qe=s.__r;s.__r=function(e){qe&&qe(e),Re=e.__c};var Me={ReactCurrentDispatcher:{current:{readContext:function(e){return Re.__n[e.__c].props.value}}}};"object"==("undefined"==typeof performance?"undefined":n(performance))&&"function"==typeof performance.now&&performance.now.bind(performance);function He(e){return!!e&&e.$$typeof===Pe}var Ue={useState:function(e){return $=1,ne(se,e)},useReducer:ne,useEffect:function(e,t){var n=te(W++,3);!s.__s&&le(n.__H,t)&&(n.__=e,n.__H=t,K.__H.__h.push(n))},useLayoutEffect:re,useRef:function(e){return $=5,oe((function(){return{current:e}}),[])},useImperativeHandle:function(e,t,n){$=6,re((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))},useMemo:oe,useCallback:function(e,t){return $=8,oe((function(){return e}),t)},useContext:function(e){var t=K.context[e.__c],n=te(W++,9);return n.__c=e,t?(null==n.__&&(n.__=!0,t.sub(K)),t.props.value):e.__},useDebugValue:function(e,t){s.useDebugValue&&s.useDebugValue(t?t(e):e)},version:"16.8.0",Children:ye,render:De,hydrate:function(e,t,n){return V(e,t),"function"==typeof n&&n(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(B(null,e),!0)},createPortal:je,createElement:g,createContext:function(e,t){var n={__c:t="__cC"+d++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(P)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},createFactory:function(e){return g.bind(null,e)},cloneElement:function(e){return He(e)?z.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:S,isValidElement:He,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:E,PureComponent:me,memo:function(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:pe(this.props,e)}function r(t){return this.shouldComponentUpdate=n,g(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r},forwardRef:function(e){function t(t,r){var o=fe({},t);return delete o.ref,e(o,(r=t.ref||r)&&("object"!=n(r)||"current"in r)?r:null)}return t.$$typeof=he,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:S,Suspense:be,SuspenseList:Oe,lazy:function(e){var t,n,r;function o(o){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return g(n,o)}return o.displayName="Lazy",o.__f=!0,o},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Me};function Fe(){return Ue.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},Ue.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"}))}function Be(){return Ue.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20"},Ue.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"}))}var Ve=["translations"];function ze(){return ze=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Ke="Ctrl";var Je=Ue.forwardRef((function(e,t){var n=e.translations,r=void 0===n?{}:n,o=We(e,Ve),c=r.buttonText,i=void 0===c?"Search":c,a=r.buttonAriaLabel,u=void 0===a?"Search":a,l=oe((function(){return"undefined"!=typeof navigator?/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?"⌘":Ke:null}),[]);return Ue.createElement("button",ze({type:"button",className:"DocSearch DocSearch-Button","aria-label":u},o,{ref:t}),Ue.createElement("span",{className:"DocSearch-Button-Container"},Ue.createElement(Be,null),Ue.createElement("span",{className:"DocSearch-Button-Placeholder"},i)),Ue.createElement("span",{className:"DocSearch-Button-Keys"},null!==l&&Ue.createElement(Ue.Fragment,null,Ue.createElement("span",{className:"DocSearch-Button-Key"},l===Ke?Ue.createElement(Fe,null):l),Ue.createElement("span",{className:"DocSearch-Button-Key"},"K"))))}));function $e(e){return e.reduce((function(e,t){return e.concat(t)}),[])}var Qe=0;function Ye(e){return 0===e.collections.length?0:e.collections.reduce((function(e,t){return e+t.items.length}),0)}var Ge=function(){},Ze=[{segment:"autocomplete-core",version:"1.5.2"}];function Xe(e,t){var n=t;return{then:function(t,r){return Xe(e.then(tt(t,n,e),tt(r,n,e)),n)},catch:function(t){return Xe(e.catch(tt(t,n,e)),n)},finally:function(t){return t&&n.onCancelList.push(t),Xe(e.finally(tt(t&&function(){return n.onCancelList=[],t()},n,e)),n)},cancel:function(){n.isCanceled=!0;var e=n.onCancelList;n.onCancelList=[],e.forEach((function(e){e()}))},isCanceled:function(){return!0===n.isCanceled}}}function et(e){return Xe(e,{isCanceled:!1,onCancelList:[]})}function tt(e,t,n){return e?function(n){return t.isCanceled?n:e(n)}:n}function nt(e,t,n,r){if(!n)return null;if(e<0&&(null===t||null!==r&&0===t))return n+e;var o=(null===t?-1:t)+e;return o<=-1||o>=n?null===r?null:0:o}function rt(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 ot(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ct(e,t){var n=[];return Promise.resolve(e(t)).then((function(e){return Promise.all(e.filter((function(e){return Boolean(e)})).map((function(e){if(e.sourceId,n.includes(e.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(e.sourceId)," is not unique."));n.push(e.sourceId);var t=function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Mt,Ht,Ut,Ft=null,Bt=(Mt=-1,Ht=-1,Ut=void 0,function(e){var t=++Mt;return Promise.resolve(e).then((function(e){return Ut&&t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Qt=["props","refresh","store"],Yt=["inputElement","formElement","panelElement"],Gt=["inputElement"],Zt=["inputElement","maxLength"],Xt=["item","source"];function en(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 tn(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function on(e){var t=e.props,n=e.refresh,r=e.store,o=rn(e,Qt);return{getEnvironmentProps:function(e){var n=e.inputElement,o=e.formElement,c=e.panelElement;return tn({onTouchStart:function(e){!r.getState().isOpen&&r.pendingRequests.isEmpty()||e.target===n||!1===[o,c].some((function(t){return n=t,r=e.target,n===r||n.contains(r);var n,r}))&&(r.dispatch("blur",null),t.debug||r.pendingRequests.cancelAll())},onTouchMove:function(e){!1!==r.getState().isOpen&&n===t.environment.document.activeElement&&e.target!==n&&n.blur()}},rn(e,Yt))},getRootProps:function(e){return tn({role:"combobox","aria-expanded":r.getState().isOpen,"aria-haspopup":"listbox","aria-owns":r.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label")},e)},getFormProps:function(e){e.inputElement;return tn({action:"",noValidate:!0,role:"search",onSubmit:function(c){var i;c.preventDefault(),t.onSubmit(tn({event:c,refresh:n,state:r.getState()},o)),r.dispatch("submit",null),null===(i=e.inputElement)||void 0===i||i.blur()},onReset:function(c){var i;c.preventDefault(),t.onReset(tn({event:c,refresh:n,state:r.getState()},o)),r.dispatch("reset",null),null===(i=e.inputElement)||void 0===i||i.focus()}},rn(e,Gt))},getLabelProps:function(e){return tn({htmlFor:"".concat(t.id,"-input"),id:"".concat(t.id,"-label")},e)},getInputProps:function(e){function c(e){(t.openOnFocus||Boolean(r.getState().query))&&Vt(tn({event:e,props:t,query:r.getState().completion||r.getState().query,refresh:n,store:r},o)),r.dispatch("focus",null)}var i="ontouchstart"in t.environment,a=e||{},u=(a.inputElement,a.maxLength),l=void 0===u?512:u,s=rn(a,Zt),f=it(r.getState());return tn({"aria-autocomplete":"both","aria-activedescendant":r.getState().isOpen&&null!==r.getState().activeItemId?"".concat(t.id,"-item-").concat(r.getState().activeItemId):void 0,"aria-controls":r.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label"),value:r.getState().completion||r.getState().query,id:"".concat(t.id,"-input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:null!=f&&f.itemUrl?"go":"search",spellCheck:"false",autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:l,type:"search",onChange:function(e){Vt(tn({event:e,props:t,query:e.currentTarget.value.slice(0,l),refresh:n,store:r},o))},onKeyDown:function(e){!function(e){var t=e.event,n=e.props,r=e.refresh,o=e.store,c=$t(e,zt);if("ArrowUp"===t.key||"ArrowDown"===t.key){var i=function(){var e=n.environment.document.getElementById("".concat(n.id,"-item-").concat(o.getState().activeItemId));e&&(e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded(!1):e.scrollIntoView(!1))},a=function(){var e=it(o.getState());if(null!==o.getState().activeItemId&&e){var n=e.item,i=e.itemInputValue,a=e.itemUrl,u=e.source;u.onActive(Kt({event:t,item:n,itemInputValue:i,itemUrl:a,refresh:r,source:u,state:o.getState()},c))}};t.preventDefault(),!1===o.getState().isOpen&&(n.openOnFocus||Boolean(o.getState().query))?Vt(Kt({event:t,props:n,query:o.getState().query,refresh:r,store:o},c)).then((function(){o.dispatch(t.key,{nextActiveItemId:n.defaultActiveItemId}),a(),setTimeout(i,0)})):(o.dispatch(t.key,{}),a(),i())}else if("Escape"===t.key)t.preventDefault(),o.dispatch(t.key,null),o.pendingRequests.cancelAll();else if("Enter"===t.key){if(null===o.getState().activeItemId||o.getState().collections.every((function(e){return 0===e.items.length})))return;t.preventDefault();var u=it(o.getState()),l=u.item,s=u.itemInputValue,f=u.itemUrl,p=u.source;if(t.metaKey||t.ctrlKey)void 0!==f&&(p.onSelect(Kt({event:t,item:l,itemInputValue:s,itemUrl:f,refresh:r,source:p,state:o.getState()},c)),n.navigator.navigateNewTab({itemUrl:f,item:l,state:o.getState()}));else if(t.shiftKey)void 0!==f&&(p.onSelect(Kt({event:t,item:l,itemInputValue:s,itemUrl:f,refresh:r,source:p,state:o.getState()},c)),n.navigator.navigateNewWindow({itemUrl:f,item:l,state:o.getState()}));else if(t.altKey);else{if(void 0!==f)return p.onSelect(Kt({event:t,item:l,itemInputValue:s,itemUrl:f,refresh:r,source:p,state:o.getState()},c)),void n.navigator.navigate({itemUrl:f,item:l,state:o.getState()});Vt(Kt({event:t,nextState:{isOpen:!1},props:n,query:s,refresh:r,store:o},c)).then((function(){p.onSelect(Kt({event:t,item:l,itemInputValue:s,itemUrl:f,refresh:r,source:p,state:o.getState()},c))}))}}}(tn({event:e,props:t,refresh:n,store:r},o))},onFocus:c,onBlur:function(){i||(r.dispatch("blur",null),t.debug||r.pendingRequests.cancelAll())},onClick:function(n){e.inputElement!==t.environment.document.activeElement||r.getState().isOpen||c(n)}},s)},getPanelProps:function(e){return tn({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){r.dispatch("mouseleave",null)}},e)},getListProps:function(e){return tn({role:"listbox","aria-labelledby":"".concat(t.id,"-label"),id:"".concat(t.id,"-list")},e)},getItemProps:function(e){var c=e.item,i=e.source,a=rn(e,Xt);return tn({id:"".concat(t.id,"-item-").concat(c.__autocomplete_id),role:"option","aria-selected":r.getState().activeItemId===c.__autocomplete_id,onMouseMove:function(e){if(c.__autocomplete_id!==r.getState().activeItemId){r.dispatch("mousemove",c.__autocomplete_id);var t=it(r.getState());if(null!==r.getState().activeItemId&&t){var i=t.item,a=t.itemInputValue,u=t.itemUrl,l=t.source;l.onActive(tn({event:e,item:i,itemInputValue:a,itemUrl:u,refresh:n,source:l,state:r.getState()},o))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var a=i.getItemInputValue({item:c,state:r.getState()}),u=i.getItemUrl({item:c,state:r.getState()});(u?Promise.resolve():Vt(tn({event:e,nextState:{isOpen:!1},props:t,query:a,refresh:n,store:r},o))).then((function(){i.onSelect(tn({event:e,item:c,itemInputValue:a,itemUrl:u,refresh:n,source:i,state:r.getState()},o))}))}},a)}}}function cn(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 an(e){for(var t=1;t0},reshape:function(e){return e.sources}},e),{},{id:null!==(n=e.id)&&void 0!==n?n:"autocomplete-".concat(Qe++),plugins:o,initialState:bt({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var n;null===(n=e.onStateChange)||void 0===n||n.call(e,t),o.forEach((function(e){var n;return null===(n=e.onStateChange)||void 0===n?void 0:n.call(e,t)}))},onSubmit:function(t){var n;null===(n=e.onSubmit)||void 0===n||n.call(e,t),o.forEach((function(e){var n;return null===(n=e.onSubmit)||void 0===n?void 0:n.call(e,t)}))},onReset:function(t){var n;null===(n=e.onReset)||void 0===n||n.call(e,t),o.forEach((function(e){var n;return null===(n=e.onReset)||void 0===n?void 0:n.call(e,t)}))},getSources:function(n){return Promise.all([].concat(vt(o.map((function(e){return e.getSources}))),[e.getSources]).filter(Boolean).map((function(e){return ct(e,n)}))).then((function(e){return $e(e)})).then((function(e){return e.map((function(e){return bt(bt({},e),{},{onSelect:function(n){e.onSelect(n),t.forEach((function(e){var t;return null===(t=e.onSelect)||void 0===t?void 0:t.call(e,n)}))},onActive:function(n){e.onActive(n),t.forEach((function(e){var t;return null===(t=e.onActive)||void 0===t?void 0:t.call(e,n)}))}})}))}))},navigator:bt({navigate:function(e){var t=e.itemUrl;r.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl,n=r.open(t,"_blank","noopener");null==n||n.focus()},navigateNewWindow:function(e){var t=e.itemUrl;r.open(t,"_blank","noopener")}},e.navigator)})}(e,t),r=pt(dn,n,(function(e){var t=e.prevState,r=e.state;n.onStateChange(vn({prevState:t,state:r,refresh:i},o))})),o=function(e){var t=e.store;return{setActiveItemId:function(e){t.dispatch("setActiveItemId",e)},setQuery:function(e){t.dispatch("setQuery",e)},setCollections:function(e){var n=0,r=e.map((function(e){return dt(dt({},e),{},{items:$e(e.items).map((function(e){return dt(dt({},e),{},{__autocomplete_id:n++})}))})}));t.dispatch("setCollections",r)},setIsOpen:function(e){t.dispatch("setIsOpen",e)},setStatus:function(e){t.dispatch("setStatus",e)},setContext:function(e){t.dispatch("setContext",e)}}}({store:r}),c=on(vn({props:n,refresh:i,store:r},o));function i(){return Vt(vn({event:new Event("input"),nextState:{isOpen:r.getState().isOpen},props:n,query:r.getState().query,refresh:i,store:r},o))}return n.plugins.forEach((function(e){var n;return null===(n=e.subscribe)||void 0===n?void 0:n.call(e,vn(vn({},o),{},{refresh:i,onSelect:function(e){t.push({onSelect:e})},onActive:function(e){t.push({onActive:e})}}))})),function(e){var t,n=e.metadata,r=e.environment;if(null===(t=r.navigator)||void 0===t?void 0:t.userAgent.includes("Algolia Crawler")){var o=r.document.createElement("meta"),c=r.document.querySelector("head");o.name="algolia:metadata",setTimeout((function(){o.content=JSON.stringify(n),c.appendChild(o)}),0)}}({metadata:ln({plugins:n.plugins,options:e}),environment:n.environment}),vn(vn({refresh:i},c),o)}function bn(e){var t=e.translations,n=(void 0===t?{}:t).searchByText,r=void 0===n?"Search by":n;return Ue.createElement("a",{href:"https://www.algolia.com/ref/docsearch/?utm_source=".concat(window.location.hostname,"&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch"),target:"_blank",rel:"noopener noreferrer"},Ue.createElement("span",{className:"DocSearch-Label"},r),Ue.createElement("svg",{width:"77",height:"19","aria-label":"Algolia",role:"img"},Ue.createElement("path",{d:"M2.5067 0h14.0245c1.384.001 2.5058 1.1205 2.5068 2.5017V16.5c-.0014 1.3808-1.1232 2.4995-2.5068 2.5H2.5067C1.1232 18.9995.0014 17.8808 0 16.5V2.4958A2.495 2.495 0 01.735.7294 2.505 2.505 0 012.5068 0zM37.95 15.0695c-3.7068.0168-3.7068-2.986-3.7068-3.4634L34.2372.3576 36.498 0v11.1794c0 .2715 0 1.9889 1.452 1.994v1.8961zm-9.1666-1.8388c.694 0 1.2086-.0397 1.5678-.1088v-2.2934a5.3639 5.3639 0 00-1.3303-.1679 4.8283 4.8283 0 00-.758.0582 2.2845 2.2845 0 00-.688.2024c-.2029.0979-.371.2362-.4919.4142-.1268.1788-.185.2826-.185.5533 0 .5297.185.8359.5205 1.0375.3355.2016.7928.3053 1.365.3053v-.0008zm-.1969-8.1817c.7463 0 1.3768.092 1.8856.2767.5088.1838.9195.4428 1.2204.7717.3068.334.5147.7777.6423 1.251.1327.4723.196.991.196 1.5603v5.798c-.5235.1036-1.05.192-1.5787.2649-.7048.1037-1.4976.156-2.3774.156-.5832 0-1.1215-.0582-1.6016-.167a3.385 3.385 0 01-1.2432-.5364 2.6034 2.6034 0 01-.8037-.9565c-.191-.3922-.29-.9447-.29-1.5208 0-.5533.11-.905.3246-1.2863a2.7351 2.7351 0 01.8849-.9329c.376-.242.8029-.415 1.2948-.5187a7.4517 7.4517 0 011.5381-.156 7.1162 7.1162 0 011.6667.2024V8.886c0-.259-.0296-.5061-.093-.7372a1.5847 1.5847 0 00-.3245-.6158 1.5079 1.5079 0 00-.6119-.4158 2.6788 2.6788 0 00-.966-.173c-.5206 0-.9948.0634-1.4283.1384a6.5481 6.5481 0 00-1.065.259l-.2712-1.849c.2831-.0986.7048-.1964 1.2491-.2943a9.2979 9.2979 0 011.752-.1501v.0008zm44.6597 8.1193c.6947 0 1.2086-.0405 1.567-.1097v-2.2942a5.3743 5.3743 0 00-1.3303-.1679c-.2485 0-.503.0177-.7573.0582a2.2853 2.2853 0 00-.688.2024 1.2333 1.2333 0 00-.4918.4142c-.1268.1788-.1843.2826-.1843.5533 0 .5297.1843.8359.5198 1.0375.3414.2066.7927.3053 1.365.3053v.0009zm-.191-8.1767c.7463 0 1.3768.0912 1.8856.2759.5087.1847.9195.4436 1.2204.7717.3.329.5147.7786.6414 1.251a5.7248 5.7248 0 01.197 1.562v5.7972c-.3466.0742-.874.1602-1.5788.2648-.7049.1038-1.4976.1552-2.3774.1552-.5832 0-1.1215-.0573-1.6016-.167a3.385 3.385 0 01-1.2432-.5356 2.6034 2.6034 0 01-.8038-.9565c-.191-.3922-.2898-.9447-.2898-1.5216 0-.5533.1098-.905.3245-1.2854a2.7373 2.7373 0 01.8849-.9338c.376-.2412.8029-.4141 1.2947-.5178a7.4545 7.4545 0 012.325-.1097c.2781.0287.5672.081.879.156v-.3686a2.7781 2.7781 0 00-.092-.738 1.5788 1.5788 0 00-.3246-.6166 1.5079 1.5079 0 00-.612-.415 2.6797 2.6797 0 00-.966-.1729c-.5205 0-.9947.0633-1.4282.1384a6.5608 6.5608 0 00-1.065.259l-.2712-1.8498c.283-.0979.7048-.1957 1.2491-.2935a9.8597 9.8597 0 011.752-.1494zm-6.79-1.072c-.7576.001-1.373-.6103-1.3759-1.3664 0-.755.6128-1.3664 1.376-1.3664.764 0 1.3775.6115 1.3775 1.3664s-.6195 1.3664-1.3776 1.3664zm1.1393 11.1507h-2.2726V5.3409l2.2734-.3568v10.0845l-.0008.0017zm-3.984 0c-3.707.0168-3.707-2.986-3.707-3.4642L59.7069.3576 61.9685 0v11.1794c0 .2715 0 1.9889 1.452 1.994V15.0703zm-7.3512-4.979c0-.975-.2138-1.7873-.6305-2.3516-.4167-.571-.9998-.852-1.747-.852-.7454 0-1.3302.281-1.7452.852-.4166.5702-.6195 1.3765-.6195 2.3516 0 .9851.208 1.6473.6254 2.2183.4158.576.9998.8587 1.7461.8587.7454 0 1.3303-.2885 1.747-.8595.4158-.5761.6237-1.2315.6237-2.2184v.0009zm2.3132-.006c0 .7609-.1099 1.3361-.3356 1.9654a4.654 4.654 0 01-.9533 1.6076A4.214 4.214 0 0155.613 14.69c-.579.2412-1.4697.3795-1.9143.3795-.4462-.005-1.3303-.1324-1.9033-.3795a4.307 4.307 0 01-1.474-1.0316c-.4115-.4445-.7293-.9801-.9609-1.6076a5.3423 5.3423 0 01-.3465-1.9653c0-.7608.104-1.493.3356-2.1155a4.683 4.683 0 01.9719-1.5958 4.3383 4.3383 0 011.479-1.0257c.5739-.242 1.2043-.3567 1.8864-.3567.6829 0 1.3125.1197 1.8906.3567a4.1245 4.1245 0 011.4816 1.0257 4.7587 4.7587 0 01.9592 1.5958c.2426.6225.3643 1.3547.3643 2.1155zm-17.0198 0c0 .9448.208 1.9932.6238 2.431.4166.4386.955.6579 1.6142.6579.3584 0 .6998-.0523 1.0176-.1502.3186-.0978.5721-.2134.775-.3517V7.0784a8.8706 8.8706 0 00-1.4926-.1906c-.8206-.0236-1.4452.312-1.8847.8468-.4335.5365-.6533 1.476-.6533 2.3516v-.0008zm6.2863 4.4485c0 1.5385-.3938 2.662-1.1866 3.3773-.791.7136-2.0005 1.0712-3.6308 1.0712-.5958 0-1.834-.1156-2.8228-.334l.3643-1.7865c.8282.173 1.9202.2193 2.4932.2193.9077 0 1.555-.1847 1.943-.5533.388-.3686.578-.916.578-1.643v-.3687a6.8289 6.8289 0 01-.8848.3349c-.3634.1096-.786.167-1.261.167-.6246 0-1.1917-.0979-1.7055-.2944a3.5554 3.5554 0 01-1.3244-.8645c-.3642-.3796-.6541-.8579-.8561-1.4289-.2028-.571-.3068-1.59-.3068-2.339 0-.7034.1099-1.5856.3245-2.1735.2198-.5871.5316-1.0949.9542-1.515.4167-.42.9255-.743 1.5213-.98a5.5923 5.5923 0 012.052-.3855c.7353 0 1.4114.092 2.0707.2024.6592.1088 1.2204.2236 1.6776.35v8.945-.0008zM11.5026 4.2418v-.6511c-.0005-.4553-.3704-.8241-.8266-.8241H8.749c-.4561 0-.826.3688-.8265.824v.669c0 .0742.0693.1264.1445.1096a6.0346 6.0346 0 011.6768-.2362 6.125 6.125 0 011.6202.2185.1116.1116 0 00.1386-.1097zm-5.2806.852l-.3296-.3282a.8266.8266 0 00-1.168 0l-.393.3922a.8199.8199 0 000 1.164l.3237.323c.0524.0515.1268.0397.1733-.0117.191-.259.3989-.507.6305-.7372.2374-.2362.48-.4437.7462-.6335.0575-.0354.0634-.1155.017-.1687zm3.5159 2.069v2.818c0 .081.0879.1392.1622.0987l2.5102-1.2964c.0574-.0287.0752-.0987.0464-.1552a3.1237 3.1237 0 00-2.603-1.574c-.0575 0-.115.0456-.115.1097l-.0008-.0009zm.0008 6.789c-2.0933.0005-3.7915-1.6912-3.7947-3.7804C5.9468 8.0821 7.6452 6.39 9.7387 6.391c2.0932-.0005 3.7911 1.6914 3.794 3.7804a3.7783 3.7783 0 01-1.1124 2.675 3.7936 3.7936 0 01-2.6824 1.1054h.0008zM9.738 4.8002c-1.9218 0-3.6975 1.0232-4.6584 2.6841a5.359 5.359 0 000 5.3683c.9609 1.661 2.7366 2.6841 4.6584 2.6841a5.3891 5.3891 0 003.8073-1.5725 5.3675 5.3675 0 001.578-3.7987 5.3574 5.3574 0 00-1.5771-3.797A5.379 5.379 0 009.7387 4.801l-.0008-.0008z",fill:"currentColor",fillRule:"evenodd"})))}function gn(e){return Ue.createElement("svg",{width:"15",height:"15","aria-label":e.ariaLabel,role:"img"},Ue.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"},e.children))}function On(e){var t=e.translations,n=void 0===t?{}:t,r=n.selectText,o=void 0===r?"to select":r,c=n.selectKeyAriaLabel,i=void 0===c?"Enter key":c,a=n.navigateText,u=void 0===a?"to navigate":a,l=n.navigateUpKeyAriaLabel,s=void 0===l?"Arrow up":l,f=n.navigateDownKeyAriaLabel,p=void 0===f?"Arrow down":f,m=n.closeText,d=void 0===m?"to close":m,h=n.closeKeyAriaLabel,v=void 0===h?"Escape key":h,y=n.searchByText,_=void 0===y?"Search by":y;return Ue.createElement(Ue.Fragment,null,Ue.createElement("div",{className:"DocSearch-Logo"},Ue.createElement(bn,{translations:{searchByText:_}})),Ue.createElement("ul",{className:"DocSearch-Commands"},Ue.createElement("li",null,Ue.createElement("span",{className:"DocSearch-Commands-Key"},Ue.createElement(gn,{ariaLabel:i},Ue.createElement("path",{d:"M12 3.53088v3c0 1-1 2-2 2H4M7 11.53088l-3-3 3-3"}))),Ue.createElement("span",{className:"DocSearch-Label"},o)),Ue.createElement("li",null,Ue.createElement("span",{className:"DocSearch-Commands-Key"},Ue.createElement(gn,{ariaLabel:p},Ue.createElement("path",{d:"M7.5 3.5v8M10.5 8.5l-3 3-3-3"}))),Ue.createElement("span",{className:"DocSearch-Commands-Key"},Ue.createElement(gn,{ariaLabel:s},Ue.createElement("path",{d:"M7.5 11.5v-8M10.5 6.5l-3-3-3 3"}))),Ue.createElement("span",{className:"DocSearch-Label"},u)),Ue.createElement("li",null,Ue.createElement("span",{className:"DocSearch-Commands-Key"},Ue.createElement(gn,{ariaLabel:v},Ue.createElement("path",{d:"M13.6167 8.936c-.1065.3583-.6883.962-1.4875.962-.7993 0-1.653-.9165-1.653-2.1258v-.5678c0-1.2548.7896-2.1016 1.653-2.1016.8634 0 1.3601.4778 1.4875 1.0724M9 6c-.1352-.4735-.7506-.9219-1.46-.8972-.7092.0246-1.344.57-1.344 1.2166s.4198.8812 1.3445.9805C8.465 7.3992 8.968 7.9337 9 8.5c.032.5663-.454 1.398-1.4595 1.398C6.6593 9.898 6 9 5.963 8.4851m-1.4748.5368c-.2635.5941-.8099.876-1.5443.876s-1.7073-.6248-1.7073-2.204v-.4603c0-1.0416.721-2.131 1.7073-2.131.9864 0 1.6425 1.031 1.5443 2.2492h-2.956"}))),Ue.createElement("span",{className:"DocSearch-Label"},d))))}function Sn(e){var t=e.hit,n=e.children;return Ue.createElement("a",{href:t.url},n)}function En(){return Ue.createElement("svg",{viewBox:"0 0 38 38",stroke:"currentColor",strokeOpacity:".5"},Ue.createElement("g",{fill:"none",fillRule:"evenodd"},Ue.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},Ue.createElement("circle",{strokeOpacity:".3",cx:"18",cy:"18",r:"18"}),Ue.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18"},Ue.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))))}function wn(){return Ue.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},Ue.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},Ue.createElement("path",{d:"M3.18 6.6a8.23 8.23 0 1112.93 9.94h0a8.23 8.23 0 01-11.63 0"}),Ue.createElement("path",{d:"M6.44 7.25H2.55V3.36M10.45 6v5.6M10.45 11.6L13 13"})))}function jn(){return Ue.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},Ue.createElement("path",{d:"M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function Pn(){return Ue.createElement("svg",{className:"DocSearch-Hit-Select-Icon",width:"20",height:"20",viewBox:"0 0 20 20"},Ue.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},Ue.createElement("path",{d:"M18 3v4c0 2-2 4-4 4H2"}),Ue.createElement("path",{d:"M8 17l-6-6 6-6"})))}var In=function(){return Ue.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},Ue.createElement("path",{d:"M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))};function kn(e){switch(e.type){case"lvl1":return Ue.createElement(In,null);case"content":return Ue.createElement(Cn,null);default:return Ue.createElement(Dn,null)}}function Dn(){return Ue.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},Ue.createElement("path",{d:"M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function Cn(){return Ue.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},Ue.createElement("path",{d:"M17 5H3h14zm0 5H3h14zm0 5H3h14z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function An(){return Ue.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},Ue.createElement("path",{d:"M10 14.2L5 17l1-5.6-4-4 5.5-.7 2.5-5 2.5 5 5.6.8-4 4 .9 5.5z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function xn(){return Ue.createElement("svg",{width:"40",height:"40",viewBox:"0 0 20 20",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},Ue.createElement("path",{d:"M19 4.8a16 16 0 00-2-1.2m-3.3-1.2A16 16 0 001.1 4.7M16.7 8a12 12 0 00-2.8-1.4M10 6a12 12 0 00-6.7 2M12.3 14.7a4 4 0 00-4.5 0M14.5 11.4A8 8 0 0010 10M3 16L18 2M10 18h0"}))}function Nn(){return Ue.createElement("svg",{width:"40",height:"40",viewBox:"0 0 20 20",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},Ue.createElement("path",{d:"M15.5 4.8c2 3 1.7 7-1 9.7h0l4.3 4.3-4.3-4.3a7.8 7.8 0 01-9.8 1m-2.2-2.2A7.8 7.8 0 0113.2 2.4M2 18L18 2"}))}function Rn(e){var t=e.translations,n=void 0===t?{}:t,r=n.titleText,o=void 0===r?"Unable to fetch results":r,c=n.helpText,i=void 0===c?"You might want to check your network connection.":c;return Ue.createElement("div",{className:"DocSearch-ErrorScreen"},Ue.createElement("div",{className:"DocSearch-Screen-Icon"},Ue.createElement(xn,null)),Ue.createElement("p",{className:"DocSearch-Title"},o),Ue.createElement("p",{className:"DocSearch-Help"},i))}var Tn=["translations"];function Ln(e){return function(e){if(Array.isArray(e))return qn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return qn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qn(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Hn(e){var t=e.translations,n=void 0===t?{}:t,r=Mn(e,Tn),o=n.noResultsText,c=void 0===o?"No results for":o,i=n.suggestedQueryText,a=void 0===i?"Try searching for":i,u=n.reportMissingResultsText,l=void 0===u?"Believe this query should return results?":u,s=n.reportMissingResultsLinkText,f=void 0===s?"Let us know.":s,p=r.state.context.searchSuggestions;return Ue.createElement("div",{className:"DocSearch-NoResults"},Ue.createElement("div",{className:"DocSearch-Screen-Icon"},Ue.createElement(Nn,null)),Ue.createElement("p",{className:"DocSearch-Title"},c,' "',Ue.createElement("strong",null,r.state.query),'"'),p&&p.length>0&&Ue.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},Ue.createElement("p",{className:"DocSearch-Help"},a,":"),Ue.createElement("ul",null,p.slice(0,3).reduce((function(e,t){return[].concat(Ln(e),[Ue.createElement("li",{key:t},Ue.createElement("button",{className:"DocSearch-Prefill",key:t,type:"button",onClick:function(){r.setQuery(t.toLowerCase()+" "),r.refresh(),r.inputRef.current.focus()}},t))])}),[]))),r.getMissingResultsUrl&&Ue.createElement("p",{className:"DocSearch-Help"},"".concat(l," "),Ue.createElement("a",{href:r.getMissingResultsUrl({query:r.state.query}),target:"_blank",rel:"noopener noreferrer"},f)))}var Un=["hit","attribute","tagName"];function Fn(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 Bn(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Wn(e,t){return t.split(".").reduce((function(e,t){return null!=e&&e[t]?e[t]:null}),e)}function Kn(e){var t=e.hit,n=e.attribute,r=e.tagName;return g(void 0===r?"span":r,Bn(Bn({},zn(e,Un)),{},{dangerouslySetInnerHTML:{__html:Wn(t,"_snippetResult.".concat(n,".value"))||Wn(t,n)}}))}function Jn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,c=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(c.push(r.value),!t||c.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return c}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return $n(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n|<\/mark>)/g,nr=RegExp(tr.source);function rr(e){var t,n,r,o,c,i=e;if(!i.__docsearch_parent&&!e._highlightResult)return e.hierarchy.lvl0;var a=((i.__docsearch_parent?null===(t=i.__docsearch_parent)||void 0===t||null===(n=t._highlightResult)||void 0===n||null===(r=n.hierarchy)||void 0===r?void 0:r.lvl0:null===(o=e._highlightResult)||void 0===o||null===(c=o.hierarchy)||void 0===c?void 0:c.lvl0)||{}).value;return a&&nr.test(a)?a.replace(tr,""):a}function or(){return or=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function lr(e){var t=e.translations,n=void 0===t?{}:t,r=ur(e,ir),o=n.recentSearchesTitle,c=void 0===o?"Recent":o,i=n.noRecentSearchesText,a=void 0===i?"No recent searches":i,u=n.saveRecentSearchButtonTitle,l=void 0===u?"Save this search":u,s=n.removeRecentSearchButtonTitle,f=void 0===s?"Remove this search from history":s,p=n.favoriteSearchesTitle,m=void 0===p?"Favorite":p,d=n.removeFavoriteSearchButtonTitle,h=void 0===d?"Remove this search from favorites":d;return"idle"===r.state.status&&!1===r.hasCollections?r.disableUserPersonalization?null:Ue.createElement("div",{className:"DocSearch-StartScreen"},Ue.createElement("p",{className:"DocSearch-Help"},a)):!1===r.hasCollections?null:Ue.createElement("div",{className:"DocSearch-Dropdown-Container"},Ue.createElement(Yn,ar({},r,{title:c,collection:r.state.collections[0],renderIcon:function(){return Ue.createElement("div",{className:"DocSearch-Hit-icon"},Ue.createElement(wn,null))},renderAction:function(e){var t=e.item,n=e.runFavoriteTransition,o=e.runDeleteTransition;return Ue.createElement(Ue.Fragment,null,Ue.createElement("div",{className:"DocSearch-Hit-action"},Ue.createElement("button",{className:"DocSearch-Hit-action-button",title:l,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),n((function(){r.favoriteSearches.add(t),r.recentSearches.remove(t),r.refresh()}))}},Ue.createElement(An,null))),Ue.createElement("div",{className:"DocSearch-Hit-action"},Ue.createElement("button",{className:"DocSearch-Hit-action-button",title:f,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),o((function(){r.recentSearches.remove(t),r.refresh()}))}},Ue.createElement(jn,null))))}})),Ue.createElement(Yn,ar({},r,{title:m,collection:r.state.collections[1],renderIcon:function(){return Ue.createElement("div",{className:"DocSearch-Hit-icon"},Ue.createElement(An,null))},renderAction:function(e){var t=e.item,n=e.runDeleteTransition;return Ue.createElement("div",{className:"DocSearch-Hit-action"},Ue.createElement("button",{className:"DocSearch-Hit-action-button",title:h,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),n((function(){r.favoriteSearches.remove(t),r.refresh()}))}},Ue.createElement(jn,null)))}})))}var sr=["translations"];function fr(){return fr=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var mr=Ue.memo((function(e){var t=e.translations,n=void 0===t?{}:t,r=pr(e,sr);if("error"===r.state.status)return Ue.createElement(Rn,{translations:null==n?void 0:n.errorScreen});var o=r.state.collections.some((function(e){return e.items.length>0}));return r.state.query?!1===o?Ue.createElement(Hn,fr({},r,{translations:null==n?void 0:n.noResultsScreen})):Ue.createElement(cr,r):Ue.createElement(lr,fr({},r,{hasCollections:o,translations:null==n?void 0:n.startScreen}))}),(function(e,t){return"loading"===t.state.status||"stalled"===t.state.status})),dr=["translations"];function hr(){return hr=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function yr(e){var t=e.translations,n=void 0===t?{}:t,r=vr(e,dr),o=n.resetButtonTitle,c=void 0===o?"Clear the query":o,i=n.resetButtonAriaLabel,a=void 0===i?"Clear the query":i,u=n.cancelButtonText,l=void 0===u?"Cancel":u,s=n.cancelButtonAriaLabel,f=void 0===s?"Cancel":s,p=r.getFormProps({inputElement:r.inputRef.current}).onReset;return Ue.useEffect((function(){r.autoFocus&&r.inputRef.current&&r.inputRef.current.focus()}),[r.autoFocus,r.inputRef]),Ue.useEffect((function(){r.isFromSelection&&r.inputRef.current&&r.inputRef.current.select()}),[r.isFromSelection,r.inputRef]),Ue.createElement(Ue.Fragment,null,Ue.createElement("form",{className:"DocSearch-Form",onSubmit:function(e){e.preventDefault()},onReset:p},Ue.createElement("label",hr({className:"DocSearch-MagnifierLabel"},r.getLabelProps()),Ue.createElement(Be,null)),Ue.createElement("div",{className:"DocSearch-LoadingIndicator"},Ue.createElement(En,null)),Ue.createElement("input",hr({className:"DocSearch-Input",ref:r.inputRef},r.getInputProps({inputElement:r.inputRef.current,autoFocus:r.autoFocus,maxLength:64}))),Ue.createElement("button",{type:"reset",title:c,className:"DocSearch-Reset","aria-label":a,hidden:!r.state.query},Ue.createElement(jn,null))),Ue.createElement("button",{className:"DocSearch-Cancel",type:"reset","aria-label":f,onClick:r.onClose},l))}var _r=["_highlightResult","_snippetResult"];function br(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function gr(e){return!1===function(){var e="__TEST_KEY__";try{return localStorage.setItem(e,""),localStorage.removeItem(e),!0}catch(e){return!1}}()?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){return window.localStorage.setItem(e,JSON.stringify(t))},getItem:function(){var t=window.localStorage.getItem(e);return t?JSON.parse(t):[]}}}function Or(e){var t=e.key,n=e.limit,r=void 0===n?5:n,o=gr(t),c=o.getItem().slice(0,r);return{add:function(e){var t=e,n=(t._highlightResult,t._snippetResult,br(t,_r)),i=c.findIndex((function(e){return e.objectID===n.objectID}));i>-1&&c.splice(i,1),c.unshift(n),c=c.slice(0,r),o.setItem(c)},remove:function(e){c=c.filter((function(t){return t.objectID!==e.objectID})),o.setItem(c)},getAll:function(){return c}}}var Sr=["facetName","facetQuery"];function Er(e){var t,n="algoliasearch-client-js-".concat(e.key),r=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},o=function(){return JSON.parse(r().getItem(n)||"{}")};return{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var n=JSON.stringify(e),r=o()[n];return Promise.all([r||t(),void 0!==r])})).then((function(e){var t=i(e,2),r=t[0],o=t[1];return Promise.all([r,o||n.miss(r)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var c=o();return c[JSON.stringify(e)]=t,r().setItem(n,JSON.stringify(c)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=o();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){r().removeItem(n)}))}}}function wr(e){var t=a(e.caches),n=t.shift();return void 0===n?{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,n.miss(e)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(e,r,o).catch((function(){return wr({caches:t}).get(e,r,o)}))},set:function(e,r){return n.set(e,r).catch((function(){return wr({caches:t}).set(e,r)}))},delete:function(e){return n.delete(e).catch((function(){return wr({caches:t}).delete(e)}))},clear:function(){return n.clear().catch((function(){return wr({caches:t}).clear()}))}}}function jr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},c=JSON.stringify(n);if(c in t)return Promise.resolve(e.serializable?JSON.parse(t[c]):t[c]);var i=r(),a=o&&o.miss||function(){return Promise.resolve()};return i.then((function(e){return a(e)})).then((function(){return i}))},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function Pr(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}function Ir(e,t){return t?(Object.keys(t).forEach((function(n){e[n]=t[n](e)})),e):e}function kr(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0?r:void 0,timeout:n.timeout||t,headers:n.headers||{},queryParameters:n.queryParameters||{},cacheable:n.cacheable}}var xr={Read:1,Write:2,Any:3},Nr=1,Rr=2,Tr=3,Lr=12e4;function qr(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Nr;return t(t({},e),{},{status:n,lastUpdate:Date.now()})}function Mr(e){return"string"==typeof e?{protocol:"https",url:e,accept:xr.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||xr.Any}}var Hr="GET",Ur="POST";function Fr(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(qr(t))}))}))).then((function(e){var n=e.filter((function(e){return function(e){return e.status===Nr||Date.now()-e.lastUpdate>Lr}(e)})),r=e.filter((function(e){return function(e){return e.status===Tr&&Date.now()-e.lastUpdate<=Lr}(e)})),o=[].concat(a(n),a(r));return{getTimeout:function(e,t){return(0===r.length&&0===e?1:r.length+3+e)*t},statelessHosts:o.length>0?o.map((function(e){return Mr(e)})):t}}))}function Br(e,n,r,o){var c=[],i=function(e,n){if(e.method===Hr||void 0===e.data&&void 0===n.data)return;var r=Array.isArray(e.data)?e.data:t(t({},e.data),n.data);return JSON.stringify(r)}(r,o),u=function(e,n){var r=t(t({},e.headers),n.headers),o={};return Object.keys(r).forEach((function(e){var t=r[e];o[e.toLowerCase()]=t})),o}(e,o),l=r.method,s=r.method!==Hr?{}:t(t({},r.data),o.data),f=t(t(t({"x-algolia-agent":e.userAgent.value},e.queryParameters),s),o.queryParameters),p=0,m=function t(n,a){var s=n.pop();if(void 0===s)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:Kr(c)};var m={data:i,headers:u,method:l,url:zr(s,r.path,f),connectTimeout:a(p,e.timeouts.connect),responseTimeout:a(p,o.timeout)},d=function(e){var t={request:m,response:e,host:s,triesLeft:n.length};return c.push(t),t},h={onSucess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(r){var o=d(r);return r.isTimedOut&&p++,Promise.all([e.logger.info("Retryable failure",Jr(o)),e.hostsCache.set(s,qr(s,r.isTimedOut?Tr:Rr))]).then((function(){return t(n,a)}))},onFail:function(e){throw d(e),function(e,t){var n=e.content,r=e.status,o=n;try{o=JSON.parse(n).message}catch(e){}return function(e,t,n){return{name:"ApiError",message:e,status:t,transporterStackTrace:n}}(o,r,t)}(e,Kr(c))}};return e.requester.send(m).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,n=e.status;return!t&&0==~~n}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSucess(e):t.onFail(e)}(e,h)}))};return Fr(e.hostsCache,n).then((function(e){return m(a(e.statelessHosts).reverse(),e.getTimeout)}))}function Vr(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var n="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(n)&&(t.value="".concat(t.value).concat(n)),t}};return t}function zr(e,t,n){var r=Wr(n),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return r.length&&(o+="?".concat(r)),o}function Wr(e){return Object.keys(e).map((function(t){return kr("%s=%s",t,(n=e[t],"[object Object]"===Object.prototype.toString.call(n)||"[object Array]"===Object.prototype.toString.call(n)?JSON.stringify(e[t]):e[t]));var n})).join("&")}function Kr(e){return e.map((function(e){return Jr(e)}))}function Jr(e){var n=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return t(t({},e),{},{request:t(t({},e.request),{},{headers:t(t({},e.request.headers),n)})})}var $r=function(e){var n=e.appId,r=function(e,t,n){var r={"x-algolia-api-key":n,"x-algolia-application-id":t};return{headers:function(){return e===Cr.WithinHeaders?r:{}},queryParameters:function(){return e===Cr.WithinQueryParameters?r:{}}}}(void 0!==e.authMode?e.authMode:Cr.WithinHeaders,n,e.apiKey),o=function(e){var t=e.hostsCache,n=e.logger,r=e.requester,o=e.requestsCache,c=e.responsesCache,a=e.timeouts,u=e.userAgent,l=e.hosts,s=e.queryParameters,f={hostsCache:t,logger:n,requester:r,requestsCache:o,responsesCache:c,timeouts:a,userAgent:u,headers:e.headers,queryParameters:s,hosts:l.map((function(e){return Mr(e)})),read:function(e,t){var n=Ar(t,f.timeouts.read),r=function(){return Br(f,f.hosts.filter((function(e){return 0!=(e.accept&xr.Read)})),e,n)};if(!0!==(void 0!==n.cacheable?n.cacheable:e.cacheable))return r();var o={request:e,mappedRequestOptions:n,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(o,(function(){return f.requestsCache.get(o,(function(){return f.requestsCache.set(o,r()).then((function(e){return Promise.all([f.requestsCache.delete(o),e])}),(function(e){return Promise.all([f.requestsCache.delete(o),Promise.reject(e)])})).then((function(e){var t=i(e,2);return t[0],t[1]}))}))}),{miss:function(e){return f.responsesCache.set(o,e)}})},write:function(e,t){return Br(f,f.hosts.filter((function(e){return 0!=(e.accept&xr.Write)})),e,Ar(t,f.timeouts.write))}};return f}(t(t({hosts:[{url:"".concat(n,"-dsn.algolia.net"),accept:xr.Read},{url:"".concat(n,".algolia.net"),accept:xr.Write}].concat(Pr([{url:"".concat(n,"-1.algolianet.com")},{url:"".concat(n,"-2.algolianet.com")},{url:"".concat(n,"-3.algolianet.com")}]))},e),{},{headers:t(t(t({},r.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:t(t({},r.queryParameters()),e.queryParameters)})),c={transporter:o,appId:n,addAlgoliaAgent:function(e,t){o.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then((function(){}))}};return Ir(c,e.methods)},Qr=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={transporter:e.transporter,appId:e.appId,indexName:t};return Ir(r,n.methods)}},Yr=function(e){return function(n,r){var o=n.map((function(e){return t(t({},e),{},{params:Wr(e.params||{})})}));return e.transporter.read({method:Ur,path:"1/indexes/*/queries",data:{requests:o},cacheable:!0},r)}},Gr=function(e){return function(n,r){return Promise.all(n.map((function(n){var o=n.params,i=o.facetName,a=o.facetQuery,u=c(o,Sr);return Qr(e)(n.indexName,{methods:{searchForFacetValues:eo}}).searchForFacetValues(i,a,t(t({},r),u))})))}},Zr=function(e){return function(t,n,r){return e.transporter.read({method:Ur,path:kr("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:n},cacheable:!0},r)}},Xr=function(e){return function(t,n){return e.transporter.read({method:Ur,path:kr("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},n)}},eo=function(e){return function(t,n,r){return e.transporter.read({method:Ur,path:kr("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:n},cacheable:!0},r)}},to=1,no=2,ro=3;function oo(e,n,r){var o,c={appId:e,apiKey:n,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return n.setRequestHeader(t,e.headers[t])}));var r,o=function(e,r){return setTimeout((function(){n.abort(),t({status:0,content:r,isTimedOut:!0})}),1e3*e)},c=o(e.connectTimeout,"Connection timeout");n.onreadystatechange=function(){n.readyState>n.OPENED&&void 0===r&&(clearTimeout(c),r=o(e.responseTimeout,"Socket timeout"))},n.onerror=function(){0===n.status&&(clearTimeout(c),clearTimeout(r),t({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=function(){clearTimeout(c),clearTimeout(r),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)}))}},logger:(o=ro,{debug:function(e,t){return to>=o&&console.debug(e,t),Promise.resolve()},info:function(e,t){return no>=o&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:jr(),requestsCache:jr({serializable:!1}),hostsCache:wr({caches:[Er({key:"".concat(Dr,"-").concat(e)}),jr()]}),userAgent:Vr(Dr).add({segment:"Browser",version:"lite"}),authMode:Cr.WithinQueryParameters};return $r(t(t(t({},c),r),{},{methods:{search:Yr,searchForFacetValues:Gr,multipleQueries:Yr,multipleSearchForFacetValues:Gr,initIndex:function(e){return function(t){return Qr(e)(t,{methods:{search:Xr,searchForFacetValues:eo,findAnswers:Zr}})}}}}))}oo.version=Dr;var co="3.0.0";var io=["footer","searchBox"];function ao(){return ao=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ho(e){var t=e.appId,n=e.apiKey,r=e.indexName,o=e.placeholder,c=void 0===o?"Search docs":o,i=e.searchParameters,a=e.onClose,u=void 0===a?er:a,l=e.transformItems,s=void 0===l?Xn:l,f=e.hitComponent,p=void 0===f?Sn:f,m=e.resultsFooterComponent,d=void 0===m?function(){return null}:m,h=e.navigator,v=e.initialScrollY,y=void 0===v?0:v,_=e.transformSearchClient,b=void 0===_?Xn:_,g=e.disableUserPersonalization,O=void 0!==g&&g,S=e.initialQuery,E=void 0===S?"":S,w=e.translations,j=void 0===w?{}:w,P=e.getMissingResultsUrl,I=j.footer,k=j.searchBox,D=mo(j,io),C=fo(Ue.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),A=C[0],x=C[1],N=Ue.useRef(null),R=Ue.useRef(null),T=Ue.useRef(null),L=Ue.useRef(null),q=Ue.useRef(null),M=Ue.useRef(10),H=Ue.useRef("undefined"!=typeof window?window.getSelection().toString().slice(0,64):"").current,U=Ue.useRef(E||H).current,F=function(e,t,n){return Ue.useMemo((function(){var r=oo(e,t);return r.addAlgoliaAgent("docsearch",co),!1===/docsearch.js \(.*\)/.test(r.transporter.userAgent.value)&&r.addAlgoliaAgent("docsearch-react",co),n(r)}),[e,t,n])}(t,n,b),B=Ue.useRef(Or({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(r),limit:10})).current,V=Ue.useRef(Or({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(r),limit:0===B.getAll().length?7:4})).current,z=Ue.useCallback((function(e){if(!O){var t="content"===e.type?e.__docsearch_parent:e;t&&-1===B.getAll().findIndex((function(e){return e.objectID===t.objectID}))&&V.add(t)}}),[B,V,O]),W=Ue.useMemo((function(){return _n({id:"docsearch",defaultActiveItemId:0,placeholder:c,openOnFocus:!0,initialState:{query:U,context:{searchSuggestions:[]}},navigator:h,onStateChange:function(e){x(e.state)},getSources:function(e){var t=e.query,n=e.state,o=e.setContext,c=e.setStatus;return t?F.search([{query:t,indexName:r,params:lo({attributesToRetrieve:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:["hierarchy.lvl1:".concat(M.current),"hierarchy.lvl2:".concat(M.current),"hierarchy.lvl3:".concat(M.current),"hierarchy.lvl4:".concat(M.current),"hierarchy.lvl5:".concat(M.current),"hierarchy.lvl6:".concat(M.current),"content:".concat(M.current)],snippetEllipsisText:"…",highlightPreTag:"",highlightPostTag:"",hitsPerPage:20},i)}]).catch((function(e){throw"RetryError"===e.name&&c("error"),e})).then((function(e){var t=e.results[0],r=t.hits,c=t.nbHits,i=Zn(r,(function(e){return rr(e)}));return n.context.searchSuggestions.length0&&($(),q.current&&q.current.focus())}),[U,$]),Ue.useEffect((function(){function e(){if(R.current){var e=.01*window.innerHeight;R.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),Ue.createElement("div",ao({ref:N},J({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===A.status&&"DocSearch-Container--Stalled","error"===A.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),role:"button",tabIndex:0,onMouseDown:function(e){e.target===e.currentTarget&&u()}}),Ue.createElement("div",{className:"DocSearch-Modal",ref:R},Ue.createElement("header",{className:"DocSearch-SearchBar",ref:T},Ue.createElement(yr,ao({},W,{state:A,autoFocus:0===U.length,inputRef:q,isFromSelection:Boolean(U)&&U===H,translations:k,onClose:u}))),Ue.createElement("div",{className:"DocSearch-Dropdown",ref:L},Ue.createElement(mr,ao({},W,{indexName:r,state:A,hitComponent:p,resultsFooterComponent:d,disableUserPersonalization:O,recentSearches:V,favoriteSearches:B,inputRef:q,translations:D,getMissingResultsUrl:P,onItemClick:function(e){z(e),u()}}))),Ue.createElement("footer",{className:"DocSearch-Footer"},Ue.createElement(On,{translations:I}))))}function vo(){return vo=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:window;return"string"==typeof e?t.document.querySelector(e):e}(e.container,e.environment))}})); +//# sourceMappingURL=index.js.map diff --git a/node_modules/@docsearch/js/dist/umd/index.js.map b/node_modules/@docsearch/js/dist/umd/index.js.map new file mode 100644 index 0000000000..fc65ba3724 --- /dev/null +++ b/node_modules/@docsearch/js/dist/umd/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../../../../node_modules/preact/dist/preact.module.js","../../../../node_modules/preact/hooks/dist/hooks.module.js","../../../../node_modules/preact/compat/dist/compat.module.js","../../../docsearch-react/dist/esm/icons/ControlKeyIcon.js","../../../docsearch-react/dist/esm/icons/SearchIcon.js","../../../docsearch-react/dist/esm/DocSearchButton.js","../../../../node_modules/@algolia/autocomplete-shared/dist/esm/flatten.js","../../../../node_modules/@algolia/autocomplete-shared/dist/esm/generateAutocompleteId.js","../../../../node_modules/@algolia/autocomplete-shared/dist/esm/getItemsCount.js","../../../../node_modules/@algolia/autocomplete-shared/dist/esm/noop.js","../../../../node_modules/@algolia/autocomplete-shared/dist/esm/userAgents.js","../../../../node_modules/@algolia/autocomplete-shared/dist/esm/version.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromise.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/getNextActiveItemId.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/getNormalizedSources.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/getActiveItem.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/mapToAlgoliaResponse.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/createStore.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromiseList.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/getAutocompleteSetters.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/getDefaultProps.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/reshape.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/resolve.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/onInput.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/createConcurrentSafePromise.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/onKeyDown.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/getPropGetters.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/isOrContainsNode.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/metadata.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/getCompletion.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/stateReducer.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/createAutocomplete.js","../../../docsearch-react/dist/esm/AlgoliaLogo.js","../../../docsearch-react/dist/esm/Footer.js","../../../docsearch-react/dist/esm/Hit.js","../../../docsearch-react/dist/esm/icons/LoadingIcon.js","../../../docsearch-react/dist/esm/icons/RecentIcon.js","../../../docsearch-react/dist/esm/icons/ResetIcon.js","../../../docsearch-react/dist/esm/icons/SelectIcon.js","../../../docsearch-react/dist/esm/icons/SourceIcon.js","../../../docsearch-react/dist/esm/icons/StarIcon.js","../../../docsearch-react/dist/esm/icons/ErrorIcon.js","../../../docsearch-react/dist/esm/icons/NoResultsIcon.js","../../../docsearch-react/dist/esm/ErrorScreen.js","../../../docsearch-react/dist/esm/NoResultsScreen.js","../../../docsearch-react/dist/esm/Snippet.js","../../../docsearch-react/dist/esm/Results.js","../../../docsearch-react/dist/esm/utils/groupBy.js","../../../docsearch-react/dist/esm/utils/identity.js","../../../docsearch-react/dist/esm/utils/noop.js","../../../docsearch-react/dist/esm/utils/removeHighlightTags.js","../../../docsearch-react/dist/esm/ResultsScreen.js","../../../docsearch-react/dist/esm/StartScreen.js","../../../docsearch-react/dist/esm/ScreenState.js","../../../docsearch-react/dist/esm/SearchBox.js","../../../docsearch-react/dist/esm/constants.js","../../../docsearch-react/dist/esm/stored-searches.js","../../../docsearch-react/node_modules/algoliasearch/dist/algoliasearch-lite.esm.browser.js","../../../docsearch-react/dist/esm/version.js","../../../docsearch-react/dist/esm/DocSearchModal.js","../../../docsearch-react/dist/esm/useSearchClient.js","../../../docsearch-react/dist/esm/useTouchEvents.js","../../../docsearch-react/dist/esm/useTrapFocus.js","../../../docsearch-react/dist/esm/DocSearch.js","../../../docsearch-react/dist/esm/useDocSearchKeyboardEvents.js","../../src/docsearch.tsx"],"sourcesContent":["var n,l,u,i,t,r,o={},f=[],e=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function c(n,l){for(var u in l)n[u]=l[u];return n}function s(n){var l=n.parentNode;l&&l.removeChild(n)}function a(n,l,u){var i,t,r,o=arguments,f={};for(r in l)\"key\"==r?i=l[r]:\"ref\"==r?t=l[r]:f[r]=l[r];if(arguments.length>3)for(u=[u],r=3;r0?v(k.type,k.props,k.key,null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(_=A[h])||_&&k.key==_.key&&k.type===_.type)A[h]=void 0;else for(p=0;p3)for(u=[u],r=3;r=i.__.length&&i.__.push({}),i.__[t]}function l(n){return o=1,p(w,n)}function p(n,r,o){var i=m(t++,2);return i.t=n,i.__c||(i.__=[o?o(r):w(void 0,r),function(n){var t=i.t(i.__[0],n);i.__[0]!==t&&(i.__=[t,i.__[1]],i.__c.setState({}))}],i.__c=u),i.__}function y(r,o){var i=m(t++,3);!n.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__H.__h.push(i))}function h(r,o){var i=m(t++,4);!n.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__h.push(i))}function s(n){return o=5,d(function(){return{current:n}},[])}function _(n,t,u){o=6,h(function(){\"function\"==typeof n?n(t()):n&&(n.current=t())},null==u?u:u.concat(n))}function d(n,u){var r=m(t++,7);return k(r.__H,u)&&(r.__=n(),r.__H=u,r.__h=n),r.__}function A(n,t){return o=8,d(function(){return n},t)}function F(n){var r=u.context[n.__c],o=m(t++,9);return o.__c=n,r?(null==o.__&&(o.__=!0,r.sub(u)),r.props.value):n.__}function T(t,u){n.useDebugValue&&n.useDebugValue(u?u(t):t)}function q(n){var r=m(t++,10),o=l();return r.__=n,u.componentDidCatch||(u.componentDidCatch=function(n){r.__&&r.__(n),o[1](n)}),[o[0],function(){o[1](void 0)}]}function x(){i.forEach(function(t){if(t.__P)try{t.__H.__h.forEach(g),t.__H.__h.forEach(j),t.__H.__h=[]}catch(u){t.__H.__h=[],n.__e(u,t.__v)}}),i=[]}n.__b=function(n){u=null,c&&c(n)},n.__r=function(n){f&&f(n),t=0;var r=(u=n.__c).__H;r&&(r.__h.forEach(g),r.__h.forEach(j),r.__h=[])},n.diffed=function(t){e&&e(t);var o=t.__c;o&&o.__H&&o.__H.__h.length&&(1!==i.push(o)&&r===n.requestAnimationFrame||((r=n.requestAnimationFrame)||function(n){var t,u=function(){clearTimeout(r),b&&cancelAnimationFrame(t),setTimeout(n)},r=setTimeout(u,100);b&&(t=requestAnimationFrame(u))})(x)),u=void 0},n.__c=function(t,u){u.some(function(t){try{t.__h.forEach(g),t.__h=t.__h.filter(function(n){return!n.__||j(n)})}catch(r){u.some(function(n){n.__h&&(n.__h=[])}),u=[],n.__e(r,t.__v)}}),a&&a(t,u)},n.unmount=function(t){v&&v(t);var u=t.__c;if(u&&u.__H)try{u.__H.__.forEach(g)}catch(t){n.__e(t,u.__v)}};var b=\"function\"==typeof requestAnimationFrame;function g(n){var t=u;\"function\"==typeof n.__c&&n.__c(),u=t}function j(n){var t=u;n.__c=n.__(),u=t}function k(n,t){return!n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function w(n,t){return\"function\"==typeof t?t(n):t}export{l as useState,p as useReducer,y as useEffect,h as useLayoutEffect,s as useRef,_ as useImperativeHandle,d as useMemo,A as useCallback,F as useContext,T as useDebugValue,q as useErrorBoundary};\n//# sourceMappingURL=hooks.module.js.map\n","import{useState as n,useReducer as t,useEffect as e,useLayoutEffect as r,useRef as u,useImperativeHandle as o,useMemo as i,useCallback as l,useContext as f,useDebugValue as c}from\"preact/hooks\";export*from\"preact/hooks\";import{Component as a,createElement as s,options as h,toChildArray as p,Fragment as v,render as d,hydrate as m,cloneElement as y,createRef as b,createContext as _}from\"preact\";export{createElement,createContext,createRef,Fragment,Component}from\"preact\";function C(n,t){for(var e in t)n[e]=t[e];return n}function S(n,t){for(var e in n)if(\"__source\"!==e&&!(e in t))return!0;for(var r in t)if(\"__source\"!==r&&n[r]!==t[r])return!0;return!1}function E(n){this.props=n}function g(n,t){function e(n){var e=this.props.ref,r=e==n.ref;return!r&&e&&(e.call?e(null):e.current=null),t?!t(this.props,n)||!r:S(this.props,n)}function r(t){return this.shouldComponentUpdate=e,s(n,t)}return r.displayName=\"Memo(\"+(n.displayName||n.name)+\")\",r.prototype.isReactComponent=!0,r.__f=!0,r}(E.prototype=new a).isPureReactComponent=!0,E.prototype.shouldComponentUpdate=function(n,t){return S(this.props,n)||S(this.state,t)};var w=h.__b;h.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),w&&w(n)};var R=\"undefined\"!=typeof Symbol&&Symbol.for&&Symbol.for(\"react.forward_ref\")||3911;function x(n){function t(t,e){var r=C({},t);return delete r.ref,n(r,(e=t.ref||e)&&(\"object\"!=typeof e||\"current\"in e)?e:null)}return t.$$typeof=R,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName=\"ForwardRef(\"+(n.displayName||n.name)+\")\",t}var N=function(n,t){return null==n?null:p(p(n).map(t))},k={map:N,forEach:N,count:function(n){return n?p(n).length:0},only:function(n){var t=p(n);if(1!==t.length)throw\"Children.only\";return t[0]},toArray:p},A=h.__e;function O(){this.__u=0,this.t=null,this.__b=null}function L(n){var t=n.__.__c;return t&&t.__e&&t.__e(n)}function U(n){var t,e,r;function u(u){if(t||(t=n()).then(function(n){e=n.default||n},function(n){r=n}),r)throw r;if(!e)throw t;return s(e,u)}return u.displayName=\"Lazy\",u.__f=!0,u}function D(){this.u=null,this.o=null}h.__e=function(n,t,e){if(n.then)for(var r,u=t;u=u.__;)if((r=u.__c)&&r.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),r.__c(n,t);A(n,t,e)},(O.prototype=new a).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=L(r.__v),o=!1,i=function(){o||(o=!0,e.componentWillUnmount=e.__c,u?u(l):l())};e.__c=e.componentWillUnmount,e.componentWillUnmount=function(){i(),e.__c&&e.__c()};var l=function(){if(!--r.__u){if(r.state.__e){var n=r.state.__e;r.__v.__k[0]=function n(t,e,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)}),t.__c&&t.__c.__P===e&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(n,n.__c.__P,n.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},f=!0===t.__h;r.__u++||f||r.setState({__e:r.__b=r.__v.__k[0]}),n.then(i,i)},O.prototype.componentWillUnmount=function(){this.t=[]},O.prototype.render=function(n,t){if(this.__b){if(this.__v.__k){var e=document.createElement(\"div\"),r=this.__v.__k[0].__c;this.__v.__k[0]=function n(t,e,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(n){\"function\"==typeof n.__c&&n.__c()}),t.__c.__H=null),null!=(t=C({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)})),t}(this.__b,e,r.__O=r.__P)}this.__b=null}var u=t.__e&&s(v,null,n.fallback);return u&&(u.__h=null),[s(v,null,t.__e?null:n.children),u]};var F=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&(\"t\"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]>>1,1),t.i.removeChild(n)}}),d(s(M,{context:t.context},n.__v),t.l)):t.l&&t.componentWillUnmount()}function j(n,t){return s(T,{__v:n,i:t})}(D.prototype=new a).__e=function(n){var t=this,e=L(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),F(t,n,r)):u()};e?e(o):o()}},D.prototype.render=function(n){this.u=null,this.o=new Map;var t=p(n.children);n.revealOrder&&\"b\"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},D.prototype.componentDidUpdate=D.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){F(n,e,t)})};var I=\"undefined\"!=typeof Symbol&&Symbol.for&&Symbol.for(\"react.element\")||60103,W=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,P=function(n){return(\"undefined\"!=typeof Symbol&&\"symbol\"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function V(n,t,e){return null==t.__k&&(t.textContent=\"\"),d(n,t),\"function\"==typeof e&&e(),n?n.__c:null}function z(n,t,e){return m(n,t),\"function\"==typeof e&&e(),n?n.__c:null}a.prototype.isReactComponent={},[\"componentWillMount\",\"componentWillReceiveProps\",\"componentWillUpdate\"].forEach(function(n){Object.defineProperty(a.prototype,n,{configurable:!0,get:function(){return this[\"UNSAFE_\"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t})}})});var B=h.event;function H(){}function Z(){return this.cancelBubble}function Y(){return this.defaultPrevented}h.event=function(n){return B&&(n=B(n)),n.persist=H,n.isPropagationStopped=Z,n.isDefaultPrevented=Y,n.nativeEvent=n};var $,q={configurable:!0,get:function(){return this.class}},G=h.vnode;h.vnode=function(n){var t=n.type,e=n.props,r=e;if(\"string\"==typeof t){for(var u in r={},e){var o=e[u];\"value\"===u&&\"defaultValue\"in e&&null==o||(\"defaultValue\"===u&&\"value\"in e&&null==e.value?u=\"value\":\"download\"===u&&!0===o?o=\"\":/ondoubleclick/i.test(u)?u=\"ondblclick\":/^onchange(textarea|input)/i.test(u+t)&&!P(e.type)?u=\"oninput\":/^on(Ani|Tra|Tou|BeforeInp)/.test(u)?u=u.toLowerCase():W.test(u)?u=u.replace(/[A-Z0-9]/,\"-$&\").toLowerCase():null===o&&(o=void 0),r[u]=o)}\"select\"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=p(e.children).forEach(function(n){n.props.selected=-1!=r.value.indexOf(n.props.value)})),\"select\"==t&&null!=r.defaultValue&&(r.value=p(e.children).forEach(function(n){n.props.selected=r.multiple?-1!=r.defaultValue.indexOf(n.props.value):r.defaultValue==n.props.value})),n.props=r}t&&e.class!=e.className&&(q.enumerable=\"className\"in e,null!=e.className&&(r.class=e.className),Object.defineProperty(r,\"className\",q)),n.$$typeof=I,G&&G(n)};var J=h.__r;h.__r=function(n){J&&J(n),$=n.__c};var K={ReactCurrentDispatcher:{current:{readContext:function(n){return $.__n[n.__c].props.value}}}},Q=1,X=2,nn=3,tn=4,en=5;function rn(n,t){return t()}var un=\"object\"==typeof performance&&\"function\"==typeof performance.now?performance.now.bind(performance):function(){return Date.now()},on=\"16.8.0\";function ln(n){return s.bind(null,n)}function fn(n){return!!n&&n.$$typeof===I}function cn(n){return fn(n)?y.apply(null,arguments):n}function an(n){return!!n.__k&&(d(null,n),!0)}function sn(n){return n&&(n.base||1===n.nodeType&&n)||null}var hn=function(n,t){return n(t)},pn=v;export default{useState:n,useReducer:t,useEffect:e,useLayoutEffect:r,useRef:u,useImperativeHandle:o,useMemo:i,useCallback:l,useContext:f,useDebugValue:c,version:\"16.8.0\",Children:k,render:V,hydrate:z,unmountComponentAtNode:an,createPortal:j,createElement:s,createContext:_,createFactory:ln,cloneElement:cn,createRef:b,Fragment:v,isValidElement:fn,findDOMNode:sn,Component:a,PureComponent:E,memo:g,forwardRef:x,unstable_batchedUpdates:hn,StrictMode:v,Suspense:O,SuspenseList:D,lazy:U,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:K};export{on as version,k as Children,V as render,z as hydrate,an as unmountComponentAtNode,j as createPortal,ln as createFactory,cn as cloneElement,fn as isValidElement,sn as findDOMNode,E as PureComponent,g as memo,x as forwardRef,hn as unstable_batchedUpdates,pn as StrictMode,O as Suspense,D as SuspenseList,U as lazy,K as __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Q as unstable_ImmediatePriority,X as unstable_UserBlockingPriority,nn as unstable_NormalPriority,tn as unstable_LowPriority,en as unstable_IdlePriority,rn as unstable_runWithPriority,un as unstable_now};\n//# sourceMappingURL=compat.module.js.map\n","import React from 'react';\nexport function ControlKeyIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"15\",\n height: \"15\",\n className: \"DocSearch-Control-Key-Icon\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n 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\",\n strokeWidth: \"1.2\",\n stroke: \"currentColor\",\n fill: \"none\",\n strokeLinecap: \"square\"\n }));\n}","import React from 'react';\nexport function SearchIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"20\",\n height: \"20\",\n className: \"DocSearch-Search-Icon\",\n viewBox: \"0 0 20 20\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n 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\",\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }));\n}","var _excluded = [\"translations\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React, { useMemo } from 'react';\nimport { ControlKeyIcon } from './icons/ControlKeyIcon';\nimport { SearchIcon } from './icons/SearchIcon';\nvar ACTION_KEY_DEFAULT = 'Ctrl';\nvar ACTION_KEY_APPLE = '⌘';\n\nfunction isAppleDevice() {\n return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);\n}\n\nexport var DocSearchButton = React.forwardRef(function (_ref, ref) {\n var _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations,\n props = _objectWithoutProperties(_ref, _excluded);\n\n var _translations$buttonT = translations.buttonText,\n buttonText = _translations$buttonT === void 0 ? 'Search' : _translations$buttonT,\n _translations$buttonA = translations.buttonAriaLabel,\n buttonAriaLabel = _translations$buttonA === void 0 ? 'Search' : _translations$buttonA;\n var key = useMemo(function () {\n if (typeof navigator !== 'undefined') {\n return isAppleDevice() ? ACTION_KEY_APPLE : ACTION_KEY_DEFAULT;\n }\n\n return null;\n }, []);\n return /*#__PURE__*/React.createElement(\"button\", _extends({\n type: \"button\",\n className: \"DocSearch DocSearch-Button\",\n \"aria-label\": buttonAriaLabel\n }, props, {\n ref: ref\n }), /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Button-Container\"\n }, /*#__PURE__*/React.createElement(SearchIcon, null), /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Button-Placeholder\"\n }, buttonText)), /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Button-Keys\"\n }, key !== null && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Button-Key\"\n }, key === ACTION_KEY_DEFAULT ? /*#__PURE__*/React.createElement(ControlKeyIcon, null) : key), /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Button-Key\"\n }, \"K\"))));\n});","export function flatten(values) {\n return values.reduce(function (a, b) {\n return a.concat(b);\n }, []);\n}","var autocompleteId = 0;\nexport function generateAutocompleteId() {\n return \"autocomplete-\".concat(autocompleteId++);\n}","export function getItemsCount(state) {\n if (state.collections.length === 0) {\n return 0;\n }\n\n return state.collections.reduce(function (sum, collection) {\n return sum + collection.items.length;\n }, 0);\n}","export var noop = function noop() {};","import { version } from './version';\nexport var userAgents = [{\n segment: 'autocomplete-core',\n version: version\n}];","export var version = '1.5.2';","function createInternalCancelablePromise(promise, initialState) {\n var state = initialState;\n return {\n then: function then(onfulfilled, onrejected) {\n return createInternalCancelablePromise(promise.then(createCallback(onfulfilled, state, promise), createCallback(onrejected, state, promise)), state);\n },\n catch: function _catch(onrejected) {\n return createInternalCancelablePromise(promise.catch(createCallback(onrejected, state, promise)), state);\n },\n finally: function _finally(onfinally) {\n if (onfinally) {\n state.onCancelList.push(onfinally);\n }\n\n return createInternalCancelablePromise(promise.finally(createCallback(onfinally && function () {\n state.onCancelList = [];\n return onfinally();\n }, state, promise)), state);\n },\n cancel: function cancel() {\n state.isCanceled = true;\n var callbacks = state.onCancelList;\n state.onCancelList = [];\n callbacks.forEach(function (callback) {\n callback();\n });\n },\n isCanceled: function isCanceled() {\n return state.isCanceled === true;\n }\n };\n}\n\nexport function createCancelablePromise(executor) {\n return createInternalCancelablePromise(new Promise(function (resolve, reject) {\n return executor(resolve, reject);\n }), {\n isCanceled: false,\n onCancelList: []\n });\n}\n\ncreateCancelablePromise.resolve = function (value) {\n return cancelable(Promise.resolve(value));\n};\n\ncreateCancelablePromise.reject = function (reason) {\n return cancelable(Promise.reject(reason));\n};\n\nexport function cancelable(promise) {\n return createInternalCancelablePromise(promise, {\n isCanceled: false,\n onCancelList: []\n });\n}\n\nfunction createCallback(onResult, state, fallback) {\n if (!onResult) {\n return fallback;\n }\n\n return function callback(arg) {\n if (state.isCanceled) {\n return arg;\n }\n\n return onResult(arg);\n };\n}","/**\n * Returns the next active item ID from the current state.\n *\n * We allow circular keyboard navigation from the base index.\n * The base index can either be `null` (nothing is highlighted) or `0`\n * (the first item is highlighted).\n * The base index is allowed to get assigned `null` only if\n * `props.defaultActiveItemId` is `null`. This pattern allows to \"stop\"\n * by the actual query before navigating to other suggestions as seen on\n * Google or Amazon.\n *\n * @param moveAmount The offset to increment (or decrement) the last index\n * @param baseIndex The current index to compute the next index from\n * @param itemCount The number of items\n * @param defaultActiveItemId The default active index to fallback to\n */\nexport function getNextActiveItemId(moveAmount, baseIndex, itemCount, defaultActiveItemId) {\n if (!itemCount) {\n return null;\n }\n\n if (moveAmount < 0 && (baseIndex === null || defaultActiveItemId !== null && baseIndex === 0)) {\n return itemCount + moveAmount;\n }\n\n var numericIndex = (baseIndex === null ? -1 : baseIndex) + moveAmount;\n\n if (numericIndex <= -1 || numericIndex >= itemCount) {\n return defaultActiveItemId === null ? null : 0;\n }\n\n return numericIndex;\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { invariant, decycle, noop } from '@algolia/autocomplete-shared';\nexport function getNormalizedSources(getSources, params) {\n var seenSourceIds = [];\n return Promise.resolve(getSources(params)).then(function (sources) {\n invariant(Array.isArray(sources), function () {\n return \"The `getSources` function must return an array of sources but returned type \".concat(JSON.stringify(_typeof(sources)), \":\\n\\n\").concat(JSON.stringify(decycle(sources), null, 2));\n });\n return Promise.all(sources // We allow `undefined` and `false` sources to allow users to use\n // `Boolean(query) && source` (=> `false`).\n // We need to remove these values at this point.\n .filter(function (maybeSource) {\n return Boolean(maybeSource);\n }).map(function (source) {\n invariant(typeof source.sourceId === 'string', 'A source must provide a `sourceId` string.');\n\n if (seenSourceIds.includes(source.sourceId)) {\n throw new Error(\"[Autocomplete] The `sourceId` \".concat(JSON.stringify(source.sourceId), \" is not unique.\"));\n }\n\n seenSourceIds.push(source.sourceId);\n\n var normalizedSource = _objectSpread({\n getItemInputValue: function getItemInputValue(_ref) {\n var state = _ref.state;\n return state.query;\n },\n getItemUrl: function getItemUrl() {\n return undefined;\n },\n onSelect: function onSelect(_ref2) {\n var setIsOpen = _ref2.setIsOpen;\n setIsOpen(false);\n },\n onActive: noop\n }, source);\n\n return Promise.resolve(normalizedSource);\n }));\n });\n}","// We don't have access to the autocomplete source when we call `onKeyDown`\n// or `onClick` because those are native browser events.\n// However, we can get the source from the suggestion index.\nfunction getCollectionFromActiveItemId(state) {\n // Given 3 sources with respectively 1, 2 and 3 suggestions: [1, 2, 3]\n // We want to get the accumulated counts:\n // [1, 1 + 2, 1 + 2 + 3] = [1, 3, 3 + 3] = [1, 3, 6]\n var accumulatedCollectionsCount = state.collections.map(function (collections) {\n return collections.items.length;\n }).reduce(function (acc, collectionsCount, index) {\n var previousValue = acc[index - 1] || 0;\n var nextValue = previousValue + collectionsCount;\n acc.push(nextValue);\n return acc;\n }, []); // Based on the accumulated counts, we can infer the index of the suggestion.\n\n var collectionIndex = accumulatedCollectionsCount.reduce(function (acc, current) {\n if (current <= state.activeItemId) {\n return acc + 1;\n }\n\n return acc;\n }, 0);\n return state.collections[collectionIndex];\n}\n/**\n * Gets the highlighted index relative to a suggestion object (not the absolute\n * highlighted index).\n *\n * Example:\n * [['a', 'b'], ['c', 'd', 'e'], ['f']]\n * ↑\n * (absolute: 3, relative: 1)\n */\n\n\nfunction getRelativeActiveItemId(_ref) {\n var state = _ref.state,\n collection = _ref.collection;\n var isOffsetFound = false;\n var counter = 0;\n var previousItemsOffset = 0;\n\n while (isOffsetFound === false) {\n var currentCollection = state.collections[counter];\n\n if (currentCollection === collection) {\n isOffsetFound = true;\n break;\n }\n\n previousItemsOffset += currentCollection.items.length;\n counter++;\n }\n\n return state.activeItemId - previousItemsOffset;\n}\n\nexport function getActiveItem(state) {\n var collection = getCollectionFromActiveItemId(state);\n\n if (!collection) {\n return null;\n }\n\n var item = collection.items[getRelativeActiveItemId({\n state: state,\n collection: collection\n })];\n var source = collection.source;\n var itemInputValue = source.getItemInputValue({\n item: item,\n state: state\n });\n var itemUrl = source.getItemUrl({\n item: item,\n state: state\n });\n return {\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n source: source\n };\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nexport function mapToAlgoliaResponse(rawResults) {\n var results = rawResults.map(function (result) {\n var _hits;\n\n return _objectSpread(_objectSpread({}, result), {}, {\n hits: (_hits = result.hits) === null || _hits === void 0 ? void 0 : _hits.map(function (hit) {\n // Bring support for the Insights plugin.\n return _objectSpread(_objectSpread({}, hit), {}, {\n __autocomplete_indexName: result.index,\n __autocomplete_queryID: result.queryID\n });\n })\n });\n });\n return {\n results: results,\n hits: results.map(function (result) {\n return result.hits;\n }).filter(Boolean),\n facetHits: results.map(function (result) {\n var _facetHits;\n\n return (_facetHits = result.facetHits) === null || _facetHits === void 0 ? void 0 : _facetHits.map(function (facetHit) {\n // Bring support for the highlighting components.\n return {\n label: facetHit.value,\n count: facetHit.count,\n _highlightResult: {\n label: {\n value: facetHit.highlighted\n }\n }\n };\n });\n }).filter(Boolean)\n };\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { createCancelablePromiseList } from './utils';\nexport function createStore(reducer, props, onStoreStateChange) {\n var state = props.initialState;\n return {\n getState: function getState() {\n return state;\n },\n dispatch: function dispatch(action, payload) {\n var prevState = _objectSpread({}, state);\n\n state = reducer(state, {\n type: action,\n props: props,\n payload: payload\n });\n onStoreStateChange({\n state: state,\n prevState: prevState\n });\n },\n pendingRequests: createCancelablePromiseList()\n };\n}","export function createCancelablePromiseList() {\n var list = [];\n return {\n add: function add(cancelablePromise) {\n list.push(cancelablePromise);\n return cancelablePromise.finally(function () {\n list = list.filter(function (item) {\n return item !== cancelablePromise;\n });\n });\n },\n cancelAll: function cancelAll() {\n list.forEach(function (promise) {\n return promise.cancel();\n });\n },\n isEmpty: function isEmpty() {\n return list.length === 0;\n }\n };\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { flatten } from '@algolia/autocomplete-shared';\nexport function getAutocompleteSetters(_ref) {\n var store = _ref.store;\n\n var setActiveItemId = function setActiveItemId(value) {\n store.dispatch('setActiveItemId', value);\n };\n\n var setQuery = function setQuery(value) {\n store.dispatch('setQuery', value);\n };\n\n var setCollections = function setCollections(rawValue) {\n var baseItemId = 0;\n var value = rawValue.map(function (collection) {\n return _objectSpread(_objectSpread({}, collection), {}, {\n // We flatten the stored items to support calling `getAlgoliaResults`\n // from the source itself.\n items: flatten(collection.items).map(function (item) {\n return _objectSpread(_objectSpread({}, item), {}, {\n __autocomplete_id: baseItemId++\n });\n })\n });\n });\n store.dispatch('setCollections', value);\n };\n\n var setIsOpen = function setIsOpen(value) {\n store.dispatch('setIsOpen', value);\n };\n\n var setStatus = function setStatus(value) {\n store.dispatch('setStatus', value);\n };\n\n var setContext = function setContext(value) {\n store.dispatch('setContext', value);\n };\n\n return {\n setActiveItemId: setActiveItemId,\n setQuery: setQuery,\n setCollections: setCollections,\n setIsOpen: setIsOpen,\n setStatus: setStatus,\n setContext: setContext\n };\n}","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { getItemsCount, generateAutocompleteId, flatten } from '@algolia/autocomplete-shared';\nimport { getNormalizedSources } from './utils';\nexport function getDefaultProps(props, pluginSubscribers) {\n var _props$id;\n\n /* eslint-disable no-restricted-globals */\n var environment = typeof window !== 'undefined' ? window : {};\n /* eslint-enable no-restricted-globals */\n\n var plugins = props.plugins || [];\n return _objectSpread(_objectSpread({\n debug: false,\n openOnFocus: false,\n placeholder: '',\n autoFocus: false,\n defaultActiveItemId: null,\n stallThreshold: 300,\n environment: environment,\n shouldPanelOpen: function shouldPanelOpen(_ref) {\n var state = _ref.state;\n return getItemsCount(state) > 0;\n },\n reshape: function reshape(_ref2) {\n var sources = _ref2.sources;\n return sources;\n }\n }, props), {}, {\n // Since `generateAutocompleteId` triggers a side effect (it increments\n // an internal counter), we don't want to execute it if unnecessary.\n id: (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : generateAutocompleteId(),\n plugins: plugins,\n // The following props need to be deeply defaulted.\n initialState: _objectSpread({\n activeItemId: null,\n query: '',\n completion: null,\n collections: [],\n isOpen: false,\n status: 'idle',\n context: {}\n }, props.initialState),\n onStateChange: function onStateChange(params) {\n var _props$onStateChange;\n\n (_props$onStateChange = props.onStateChange) === null || _props$onStateChange === void 0 ? void 0 : _props$onStateChange.call(props, params);\n plugins.forEach(function (x) {\n var _x$onStateChange;\n\n return (_x$onStateChange = x.onStateChange) === null || _x$onStateChange === void 0 ? void 0 : _x$onStateChange.call(x, params);\n });\n },\n onSubmit: function onSubmit(params) {\n var _props$onSubmit;\n\n (_props$onSubmit = props.onSubmit) === null || _props$onSubmit === void 0 ? void 0 : _props$onSubmit.call(props, params);\n plugins.forEach(function (x) {\n var _x$onSubmit;\n\n return (_x$onSubmit = x.onSubmit) === null || _x$onSubmit === void 0 ? void 0 : _x$onSubmit.call(x, params);\n });\n },\n onReset: function onReset(params) {\n var _props$onReset;\n\n (_props$onReset = props.onReset) === null || _props$onReset === void 0 ? void 0 : _props$onReset.call(props, params);\n plugins.forEach(function (x) {\n var _x$onReset;\n\n return (_x$onReset = x.onReset) === null || _x$onReset === void 0 ? void 0 : _x$onReset.call(x, params);\n });\n },\n getSources: function getSources(params) {\n return Promise.all([].concat(_toConsumableArray(plugins.map(function (plugin) {\n return plugin.getSources;\n })), [props.getSources]).filter(Boolean).map(function (getSources) {\n return getNormalizedSources(getSources, params);\n })).then(function (nested) {\n return flatten(nested);\n }).then(function (sources) {\n return sources.map(function (source) {\n return _objectSpread(_objectSpread({}, source), {}, {\n onSelect: function onSelect(params) {\n source.onSelect(params);\n pluginSubscribers.forEach(function (x) {\n var _x$onSelect;\n\n return (_x$onSelect = x.onSelect) === null || _x$onSelect === void 0 ? void 0 : _x$onSelect.call(x, params);\n });\n },\n onActive: function onActive(params) {\n source.onActive(params);\n pluginSubscribers.forEach(function (x) {\n var _x$onActive;\n\n return (_x$onActive = x.onActive) === null || _x$onActive === void 0 ? void 0 : _x$onActive.call(x, params);\n });\n }\n });\n });\n });\n },\n navigator: _objectSpread({\n navigate: function navigate(_ref3) {\n var itemUrl = _ref3.itemUrl;\n environment.location.assign(itemUrl);\n },\n navigateNewTab: function navigateNewTab(_ref4) {\n var itemUrl = _ref4.itemUrl;\n var windowReference = environment.open(itemUrl, '_blank', 'noopener');\n windowReference === null || windowReference === void 0 ? void 0 : windowReference.focus();\n },\n navigateNewWindow: function navigateNewWindow(_ref5) {\n var itemUrl = _ref5.itemUrl;\n environment.open(itemUrl, '_blank', 'noopener');\n }\n }, props.navigator)\n });\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { flatten } from '@algolia/autocomplete-shared';\nexport function reshape(_ref) {\n var collections = _ref.collections,\n props = _ref.props,\n state = _ref.state;\n // Sources are grouped by `sourceId` to conveniently pick them via destructuring.\n // Example: `const { recentSearchesPlugin } = sourcesBySourceId`\n var sourcesBySourceId = collections.reduce(function (acc, collection) {\n return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, collection.source.sourceId, _objectSpread(_objectSpread({}, collection.source), {}, {\n getItems: function getItems() {\n // We provide the resolved items from the collection to the `reshape` prop.\n return flatten(collection.items);\n }\n })));\n }, {});\n var reshapeSources = props.reshape({\n sources: Object.values(sourcesBySourceId),\n sourcesBySourceId: sourcesBySourceId,\n state: state\n }); // We reconstruct the collections with the items modified by the `reshape` prop.\n\n return flatten(reshapeSources).filter(Boolean).map(function (source) {\n return {\n source: source,\n items: source.getItems()\n };\n });\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { decycle, flatten, invariant } from '@algolia/autocomplete-shared';\nimport { mapToAlgoliaResponse } from './utils';\n\nfunction isDescription(item) {\n return Boolean(item.execute);\n}\n\nfunction isRequesterDescription(description) {\n return Boolean(description === null || description === void 0 ? void 0 : description.execute);\n}\n\nexport function preResolve(itemsOrDescription, sourceId) {\n if (isRequesterDescription(itemsOrDescription)) {\n return _objectSpread(_objectSpread({}, itemsOrDescription), {}, {\n requests: itemsOrDescription.queries.map(function (query) {\n return {\n query: query,\n sourceId: sourceId,\n transformResponse: itemsOrDescription.transformResponse\n };\n })\n });\n }\n\n return {\n items: itemsOrDescription,\n sourceId: sourceId\n };\n}\nexport function resolve(items) {\n var packed = items.reduce(function (acc, current) {\n if (!isDescription(current)) {\n acc.push(current);\n return acc;\n }\n\n var searchClient = current.searchClient,\n execute = current.execute,\n requests = current.requests;\n var container = acc.find(function (item) {\n return isDescription(current) && isDescription(item) && item.searchClient === searchClient && item.execute === execute;\n });\n\n if (container) {\n var _container$items;\n\n (_container$items = container.items).push.apply(_container$items, _toConsumableArray(requests));\n } else {\n var request = {\n execute: execute,\n items: requests,\n searchClient: searchClient\n };\n acc.push(request);\n }\n\n return acc;\n }, []);\n var values = packed.map(function (maybeDescription) {\n if (!isDescription(maybeDescription)) {\n return Promise.resolve(maybeDescription);\n }\n\n var _ref = maybeDescription,\n execute = _ref.execute,\n items = _ref.items,\n searchClient = _ref.searchClient;\n return execute({\n searchClient: searchClient,\n requests: items\n });\n });\n return Promise.all(values).then(function (responses) {\n return flatten(responses);\n });\n}\nexport function postResolve(responses, sources) {\n return sources.map(function (source) {\n var matches = responses.filter(function (response) {\n return response.sourceId === source.sourceId;\n });\n var results = matches.map(function (_ref2) {\n var items = _ref2.items;\n return items;\n });\n var transform = matches[0].transformResponse;\n var items = transform ? transform(mapToAlgoliaResponse(results)) : results;\n invariant(Array.isArray(items), function () {\n return \"The `getItems` function from source \\\"\".concat(source.sourceId, \"\\\" must return an array of items but returned type \").concat(JSON.stringify(_typeof(items)), \":\\n\\n\").concat(JSON.stringify(decycle(items), null, 2), \".\\n\\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems\");\n });\n invariant(items.every(Boolean), \"The `getItems` function from source \\\"\".concat(source.sourceId, \"\\\" must return an array of items but returned \").concat(JSON.stringify(undefined), \".\\n\\nDid you forget to return items?\\n\\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems\"));\n return {\n source: source,\n items: items\n };\n });\n}","var _excluded = [\"event\", \"nextState\", \"props\", \"query\", \"refresh\", \"store\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { reshape } from './reshape';\nimport { preResolve, resolve, postResolve } from './resolve';\nimport { cancelable, createConcurrentSafePromise, getActiveItem } from './utils';\nvar lastStalledId = null;\nvar runConcurrentSafePromise = createConcurrentSafePromise();\nexport function onInput(_ref) {\n var event = _ref.event,\n _ref$nextState = _ref.nextState,\n nextState = _ref$nextState === void 0 ? {} : _ref$nextState,\n props = _ref.props,\n query = _ref.query,\n refresh = _ref.refresh,\n store = _ref.store,\n setters = _objectWithoutProperties(_ref, _excluded);\n\n if (lastStalledId) {\n props.environment.clearTimeout(lastStalledId);\n }\n\n var setCollections = setters.setCollections,\n setIsOpen = setters.setIsOpen,\n setQuery = setters.setQuery,\n setActiveItemId = setters.setActiveItemId,\n setStatus = setters.setStatus;\n setQuery(query);\n setActiveItemId(props.defaultActiveItemId);\n\n if (!query && props.openOnFocus === false) {\n var _nextState$isOpen;\n\n var collections = store.getState().collections.map(function (collection) {\n return _objectSpread(_objectSpread({}, collection), {}, {\n items: []\n });\n });\n setStatus('idle');\n setCollections(collections);\n setIsOpen((_nextState$isOpen = nextState.isOpen) !== null && _nextState$isOpen !== void 0 ? _nextState$isOpen : props.shouldPanelOpen({\n state: store.getState()\n })); // We make sure to update the latest resolved value of the tracked\n // promises to keep late resolving promises from \"cancelling\" the state\n // updates performed in this code path.\n // We chain with a void promise to respect `onInput`'s expected return type.\n\n var _request = cancelable(runConcurrentSafePromise(collections).then(function () {\n return Promise.resolve();\n }));\n\n return store.pendingRequests.add(_request);\n }\n\n setStatus('loading');\n lastStalledId = props.environment.setTimeout(function () {\n setStatus('stalled');\n }, props.stallThreshold); // We track the entire promise chain triggered by `onInput` before mutating\n // the Autocomplete state to make sure that any state manipulation is based on\n // fresh data regardless of when promises individually resolve.\n // We don't track nested promises and only rely on the full chain resolution,\n // meaning we should only ever manipulate the state once this concurrent-safe\n // promise is resolved.\n\n var request = cancelable(runConcurrentSafePromise(props.getSources(_objectSpread({\n query: query,\n refresh: refresh,\n state: store.getState()\n }, setters)).then(function (sources) {\n return Promise.all(sources.map(function (source) {\n return Promise.resolve(source.getItems(_objectSpread({\n query: query,\n refresh: refresh,\n state: store.getState()\n }, setters))).then(function (itemsOrDescription) {\n return preResolve(itemsOrDescription, source.sourceId);\n });\n })).then(resolve).then(function (responses) {\n return postResolve(responses, sources);\n }).then(function (collections) {\n return reshape({\n collections: collections,\n props: props,\n state: store.getState()\n });\n });\n }))).then(function (collections) {\n var _nextState$isOpen2;\n\n // Parameters passed to `onInput` could be stale when the following code\n // executes, because `onInput` calls may not resolve in order.\n // If it becomes a problem we'll need to save the last passed parameters.\n // See: https://codesandbox.io/s/agitated-cookies-y290z\n setStatus('idle');\n setCollections(collections);\n var isPanelOpen = props.shouldPanelOpen({\n state: store.getState()\n });\n setIsOpen((_nextState$isOpen2 = nextState.isOpen) !== null && _nextState$isOpen2 !== void 0 ? _nextState$isOpen2 : props.openOnFocus && !query && isPanelOpen || isPanelOpen);\n var highlightedItem = getActiveItem(store.getState());\n\n if (store.getState().activeItemId !== null && highlightedItem) {\n var item = highlightedItem.item,\n itemInputValue = highlightedItem.itemInputValue,\n itemUrl = highlightedItem.itemUrl,\n source = highlightedItem.source;\n source.onActive(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n }\n }).finally(function () {\n setStatus('idle');\n\n if (lastStalledId) {\n props.environment.clearTimeout(lastStalledId);\n }\n });\n return store.pendingRequests.add(request);\n}","/**\n * Creates a runner that executes promises in a concurrent-safe way.\n *\n * This is useful to prevent older promises to resolve after a newer promise,\n * otherwise resulting in stale resolved values.\n */\nexport function createConcurrentSafePromise() {\n var basePromiseId = -1;\n var latestResolvedId = -1;\n var latestResolvedValue = undefined;\n return function runConcurrentSafePromise(promise) {\n basePromiseId++;\n var currentPromiseId = basePromiseId;\n return Promise.resolve(promise).then(function (x) {\n // The promise might take too long to resolve and get outdated. This would\n // result in resolving stale values.\n // When this happens, we ignore the promise value and return the one\n // coming from the latest resolved value.\n //\n // +----------------------------------+\n // | 100ms |\n // | run(1) +---> R1 |\n // | 300ms |\n // | run(2) +-------------> R2 (SKIP) |\n // | 200ms |\n // | run(3) +--------> R3 |\n // +----------------------------------+\n if (latestResolvedValue && currentPromiseId < latestResolvedId) {\n return latestResolvedValue;\n }\n\n latestResolvedId = currentPromiseId;\n latestResolvedValue = x;\n return x;\n });\n };\n}","var _excluded = [\"event\", \"props\", \"refresh\", \"store\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { onInput } from './onInput';\nimport { getActiveItem } from './utils';\nexport function onKeyDown(_ref) {\n var event = _ref.event,\n props = _ref.props,\n refresh = _ref.refresh,\n store = _ref.store,\n setters = _objectWithoutProperties(_ref, _excluded);\n\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n // eslint-disable-next-line no-inner-declarations\n var triggerScrollIntoView = function triggerScrollIntoView() {\n var nodeItem = props.environment.document.getElementById(\"\".concat(props.id, \"-item-\").concat(store.getState().activeItemId));\n\n if (nodeItem) {\n if (nodeItem.scrollIntoViewIfNeeded) {\n nodeItem.scrollIntoViewIfNeeded(false);\n } else {\n nodeItem.scrollIntoView(false);\n }\n }\n }; // eslint-disable-next-line no-inner-declarations\n\n\n var triggerOnActive = function triggerOnActive() {\n var highlightedItem = getActiveItem(store.getState());\n\n if (store.getState().activeItemId !== null && highlightedItem) {\n var item = highlightedItem.item,\n itemInputValue = highlightedItem.itemInputValue,\n itemUrl = highlightedItem.itemUrl,\n source = highlightedItem.source;\n source.onActive(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n }\n }; // Default browser behavior changes the caret placement on ArrowUp and\n // ArrowDown.\n\n\n event.preventDefault(); // When re-opening the panel, we need to split the logic to keep the actions\n // synchronized as `onInput` returns a promise.\n\n if (store.getState().isOpen === false && (props.openOnFocus || Boolean(store.getState().query))) {\n onInput(_objectSpread({\n event: event,\n props: props,\n query: store.getState().query,\n refresh: refresh,\n store: store\n }, setters)).then(function () {\n store.dispatch(event.key, {\n nextActiveItemId: props.defaultActiveItemId\n });\n triggerOnActive(); // Since we rely on the DOM, we need to wait for all the micro tasks to\n // finish (which include re-opening the panel) to make sure all the\n // elements are available.\n\n setTimeout(triggerScrollIntoView, 0);\n });\n } else {\n store.dispatch(event.key, {});\n triggerOnActive();\n triggerScrollIntoView();\n }\n } else if (event.key === 'Escape') {\n // This prevents the default browser behavior on `input[type=\"search\"]`\n // from removing the query right away because we first want to close the\n // panel.\n event.preventDefault();\n store.dispatch(event.key, null); // Hitting the `Escape` key signals the end of a user interaction with the\n // autocomplete. At this point, we should ignore any requests that are still\n // pending and could reopen the panel once they resolve, because that would\n // result in an unsolicited UI behavior.\n\n store.pendingRequests.cancelAll();\n } else if (event.key === 'Enter') {\n // No active item, so we let the browser handle the native `onSubmit` form\n // event.\n if (store.getState().activeItemId === null || store.getState().collections.every(function (collection) {\n return collection.items.length === 0;\n })) {\n return;\n } // This prevents the `onSubmit` event to be sent because an item is\n // highlighted.\n\n\n event.preventDefault();\n\n var _ref2 = getActiveItem(store.getState()),\n item = _ref2.item,\n itemInputValue = _ref2.itemInputValue,\n itemUrl = _ref2.itemUrl,\n source = _ref2.source;\n\n if (event.metaKey || event.ctrlKey) {\n if (itemUrl !== undefined) {\n source.onSelect(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n props.navigator.navigateNewTab({\n itemUrl: itemUrl,\n item: item,\n state: store.getState()\n });\n }\n } else if (event.shiftKey) {\n if (itemUrl !== undefined) {\n source.onSelect(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n props.navigator.navigateNewWindow({\n itemUrl: itemUrl,\n item: item,\n state: store.getState()\n });\n }\n } else if (event.altKey) {// Keep native browser behavior\n } else {\n if (itemUrl !== undefined) {\n source.onSelect(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n props.navigator.navigate({\n itemUrl: itemUrl,\n item: item,\n state: store.getState()\n });\n return;\n }\n\n onInput(_objectSpread({\n event: event,\n nextState: {\n isOpen: false\n },\n props: props,\n query: itemInputValue,\n refresh: refresh,\n store: store\n }, setters)).then(function () {\n source.onSelect(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n });\n }\n }\n}","var _excluded = [\"props\", \"refresh\", \"store\"],\n _excluded2 = [\"inputElement\", \"formElement\", \"panelElement\"],\n _excluded3 = [\"inputElement\"],\n _excluded4 = [\"inputElement\", \"maxLength\"],\n _excluded5 = [\"item\", \"source\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { onInput } from './onInput';\nimport { onKeyDown as _onKeyDown } from './onKeyDown';\nimport { getActiveItem, isOrContainsNode } from './utils';\nexport function getPropGetters(_ref) {\n var props = _ref.props,\n refresh = _ref.refresh,\n store = _ref.store,\n setters = _objectWithoutProperties(_ref, _excluded);\n\n var getEnvironmentProps = function getEnvironmentProps(providedProps) {\n var inputElement = providedProps.inputElement,\n formElement = providedProps.formElement,\n panelElement = providedProps.panelElement,\n rest = _objectWithoutProperties(providedProps, _excluded2);\n\n return _objectSpread({\n // On touch devices, we do not rely on the native `blur` event of the\n // input to close the panel, but rather on a custom `touchstart` event\n // outside of the autocomplete elements.\n // This ensures a working experience on mobile because we blur the input\n // on touch devices when the user starts scrolling (`touchmove`).\n // @TODO: support cases where there are multiple Autocomplete instances.\n // Right now, a second instance makes this computation return false.\n onTouchStart: function onTouchStart(event) {\n // The `onTouchStart` event shouldn't trigger the `blur` handler when\n // it's not an interaction with Autocomplete. We detect it with the\n // following heuristics:\n // - the panel is closed AND there are no pending requests\n // (no interaction with the autocomplete, no future state updates)\n // - OR the touched target is the input element (should open the panel)\n var isAutocompleteInteraction = store.getState().isOpen || !store.pendingRequests.isEmpty();\n\n if (!isAutocompleteInteraction || event.target === inputElement) {\n return;\n }\n\n var isTargetWithinAutocomplete = [formElement, panelElement].some(function (contextNode) {\n return isOrContainsNode(contextNode, event.target);\n });\n\n if (isTargetWithinAutocomplete === false) {\n store.dispatch('blur', null); // If requests are still pending when the user closes the panel, they\n // could reopen the panel once they resolve.\n // We want to prevent any subsequent query from reopening the panel\n // because it would result in an unsolicited UI behavior.\n\n if (!props.debug) {\n store.pendingRequests.cancelAll();\n }\n }\n },\n // When scrolling on touch devices (mobiles, tablets, etc.), we want to\n // mimic the native platform behavior where the input is blurred to\n // hide the virtual keyboard. This gives more vertical space to\n // discover all the suggestions showing up in the panel.\n onTouchMove: function onTouchMove(event) {\n if (store.getState().isOpen === false || inputElement !== props.environment.document.activeElement || event.target === inputElement) {\n return;\n }\n\n inputElement.blur();\n }\n }, rest);\n };\n\n var getRootProps = function getRootProps(rest) {\n return _objectSpread({\n role: 'combobox',\n 'aria-expanded': store.getState().isOpen,\n 'aria-haspopup': 'listbox',\n 'aria-owns': store.getState().isOpen ? \"\".concat(props.id, \"-list\") : undefined,\n 'aria-labelledby': \"\".concat(props.id, \"-label\")\n }, rest);\n };\n\n var getFormProps = function getFormProps(providedProps) {\n var inputElement = providedProps.inputElement,\n rest = _objectWithoutProperties(providedProps, _excluded3);\n\n return _objectSpread({\n action: '',\n noValidate: true,\n role: 'search',\n onSubmit: function onSubmit(event) {\n var _providedProps$inputE;\n\n event.preventDefault();\n props.onSubmit(_objectSpread({\n event: event,\n refresh: refresh,\n state: store.getState()\n }, setters));\n store.dispatch('submit', null);\n (_providedProps$inputE = providedProps.inputElement) === null || _providedProps$inputE === void 0 ? void 0 : _providedProps$inputE.blur();\n },\n onReset: function onReset(event) {\n var _providedProps$inputE2;\n\n event.preventDefault();\n props.onReset(_objectSpread({\n event: event,\n refresh: refresh,\n state: store.getState()\n }, setters));\n store.dispatch('reset', null);\n (_providedProps$inputE2 = providedProps.inputElement) === null || _providedProps$inputE2 === void 0 ? void 0 : _providedProps$inputE2.focus();\n }\n }, rest);\n };\n\n var getInputProps = function getInputProps(providedProps) {\n function onFocus(event) {\n // We want to trigger a query when `openOnFocus` is true\n // because the panel should open with the current query.\n if (props.openOnFocus || Boolean(store.getState().query)) {\n onInput(_objectSpread({\n event: event,\n props: props,\n query: store.getState().completion || store.getState().query,\n refresh: refresh,\n store: store\n }, setters));\n }\n\n store.dispatch('focus', null);\n }\n\n var isTouchDevice = ('ontouchstart' in props.environment);\n\n var _ref2 = providedProps || {},\n inputElement = _ref2.inputElement,\n _ref2$maxLength = _ref2.maxLength,\n maxLength = _ref2$maxLength === void 0 ? 512 : _ref2$maxLength,\n rest = _objectWithoutProperties(_ref2, _excluded4);\n\n var activeItem = getActiveItem(store.getState());\n return _objectSpread({\n 'aria-autocomplete': 'both',\n 'aria-activedescendant': store.getState().isOpen && store.getState().activeItemId !== null ? \"\".concat(props.id, \"-item-\").concat(store.getState().activeItemId) : undefined,\n 'aria-controls': store.getState().isOpen ? \"\".concat(props.id, \"-list\") : undefined,\n 'aria-labelledby': \"\".concat(props.id, \"-label\"),\n value: store.getState().completion || store.getState().query,\n id: \"\".concat(props.id, \"-input\"),\n autoComplete: 'off',\n autoCorrect: 'off',\n autoCapitalize: 'off',\n enterKeyHint: activeItem !== null && activeItem !== void 0 && activeItem.itemUrl ? 'go' : 'search',\n spellCheck: 'false',\n autoFocus: props.autoFocus,\n placeholder: props.placeholder,\n maxLength: maxLength,\n type: 'search',\n onChange: function onChange(event) {\n onInput(_objectSpread({\n event: event,\n props: props,\n query: event.currentTarget.value.slice(0, maxLength),\n refresh: refresh,\n store: store\n }, setters));\n },\n onKeyDown: function onKeyDown(event) {\n _onKeyDown(_objectSpread({\n event: event,\n props: props,\n refresh: refresh,\n store: store\n }, setters));\n },\n onFocus: onFocus,\n onBlur: function onBlur() {\n // We do rely on the `blur` event on touch devices.\n // See explanation in `onTouchStart`.\n if (!isTouchDevice) {\n store.dispatch('blur', null); // If requests are still pending when the user closes the panel, they\n // could reopen the panel once they resolve.\n // We want to prevent any subsequent query from reopening the panel\n // because it would result in an unsolicited UI behavior.\n\n if (!props.debug) {\n store.pendingRequests.cancelAll();\n }\n }\n },\n onClick: function onClick(event) {\n // When the panel is closed and you click on the input while\n // the input is focused, the `onFocus` event is not triggered\n // (default browser behavior).\n // In an autocomplete context, it makes sense to open the panel in this\n // case.\n // We mimic this event by catching the `onClick` event which\n // triggers the `onFocus` for the panel to open.\n if (providedProps.inputElement === props.environment.document.activeElement && !store.getState().isOpen) {\n onFocus(event);\n }\n }\n }, rest);\n };\n\n var getLabelProps = function getLabelProps(rest) {\n return _objectSpread({\n htmlFor: \"\".concat(props.id, \"-input\"),\n id: \"\".concat(props.id, \"-label\")\n }, rest);\n };\n\n var getListProps = function getListProps(rest) {\n return _objectSpread({\n role: 'listbox',\n 'aria-labelledby': \"\".concat(props.id, \"-label\"),\n id: \"\".concat(props.id, \"-list\")\n }, rest);\n };\n\n var getPanelProps = function getPanelProps(rest) {\n return _objectSpread({\n onMouseDown: function onMouseDown(event) {\n // Prevents the `activeElement` from being changed to the panel so\n // that the blur event is not triggered, otherwise it closes the\n // panel.\n event.preventDefault();\n },\n onMouseLeave: function onMouseLeave() {\n store.dispatch('mouseleave', null);\n }\n }, rest);\n };\n\n var getItemProps = function getItemProps(providedProps) {\n var item = providedProps.item,\n source = providedProps.source,\n rest = _objectWithoutProperties(providedProps, _excluded5);\n\n return _objectSpread({\n id: \"\".concat(props.id, \"-item-\").concat(item.__autocomplete_id),\n role: 'option',\n 'aria-selected': store.getState().activeItemId === item.__autocomplete_id,\n onMouseMove: function onMouseMove(event) {\n if (item.__autocomplete_id === store.getState().activeItemId) {\n return;\n }\n\n store.dispatch('mousemove', item.__autocomplete_id);\n var activeItem = getActiveItem(store.getState());\n\n if (store.getState().activeItemId !== null && activeItem) {\n var _item = activeItem.item,\n itemInputValue = activeItem.itemInputValue,\n itemUrl = activeItem.itemUrl,\n _source = activeItem.source;\n\n _source.onActive(_objectSpread({\n event: event,\n item: _item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: _source,\n state: store.getState()\n }, setters));\n }\n },\n onMouseDown: function onMouseDown(event) {\n // Prevents the `activeElement` from being changed to the item so it\n // can remain with the current `activeElement`.\n event.preventDefault();\n },\n onClick: function onClick(event) {\n var itemInputValue = source.getItemInputValue({\n item: item,\n state: store.getState()\n });\n var itemUrl = source.getItemUrl({\n item: item,\n state: store.getState()\n }); // If `getItemUrl` is provided, it means that the suggestion\n // is a link, not plain text that aims at updating the query.\n // We can therefore skip the state change because it will update\n // the `activeItemId`, resulting in a UI flash, especially\n // noticeable on mobile.\n\n var runPreCommand = itemUrl ? Promise.resolve() : onInput(_objectSpread({\n event: event,\n nextState: {\n isOpen: false\n },\n props: props,\n query: itemInputValue,\n refresh: refresh,\n store: store\n }, setters));\n runPreCommand.then(function () {\n source.onSelect(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n });\n }\n }, rest);\n };\n\n return {\n getEnvironmentProps: getEnvironmentProps,\n getRootProps: getRootProps,\n getFormProps: getFormProps,\n getLabelProps: getLabelProps,\n getInputProps: getInputProps,\n getPanelProps: getPanelProps,\n getListProps: getListProps,\n getItemProps: getItemProps\n };\n}","export function isOrContainsNode(parent, child) {\n return parent === child || parent.contains(child);\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { userAgents } from '@algolia/autocomplete-shared';\nexport function getMetadata(_ref) {\n var _, _options$__autocomple, _options$__autocomple2, _options$__autocomple3;\n\n var plugins = _ref.plugins,\n options = _ref.options;\n var optionsKey = (_ = (((_options$__autocomple = options.__autocomplete_metadata) === null || _options$__autocomple === void 0 ? void 0 : _options$__autocomple.userAgents) || [])[0]) === null || _ === void 0 ? void 0 : _.segment;\n var extraOptions = optionsKey ? _defineProperty({}, optionsKey, Object.keys(((_options$__autocomple2 = options.__autocomplete_metadata) === null || _options$__autocomple2 === void 0 ? void 0 : _options$__autocomple2.options) || {})) : {};\n return {\n plugins: plugins.map(function (plugin) {\n return {\n name: plugin.name,\n options: Object.keys(plugin.__autocomplete_pluginOptions || [])\n };\n }),\n options: _objectSpread({\n 'autocomplete-core': Object.keys(options)\n }, extraOptions),\n ua: userAgents.concat(((_options$__autocomple3 = options.__autocomplete_metadata) === null || _options$__autocomple3 === void 0 ? void 0 : _options$__autocomple3.userAgents) || [])\n };\n}\nexport function injectMetadata(_ref3) {\n var _environment$navigato;\n\n var metadata = _ref3.metadata,\n environment = _ref3.environment;\n var isMetadataEnabled = (_environment$navigato = environment.navigator) === null || _environment$navigato === void 0 ? void 0 : _environment$navigato.userAgent.includes('Algolia Crawler');\n\n if (isMetadataEnabled) {\n var metadataContainer = environment.document.createElement('meta');\n var headRef = environment.document.querySelector('head');\n metadataContainer.name = 'algolia:metadata';\n setTimeout(function () {\n metadataContainer.content = JSON.stringify(metadata);\n headRef.appendChild(metadataContainer);\n }, 0);\n }\n}","import { getActiveItem } from './utils';\nexport function getCompletion(_ref) {\n var _getActiveItem;\n\n var state = _ref.state;\n\n if (state.isOpen === false || state.activeItemId === null) {\n return null;\n }\n\n return ((_getActiveItem = getActiveItem(state)) === null || _getActiveItem === void 0 ? void 0 : _getActiveItem.itemInputValue) || null;\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { getItemsCount, invariant } from '@algolia/autocomplete-shared';\nimport { getCompletion } from './getCompletion';\nimport { getNextActiveItemId } from './utils';\nexport var stateReducer = function stateReducer(state, action) {\n switch (action.type) {\n case 'setActiveItemId':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: action.payload\n });\n }\n\n case 'setQuery':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n query: action.payload,\n completion: null\n });\n }\n\n case 'setCollections':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n collections: action.payload\n });\n }\n\n case 'setIsOpen':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n isOpen: action.payload\n });\n }\n\n case 'setStatus':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n status: action.payload\n });\n }\n\n case 'setContext':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n context: _objectSpread(_objectSpread({}, state.context), action.payload)\n });\n }\n\n case 'ArrowDown':\n {\n var nextState = _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: action.payload.hasOwnProperty('nextActiveItemId') ? action.payload.nextActiveItemId : getNextActiveItemId(1, state.activeItemId, getItemsCount(state), action.props.defaultActiveItemId)\n });\n\n return _objectSpread(_objectSpread({}, nextState), {}, {\n completion: getCompletion({\n state: nextState\n })\n });\n }\n\n case 'ArrowUp':\n {\n var _nextState = _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: getNextActiveItemId(-1, state.activeItemId, getItemsCount(state), action.props.defaultActiveItemId)\n });\n\n return _objectSpread(_objectSpread({}, _nextState), {}, {\n completion: getCompletion({\n state: _nextState\n })\n });\n }\n\n case 'Escape':\n {\n if (state.isOpen) {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: null,\n isOpen: false,\n completion: null\n });\n }\n\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: null,\n query: '',\n status: 'idle',\n collections: []\n });\n }\n\n case 'submit':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: null,\n isOpen: false,\n status: 'idle'\n });\n }\n\n case 'reset':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: // Since we open the panel on reset when openOnFocus=true\n // we need to restore the highlighted index to the defaultActiveItemId. (DocSearch use-case)\n // Since we close the panel when openOnFocus=false\n // we lose track of the highlighted index. (Query-suggestions use-case)\n action.props.openOnFocus === true ? action.props.defaultActiveItemId : null,\n status: 'idle',\n query: ''\n });\n }\n\n case 'focus':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: action.props.defaultActiveItemId,\n isOpen: (action.props.openOnFocus || Boolean(state.query)) && action.props.shouldPanelOpen({\n state: state\n })\n });\n }\n\n case 'blur':\n {\n if (action.props.debug) {\n return state;\n }\n\n return _objectSpread(_objectSpread({}, state), {}, {\n isOpen: false,\n activeItemId: null\n });\n }\n\n case 'mousemove':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: action.payload\n });\n }\n\n case 'mouseleave':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: action.props.defaultActiveItemId\n });\n }\n\n default:\n invariant(false, \"The reducer action \".concat(JSON.stringify(action.type), \" is not supported.\"));\n return state;\n }\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { checkOptions } from './checkOptions';\nimport { createStore } from './createStore';\nimport { getAutocompleteSetters } from './getAutocompleteSetters';\nimport { getDefaultProps } from './getDefaultProps';\nimport { getPropGetters } from './getPropGetters';\nimport { getMetadata, injectMetadata } from './metadata';\nimport { onInput } from './onInput';\nimport { stateReducer } from './stateReducer';\nexport function createAutocomplete(options) {\n checkOptions(options);\n var subscribers = [];\n var props = getDefaultProps(options, subscribers);\n var store = createStore(stateReducer, props, onStoreStateChange);\n var setters = getAutocompleteSetters({\n store: store\n });\n var propGetters = getPropGetters(_objectSpread({\n props: props,\n refresh: refresh,\n store: store\n }, setters));\n\n function onStoreStateChange(_ref) {\n var prevState = _ref.prevState,\n state = _ref.state;\n props.onStateChange(_objectSpread({\n prevState: prevState,\n state: state,\n refresh: refresh\n }, setters));\n }\n\n function refresh() {\n return onInput(_objectSpread({\n event: new Event('input'),\n nextState: {\n isOpen: store.getState().isOpen\n },\n props: props,\n query: store.getState().query,\n refresh: refresh,\n store: store\n }, setters));\n }\n\n props.plugins.forEach(function (plugin) {\n var _plugin$subscribe;\n\n return (_plugin$subscribe = plugin.subscribe) === null || _plugin$subscribe === void 0 ? void 0 : _plugin$subscribe.call(plugin, _objectSpread(_objectSpread({}, setters), {}, {\n refresh: refresh,\n onSelect: function onSelect(fn) {\n subscribers.push({\n onSelect: fn\n });\n },\n onActive: function onActive(fn) {\n subscribers.push({\n onActive: fn\n });\n }\n }));\n });\n injectMetadata({\n metadata: getMetadata({\n plugins: props.plugins,\n options: options\n }),\n environment: props.environment\n });\n return _objectSpread(_objectSpread({\n refresh: refresh\n }, propGetters), setters);\n}","import React from 'react';\nexport function AlgoliaLogo(_ref) {\n var _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations;\n var _translations$searchB = translations.searchByText,\n searchByText = _translations$searchB === void 0 ? 'Search by' : _translations$searchB;\n return /*#__PURE__*/React.createElement(\"a\", {\n href: \"https://www.algolia.com/ref/docsearch/?utm_source=\".concat(window.location.hostname, \"&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch\"),\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Label\"\n }, searchByText), /*#__PURE__*/React.createElement(\"svg\", {\n width: \"77\",\n height: \"19\",\n \"aria-label\": \"Algolia\",\n role: \"img\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M2.5067 0h14.0245c1.384.001 2.5058 1.1205 2.5068 2.5017V16.5c-.0014 1.3808-1.1232 2.4995-2.5068 2.5H2.5067C1.1232 18.9995.0014 17.8808 0 16.5V2.4958A2.495 2.495 0 01.735.7294 2.505 2.505 0 012.5068 0zM37.95 15.0695c-3.7068.0168-3.7068-2.986-3.7068-3.4634L34.2372.3576 36.498 0v11.1794c0 .2715 0 1.9889 1.452 1.994v1.8961zm-9.1666-1.8388c.694 0 1.2086-.0397 1.5678-.1088v-2.2934a5.3639 5.3639 0 00-1.3303-.1679 4.8283 4.8283 0 00-.758.0582 2.2845 2.2845 0 00-.688.2024c-.2029.0979-.371.2362-.4919.4142-.1268.1788-.185.2826-.185.5533 0 .5297.185.8359.5205 1.0375.3355.2016.7928.3053 1.365.3053v-.0008zm-.1969-8.1817c.7463 0 1.3768.092 1.8856.2767.5088.1838.9195.4428 1.2204.7717.3068.334.5147.7777.6423 1.251.1327.4723.196.991.196 1.5603v5.798c-.5235.1036-1.05.192-1.5787.2649-.7048.1037-1.4976.156-2.3774.156-.5832 0-1.1215-.0582-1.6016-.167a3.385 3.385 0 01-1.2432-.5364 2.6034 2.6034 0 01-.8037-.9565c-.191-.3922-.29-.9447-.29-1.5208 0-.5533.11-.905.3246-1.2863a2.7351 2.7351 0 01.8849-.9329c.376-.242.8029-.415 1.2948-.5187a7.4517 7.4517 0 011.5381-.156 7.1162 7.1162 0 011.6667.2024V8.886c0-.259-.0296-.5061-.093-.7372a1.5847 1.5847 0 00-.3245-.6158 1.5079 1.5079 0 00-.6119-.4158 2.6788 2.6788 0 00-.966-.173c-.5206 0-.9948.0634-1.4283.1384a6.5481 6.5481 0 00-1.065.259l-.2712-1.849c.2831-.0986.7048-.1964 1.2491-.2943a9.2979 9.2979 0 011.752-.1501v.0008zm44.6597 8.1193c.6947 0 1.2086-.0405 1.567-.1097v-2.2942a5.3743 5.3743 0 00-1.3303-.1679c-.2485 0-.503.0177-.7573.0582a2.2853 2.2853 0 00-.688.2024 1.2333 1.2333 0 00-.4918.4142c-.1268.1788-.1843.2826-.1843.5533 0 .5297.1843.8359.5198 1.0375.3414.2066.7927.3053 1.365.3053v.0009zm-.191-8.1767c.7463 0 1.3768.0912 1.8856.2759.5087.1847.9195.4436 1.2204.7717.3.329.5147.7786.6414 1.251a5.7248 5.7248 0 01.197 1.562v5.7972c-.3466.0742-.874.1602-1.5788.2648-.7049.1038-1.4976.1552-2.3774.1552-.5832 0-1.1215-.0573-1.6016-.167a3.385 3.385 0 01-1.2432-.5356 2.6034 2.6034 0 01-.8038-.9565c-.191-.3922-.2898-.9447-.2898-1.5216 0-.5533.1098-.905.3245-1.2854a2.7373 2.7373 0 01.8849-.9338c.376-.2412.8029-.4141 1.2947-.5178a7.4545 7.4545 0 012.325-.1097c.2781.0287.5672.081.879.156v-.3686a2.7781 2.7781 0 00-.092-.738 1.5788 1.5788 0 00-.3246-.6166 1.5079 1.5079 0 00-.612-.415 2.6797 2.6797 0 00-.966-.1729c-.5205 0-.9947.0633-1.4282.1384a6.5608 6.5608 0 00-1.065.259l-.2712-1.8498c.283-.0979.7048-.1957 1.2491-.2935a9.8597 9.8597 0 011.752-.1494zm-6.79-1.072c-.7576.001-1.373-.6103-1.3759-1.3664 0-.755.6128-1.3664 1.376-1.3664.764 0 1.3775.6115 1.3775 1.3664s-.6195 1.3664-1.3776 1.3664zm1.1393 11.1507h-2.2726V5.3409l2.2734-.3568v10.0845l-.0008.0017zm-3.984 0c-3.707.0168-3.707-2.986-3.707-3.4642L59.7069.3576 61.9685 0v11.1794c0 .2715 0 1.9889 1.452 1.994V15.0703zm-7.3512-4.979c0-.975-.2138-1.7873-.6305-2.3516-.4167-.571-.9998-.852-1.747-.852-.7454 0-1.3302.281-1.7452.852-.4166.5702-.6195 1.3765-.6195 2.3516 0 .9851.208 1.6473.6254 2.2183.4158.576.9998.8587 1.7461.8587.7454 0 1.3303-.2885 1.747-.8595.4158-.5761.6237-1.2315.6237-2.2184v.0009zm2.3132-.006c0 .7609-.1099 1.3361-.3356 1.9654a4.654 4.654 0 01-.9533 1.6076A4.214 4.214 0 0155.613 14.69c-.579.2412-1.4697.3795-1.9143.3795-.4462-.005-1.3303-.1324-1.9033-.3795a4.307 4.307 0 01-1.474-1.0316c-.4115-.4445-.7293-.9801-.9609-1.6076a5.3423 5.3423 0 01-.3465-1.9653c0-.7608.104-1.493.3356-2.1155a4.683 4.683 0 01.9719-1.5958 4.3383 4.3383 0 011.479-1.0257c.5739-.242 1.2043-.3567 1.8864-.3567.6829 0 1.3125.1197 1.8906.3567a4.1245 4.1245 0 011.4816 1.0257 4.7587 4.7587 0 01.9592 1.5958c.2426.6225.3643 1.3547.3643 2.1155zm-17.0198 0c0 .9448.208 1.9932.6238 2.431.4166.4386.955.6579 1.6142.6579.3584 0 .6998-.0523 1.0176-.1502.3186-.0978.5721-.2134.775-.3517V7.0784a8.8706 8.8706 0 00-1.4926-.1906c-.8206-.0236-1.4452.312-1.8847.8468-.4335.5365-.6533 1.476-.6533 2.3516v-.0008zm6.2863 4.4485c0 1.5385-.3938 2.662-1.1866 3.3773-.791.7136-2.0005 1.0712-3.6308 1.0712-.5958 0-1.834-.1156-2.8228-.334l.3643-1.7865c.8282.173 1.9202.2193 2.4932.2193.9077 0 1.555-.1847 1.943-.5533.388-.3686.578-.916.578-1.643v-.3687a6.8289 6.8289 0 01-.8848.3349c-.3634.1096-.786.167-1.261.167-.6246 0-1.1917-.0979-1.7055-.2944a3.5554 3.5554 0 01-1.3244-.8645c-.3642-.3796-.6541-.8579-.8561-1.4289-.2028-.571-.3068-1.59-.3068-2.339 0-.7034.1099-1.5856.3245-2.1735.2198-.5871.5316-1.0949.9542-1.515.4167-.42.9255-.743 1.5213-.98a5.5923 5.5923 0 012.052-.3855c.7353 0 1.4114.092 2.0707.2024.6592.1088 1.2204.2236 1.6776.35v8.945-.0008zM11.5026 4.2418v-.6511c-.0005-.4553-.3704-.8241-.8266-.8241H8.749c-.4561 0-.826.3688-.8265.824v.669c0 .0742.0693.1264.1445.1096a6.0346 6.0346 0 011.6768-.2362 6.125 6.125 0 011.6202.2185.1116.1116 0 00.1386-.1097zm-5.2806.852l-.3296-.3282a.8266.8266 0 00-1.168 0l-.393.3922a.8199.8199 0 000 1.164l.3237.323c.0524.0515.1268.0397.1733-.0117.191-.259.3989-.507.6305-.7372.2374-.2362.48-.4437.7462-.6335.0575-.0354.0634-.1155.017-.1687zm3.5159 2.069v2.818c0 .081.0879.1392.1622.0987l2.5102-1.2964c.0574-.0287.0752-.0987.0464-.1552a3.1237 3.1237 0 00-2.603-1.574c-.0575 0-.115.0456-.115.1097l-.0008-.0009zm.0008 6.789c-2.0933.0005-3.7915-1.6912-3.7947-3.7804C5.9468 8.0821 7.6452 6.39 9.7387 6.391c2.0932-.0005 3.7911 1.6914 3.794 3.7804a3.7783 3.7783 0 01-1.1124 2.675 3.7936 3.7936 0 01-2.6824 1.1054h.0008zM9.738 4.8002c-1.9218 0-3.6975 1.0232-4.6584 2.6841a5.359 5.359 0 000 5.3683c.9609 1.661 2.7366 2.6841 4.6584 2.6841a5.3891 5.3891 0 003.8073-1.5725 5.3675 5.3675 0 001.578-3.7987 5.3574 5.3574 0 00-1.5771-3.797A5.379 5.379 0 009.7387 4.801l-.0008-.0008z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\"\n })));\n}","import React from 'react';\nimport { AlgoliaLogo } from './AlgoliaLogo';\n\nfunction CommandIcon(props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"15\",\n height: \"15\",\n \"aria-label\": props.ariaLabel,\n role: \"img\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n fill: \"none\",\n stroke: \"currentColor\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: \"1.2\"\n }, props.children));\n}\n\nexport function Footer(_ref) {\n var _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations;\n var _translations$selectT = translations.selectText,\n selectText = _translations$selectT === void 0 ? 'to select' : _translations$selectT,\n _translations$selectK = translations.selectKeyAriaLabel,\n selectKeyAriaLabel = _translations$selectK === void 0 ? 'Enter key' : _translations$selectK,\n _translations$navigat = translations.navigateText,\n navigateText = _translations$navigat === void 0 ? 'to navigate' : _translations$navigat,\n _translations$navigat2 = translations.navigateUpKeyAriaLabel,\n navigateUpKeyAriaLabel = _translations$navigat2 === void 0 ? 'Arrow up' : _translations$navigat2,\n _translations$navigat3 = translations.navigateDownKeyAriaLabel,\n navigateDownKeyAriaLabel = _translations$navigat3 === void 0 ? 'Arrow down' : _translations$navigat3,\n _translations$closeTe = translations.closeText,\n closeText = _translations$closeTe === void 0 ? 'to close' : _translations$closeTe,\n _translations$closeKe = translations.closeKeyAriaLabel,\n closeKeyAriaLabel = _translations$closeKe === void 0 ? 'Escape key' : _translations$closeKe,\n _translations$searchB = translations.searchByText,\n searchByText = _translations$searchB === void 0 ? 'Search by' : _translations$searchB;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Logo\"\n }, /*#__PURE__*/React.createElement(AlgoliaLogo, {\n translations: {\n searchByText: searchByText\n }\n })), /*#__PURE__*/React.createElement(\"ul\", {\n className: \"DocSearch-Commands\"\n }, /*#__PURE__*/React.createElement(\"li\", null, /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Commands-Key\"\n }, /*#__PURE__*/React.createElement(CommandIcon, {\n ariaLabel: selectKeyAriaLabel\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 3.53088v3c0 1-1 2-2 2H4M7 11.53088l-3-3 3-3\"\n }))), /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Label\"\n }, selectText)), /*#__PURE__*/React.createElement(\"li\", null, /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Commands-Key\"\n }, /*#__PURE__*/React.createElement(CommandIcon, {\n ariaLabel: navigateDownKeyAriaLabel\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.5 3.5v8M10.5 8.5l-3 3-3-3\"\n }))), /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Commands-Key\"\n }, /*#__PURE__*/React.createElement(CommandIcon, {\n ariaLabel: navigateUpKeyAriaLabel\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.5 11.5v-8M10.5 6.5l-3-3-3 3\"\n }))), /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Label\"\n }, navigateText)), /*#__PURE__*/React.createElement(\"li\", null, /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Commands-Key\"\n }, /*#__PURE__*/React.createElement(CommandIcon, {\n ariaLabel: closeKeyAriaLabel\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.6167 8.936c-.1065.3583-.6883.962-1.4875.962-.7993 0-1.653-.9165-1.653-2.1258v-.5678c0-1.2548.7896-2.1016 1.653-2.1016.8634 0 1.3601.4778 1.4875 1.0724M9 6c-.1352-.4735-.7506-.9219-1.46-.8972-.7092.0246-1.344.57-1.344 1.2166s.4198.8812 1.3445.9805C8.465 7.3992 8.968 7.9337 9 8.5c.032.5663-.454 1.398-1.4595 1.398C6.6593 9.898 6 9 5.963 8.4851m-1.4748.5368c-.2635.5941-.8099.876-1.5443.876s-1.7073-.6248-1.7073-2.204v-.4603c0-1.0416.721-2.131 1.7073-2.131.9864 0 1.6425 1.031 1.5443 2.2492h-2.956\"\n }))), /*#__PURE__*/React.createElement(\"span\", {\n className: \"DocSearch-Label\"\n }, closeText))));\n}","import React from 'react';\nexport function Hit(_ref) {\n var hit = _ref.hit,\n children = _ref.children;\n return /*#__PURE__*/React.createElement(\"a\", {\n href: hit.url\n }, children);\n}","import React from 'react';\nexport function LoadingIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n viewBox: \"0 0 38 38\",\n stroke: \"currentColor\",\n strokeOpacity: \".5\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n fill: \"none\",\n fillRule: \"evenodd\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(1 1)\",\n strokeWidth: \"2\"\n }, /*#__PURE__*/React.createElement(\"circle\", {\n strokeOpacity: \".3\",\n cx: \"18\",\n cy: \"18\",\n r: \"18\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36 18c0-9.94-8.06-18-18-18\"\n }, /*#__PURE__*/React.createElement(\"animateTransform\", {\n attributeName: \"transform\",\n type: \"rotate\",\n from: \"0 18 18\",\n to: \"360 18 18\",\n dur: \"1s\",\n repeatCount: \"indefinite\"\n })))));\n}","import React from 'react';\nexport function RecentIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 20 20\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3.18 6.6a8.23 8.23 0 1112.93 9.94h0a8.23 8.23 0 01-11.63 0\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6.44 7.25H2.55V3.36M10.45 6v5.6M10.45 11.6L13 13\"\n })));\n}","import React from 'react';\nexport function ResetIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 20 20\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z\",\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }));\n}","import React from 'react';\nexport function SelectIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n className: \"DocSearch-Hit-Select-Icon\",\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 20 20\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18 3v4c0 2-2 4-4 4H2\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8 17l-6-6 6-6\"\n })));\n}","import React from 'react';\n\nvar LvlIcon = function LvlIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 20 20\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4\",\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinejoin: \"round\"\n }));\n};\n\nexport function SourceIcon(props) {\n switch (props.type) {\n case 'lvl1':\n return /*#__PURE__*/React.createElement(LvlIcon, null);\n\n case 'content':\n return /*#__PURE__*/React.createElement(ContentIcon, null);\n\n default:\n return /*#__PURE__*/React.createElement(AnchorIcon, null);\n }\n}\n\nfunction AnchorIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 20 20\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z\",\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }));\n}\n\nfunction ContentIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 20 20\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17 5H3h14zm0 5H3h14zm0 5H3h14z\",\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinejoin: \"round\"\n }));\n}","import React from 'react';\nexport function StarIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 20 20\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10 14.2L5 17l1-5.6-4-4 5.5-.7 2.5-5 2.5 5 5.6.8-4 4 .9 5.5z\",\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinejoin: \"round\"\n }));\n}","import React from 'react';\nexport function ErrorIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"40\",\n height: \"40\",\n viewBox: \"0 0 20 20\",\n fill: \"none\",\n fillRule: \"evenodd\",\n stroke: \"currentColor\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19 4.8a16 16 0 00-2-1.2m-3.3-1.2A16 16 0 001.1 4.7M16.7 8a12 12 0 00-2.8-1.4M10 6a12 12 0 00-6.7 2M12.3 14.7a4 4 0 00-4.5 0M14.5 11.4A8 8 0 0010 10M3 16L18 2M10 18h0\"\n }));\n}","import React from 'react';\nexport function NoResultsIcon() {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: \"40\",\n height: \"40\",\n viewBox: \"0 0 20 20\",\n fill: \"none\",\n fillRule: \"evenodd\",\n stroke: \"currentColor\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.5 4.8c2 3 1.7 7-1 9.7h0l4.3 4.3-4.3-4.3a7.8 7.8 0 01-9.8 1m-2.2-2.2A7.8 7.8 0 0113.2 2.4M2 18L18 2\"\n }));\n}","import React from 'react';\nimport { ErrorIcon } from './icons';\nexport function ErrorScreen(_ref) {\n var _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations;\n var _translations$titleTe = translations.titleText,\n titleText = _translations$titleTe === void 0 ? 'Unable to fetch results' : _translations$titleTe,\n _translations$helpTex = translations.helpText,\n helpText = _translations$helpTex === void 0 ? 'You might want to check your network connection.' : _translations$helpTex;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-ErrorScreen\"\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Screen-Icon\"\n }, /*#__PURE__*/React.createElement(ErrorIcon, null)), /*#__PURE__*/React.createElement(\"p\", {\n className: \"DocSearch-Title\"\n }, titleText), /*#__PURE__*/React.createElement(\"p\", {\n className: \"DocSearch-Help\"\n }, helpText));\n}","var _excluded = [\"translations\"];\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from 'react';\nimport { NoResultsIcon } from './icons';\nexport function NoResultsScreen(_ref) {\n var _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations,\n props = _objectWithoutProperties(_ref, _excluded);\n\n var _translations$noResul = translations.noResultsText,\n noResultsText = _translations$noResul === void 0 ? 'No results for' : _translations$noResul,\n _translations$suggest = translations.suggestedQueryText,\n suggestedQueryText = _translations$suggest === void 0 ? 'Try searching for' : _translations$suggest,\n _translations$reportM = translations.reportMissingResultsText,\n reportMissingResultsText = _translations$reportM === void 0 ? 'Believe this query should return results?' : _translations$reportM,\n _translations$reportM2 = translations.reportMissingResultsLinkText,\n reportMissingResultsLinkText = _translations$reportM2 === void 0 ? 'Let us know.' : _translations$reportM2;\n var searchSuggestions = props.state.context.searchSuggestions;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-NoResults\"\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Screen-Icon\"\n }, /*#__PURE__*/React.createElement(NoResultsIcon, null)), /*#__PURE__*/React.createElement(\"p\", {\n className: \"DocSearch-Title\"\n }, noResultsText, \" \\\"\", /*#__PURE__*/React.createElement(\"strong\", null, props.state.query), \"\\\"\"), searchSuggestions && searchSuggestions.length > 0 && /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-NoResults-Prefill-List\"\n }, /*#__PURE__*/React.createElement(\"p\", {\n className: \"DocSearch-Help\"\n }, suggestedQueryText, \":\"), /*#__PURE__*/React.createElement(\"ul\", null, searchSuggestions.slice(0, 3).reduce(function (acc, search) {\n return [].concat(_toConsumableArray(acc), [/*#__PURE__*/React.createElement(\"li\", {\n key: search\n }, /*#__PURE__*/React.createElement(\"button\", {\n className: \"DocSearch-Prefill\",\n key: search,\n type: \"button\",\n onClick: function onClick() {\n props.setQuery(search.toLowerCase() + ' ');\n props.refresh();\n props.inputRef.current.focus();\n }\n }, search))]);\n }, []))), props.getMissingResultsUrl && /*#__PURE__*/React.createElement(\"p\", {\n className: \"DocSearch-Help\"\n }, \"\".concat(reportMissingResultsText, \" \"), /*#__PURE__*/React.createElement(\"a\", {\n href: props.getMissingResultsUrl({\n query: props.state.query\n }),\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, reportMissingResultsLinkText)));\n}","var _excluded = [\"hit\", \"attribute\", \"tagName\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { createElement } from 'react';\n\nfunction getPropertyByPath(object, path) {\n var parts = path.split('.');\n return parts.reduce(function (prev, current) {\n if (prev !== null && prev !== void 0 && prev[current]) return prev[current];\n return null;\n }, object);\n}\n\nexport function Snippet(_ref) {\n var hit = _ref.hit,\n attribute = _ref.attribute,\n _ref$tagName = _ref.tagName,\n tagName = _ref$tagName === void 0 ? 'span' : _ref$tagName,\n rest = _objectWithoutProperties(_ref, _excluded);\n\n return createElement(tagName, _objectSpread(_objectSpread({}, rest), {}, {\n dangerouslySetInnerHTML: {\n __html: getPropertyByPath(hit, \"_snippetResult.\".concat(attribute, \".value\")) || getPropertyByPath(hit, attribute)\n }\n }));\n}","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport React from 'react';\nimport { Snippet } from './Snippet';\nexport function Results(props) {\n if (!props.collection || props.collection.items.length === 0) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(\"section\", {\n className: \"DocSearch-Hits\"\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-source\"\n }, props.title), /*#__PURE__*/React.createElement(\"ul\", props.getListProps(), props.collection.items.map(function (item, index) {\n return /*#__PURE__*/React.createElement(Result, _extends({\n key: [props.title, item.objectID].join(':'),\n item: item,\n index: index\n }, props));\n })));\n}\n\nfunction Result(_ref) {\n var item = _ref.item,\n index = _ref.index,\n renderIcon = _ref.renderIcon,\n renderAction = _ref.renderAction,\n getItemProps = _ref.getItemProps,\n onItemClick = _ref.onItemClick,\n collection = _ref.collection,\n hitComponent = _ref.hitComponent;\n\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n isDeleting = _React$useState2[0],\n setIsDeleting = _React$useState2[1];\n\n var _React$useState3 = React.useState(false),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n isFavoriting = _React$useState4[0],\n setIsFavoriting = _React$useState4[1];\n\n var action = React.useRef(null);\n var Hit = hitComponent;\n\n function runDeleteTransition(cb) {\n setIsDeleting(true);\n action.current = cb;\n }\n\n function runFavoriteTransition(cb) {\n setIsFavoriting(true);\n action.current = cb;\n }\n\n return /*#__PURE__*/React.createElement(\"li\", _extends({\n className: ['DocSearch-Hit', item.__docsearch_parent && 'DocSearch-Hit--Child', isDeleting && 'DocSearch-Hit--deleting', isFavoriting && 'DocSearch-Hit--favoriting'].filter(Boolean).join(' '),\n onTransitionEnd: function onTransitionEnd() {\n if (action.current) {\n action.current();\n }\n }\n }, getItemProps({\n item: item,\n source: collection.source,\n onClick: function onClick() {\n onItemClick(item);\n }\n })), /*#__PURE__*/React.createElement(Hit, {\n hit: item\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-Container\"\n }, renderIcon({\n item: item,\n index: index\n }), item.hierarchy[item.type] && item.type === 'lvl1' && /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-content-wrapper\"\n }, /*#__PURE__*/React.createElement(Snippet, {\n className: \"DocSearch-Hit-title\",\n hit: item,\n attribute: \"hierarchy.lvl1\"\n }), item.content && /*#__PURE__*/React.createElement(Snippet, {\n className: \"DocSearch-Hit-path\",\n hit: item,\n attribute: \"content\"\n })), item.hierarchy[item.type] && (item.type === 'lvl2' || item.type === 'lvl3' || item.type === 'lvl4' || item.type === 'lvl5' || item.type === 'lvl6') && /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-content-wrapper\"\n }, /*#__PURE__*/React.createElement(Snippet, {\n className: \"DocSearch-Hit-title\",\n hit: item,\n attribute: \"hierarchy.\".concat(item.type)\n }), /*#__PURE__*/React.createElement(Snippet, {\n className: \"DocSearch-Hit-path\",\n hit: item,\n attribute: \"hierarchy.lvl1\"\n })), item.type === 'content' && /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-content-wrapper\"\n }, /*#__PURE__*/React.createElement(Snippet, {\n className: \"DocSearch-Hit-title\",\n hit: item,\n attribute: \"content\"\n }), /*#__PURE__*/React.createElement(Snippet, {\n className: \"DocSearch-Hit-path\",\n hit: item,\n attribute: \"hierarchy.lvl1\"\n })), renderAction({\n item: item,\n runDeleteTransition: runDeleteTransition,\n runFavoriteTransition: runFavoriteTransition\n }))));\n}","export function groupBy(values, predicate) {\n return values.reduce(function (acc, item) {\n var key = predicate(item);\n\n if (!acc.hasOwnProperty(key)) {\n acc[key] = [];\n } // We limit each section to show 5 hits maximum.\n // This acts as a frontend alternative to `distinct`.\n\n\n if (acc[key].length < 5) {\n acc[key].push(item);\n }\n\n return acc;\n }, {});\n}","export function identity(x) {\n return x;\n}","export function noop() {}","var regexHighlightTags = /(|<\\/mark>)/g;\nvar regexHasHighlightTags = RegExp(regexHighlightTags.source);\nexport function removeHighlightTags(hit) {\n var _internalDocSearchHit, _internalDocSearchHit2, _internalDocSearchHit3, _hit$_highlightResult, _hit$_highlightResult2;\n\n var internalDocSearchHit = hit;\n\n if (!internalDocSearchHit.__docsearch_parent && !hit._highlightResult) {\n return hit.hierarchy.lvl0;\n }\n\n var _ref = (internalDocSearchHit.__docsearch_parent ? (_internalDocSearchHit = internalDocSearchHit.__docsearch_parent) === null || _internalDocSearchHit === void 0 ? void 0 : (_internalDocSearchHit2 = _internalDocSearchHit._highlightResult) === null || _internalDocSearchHit2 === void 0 ? void 0 : (_internalDocSearchHit3 = _internalDocSearchHit2.hierarchy) === null || _internalDocSearchHit3 === void 0 ? void 0 : _internalDocSearchHit3.lvl0 : (_hit$_highlightResult = hit._highlightResult) === null || _hit$_highlightResult === void 0 ? void 0 : (_hit$_highlightResult2 = _hit$_highlightResult.hierarchy) === null || _hit$_highlightResult2 === void 0 ? void 0 : _hit$_highlightResult2.lvl0) || {},\n value = _ref.value;\n\n return value && regexHasHighlightTags.test(value) ? value.replace(regexHighlightTags, '') : value;\n}","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport React from 'react';\nimport { SelectIcon, SourceIcon } from './icons';\nimport { Results } from './Results';\nimport { removeHighlightTags } from './utils';\nexport function ResultsScreen(props) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Dropdown-Container\"\n }, props.state.collections.map(function (collection) {\n if (collection.items.length === 0) {\n return null;\n }\n\n var title = removeHighlightTags(collection.items[0]);\n return /*#__PURE__*/React.createElement(Results, _extends({}, props, {\n key: collection.source.sourceId,\n title: title,\n collection: collection,\n renderIcon: function renderIcon(_ref) {\n var _collection$items;\n\n var item = _ref.item,\n index = _ref.index;\n return /*#__PURE__*/React.createElement(React.Fragment, null, item.__docsearch_parent && /*#__PURE__*/React.createElement(\"svg\", {\n className: \"DocSearch-Hit-Tree\",\n viewBox: \"0 0 24 54\"\n }, /*#__PURE__*/React.createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n fillRule: \"evenodd\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }, item.__docsearch_parent !== ((_collection$items = collection.items[index + 1]) === null || _collection$items === void 0 ? void 0 : _collection$items.__docsearch_parent) ? /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8 6v21M20 27H8.3\"\n }) : /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8 6v42M20 27H8.3\"\n }))), /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-icon\"\n }, /*#__PURE__*/React.createElement(SourceIcon, {\n type: item.type\n })));\n },\n renderAction: function renderAction() {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-action\"\n }, /*#__PURE__*/React.createElement(SelectIcon, null));\n }\n }));\n }), props.resultsFooterComponent && /*#__PURE__*/React.createElement(\"section\", {\n className: \"DocSearch-HitsFooter\"\n }, /*#__PURE__*/React.createElement(props.resultsFooterComponent, {\n state: props.state\n })));\n}","var _excluded = [\"translations\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from 'react';\nimport { RecentIcon, ResetIcon, StarIcon } from './icons';\nimport { Results } from './Results';\nexport function StartScreen(_ref) {\n var _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations,\n props = _objectWithoutProperties(_ref, _excluded);\n\n var _translations$recentS = translations.recentSearchesTitle,\n recentSearchesTitle = _translations$recentS === void 0 ? 'Recent' : _translations$recentS,\n _translations$noRecen = translations.noRecentSearchesText,\n noRecentSearchesText = _translations$noRecen === void 0 ? 'No recent searches' : _translations$noRecen,\n _translations$saveRec = translations.saveRecentSearchButtonTitle,\n saveRecentSearchButtonTitle = _translations$saveRec === void 0 ? 'Save this search' : _translations$saveRec,\n _translations$removeR = translations.removeRecentSearchButtonTitle,\n removeRecentSearchButtonTitle = _translations$removeR === void 0 ? 'Remove this search from history' : _translations$removeR,\n _translations$favorit = translations.favoriteSearchesTitle,\n favoriteSearchesTitle = _translations$favorit === void 0 ? 'Favorite' : _translations$favorit,\n _translations$removeF = translations.removeFavoriteSearchButtonTitle,\n removeFavoriteSearchButtonTitle = _translations$removeF === void 0 ? 'Remove this search from favorites' : _translations$removeF;\n\n if (props.state.status === 'idle' && props.hasCollections === false) {\n if (props.disableUserPersonalization) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-StartScreen\"\n }, /*#__PURE__*/React.createElement(\"p\", {\n className: \"DocSearch-Help\"\n }, noRecentSearchesText));\n }\n\n if (props.hasCollections === false) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Dropdown-Container\"\n }, /*#__PURE__*/React.createElement(Results, _extends({}, props, {\n title: recentSearchesTitle,\n collection: props.state.collections[0],\n renderIcon: function renderIcon() {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-icon\"\n }, /*#__PURE__*/React.createElement(RecentIcon, null));\n },\n renderAction: function renderAction(_ref2) {\n var item = _ref2.item,\n runFavoriteTransition = _ref2.runFavoriteTransition,\n runDeleteTransition = _ref2.runDeleteTransition;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-action\"\n }, /*#__PURE__*/React.createElement(\"button\", {\n className: \"DocSearch-Hit-action-button\",\n title: saveRecentSearchButtonTitle,\n type: \"submit\",\n onClick: function onClick(event) {\n event.preventDefault();\n event.stopPropagation();\n runFavoriteTransition(function () {\n props.favoriteSearches.add(item);\n props.recentSearches.remove(item);\n props.refresh();\n });\n }\n }, /*#__PURE__*/React.createElement(StarIcon, null))), /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-action\"\n }, /*#__PURE__*/React.createElement(\"button\", {\n className: \"DocSearch-Hit-action-button\",\n title: removeRecentSearchButtonTitle,\n type: \"submit\",\n onClick: function onClick(event) {\n event.preventDefault();\n event.stopPropagation();\n runDeleteTransition(function () {\n props.recentSearches.remove(item);\n props.refresh();\n });\n }\n }, /*#__PURE__*/React.createElement(ResetIcon, null))));\n }\n })), /*#__PURE__*/React.createElement(Results, _extends({}, props, {\n title: favoriteSearchesTitle,\n collection: props.state.collections[1],\n renderIcon: function renderIcon() {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-icon\"\n }, /*#__PURE__*/React.createElement(StarIcon, null));\n },\n renderAction: function renderAction(_ref3) {\n var item = _ref3.item,\n runDeleteTransition = _ref3.runDeleteTransition;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Hit-action\"\n }, /*#__PURE__*/React.createElement(\"button\", {\n className: \"DocSearch-Hit-action-button\",\n title: removeFavoriteSearchButtonTitle,\n type: \"submit\",\n onClick: function onClick(event) {\n event.preventDefault();\n event.stopPropagation();\n runDeleteTransition(function () {\n props.favoriteSearches.remove(item);\n props.refresh();\n });\n }\n }, /*#__PURE__*/React.createElement(ResetIcon, null)));\n }\n })));\n}","var _excluded = [\"translations\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from 'react';\nimport { ErrorScreen } from './ErrorScreen';\nimport { NoResultsScreen } from './NoResultsScreen';\nimport { ResultsScreen } from './ResultsScreen';\nimport { StartScreen } from './StartScreen';\nexport var ScreenState = React.memo(function (_ref) {\n var _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations,\n props = _objectWithoutProperties(_ref, _excluded);\n\n if (props.state.status === 'error') {\n return /*#__PURE__*/React.createElement(ErrorScreen, {\n translations: translations === null || translations === void 0 ? void 0 : translations.errorScreen\n });\n }\n\n var hasCollections = props.state.collections.some(function (collection) {\n return collection.items.length > 0;\n });\n\n if (!props.state.query) {\n return /*#__PURE__*/React.createElement(StartScreen, _extends({}, props, {\n hasCollections: hasCollections,\n translations: translations === null || translations === void 0 ? void 0 : translations.startScreen\n }));\n }\n\n if (hasCollections === false) {\n return /*#__PURE__*/React.createElement(NoResultsScreen, _extends({}, props, {\n translations: translations === null || translations === void 0 ? void 0 : translations.noResultsScreen\n }));\n }\n\n return /*#__PURE__*/React.createElement(ResultsScreen, props);\n}, function areEqual(_prevProps, nextProps) {\n // We don't update the screen when Autocomplete is loading or stalled to\n // avoid UI flashes:\n // - Empty screen → Results screen\n // - NoResults screen → NoResults screen with another query\n return nextProps.state.status === 'loading' || nextProps.state.status === 'stalled';\n});","var _excluded = [\"translations\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from 'react';\nimport { MAX_QUERY_SIZE } from './constants';\nimport { LoadingIcon } from './icons/LoadingIcon';\nimport { ResetIcon } from './icons/ResetIcon';\nimport { SearchIcon } from './icons/SearchIcon';\nexport function SearchBox(_ref) {\n var _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations,\n props = _objectWithoutProperties(_ref, _excluded);\n\n var _translations$resetBu = translations.resetButtonTitle,\n resetButtonTitle = _translations$resetBu === void 0 ? 'Clear the query' : _translations$resetBu,\n _translations$resetBu2 = translations.resetButtonAriaLabel,\n resetButtonAriaLabel = _translations$resetBu2 === void 0 ? 'Clear the query' : _translations$resetBu2,\n _translations$cancelB = translations.cancelButtonText,\n cancelButtonText = _translations$cancelB === void 0 ? 'Cancel' : _translations$cancelB,\n _translations$cancelB2 = translations.cancelButtonAriaLabel,\n cancelButtonAriaLabel = _translations$cancelB2 === void 0 ? 'Cancel' : _translations$cancelB2;\n\n var _props$getFormProps = props.getFormProps({\n inputElement: props.inputRef.current\n }),\n onReset = _props$getFormProps.onReset;\n\n React.useEffect(function () {\n if (props.autoFocus && props.inputRef.current) {\n props.inputRef.current.focus();\n }\n }, [props.autoFocus, props.inputRef]);\n React.useEffect(function () {\n if (props.isFromSelection && props.inputRef.current) {\n props.inputRef.current.select();\n }\n }, [props.isFromSelection, props.inputRef]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"form\", {\n className: \"DocSearch-Form\",\n onSubmit: function onSubmit(event) {\n event.preventDefault();\n },\n onReset: onReset\n }, /*#__PURE__*/React.createElement(\"label\", _extends({\n className: \"DocSearch-MagnifierLabel\"\n }, props.getLabelProps()), /*#__PURE__*/React.createElement(SearchIcon, null)), /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-LoadingIndicator\"\n }, /*#__PURE__*/React.createElement(LoadingIcon, null)), /*#__PURE__*/React.createElement(\"input\", _extends({\n className: \"DocSearch-Input\",\n ref: props.inputRef\n }, props.getInputProps({\n inputElement: props.inputRef.current,\n autoFocus: props.autoFocus,\n maxLength: MAX_QUERY_SIZE\n }))), /*#__PURE__*/React.createElement(\"button\", {\n type: \"reset\",\n title: resetButtonTitle,\n className: \"DocSearch-Reset\",\n \"aria-label\": resetButtonAriaLabel,\n hidden: !props.state.query\n }, /*#__PURE__*/React.createElement(ResetIcon, null))), /*#__PURE__*/React.createElement(\"button\", {\n className: \"DocSearch-Cancel\",\n type: \"reset\",\n \"aria-label\": cancelButtonAriaLabel,\n onClick: props.onClose\n }, cancelButtonText));\n}","export var MAX_QUERY_SIZE = 64;","var _excluded = [\"_highlightResult\", \"_snippetResult\"];\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction isLocalStorageSupported() {\n var key = '__TEST_KEY__';\n\n try {\n localStorage.setItem(key, '');\n localStorage.removeItem(key);\n return true;\n } catch (error) {\n return false;\n }\n}\n\nfunction createStorage(key) {\n if (isLocalStorageSupported() === false) {\n return {\n setItem: function setItem() {},\n getItem: function getItem() {\n return [];\n }\n };\n }\n\n return {\n setItem: function setItem(item) {\n return window.localStorage.setItem(key, JSON.stringify(item));\n },\n getItem: function getItem() {\n var item = window.localStorage.getItem(key);\n return item ? JSON.parse(item) : [];\n }\n };\n}\n\nexport function createStoredSearches(_ref) {\n var key = _ref.key,\n _ref$limit = _ref.limit,\n limit = _ref$limit === void 0 ? 5 : _ref$limit;\n var storage = createStorage(key);\n var items = storage.getItem().slice(0, limit);\n return {\n add: function add(item) {\n var _ref2 = item,\n _highlightResult = _ref2._highlightResult,\n _snippetResult = _ref2._snippetResult,\n hit = _objectWithoutProperties(_ref2, _excluded);\n\n var isQueryAlreadySaved = items.findIndex(function (x) {\n return x.objectID === hit.objectID;\n });\n\n if (isQueryAlreadySaved > -1) {\n items.splice(isQueryAlreadySaved, 1);\n }\n\n items.unshift(hit);\n items = items.slice(0, limit);\n storage.setItem(items);\n },\n remove: function remove(item) {\n items = items.filter(function (x) {\n return x.objectID !== item.objectID;\n });\n storage.setItem(items);\n },\n getAll: function getAll() {\n return items;\n }\n };\n}","function createBrowserLocalStorageCache(options) {\r\n const namespaceKey = `algoliasearch-client-js-${options.key}`;\r\n // eslint-disable-next-line functional/no-let\r\n let storage;\r\n const getStorage = () => {\r\n if (storage === undefined) {\r\n storage = options.localStorage || window.localStorage;\r\n }\r\n return storage;\r\n };\r\n const getNamespace = () => {\r\n return JSON.parse(getStorage().getItem(namespaceKey) || '{}');\r\n };\r\n return {\r\n get(key, defaultValue, events = {\r\n miss: () => Promise.resolve(),\r\n }) {\r\n return Promise.resolve()\r\n .then(() => {\r\n const keyAsString = JSON.stringify(key);\r\n const value = getNamespace()[keyAsString];\r\n return Promise.all([value || defaultValue(), value !== undefined]);\r\n })\r\n .then(([value, exists]) => {\r\n return Promise.all([value, exists || events.miss(value)]);\r\n })\r\n .then(([value]) => value);\r\n },\r\n set(key, value) {\r\n return Promise.resolve().then(() => {\r\n const namespace = getNamespace();\r\n // eslint-disable-next-line functional/immutable-data\r\n namespace[JSON.stringify(key)] = value;\r\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\r\n return value;\r\n });\r\n },\r\n delete(key) {\r\n return Promise.resolve().then(() => {\r\n const namespace = getNamespace();\r\n // eslint-disable-next-line functional/immutable-data\r\n delete namespace[JSON.stringify(key)];\r\n getStorage().setItem(namespaceKey, JSON.stringify(namespace));\r\n });\r\n },\r\n clear() {\r\n return Promise.resolve().then(() => {\r\n getStorage().removeItem(namespaceKey);\r\n });\r\n },\r\n };\r\n}\n\n// @todo Add logger on options to debug when caches go wrong.\r\nfunction createFallbackableCache(options) {\r\n const caches = [...options.caches];\r\n const current = caches.shift(); // eslint-disable-line functional/immutable-data\r\n if (current === undefined) {\r\n return createNullCache();\r\n }\r\n return {\r\n get(key, defaultValue, events = {\r\n miss: () => Promise.resolve(),\r\n }) {\r\n return current.get(key, defaultValue, events).catch(() => {\r\n return createFallbackableCache({ caches }).get(key, defaultValue, events);\r\n });\r\n },\r\n set(key, value) {\r\n return current.set(key, value).catch(() => {\r\n return createFallbackableCache({ caches }).set(key, value);\r\n });\r\n },\r\n delete(key) {\r\n return current.delete(key).catch(() => {\r\n return createFallbackableCache({ caches }).delete(key);\r\n });\r\n },\r\n clear() {\r\n return current.clear().catch(() => {\r\n return createFallbackableCache({ caches }).clear();\r\n });\r\n },\r\n };\r\n}\n\nfunction createNullCache() {\r\n return {\r\n get(_key, defaultValue, events = {\r\n miss: () => Promise.resolve(),\r\n }) {\r\n const value = defaultValue();\r\n return value\r\n .then(result => Promise.all([result, events.miss(result)]))\r\n .then(([result]) => result);\r\n },\r\n set(_key, value) {\r\n return Promise.resolve(value);\r\n },\r\n delete(_key) {\r\n return Promise.resolve();\r\n },\r\n clear() {\r\n return Promise.resolve();\r\n },\r\n };\r\n}\n\nfunction createInMemoryCache(options = { serializable: true }) {\r\n // eslint-disable-next-line functional/no-let\r\n let cache = {};\r\n return {\r\n get(key, defaultValue, events = {\r\n miss: () => Promise.resolve(),\r\n }) {\r\n const keyAsString = JSON.stringify(key);\r\n if (keyAsString in cache) {\r\n return Promise.resolve(options.serializable ? JSON.parse(cache[keyAsString]) : cache[keyAsString]);\r\n }\r\n const promise = defaultValue();\r\n const miss = (events && events.miss) || (() => Promise.resolve());\r\n return promise.then((value) => miss(value)).then(() => promise);\r\n },\r\n set(key, value) {\r\n // eslint-disable-next-line functional/immutable-data\r\n cache[JSON.stringify(key)] = options.serializable ? JSON.stringify(value) : value;\r\n return Promise.resolve(value);\r\n },\r\n delete(key) {\r\n // eslint-disable-next-line functional/immutable-data\r\n delete cache[JSON.stringify(key)];\r\n return Promise.resolve();\r\n },\r\n clear() {\r\n cache = {};\r\n return Promise.resolve();\r\n },\r\n };\r\n}\n\nfunction createAuth(authMode, appId, apiKey) {\r\n const credentials = {\r\n 'x-algolia-api-key': apiKey,\r\n 'x-algolia-application-id': appId,\r\n };\r\n return {\r\n headers() {\r\n return authMode === AuthMode.WithinHeaders ? credentials : {};\r\n },\r\n queryParameters() {\r\n return authMode === AuthMode.WithinQueryParameters ? credentials : {};\r\n },\r\n };\r\n}\n\n// eslint-disable-next-line functional/prefer-readonly-type\r\nfunction shuffle(array) {\r\n let c = array.length - 1; // eslint-disable-line functional/no-let\r\n // eslint-disable-next-line functional/no-loop-statement\r\n for (c; c > 0; c--) {\r\n const b = Math.floor(Math.random() * (c + 1));\r\n const a = array[c];\r\n array[c] = array[b]; // eslint-disable-line functional/immutable-data, no-param-reassign\r\n array[b] = a; // eslint-disable-line functional/immutable-data, no-param-reassign\r\n }\r\n return array;\r\n}\r\nfunction addMethods(base, methods) {\r\n if (!methods) {\r\n return base;\r\n }\r\n Object.keys(methods).forEach(key => {\r\n // eslint-disable-next-line functional/immutable-data, no-param-reassign\r\n base[key] = methods[key](base);\r\n });\r\n return base;\r\n}\r\nfunction encode(format, ...args) {\r\n // eslint-disable-next-line functional/no-let\r\n let i = 0;\r\n return format.replace(/%s/g, () => encodeURIComponent(args[i++]));\r\n}\n\nconst version = '4.8.5';\n\nconst AuthMode = {\r\n /**\r\n * If auth credentials should be in query parameters.\r\n */\r\n WithinQueryParameters: 0,\r\n /**\r\n * If auth credentials should be in headers.\r\n */\r\n WithinHeaders: 1,\r\n};\n\nfunction createMappedRequestOptions(requestOptions, timeout) {\r\n const options = requestOptions || {};\r\n const data = options.data || {};\r\n Object.keys(options).forEach(key => {\r\n if (['timeout', 'headers', 'queryParameters', 'data', 'cacheable'].indexOf(key) === -1) {\r\n data[key] = options[key]; // eslint-disable-line functional/immutable-data\r\n }\r\n });\r\n return {\r\n data: Object.entries(data).length > 0 ? data : undefined,\r\n timeout: options.timeout || timeout,\r\n headers: options.headers || {},\r\n queryParameters: options.queryParameters || {},\r\n cacheable: options.cacheable,\r\n };\r\n}\n\nconst CallEnum = {\r\n /**\r\n * If the host is read only.\r\n */\r\n Read: 1,\r\n /**\r\n * If the host is write only.\r\n */\r\n Write: 2,\r\n /**\r\n * If the host is both read and write.\r\n */\r\n Any: 3,\r\n};\n\nconst HostStatusEnum = {\r\n Up: 1,\r\n Down: 2,\r\n Timeouted: 3,\r\n};\n\n// By default, API Clients at Algolia have expiration delay\r\n// of 5 mins. In the JavaScript client, we have 2 mins.\r\nconst EXPIRATION_DELAY = 2 * 60 * 1000;\r\nfunction createStatefulHost(host, status = HostStatusEnum.Up) {\r\n return {\r\n ...host,\r\n status,\r\n lastUpdate: Date.now(),\r\n };\r\n}\r\nfunction isStatefulHostUp(host) {\r\n return host.status === HostStatusEnum.Up || Date.now() - host.lastUpdate > EXPIRATION_DELAY;\r\n}\r\nfunction isStatefulHostTimeouted(host) {\r\n return (host.status === HostStatusEnum.Timeouted && Date.now() - host.lastUpdate <= EXPIRATION_DELAY);\r\n}\n\nfunction createStatelessHost(options) {\r\n if (typeof options === 'string') {\r\n return {\r\n protocol: 'https',\r\n url: options,\r\n accept: CallEnum.Any,\r\n };\r\n }\r\n return {\r\n protocol: options.protocol || 'https',\r\n url: options.url,\r\n accept: options.accept || CallEnum.Any,\r\n };\r\n}\n\nconst MethodEnum = {\r\n Delete: 'DELETE',\r\n Get: 'GET',\r\n Post: 'POST',\r\n Put: 'PUT',\r\n};\n\nfunction createRetryableOptions(hostsCache, statelessHosts) {\r\n return Promise.all(statelessHosts.map(statelessHost => {\r\n return hostsCache.get(statelessHost, () => {\r\n return Promise.resolve(createStatefulHost(statelessHost));\r\n });\r\n })).then(statefulHosts => {\r\n const hostsUp = statefulHosts.filter(host => isStatefulHostUp(host));\r\n const hostsTimeouted = statefulHosts.filter(host => isStatefulHostTimeouted(host));\r\n /**\r\n * Note, we put the hosts that previously timeouted on the end of the list.\r\n */\r\n const hostsAvailable = [...hostsUp, ...hostsTimeouted];\r\n const statelessHostsAvailable = hostsAvailable.length > 0\r\n ? hostsAvailable.map(host => createStatelessHost(host))\r\n : statelessHosts;\r\n return {\r\n getTimeout(timeoutsCount, baseTimeout) {\r\n /**\r\n * Imagine that you have 4 hosts, if timeouts will increase\r\n * on the following way: 1 (timeouted) > 4 (timeouted) > 5 (200)\r\n *\r\n * Note that, the very next request, we start from the previous timeout\r\n *\r\n * 5 (timeouted) > 6 (timeouted) > 7 ...\r\n *\r\n * This strategy may need to be reviewed, but is the strategy on the our\r\n * current v3 version.\r\n */\r\n const timeoutMultiplier = hostsTimeouted.length === 0 && timeoutsCount === 0\r\n ? 1\r\n : hostsTimeouted.length + 3 + timeoutsCount;\r\n return timeoutMultiplier * baseTimeout;\r\n },\r\n statelessHosts: statelessHostsAvailable,\r\n };\r\n });\r\n}\n\nconst isNetworkError = ({ isTimedOut, status }) => {\r\n return !isTimedOut && ~~status === 0;\r\n};\r\nconst isRetryable = (response) => {\r\n const status = response.status;\r\n const isTimedOut = response.isTimedOut;\r\n return (isTimedOut || isNetworkError(response) || (~~(status / 100) !== 2 && ~~(status / 100) !== 4));\r\n};\r\nconst isSuccess = ({ status }) => {\r\n return ~~(status / 100) === 2;\r\n};\r\nconst retryDecision = (response, outcomes) => {\r\n if (isRetryable(response)) {\r\n return outcomes.onRetry(response);\r\n }\r\n if (isSuccess(response)) {\r\n return outcomes.onSucess(response);\r\n }\r\n return outcomes.onFail(response);\r\n};\n\nfunction retryableRequest(transporter, statelessHosts, request, requestOptions) {\r\n const stackTrace = []; // eslint-disable-line functional/prefer-readonly-type\r\n /**\r\n * First we prepare the payload that do not depend from hosts.\r\n */\r\n const data = serializeData(request, requestOptions);\r\n const headers = serializeHeaders(transporter, requestOptions);\r\n const method = request.method;\r\n // On `GET`, the data is proxied to query parameters.\r\n const dataQueryParameters = request.method !== MethodEnum.Get\r\n ? {}\r\n : {\r\n ...request.data,\r\n ...requestOptions.data,\r\n };\r\n const queryParameters = {\r\n 'x-algolia-agent': transporter.userAgent.value,\r\n ...transporter.queryParameters,\r\n ...dataQueryParameters,\r\n ...requestOptions.queryParameters,\r\n };\r\n let timeoutsCount = 0; // eslint-disable-line functional/no-let\r\n const retry = (hosts, // eslint-disable-line functional/prefer-readonly-type\r\n getTimeout) => {\r\n /**\r\n * We iterate on each host, until there is no host left.\r\n */\r\n const host = hosts.pop(); // eslint-disable-line functional/immutable-data\r\n if (host === undefined) {\r\n throw createRetryError(stackTraceWithoutCredentials(stackTrace));\r\n }\r\n const payload = {\r\n data,\r\n headers,\r\n method,\r\n url: serializeUrl(host, request.path, queryParameters),\r\n connectTimeout: getTimeout(timeoutsCount, transporter.timeouts.connect),\r\n responseTimeout: getTimeout(timeoutsCount, requestOptions.timeout),\r\n };\r\n /**\r\n * The stackFrame is pushed to the stackTrace so we\r\n * can have information about onRetry and onFailure\r\n * decisions.\r\n */\r\n const pushToStackTrace = (response) => {\r\n const stackFrame = {\r\n request: payload,\r\n response,\r\n host,\r\n triesLeft: hosts.length,\r\n };\r\n // eslint-disable-next-line functional/immutable-data\r\n stackTrace.push(stackFrame);\r\n return stackFrame;\r\n };\r\n const decisions = {\r\n onSucess: response => deserializeSuccess(response),\r\n onRetry(response) {\r\n const stackFrame = pushToStackTrace(response);\r\n /**\r\n * If response is a timeout, we increaset the number of\r\n * timeouts so we can increase the timeout later.\r\n */\r\n if (response.isTimedOut) {\r\n timeoutsCount++;\r\n }\r\n return Promise.all([\r\n /**\r\n * Failures are individually send the logger, allowing\r\n * the end user to debug / store stack frames even\r\n * when a retry error does not happen.\r\n */\r\n transporter.logger.info('Retryable failure', stackFrameWithoutCredentials(stackFrame)),\r\n /**\r\n * We also store the state of the host in failure cases. If the host, is\r\n * down it will remain down for the next 2 minutes. In a timeout situation,\r\n * this host will be added end of the list of hosts on the next request.\r\n */\r\n transporter.hostsCache.set(host, createStatefulHost(host, response.isTimedOut ? HostStatusEnum.Timeouted : HostStatusEnum.Down)),\r\n ]).then(() => retry(hosts, getTimeout));\r\n },\r\n onFail(response) {\r\n pushToStackTrace(response);\r\n throw deserializeFailure(response, stackTraceWithoutCredentials(stackTrace));\r\n },\r\n };\r\n return transporter.requester.send(payload).then(response => {\r\n return retryDecision(response, decisions);\r\n });\r\n };\r\n /**\r\n * Finally, for each retryable host perform request until we got a non\r\n * retryable response. Some notes here:\r\n *\r\n * 1. The reverse here is applied so we can apply a `pop` later on => more performant.\r\n * 2. We also get from the retryable options a timeout multiplier that is tailored\r\n * for the current context.\r\n */\r\n return createRetryableOptions(transporter.hostsCache, statelessHosts).then(options => {\r\n return retry([...options.statelessHosts].reverse(), options.getTimeout);\r\n });\r\n}\n\nfunction createTransporter(options) {\r\n const { hostsCache, logger, requester, requestsCache, responsesCache, timeouts, userAgent, hosts, queryParameters, headers, } = options;\r\n const transporter = {\r\n hostsCache,\r\n logger,\r\n requester,\r\n requestsCache,\r\n responsesCache,\r\n timeouts,\r\n userAgent,\r\n headers,\r\n queryParameters,\r\n hosts: hosts.map(host => createStatelessHost(host)),\r\n read(request, requestOptions) {\r\n /**\r\n * First, we compute the user request options. Now, keep in mind,\r\n * that using request options the user is able to modified the intire\r\n * payload of the request. Such as headers, query parameters, and others.\r\n */\r\n const mappedRequestOptions = createMappedRequestOptions(requestOptions, transporter.timeouts.read);\r\n const createRetryableRequest = () => {\r\n /**\r\n * Then, we prepare a function factory that contains the construction of\r\n * the retryable request. At this point, we may *not* perform the actual\r\n * request. But we want to have the function factory ready.\r\n */\r\n return retryableRequest(transporter, transporter.hosts.filter(host => (host.accept & CallEnum.Read) !== 0), request, mappedRequestOptions);\r\n };\r\n /**\r\n * Once we have the function factory ready, we need to determine of the\r\n * request is \"cacheable\" - should be cached. Note that, once again,\r\n * the user can force this option.\r\n */\r\n const cacheable = mappedRequestOptions.cacheable !== undefined\r\n ? mappedRequestOptions.cacheable\r\n : request.cacheable;\r\n /**\r\n * If is not \"cacheable\", we immediatly trigger the retryable request, no\r\n * need to check cache implementations.\r\n */\r\n if (cacheable !== true) {\r\n return createRetryableRequest();\r\n }\r\n /**\r\n * If the request is \"cacheable\", we need to first compute the key to ask\r\n * the cache implementations if this request is on progress or if the\r\n * response already exists on the cache.\r\n */\r\n const key = {\r\n request,\r\n mappedRequestOptions,\r\n transporter: {\r\n queryParameters: transporter.queryParameters,\r\n headers: transporter.headers,\r\n },\r\n };\r\n /**\r\n * With the computed key, we first ask the responses cache\r\n * implemention if this request was been resolved before.\r\n */\r\n return transporter.responsesCache.get(key, () => {\r\n /**\r\n * If the request has never resolved before, we actually ask if there\r\n * is a current request with the same key on progress.\r\n */\r\n return transporter.requestsCache.get(key, () => {\r\n return (transporter.requestsCache\r\n /**\r\n * Finally, if there is no request in progress with the same key,\r\n * this `createRetryableRequest()` will actually trigger the\r\n * retryable request.\r\n */\r\n .set(key, createRetryableRequest())\r\n .then(response => Promise.all([transporter.requestsCache.delete(key), response]), err => Promise.all([transporter.requestsCache.delete(key), Promise.reject(err)]))\r\n .then(([_, response]) => response));\r\n });\r\n }, {\r\n /**\r\n * Of course, once we get this response back from the server, we\r\n * tell response cache to actually store the received response\r\n * to be used later.\r\n */\r\n miss: response => transporter.responsesCache.set(key, response),\r\n });\r\n },\r\n write(request, requestOptions) {\r\n /**\r\n * On write requests, no cache mechanisms are applied, and we\r\n * proxy the request immediately to the requester.\r\n */\r\n return retryableRequest(transporter, transporter.hosts.filter(host => (host.accept & CallEnum.Write) !== 0), request, createMappedRequestOptions(requestOptions, transporter.timeouts.write));\r\n },\r\n };\r\n return transporter;\r\n}\n\nfunction createUserAgent(version) {\r\n const userAgent = {\r\n value: `Algolia for JavaScript (${version})`,\r\n add(options) {\r\n const addedUserAgent = `; ${options.segment}${options.version !== undefined ? ` (${options.version})` : ''}`;\r\n if (userAgent.value.indexOf(addedUserAgent) === -1) {\r\n // eslint-disable-next-line functional/immutable-data\r\n userAgent.value = `${userAgent.value}${addedUserAgent}`;\r\n }\r\n return userAgent;\r\n },\r\n };\r\n return userAgent;\r\n}\n\nfunction deserializeSuccess(response) {\r\n // eslint-disable-next-line functional/no-try-statement\r\n try {\r\n return JSON.parse(response.content);\r\n }\r\n catch (e) {\r\n throw createDeserializationError(e.message, response);\r\n }\r\n}\r\nfunction deserializeFailure({ content, status }, stackFrame) {\r\n // eslint-disable-next-line functional/no-let\r\n let message = content;\r\n // eslint-disable-next-line functional/no-try-statement\r\n try {\r\n message = JSON.parse(content).message;\r\n }\r\n catch (e) {\r\n // ..\r\n }\r\n return createApiError(message, status, stackFrame);\r\n}\n\nfunction serializeUrl(host, path, queryParameters) {\r\n const queryParametersAsString = serializeQueryParameters(queryParameters);\r\n // eslint-disable-next-line functional/no-let\r\n let url = `${host.protocol}://${host.url}/${path.charAt(0) === '/' ? path.substr(1) : path}`;\r\n if (queryParametersAsString.length) {\r\n url += `?${queryParametersAsString}`;\r\n }\r\n return url;\r\n}\r\nfunction serializeQueryParameters(parameters) {\r\n const isObjectOrArray = (value) => Object.prototype.toString.call(value) === '[object Object]' ||\r\n Object.prototype.toString.call(value) === '[object Array]';\r\n return Object.keys(parameters)\r\n .map(key => encode('%s=%s', key, isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]))\r\n .join('&');\r\n}\r\nfunction serializeData(request, requestOptions) {\r\n if (request.method === MethodEnum.Get ||\r\n (request.data === undefined && requestOptions.data === undefined)) {\r\n return undefined;\r\n }\r\n const data = Array.isArray(request.data)\r\n ? request.data\r\n : { ...request.data, ...requestOptions.data };\r\n return JSON.stringify(data);\r\n}\r\nfunction serializeHeaders(transporter, requestOptions) {\r\n const headers = {\r\n ...transporter.headers,\r\n ...requestOptions.headers,\r\n };\r\n const serializedHeaders = {};\r\n Object.keys(headers).forEach(header => {\r\n const value = headers[header];\r\n // @ts-ignore\r\n // eslint-disable-next-line functional/immutable-data\r\n serializedHeaders[header.toLowerCase()] = value;\r\n });\r\n return serializedHeaders;\r\n}\n\nfunction stackTraceWithoutCredentials(stackTrace) {\r\n return stackTrace.map(stackFrame => stackFrameWithoutCredentials(stackFrame));\r\n}\r\nfunction stackFrameWithoutCredentials(stackFrame) {\r\n const modifiedHeaders = stackFrame.request.headers['x-algolia-api-key']\r\n ? { 'x-algolia-api-key': '*****' }\r\n : {};\r\n return {\r\n ...stackFrame,\r\n request: {\r\n ...stackFrame.request,\r\n headers: {\r\n ...stackFrame.request.headers,\r\n ...modifiedHeaders,\r\n },\r\n },\r\n };\r\n}\n\nfunction createApiError(message, status, transporterStackTrace) {\r\n return {\r\n name: 'ApiError',\r\n message,\r\n status,\r\n transporterStackTrace,\r\n };\r\n}\n\nfunction createDeserializationError(message, response) {\r\n return {\r\n name: 'DeserializationError',\r\n message,\r\n response,\r\n };\r\n}\n\nfunction createRetryError(transporterStackTrace) {\r\n return {\r\n name: 'RetryError',\r\n message: 'Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.',\r\n transporterStackTrace,\r\n };\r\n}\n\nconst createSearchClient = options => {\r\n const appId = options.appId;\r\n const auth = createAuth(options.authMode !== undefined ? options.authMode : AuthMode.WithinHeaders, appId, options.apiKey);\r\n const transporter = createTransporter({\r\n hosts: [\r\n { url: `${appId}-dsn.algolia.net`, accept: CallEnum.Read },\r\n { url: `${appId}.algolia.net`, accept: CallEnum.Write },\r\n ].concat(shuffle([\r\n { url: `${appId}-1.algolianet.com` },\r\n { url: `${appId}-2.algolianet.com` },\r\n { url: `${appId}-3.algolianet.com` },\r\n ])),\r\n ...options,\r\n headers: {\r\n ...auth.headers(),\r\n ...{ 'content-type': 'application/x-www-form-urlencoded' },\r\n ...options.headers,\r\n },\r\n queryParameters: {\r\n ...auth.queryParameters(),\r\n ...options.queryParameters,\r\n },\r\n });\r\n const base = {\r\n transporter,\r\n appId,\r\n addAlgoliaAgent(segment, version) {\r\n transporter.userAgent.add({ segment, version });\r\n },\r\n clearCache() {\r\n return Promise.all([\r\n transporter.requestsCache.clear(),\r\n transporter.responsesCache.clear(),\r\n ]).then(() => undefined);\r\n },\r\n };\r\n return addMethods(base, options.methods);\r\n};\n\nconst initIndex = (base) => {\r\n return (indexName, options = {}) => {\r\n const searchIndex = {\r\n transporter: base.transporter,\r\n appId: base.appId,\r\n indexName,\r\n };\r\n return addMethods(searchIndex, options.methods);\r\n };\r\n};\n\nconst multipleQueries = (base) => {\r\n return (queries, requestOptions) => {\r\n const requests = queries.map(query => {\r\n return {\r\n ...query,\r\n params: serializeQueryParameters(query.params || {}),\r\n };\r\n });\r\n return base.transporter.read({\r\n method: MethodEnum.Post,\r\n path: '1/indexes/*/queries',\r\n data: {\r\n requests,\r\n },\r\n cacheable: true,\r\n }, requestOptions);\r\n };\r\n};\n\nconst multipleSearchForFacetValues = (base) => {\r\n return (queries, requestOptions) => {\r\n return Promise.all(queries.map(query => {\r\n const { facetName, facetQuery, ...params } = query.params;\r\n return initIndex(base)(query.indexName, {\r\n methods: { searchForFacetValues },\r\n }).searchForFacetValues(facetName, facetQuery, {\r\n ...requestOptions,\r\n ...params,\r\n });\r\n }));\r\n };\r\n};\n\nconst findAnswers = (base) => {\r\n return (query, queryLanguages, requestOptions) => {\r\n return base.transporter.read({\r\n method: MethodEnum.Post,\r\n path: encode('1/answers/%s/prediction', base.indexName),\r\n data: {\r\n query,\r\n queryLanguages,\r\n },\r\n cacheable: true,\r\n }, requestOptions);\r\n };\r\n};\n\nconst search = (base) => {\r\n return (query, requestOptions) => {\r\n return base.transporter.read({\r\n method: MethodEnum.Post,\r\n path: encode('1/indexes/%s/query', base.indexName),\r\n data: {\r\n query,\r\n },\r\n cacheable: true,\r\n }, requestOptions);\r\n };\r\n};\n\nconst searchForFacetValues = (base) => {\r\n return (facetName, facetQuery, requestOptions) => {\r\n return base.transporter.read({\r\n method: MethodEnum.Post,\r\n path: encode('1/indexes/%s/facets/%s/query', base.indexName, facetName),\r\n data: {\r\n facetQuery,\r\n },\r\n cacheable: true,\r\n }, requestOptions);\r\n };\r\n};\n\nconst LogLevelEnum = {\r\n Debug: 1,\r\n Info: 2,\r\n Error: 3,\r\n};\n\n/* eslint no-console: 0 */\r\nfunction createConsoleLogger(logLevel) {\r\n return {\r\n debug(message, args) {\r\n if (LogLevelEnum.Debug >= logLevel) {\r\n console.debug(message, args);\r\n }\r\n return Promise.resolve();\r\n },\r\n info(message, args) {\r\n if (LogLevelEnum.Info >= logLevel) {\r\n console.info(message, args);\r\n }\r\n return Promise.resolve();\r\n },\r\n error(message, args) {\r\n console.error(message, args);\r\n return Promise.resolve();\r\n },\r\n };\r\n}\n\nfunction createBrowserXhrRequester() {\r\n return {\r\n send(request) {\r\n return new Promise((resolve) => {\r\n const baseRequester = new XMLHttpRequest();\r\n baseRequester.open(request.method, request.url, true);\r\n Object.keys(request.headers).forEach(key => baseRequester.setRequestHeader(key, request.headers[key]));\r\n const createTimeout = (timeout, content) => {\r\n return setTimeout(() => {\r\n baseRequester.abort();\r\n resolve({\r\n status: 0,\r\n content,\r\n isTimedOut: true,\r\n });\r\n }, timeout * 1000);\r\n };\r\n const connectTimeout = createTimeout(request.connectTimeout, 'Connection timeout');\r\n // eslint-disable-next-line functional/no-let\r\n let responseTimeout;\r\n // eslint-disable-next-line functional/immutable-data\r\n baseRequester.onreadystatechange = () => {\r\n if (baseRequester.readyState > baseRequester.OPENED && responseTimeout === undefined) {\r\n clearTimeout(connectTimeout);\r\n responseTimeout = createTimeout(request.responseTimeout, 'Socket timeout');\r\n }\r\n };\r\n // eslint-disable-next-line functional/immutable-data\r\n baseRequester.onerror = () => {\r\n // istanbul ignore next\r\n if (baseRequester.status === 0) {\r\n clearTimeout(connectTimeout);\r\n clearTimeout(responseTimeout);\r\n resolve({\r\n content: baseRequester.responseText || 'Network request failed',\r\n status: baseRequester.status,\r\n isTimedOut: false,\r\n });\r\n }\r\n };\r\n // eslint-disable-next-line functional/immutable-data\r\n baseRequester.onload = () => {\r\n clearTimeout(connectTimeout);\r\n clearTimeout(responseTimeout);\r\n resolve({\r\n content: baseRequester.responseText,\r\n status: baseRequester.status,\r\n isTimedOut: false,\r\n });\r\n };\r\n baseRequester.send(request.data);\r\n });\r\n },\r\n };\r\n}\n\nfunction algoliasearch(appId, apiKey, options) {\r\n const commonOptions = {\r\n appId,\r\n apiKey,\r\n timeouts: {\r\n connect: 1,\r\n read: 2,\r\n write: 30,\r\n },\r\n requester: createBrowserXhrRequester(),\r\n logger: createConsoleLogger(LogLevelEnum.Error),\r\n responsesCache: createInMemoryCache(),\r\n requestsCache: createInMemoryCache({ serializable: false }),\r\n hostsCache: createFallbackableCache({\r\n caches: [\r\n createBrowserLocalStorageCache({ key: `${version}-${appId}` }),\r\n createInMemoryCache(),\r\n ],\r\n }),\r\n userAgent: createUserAgent(version).add({\r\n segment: 'Browser',\r\n version: 'lite',\r\n }),\r\n authMode: AuthMode.WithinQueryParameters,\r\n };\r\n return createSearchClient({\r\n ...commonOptions,\r\n ...options,\r\n methods: {\r\n search: multipleQueries,\r\n searchForFacetValues: multipleSearchForFacetValues,\r\n multipleQueries,\r\n multipleSearchForFacetValues,\r\n initIndex: base => (indexName) => {\r\n return initIndex(base)(indexName, {\r\n methods: { search, searchForFacetValues, findAnswers },\r\n });\r\n },\r\n },\r\n });\r\n}\r\n// eslint-disable-next-line functional/immutable-data\r\nalgoliasearch.version = version;\n\nexport default algoliasearch;\n","export var version = '3.0.0';","var _excluded = [\"footer\", \"searchBox\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { createAutocomplete } from '@algolia/autocomplete-core';\nimport React from 'react';\nimport { MAX_QUERY_SIZE } from './constants';\nimport { Footer } from './Footer';\nimport { Hit } from './Hit';\nimport { ScreenState } from './ScreenState';\nimport { SearchBox } from './SearchBox';\nimport { createStoredSearches } from './stored-searches';\nimport { useSearchClient } from './useSearchClient';\nimport { useTouchEvents } from './useTouchEvents';\nimport { useTrapFocus } from './useTrapFocus';\nimport { groupBy, identity, noop, removeHighlightTags } from './utils';\nexport function DocSearchModal(_ref) {\n var appId = _ref.appId,\n apiKey = _ref.apiKey,\n indexName = _ref.indexName,\n _ref$placeholder = _ref.placeholder,\n placeholder = _ref$placeholder === void 0 ? 'Search docs' : _ref$placeholder,\n searchParameters = _ref.searchParameters,\n _ref$onClose = _ref.onClose,\n onClose = _ref$onClose === void 0 ? noop : _ref$onClose,\n _ref$transformItems = _ref.transformItems,\n transformItems = _ref$transformItems === void 0 ? identity : _ref$transformItems,\n _ref$hitComponent = _ref.hitComponent,\n hitComponent = _ref$hitComponent === void 0 ? Hit : _ref$hitComponent,\n _ref$resultsFooterCom = _ref.resultsFooterComponent,\n resultsFooterComponent = _ref$resultsFooterCom === void 0 ? function () {\n return null;\n } : _ref$resultsFooterCom,\n navigator = _ref.navigator,\n _ref$initialScrollY = _ref.initialScrollY,\n initialScrollY = _ref$initialScrollY === void 0 ? 0 : _ref$initialScrollY,\n _ref$transformSearchC = _ref.transformSearchClient,\n transformSearchClient = _ref$transformSearchC === void 0 ? identity : _ref$transformSearchC,\n _ref$disableUserPerso = _ref.disableUserPersonalization,\n disableUserPersonalization = _ref$disableUserPerso === void 0 ? false : _ref$disableUserPerso,\n _ref$initialQuery = _ref.initialQuery,\n initialQueryFromProp = _ref$initialQuery === void 0 ? '' : _ref$initialQuery,\n _ref$translations = _ref.translations,\n translations = _ref$translations === void 0 ? {} : _ref$translations,\n getMissingResultsUrl = _ref.getMissingResultsUrl;\n\n var footerTranslations = translations.footer,\n searchBoxTranslations = translations.searchBox,\n screenStateTranslations = _objectWithoutProperties(translations, _excluded);\n\n var _React$useState = React.useState({\n query: '',\n collections: [],\n completion: null,\n context: {},\n isOpen: false,\n activeItemId: null,\n status: 'idle'\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n state = _React$useState2[0],\n setState = _React$useState2[1];\n\n var containerRef = React.useRef(null);\n var modalRef = React.useRef(null);\n var formElementRef = React.useRef(null);\n var dropdownRef = React.useRef(null);\n var inputRef = React.useRef(null);\n var snippetLength = React.useRef(10);\n var initialQueryFromSelection = React.useRef(typeof window !== 'undefined' ? window.getSelection().toString().slice(0, MAX_QUERY_SIZE) : '').current;\n var initialQuery = React.useRef(initialQueryFromProp || initialQueryFromSelection).current;\n var searchClient = useSearchClient(appId, apiKey, transformSearchClient);\n var favoriteSearches = React.useRef(createStoredSearches({\n key: \"__DOCSEARCH_FAVORITE_SEARCHES__\".concat(indexName),\n limit: 10\n })).current;\n var recentSearches = React.useRef(createStoredSearches({\n key: \"__DOCSEARCH_RECENT_SEARCHES__\".concat(indexName),\n // We display 7 recent searches and there's no favorites, but only\n // 4 when there are favorites.\n limit: favoriteSearches.getAll().length === 0 ? 7 : 4\n })).current;\n var saveRecentSearch = React.useCallback(function saveRecentSearch(item) {\n if (disableUserPersonalization) {\n return;\n } // We don't store `content` record, but their parent if available.\n\n\n var search = item.type === 'content' ? item.__docsearch_parent : item; // We save the recent search only if it's not favorited.\n\n if (search && favoriteSearches.getAll().findIndex(function (x) {\n return x.objectID === search.objectID;\n }) === -1) {\n recentSearches.add(search);\n }\n }, [favoriteSearches, recentSearches, disableUserPersonalization]);\n var autocomplete = React.useMemo(function () {\n return createAutocomplete({\n id: 'docsearch',\n defaultActiveItemId: 0,\n placeholder: placeholder,\n openOnFocus: true,\n initialState: {\n query: initialQuery,\n context: {\n searchSuggestions: []\n }\n },\n navigator: navigator,\n onStateChange: function onStateChange(props) {\n setState(props.state);\n },\n getSources: function getSources(_ref2) {\n var query = _ref2.query,\n sourcesState = _ref2.state,\n setContext = _ref2.setContext,\n setStatus = _ref2.setStatus;\n\n if (!query) {\n if (disableUserPersonalization) {\n return [];\n }\n\n return [{\n sourceId: 'recentSearches',\n onSelect: function onSelect(_ref3) {\n var item = _ref3.item,\n event = _ref3.event;\n saveRecentSearch(item);\n\n if (!event.shiftKey && !event.ctrlKey && !event.metaKey) {\n onClose();\n }\n },\n getItemUrl: function getItemUrl(_ref4) {\n var item = _ref4.item;\n return item.url;\n },\n getItems: function getItems() {\n return recentSearches.getAll();\n }\n }, {\n sourceId: 'favoriteSearches',\n onSelect: function onSelect(_ref5) {\n var item = _ref5.item,\n event = _ref5.event;\n saveRecentSearch(item);\n\n if (!event.shiftKey && !event.ctrlKey && !event.metaKey) {\n onClose();\n }\n },\n getItemUrl: function getItemUrl(_ref6) {\n var item = _ref6.item;\n return item.url;\n },\n getItems: function getItems() {\n return favoriteSearches.getAll();\n }\n }];\n }\n\n return searchClient.search([{\n query: query,\n indexName: indexName,\n params: _objectSpread({\n attributesToRetrieve: ['hierarchy.lvl0', 'hierarchy.lvl1', 'hierarchy.lvl2', 'hierarchy.lvl3', 'hierarchy.lvl4', 'hierarchy.lvl5', 'hierarchy.lvl6', 'content', 'type', 'url'],\n attributesToSnippet: [\"hierarchy.lvl1:\".concat(snippetLength.current), \"hierarchy.lvl2:\".concat(snippetLength.current), \"hierarchy.lvl3:\".concat(snippetLength.current), \"hierarchy.lvl4:\".concat(snippetLength.current), \"hierarchy.lvl5:\".concat(snippetLength.current), \"hierarchy.lvl6:\".concat(snippetLength.current), \"content:\".concat(snippetLength.current)],\n snippetEllipsisText: '…',\n highlightPreTag: '',\n highlightPostTag: '',\n hitsPerPage: 20\n }, searchParameters)\n }]).catch(function (error) {\n // The Algolia `RetryError` happens when all the servers have\n // failed, meaning that there's no chance the response comes\n // back. This is the right time to display an error.\n // See https://github.com/algolia/algoliasearch-client-javascript/blob/2ffddf59bc765cd1b664ee0346b28f00229d6e12/packages/transporter/src/errors/createRetryError.ts#L5\n if (error.name === 'RetryError') {\n setStatus('error');\n }\n\n throw error;\n }).then(function (_ref7) {\n var results = _ref7.results;\n var _results$ = results[0],\n hits = _results$.hits,\n nbHits = _results$.nbHits;\n var sources = groupBy(hits, function (hit) {\n return removeHighlightTags(hit);\n }); // We store the `lvl0`s to display them as search suggestions\n // in the \"no results\" screen.\n\n if (sourcesState.context.searchSuggestions.length < Object.keys(sources).length) {\n setContext({\n searchSuggestions: Object.keys(sources)\n });\n }\n\n setContext({\n nbHits: nbHits\n });\n return Object.values(sources).map(function (items, index) {\n return {\n sourceId: \"hits\".concat(index),\n onSelect: function onSelect(_ref8) {\n var item = _ref8.item,\n event = _ref8.event;\n saveRecentSearch(item);\n\n if (!event.shiftKey && !event.ctrlKey && !event.metaKey) {\n onClose();\n }\n },\n getItemUrl: function getItemUrl(_ref9) {\n var item = _ref9.item;\n return item.url;\n },\n getItems: function getItems() {\n return Object.values(groupBy(items, function (item) {\n return item.hierarchy.lvl1;\n })).map(transformItems).map(function (groupedHits) {\n return groupedHits.map(function (item) {\n return _objectSpread(_objectSpread({}, item), {}, {\n __docsearch_parent: item.type !== 'lvl1' && groupedHits.find(function (siblingItem) {\n return siblingItem.type === 'lvl1' && siblingItem.hierarchy.lvl1 === item.hierarchy.lvl1;\n })\n });\n });\n }).flat();\n }\n };\n });\n });\n }\n });\n }, [indexName, searchParameters, searchClient, onClose, recentSearches, favoriteSearches, saveRecentSearch, initialQuery, placeholder, navigator, transformItems, disableUserPersonalization]);\n var getEnvironmentProps = autocomplete.getEnvironmentProps,\n getRootProps = autocomplete.getRootProps,\n refresh = autocomplete.refresh;\n useTouchEvents({\n getEnvironmentProps: getEnvironmentProps,\n panelElement: dropdownRef.current,\n formElement: formElementRef.current,\n inputElement: inputRef.current\n });\n useTrapFocus({\n container: containerRef.current\n });\n React.useEffect(function () {\n document.body.classList.add('DocSearch--active');\n return function () {\n var _window$scrollTo, _window;\n\n document.body.classList.remove('DocSearch--active'); // IE11 doesn't support `scrollTo` so we check that the method exists\n // first.\n\n (_window$scrollTo = (_window = window).scrollTo) === null || _window$scrollTo === void 0 ? void 0 : _window$scrollTo.call(_window, 0, initialScrollY);\n }; // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n React.useEffect(function () {\n var isMobileMediaQuery = window.matchMedia('(max-width: 750px)');\n\n if (isMobileMediaQuery.matches) {\n snippetLength.current = 5;\n }\n }, []);\n React.useEffect(function () {\n if (dropdownRef.current) {\n dropdownRef.current.scrollTop = 0;\n }\n }, [state.query]); // We don't focus the input when there's an initial query (i.e. Selection\n // Search) because users rather want to see the results directly, without the\n // keyboard appearing.\n // We therefore need to refresh the autocomplete instance to load all the\n // results, which is usually triggered on focus.\n\n React.useEffect(function () {\n if (initialQuery.length > 0) {\n refresh();\n\n if (inputRef.current) {\n inputRef.current.focus();\n }\n }\n }, [initialQuery, refresh]); // We rely on a CSS property to set the modal height to the full viewport height\n // because all mobile browsers don't compute their height the same way.\n // See https://css-tricks.com/the-trick-to-viewport-units-on-mobile/\n\n React.useEffect(function () {\n function setFullViewportHeight() {\n if (modalRef.current) {\n var vh = window.innerHeight * 0.01;\n modalRef.current.style.setProperty('--docsearch-vh', \"\".concat(vh, \"px\"));\n }\n }\n\n setFullViewportHeight();\n window.addEventListener('resize', setFullViewportHeight);\n return function () {\n window.removeEventListener('resize', setFullViewportHeight);\n };\n }, []);\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: containerRef\n }, getRootProps({\n 'aria-expanded': true\n }), {\n className: ['DocSearch', 'DocSearch-Container', state.status === 'stalled' && 'DocSearch-Container--Stalled', state.status === 'error' && 'DocSearch-Container--Errored'].filter(Boolean).join(' '),\n role: \"button\",\n tabIndex: 0,\n onMouseDown: function onMouseDown(event) {\n if (event.target === event.currentTarget) {\n onClose();\n }\n }\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Modal\",\n ref: modalRef\n }, /*#__PURE__*/React.createElement(\"header\", {\n className: \"DocSearch-SearchBar\",\n ref: formElementRef\n }, /*#__PURE__*/React.createElement(SearchBox, _extends({}, autocomplete, {\n state: state,\n autoFocus: initialQuery.length === 0,\n inputRef: inputRef,\n isFromSelection: Boolean(initialQuery) && initialQuery === initialQueryFromSelection,\n translations: searchBoxTranslations,\n onClose: onClose\n }))), /*#__PURE__*/React.createElement(\"div\", {\n className: \"DocSearch-Dropdown\",\n ref: dropdownRef\n }, /*#__PURE__*/React.createElement(ScreenState, _extends({}, autocomplete, {\n indexName: indexName,\n state: state,\n hitComponent: hitComponent,\n resultsFooterComponent: resultsFooterComponent,\n disableUserPersonalization: disableUserPersonalization,\n recentSearches: recentSearches,\n favoriteSearches: favoriteSearches,\n inputRef: inputRef,\n translations: screenStateTranslations,\n getMissingResultsUrl: getMissingResultsUrl,\n onItemClick: function onItemClick(item) {\n saveRecentSearch(item);\n onClose();\n }\n }))), /*#__PURE__*/React.createElement(\"footer\", {\n className: \"DocSearch-Footer\"\n }, /*#__PURE__*/React.createElement(Footer, {\n translations: footerTranslations\n }))));\n}","import algoliasearch from 'algoliasearch/dist/algoliasearch-lite.esm.browser';\nimport React from 'react';\nimport { version } from './version';\nexport function useSearchClient(appId, apiKey, transformSearchClient) {\n var searchClient = React.useMemo(function () {\n var client = algoliasearch(appId, apiKey);\n client.addAlgoliaAgent('docsearch', version); // Since DocSearch.js relies on DocSearch React with an alias to Preact,\n // we cannot add the `docsearch-react` user agent by default, otherwise\n // it would also be sent on a DocSearch.js integration.\n // We therefore only add the `docsearch-react` user agent if `docsearch.js`\n // is not present.\n\n if (/docsearch.js \\(.*\\)/.test(client.transporter.userAgent.value) === false) {\n client.addAlgoliaAgent('docsearch-react', version);\n }\n\n return transformSearchClient(client);\n }, [appId, apiKey, transformSearchClient]);\n return searchClient;\n}","import React from 'react';\nexport function useTouchEvents(_ref) {\n var getEnvironmentProps = _ref.getEnvironmentProps,\n panelElement = _ref.panelElement,\n formElement = _ref.formElement,\n inputElement = _ref.inputElement;\n React.useEffect(function () {\n if (!(panelElement && formElement && inputElement)) {\n return undefined;\n }\n\n var _getEnvironmentProps = getEnvironmentProps({\n panelElement: panelElement,\n formElement: formElement,\n inputElement: inputElement\n }),\n onTouchStart = _getEnvironmentProps.onTouchStart,\n onTouchMove = _getEnvironmentProps.onTouchMove;\n\n window.addEventListener('touchstart', onTouchStart);\n window.addEventListener('touchmove', onTouchMove);\n return function () {\n window.removeEventListener('touchstart', onTouchStart);\n window.removeEventListener('touchmove', onTouchMove);\n };\n }, [getEnvironmentProps, panelElement, formElement, inputElement]);\n}","import React from 'react';\nexport function useTrapFocus(_ref) {\n var container = _ref.container;\n React.useEffect(function () {\n if (!container) {\n return undefined;\n }\n\n var focusableElements = container.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), input:not([disabled])');\n var firstElement = focusableElements[0];\n var lastElement = focusableElements[focusableElements.length - 1];\n\n function trapFocus(event) {\n if (event.key !== 'Tab') {\n return;\n }\n\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n\n container.addEventListener('keydown', trapFocus);\n return function () {\n container.removeEventListener('keydown', trapFocus);\n };\n }, [container]);\n}","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport React from 'react';\nimport { createPortal } from 'react-dom';\nimport { DocSearchButton } from './DocSearchButton';\nimport { DocSearchModal } from './DocSearchModal';\nimport { useDocSearchKeyboardEvents } from './useDocSearchKeyboardEvents';\nexport function DocSearch(props) {\n var _props$translations, _props$translations2;\n\n var searchButtonRef = React.useRef(null);\n\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n isOpen = _React$useState2[0],\n setIsOpen = _React$useState2[1];\n\n var _React$useState3 = React.useState((props === null || props === void 0 ? void 0 : props.initialQuery) || undefined),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n initialQuery = _React$useState4[0],\n setInitialQuery = _React$useState4[1];\n\n var onOpen = React.useCallback(function () {\n setIsOpen(true);\n }, [setIsOpen]);\n var onClose = React.useCallback(function () {\n setIsOpen(false);\n }, [setIsOpen]);\n var onInput = React.useCallback(function (event) {\n setIsOpen(true);\n setInitialQuery(event.key);\n }, [setIsOpen, setInitialQuery]);\n useDocSearchKeyboardEvents({\n isOpen: isOpen,\n onOpen: onOpen,\n onClose: onClose,\n onInput: onInput,\n searchButtonRef: searchButtonRef\n });\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DocSearchButton, {\n ref: searchButtonRef,\n translations: props === null || props === void 0 ? void 0 : (_props$translations = props.translations) === null || _props$translations === void 0 ? void 0 : _props$translations.button,\n onClick: onOpen\n }), isOpen && createPortal( /*#__PURE__*/React.createElement(DocSearchModal, _extends({}, props, {\n initialScrollY: window.scrollY,\n initialQuery: initialQuery,\n translations: props === null || props === void 0 ? void 0 : (_props$translations2 = props.translations) === null || _props$translations2 === void 0 ? void 0 : _props$translations2.modal,\n onClose: onClose\n })), document.body));\n}","import React from 'react';\n\nfunction isEditingContent(event) {\n var element = event.target;\n var tagName = element.tagName;\n return element.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA';\n}\n\nexport function useDocSearchKeyboardEvents(_ref) {\n var isOpen = _ref.isOpen,\n onOpen = _ref.onOpen,\n onClose = _ref.onClose,\n onInput = _ref.onInput,\n searchButtonRef = _ref.searchButtonRef;\n React.useEffect(function () {\n function onKeyDown(event) {\n function open() {\n // We check that no other DocSearch modal is showing before opening\n // another one.\n if (!document.body.classList.contains('DocSearch--active')) {\n onOpen();\n }\n }\n\n if (event.keyCode === 27 && isOpen || // The `Cmd+K` shortcut both opens and closes the modal.\n event.key === 'k' && (event.metaKey || event.ctrlKey) || // The `/` shortcut opens but doesn't close the modal because it's\n // a character.\n !isEditingContent(event) && event.key === '/' && !isOpen) {\n event.preventDefault();\n\n if (isOpen) {\n onClose();\n } else if (!document.body.classList.contains('DocSearch--active')) {\n open();\n }\n }\n\n if (searchButtonRef && searchButtonRef.current === document.activeElement && onInput) {\n if (/[a-zA-Z0-9]/.test(String.fromCharCode(event.keyCode))) {\n onInput(event);\n }\n }\n }\n\n window.addEventListener('keydown', onKeyDown);\n return function () {\n window.removeEventListener('keydown', onKeyDown);\n };\n }, [isOpen, onOpen, onClose, onInput, searchButtonRef]);\n}","import type { DocSearchProps as DocSearchComponentProps } from '@docsearch/react';\nimport { DocSearch, version } from '@docsearch/react';\nimport React, { render } from 'preact/compat';\n\nfunction getHTMLElement(\n value: HTMLElement | string,\n environment: DocSearchProps['environment'] = window\n): HTMLElement {\n if (typeof value === 'string') {\n return environment.document.querySelector(value)!;\n }\n\n return value;\n}\n\ninterface DocSearchProps extends DocSearchComponentProps {\n container: HTMLElement | string;\n environment?: typeof window;\n}\n\nexport function docsearch(props: DocSearchProps) {\n render(\n {\n searchClient.addAlgoliaAgent('docsearch.js', version);\n\n return props.transformSearchClient\n ? props.transformSearchClient(searchClient)\n : searchClient;\n }}\n />,\n getHTMLElement(props.container, props.environment)\n );\n}\n"],"names":["EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","currentIndex","currentComponent","prevRaf","currentHook","afterPaintEffects","oldBeforeDiff","options","oldBeforeRender","oldAfterDiff","diffed","oldCommit","oldBeforeUnmount","unmount","getHookState","index","type","hooks","__","__h","length","push","useReducer","reducer","initialState","init","hookState","_reducer","invokeOrReturn","n","nextValue","action","setState","useLayoutEffect","callback","args","state","argsChanged","useMemo","factory","flushAfterPaintEffects","forEach","t","component","invokeCleanup","invokeEffect","e","vnode","c","requestAnimationFrame","raf","done","clearTimeout","timeout","HAS_RAF","cancelAnimationFrame","setTimeout","commitQueue","some","filter","cb","hook","comp","oldArgs","newArgs","arg","f","assign","obj","props","i","shallowDiffers","a","b","initialValue","current","ref","createHandle","concat","context","provider","sub","value","formatter","useDebugValue","ControlKeyIcon","React","createElement","width","height","className","d","strokeWidth","stroke","fill","strokeLinecap","SearchIcon","viewBox","fillRule","strokeLinejoin","_excluded","_extends","Object","target","arguments","source","key","prototype","hasOwnProperty","call","apply","this","_objectWithoutProperties","excluded","sourceKeys","keys","indexOf","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","ACTION_KEY_DEFAULT","DocSearchButton","forwardRef","_ref","_ref$translations","translations","_translations$buttonT","buttonText","_translations$buttonA","buttonAriaLabel","navigator","test","platform","Fragment","flatten","values","reduce","autocompleteId","getItemsCount","collections","sum","collection","items","noop","userAgents","segment","version","createInternalCancelablePromise","promise","then","onfulfilled","onrejected","createCallback","catch","finally","onfinally","onCancelList","cancel","isCanceled","callbacks","cancelable","onResult","fallback","getNextActiveItemId","moveAmount","baseIndex","itemCount","defaultActiveItemId","numericIndex","ownKeys","object","enumerableOnly","symbols","sym","getOwnPropertyDescriptor","enumerable","_defineProperty","defineProperty","configurable","writable","getNormalizedSources","getSources","params","seenSourceIds","Promise","resolve","sources","all","maybeSource","Boolean","map","sourceId","includes","Error","JSON","stringify","normalizedSource","getOwnPropertyDescriptors","defineProperties","_objectSpread","getItemInputValue","query","getItemUrl","onSelect","_ref2","setIsOpen","onActive","getActiveItem","collectionIndex","acc","collectionsCount","activeItemId","getCollectionFromActiveItemId","item","isOffsetFound","counter","previousItemsOffset","currentCollection","getRelativeActiveItemId","itemInputValue","itemUrl","createStore","onStoreStateChange","list","getState","dispatch","payload","prevState","pendingRequests","add","cancelablePromise","cancelAll","isEmpty","_toConsumableArray","arr","Array","isArray","_arrayLikeToArray","_arrayWithoutHoles","iter","Symbol","iterator","from","_iterableToArray","o","minLen","toString","slice","constructor","name","_unsupportedIterableToArray","TypeError","_nonIterableSpread","len","arr2","isDescription","execute","preResolve","itemsOrDescription","description","requests","queries","transformResponse","searchClient","container","find","_container$items","request","maybeDescription","responses","postResolve","matches","response","results","transform","rawResults","result","_hits","hits","hit","__autocomplete_indexName","__autocomplete_queryID","queryID","facetHits","_facetHits","facetHit","label","count","_highlightResult","highlighted","mapToAlgoliaResponse","every","undefined","basePromiseId","latestResolvedId","latestResolvedValue","lastStalledId","runConcurrentSafePromise","currentPromiseId","x","onInput","event","_ref$nextState","nextState","refresh","store","setters","environment","setCollections","setQuery","setActiveItemId","setStatus","openOnFocus","_nextState$isOpen","isOpen","shouldPanelOpen","_request","stallThreshold","getItems","sourcesBySourceId","reshape","_nextState$isOpen2","isPanelOpen","highlightedItem","_excluded2","_excluded3","_excluded4","_excluded5","getPropGetters","getEnvironmentProps","providedProps","inputElement","formElement","panelElement","onTouchStart","contextNode","parent","child","contains","debug","onTouchMove","document","activeElement","blur","getRootProps","rest","role","id","getFormProps","noValidate","onSubmit","_providedProps$inputE","preventDefault","onReset","_providedProps$inputE2","focus","getLabelProps","htmlFor","getInputProps","onFocus","completion","isTouchDevice","_ref2$maxLength","maxLength","activeItem","autoComplete","autoCorrect","autoCapitalize","enterKeyHint","spellCheck","autoFocus","placeholder","onChange","currentTarget","onKeyDown","triggerScrollIntoView","nodeItem","getElementById","scrollIntoViewIfNeeded","scrollIntoView","triggerOnActive","nextActiveItemId","metaKey","ctrlKey","navigateNewTab","shiftKey","navigateNewWindow","altKey","navigate","_onKeyDown","onBlur","onClick","getPanelProps","onMouseDown","onMouseLeave","getListProps","getItemProps","__autocomplete_id","onMouseMove","_item","_source","getMetadata","_","_options$__autocomple","_options$__autocomple2","_options$__autocomple3","plugins","optionsKey","__autocomplete_metadata","extraOptions","plugin","__autocomplete_pluginOptions","ua","getCompletion","_getActiveItem","stateReducer","status","_nextState","createAutocomplete","subscribers","pluginSubscribers","_props$id","window","onStateChange","_props$onStateChange","_x$onStateChange","_props$onSubmit","_x$onSubmit","_props$onReset","_x$onReset","nested","_x$onSelect","_x$onActive","_ref3","location","_ref4","windowReference","open","_ref5","getDefaultProps","rawValue","baseItemId","setContext","getAutocompleteSetters","propGetters","Event","_plugin$subscribe","subscribe","fn","_environment$navigato","metadata","userAgent","metadataContainer","headRef","querySelector","content","appendChild","injectMetadata","AlgoliaLogo","_translations$searchB","searchByText","href","hostname","rel","CommandIcon","ariaLabel","children","Footer","_translations$selectT","selectText","_translations$selectK","selectKeyAriaLabel","_translations$navigat","navigateText","_translations$navigat2","navigateUpKeyAriaLabel","_translations$navigat3","navigateDownKeyAriaLabel","_translations$closeTe","closeText","_translations$closeKe","closeKeyAriaLabel","Hit","url","LoadingIcon","strokeOpacity","cx","cy","r","attributeName","to","dur","repeatCount","RecentIcon","ResetIcon","SelectIcon","LvlIcon","SourceIcon","ContentIcon","AnchorIcon","StarIcon","ErrorIcon","NoResultsIcon","ErrorScreen","_translations$titleTe","titleText","_translations$helpTex","helpText","NoResultsScreen","_translations$noResul","noResultsText","_translations$suggest","suggestedQueryText","_translations$reportM","reportMissingResultsText","_translations$reportM2","reportMissingResultsLinkText","searchSuggestions","search","toLowerCase","inputRef","getMissingResultsUrl","getPropertyByPath","path","split","prev","Snippet","attribute","_ref$tagName","tagName","dangerouslySetInnerHTML","__html","_slicedToArray","_arrayWithHoles","_i","_s","_e","_arr","_n","_d","next","err","_iterableToArrayLimit","_nonIterableRest","Results","title","Result","objectID","join","renderIcon","renderAction","onItemClick","hitComponent","_React$useState2","useState","isDeleting","setIsDeleting","_React$useState4","isFavoriting","setIsFavoriting","useRef","__docsearch_parent","onTransitionEnd","hierarchy","runDeleteTransition","runFavoriteTransition","groupBy","predicate","identity","regexHighlightTags","regexHasHighlightTags","RegExp","removeHighlightTags","_internalDocSearchHit","_internalDocSearchHit2","_internalDocSearchHit3","_hit$_highlightResult","_hit$_highlightResult2","internalDocSearchHit","lvl0","replace","ResultsScreen","_collection$items","resultsFooterComponent","StartScreen","_translations$recentS","recentSearchesTitle","_translations$noRecen","noRecentSearchesText","_translations$saveRec","saveRecentSearchButtonTitle","_translations$removeR","removeRecentSearchButtonTitle","_translations$favorit","favoriteSearchesTitle","_translations$removeF","removeFavoriteSearchButtonTitle","hasCollections","disableUserPersonalization","stopPropagation","favoriteSearches","recentSearches","remove","ScreenState","memo","errorScreen","noResultsScreen","startScreen","_prevProps","nextProps","SearchBox","_translations$resetBu","resetButtonTitle","_translations$resetBu2","resetButtonAriaLabel","_translations$cancelB","cancelButtonText","_translations$cancelB2","cancelButtonAriaLabel","useEffect","isFromSelection","select","hidden","onClose","createStorage","localStorage","setItem","removeItem","error","isLocalStorageSupported","getItem","parse","createStoredSearches","_ref$limit","limit","storage","_snippetResult","isQueryAlreadySaved","findIndex","splice","unshift","getAll","createBrowserLocalStorageCache","namespaceKey","getStorage","getNamespace","get","defaultValue","events","miss","keyAsString","exists","set","namespace","delete","clear","createFallbackableCache","caches","shift","_key","createInMemoryCache","serializable","cache","shuffle","array","Math","floor","random","addMethods","base","methods","encode","format","encodeURIComponent","AuthMode","WithinQueryParameters","WithinHeaders","createMappedRequestOptions","requestOptions","data","entries","headers","queryParameters","cacheable","CallEnum","Read","Write","Any","HostStatusEnum","EXPIRATION_DELAY","createStatefulHost","host","lastUpdate","Date","now","createStatelessHost","protocol","accept","MethodEnum","createRetryableOptions","hostsCache","statelessHosts","statelessHost","statefulHosts","hostsUp","isStatefulHostUp","hostsTimeouted","isStatefulHostTimeouted","hostsAvailable","getTimeout","timeoutsCount","baseTimeout","retryableRequest","transporter","stackTrace","method","serializeData","serializedHeaders","header","serializeHeaders","dataQueryParameters","retry","hosts","pop","message","transporterStackTrace","stackTraceWithoutCredentials","serializeUrl","connectTimeout","timeouts","connect","responseTimeout","pushToStackTrace","stackFrame","triesLeft","decisions","onSucess","createDeserializationError","deserializeSuccess","onRetry","isTimedOut","logger","info","stackFrameWithoutCredentials","onFail","createApiError","deserializeFailure","requester","send","outcomes","isNetworkError","isRetryable","retryDecision","reverse","createUserAgent","addedUserAgent","queryParametersAsString","serializeQueryParameters","charAt","substr","parameters","modifiedHeaders","createSearchClient","appId","auth","authMode","apiKey","credentials","createAuth","requestsCache","responsesCache","read","mappedRequestOptions","createRetryableRequest","reject","write","createTransporter","addAlgoliaAgent","clearCache","initIndex","indexName","searchIndex","multipleQueries","multipleSearchForFacetValues","facetName","facetQuery","searchForFacetValues","findAnswers","queryLanguages","LogLevelEnum","algoliasearch","logLevel","commonOptions","baseRequester","XMLHttpRequest","setRequestHeader","createTimeout","abort","onreadystatechange","readyState","OPENED","onerror","responseText","onload","console","DocSearchModal","_ref$placeholder","searchParameters","_ref$onClose","_ref$transformItems","transformItems","_ref$hitComponent","_ref$resultsFooterCom","_ref$initialScrollY","initialScrollY","_ref$transformSearchC","transformSearchClient","_ref$disableUserPerso","_ref$initialQuery","initialQuery","initialQueryFromProp","footerTranslations","footer","searchBoxTranslations","searchBox","screenStateTranslations","containerRef","modalRef","formElementRef","dropdownRef","snippetLength","initialQueryFromSelection","getSelection","client","useSearchClient","saveRecentSearch","useCallback","autocomplete","sourcesState","attributesToRetrieve","attributesToSnippet","snippetEllipsisText","highlightPreTag","highlightPostTag","hitsPerPage","_ref7","_results$","nbHits","_ref8","_ref9","lvl1","groupedHits","siblingItem","flat","_ref6","_getEnvironmentProps","addEventListener","removeEventListener","useTouchEvents","focusableElements","querySelectorAll","firstElement","lastElement","trapFocus","useTrapFocus","body","classList","_window$scrollTo","_window","scrollTo","matchMedia","scrollTop","setFullViewportHeight","vh","innerHeight","style","setProperty","tabIndex","DocSearch","_props$translations","_props$translations2","searchButtonRef","setInitialQuery","onOpen","keyCode","element","isContentEditable","isEditingContent","String","fromCharCode","useDocSearchKeyboardEvents","button","createPortal","scrollY","modal","render","getHTMLElement"],"mappings":";g+FAAaA,EAAY,GACZC,EAAY,GACZC,EAAqB,6+RCClC,IAAIC,EAGAC,EAsBAC,EAZAC,EAAc,EAGdC,EAAoB,GAEpBC,EAAgBC,EAAAA,IAChBC,EAAkBD,EAAAA,IAClBE,EAAeF,EAAQG,OACvBC,EAAYJ,EAAAA,IACZK,GAAmBL,EAAQM,QAwE/B,SAASC,GAAaC,EAAOC,GACxBT,EAAAA,KACHA,EAAAA,IAAcL,EAAkBa,EAAOX,GAAeY,GAEvDZ,EAAc,MAORa,EACLf,EAAAA,MACCA,EAAAA,IAA2B,CAAAgB,GACpB,GAAAC,IACU,YAGfJ,GAASE,EAAAA,GAAYG,QACxBH,EAAAA,GAAYI,KAAK,IAEXJ,EAAAA,GAAYF,GAiBpB,SAAgBO,GAAWC,EAASC,EAAcC,OAE3CC,EAAYZ,GAAab,IAAgB,UAC/CyB,EAAUC,EAAWJ,EAChBG,EAAAA,MACJA,EAAAA,GAAmB,CACjBD,EAAiDA,EAAKD,GAA/CI,QAAAA,EAA0BJ,GAElC,SAAAK,OACOC,EAAYJ,EAAUC,EAASD,EAAAA,GAAiB,GAAIK,GACtDL,EAAAA,GAAiB,KAAOI,IAC3BJ,EAAAA,GAAmB,CAACI,EAAWJ,EAAAA,GAAiB,IAChDA,EAAAA,IAAqBM,SAAS,OAKjCN,EAAAA,IAAuBxB,GAGjBwB,EAAAA,GAsBD,SAASO,GAAgBC,EAAUC,OAEnCC,EAAQtB,GAAab,IAAgB,IACtCM,EAAAA,KAAwB8B,GAAYD,EAAAA,IAAaD,KACrDC,EAAAA,GAAeF,EACfE,EAAAA,IAAcD,EAEdjC,EAAAA,IAAkCmB,KAAKe,IA6BlC,SAASE,GAAQC,EAASJ,OAE1BC,EA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AAOud,QACvB1E,aAAcA,EACdtrB,aAAczD,MAAAA,GAA8F,QAA/C4yB,EAAuB5yB,EAAMyD,oBAAmD,IAAzBmvB,OAAjE,EAA4GA,EAAqBc,MACpL/Q,QAASA,KACN1R,SAAS4gB,cExCT,SAAmB7xB,GACxB2zB,GACE1yB,iBAACyxB,QACK1yB,GACJ4uB,sBAAuB,SAACziB,UACtBA,EAAakgB,gBAAgB,eAAgBvnB,IAEtC9E,EAAM4uB,sBACT5uB,EAAM4uB,sBAAsBziB,GAC5BA,MAzBZ,SACEtL,OACAkO,yDAA6CmH,aAExB,iBAAVrV,EACFkO,EAAYkC,SAASiH,cAA2BrX,GAGlDA,EAoBL+yB,CAAe5zB,EAAMoM,UAAWpM,EAAM+O"} \ No newline at end of file diff --git a/node_modules/@docsearch/js/package.json b/node_modules/@docsearch/js/package.json new file mode 100644 index 0000000000..dc04cf5701 --- /dev/null +++ b/node_modules/@docsearch/js/package.json @@ -0,0 +1,37 @@ +{ + "name": "@docsearch/js", + "description": "JavaScript package for DocSearch, the best search experience for docs.", + "version": "3.0.0", + "license": "MIT", + "homepage": "https://docsearch.algolia.com", + "repository": "algolia/docsearch", + "author": { + "name": "Algolia, Inc.", + "url": "https://www.algolia.com" + }, + "sideEffects": false, + "files": [ + "dist/" + ], + "source": "src/index.ts", + "types": "dist/esm/index.d.ts", + "module": "dist/esm/index.js", + "main": "dist/umd/index.js", + "umd:main": "dist/umd/index.js", + "unpkg": "dist/umd/index.js", + "jsdelivr": "dist/umd/index.js", + "scripts": { + "build:clean": "rm -rf ./dist", + "build:esm": "cross-env BUILD=esm rollup --config", + "build:types": "tsc -p ./tsconfig.declaration.json --outFile ./dist/esm/index.d.ts", + "build:umd": "cross-env BUILD=umd rollup --config", + "build": "yarn build:clean && yarn build:umd && yarn build:esm && yarn build:types", + "on:change": "concurrently \"yarn build:esm\" \"yarn build:types\"", + "prepare": "yarn build:esm && yarn build:types", + "watch": "watch \"yarn on:change\" --ignoreDirectoryPattern \"/dist/\"" + }, + "dependencies": { + "@docsearch/react": "3.0.0", + "preact": "^10.0.0" + } +} diff --git a/node_modules/@docsearch/react/README.md b/node_modules/@docsearch/react/README.md new file mode 100644 index 0000000000..b13eb61a27 --- /dev/null +++ b/node_modules/@docsearch/react/README.md @@ -0,0 +1,43 @@ +# @docsearch/react + +React package for [DocSearch](http://docsearch.algolia.com/), the best search experience for docs. + +## Installation + +```bash +yarn add @docsearch/react@3 +# or +npm install @docsearch/react@3 +``` + +If you don’t want to use a package manager, you can use a standalone endpoint: + +```html + +``` + +## Get started + +DocSearch generates a fully accessible search box for you. + +```jsx App.js +import { DocSearch } from '@docsearch/react'; + +import '@docsearch/css'; + +function App() { + return ( + + ); +} + +export default App; +``` + +## Documentation + +[Read documentation →](https://docsearch.algolia.com/docs/DocSearch-v3) diff --git a/node_modules/@docsearch/react/button.js b/node_modules/@docsearch/react/button.js new file mode 100644 index 0000000000..5614c2a79f --- /dev/null +++ b/node_modules/@docsearch/react/button.js @@ -0,0 +1 @@ +export { DocSearchButton } from './dist/esm/DocSearchButton.js'; diff --git a/node_modules/@docsearch/react/dist/esm/AlgoliaLogo.d.ts b/node_modules/@docsearch/react/dist/esm/AlgoliaLogo.d.ts new file mode 100644 index 0000000000..bc1dbabba9 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/AlgoliaLogo.d.ts @@ -0,0 +1,9 @@ +/// +declare type AlgoliaLogoTranslations = Partial<{ + searchByText: string; +}>; +declare type AlgoliaLogoProps = { + translations?: AlgoliaLogoTranslations; +}; +export declare function AlgoliaLogo({ translations }: AlgoliaLogoProps): JSX.Element; +export {}; diff --git a/node_modules/@docsearch/react/dist/esm/AlgoliaLogo.js b/node_modules/@docsearch/react/dist/esm/AlgoliaLogo.js new file mode 100644 index 0000000000..d081b7517c --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/AlgoliaLogo.js @@ -0,0 +1,23 @@ +import React from 'react'; +export function AlgoliaLogo(_ref) { + var _ref$translations = _ref.translations, + translations = _ref$translations === void 0 ? {} : _ref$translations; + var _translations$searchB = translations.searchByText, + searchByText = _translations$searchB === void 0 ? 'Search by' : _translations$searchB; + return /*#__PURE__*/React.createElement("a", { + href: "https://www.algolia.com/ref/docsearch/?utm_source=".concat(window.location.hostname, "&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch"), + target: "_blank", + rel: "noopener noreferrer" + }, /*#__PURE__*/React.createElement("span", { + className: "DocSearch-Label" + }, searchByText), /*#__PURE__*/React.createElement("svg", { + width: "77", + height: "19", + "aria-label": "Algolia", + role: "img" + }, /*#__PURE__*/React.createElement("path", { + d: "M2.5067 0h14.0245c1.384.001 2.5058 1.1205 2.5068 2.5017V16.5c-.0014 1.3808-1.1232 2.4995-2.5068 2.5H2.5067C1.1232 18.9995.0014 17.8808 0 16.5V2.4958A2.495 2.495 0 01.735.7294 2.505 2.505 0 012.5068 0zM37.95 15.0695c-3.7068.0168-3.7068-2.986-3.7068-3.4634L34.2372.3576 36.498 0v11.1794c0 .2715 0 1.9889 1.452 1.994v1.8961zm-9.1666-1.8388c.694 0 1.2086-.0397 1.5678-.1088v-2.2934a5.3639 5.3639 0 00-1.3303-.1679 4.8283 4.8283 0 00-.758.0582 2.2845 2.2845 0 00-.688.2024c-.2029.0979-.371.2362-.4919.4142-.1268.1788-.185.2826-.185.5533 0 .5297.185.8359.5205 1.0375.3355.2016.7928.3053 1.365.3053v-.0008zm-.1969-8.1817c.7463 0 1.3768.092 1.8856.2767.5088.1838.9195.4428 1.2204.7717.3068.334.5147.7777.6423 1.251.1327.4723.196.991.196 1.5603v5.798c-.5235.1036-1.05.192-1.5787.2649-.7048.1037-1.4976.156-2.3774.156-.5832 0-1.1215-.0582-1.6016-.167a3.385 3.385 0 01-1.2432-.5364 2.6034 2.6034 0 01-.8037-.9565c-.191-.3922-.29-.9447-.29-1.5208 0-.5533.11-.905.3246-1.2863a2.7351 2.7351 0 01.8849-.9329c.376-.242.8029-.415 1.2948-.5187a7.4517 7.4517 0 011.5381-.156 7.1162 7.1162 0 011.6667.2024V8.886c0-.259-.0296-.5061-.093-.7372a1.5847 1.5847 0 00-.3245-.6158 1.5079 1.5079 0 00-.6119-.4158 2.6788 2.6788 0 00-.966-.173c-.5206 0-.9948.0634-1.4283.1384a6.5481 6.5481 0 00-1.065.259l-.2712-1.849c.2831-.0986.7048-.1964 1.2491-.2943a9.2979 9.2979 0 011.752-.1501v.0008zm44.6597 8.1193c.6947 0 1.2086-.0405 1.567-.1097v-2.2942a5.3743 5.3743 0 00-1.3303-.1679c-.2485 0-.503.0177-.7573.0582a2.2853 2.2853 0 00-.688.2024 1.2333 1.2333 0 00-.4918.4142c-.1268.1788-.1843.2826-.1843.5533 0 .5297.1843.8359.5198 1.0375.3414.2066.7927.3053 1.365.3053v.0009zm-.191-8.1767c.7463 0 1.3768.0912 1.8856.2759.5087.1847.9195.4436 1.2204.7717.3.329.5147.7786.6414 1.251a5.7248 5.7248 0 01.197 1.562v5.7972c-.3466.0742-.874.1602-1.5788.2648-.7049.1038-1.4976.1552-2.3774.1552-.5832 0-1.1215-.0573-1.6016-.167a3.385 3.385 0 01-1.2432-.5356 2.6034 2.6034 0 01-.8038-.9565c-.191-.3922-.2898-.9447-.2898-1.5216 0-.5533.1098-.905.3245-1.2854a2.7373 2.7373 0 01.8849-.9338c.376-.2412.8029-.4141 1.2947-.5178a7.4545 7.4545 0 012.325-.1097c.2781.0287.5672.081.879.156v-.3686a2.7781 2.7781 0 00-.092-.738 1.5788 1.5788 0 00-.3246-.6166 1.5079 1.5079 0 00-.612-.415 2.6797 2.6797 0 00-.966-.1729c-.5205 0-.9947.0633-1.4282.1384a6.5608 6.5608 0 00-1.065.259l-.2712-1.8498c.283-.0979.7048-.1957 1.2491-.2935a9.8597 9.8597 0 011.752-.1494zm-6.79-1.072c-.7576.001-1.373-.6103-1.3759-1.3664 0-.755.6128-1.3664 1.376-1.3664.764 0 1.3775.6115 1.3775 1.3664s-.6195 1.3664-1.3776 1.3664zm1.1393 11.1507h-2.2726V5.3409l2.2734-.3568v10.0845l-.0008.0017zm-3.984 0c-3.707.0168-3.707-2.986-3.707-3.4642L59.7069.3576 61.9685 0v11.1794c0 .2715 0 1.9889 1.452 1.994V15.0703zm-7.3512-4.979c0-.975-.2138-1.7873-.6305-2.3516-.4167-.571-.9998-.852-1.747-.852-.7454 0-1.3302.281-1.7452.852-.4166.5702-.6195 1.3765-.6195 2.3516 0 .9851.208 1.6473.6254 2.2183.4158.576.9998.8587 1.7461.8587.7454 0 1.3303-.2885 1.747-.8595.4158-.5761.6237-1.2315.6237-2.2184v.0009zm2.3132-.006c0 .7609-.1099 1.3361-.3356 1.9654a4.654 4.654 0 01-.9533 1.6076A4.214 4.214 0 0155.613 14.69c-.579.2412-1.4697.3795-1.9143.3795-.4462-.005-1.3303-.1324-1.9033-.3795a4.307 4.307 0 01-1.474-1.0316c-.4115-.4445-.7293-.9801-.9609-1.6076a5.3423 5.3423 0 01-.3465-1.9653c0-.7608.104-1.493.3356-2.1155a4.683 4.683 0 01.9719-1.5958 4.3383 4.3383 0 011.479-1.0257c.5739-.242 1.2043-.3567 1.8864-.3567.6829 0 1.3125.1197 1.8906.3567a4.1245 4.1245 0 011.4816 1.0257 4.7587 4.7587 0 01.9592 1.5958c.2426.6225.3643 1.3547.3643 2.1155zm-17.0198 0c0 .9448.208 1.9932.6238 2.431.4166.4386.955.6579 1.6142.6579.3584 0 .6998-.0523 1.0176-.1502.3186-.0978.5721-.2134.775-.3517V7.0784a8.8706 8.8706 0 00-1.4926-.1906c-.8206-.0236-1.4452.312-1.8847.8468-.4335.5365-.6533 1.476-.6533 2.3516v-.0008zm6.2863 4.4485c0 1.5385-.3938 2.662-1.1866 3.3773-.791.7136-2.0005 1.0712-3.6308 1.0712-.5958 0-1.834-.1156-2.8228-.334l.3643-1.7865c.8282.173 1.9202.2193 2.4932.2193.9077 0 1.555-.1847 1.943-.5533.388-.3686.578-.916.578-1.643v-.3687a6.8289 6.8289 0 01-.8848.3349c-.3634.1096-.786.167-1.261.167-.6246 0-1.1917-.0979-1.7055-.2944a3.5554 3.5554 0 01-1.3244-.8645c-.3642-.3796-.6541-.8579-.8561-1.4289-.2028-.571-.3068-1.59-.3068-2.339 0-.7034.1099-1.5856.3245-2.1735.2198-.5871.5316-1.0949.9542-1.515.4167-.42.9255-.743 1.5213-.98a5.5923 5.5923 0 012.052-.3855c.7353 0 1.4114.092 2.0707.2024.6592.1088 1.2204.2236 1.6776.35v8.945-.0008zM11.5026 4.2418v-.6511c-.0005-.4553-.3704-.8241-.8266-.8241H8.749c-.4561 0-.826.3688-.8265.824v.669c0 .0742.0693.1264.1445.1096a6.0346 6.0346 0 011.6768-.2362 6.125 6.125 0 011.6202.2185.1116.1116 0 00.1386-.1097zm-5.2806.852l-.3296-.3282a.8266.8266 0 00-1.168 0l-.393.3922a.8199.8199 0 000 1.164l.3237.323c.0524.0515.1268.0397.1733-.0117.191-.259.3989-.507.6305-.7372.2374-.2362.48-.4437.7462-.6335.0575-.0354.0634-.1155.017-.1687zm3.5159 2.069v2.818c0 .081.0879.1392.1622.0987l2.5102-1.2964c.0574-.0287.0752-.0987.0464-.1552a3.1237 3.1237 0 00-2.603-1.574c-.0575 0-.115.0456-.115.1097l-.0008-.0009zm.0008 6.789c-2.0933.0005-3.7915-1.6912-3.7947-3.7804C5.9468 8.0821 7.6452 6.39 9.7387 6.391c2.0932-.0005 3.7911 1.6914 3.794 3.7804a3.7783 3.7783 0 01-1.1124 2.675 3.7936 3.7936 0 01-2.6824 1.1054h.0008zM9.738 4.8002c-1.9218 0-3.6975 1.0232-4.6584 2.6841a5.359 5.359 0 000 5.3683c.9609 1.661 2.7366 2.6841 4.6584 2.6841a5.3891 5.3891 0 003.8073-1.5725 5.3675 5.3675 0 001.578-3.7987 5.3574 5.3574 0 00-1.5771-3.797A5.379 5.379 0 009.7387 4.801l-.0008-.0008z", + fill: "currentColor", + fillRule: "evenodd" + }))); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/DocSearch.d.ts b/node_modules/@docsearch/react/dist/esm/DocSearch.d.ts new file mode 100644 index 0000000000..3bb279f75e --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/DocSearch.d.ts @@ -0,0 +1,34 @@ +import type { AutocompleteState, AutocompleteOptions } from '@algolia/autocomplete-core'; +import type { SearchOptions } from '@algolia/client-search'; +import type { SearchClient } from 'algoliasearch/lite'; +import React from 'react'; +import type { DocSearchHit, InternalDocSearchHit, StoredDocSearchHit } from './types'; +import type { ButtonTranslations, ModalTranslations } from '.'; +export declare type DocSearchTranslations = Partial<{ + button: ButtonTranslations; + modal: ModalTranslations; +}>; +export interface DocSearchProps { + appId: string; + apiKey: string; + indexName: string; + placeholder?: string; + searchParameters?: SearchOptions; + transformItems?: (items: DocSearchHit[]) => DocSearchHit[]; + hitComponent?: (props: { + hit: InternalDocSearchHit | StoredDocSearchHit; + children: React.ReactNode; + }) => JSX.Element; + resultsFooterComponent?: (props: { + state: AutocompleteState; + }) => JSX.Element | null; + transformSearchClient?: (searchClient: SearchClient) => SearchClient; + disableUserPersonalization?: boolean; + initialQuery?: string; + navigator?: AutocompleteOptions['navigator']; + translations?: DocSearchTranslations; + getMissingResultsUrl?: ({ query: string }: { + query: any; + }) => string; +} +export declare function DocSearch(props: DocSearchProps): JSX.Element; diff --git a/node_modules/@docsearch/react/dist/esm/DocSearch.js b/node_modules/@docsearch/react/dist/esm/DocSearch.js new file mode 100644 index 0000000000..3a6658b0e6 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/DocSearch.js @@ -0,0 +1,62 @@ +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +import React from 'react'; +import { createPortal } from 'react-dom'; +import { DocSearchButton } from './DocSearchButton'; +import { DocSearchModal } from './DocSearchModal'; +import { useDocSearchKeyboardEvents } from './useDocSearchKeyboardEvents'; +export function DocSearch(props) { + var _props$translations, _props$translations2; + + var searchButtonRef = React.useRef(null); + + var _React$useState = React.useState(false), + _React$useState2 = _slicedToArray(_React$useState, 2), + isOpen = _React$useState2[0], + setIsOpen = _React$useState2[1]; + + var _React$useState3 = React.useState((props === null || props === void 0 ? void 0 : props.initialQuery) || undefined), + _React$useState4 = _slicedToArray(_React$useState3, 2), + initialQuery = _React$useState4[0], + setInitialQuery = _React$useState4[1]; + + var onOpen = React.useCallback(function () { + setIsOpen(true); + }, [setIsOpen]); + var onClose = React.useCallback(function () { + setIsOpen(false); + }, [setIsOpen]); + var onInput = React.useCallback(function (event) { + setIsOpen(true); + setInitialQuery(event.key); + }, [setIsOpen, setInitialQuery]); + useDocSearchKeyboardEvents({ + isOpen: isOpen, + onOpen: onOpen, + onClose: onClose, + onInput: onInput, + searchButtonRef: searchButtonRef + }); + return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DocSearchButton, { + ref: searchButtonRef, + translations: props === null || props === void 0 ? void 0 : (_props$translations = props.translations) === null || _props$translations === void 0 ? void 0 : _props$translations.button, + onClick: onOpen + }), isOpen && createPortal( /*#__PURE__*/React.createElement(DocSearchModal, _extends({}, props, { + initialScrollY: window.scrollY, + initialQuery: initialQuery, + translations: props === null || props === void 0 ? void 0 : (_props$translations2 = props.translations) === null || _props$translations2 === void 0 ? void 0 : _props$translations2.modal, + onClose: onClose + })), document.body)); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/DocSearchButton.d.ts b/node_modules/@docsearch/react/dist/esm/DocSearchButton.d.ts new file mode 100644 index 0000000000..25f088ccb5 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/DocSearchButton.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; +export declare type ButtonTranslations = Partial<{ + buttonText: string; + buttonAriaLabel: string; +}>; +export declare type DocSearchButtonProps = React.ComponentProps<'button'> & { + translations?: ButtonTranslations; +}; +export declare const DocSearchButton: React.ForwardRefExoticComponent> & React.RefAttributes>; diff --git a/node_modules/@docsearch/react/dist/esm/DocSearchButton.js b/node_modules/@docsearch/react/dist/esm/DocSearchButton.js new file mode 100644 index 0000000000..5e82770f6a --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/DocSearchButton.js @@ -0,0 +1,52 @@ +var _excluded = ["translations"]; + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +import React, { useMemo } from 'react'; +import { ControlKeyIcon } from './icons/ControlKeyIcon'; +import { SearchIcon } from './icons/SearchIcon'; +var ACTION_KEY_DEFAULT = 'Ctrl'; +var ACTION_KEY_APPLE = '⌘'; + +function isAppleDevice() { + return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform); +} + +export var DocSearchButton = React.forwardRef(function (_ref, ref) { + var _ref$translations = _ref.translations, + translations = _ref$translations === void 0 ? {} : _ref$translations, + props = _objectWithoutProperties(_ref, _excluded); + + var _translations$buttonT = translations.buttonText, + buttonText = _translations$buttonT === void 0 ? 'Search' : _translations$buttonT, + _translations$buttonA = translations.buttonAriaLabel, + buttonAriaLabel = _translations$buttonA === void 0 ? 'Search' : _translations$buttonA; + var key = useMemo(function () { + if (typeof navigator !== 'undefined') { + return isAppleDevice() ? ACTION_KEY_APPLE : ACTION_KEY_DEFAULT; + } + + return null; + }, []); + return /*#__PURE__*/React.createElement("button", _extends({ + type: "button", + className: "DocSearch DocSearch-Button", + "aria-label": buttonAriaLabel + }, props, { + ref: ref + }), /*#__PURE__*/React.createElement("span", { + className: "DocSearch-Button-Container" + }, /*#__PURE__*/React.createElement(SearchIcon, null), /*#__PURE__*/React.createElement("span", { + className: "DocSearch-Button-Placeholder" + }, buttonText)), /*#__PURE__*/React.createElement("span", { + className: "DocSearch-Button-Keys" + }, key !== null && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", { + className: "DocSearch-Button-Key" + }, key === ACTION_KEY_DEFAULT ? /*#__PURE__*/React.createElement(ControlKeyIcon, null) : key), /*#__PURE__*/React.createElement("span", { + className: "DocSearch-Button-Key" + }, "K")))); +}); \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/DocSearchModal.d.ts b/node_modules/@docsearch/react/dist/esm/DocSearchModal.d.ts new file mode 100644 index 0000000000..940c617e59 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/DocSearchModal.d.ts @@ -0,0 +1,15 @@ +/// +import type { DocSearchProps } from './DocSearch'; +import type { FooterTranslations } from './Footer'; +import type { ScreenStateTranslations } from './ScreenState'; +import type { SearchBoxTranslations } from './SearchBox'; +export declare type ModalTranslations = Partial<{ + searchBox: SearchBoxTranslations; + footer: FooterTranslations; +}> & ScreenStateTranslations; +export declare type DocSearchModalProps = DocSearchProps & { + initialScrollY: number; + onClose?: () => void; + translations?: ModalTranslations; +}; +export declare function DocSearchModal({ appId, apiKey, indexName, placeholder, searchParameters, onClose, transformItems, hitComponent, resultsFooterComponent, navigator, initialScrollY, transformSearchClient, disableUserPersonalization, initialQuery: initialQueryFromProp, translations, getMissingResultsUrl, }: DocSearchModalProps): JSX.Element; diff --git a/node_modules/@docsearch/react/dist/esm/DocSearchModal.js b/node_modules/@docsearch/react/dist/esm/DocSearchModal.js new file mode 100644 index 0000000000..f963460ea2 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/DocSearchModal.js @@ -0,0 +1,375 @@ +var _excluded = ["footer", "searchBox"]; + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +import { createAutocomplete } from '@algolia/autocomplete-core'; +import React from 'react'; +import { MAX_QUERY_SIZE } from './constants'; +import { Footer } from './Footer'; +import { Hit } from './Hit'; +import { ScreenState } from './ScreenState'; +import { SearchBox } from './SearchBox'; +import { createStoredSearches } from './stored-searches'; +import { useSearchClient } from './useSearchClient'; +import { useTouchEvents } from './useTouchEvents'; +import { useTrapFocus } from './useTrapFocus'; +import { groupBy, identity, noop, removeHighlightTags } from './utils'; +export function DocSearchModal(_ref) { + var appId = _ref.appId, + apiKey = _ref.apiKey, + indexName = _ref.indexName, + _ref$placeholder = _ref.placeholder, + placeholder = _ref$placeholder === void 0 ? 'Search docs' : _ref$placeholder, + searchParameters = _ref.searchParameters, + _ref$onClose = _ref.onClose, + onClose = _ref$onClose === void 0 ? noop : _ref$onClose, + _ref$transformItems = _ref.transformItems, + transformItems = _ref$transformItems === void 0 ? identity : _ref$transformItems, + _ref$hitComponent = _ref.hitComponent, + hitComponent = _ref$hitComponent === void 0 ? Hit : _ref$hitComponent, + _ref$resultsFooterCom = _ref.resultsFooterComponent, + resultsFooterComponent = _ref$resultsFooterCom === void 0 ? function () { + return null; + } : _ref$resultsFooterCom, + navigator = _ref.navigator, + _ref$initialScrollY = _ref.initialScrollY, + initialScrollY = _ref$initialScrollY === void 0 ? 0 : _ref$initialScrollY, + _ref$transformSearchC = _ref.transformSearchClient, + transformSearchClient = _ref$transformSearchC === void 0 ? identity : _ref$transformSearchC, + _ref$disableUserPerso = _ref.disableUserPersonalization, + disableUserPersonalization = _ref$disableUserPerso === void 0 ? false : _ref$disableUserPerso, + _ref$initialQuery = _ref.initialQuery, + initialQueryFromProp = _ref$initialQuery === void 0 ? '' : _ref$initialQuery, + _ref$translations = _ref.translations, + translations = _ref$translations === void 0 ? {} : _ref$translations, + getMissingResultsUrl = _ref.getMissingResultsUrl; + + var footerTranslations = translations.footer, + searchBoxTranslations = translations.searchBox, + screenStateTranslations = _objectWithoutProperties(translations, _excluded); + + var _React$useState = React.useState({ + query: '', + collections: [], + completion: null, + context: {}, + isOpen: false, + activeItemId: null, + status: 'idle' + }), + _React$useState2 = _slicedToArray(_React$useState, 2), + state = _React$useState2[0], + setState = _React$useState2[1]; + + var containerRef = React.useRef(null); + var modalRef = React.useRef(null); + var formElementRef = React.useRef(null); + var dropdownRef = React.useRef(null); + var inputRef = React.useRef(null); + var snippetLength = React.useRef(10); + var initialQueryFromSelection = React.useRef(typeof window !== 'undefined' ? window.getSelection().toString().slice(0, MAX_QUERY_SIZE) : '').current; + var initialQuery = React.useRef(initialQueryFromProp || initialQueryFromSelection).current; + var searchClient = useSearchClient(appId, apiKey, transformSearchClient); + var favoriteSearches = React.useRef(createStoredSearches({ + key: "__DOCSEARCH_FAVORITE_SEARCHES__".concat(indexName), + limit: 10 + })).current; + var recentSearches = React.useRef(createStoredSearches({ + key: "__DOCSEARCH_RECENT_SEARCHES__".concat(indexName), + // We display 7 recent searches and there's no favorites, but only + // 4 when there are favorites. + limit: favoriteSearches.getAll().length === 0 ? 7 : 4 + })).current; + var saveRecentSearch = React.useCallback(function saveRecentSearch(item) { + if (disableUserPersonalization) { + return; + } // We don't store `content` record, but their parent if available. + + + var search = item.type === 'content' ? item.__docsearch_parent : item; // We save the recent search only if it's not favorited. + + if (search && favoriteSearches.getAll().findIndex(function (x) { + return x.objectID === search.objectID; + }) === -1) { + recentSearches.add(search); + } + }, [favoriteSearches, recentSearches, disableUserPersonalization]); + var autocomplete = React.useMemo(function () { + return createAutocomplete({ + id: 'docsearch', + defaultActiveItemId: 0, + placeholder: placeholder, + openOnFocus: true, + initialState: { + query: initialQuery, + context: { + searchSuggestions: [] + } + }, + navigator: navigator, + onStateChange: function onStateChange(props) { + setState(props.state); + }, + getSources: function getSources(_ref2) { + var query = _ref2.query, + sourcesState = _ref2.state, + setContext = _ref2.setContext, + setStatus = _ref2.setStatus; + + if (!query) { + if (disableUserPersonalization) { + return []; + } + + return [{ + sourceId: 'recentSearches', + onSelect: function onSelect(_ref3) { + var item = _ref3.item, + event = _ref3.event; + saveRecentSearch(item); + + if (!event.shiftKey && !event.ctrlKey && !event.metaKey) { + onClose(); + } + }, + getItemUrl: function getItemUrl(_ref4) { + var item = _ref4.item; + return item.url; + }, + getItems: function getItems() { + return recentSearches.getAll(); + } + }, { + sourceId: 'favoriteSearches', + onSelect: function onSelect(_ref5) { + var item = _ref5.item, + event = _ref5.event; + saveRecentSearch(item); + + if (!event.shiftKey && !event.ctrlKey && !event.metaKey) { + onClose(); + } + }, + getItemUrl: function getItemUrl(_ref6) { + var item = _ref6.item; + return item.url; + }, + getItems: function getItems() { + return favoriteSearches.getAll(); + } + }]; + } + + return searchClient.search([{ + query: query, + indexName: indexName, + params: _objectSpread({ + attributesToRetrieve: ['hierarchy.lvl0', 'hierarchy.lvl1', 'hierarchy.lvl2', 'hierarchy.lvl3', 'hierarchy.lvl4', 'hierarchy.lvl5', 'hierarchy.lvl6', 'content', 'type', 'url'], + attributesToSnippet: ["hierarchy.lvl1:".concat(snippetLength.current), "hierarchy.lvl2:".concat(snippetLength.current), "hierarchy.lvl3:".concat(snippetLength.current), "hierarchy.lvl4:".concat(snippetLength.current), "hierarchy.lvl5:".concat(snippetLength.current), "hierarchy.lvl6:".concat(snippetLength.current), "content:".concat(snippetLength.current)], + snippetEllipsisText: '…', + highlightPreTag: '', + highlightPostTag: '', + hitsPerPage: 20 + }, searchParameters) + }]).catch(function (error) { + // The Algolia `RetryError` happens when all the servers have + // failed, meaning that there's no chance the response comes + // back. This is the right time to display an error. + // See https://github.com/algolia/algoliasearch-client-javascript/blob/2ffddf59bc765cd1b664ee0346b28f00229d6e12/packages/transporter/src/errors/createRetryError.ts#L5 + if (error.name === 'RetryError') { + setStatus('error'); + } + + throw error; + }).then(function (_ref7) { + var results = _ref7.results; + var _results$ = results[0], + hits = _results$.hits, + nbHits = _results$.nbHits; + var sources = groupBy(hits, function (hit) { + return removeHighlightTags(hit); + }); // We store the `lvl0`s to display them as search suggestions + // in the "no results" screen. + + if (sourcesState.context.searchSuggestions.length < Object.keys(sources).length) { + setContext({ + searchSuggestions: Object.keys(sources) + }); + } + + setContext({ + nbHits: nbHits + }); + return Object.values(sources).map(function (items, index) { + return { + sourceId: "hits".concat(index), + onSelect: function onSelect(_ref8) { + var item = _ref8.item, + event = _ref8.event; + saveRecentSearch(item); + + if (!event.shiftKey && !event.ctrlKey && !event.metaKey) { + onClose(); + } + }, + getItemUrl: function getItemUrl(_ref9) { + var item = _ref9.item; + return item.url; + }, + getItems: function getItems() { + return Object.values(groupBy(items, function (item) { + return item.hierarchy.lvl1; + })).map(transformItems).map(function (groupedHits) { + return groupedHits.map(function (item) { + return _objectSpread(_objectSpread({}, item), {}, { + __docsearch_parent: item.type !== 'lvl1' && groupedHits.find(function (siblingItem) { + return siblingItem.type === 'lvl1' && siblingItem.hierarchy.lvl1 === item.hierarchy.lvl1; + }) + }); + }); + }).flat(); + } + }; + }); + }); + } + }); + }, [indexName, searchParameters, searchClient, onClose, recentSearches, favoriteSearches, saveRecentSearch, initialQuery, placeholder, navigator, transformItems, disableUserPersonalization]); + var getEnvironmentProps = autocomplete.getEnvironmentProps, + getRootProps = autocomplete.getRootProps, + refresh = autocomplete.refresh; + useTouchEvents({ + getEnvironmentProps: getEnvironmentProps, + panelElement: dropdownRef.current, + formElement: formElementRef.current, + inputElement: inputRef.current + }); + useTrapFocus({ + container: containerRef.current + }); + React.useEffect(function () { + document.body.classList.add('DocSearch--active'); + return function () { + var _window$scrollTo, _window; + + document.body.classList.remove('DocSearch--active'); // IE11 doesn't support `scrollTo` so we check that the method exists + // first. + + (_window$scrollTo = (_window = window).scrollTo) === null || _window$scrollTo === void 0 ? void 0 : _window$scrollTo.call(_window, 0, initialScrollY); + }; // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + React.useEffect(function () { + var isMobileMediaQuery = window.matchMedia('(max-width: 750px)'); + + if (isMobileMediaQuery.matches) { + snippetLength.current = 5; + } + }, []); + React.useEffect(function () { + if (dropdownRef.current) { + dropdownRef.current.scrollTop = 0; + } + }, [state.query]); // We don't focus the input when there's an initial query (i.e. Selection + // Search) because users rather want to see the results directly, without the + // keyboard appearing. + // We therefore need to refresh the autocomplete instance to load all the + // results, which is usually triggered on focus. + + React.useEffect(function () { + if (initialQuery.length > 0) { + refresh(); + + if (inputRef.current) { + inputRef.current.focus(); + } + } + }, [initialQuery, refresh]); // We rely on a CSS property to set the modal height to the full viewport height + // because all mobile browsers don't compute their height the same way. + // See https://css-tricks.com/the-trick-to-viewport-units-on-mobile/ + + React.useEffect(function () { + function setFullViewportHeight() { + if (modalRef.current) { + var vh = window.innerHeight * 0.01; + modalRef.current.style.setProperty('--docsearch-vh', "".concat(vh, "px")); + } + } + + setFullViewportHeight(); + window.addEventListener('resize', setFullViewportHeight); + return function () { + window.removeEventListener('resize', setFullViewportHeight); + }; + }, []); + return /*#__PURE__*/React.createElement("div", _extends({ + ref: containerRef + }, getRootProps({ + 'aria-expanded': true + }), { + className: ['DocSearch', 'DocSearch-Container', state.status === 'stalled' && 'DocSearch-Container--Stalled', state.status === 'error' && 'DocSearch-Container--Errored'].filter(Boolean).join(' '), + role: "button", + tabIndex: 0, + onMouseDown: function onMouseDown(event) { + if (event.target === event.currentTarget) { + onClose(); + } + } + }), /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Modal", + ref: modalRef + }, /*#__PURE__*/React.createElement("header", { + className: "DocSearch-SearchBar", + ref: formElementRef + }, /*#__PURE__*/React.createElement(SearchBox, _extends({}, autocomplete, { + state: state, + autoFocus: initialQuery.length === 0, + inputRef: inputRef, + isFromSelection: Boolean(initialQuery) && initialQuery === initialQueryFromSelection, + translations: searchBoxTranslations, + onClose: onClose + }))), /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Dropdown", + ref: dropdownRef + }, /*#__PURE__*/React.createElement(ScreenState, _extends({}, autocomplete, { + indexName: indexName, + state: state, + hitComponent: hitComponent, + resultsFooterComponent: resultsFooterComponent, + disableUserPersonalization: disableUserPersonalization, + recentSearches: recentSearches, + favoriteSearches: favoriteSearches, + inputRef: inputRef, + translations: screenStateTranslations, + getMissingResultsUrl: getMissingResultsUrl, + onItemClick: function onItemClick(item) { + saveRecentSearch(item); + onClose(); + } + }))), /*#__PURE__*/React.createElement("footer", { + className: "DocSearch-Footer" + }, /*#__PURE__*/React.createElement(Footer, { + translations: footerTranslations + })))); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/ErrorScreen.d.ts b/node_modules/@docsearch/react/dist/esm/ErrorScreen.d.ts new file mode 100644 index 0000000000..0c923e19d3 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/ErrorScreen.d.ts @@ -0,0 +1,10 @@ +/// +export declare type ErrorScreenTranslations = Partial<{ + titleText: string; + helpText: string; +}>; +declare type ErrorScreenProps = { + translations?: ErrorScreenTranslations; +}; +export declare function ErrorScreen({ translations }: ErrorScreenProps): JSX.Element; +export {}; diff --git a/node_modules/@docsearch/react/dist/esm/ErrorScreen.js b/node_modules/@docsearch/react/dist/esm/ErrorScreen.js new file mode 100644 index 0000000000..b8b0920c22 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/ErrorScreen.js @@ -0,0 +1,19 @@ +import React from 'react'; +import { ErrorIcon } from './icons'; +export function ErrorScreen(_ref) { + var _ref$translations = _ref.translations, + translations = _ref$translations === void 0 ? {} : _ref$translations; + var _translations$titleTe = translations.titleText, + titleText = _translations$titleTe === void 0 ? 'Unable to fetch results' : _translations$titleTe, + _translations$helpTex = translations.helpText, + helpText = _translations$helpTex === void 0 ? 'You might want to check your network connection.' : _translations$helpTex; + return /*#__PURE__*/React.createElement("div", { + className: "DocSearch-ErrorScreen" + }, /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Screen-Icon" + }, /*#__PURE__*/React.createElement(ErrorIcon, null)), /*#__PURE__*/React.createElement("p", { + className: "DocSearch-Title" + }, titleText), /*#__PURE__*/React.createElement("p", { + className: "DocSearch-Help" + }, helpText)); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/Footer.d.ts b/node_modules/@docsearch/react/dist/esm/Footer.d.ts new file mode 100644 index 0000000000..25c13ee4f3 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/Footer.d.ts @@ -0,0 +1,16 @@ +/// +export declare type FooterTranslations = Partial<{ + selectText: string; + selectKeyAriaLabel: string; + navigateText: string; + navigateUpKeyAriaLabel: string; + navigateDownKeyAriaLabel: string; + closeText: string; + closeKeyAriaLabel: string; + searchByText: string; +}>; +declare type FooterProps = Partial<{ + translations: FooterTranslations; +}>; +export declare function Footer({ translations }: FooterProps): JSX.Element; +export {}; diff --git a/node_modules/@docsearch/react/dist/esm/Footer.js b/node_modules/@docsearch/react/dist/esm/Footer.js new file mode 100644 index 0000000000..dae9cdf418 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/Footer.js @@ -0,0 +1,77 @@ +import React from 'react'; +import { AlgoliaLogo } from './AlgoliaLogo'; + +function CommandIcon(props) { + return /*#__PURE__*/React.createElement("svg", { + width: "15", + height: "15", + "aria-label": props.ariaLabel, + role: "img" + }, /*#__PURE__*/React.createElement("g", { + fill: "none", + stroke: "currentColor", + strokeLinecap: "round", + strokeLinejoin: "round", + strokeWidth: "1.2" + }, props.children)); +} + +export function Footer(_ref) { + var _ref$translations = _ref.translations, + translations = _ref$translations === void 0 ? {} : _ref$translations; + var _translations$selectT = translations.selectText, + selectText = _translations$selectT === void 0 ? 'to select' : _translations$selectT, + _translations$selectK = translations.selectKeyAriaLabel, + selectKeyAriaLabel = _translations$selectK === void 0 ? 'Enter key' : _translations$selectK, + _translations$navigat = translations.navigateText, + navigateText = _translations$navigat === void 0 ? 'to navigate' : _translations$navigat, + _translations$navigat2 = translations.navigateUpKeyAriaLabel, + navigateUpKeyAriaLabel = _translations$navigat2 === void 0 ? 'Arrow up' : _translations$navigat2, + _translations$navigat3 = translations.navigateDownKeyAriaLabel, + navigateDownKeyAriaLabel = _translations$navigat3 === void 0 ? 'Arrow down' : _translations$navigat3, + _translations$closeTe = translations.closeText, + closeText = _translations$closeTe === void 0 ? 'to close' : _translations$closeTe, + _translations$closeKe = translations.closeKeyAriaLabel, + closeKeyAriaLabel = _translations$closeKe === void 0 ? 'Escape key' : _translations$closeKe, + _translations$searchB = translations.searchByText, + searchByText = _translations$searchB === void 0 ? 'Search by' : _translations$searchB; + return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Logo" + }, /*#__PURE__*/React.createElement(AlgoliaLogo, { + translations: { + searchByText: searchByText + } + })), /*#__PURE__*/React.createElement("ul", { + className: "DocSearch-Commands" + }, /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("span", { + className: "DocSearch-Commands-Key" + }, /*#__PURE__*/React.createElement(CommandIcon, { + ariaLabel: selectKeyAriaLabel + }, /*#__PURE__*/React.createElement("path", { + d: "M12 3.53088v3c0 1-1 2-2 2H4M7 11.53088l-3-3 3-3" + }))), /*#__PURE__*/React.createElement("span", { + className: "DocSearch-Label" + }, selectText)), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("span", { + className: "DocSearch-Commands-Key" + }, /*#__PURE__*/React.createElement(CommandIcon, { + ariaLabel: navigateDownKeyAriaLabel + }, /*#__PURE__*/React.createElement("path", { + d: "M7.5 3.5v8M10.5 8.5l-3 3-3-3" + }))), /*#__PURE__*/React.createElement("span", { + className: "DocSearch-Commands-Key" + }, /*#__PURE__*/React.createElement(CommandIcon, { + ariaLabel: navigateUpKeyAriaLabel + }, /*#__PURE__*/React.createElement("path", { + d: "M7.5 11.5v-8M10.5 6.5l-3-3-3 3" + }))), /*#__PURE__*/React.createElement("span", { + className: "DocSearch-Label" + }, navigateText)), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("span", { + className: "DocSearch-Commands-Key" + }, /*#__PURE__*/React.createElement(CommandIcon, { + ariaLabel: closeKeyAriaLabel + }, /*#__PURE__*/React.createElement("path", { + d: "M13.6167 8.936c-.1065.3583-.6883.962-1.4875.962-.7993 0-1.653-.9165-1.653-2.1258v-.5678c0-1.2548.7896-2.1016 1.653-2.1016.8634 0 1.3601.4778 1.4875 1.0724M9 6c-.1352-.4735-.7506-.9219-1.46-.8972-.7092.0246-1.344.57-1.344 1.2166s.4198.8812 1.3445.9805C8.465 7.3992 8.968 7.9337 9 8.5c.032.5663-.454 1.398-1.4595 1.398C6.6593 9.898 6 9 5.963 8.4851m-1.4748.5368c-.2635.5941-.8099.876-1.5443.876s-1.7073-.6248-1.7073-2.204v-.4603c0-1.0416.721-2.131 1.7073-2.131.9864 0 1.6425 1.031 1.5443 2.2492h-2.956" + }))), /*#__PURE__*/React.createElement("span", { + className: "DocSearch-Label" + }, closeText)))); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/Hit.d.ts b/node_modules/@docsearch/react/dist/esm/Hit.d.ts new file mode 100644 index 0000000000..b0107363c3 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/Hit.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import type { InternalDocSearchHit, StoredDocSearchHit } from './types'; +interface HitProps { + hit: InternalDocSearchHit | StoredDocSearchHit; + children: React.ReactNode; +} +export declare function Hit({ hit, children }: HitProps): JSX.Element; +export {}; diff --git a/node_modules/@docsearch/react/dist/esm/Hit.js b/node_modules/@docsearch/react/dist/esm/Hit.js new file mode 100644 index 0000000000..00bf82c1b5 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/Hit.js @@ -0,0 +1,8 @@ +import React from 'react'; +export function Hit(_ref) { + var hit = _ref.hit, + children = _ref.children; + return /*#__PURE__*/React.createElement("a", { + href: hit.url + }, children); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/NoResultsScreen.d.ts b/node_modules/@docsearch/react/dist/esm/NoResultsScreen.d.ts new file mode 100644 index 0000000000..4f74a88ae9 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/NoResultsScreen.d.ts @@ -0,0 +1,14 @@ +/// +import type { ScreenStateProps } from './ScreenState'; +import type { InternalDocSearchHit } from './types'; +export declare type NoResultsScreenTranslations = Partial<{ + noResultsText: string; + suggestedQueryText: string; + reportMissingResultsText: string; + reportMissingResultsLinkText: string; +}>; +declare type NoResultsScreenProps = Omit, 'translations'> & { + translations?: NoResultsScreenTranslations; +}; +export declare function NoResultsScreen({ translations, ...props }: NoResultsScreenProps): JSX.Element; +export {}; diff --git a/node_modules/@docsearch/react/dist/esm/NoResultsScreen.js b/node_modules/@docsearch/react/dist/esm/NoResultsScreen.js new file mode 100644 index 0000000000..fc12042a8f --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/NoResultsScreen.js @@ -0,0 +1,67 @@ +var _excluded = ["translations"]; + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +import React from 'react'; +import { NoResultsIcon } from './icons'; +export function NoResultsScreen(_ref) { + var _ref$translations = _ref.translations, + translations = _ref$translations === void 0 ? {} : _ref$translations, + props = _objectWithoutProperties(_ref, _excluded); + + var _translations$noResul = translations.noResultsText, + noResultsText = _translations$noResul === void 0 ? 'No results for' : _translations$noResul, + _translations$suggest = translations.suggestedQueryText, + suggestedQueryText = _translations$suggest === void 0 ? 'Try searching for' : _translations$suggest, + _translations$reportM = translations.reportMissingResultsText, + reportMissingResultsText = _translations$reportM === void 0 ? 'Believe this query should return results?' : _translations$reportM, + _translations$reportM2 = translations.reportMissingResultsLinkText, + reportMissingResultsLinkText = _translations$reportM2 === void 0 ? 'Let us know.' : _translations$reportM2; + var searchSuggestions = props.state.context.searchSuggestions; + return /*#__PURE__*/React.createElement("div", { + className: "DocSearch-NoResults" + }, /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Screen-Icon" + }, /*#__PURE__*/React.createElement(NoResultsIcon, null)), /*#__PURE__*/React.createElement("p", { + className: "DocSearch-Title" + }, noResultsText, " \"", /*#__PURE__*/React.createElement("strong", null, props.state.query), "\""), searchSuggestions && searchSuggestions.length > 0 && /*#__PURE__*/React.createElement("div", { + className: "DocSearch-NoResults-Prefill-List" + }, /*#__PURE__*/React.createElement("p", { + className: "DocSearch-Help" + }, suggestedQueryText, ":"), /*#__PURE__*/React.createElement("ul", null, searchSuggestions.slice(0, 3).reduce(function (acc, search) { + return [].concat(_toConsumableArray(acc), [/*#__PURE__*/React.createElement("li", { + key: search + }, /*#__PURE__*/React.createElement("button", { + className: "DocSearch-Prefill", + key: search, + type: "button", + onClick: function onClick() { + props.setQuery(search.toLowerCase() + ' '); + props.refresh(); + props.inputRef.current.focus(); + } + }, search))]); + }, []))), props.getMissingResultsUrl && /*#__PURE__*/React.createElement("p", { + className: "DocSearch-Help" + }, "".concat(reportMissingResultsText, " "), /*#__PURE__*/React.createElement("a", { + href: props.getMissingResultsUrl({ + query: props.state.query + }), + target: "_blank", + rel: "noopener noreferrer" + }, reportMissingResultsLinkText))); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/Results.d.ts b/node_modules/@docsearch/react/dist/esm/Results.d.ts new file mode 100644 index 0000000000..ccbd396938 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/Results.d.ts @@ -0,0 +1,21 @@ +import type { AutocompleteApi, AutocompleteState, BaseItem } from '@algolia/autocomplete-core'; +import React from 'react'; +import type { DocSearchProps } from './DocSearch'; +import type { StoredDocSearchHit } from './types'; +interface ResultsProps extends AutocompleteApi { + title: string; + collection: AutocompleteState['collections'][0]; + renderIcon: (props: { + item: TItem; + index: number; + }) => React.ReactNode; + renderAction: (props: { + item: TItem; + runDeleteTransition: (cb: () => void) => void; + runFavoriteTransition: (cb: () => void) => void; + }) => React.ReactNode; + onItemClick: (item: TItem) => void; + hitComponent: DocSearchProps['hitComponent']; +} +export declare function Results(props: ResultsProps): JSX.Element | null; +export {}; diff --git a/node_modules/@docsearch/react/dist/esm/Results.js b/node_modules/@docsearch/react/dist/esm/Results.js new file mode 100644 index 0000000000..dd16393722 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/Results.js @@ -0,0 +1,123 @@ +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +import React from 'react'; +import { Snippet } from './Snippet'; +export function Results(props) { + if (!props.collection || props.collection.items.length === 0) { + return null; + } + + return /*#__PURE__*/React.createElement("section", { + className: "DocSearch-Hits" + }, /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Hit-source" + }, props.title), /*#__PURE__*/React.createElement("ul", props.getListProps(), props.collection.items.map(function (item, index) { + return /*#__PURE__*/React.createElement(Result, _extends({ + key: [props.title, item.objectID].join(':'), + item: item, + index: index + }, props)); + }))); +} + +function Result(_ref) { + var item = _ref.item, + index = _ref.index, + renderIcon = _ref.renderIcon, + renderAction = _ref.renderAction, + getItemProps = _ref.getItemProps, + onItemClick = _ref.onItemClick, + collection = _ref.collection, + hitComponent = _ref.hitComponent; + + var _React$useState = React.useState(false), + _React$useState2 = _slicedToArray(_React$useState, 2), + isDeleting = _React$useState2[0], + setIsDeleting = _React$useState2[1]; + + var _React$useState3 = React.useState(false), + _React$useState4 = _slicedToArray(_React$useState3, 2), + isFavoriting = _React$useState4[0], + setIsFavoriting = _React$useState4[1]; + + var action = React.useRef(null); + var Hit = hitComponent; + + function runDeleteTransition(cb) { + setIsDeleting(true); + action.current = cb; + } + + function runFavoriteTransition(cb) { + setIsFavoriting(true); + action.current = cb; + } + + return /*#__PURE__*/React.createElement("li", _extends({ + className: ['DocSearch-Hit', item.__docsearch_parent && 'DocSearch-Hit--Child', isDeleting && 'DocSearch-Hit--deleting', isFavoriting && 'DocSearch-Hit--favoriting'].filter(Boolean).join(' '), + onTransitionEnd: function onTransitionEnd() { + if (action.current) { + action.current(); + } + } + }, getItemProps({ + item: item, + source: collection.source, + onClick: function onClick() { + onItemClick(item); + } + })), /*#__PURE__*/React.createElement(Hit, { + hit: item + }, /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Hit-Container" + }, renderIcon({ + item: item, + index: index + }), item.hierarchy[item.type] && item.type === 'lvl1' && /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Hit-content-wrapper" + }, /*#__PURE__*/React.createElement(Snippet, { + className: "DocSearch-Hit-title", + hit: item, + attribute: "hierarchy.lvl1" + }), item.content && /*#__PURE__*/React.createElement(Snippet, { + className: "DocSearch-Hit-path", + hit: item, + attribute: "content" + })), item.hierarchy[item.type] && (item.type === 'lvl2' || item.type === 'lvl3' || item.type === 'lvl4' || item.type === 'lvl5' || item.type === 'lvl6') && /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Hit-content-wrapper" + }, /*#__PURE__*/React.createElement(Snippet, { + className: "DocSearch-Hit-title", + hit: item, + attribute: "hierarchy.".concat(item.type) + }), /*#__PURE__*/React.createElement(Snippet, { + className: "DocSearch-Hit-path", + hit: item, + attribute: "hierarchy.lvl1" + })), item.type === 'content' && /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Hit-content-wrapper" + }, /*#__PURE__*/React.createElement(Snippet, { + className: "DocSearch-Hit-title", + hit: item, + attribute: "content" + }), /*#__PURE__*/React.createElement(Snippet, { + className: "DocSearch-Hit-path", + hit: item, + attribute: "hierarchy.lvl1" + })), renderAction({ + item: item, + runDeleteTransition: runDeleteTransition, + runFavoriteTransition: runFavoriteTransition + })))); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/ResultsScreen.d.ts b/node_modules/@docsearch/react/dist/esm/ResultsScreen.d.ts new file mode 100644 index 0000000000..abe277b266 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/ResultsScreen.d.ts @@ -0,0 +1,6 @@ +/// +import type { ScreenStateProps } from './ScreenState'; +import type { InternalDocSearchHit } from './types'; +declare type ResultsScreenProps = Omit, 'translations'>; +export declare function ResultsScreen(props: ResultsScreenProps): JSX.Element; +export {}; diff --git a/node_modules/@docsearch/react/dist/esm/ResultsScreen.js b/node_modules/@docsearch/react/dist/esm/ResultsScreen.js new file mode 100644 index 0000000000..27c2bf59e2 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/ResultsScreen.js @@ -0,0 +1,55 @@ +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +import React from 'react'; +import { SelectIcon, SourceIcon } from './icons'; +import { Results } from './Results'; +import { removeHighlightTags } from './utils'; +export function ResultsScreen(props) { + return /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Dropdown-Container" + }, props.state.collections.map(function (collection) { + if (collection.items.length === 0) { + return null; + } + + var title = removeHighlightTags(collection.items[0]); + return /*#__PURE__*/React.createElement(Results, _extends({}, props, { + key: collection.source.sourceId, + title: title, + collection: collection, + renderIcon: function renderIcon(_ref) { + var _collection$items; + + var item = _ref.item, + index = _ref.index; + return /*#__PURE__*/React.createElement(React.Fragment, null, item.__docsearch_parent && /*#__PURE__*/React.createElement("svg", { + className: "DocSearch-Hit-Tree", + viewBox: "0 0 24 54" + }, /*#__PURE__*/React.createElement("g", { + stroke: "currentColor", + fill: "none", + fillRule: "evenodd", + strokeLinecap: "round", + strokeLinejoin: "round" + }, item.__docsearch_parent !== ((_collection$items = collection.items[index + 1]) === null || _collection$items === void 0 ? void 0 : _collection$items.__docsearch_parent) ? /*#__PURE__*/React.createElement("path", { + d: "M8 6v21M20 27H8.3" + }) : /*#__PURE__*/React.createElement("path", { + d: "M8 6v42M20 27H8.3" + }))), /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Hit-icon" + }, /*#__PURE__*/React.createElement(SourceIcon, { + type: item.type + }))); + }, + renderAction: function renderAction() { + return /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Hit-action" + }, /*#__PURE__*/React.createElement(SelectIcon, null)); + } + })); + }), props.resultsFooterComponent && /*#__PURE__*/React.createElement("section", { + className: "DocSearch-HitsFooter" + }, /*#__PURE__*/React.createElement(props.resultsFooterComponent, { + state: props.state + }))); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/ScreenState.d.ts b/node_modules/@docsearch/react/dist/esm/ScreenState.d.ts new file mode 100644 index 0000000000..2859010c39 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/ScreenState.d.ts @@ -0,0 +1,27 @@ +import type { AutocompleteApi, AutocompleteState, BaseItem } from '@algolia/autocomplete-core'; +import React from 'react'; +import type { DocSearchProps } from './DocSearch'; +import type { ErrorScreenTranslations } from './ErrorScreen'; +import type { NoResultsScreenTranslations } from './NoResultsScreen'; +import type { StartScreenTranslations } from './StartScreen'; +import type { StoredSearchPlugin } from './stored-searches'; +import type { InternalDocSearchHit, StoredDocSearchHit } from './types'; +export declare type ScreenStateTranslations = Partial<{ + errorScreen: ErrorScreenTranslations; + startScreen: StartScreenTranslations; + noResultsScreen: NoResultsScreenTranslations; +}>; +export interface ScreenStateProps extends AutocompleteApi { + state: AutocompleteState; + recentSearches: StoredSearchPlugin; + favoriteSearches: StoredSearchPlugin; + onItemClick: (item: InternalDocSearchHit) => void; + inputRef: React.MutableRefObject; + hitComponent: DocSearchProps['hitComponent']; + indexName: DocSearchProps['indexName']; + disableUserPersonalization: boolean; + resultsFooterComponent: DocSearchProps['resultsFooterComponent']; + translations: ScreenStateTranslations; + getMissingResultsUrl?: DocSearchProps['getMissingResultsUrl']; +} +export declare const ScreenState: React.MemoExoticComponent<({ translations, ...props }: ScreenStateProps) => JSX.Element>; diff --git a/node_modules/@docsearch/react/dist/esm/ScreenState.js b/node_modules/@docsearch/react/dist/esm/ScreenState.js new file mode 100644 index 0000000000..1dbf1a4ee6 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/ScreenState.js @@ -0,0 +1,49 @@ +var _excluded = ["translations"]; + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +import React from 'react'; +import { ErrorScreen } from './ErrorScreen'; +import { NoResultsScreen } from './NoResultsScreen'; +import { ResultsScreen } from './ResultsScreen'; +import { StartScreen } from './StartScreen'; +export var ScreenState = React.memo(function (_ref) { + var _ref$translations = _ref.translations, + translations = _ref$translations === void 0 ? {} : _ref$translations, + props = _objectWithoutProperties(_ref, _excluded); + + if (props.state.status === 'error') { + return /*#__PURE__*/React.createElement(ErrorScreen, { + translations: translations === null || translations === void 0 ? void 0 : translations.errorScreen + }); + } + + var hasCollections = props.state.collections.some(function (collection) { + return collection.items.length > 0; + }); + + if (!props.state.query) { + return /*#__PURE__*/React.createElement(StartScreen, _extends({}, props, { + hasCollections: hasCollections, + translations: translations === null || translations === void 0 ? void 0 : translations.startScreen + })); + } + + if (hasCollections === false) { + return /*#__PURE__*/React.createElement(NoResultsScreen, _extends({}, props, { + translations: translations === null || translations === void 0 ? void 0 : translations.noResultsScreen + })); + } + + return /*#__PURE__*/React.createElement(ResultsScreen, props); +}, function areEqual(_prevProps, nextProps) { + // We don't update the screen when Autocomplete is loading or stalled to + // avoid UI flashes: + // - Empty screen → Results screen + // - NoResults screen → NoResults screen with another query + return nextProps.state.status === 'loading' || nextProps.state.status === 'stalled'; +}); \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/SearchBox.d.ts b/node_modules/@docsearch/react/dist/esm/SearchBox.d.ts new file mode 100644 index 0000000000..65401a0ad1 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/SearchBox.d.ts @@ -0,0 +1,20 @@ +import type { AutocompleteApi, AutocompleteState } from '@algolia/autocomplete-core'; +import type { MutableRefObject } from 'react'; +import React from 'react'; +import type { InternalDocSearchHit } from './types'; +export declare type SearchBoxTranslations = Partial<{ + resetButtonTitle: string; + resetButtonAriaLabel: string; + cancelButtonText: string; + cancelButtonAriaLabel: string; +}>; +interface SearchBoxProps extends AutocompleteApi { + state: AutocompleteState; + autoFocus: boolean; + inputRef: MutableRefObject; + onClose: () => void; + isFromSelection: boolean; + translations?: SearchBoxTranslations; +} +export declare function SearchBox({ translations, ...props }: SearchBoxProps): JSX.Element; +export {}; diff --git a/node_modules/@docsearch/react/dist/esm/SearchBox.js b/node_modules/@docsearch/react/dist/esm/SearchBox.js new file mode 100644 index 0000000000..92130258a2 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/SearchBox.js @@ -0,0 +1,72 @@ +var _excluded = ["translations"]; + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +import React from 'react'; +import { MAX_QUERY_SIZE } from './constants'; +import { LoadingIcon } from './icons/LoadingIcon'; +import { ResetIcon } from './icons/ResetIcon'; +import { SearchIcon } from './icons/SearchIcon'; +export function SearchBox(_ref) { + var _ref$translations = _ref.translations, + translations = _ref$translations === void 0 ? {} : _ref$translations, + props = _objectWithoutProperties(_ref, _excluded); + + var _translations$resetBu = translations.resetButtonTitle, + resetButtonTitle = _translations$resetBu === void 0 ? 'Clear the query' : _translations$resetBu, + _translations$resetBu2 = translations.resetButtonAriaLabel, + resetButtonAriaLabel = _translations$resetBu2 === void 0 ? 'Clear the query' : _translations$resetBu2, + _translations$cancelB = translations.cancelButtonText, + cancelButtonText = _translations$cancelB === void 0 ? 'Cancel' : _translations$cancelB, + _translations$cancelB2 = translations.cancelButtonAriaLabel, + cancelButtonAriaLabel = _translations$cancelB2 === void 0 ? 'Cancel' : _translations$cancelB2; + + var _props$getFormProps = props.getFormProps({ + inputElement: props.inputRef.current + }), + onReset = _props$getFormProps.onReset; + + React.useEffect(function () { + if (props.autoFocus && props.inputRef.current) { + props.inputRef.current.focus(); + } + }, [props.autoFocus, props.inputRef]); + React.useEffect(function () { + if (props.isFromSelection && props.inputRef.current) { + props.inputRef.current.select(); + } + }, [props.isFromSelection, props.inputRef]); + return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("form", { + className: "DocSearch-Form", + onSubmit: function onSubmit(event) { + event.preventDefault(); + }, + onReset: onReset + }, /*#__PURE__*/React.createElement("label", _extends({ + className: "DocSearch-MagnifierLabel" + }, props.getLabelProps()), /*#__PURE__*/React.createElement(SearchIcon, null)), /*#__PURE__*/React.createElement("div", { + className: "DocSearch-LoadingIndicator" + }, /*#__PURE__*/React.createElement(LoadingIcon, null)), /*#__PURE__*/React.createElement("input", _extends({ + className: "DocSearch-Input", + ref: props.inputRef + }, props.getInputProps({ + inputElement: props.inputRef.current, + autoFocus: props.autoFocus, + maxLength: MAX_QUERY_SIZE + }))), /*#__PURE__*/React.createElement("button", { + type: "reset", + title: resetButtonTitle, + className: "DocSearch-Reset", + "aria-label": resetButtonAriaLabel, + hidden: !props.state.query + }, /*#__PURE__*/React.createElement(ResetIcon, null))), /*#__PURE__*/React.createElement("button", { + className: "DocSearch-Cancel", + type: "reset", + "aria-label": cancelButtonAriaLabel, + onClick: props.onClose + }, cancelButtonText)); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/Snippet.d.ts b/node_modules/@docsearch/react/dist/esm/Snippet.d.ts new file mode 100644 index 0000000000..655e17e898 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/Snippet.d.ts @@ -0,0 +1,14 @@ +/// +import type { StoredDocSearchHit } from './types'; +interface SnippetProps { + hit: TItem; + attribute: string; + tagName?: string; + [prop: string]: unknown; +} +export declare function Snippet({ hit, attribute, tagName, ...rest }: SnippetProps): import("react").DOMElement<{ + dangerouslySetInnerHTML: { + __html: any; + }; +}, Element>; +export {}; diff --git a/node_modules/@docsearch/react/dist/esm/Snippet.js b/node_modules/@docsearch/react/dist/esm/Snippet.js new file mode 100644 index 0000000000..3937093f88 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/Snippet.js @@ -0,0 +1,35 @@ +var _excluded = ["hit", "attribute", "tagName"]; + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +import { createElement } from 'react'; + +function getPropertyByPath(object, path) { + var parts = path.split('.'); + return parts.reduce(function (prev, current) { + if (prev !== null && prev !== void 0 && prev[current]) return prev[current]; + return null; + }, object); +} + +export function Snippet(_ref) { + var hit = _ref.hit, + attribute = _ref.attribute, + _ref$tagName = _ref.tagName, + tagName = _ref$tagName === void 0 ? 'span' : _ref$tagName, + rest = _objectWithoutProperties(_ref, _excluded); + + return createElement(tagName, _objectSpread(_objectSpread({}, rest), {}, { + dangerouslySetInnerHTML: { + __html: getPropertyByPath(hit, "_snippetResult.".concat(attribute, ".value")) || getPropertyByPath(hit, attribute) + } + })); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/StartScreen.d.ts b/node_modules/@docsearch/react/dist/esm/StartScreen.d.ts new file mode 100644 index 0000000000..250eff76db --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/StartScreen.d.ts @@ -0,0 +1,17 @@ +/// +import type { ScreenStateProps } from './ScreenState'; +import type { InternalDocSearchHit } from './types'; +export declare type StartScreenTranslations = Partial<{ + recentSearchesTitle: string; + noRecentSearchesText: string; + saveRecentSearchButtonTitle: string; + removeRecentSearchButtonTitle: string; + favoriteSearchesTitle: string; + removeFavoriteSearchButtonTitle: string; +}>; +declare type StartScreenProps = Omit, 'translations'> & { + hasCollections: boolean; + translations?: StartScreenTranslations; +}; +export declare function StartScreen({ translations, ...props }: StartScreenProps): JSX.Element | null; +export {}; diff --git a/node_modules/@docsearch/react/dist/esm/StartScreen.js b/node_modules/@docsearch/react/dist/esm/StartScreen.js new file mode 100644 index 0000000000..595ccb55d0 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/StartScreen.js @@ -0,0 +1,119 @@ +var _excluded = ["translations"]; + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +import React from 'react'; +import { RecentIcon, ResetIcon, StarIcon } from './icons'; +import { Results } from './Results'; +export function StartScreen(_ref) { + var _ref$translations = _ref.translations, + translations = _ref$translations === void 0 ? {} : _ref$translations, + props = _objectWithoutProperties(_ref, _excluded); + + var _translations$recentS = translations.recentSearchesTitle, + recentSearchesTitle = _translations$recentS === void 0 ? 'Recent' : _translations$recentS, + _translations$noRecen = translations.noRecentSearchesText, + noRecentSearchesText = _translations$noRecen === void 0 ? 'No recent searches' : _translations$noRecen, + _translations$saveRec = translations.saveRecentSearchButtonTitle, + saveRecentSearchButtonTitle = _translations$saveRec === void 0 ? 'Save this search' : _translations$saveRec, + _translations$removeR = translations.removeRecentSearchButtonTitle, + removeRecentSearchButtonTitle = _translations$removeR === void 0 ? 'Remove this search from history' : _translations$removeR, + _translations$favorit = translations.favoriteSearchesTitle, + favoriteSearchesTitle = _translations$favorit === void 0 ? 'Favorite' : _translations$favorit, + _translations$removeF = translations.removeFavoriteSearchButtonTitle, + removeFavoriteSearchButtonTitle = _translations$removeF === void 0 ? 'Remove this search from favorites' : _translations$removeF; + + if (props.state.status === 'idle' && props.hasCollections === false) { + if (props.disableUserPersonalization) { + return null; + } + + return /*#__PURE__*/React.createElement("div", { + className: "DocSearch-StartScreen" + }, /*#__PURE__*/React.createElement("p", { + className: "DocSearch-Help" + }, noRecentSearchesText)); + } + + if (props.hasCollections === false) { + return null; + } + + return /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Dropdown-Container" + }, /*#__PURE__*/React.createElement(Results, _extends({}, props, { + title: recentSearchesTitle, + collection: props.state.collections[0], + renderIcon: function renderIcon() { + return /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Hit-icon" + }, /*#__PURE__*/React.createElement(RecentIcon, null)); + }, + renderAction: function renderAction(_ref2) { + var item = _ref2.item, + runFavoriteTransition = _ref2.runFavoriteTransition, + runDeleteTransition = _ref2.runDeleteTransition; + return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Hit-action" + }, /*#__PURE__*/React.createElement("button", { + className: "DocSearch-Hit-action-button", + title: saveRecentSearchButtonTitle, + type: "submit", + onClick: function onClick(event) { + event.preventDefault(); + event.stopPropagation(); + runFavoriteTransition(function () { + props.favoriteSearches.add(item); + props.recentSearches.remove(item); + props.refresh(); + }); + } + }, /*#__PURE__*/React.createElement(StarIcon, null))), /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Hit-action" + }, /*#__PURE__*/React.createElement("button", { + className: "DocSearch-Hit-action-button", + title: removeRecentSearchButtonTitle, + type: "submit", + onClick: function onClick(event) { + event.preventDefault(); + event.stopPropagation(); + runDeleteTransition(function () { + props.recentSearches.remove(item); + props.refresh(); + }); + } + }, /*#__PURE__*/React.createElement(ResetIcon, null)))); + } + })), /*#__PURE__*/React.createElement(Results, _extends({}, props, { + title: favoriteSearchesTitle, + collection: props.state.collections[1], + renderIcon: function renderIcon() { + return /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Hit-icon" + }, /*#__PURE__*/React.createElement(StarIcon, null)); + }, + renderAction: function renderAction(_ref3) { + var item = _ref3.item, + runDeleteTransition = _ref3.runDeleteTransition; + return /*#__PURE__*/React.createElement("div", { + className: "DocSearch-Hit-action" + }, /*#__PURE__*/React.createElement("button", { + className: "DocSearch-Hit-action-button", + title: removeFavoriteSearchButtonTitle, + type: "submit", + onClick: function onClick(event) { + event.preventDefault(); + event.stopPropagation(); + runDeleteTransition(function () { + props.favoriteSearches.remove(item); + props.refresh(); + }); + } + }, /*#__PURE__*/React.createElement(ResetIcon, null))); + } + }))); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/__tests__/api.test.js b/node_modules/@docsearch/react/dist/esm/__tests__/api.test.js new file mode 100644 index 0000000000..3d82f03293 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/__tests__/api.test.js @@ -0,0 +1,345 @@ +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } + +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +import { render, fireEvent, waitFor, screen, act } from '@testing-library/react'; +import React from 'react'; +import '@testing-library/jest-dom'; +import { DocSearch as DocSearchComponent } from '../DocSearch'; + +function DocSearch(props) { + return /*#__PURE__*/React.createElement(DocSearchComponent, _extends({ + appId: "woo", + apiKey: "foo", + indexName: "bar" + }, props)); +} // mock empty response + + +function noResultSearch(_queries, _requestOptions) { + return new Promise(function (resolve) { + resolve({ + results: [{ + hits: [], + hitsPerPage: 0, + nbHits: 0, + nbPages: 0, + page: 0, + processingTimeMS: 0, + exhaustiveNbHits: true, + params: '', + query: '' + }] + }); + }); +} + +describe('api', function () { + beforeEach(function () { + document.body.innerHTML = ''; + }); + it('renders with minimal parameters', function () { + render( /*#__PURE__*/React.createElement(DocSearch, null)); + expect(document.querySelector('.DocSearch')).toBeInTheDocument(); + }); + describe('translations', function () { + it('overrides the default DocSearchButton text', function () { + render( /*#__PURE__*/React.createElement(DocSearch, { + translations: { + button: { + buttonText: 'Recherche', + buttonAriaLabel: 'Recherche' + } + } + })); + expect(document.querySelector('.DocSearch-Button-Placeholder').innerHTML).toBe('Recherche'); + expect(document.querySelector('.DocSearch-Button').getAttribute('aria-label')).toBe('Recherche'); + }); + it('overrides the default DocSearchModal startScreen text', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { + return regeneratorRuntime.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + render( /*#__PURE__*/React.createElement(DocSearch, { + translations: { + modal: { + startScreen: { + noRecentSearchesText: 'Pas de recherche récentes' + } + } + } + })); + _context.next = 3; + return waitFor(function () { + fireEvent.click(document.querySelector('.DocSearch-Button')); + }); + + case 3: + expect(screen.getByText('Pas de recherche récentes')).toBeInTheDocument(); + + case 4: + case "end": + return _context.stop(); + } + } + }, _callee); + }))); + it('overrides the default DocSearchModal noResultsScreen text', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() { + return regeneratorRuntime.wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + render( /*#__PURE__*/React.createElement(DocSearch, { + transformSearchClient: function transformSearchClient(searchClient) { + return _objectSpread(_objectSpread({}, searchClient), {}, { + search: noResultSearch + }); + }, + translations: { + modal: { + noResultsScreen: { + noResultsText: 'Pas de résultats pour', + reportMissingResultsText: 'Ouvrez une issue sur docsearch-configs', + reportMissingResultsLinkText: 'Lien du repo' + } + } + }, + getMissingResultsUrl: function getMissingResultsUrl() { + return 'algolia.com'; + } + })); + _context3.next = 3; + return act( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { + return regeneratorRuntime.wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _context2.next = 2; + return waitFor(function () { + fireEvent.click(document.querySelector('.DocSearch-Button')); + }); + + case 2: + fireEvent.input(document.querySelector('.DocSearch-Input'), { + target: { + value: 'q' + } + }); + + case 3: + case "end": + return _context2.stop(); + } + } + }, _callee2); + }))); + + case 3: + expect(screen.getByText(/Pas de résultats pour/)).toBeInTheDocument(); + expect(screen.getByText(/Ouvrez une issue sur docsearch-configs/)).toBeInTheDocument(); + expect(screen.getByRole('link', { + name: 'Lien du repo' + })).toBeInTheDocument(); + + case 6: + case "end": + return _context3.stop(); + } + } + }, _callee3); + }))); + it('overrides the default DocSearchModal searchbox text', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() { + return regeneratorRuntime.wrap(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + render( /*#__PURE__*/React.createElement(DocSearch, { + translations: { + modal: { + searchBox: { + resetButtonTitle: 'Effacer', + resetButtonAriaLabel: 'Effacer', + cancelButtonText: 'Annuler', + cancelButtonAriaLabel: 'Annuler' + } + } + } + })); + _context4.next = 3; + return waitFor(function () { + fireEvent.click(document.querySelector('.DocSearch-Button')); + }); + + case 3: + expect(document.querySelector('.DocSearch-Cancel').innerHTML).toBe('Annuler'); + expect(document.querySelector('.DocSearch-Cancel').getAttribute('aria-label')).toBe('Annuler'); + expect(document.querySelector('.DocSearch-Reset').getAttribute('title')).toBe('Effacer'); + expect(document.querySelector('.DocSearch-Reset').getAttribute('aria-label')).toBe('Effacer'); + + case 7: + case "end": + return _context4.stop(); + } + } + }, _callee4); + }))); + it('overrides the default DocSearchModal footer text', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() { + return regeneratorRuntime.wrap(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + render( /*#__PURE__*/React.createElement(DocSearch, { + translations: { + modal: { + footer: { + closeText: 'Pour fermer', + closeKeyAriaLabel: "Touche d'échappement", + navigateText: 'Pour naviguer', + navigateUpKeyAriaLabel: 'Flèche vers le haut', + navigateDownKeyAriaLabel: 'Flèche le bas', + searchByText: 'Recherche par', + selectText: 'Pour selectionner', + selectKeyAriaLabel: "Touche d'entrée" + } + } + } + })); + _context5.next = 3; + return waitFor(function () { + fireEvent.click(document.querySelector('.DocSearch-Button')); + }); + + case 3: + expect(screen.getByText('Recherche par')).toBeInTheDocument(); + expect(screen.getByText('Pour fermer')).toBeInTheDocument(); + expect(screen.getByText('Pour naviguer')).toBeInTheDocument(); + expect(screen.getByText('Pour selectionner')).toBeInTheDocument(); + expect(document.querySelector('.DocSearch-Commands-Key > svg[aria-label="Touche d\'échappement"]')).toBeInTheDocument(); + expect(document.querySelector('.DocSearch-Commands-Key > svg[aria-label="Flèche vers le haut"]')).toBeInTheDocument(); + expect(document.querySelector('.DocSearch-Commands-Key > svg[aria-label="Flèche le bas"]')).toBeInTheDocument(); + expect(document.querySelector('.DocSearch-Commands-Key > svg[aria-label="Touche d\'entrée"]')).toBeInTheDocument(); + + case 11: + case "end": + return _context5.stop(); + } + } + }, _callee5); + }))); + }); + describe('getMissingResultsUrl', function () { + it('does not render the link to the repository by default', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7() { + return regeneratorRuntime.wrap(function _callee7$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + render( /*#__PURE__*/React.createElement(DocSearch, { + transformSearchClient: function transformSearchClient(searchClient) { + return _objectSpread(_objectSpread({}, searchClient), {}, { + search: noResultSearch + }); + } + })); + _context7.next = 3; + return act( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() { + return regeneratorRuntime.wrap(function _callee6$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + _context6.next = 2; + return waitFor(function () { + fireEvent.click(document.querySelector('.DocSearch-Button')); + }); + + case 2: + fireEvent.input(document.querySelector('.DocSearch-Input'), { + target: { + value: 'q' + } + }); + + case 3: + case "end": + return _context6.stop(); + } + } + }, _callee6); + }))); + + case 3: + expect(screen.getByText(/No results for/)).toBeInTheDocument(); + expect(document.querySelector('.DocSearch-Help a')).not.toBeInTheDocument(); + + case 5: + case "end": + return _context7.stop(); + } + } + }, _callee7); + }))); + it('render the link to the repository', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() { + var link; + return regeneratorRuntime.wrap(function _callee9$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + render( /*#__PURE__*/React.createElement(DocSearch, { + transformSearchClient: function transformSearchClient(searchClient) { + return _objectSpread(_objectSpread({}, searchClient), {}, { + search: noResultSearch + }); + }, + getMissingResultsUrl: function getMissingResultsUrl(_ref9) { + var query = _ref9.query; + return "https://github.com/algolia/docsearch/issues/new?title=".concat(query); + } + })); + _context9.next = 3; + return act( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() { + return regeneratorRuntime.wrap(function _callee8$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + _context8.next = 2; + return waitFor(function () { + fireEvent.click(document.querySelector('.DocSearch-Button')); + }); + + case 2: + fireEvent.input(document.querySelector('.DocSearch-Input'), { + target: { + value: 'q' + } + }); + + case 3: + case "end": + return _context8.stop(); + } + } + }, _callee8); + }))); + + case 3: + expect(screen.getByText(/No results for/)).toBeInTheDocument(); + link = document.querySelector('.DocSearch-Help a'); + expect(link).toBeInTheDocument(); + expect(link.getAttribute('href')).toBe('https://github.com/algolia/docsearch/issues/new?title=q'); + + case 7: + case "end": + return _context9.stop(); + } + } + }, _callee9); + }))); + }); +}); \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/constants.d.ts b/node_modules/@docsearch/react/dist/esm/constants.d.ts new file mode 100644 index 0000000000..b44c01456d --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/constants.d.ts @@ -0,0 +1 @@ +export declare const MAX_QUERY_SIZE = 64; diff --git a/node_modules/@docsearch/react/dist/esm/constants.js b/node_modules/@docsearch/react/dist/esm/constants.js new file mode 100644 index 0000000000..9325780c8a --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/constants.js @@ -0,0 +1 @@ +export var MAX_QUERY_SIZE = 64; \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/icons/ControlKeyIcon.d.ts b/node_modules/@docsearch/react/dist/esm/icons/ControlKeyIcon.d.ts new file mode 100644 index 0000000000..61366a3fca --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/ControlKeyIcon.d.ts @@ -0,0 +1,2 @@ +/// +export declare function ControlKeyIcon(): JSX.Element; diff --git a/node_modules/@docsearch/react/dist/esm/icons/ControlKeyIcon.js b/node_modules/@docsearch/react/dist/esm/icons/ControlKeyIcon.js new file mode 100644 index 0000000000..ee3513dc7a --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/ControlKeyIcon.js @@ -0,0 +1,14 @@ +import React from 'react'; +export function ControlKeyIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "15", + height: "15", + className: "DocSearch-Control-Key-Icon" + }, /*#__PURE__*/React.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" + })); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/icons/ErrorIcon.d.ts b/node_modules/@docsearch/react/dist/esm/icons/ErrorIcon.d.ts new file mode 100644 index 0000000000..8285fb9279 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/ErrorIcon.d.ts @@ -0,0 +1,2 @@ +/// +export declare function ErrorIcon(): JSX.Element; diff --git a/node_modules/@docsearch/react/dist/esm/icons/ErrorIcon.js b/node_modules/@docsearch/react/dist/esm/icons/ErrorIcon.js new file mode 100644 index 0000000000..dee377d518 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/ErrorIcon.js @@ -0,0 +1,15 @@ +import React from 'react'; +export function ErrorIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "40", + height: "40", + viewBox: "0 0 20 20", + fill: "none", + fillRule: "evenodd", + stroke: "currentColor", + strokeLinecap: "round", + strokeLinejoin: "round" + }, /*#__PURE__*/React.createElement("path", { + d: "M19 4.8a16 16 0 00-2-1.2m-3.3-1.2A16 16 0 001.1 4.7M16.7 8a12 12 0 00-2.8-1.4M10 6a12 12 0 00-6.7 2M12.3 14.7a4 4 0 00-4.5 0M14.5 11.4A8 8 0 0010 10M3 16L18 2M10 18h0" + })); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/icons/GoToExternalIcon.d.ts b/node_modules/@docsearch/react/dist/esm/icons/GoToExternalIcon.d.ts new file mode 100644 index 0000000000..4358c6753d --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/GoToExternalIcon.d.ts @@ -0,0 +1,2 @@ +/// +export declare function GoToExternal(): JSX.Element; diff --git a/node_modules/@docsearch/react/dist/esm/icons/GoToExternalIcon.js b/node_modules/@docsearch/react/dist/esm/icons/GoToExternalIcon.js new file mode 100644 index 0000000000..d15deb7f22 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/GoToExternalIcon.js @@ -0,0 +1,11 @@ +import React from 'react'; +export function GoToExternal() { + return /*#__PURE__*/React.createElement("svg", { + width: "20", + height: "20" + }, /*#__PURE__*/React.createElement("path", { + d: "M5 6v9h9v-3a1 1 0 112 0v4l-1 1H4l-1-1V5l1-1h4a1 1 0 110 2H5zm5 5a1 1 0 11-1-1l5-6h-3a1 1 0 110-2h6a1 1 0 011 1v6a1 1 0 11-2 0V6l-6 5z", + fill: "currentColor", + fillRule: "nonzero" + })); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/icons/LoadingIcon.d.ts b/node_modules/@docsearch/react/dist/esm/icons/LoadingIcon.d.ts new file mode 100644 index 0000000000..50d75750f3 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/LoadingIcon.d.ts @@ -0,0 +1,2 @@ +/// +export declare function LoadingIcon(): JSX.Element; diff --git a/node_modules/@docsearch/react/dist/esm/icons/LoadingIcon.js b/node_modules/@docsearch/react/dist/esm/icons/LoadingIcon.js new file mode 100644 index 0000000000..6aec628fc0 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/LoadingIcon.js @@ -0,0 +1,28 @@ +import React from 'react'; +export function LoadingIcon() { + return /*#__PURE__*/React.createElement("svg", { + viewBox: "0 0 38 38", + stroke: "currentColor", + strokeOpacity: ".5" + }, /*#__PURE__*/React.createElement("g", { + fill: "none", + fillRule: "evenodd" + }, /*#__PURE__*/React.createElement("g", { + transform: "translate(1 1)", + strokeWidth: "2" + }, /*#__PURE__*/React.createElement("circle", { + strokeOpacity: ".3", + cx: "18", + cy: "18", + r: "18" + }), /*#__PURE__*/React.createElement("path", { + d: "M36 18c0-9.94-8.06-18-18-18" + }, /*#__PURE__*/React.createElement("animateTransform", { + attributeName: "transform", + type: "rotate", + from: "0 18 18", + to: "360 18 18", + dur: "1s", + repeatCount: "indefinite" + }))))); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/icons/NoResultsIcon.d.ts b/node_modules/@docsearch/react/dist/esm/icons/NoResultsIcon.d.ts new file mode 100644 index 0000000000..4a84d53c7b --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/NoResultsIcon.d.ts @@ -0,0 +1,2 @@ +/// +export declare function NoResultsIcon(): JSX.Element; diff --git a/node_modules/@docsearch/react/dist/esm/icons/NoResultsIcon.js b/node_modules/@docsearch/react/dist/esm/icons/NoResultsIcon.js new file mode 100644 index 0000000000..e5cf412115 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/NoResultsIcon.js @@ -0,0 +1,15 @@ +import React from 'react'; +export function NoResultsIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "40", + height: "40", + viewBox: "0 0 20 20", + fill: "none", + fillRule: "evenodd", + stroke: "currentColor", + strokeLinecap: "round", + strokeLinejoin: "round" + }, /*#__PURE__*/React.createElement("path", { + d: "M15.5 4.8c2 3 1.7 7-1 9.7h0l4.3 4.3-4.3-4.3a7.8 7.8 0 01-9.8 1m-2.2-2.2A7.8 7.8 0 0113.2 2.4M2 18L18 2" + })); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/icons/RecentIcon.d.ts b/node_modules/@docsearch/react/dist/esm/icons/RecentIcon.d.ts new file mode 100644 index 0000000000..450aed3d80 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/RecentIcon.d.ts @@ -0,0 +1,2 @@ +/// +export declare function RecentIcon(): JSX.Element; diff --git a/node_modules/@docsearch/react/dist/esm/icons/RecentIcon.js b/node_modules/@docsearch/react/dist/esm/icons/RecentIcon.js new file mode 100644 index 0000000000..6670ff6169 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/RecentIcon.js @@ -0,0 +1,18 @@ +import React from 'react'; +export function RecentIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "20", + height: "20", + viewBox: "0 0 20 20" + }, /*#__PURE__*/React.createElement("g", { + stroke: "currentColor", + fill: "none", + fillRule: "evenodd", + strokeLinecap: "round", + strokeLinejoin: "round" + }, /*#__PURE__*/React.createElement("path", { + d: "M3.18 6.6a8.23 8.23 0 1112.93 9.94h0a8.23 8.23 0 01-11.63 0" + }), /*#__PURE__*/React.createElement("path", { + d: "M6.44 7.25H2.55V3.36M10.45 6v5.6M10.45 11.6L13 13" + }))); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/icons/ResetIcon.d.ts b/node_modules/@docsearch/react/dist/esm/icons/ResetIcon.d.ts new file mode 100644 index 0000000000..39b63becb4 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/ResetIcon.d.ts @@ -0,0 +1,2 @@ +/// +export declare function ResetIcon(): JSX.Element; diff --git a/node_modules/@docsearch/react/dist/esm/icons/ResetIcon.js b/node_modules/@docsearch/react/dist/esm/icons/ResetIcon.js new file mode 100644 index 0000000000..be14662d0d --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/ResetIcon.js @@ -0,0 +1,15 @@ +import React from 'react'; +export function ResetIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "20", + height: "20", + viewBox: "0 0 20 20" + }, /*#__PURE__*/React.createElement("path", { + d: "M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z", + stroke: "currentColor", + fill: "none", + fillRule: "evenodd", + strokeLinecap: "round", + strokeLinejoin: "round" + })); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/icons/SearchIcon.d.ts b/node_modules/@docsearch/react/dist/esm/icons/SearchIcon.d.ts new file mode 100644 index 0000000000..130698d8d9 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/SearchIcon.d.ts @@ -0,0 +1,2 @@ +/// +export declare function SearchIcon(): JSX.Element; diff --git a/node_modules/@docsearch/react/dist/esm/icons/SearchIcon.js b/node_modules/@docsearch/react/dist/esm/icons/SearchIcon.js new file mode 100644 index 0000000000..ff57b51c05 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/SearchIcon.js @@ -0,0 +1,16 @@ +import React from 'react'; +export function SearchIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "20", + height: "20", + className: "DocSearch-Search-Icon", + viewBox: "0 0 20 20" + }, /*#__PURE__*/React.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" + })); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/icons/SelectIcon.d.ts b/node_modules/@docsearch/react/dist/esm/icons/SelectIcon.d.ts new file mode 100644 index 0000000000..7b7a45a9f4 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/SelectIcon.d.ts @@ -0,0 +1,2 @@ +/// +export declare function SelectIcon(): JSX.Element; diff --git a/node_modules/@docsearch/react/dist/esm/icons/SelectIcon.js b/node_modules/@docsearch/react/dist/esm/icons/SelectIcon.js new file mode 100644 index 0000000000..83e3ba2f58 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/SelectIcon.js @@ -0,0 +1,19 @@ +import React from 'react'; +export function SelectIcon() { + return /*#__PURE__*/React.createElement("svg", { + className: "DocSearch-Hit-Select-Icon", + width: "20", + height: "20", + viewBox: "0 0 20 20" + }, /*#__PURE__*/React.createElement("g", { + stroke: "currentColor", + fill: "none", + fillRule: "evenodd", + strokeLinecap: "round", + strokeLinejoin: "round" + }, /*#__PURE__*/React.createElement("path", { + d: "M18 3v4c0 2-2 4-4 4H2" + }), /*#__PURE__*/React.createElement("path", { + d: "M8 17l-6-6 6-6" + }))); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/icons/SourceIcon.d.ts b/node_modules/@docsearch/react/dist/esm/icons/SourceIcon.d.ts new file mode 100644 index 0000000000..17b846b335 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/SourceIcon.d.ts @@ -0,0 +1,4 @@ +/// +export declare function SourceIcon(props: { + type: string; +}): JSX.Element; diff --git a/node_modules/@docsearch/react/dist/esm/icons/SourceIcon.js b/node_modules/@docsearch/react/dist/esm/icons/SourceIcon.js new file mode 100644 index 0000000000..2249468540 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/SourceIcon.js @@ -0,0 +1,57 @@ +import React from 'react'; + +var LvlIcon = function LvlIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "20", + height: "20", + viewBox: "0 0 20 20" + }, /*#__PURE__*/React.createElement("path", { + d: "M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4", + stroke: "currentColor", + fill: "none", + fillRule: "evenodd", + strokeLinejoin: "round" + })); +}; + +export function SourceIcon(props) { + switch (props.type) { + case 'lvl1': + return /*#__PURE__*/React.createElement(LvlIcon, null); + + case 'content': + return /*#__PURE__*/React.createElement(ContentIcon, null); + + default: + return /*#__PURE__*/React.createElement(AnchorIcon, null); + } +} + +function AnchorIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "20", + height: "20", + viewBox: "0 0 20 20" + }, /*#__PURE__*/React.createElement("path", { + d: "M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z", + stroke: "currentColor", + fill: "none", + fillRule: "evenodd", + strokeLinecap: "round", + strokeLinejoin: "round" + })); +} + +function ContentIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "20", + height: "20", + viewBox: "0 0 20 20" + }, /*#__PURE__*/React.createElement("path", { + d: "M17 5H3h14zm0 5H3h14zm0 5H3h14z", + stroke: "currentColor", + fill: "none", + fillRule: "evenodd", + strokeLinejoin: "round" + })); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/icons/StarIcon.d.ts b/node_modules/@docsearch/react/dist/esm/icons/StarIcon.d.ts new file mode 100644 index 0000000000..8312c2db15 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/StarIcon.d.ts @@ -0,0 +1,2 @@ +/// +export declare function StarIcon(): JSX.Element; diff --git a/node_modules/@docsearch/react/dist/esm/icons/StarIcon.js b/node_modules/@docsearch/react/dist/esm/icons/StarIcon.js new file mode 100644 index 0000000000..62aacc2208 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/StarIcon.js @@ -0,0 +1,14 @@ +import React from 'react'; +export function StarIcon() { + return /*#__PURE__*/React.createElement("svg", { + width: "20", + height: "20", + viewBox: "0 0 20 20" + }, /*#__PURE__*/React.createElement("path", { + d: "M10 14.2L5 17l1-5.6-4-4 5.5-.7 2.5-5 2.5 5 5.6.8-4 4 .9 5.5z", + stroke: "currentColor", + fill: "none", + fillRule: "evenodd", + strokeLinejoin: "round" + })); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/icons/index.d.ts b/node_modules/@docsearch/react/dist/esm/icons/index.d.ts new file mode 100644 index 0000000000..b3c85dc999 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/index.d.ts @@ -0,0 +1,10 @@ +export * from './GoToExternalIcon'; +export * from './LoadingIcon'; +export * from './RecentIcon'; +export * from './ResetIcon'; +export * from './SearchIcon'; +export * from './SelectIcon'; +export * from './SourceIcon'; +export * from './StarIcon'; +export * from './ErrorIcon'; +export * from './NoResultsIcon'; diff --git a/node_modules/@docsearch/react/dist/esm/icons/index.js b/node_modules/@docsearch/react/dist/esm/icons/index.js new file mode 100644 index 0000000000..969d3808eb --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/icons/index.js @@ -0,0 +1,10 @@ +export * from './GoToExternalIcon'; +export * from './LoadingIcon'; +export * from './RecentIcon'; +export * from './ResetIcon'; +export * from './SearchIcon'; +export * from './SelectIcon'; +export * from './SourceIcon'; +export * from './StarIcon'; +export * from './ErrorIcon'; +export * from './NoResultsIcon'; \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/index.d.ts b/node_modules/@docsearch/react/dist/esm/index.d.ts new file mode 100644 index 0000000000..d4e9396900 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/index.d.ts @@ -0,0 +1,5 @@ +export * from './DocSearch'; +export * from './DocSearchButton'; +export * from './DocSearchModal'; +export * from './useDocSearchKeyboardEvents'; +export * from './version'; diff --git a/node_modules/@docsearch/react/dist/esm/index.js b/node_modules/@docsearch/react/dist/esm/index.js new file mode 100644 index 0000000000..9791a574f1 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/index.js @@ -0,0 +1,5 @@ +export * from './DocSearch'; +export * from './DocSearchButton'; +export * from './DocSearchModal'; +export * from './useDocSearchKeyboardEvents'; +export * from './version'; \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/stored-searches.d.ts b/node_modules/@docsearch/react/dist/esm/stored-searches.d.ts new file mode 100644 index 0000000000..d7f2661fc5 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/stored-searches.d.ts @@ -0,0 +1,12 @@ +import type { StoredDocSearchHit } from './types'; +declare type CreateStoredSearchesOptions = { + key: string; + limit?: number; +}; +export declare type StoredSearchPlugin = { + add: (item: TItem) => void; + remove: (item: TItem) => void; + getAll: () => TItem[]; +}; +export declare function createStoredSearches({ key, limit, }: CreateStoredSearchesOptions): StoredSearchPlugin; +export {}; diff --git a/node_modules/@docsearch/react/dist/esm/stored-searches.js b/node_modules/@docsearch/react/dist/esm/stored-searches.js new file mode 100644 index 0000000000..6c1c9d0026 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/stored-searches.js @@ -0,0 +1,75 @@ +var _excluded = ["_highlightResult", "_snippetResult"]; + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function isLocalStorageSupported() { + var key = '__TEST_KEY__'; + + try { + localStorage.setItem(key, ''); + localStorage.removeItem(key); + return true; + } catch (error) { + return false; + } +} + +function createStorage(key) { + if (isLocalStorageSupported() === false) { + return { + setItem: function setItem() {}, + getItem: function getItem() { + return []; + } + }; + } + + return { + setItem: function setItem(item) { + return window.localStorage.setItem(key, JSON.stringify(item)); + }, + getItem: function getItem() { + var item = window.localStorage.getItem(key); + return item ? JSON.parse(item) : []; + } + }; +} + +export function createStoredSearches(_ref) { + var key = _ref.key, + _ref$limit = _ref.limit, + limit = _ref$limit === void 0 ? 5 : _ref$limit; + var storage = createStorage(key); + var items = storage.getItem().slice(0, limit); + return { + add: function add(item) { + var _ref2 = item, + _highlightResult = _ref2._highlightResult, + _snippetResult = _ref2._snippetResult, + hit = _objectWithoutProperties(_ref2, _excluded); + + var isQueryAlreadySaved = items.findIndex(function (x) { + return x.objectID === hit.objectID; + }); + + if (isQueryAlreadySaved > -1) { + items.splice(isQueryAlreadySaved, 1); + } + + items.unshift(hit); + items = items.slice(0, limit); + storage.setItem(items); + }, + remove: function remove(item) { + items = items.filter(function (x) { + return x.objectID !== item.objectID; + }); + storage.setItem(items); + }, + getAll: function getAll() { + return items; + } + }; +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/types/DocSearchHit.d.ts b/node_modules/@docsearch/react/dist/esm/types/DocSearchHit.d.ts new file mode 100644 index 0000000000..a983f5311d --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/types/DocSearchHit.d.ts @@ -0,0 +1,68 @@ +declare type ContentType = 'content' | 'lvl0' | 'lvl1' | 'lvl2' | 'lvl3' | 'lvl4' | 'lvl5' | 'lvl6'; +interface DocSearchHitAttributeHighlightResult { + value: string; + matchLevel: 'full' | 'none' | 'partial'; + matchedWords: string[]; + fullyHighlighted?: boolean; +} +interface DocSearchHitHighlightResultHierarchy { + lvl0: DocSearchHitAttributeHighlightResult; + lvl1: DocSearchHitAttributeHighlightResult; + lvl2: DocSearchHitAttributeHighlightResult; + lvl3: DocSearchHitAttributeHighlightResult; + lvl4: DocSearchHitAttributeHighlightResult; + lvl5: DocSearchHitAttributeHighlightResult; + lvl6: DocSearchHitAttributeHighlightResult; +} +interface DocSearchHitHighlightResult { + content: DocSearchHitAttributeHighlightResult; + hierarchy: DocSearchHitHighlightResultHierarchy; + hierarchy_camel: DocSearchHitHighlightResultHierarchy[]; +} +interface DocSearchHitAttributeSnippetResult { + value: string; + matchLevel: 'full' | 'none' | 'partial'; +} +interface DocSearchHitSnippetResult { + content: DocSearchHitAttributeSnippetResult; + hierarchy: DocSearchHitHighlightResultHierarchy; + hierarchy_camel: DocSearchHitHighlightResultHierarchy[]; +} +export declare type DocSearchHit = { + objectID: string; + content: string | null; + url: string; + url_without_anchor: string; + type: ContentType; + anchor: string | null; + hierarchy: { + lvl0: string; + lvl1: string; + lvl2: string | null; + lvl3: string | null; + lvl4: string | null; + lvl5: string | null; + lvl6: string | null; + }; + _highlightResult: DocSearchHitHighlightResult; + _snippetResult: DocSearchHitSnippetResult; + _rankingInfo?: { + promoted: boolean; + nbTypos: number; + firstMatchedWord: number; + proximityDistance?: number; + geoDistance: number; + geoPrecision?: number; + nbExactWords: number; + words: number; + filters: number; + userScore: number; + matchedGeoLocation?: { + lat: number; + lng: number; + distance: number; + }; + }; + _distinctSeqID?: number; +}; +export {}; diff --git a/node_modules/@docsearch/react/dist/esm/types/DocSearchHit.js b/node_modules/@docsearch/react/dist/esm/types/DocSearchHit.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/types/DocSearchHit.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/types/InternalDocSearchHit.d.ts b/node_modules/@docsearch/react/dist/esm/types/InternalDocSearchHit.d.ts new file mode 100644 index 0000000000..7c106cce2e --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/types/InternalDocSearchHit.d.ts @@ -0,0 +1,4 @@ +import type { DocSearchHit } from './DocSearchHit'; +export declare type InternalDocSearchHit = DocSearchHit & { + __docsearch_parent: InternalDocSearchHit | null; +}; diff --git a/node_modules/@docsearch/react/dist/esm/types/InternalDocSearchHit.js b/node_modules/@docsearch/react/dist/esm/types/InternalDocSearchHit.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/types/InternalDocSearchHit.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/types/StoredDocSearchHit.d.ts b/node_modules/@docsearch/react/dist/esm/types/StoredDocSearchHit.d.ts new file mode 100644 index 0000000000..eb92d47224 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/types/StoredDocSearchHit.d.ts @@ -0,0 +1,2 @@ +import type { DocSearchHit } from './DocSearchHit'; +export declare type StoredDocSearchHit = Omit; diff --git a/node_modules/@docsearch/react/dist/esm/types/StoredDocSearchHit.js b/node_modules/@docsearch/react/dist/esm/types/StoredDocSearchHit.js new file mode 100644 index 0000000000..8cec2e9ced --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/types/StoredDocSearchHit.js @@ -0,0 +1 @@ +export {}; \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/types/index.d.ts b/node_modules/@docsearch/react/dist/esm/types/index.d.ts new file mode 100644 index 0000000000..93285bd19d --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/types/index.d.ts @@ -0,0 +1,3 @@ +export * from './DocSearchHit'; +export * from './InternalDocSearchHit'; +export * from './StoredDocSearchHit'; diff --git a/node_modules/@docsearch/react/dist/esm/types/index.js b/node_modules/@docsearch/react/dist/esm/types/index.js new file mode 100644 index 0000000000..0b0ec4cde2 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/types/index.js @@ -0,0 +1,3 @@ +export * from './DocSearchHit'; +export * from './InternalDocSearchHit'; +export * from './StoredDocSearchHit'; \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/useDocSearchKeyboardEvents.d.ts b/node_modules/@docsearch/react/dist/esm/useDocSearchKeyboardEvents.d.ts new file mode 100644 index 0000000000..b1e76ace31 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/useDocSearchKeyboardEvents.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; +export interface UseDocSearchKeyboardEventsProps { + isOpen: boolean; + onOpen: () => void; + onClose: () => void; + onInput?: (event: KeyboardEvent) => void; + searchButtonRef?: React.RefObject; +} +export declare function useDocSearchKeyboardEvents({ isOpen, onOpen, onClose, onInput, searchButtonRef, }: UseDocSearchKeyboardEventsProps): void; diff --git a/node_modules/@docsearch/react/dist/esm/useDocSearchKeyboardEvents.js b/node_modules/@docsearch/react/dist/esm/useDocSearchKeyboardEvents.js new file mode 100644 index 0000000000..c62e6ed3e6 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/useDocSearchKeyboardEvents.js @@ -0,0 +1,50 @@ +import React from 'react'; + +function isEditingContent(event) { + var element = event.target; + var tagName = element.tagName; + return element.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA'; +} + +export function useDocSearchKeyboardEvents(_ref) { + var isOpen = _ref.isOpen, + onOpen = _ref.onOpen, + onClose = _ref.onClose, + onInput = _ref.onInput, + searchButtonRef = _ref.searchButtonRef; + React.useEffect(function () { + function onKeyDown(event) { + function open() { + // We check that no other DocSearch modal is showing before opening + // another one. + if (!document.body.classList.contains('DocSearch--active')) { + onOpen(); + } + } + + if (event.keyCode === 27 && isOpen || // The `Cmd+K` shortcut both opens and closes the modal. + event.key === 'k' && (event.metaKey || event.ctrlKey) || // The `/` shortcut opens but doesn't close the modal because it's + // a character. + !isEditingContent(event) && event.key === '/' && !isOpen) { + event.preventDefault(); + + if (isOpen) { + onClose(); + } else if (!document.body.classList.contains('DocSearch--active')) { + open(); + } + } + + if (searchButtonRef && searchButtonRef.current === document.activeElement && onInput) { + if (/[a-zA-Z0-9]/.test(String.fromCharCode(event.keyCode))) { + onInput(event); + } + } + } + + window.addEventListener('keydown', onKeyDown); + return function () { + window.removeEventListener('keydown', onKeyDown); + }; + }, [isOpen, onOpen, onClose, onInput, searchButtonRef]); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/useSearchClient.d.ts b/node_modules/@docsearch/react/dist/esm/useSearchClient.d.ts new file mode 100644 index 0000000000..c82166b468 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/useSearchClient.d.ts @@ -0,0 +1,2 @@ +import type { SearchClient } from 'algoliasearch/lite'; +export declare function useSearchClient(appId: string, apiKey: string, transformSearchClient: (searchClient: SearchClient) => SearchClient): SearchClient; diff --git a/node_modules/@docsearch/react/dist/esm/useSearchClient.js b/node_modules/@docsearch/react/dist/esm/useSearchClient.js new file mode 100644 index 0000000000..16ead8c297 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/useSearchClient.js @@ -0,0 +1,20 @@ +import algoliasearch from 'algoliasearch/dist/algoliasearch-lite.esm.browser'; +import React from 'react'; +import { version } from './version'; +export function useSearchClient(appId, apiKey, transformSearchClient) { + var searchClient = React.useMemo(function () { + var client = algoliasearch(appId, apiKey); + client.addAlgoliaAgent('docsearch', version); // Since DocSearch.js relies on DocSearch React with an alias to Preact, + // we cannot add the `docsearch-react` user agent by default, otherwise + // it would also be sent on a DocSearch.js integration. + // We therefore only add the `docsearch-react` user agent if `docsearch.js` + // is not present. + + if (/docsearch.js \(.*\)/.test(client.transporter.userAgent.value) === false) { + client.addAlgoliaAgent('docsearch-react', version); + } + + return transformSearchClient(client); + }, [appId, apiKey, transformSearchClient]); + return searchClient; +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/useTouchEvents.d.ts b/node_modules/@docsearch/react/dist/esm/useTouchEvents.d.ts new file mode 100644 index 0000000000..ec9108df49 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/useTouchEvents.d.ts @@ -0,0 +1,9 @@ +import type { AutocompleteApi } from '@algolia/autocomplete-core'; +interface UseTouchEventsProps { + getEnvironmentProps: AutocompleteApi['getEnvironmentProps']; + panelElement: HTMLDivElement | null; + formElement: HTMLDivElement | null; + inputElement: HTMLInputElement | null; +} +export declare function useTouchEvents({ getEnvironmentProps, panelElement, formElement, inputElement, }: UseTouchEventsProps): void; +export {}; diff --git a/node_modules/@docsearch/react/dist/esm/useTouchEvents.js b/node_modules/@docsearch/react/dist/esm/useTouchEvents.js new file mode 100644 index 0000000000..a35b2c4730 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/useTouchEvents.js @@ -0,0 +1,27 @@ +import React from 'react'; +export function useTouchEvents(_ref) { + var getEnvironmentProps = _ref.getEnvironmentProps, + panelElement = _ref.panelElement, + formElement = _ref.formElement, + inputElement = _ref.inputElement; + React.useEffect(function () { + if (!(panelElement && formElement && inputElement)) { + return undefined; + } + + var _getEnvironmentProps = getEnvironmentProps({ + panelElement: panelElement, + formElement: formElement, + inputElement: inputElement + }), + onTouchStart = _getEnvironmentProps.onTouchStart, + onTouchMove = _getEnvironmentProps.onTouchMove; + + window.addEventListener('touchstart', onTouchStart); + window.addEventListener('touchmove', onTouchMove); + return function () { + window.removeEventListener('touchstart', onTouchStart); + window.removeEventListener('touchmove', onTouchMove); + }; + }, [getEnvironmentProps, panelElement, formElement, inputElement]); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/useTrapFocus.d.ts b/node_modules/@docsearch/react/dist/esm/useTrapFocus.d.ts new file mode 100644 index 0000000000..8d5f45aa1c --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/useTrapFocus.d.ts @@ -0,0 +1,5 @@ +interface UseTrapFocusProps { + container: HTMLElement | null; +} +export declare function useTrapFocus({ container }: UseTrapFocusProps): void; +export {}; diff --git a/node_modules/@docsearch/react/dist/esm/useTrapFocus.js b/node_modules/@docsearch/react/dist/esm/useTrapFocus.js new file mode 100644 index 0000000000..c5b11b8485 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/useTrapFocus.js @@ -0,0 +1,34 @@ +import React from 'react'; +export function useTrapFocus(_ref) { + var container = _ref.container; + React.useEffect(function () { + if (!container) { + return undefined; + } + + var focusableElements = container.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), input:not([disabled])'); + var firstElement = focusableElements[0]; + var lastElement = focusableElements[focusableElements.length - 1]; + + function trapFocus(event) { + if (event.key !== 'Tab') { + return; + } + + if (event.shiftKey) { + if (document.activeElement === firstElement) { + event.preventDefault(); + lastElement.focus(); + } + } else if (document.activeElement === lastElement) { + event.preventDefault(); + firstElement.focus(); + } + } + + container.addEventListener('keydown', trapFocus); + return function () { + container.removeEventListener('keydown', trapFocus); + }; + }, [container]); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/utils/groupBy.d.ts b/node_modules/@docsearch/react/dist/esm/utils/groupBy.d.ts new file mode 100644 index 0000000000..f99cef8b90 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/utils/groupBy.d.ts @@ -0,0 +1 @@ +export declare function groupBy>(values: TValue[], predicate: (value: TValue) => string): Record; diff --git a/node_modules/@docsearch/react/dist/esm/utils/groupBy.js b/node_modules/@docsearch/react/dist/esm/utils/groupBy.js new file mode 100644 index 0000000000..d0a35626be --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/utils/groupBy.js @@ -0,0 +1,17 @@ +export function groupBy(values, predicate) { + return values.reduce(function (acc, item) { + var key = predicate(item); + + if (!acc.hasOwnProperty(key)) { + acc[key] = []; + } // We limit each section to show 5 hits maximum. + // This acts as a frontend alternative to `distinct`. + + + if (acc[key].length < 5) { + acc[key].push(item); + } + + return acc; + }, {}); +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/utils/identity.d.ts b/node_modules/@docsearch/react/dist/esm/utils/identity.d.ts new file mode 100644 index 0000000000..343901ff7e --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/utils/identity.d.ts @@ -0,0 +1 @@ +export declare function identity(x: TParam): TParam; diff --git a/node_modules/@docsearch/react/dist/esm/utils/identity.js b/node_modules/@docsearch/react/dist/esm/utils/identity.js new file mode 100644 index 0000000000..c4c3c779d5 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/utils/identity.js @@ -0,0 +1,3 @@ +export function identity(x) { + return x; +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/utils/index.d.ts b/node_modules/@docsearch/react/dist/esm/utils/index.d.ts new file mode 100644 index 0000000000..d070520aff --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/utils/index.d.ts @@ -0,0 +1,4 @@ +export * from './groupBy'; +export * from './identity'; +export * from './noop'; +export * from './removeHighlightTags'; diff --git a/node_modules/@docsearch/react/dist/esm/utils/index.js b/node_modules/@docsearch/react/dist/esm/utils/index.js new file mode 100644 index 0000000000..0d9f5ab122 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/utils/index.js @@ -0,0 +1,4 @@ +export * from './groupBy'; +export * from './identity'; +export * from './noop'; +export * from './removeHighlightTags'; \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/utils/noop.d.ts b/node_modules/@docsearch/react/dist/esm/utils/noop.d.ts new file mode 100644 index 0000000000..7db1996565 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/utils/noop.d.ts @@ -0,0 +1 @@ +export declare function noop(..._args: any[]): void; diff --git a/node_modules/@docsearch/react/dist/esm/utils/noop.js b/node_modules/@docsearch/react/dist/esm/utils/noop.js new file mode 100644 index 0000000000..628cbaedee --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/utils/noop.js @@ -0,0 +1 @@ +export function noop() {} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/utils/removeHighlightTags.d.ts b/node_modules/@docsearch/react/dist/esm/utils/removeHighlightTags.d.ts new file mode 100644 index 0000000000..4797720edd --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/utils/removeHighlightTags.d.ts @@ -0,0 +1,2 @@ +import type { DocSearchHit, InternalDocSearchHit } from '../types'; +export declare function removeHighlightTags(hit: DocSearchHit | InternalDocSearchHit): string; diff --git a/node_modules/@docsearch/react/dist/esm/utils/removeHighlightTags.js b/node_modules/@docsearch/react/dist/esm/utils/removeHighlightTags.js new file mode 100644 index 0000000000..de7a6654ff --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/utils/removeHighlightTags.js @@ -0,0 +1,16 @@ +var regexHighlightTags = /(|<\/mark>)/g; +var regexHasHighlightTags = RegExp(regexHighlightTags.source); +export function removeHighlightTags(hit) { + var _internalDocSearchHit, _internalDocSearchHit2, _internalDocSearchHit3, _hit$_highlightResult, _hit$_highlightResult2; + + var internalDocSearchHit = hit; + + if (!internalDocSearchHit.__docsearch_parent && !hit._highlightResult) { + return hit.hierarchy.lvl0; + } + + var _ref = (internalDocSearchHit.__docsearch_parent ? (_internalDocSearchHit = internalDocSearchHit.__docsearch_parent) === null || _internalDocSearchHit === void 0 ? void 0 : (_internalDocSearchHit2 = _internalDocSearchHit._highlightResult) === null || _internalDocSearchHit2 === void 0 ? void 0 : (_internalDocSearchHit3 = _internalDocSearchHit2.hierarchy) === null || _internalDocSearchHit3 === void 0 ? void 0 : _internalDocSearchHit3.lvl0 : (_hit$_highlightResult = hit._highlightResult) === null || _hit$_highlightResult === void 0 ? void 0 : (_hit$_highlightResult2 = _hit$_highlightResult.hierarchy) === null || _hit$_highlightResult2 === void 0 ? void 0 : _hit$_highlightResult2.lvl0) || {}, + value = _ref.value; + + return value && regexHasHighlightTags.test(value) ? value.replace(regexHighlightTags, '') : value; +} \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/esm/version.d.ts b/node_modules/@docsearch/react/dist/esm/version.d.ts new file mode 100644 index 0000000000..42d5b710e0 --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/version.d.ts @@ -0,0 +1 @@ +export declare const version = "3.0.0"; diff --git a/node_modules/@docsearch/react/dist/esm/version.js b/node_modules/@docsearch/react/dist/esm/version.js new file mode 100644 index 0000000000..e3828cf4cd --- /dev/null +++ b/node_modules/@docsearch/react/dist/esm/version.js @@ -0,0 +1 @@ +export var version = '3.0.0'; \ No newline at end of file diff --git a/node_modules/@docsearch/react/dist/umd/index.js b/node_modules/@docsearch/react/dist/umd/index.js new file mode 100644 index 0000000000..de3fde7bb5 --- /dev/null +++ b/node_modules/@docsearch/react/dist/umd/index.js @@ -0,0 +1,3 @@ +/*! @docsearch/react 3.0.0 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e=e||self)["@docsearch/react"]={},e.React,e.ReactDOM)}(this,(function(e,t,r){"use strict";var n="default"in t?t.default:t;function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,a=[],c=!0,i=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);c=!0);}catch(e){i=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(i)throw o}}return a}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=r?null===n?null:0:o}function D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function k(e,t){var r=[];return Promise.resolve(e(t)).then((function(e){return Promise.all(e.filter((function(e){return Boolean(e)})).map((function(e){if(e.sourceId,r.includes(e.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(e.sourceId)," is not unique."));r.push(e.sourceId);var t=function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var le,se,ue,me=null,fe=(le=-1,se=-1,ue=void 0,function(e){var t=++le;return Promise.resolve(e).then((function(e){return ue&&t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var be=["props","refresh","store"],Oe=["inputElement","formElement","panelElement"],Se=["inputElement"],Ee=["inputElement","maxLength"],we=["item","source"];function je(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pe(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Ce(e){var t=e.props,r=e.refresh,n=e.store,o=De(e,be);return{getEnvironmentProps:function(e){var r=e.inputElement,o=e.formElement,a=e.panelElement;return Pe({onTouchStart:function(e){!n.getState().isOpen&&n.pendingRequests.isEmpty()||e.target===r||!1===[o,a].some((function(t){return r=t,n=e.target,r===n||r.contains(n);var r,n}))&&(n.dispatch("blur",null),t.debug||n.pendingRequests.cancelAll())},onTouchMove:function(e){!1!==n.getState().isOpen&&r===t.environment.document.activeElement&&e.target!==r&&r.blur()}},De(e,Oe))},getRootProps:function(e){return Pe({role:"combobox","aria-expanded":n.getState().isOpen,"aria-haspopup":"listbox","aria-owns":n.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label")},e)},getFormProps:function(e){e.inputElement;return Pe({action:"",noValidate:!0,role:"search",onSubmit:function(a){var c;a.preventDefault(),t.onSubmit(Pe({event:a,refresh:r,state:n.getState()},o)),n.dispatch("submit",null),null===(c=e.inputElement)||void 0===c||c.blur()},onReset:function(a){var c;a.preventDefault(),t.onReset(Pe({event:a,refresh:r,state:n.getState()},o)),n.dispatch("reset",null),null===(c=e.inputElement)||void 0===c||c.focus()}},De(e,Se))},getLabelProps:function(e){return Pe({htmlFor:"".concat(t.id,"-input"),id:"".concat(t.id,"-label")},e)},getInputProps:function(e){function a(e){(t.openOnFocus||Boolean(n.getState().query))&&pe(Pe({event:e,props:t,query:n.getState().completion||n.getState().query,refresh:r,store:n},o)),n.dispatch("focus",null)}var c="ontouchstart"in t.environment,i=e||{},l=(i.inputElement,i.maxLength),s=void 0===l?512:l,u=De(i,Ee),m=N(n.getState());return Pe({"aria-autocomplete":"both","aria-activedescendant":n.getState().isOpen&&null!==n.getState().activeItemId?"".concat(t.id,"-item-").concat(n.getState().activeItemId):void 0,"aria-controls":n.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label"),value:n.getState().completion||n.getState().query,id:"".concat(t.id,"-input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:null!=m&&m.itemUrl?"go":"search",spellCheck:"false",autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:s,type:"search",onChange:function(e){pe(Pe({event:e,props:t,query:e.currentTarget.value.slice(0,s),refresh:r,store:n},o))},onKeyDown:function(e){!function(e){var t=e.event,r=e.props,n=e.refresh,o=e.store,a=ge(e,de);if("ArrowUp"===t.key||"ArrowDown"===t.key){var c=function(){var e=r.environment.document.getElementById("".concat(r.id,"-item-").concat(o.getState().activeItemId));e&&(e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded(!1):e.scrollIntoView(!1))},i=function(){var e=N(o.getState());if(null!==o.getState().activeItemId&&e){var r=e.item,c=e.itemInputValue,i=e.itemUrl,l=e.source;l.onActive(ve({event:t,item:r,itemInputValue:c,itemUrl:i,refresh:n,source:l,state:o.getState()},a))}};t.preventDefault(),!1===o.getState().isOpen&&(r.openOnFocus||Boolean(o.getState().query))?pe(ve({event:t,props:r,query:o.getState().query,refresh:n,store:o},a)).then((function(){o.dispatch(t.key,{nextActiveItemId:r.defaultActiveItemId}),i(),setTimeout(c,0)})):(o.dispatch(t.key,{}),i(),c())}else if("Escape"===t.key)t.preventDefault(),o.dispatch(t.key,null),o.pendingRequests.cancelAll();else if("Enter"===t.key){if(null===o.getState().activeItemId||o.getState().collections.every((function(e){return 0===e.items.length})))return;t.preventDefault();var l=N(o.getState()),s=l.item,u=l.itemInputValue,m=l.itemUrl,f=l.source;if(t.metaKey||t.ctrlKey)void 0!==m&&(f.onSelect(ve({event:t,item:s,itemInputValue:u,itemUrl:m,refresh:n,source:f,state:o.getState()},a)),r.navigator.navigateNewTab({itemUrl:m,item:s,state:o.getState()}));else if(t.shiftKey)void 0!==m&&(f.onSelect(ve({event:t,item:s,itemInputValue:u,itemUrl:m,refresh:n,source:f,state:o.getState()},a)),r.navigator.navigateNewWindow({itemUrl:m,item:s,state:o.getState()}));else if(t.altKey);else{if(void 0!==m)return f.onSelect(ve({event:t,item:s,itemInputValue:u,itemUrl:m,refresh:n,source:f,state:o.getState()},a)),void r.navigator.navigate({itemUrl:m,item:s,state:o.getState()});pe(ve({event:t,nextState:{isOpen:!1},props:r,query:u,refresh:n,store:o},a)).then((function(){f.onSelect(ve({event:t,item:s,itemInputValue:u,itemUrl:m,refresh:n,source:f,state:o.getState()},a))}))}}}(Pe({event:e,props:t,refresh:r,store:n},o))},onFocus:a,onBlur:function(){c||(n.dispatch("blur",null),t.debug||n.pendingRequests.cancelAll())},onClick:function(r){e.inputElement!==t.environment.document.activeElement||n.getState().isOpen||a(r)}},u)},getPanelProps:function(e){return Pe({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){n.dispatch("mouseleave",null)}},e)},getListProps:function(e){return Pe({role:"listbox","aria-labelledby":"".concat(t.id,"-label"),id:"".concat(t.id,"-list")},e)},getItemProps:function(e){var a=e.item,c=e.source,i=De(e,we);return Pe({id:"".concat(t.id,"-item-").concat(a.__autocomplete_id),role:"option","aria-selected":n.getState().activeItemId===a.__autocomplete_id,onMouseMove:function(e){if(a.__autocomplete_id!==n.getState().activeItemId){n.dispatch("mousemove",a.__autocomplete_id);var t=N(n.getState());if(null!==n.getState().activeItemId&&t){var c=t.item,i=t.itemInputValue,l=t.itemUrl,s=t.source;s.onActive(Pe({event:e,item:c,itemInputValue:i,itemUrl:l,refresh:r,source:s,state:n.getState()},o))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var i=c.getItemInputValue({item:a,state:n.getState()}),l=c.getItemUrl({item:a,state:n.getState()});(l?Promise.resolve():pe(Pe({event:e,nextState:{isOpen:!1},props:t,query:i,refresh:r,store:n},o))).then((function(){c.onSelect(Pe({event:e,item:a,itemInputValue:i,itemUrl:l,refresh:r,source:c,state:n.getState()},o))}))}},i)}}}function ke(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ne(e){for(var t=1;t0},reshape:function(e){return e.sources}},e),{},{id:null!==(r=e.id)&&void 0!==r?r:"autocomplete-".concat(b++),plugins:o,initialState:V({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var r;null===(r=e.onStateChange)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onStateChange)||void 0===r?void 0:r.call(e,t)}))},onSubmit:function(t){var r;null===(r=e.onSubmit)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onSubmit)||void 0===r?void 0:r.call(e,t)}))},onReset:function(t){var r;null===(r=e.onReset)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onReset)||void 0===r?void 0:r.call(e,t)}))},getSources:function(r){return Promise.all([].concat(B(o.map((function(e){return e.getSources}))),[e.getSources]).filter(Boolean).map((function(e){return k(e,r)}))).then((function(e){return g(e)})).then((function(e){return e.map((function(e){return V(V({},e),{},{onSelect:function(r){e.onSelect(r),t.forEach((function(e){var t;return null===(t=e.onSelect)||void 0===t?void 0:t.call(e,r)}))},onActive:function(r){e.onActive(r),t.forEach((function(e){var t;return null===(t=e.onActive)||void 0===t?void 0:t.call(e,r)}))}})}))}))},navigator:V({navigate:function(e){var t=e.itemUrl;n.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl,r=n.open(t,"_blank","noopener");null==r||r.focus()},navigateNewWindow:function(e){var t=e.itemUrl;n.open(t,"_blank","noopener")}},e.navigator)})}(e,t),n=T(Le,r,(function(e){var t=e.prevState,n=e.state;r.onStateChange(He({prevState:t,state:n,refresh:c},o))})),o=function(e){var t=e.store;return{setActiveItemId:function(e){t.dispatch("setActiveItemId",e)},setQuery:function(e){t.dispatch("setQuery",e)},setCollections:function(e){var r=0,n=e.map((function(e){return M(M({},e),{},{items:g(e.items).map((function(e){return M(M({},e),{},{__autocomplete_id:r++})}))})}));t.dispatch("setCollections",n)},setIsOpen:function(e){t.dispatch("setIsOpen",e)},setStatus:function(e){t.dispatch("setStatus",e)},setContext:function(e){t.dispatch("setContext",e)}}}({store:n}),a=Ce(He({props:r,refresh:c,store:n},o));function c(){return pe(He({event:new Event("input"),nextState:{isOpen:n.getState().isOpen},props:r,query:n.getState().query,refresh:c,store:n},o))}return r.plugins.forEach((function(e){var r;return null===(r=e.subscribe)||void 0===r?void 0:r.call(e,He(He({},o),{},{refresh:c,onSelect:function(e){t.push({onSelect:e})},onActive:function(e){t.push({onActive:e})}}))})),function(e){var t,r=e.metadata,n=e.environment;if(null===(t=n.navigator)||void 0===t?void 0:t.userAgent.includes("Algolia Crawler")){var o=n.document.createElement("meta"),a=n.document.querySelector("head");o.name="algolia:metadata",setTimeout((function(){o.content=JSON.stringify(r),a.appendChild(o)}),0)}}({metadata:xe({plugins:r.plugins,options:e}),environment:r.environment}),He(He({refresh:c},a),o)}function Ue(e){var t=e.translations,r=(void 0===t?{}:t).searchByText,o=void 0===r?"Search by":r;return n.createElement("a",{href:"https://www.algolia.com/ref/docsearch/?utm_source=".concat(window.location.hostname,"&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch"),target:"_blank",rel:"noopener noreferrer"},n.createElement("span",{className:"DocSearch-Label"},o),n.createElement("svg",{width:"77",height:"19","aria-label":"Algolia",role:"img"},n.createElement("path",{d:"M2.5067 0h14.0245c1.384.001 2.5058 1.1205 2.5068 2.5017V16.5c-.0014 1.3808-1.1232 2.4995-2.5068 2.5H2.5067C1.1232 18.9995.0014 17.8808 0 16.5V2.4958A2.495 2.495 0 01.735.7294 2.505 2.505 0 012.5068 0zM37.95 15.0695c-3.7068.0168-3.7068-2.986-3.7068-3.4634L34.2372.3576 36.498 0v11.1794c0 .2715 0 1.9889 1.452 1.994v1.8961zm-9.1666-1.8388c.694 0 1.2086-.0397 1.5678-.1088v-2.2934a5.3639 5.3639 0 00-1.3303-.1679 4.8283 4.8283 0 00-.758.0582 2.2845 2.2845 0 00-.688.2024c-.2029.0979-.371.2362-.4919.4142-.1268.1788-.185.2826-.185.5533 0 .5297.185.8359.5205 1.0375.3355.2016.7928.3053 1.365.3053v-.0008zm-.1969-8.1817c.7463 0 1.3768.092 1.8856.2767.5088.1838.9195.4428 1.2204.7717.3068.334.5147.7777.6423 1.251.1327.4723.196.991.196 1.5603v5.798c-.5235.1036-1.05.192-1.5787.2649-.7048.1037-1.4976.156-2.3774.156-.5832 0-1.1215-.0582-1.6016-.167a3.385 3.385 0 01-1.2432-.5364 2.6034 2.6034 0 01-.8037-.9565c-.191-.3922-.29-.9447-.29-1.5208 0-.5533.11-.905.3246-1.2863a2.7351 2.7351 0 01.8849-.9329c.376-.242.8029-.415 1.2948-.5187a7.4517 7.4517 0 011.5381-.156 7.1162 7.1162 0 011.6667.2024V8.886c0-.259-.0296-.5061-.093-.7372a1.5847 1.5847 0 00-.3245-.6158 1.5079 1.5079 0 00-.6119-.4158 2.6788 2.6788 0 00-.966-.173c-.5206 0-.9948.0634-1.4283.1384a6.5481 6.5481 0 00-1.065.259l-.2712-1.849c.2831-.0986.7048-.1964 1.2491-.2943a9.2979 9.2979 0 011.752-.1501v.0008zm44.6597 8.1193c.6947 0 1.2086-.0405 1.567-.1097v-2.2942a5.3743 5.3743 0 00-1.3303-.1679c-.2485 0-.503.0177-.7573.0582a2.2853 2.2853 0 00-.688.2024 1.2333 1.2333 0 00-.4918.4142c-.1268.1788-.1843.2826-.1843.5533 0 .5297.1843.8359.5198 1.0375.3414.2066.7927.3053 1.365.3053v.0009zm-.191-8.1767c.7463 0 1.3768.0912 1.8856.2759.5087.1847.9195.4436 1.2204.7717.3.329.5147.7786.6414 1.251a5.7248 5.7248 0 01.197 1.562v5.7972c-.3466.0742-.874.1602-1.5788.2648-.7049.1038-1.4976.1552-2.3774.1552-.5832 0-1.1215-.0573-1.6016-.167a3.385 3.385 0 01-1.2432-.5356 2.6034 2.6034 0 01-.8038-.9565c-.191-.3922-.2898-.9447-.2898-1.5216 0-.5533.1098-.905.3245-1.2854a2.7373 2.7373 0 01.8849-.9338c.376-.2412.8029-.4141 1.2947-.5178a7.4545 7.4545 0 012.325-.1097c.2781.0287.5672.081.879.156v-.3686a2.7781 2.7781 0 00-.092-.738 1.5788 1.5788 0 00-.3246-.6166 1.5079 1.5079 0 00-.612-.415 2.6797 2.6797 0 00-.966-.1729c-.5205 0-.9947.0633-1.4282.1384a6.5608 6.5608 0 00-1.065.259l-.2712-1.8498c.283-.0979.7048-.1957 1.2491-.2935a9.8597 9.8597 0 011.752-.1494zm-6.79-1.072c-.7576.001-1.373-.6103-1.3759-1.3664 0-.755.6128-1.3664 1.376-1.3664.764 0 1.3775.6115 1.3775 1.3664s-.6195 1.3664-1.3776 1.3664zm1.1393 11.1507h-2.2726V5.3409l2.2734-.3568v10.0845l-.0008.0017zm-3.984 0c-3.707.0168-3.707-2.986-3.707-3.4642L59.7069.3576 61.9685 0v11.1794c0 .2715 0 1.9889 1.452 1.994V15.0703zm-7.3512-4.979c0-.975-.2138-1.7873-.6305-2.3516-.4167-.571-.9998-.852-1.747-.852-.7454 0-1.3302.281-1.7452.852-.4166.5702-.6195 1.3765-.6195 2.3516 0 .9851.208 1.6473.6254 2.2183.4158.576.9998.8587 1.7461.8587.7454 0 1.3303-.2885 1.747-.8595.4158-.5761.6237-1.2315.6237-2.2184v.0009zm2.3132-.006c0 .7609-.1099 1.3361-.3356 1.9654a4.654 4.654 0 01-.9533 1.6076A4.214 4.214 0 0155.613 14.69c-.579.2412-1.4697.3795-1.9143.3795-.4462-.005-1.3303-.1324-1.9033-.3795a4.307 4.307 0 01-1.474-1.0316c-.4115-.4445-.7293-.9801-.9609-1.6076a5.3423 5.3423 0 01-.3465-1.9653c0-.7608.104-1.493.3356-2.1155a4.683 4.683 0 01.9719-1.5958 4.3383 4.3383 0 011.479-1.0257c.5739-.242 1.2043-.3567 1.8864-.3567.6829 0 1.3125.1197 1.8906.3567a4.1245 4.1245 0 011.4816 1.0257 4.7587 4.7587 0 01.9592 1.5958c.2426.6225.3643 1.3547.3643 2.1155zm-17.0198 0c0 .9448.208 1.9932.6238 2.431.4166.4386.955.6579 1.6142.6579.3584 0 .6998-.0523 1.0176-.1502.3186-.0978.5721-.2134.775-.3517V7.0784a8.8706 8.8706 0 00-1.4926-.1906c-.8206-.0236-1.4452.312-1.8847.8468-.4335.5365-.6533 1.476-.6533 2.3516v-.0008zm6.2863 4.4485c0 1.5385-.3938 2.662-1.1866 3.3773-.791.7136-2.0005 1.0712-3.6308 1.0712-.5958 0-1.834-.1156-2.8228-.334l.3643-1.7865c.8282.173 1.9202.2193 2.4932.2193.9077 0 1.555-.1847 1.943-.5533.388-.3686.578-.916.578-1.643v-.3687a6.8289 6.8289 0 01-.8848.3349c-.3634.1096-.786.167-1.261.167-.6246 0-1.1917-.0979-1.7055-.2944a3.5554 3.5554 0 01-1.3244-.8645c-.3642-.3796-.6541-.8579-.8561-1.4289-.2028-.571-.3068-1.59-.3068-2.339 0-.7034.1099-1.5856.3245-2.1735.2198-.5871.5316-1.0949.9542-1.515.4167-.42.9255-.743 1.5213-.98a5.5923 5.5923 0 012.052-.3855c.7353 0 1.4114.092 2.0707.2024.6592.1088 1.2204.2236 1.6776.35v8.945-.0008zM11.5026 4.2418v-.6511c-.0005-.4553-.3704-.8241-.8266-.8241H8.749c-.4561 0-.826.3688-.8265.824v.669c0 .0742.0693.1264.1445.1096a6.0346 6.0346 0 011.6768-.2362 6.125 6.125 0 011.6202.2185.1116.1116 0 00.1386-.1097zm-5.2806.852l-.3296-.3282a.8266.8266 0 00-1.168 0l-.393.3922a.8199.8199 0 000 1.164l.3237.323c.0524.0515.1268.0397.1733-.0117.191-.259.3989-.507.6305-.7372.2374-.2362.48-.4437.7462-.6335.0575-.0354.0634-.1155.017-.1687zm3.5159 2.069v2.818c0 .081.0879.1392.1622.0987l2.5102-1.2964c.0574-.0287.0752-.0987.0464-.1552a3.1237 3.1237 0 00-2.603-1.574c-.0575 0-.115.0456-.115.1097l-.0008-.0009zm.0008 6.789c-2.0933.0005-3.7915-1.6912-3.7947-3.7804C5.9468 8.0821 7.6452 6.39 9.7387 6.391c2.0932-.0005 3.7911 1.6914 3.794 3.7804a3.7783 3.7783 0 01-1.1124 2.675 3.7936 3.7936 0 01-2.6824 1.1054h.0008zM9.738 4.8002c-1.9218 0-3.6975 1.0232-4.6584 2.6841a5.359 5.359 0 000 5.3683c.9609 1.661 2.7366 2.6841 4.6584 2.6841a5.3891 5.3891 0 003.8073-1.5725 5.3675 5.3675 0 001.578-3.7987 5.3574 5.3574 0 00-1.5771-3.797A5.379 5.379 0 009.7387 4.801l-.0008-.0008z",fill:"currentColor",fillRule:"evenodd"})))}function Ve(e){return n.createElement("svg",{width:"15",height:"15","aria-label":e.ariaLabel,role:"img"},n.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"},e.children))}function ze(e){var t=e.translations,r=void 0===t?{}:t,o=r.selectText,a=void 0===o?"to select":o,c=r.selectKeyAriaLabel,i=void 0===c?"Enter key":c,l=r.navigateText,s=void 0===l?"to navigate":l,u=r.navigateUpKeyAriaLabel,m=void 0===u?"Arrow up":u,f=r.navigateDownKeyAriaLabel,p=void 0===f?"Arrow down":f,d=r.closeText,h=void 0===d?"to close":d,v=r.closeKeyAriaLabel,y=void 0===v?"Escape key":v,g=r.searchByText,b=void 0===g?"Search by":g;return n.createElement(n.Fragment,null,n.createElement("div",{className:"DocSearch-Logo"},n.createElement(Ue,{translations:{searchByText:b}})),n.createElement("ul",{className:"DocSearch-Commands"},n.createElement("li",null,n.createElement("span",{className:"DocSearch-Commands-Key"},n.createElement(Ve,{ariaLabel:i},n.createElement("path",{d:"M12 3.53088v3c0 1-1 2-2 2H4M7 11.53088l-3-3 3-3"}))),n.createElement("span",{className:"DocSearch-Label"},a)),n.createElement("li",null,n.createElement("span",{className:"DocSearch-Commands-Key"},n.createElement(Ve,{ariaLabel:p},n.createElement("path",{d:"M7.5 3.5v8M10.5 8.5l-3 3-3-3"}))),n.createElement("span",{className:"DocSearch-Commands-Key"},n.createElement(Ve,{ariaLabel:m},n.createElement("path",{d:"M7.5 11.5v-8M10.5 6.5l-3-3-3 3"}))),n.createElement("span",{className:"DocSearch-Label"},s)),n.createElement("li",null,n.createElement("span",{className:"DocSearch-Commands-Key"},n.createElement(Ve,{ariaLabel:y},n.createElement("path",{d:"M13.6167 8.936c-.1065.3583-.6883.962-1.4875.962-.7993 0-1.653-.9165-1.653-2.1258v-.5678c0-1.2548.7896-2.1016 1.653-2.1016.8634 0 1.3601.4778 1.4875 1.0724M9 6c-.1352-.4735-.7506-.9219-1.46-.8972-.7092.0246-1.344.57-1.344 1.2166s.4198.8812 1.3445.9805C8.465 7.3992 8.968 7.9337 9 8.5c.032.5663-.454 1.398-1.4595 1.398C6.6593 9.898 6 9 5.963 8.4851m-1.4748.5368c-.2635.5941-.8099.876-1.5443.876s-1.7073-.6248-1.7073-2.204v-.4603c0-1.0416.721-2.131 1.7073-2.131.9864 0 1.6425 1.031 1.5443 2.2492h-2.956"}))),n.createElement("span",{className:"DocSearch-Label"},h))))}function Ke(e){var t=e.hit,r=e.children;return n.createElement("a",{href:t.url},r)}function Je(){return n.createElement("svg",{viewBox:"0 0 38 38",stroke:"currentColor",strokeOpacity:".5"},n.createElement("g",{fill:"none",fillRule:"evenodd"},n.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},n.createElement("circle",{strokeOpacity:".3",cx:"18",cy:"18",r:"18"}),n.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18"},n.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))))}function $e(){return n.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},n.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M3.18 6.6a8.23 8.23 0 1112.93 9.94h0a8.23 8.23 0 01-11.63 0"}),n.createElement("path",{d:"M6.44 7.25H2.55V3.36M10.45 6v5.6M10.45 11.6L13 13"})))}function Qe(){return n.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},n.createElement("path",{d:"M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function We(){return n.createElement("svg",{className:"DocSearch-Hit-Select-Icon",width:"20",height:"20",viewBox:"0 0 20 20"},n.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M18 3v4c0 2-2 4-4 4H2"}),n.createElement("path",{d:"M8 17l-6-6 6-6"})))}var Ye=function(){return n.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},n.createElement("path",{d:"M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))};function Xe(e){switch(e.type){case"lvl1":return n.createElement(Ye,null);case"content":return n.createElement(Ze,null);default:return n.createElement(Ge,null)}}function Ge(){return n.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},n.createElement("path",{d:"M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function Ze(){return n.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},n.createElement("path",{d:"M17 5H3h14zm0 5H3h14zm0 5H3h14z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function et(){return n.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},n.createElement("path",{d:"M10 14.2L5 17l1-5.6-4-4 5.5-.7 2.5-5 2.5 5 5.6.8-4 4 .9 5.5z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function tt(){return n.createElement("svg",{width:"40",height:"40",viewBox:"0 0 20 20",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M19 4.8a16 16 0 00-2-1.2m-3.3-1.2A16 16 0 001.1 4.7M16.7 8a12 12 0 00-2.8-1.4M10 6a12 12 0 00-6.7 2M12.3 14.7a4 4 0 00-4.5 0M14.5 11.4A8 8 0 0010 10M3 16L18 2M10 18h0"}))}function rt(){return n.createElement("svg",{width:"40",height:"40",viewBox:"0 0 20 20",fill:"none",fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("path",{d:"M15.5 4.8c2 3 1.7 7-1 9.7h0l4.3 4.3-4.3-4.3a7.8 7.8 0 01-9.8 1m-2.2-2.2A7.8 7.8 0 0113.2 2.4M2 18L18 2"}))}function nt(e){var t=e.translations,r=void 0===t?{}:t,o=r.titleText,a=void 0===o?"Unable to fetch results":o,c=r.helpText,i=void 0===c?"You might want to check your network connection.":c;return n.createElement("div",{className:"DocSearch-ErrorScreen"},n.createElement("div",{className:"DocSearch-Screen-Icon"},n.createElement(tt,null)),n.createElement("p",{className:"DocSearch-Title"},a),n.createElement("p",{className:"DocSearch-Help"},i))}var ot=["translations"];function at(e){var t=e.translations,r=void 0===t?{}:t,o=l(e,ot),a=r.noResultsText,c=void 0===a?"No results for":a,i=r.suggestedQueryText,s=void 0===i?"Try searching for":i,m=r.reportMissingResultsText,f=void 0===m?"Believe this query should return results?":m,p=r.reportMissingResultsLinkText,d=void 0===p?"Let us know.":p,h=o.state.context.searchSuggestions;return n.createElement("div",{className:"DocSearch-NoResults"},n.createElement("div",{className:"DocSearch-Screen-Icon"},n.createElement(rt,null)),n.createElement("p",{className:"DocSearch-Title"},c,' "',n.createElement("strong",null,o.state.query),'"'),h&&h.length>0&&n.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},n.createElement("p",{className:"DocSearch-Help"},s,":"),n.createElement("ul",null,h.slice(0,3).reduce((function(e,t){return[].concat(u(e),[n.createElement("li",{key:t},n.createElement("button",{className:"DocSearch-Prefill",key:t,type:"button",onClick:function(){o.setQuery(t.toLowerCase()+" "),o.refresh(),o.inputRef.current.focus()}},t))])}),[]))),o.getMissingResultsUrl&&n.createElement("p",{className:"DocSearch-Help"},"".concat(f," "),n.createElement("a",{href:o.getMissingResultsUrl({query:o.state.query}),target:"_blank",rel:"noopener noreferrer"},d)))}var ct=["hit","attribute","tagName"];function it(e,t){return t.split(".").reduce((function(e,t){return null!=e&&e[t]?e[t]:null}),e)}function lt(e){var r=e.hit,n=e.attribute,o=e.tagName,c=void 0===o?"span":o,i=l(e,ct);return t.createElement(c,a(a({},i),{},{dangerouslySetInnerHTML:{__html:it(r,"_snippetResult.".concat(n,".value"))||it(r,n)}}))}function st(e){return e.collection&&0!==e.collection.items.length?n.createElement("section",{className:"DocSearch-Hits"},n.createElement("div",{className:"DocSearch-Hit-source"},e.title),n.createElement("ul",e.getListProps(),e.collection.items.map((function(t,r){return n.createElement(ut,i({key:[e.title,t.objectID].join(":"),item:t,index:r},e))})))):null}function ut(e){var t=e.item,r=e.index,o=e.renderIcon,a=e.renderAction,c=e.getItemProps,l=e.onItemClick,u=e.collection,m=e.hitComponent,f=s(n.useState(!1),2),p=f[0],d=f[1],h=s(n.useState(!1),2),v=h[0],y=h[1],g=n.useRef(null),b=m;return n.createElement("li",i({className:["DocSearch-Hit",t.__docsearch_parent&&"DocSearch-Hit--Child",p&&"DocSearch-Hit--deleting",v&&"DocSearch-Hit--favoriting"].filter(Boolean).join(" "),onTransitionEnd:function(){g.current&&g.current()}},c({item:t,source:u.source,onClick:function(){l(t)}})),n.createElement(b,{hit:t},n.createElement("div",{className:"DocSearch-Hit-Container"},o({item:t,index:r}),t.hierarchy[t.type]&&"lvl1"===t.type&&n.createElement("div",{className:"DocSearch-Hit-content-wrapper"},n.createElement(lt,{className:"DocSearch-Hit-title",hit:t,attribute:"hierarchy.lvl1"}),t.content&&n.createElement(lt,{className:"DocSearch-Hit-path",hit:t,attribute:"content"})),t.hierarchy[t.type]&&("lvl2"===t.type||"lvl3"===t.type||"lvl4"===t.type||"lvl5"===t.type||"lvl6"===t.type)&&n.createElement("div",{className:"DocSearch-Hit-content-wrapper"},n.createElement(lt,{className:"DocSearch-Hit-title",hit:t,attribute:"hierarchy.".concat(t.type)}),n.createElement(lt,{className:"DocSearch-Hit-path",hit:t,attribute:"hierarchy.lvl1"})),"content"===t.type&&n.createElement("div",{className:"DocSearch-Hit-content-wrapper"},n.createElement(lt,{className:"DocSearch-Hit-title",hit:t,attribute:"content"}),n.createElement(lt,{className:"DocSearch-Hit-path",hit:t,attribute:"hierarchy.lvl1"})),a({item:t,runDeleteTransition:function(e){d(!0),g.current=e},runFavoriteTransition:function(e){y(!0),g.current=e}}))))}function mt(e,t){return e.reduce((function(e,r){var n=t(r);return e.hasOwnProperty(n)||(e[n]=[]),e[n].length<5&&e[n].push(r),e}),{})}function ft(e){return e}function pt(){}var dt=/(|<\/mark>)/g,ht=RegExp(dt.source);function vt(e){var t,r,n,o,a,c=e;if(!c.__docsearch_parent&&!e._highlightResult)return e.hierarchy.lvl0;var i=((c.__docsearch_parent?null===(t=c.__docsearch_parent)||void 0===t||null===(r=t._highlightResult)||void 0===r||null===(n=r.hierarchy)||void 0===n?void 0:n.lvl0:null===(o=e._highlightResult)||void 0===o||null===(a=o.hierarchy)||void 0===a?void 0:a.lvl0)||{}).value;return i&&ht.test(i)?i.replace(dt,""):i}function yt(e){return n.createElement("div",{className:"DocSearch-Dropdown-Container"},e.state.collections.map((function(t){if(0===t.items.length)return null;var r=vt(t.items[0]);return n.createElement(st,i({},e,{key:t.source.sourceId,title:r,collection:t,renderIcon:function(e){var r,o=e.item,a=e.index;return n.createElement(n.Fragment,null,o.__docsearch_parent&&n.createElement("svg",{className:"DocSearch-Hit-Tree",viewBox:"0 0 24 54"},n.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},o.__docsearch_parent!==(null===(r=t.items[a+1])||void 0===r?void 0:r.__docsearch_parent)?n.createElement("path",{d:"M8 6v21M20 27H8.3"}):n.createElement("path",{d:"M8 6v42M20 27H8.3"}))),n.createElement("div",{className:"DocSearch-Hit-icon"},n.createElement(Xe,{type:o.type})))},renderAction:function(){return n.createElement("div",{className:"DocSearch-Hit-action"},n.createElement(We,null))}}))})),e.resultsFooterComponent&&n.createElement("section",{className:"DocSearch-HitsFooter"},n.createElement(e.resultsFooterComponent,{state:e.state})))}var gt=["translations"];function bt(e){var t=e.translations,r=void 0===t?{}:t,o=l(e,gt),a=r.recentSearchesTitle,c=void 0===a?"Recent":a,s=r.noRecentSearchesText,u=void 0===s?"No recent searches":s,m=r.saveRecentSearchButtonTitle,f=void 0===m?"Save this search":m,p=r.removeRecentSearchButtonTitle,d=void 0===p?"Remove this search from history":p,h=r.favoriteSearchesTitle,v=void 0===h?"Favorite":h,y=r.removeFavoriteSearchButtonTitle,g=void 0===y?"Remove this search from favorites":y;return"idle"===o.state.status&&!1===o.hasCollections?o.disableUserPersonalization?null:n.createElement("div",{className:"DocSearch-StartScreen"},n.createElement("p",{className:"DocSearch-Help"},u)):!1===o.hasCollections?null:n.createElement("div",{className:"DocSearch-Dropdown-Container"},n.createElement(st,i({},o,{title:c,collection:o.state.collections[0],renderIcon:function(){return n.createElement("div",{className:"DocSearch-Hit-icon"},n.createElement($e,null))},renderAction:function(e){var t=e.item,r=e.runFavoriteTransition,a=e.runDeleteTransition;return n.createElement(n.Fragment,null,n.createElement("div",{className:"DocSearch-Hit-action"},n.createElement("button",{className:"DocSearch-Hit-action-button",title:f,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),r((function(){o.favoriteSearches.add(t),o.recentSearches.remove(t),o.refresh()}))}},n.createElement(et,null))),n.createElement("div",{className:"DocSearch-Hit-action"},n.createElement("button",{className:"DocSearch-Hit-action-button",title:d,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),a((function(){o.recentSearches.remove(t),o.refresh()}))}},n.createElement(Qe,null))))}})),n.createElement(st,i({},o,{title:v,collection:o.state.collections[1],renderIcon:function(){return n.createElement("div",{className:"DocSearch-Hit-icon"},n.createElement(et,null))},renderAction:function(e){var t=e.item,r=e.runDeleteTransition;return n.createElement("div",{className:"DocSearch-Hit-action"},n.createElement("button",{className:"DocSearch-Hit-action-button",title:g,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),r((function(){o.favoriteSearches.remove(t),o.refresh()}))}},n.createElement(Qe,null)))}})))}var Ot=["translations"],St=n.memo((function(e){var t=e.translations,r=void 0===t?{}:t,o=l(e,Ot);if("error"===o.state.status)return n.createElement(nt,{translations:null==r?void 0:r.errorScreen});var a=o.state.collections.some((function(e){return e.items.length>0}));return o.state.query?!1===a?n.createElement(at,i({},o,{translations:null==r?void 0:r.noResultsScreen})):n.createElement(yt,o):n.createElement(bt,i({},o,{hasCollections:a,translations:null==r?void 0:r.startScreen}))}),(function(e,t){return"loading"===t.state.status||"stalled"===t.state.status})),Et=["translations"];function wt(e){var t=e.translations,r=void 0===t?{}:t,o=l(e,Et),a=r.resetButtonTitle,c=void 0===a?"Clear the query":a,s=r.resetButtonAriaLabel,u=void 0===s?"Clear the query":s,m=r.cancelButtonText,f=void 0===m?"Cancel":m,p=r.cancelButtonAriaLabel,h=void 0===p?"Cancel":p,v=o.getFormProps({inputElement:o.inputRef.current}).onReset;return n.useEffect((function(){o.autoFocus&&o.inputRef.current&&o.inputRef.current.focus()}),[o.autoFocus,o.inputRef]),n.useEffect((function(){o.isFromSelection&&o.inputRef.current&&o.inputRef.current.select()}),[o.isFromSelection,o.inputRef]),n.createElement(n.Fragment,null,n.createElement("form",{className:"DocSearch-Form",onSubmit:function(e){e.preventDefault()},onReset:v},n.createElement("label",i({className:"DocSearch-MagnifierLabel"},o.getLabelProps()),n.createElement(d,null)),n.createElement("div",{className:"DocSearch-LoadingIndicator"},n.createElement(Je,null)),n.createElement("input",i({className:"DocSearch-Input",ref:o.inputRef},o.getInputProps({inputElement:o.inputRef.current,autoFocus:o.autoFocus,maxLength:64}))),n.createElement("button",{type:"reset",title:c,className:"DocSearch-Reset","aria-label":u,hidden:!o.state.query},n.createElement(Qe,null))),n.createElement("button",{className:"DocSearch-Cancel",type:"reset","aria-label":h,onClick:o.onClose},f))}var jt=["_highlightResult","_snippetResult"];function Pt(e){return!1===function(){var e="__TEST_KEY__";try{return localStorage.setItem(e,""),localStorage.removeItem(e),!0}catch(e){return!1}}()?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){return window.localStorage.setItem(e,JSON.stringify(t))},getItem:function(){var t=window.localStorage.getItem(e);return t?JSON.parse(t):[]}}}function It(e){var t=e.key,r=e.limit,n=void 0===r?5:r,o=Pt(t),a=o.getItem().slice(0,n);return{add:function(e){var t=e,r=(t._highlightResult,t._snippetResult,l(t,jt)),c=a.findIndex((function(e){return e.objectID===r.objectID}));c>-1&&a.splice(c,1),a.unshift(r),a=a.slice(0,n),o.setItem(a)},remove:function(e){a=a.filter((function(t){return t.objectID!==e.objectID})),o.setItem(a)},getAll:function(){return a}}}function Dt(e){const t=`algoliasearch-client-js-${e.key}`;let r;const n=()=>(void 0===r&&(r=e.localStorage||window.localStorage),r),o=()=>JSON.parse(n().getItem(t)||"{}");return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),n=o()[r];return Promise.all([n||t(),void 0!==n])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,r)=>Promise.resolve().then((()=>{const a=o();return a[JSON.stringify(e)]=r,n().setItem(t,JSON.stringify(a)),r})),delete:e=>Promise.resolve().then((()=>{const r=o();delete r[JSON.stringify(e)],n().setItem(t,JSON.stringify(r))})),clear:()=>Promise.resolve().then((()=>{n().removeItem(t)}))}}function Ct(e){const t=[...e.caches],r=t.shift();return void 0===r?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,n,o={miss:()=>Promise.resolve()})=>r.get(e,n,o).catch((()=>Ct({caches:t}).get(e,n,o))),set:(e,n)=>r.set(e,n).catch((()=>Ct({caches:t}).set(e,n))),delete:e=>r.delete(e).catch((()=>Ct({caches:t}).delete(e))),clear:()=>r.clear().catch((()=>Ct({caches:t}).clear()))}}function kt(e={serializable:!0}){let t={};return{get(r,n,o={miss:()=>Promise.resolve()}){const a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);const c=n(),i=o&&o.miss||(()=>Promise.resolve());return c.then((e=>i(e))).then((()=>c))},set:(r,n)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}function Nt(e){let t=e.length-1;for(;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function At(e,t){return t?(Object.keys(t).forEach((r=>{e[r]=t[r](e)})),e):e}function xt(e,...t){let r=0;return e.replace(/%s/g,(()=>encodeURIComponent(t[r++])))}const Rt="4.8.5",_t={WithinQueryParameters:0,WithinHeaders:1};function qt(e,t){const r=e||{},n=r.data||{};return Object.keys(r).forEach((e=>{-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(n[e]=r[e])})),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}const Tt={Read:1,Write:2,Any:3},Lt=1,Mt=2,Ht=3,Bt=12e4;function Ft(e,t=Lt){return{...e,status:t,lastUpdate:Date.now()}}function Ut(e){return"string"==typeof e?{protocol:"https",url:e,accept:Tt.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||Tt.Any}}const Vt="GET",zt="POST";function Kt(e,t){return Promise.all(t.map((t=>e.get(t,(()=>Promise.resolve(Ft(t))))))).then((e=>{const r=e.filter((e=>function(e){return e.status===Lt||Date.now()-e.lastUpdate>Bt}(e))),n=e.filter((e=>function(e){return e.status===Ht&&Date.now()-e.lastUpdate<=Bt}(e))),o=[...r,...n];return{getTimeout:(e,t)=>(0===n.length&&0===e?1:n.length+3+e)*t,statelessHosts:o.length>0?o.map((e=>Ut(e))):t}}))}function Jt(e,t,r,n){const o=[],a=function(e,t){if(e.method===Vt||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(r,n),c=function(e,t){const r={...e.headers,...t.headers},n={};return Object.keys(r).forEach((e=>{const t=r[e];n[e.toLowerCase()]=t})),n}(e,n),i=r.method,l=r.method!==Vt?{}:{...r.data,...n.data},s={"x-algolia-agent":e.userAgent.value,...e.queryParameters,...l,...n.queryParameters};let u=0;const m=(t,l)=>{const f=t.pop();if(void 0===f)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:Yt(o)};const p={data:a,headers:c,method:i,url:Qt(f,r.path,s),connectTimeout:l(u,e.timeouts.connect),responseTimeout:l(u,n.timeout)},d=e=>{const r={request:p,response:e,host:f,triesLeft:t.length};return o.push(r),r},h={onSucess:e=>function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e),onRetry(r){const n=d(r);return r.isTimedOut&&u++,Promise.all([e.logger.info("Retryable failure",Xt(n)),e.hostsCache.set(f,Ft(f,r.isTimedOut?Ht:Mt))]).then((()=>m(t,l)))},onFail(e){throw d(e),function({content:e,status:t},r){let n=e;try{n=JSON.parse(e).message}catch(e){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(n,t,r)}(e,Yt(o))}};return e.requester.send(p).then((e=>((e,t)=>(e=>{const t=e.status;return e.isTimedOut||(({isTimedOut:e,status:t})=>!e&&0==~~t)(e)||2!=~~(t/100)&&4!=~~(t/100)})(e)?t.onRetry(e):(({status:e})=>2==~~(e/100))(e)?t.onSucess(e):t.onFail(e))(e,h)))};return Kt(e.hostsCache,t).then((e=>m([...e.statelessHosts].reverse(),e.getTimeout)))}function $t(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}function Qt(e,t,r){const n=Wt(r);let o=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return n.length&&(o+=`?${n}`),o}function Wt(e){return Object.keys(e).map((t=>{return xt("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function Yt(e){return e.map((e=>Xt(e)))}function Xt(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}const Gt=e=>{const t=e.appId,r=function(e,t,r){const n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:()=>e===_t.WithinHeaders?n:{},queryParameters:()=>e===_t.WithinQueryParameters?n:{}}}(void 0!==e.authMode?e.authMode:_t.WithinHeaders,t,e.apiKey),n=function(e){const{hostsCache:t,logger:r,requester:n,requestsCache:o,responsesCache:a,timeouts:c,userAgent:i,hosts:l,queryParameters:s,headers:u}=e,m={hostsCache:t,logger:r,requester:n,requestsCache:o,responsesCache:a,timeouts:c,userAgent:i,headers:u,queryParameters:s,hosts:l.map((e=>Ut(e))),read(e,t){const r=qt(t,m.timeouts.read),n=()=>Jt(m,m.hosts.filter((e=>0!=(e.accept&Tt.Read))),e,r);if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();const o={request:e,mappedRequestOptions:r,transporter:{queryParameters:m.queryParameters,headers:m.headers}};return m.responsesCache.get(o,(()=>m.requestsCache.get(o,(()=>m.requestsCache.set(o,n()).then((e=>Promise.all([m.requestsCache.delete(o),e])),(e=>Promise.all([m.requestsCache.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>m.responsesCache.set(o,e)})},write:(e,t)=>Jt(m,m.hosts.filter((e=>0!=(e.accept&Tt.Write))),e,qt(t,m.timeouts.write))};return m}({hosts:[{url:`${t}-dsn.algolia.net`,accept:Tt.Read},{url:`${t}.algolia.net`,accept:Tt.Write}].concat(Nt([{url:`${t}-1.algolianet.com`},{url:`${t}-2.algolianet.com`},{url:`${t}-3.algolianet.com`}])),...e,headers:{...r.headers(),"content-type":"application/x-www-form-urlencoded",...e.headers},queryParameters:{...r.queryParameters(),...e.queryParameters}}),o={transporter:n,appId:t,addAlgoliaAgent(e,t){n.userAgent.add({segment:e,version:t})},clearCache:()=>Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then((()=>{}))};return At(o,e.methods)},Zt=e=>(t,r={})=>At({transporter:e.transporter,appId:e.appId,indexName:t},r.methods),er=e=>(t,r)=>{const n=t.map((e=>({...e,params:Wt(e.params||{})})));return e.transporter.read({method:zt,path:"1/indexes/*/queries",data:{requests:n},cacheable:!0},r)},tr=e=>(t,r)=>Promise.all(t.map((t=>{const{facetName:n,facetQuery:o,...a}=t.params;return Zt(e)(t.indexName,{methods:{searchForFacetValues:or}}).searchForFacetValues(n,o,{...r,...a})}))),rr=e=>(t,r,n)=>e.transporter.read({method:zt,path:xt("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:r},cacheable:!0},n),nr=e=>(t,r)=>e.transporter.read({method:zt,path:xt("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r),or=e=>(t,r,n)=>e.transporter.read({method:zt,path:xt("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n),ar=1,cr=2,ir=3;function lr(e,t,r){const n={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:e=>new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const n=(e,n)=>setTimeout((()=>{r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e),o=n(e.connectTimeout,"Connection timeout");let a;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===a&&(clearTimeout(o),a=n(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(o),clearTimeout(a),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(o),clearTimeout(a),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))},logger:(o=ir,{debug:(e,t)=>(ar>=o&&console.debug(e,t),Promise.resolve()),info:(e,t)=>(cr>=o&&console.info(e,t),Promise.resolve()),error:(e,t)=>(console.error(e,t),Promise.resolve())}),responsesCache:kt(),requestsCache:kt({serializable:!1}),hostsCache:Ct({caches:[Dt({key:`4.8.5-${e}`}),kt()]}),userAgent:$t(Rt).add({segment:"Browser",version:"lite"}),authMode:_t.WithinQueryParameters};var o;return Gt({...n,...r,methods:{search:er,searchForFacetValues:tr,multipleQueries:er,multipleSearchForFacetValues:tr,initIndex:e=>t=>Zt(e)(t,{methods:{search:nr,searchForFacetValues:or,findAnswers:rr}})}})}lr.version=Rt;var sr="3.0.0";var ur=["footer","searchBox"];function mr(e){var t=e.appId,r=e.apiKey,o=e.indexName,c=e.placeholder,u=void 0===c?"Search docs":c,m=e.searchParameters,f=e.onClose,p=void 0===f?pt:f,d=e.transformItems,h=void 0===d?ft:d,v=e.hitComponent,y=void 0===v?Ke:v,g=e.resultsFooterComponent,b=void 0===g?function(){return null}:g,O=e.navigator,S=e.initialScrollY,E=void 0===S?0:S,w=e.transformSearchClient,j=void 0===w?ft:w,P=e.disableUserPersonalization,I=void 0!==P&&P,D=e.initialQuery,C=void 0===D?"":D,k=e.translations,N=void 0===k?{}:k,A=e.getMissingResultsUrl,x=N.footer,R=N.searchBox,_=l(N,ur),q=s(n.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),T=q[0],L=q[1],M=n.useRef(null),H=n.useRef(null),B=n.useRef(null),F=n.useRef(null),U=n.useRef(null),V=n.useRef(10),z=n.useRef("undefined"!=typeof window?window.getSelection().toString().slice(0,64):"").current,K=n.useRef(C||z).current,J=function(e,t,r){return n.useMemo((function(){var n=lr(e,t);return n.addAlgoliaAgent("docsearch",sr),!1===/docsearch.js \(.*\)/.test(n.transporter.userAgent.value)&&n.addAlgoliaAgent("docsearch-react",sr),r(n)}),[e,t,r])}(t,r,j),$=n.useRef(It({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(o),limit:10})).current,Q=n.useRef(It({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(o),limit:0===$.getAll().length?7:4})).current,W=n.useCallback((function(e){if(!I){var t="content"===e.type?e.__docsearch_parent:e;t&&-1===$.getAll().findIndex((function(e){return e.objectID===t.objectID}))&&Q.add(t)}}),[$,Q,I]),Y=n.useMemo((function(){return Fe({id:"docsearch",defaultActiveItemId:0,placeholder:u,openOnFocus:!0,initialState:{query:K,context:{searchSuggestions:[]}},navigator:O,onStateChange:function(e){L(e.state)},getSources:function(e){var t=e.query,r=e.state,n=e.setContext,c=e.setStatus;return t?J.search([{query:t,indexName:o,params:a({attributesToRetrieve:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:["hierarchy.lvl1:".concat(V.current),"hierarchy.lvl2:".concat(V.current),"hierarchy.lvl3:".concat(V.current),"hierarchy.lvl4:".concat(V.current),"hierarchy.lvl5:".concat(V.current),"hierarchy.lvl6:".concat(V.current),"content:".concat(V.current)],snippetEllipsisText:"…",highlightPreTag:"",highlightPostTag:"",hitsPerPage:20},m)}]).catch((function(e){throw"RetryError"===e.name&&c("error"),e})).then((function(e){var t=e.results[0],o=t.hits,c=t.nbHits,i=mt(o,(function(e){return vt(e)}));return r.context.searchSuggestions.length0&&(Z(),U.current&&U.current.focus())}),[K,Z]),n.useEffect((function(){function e(){if(H.current){var e=.01*window.innerHeight;H.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),n.createElement("div",i({ref:M},G({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===T.status&&"DocSearch-Container--Stalled","error"===T.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),role:"button",tabIndex:0,onMouseDown:function(e){e.target===e.currentTarget&&p()}}),n.createElement("div",{className:"DocSearch-Modal",ref:H},n.createElement("header",{className:"DocSearch-SearchBar",ref:B},n.createElement(wt,i({},Y,{state:T,autoFocus:0===K.length,inputRef:U,isFromSelection:Boolean(K)&&K===z,translations:R,onClose:p}))),n.createElement("div",{className:"DocSearch-Dropdown",ref:F},n.createElement(St,i({},Y,{indexName:o,state:T,hitComponent:y,resultsFooterComponent:b,disableUserPersonalization:I,recentSearches:Q,favoriteSearches:$,inputRef:U,translations:_,getMissingResultsUrl:A,onItemClick:function(e){W(e),p()}}))),n.createElement("footer",{className:"DocSearch-Footer"},n.createElement(ze,{translations:x}))))}function fr(e){var t=e.isOpen,r=e.onOpen,o=e.onClose,a=e.onInput,c=e.searchButtonRef;n.useEffect((function(){function e(e){(27===e.keyCode&&t||"k"===e.key&&(e.metaKey||e.ctrlKey)||!function(e){var t=e.target,r=t.tagName;return t.isContentEditable||"INPUT"===r||"SELECT"===r||"TEXTAREA"===r}(e)&&"/"===e.key&&!t)&&(e.preventDefault(),t?o():document.body.classList.contains("DocSearch--active")||document.body.classList.contains("DocSearch--active")||r()),c&&c.current===document.activeElement&&a&&/[a-zA-Z0-9]/.test(String.fromCharCode(e.keyCode))&&a(e)}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[t,r,o,a,c])}e.DocSearch=function(e){var t,o,a=n.useRef(null),c=s(n.useState(!1),2),l=c[0],u=c[1],m=s(n.useState((null==e?void 0:e.initialQuery)||void 0),2),f=m[0],p=m[1],d=n.useCallback((function(){u(!0)}),[u]),h=n.useCallback((function(){u(!1)}),[u]);return fr({isOpen:l,onOpen:d,onClose:h,onInput:n.useCallback((function(e){u(!0),p(e.key)}),[u,p]),searchButtonRef:a}),n.createElement(n.Fragment,null,n.createElement(y,{ref:a,translations:null==e||null===(t=e.translations)||void 0===t?void 0:t.button,onClick:d}),l&&r.createPortal(n.createElement(mr,i({},e,{initialScrollY:window.scrollY,initialQuery:f,translations:null==e||null===(o=e.translations)||void 0===o?void 0:o.modal,onClose:h})),document.body))},e.DocSearchButton=y,e.DocSearchModal=mr,e.useDocSearchKeyboardEvents=fr,e.version=sr,Object.defineProperty(e,"__esModule",{value:!0})})); +//# sourceMappingURL=index.js.map diff --git a/node_modules/@docsearch/react/dist/umd/index.js.map b/node_modules/@docsearch/react/dist/umd/index.js.map new file mode 100644 index 0000000000..519b8578c2 --- /dev/null +++ b/node_modules/@docsearch/react/dist/umd/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../../src/icons/ControlKeyIcon.tsx","../../src/icons/SearchIcon.tsx","../../src/DocSearchButton.tsx","../../../../node_modules/@algolia/autocomplete-shared/dist/esm/flatten.js","../../../../node_modules/@algolia/autocomplete-shared/dist/esm/generateAutocompleteId.js","../../../../node_modules/@algolia/autocomplete-shared/dist/esm/getItemsCount.js","../../../../node_modules/@algolia/autocomplete-shared/dist/esm/noop.js","../../../../node_modules/@algolia/autocomplete-shared/dist/esm/userAgents.js","../../../../node_modules/@algolia/autocomplete-shared/dist/esm/version.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromise.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/getNextActiveItemId.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/getNormalizedSources.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/getActiveItem.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/mapToAlgoliaResponse.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/createStore.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromiseList.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/getAutocompleteSetters.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/getDefaultProps.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/reshape.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/resolve.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/onInput.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/createConcurrentSafePromise.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/onKeyDown.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/getPropGetters.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/utils/isOrContainsNode.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/metadata.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/getCompletion.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/stateReducer.js","../../../../node_modules/@algolia/autocomplete-core/dist/esm/createAutocomplete.js","../../src/AlgoliaLogo.tsx","../../src/Footer.tsx","../../src/Hit.tsx","../../src/icons/LoadingIcon.tsx","../../src/icons/RecentIcon.tsx","../../src/icons/ResetIcon.tsx","../../src/icons/SelectIcon.tsx","../../src/icons/SourceIcon.tsx","../../src/icons/StarIcon.tsx","../../src/icons/ErrorIcon.tsx","../../src/icons/NoResultsIcon.tsx","../../src/ErrorScreen.tsx","../../src/NoResultsScreen.tsx","../../src/Snippet.tsx","../../src/Results.tsx","../../src/utils/groupBy.ts","../../src/utils/identity.ts","../../src/utils/noop.ts","../../src/utils/removeHighlightTags.ts","../../src/ResultsScreen.tsx","../../src/StartScreen.tsx","../../src/ScreenState.tsx","../../src/SearchBox.tsx","../../src/constants.ts","../../src/stored-searches.ts","../../node_modules/algoliasearch/dist/algoliasearch-lite.esm.browser.js","../../src/version.ts","../../src/DocSearchModal.tsx","../../src/useSearchClient.ts","../../src/useTouchEvents.ts","../../src/useTrapFocus.ts","../../src/useDocSearchKeyboardEvents.ts","../../src/DocSearch.tsx"],"sourcesContent":["import React from 'react';\n\nexport function ControlKeyIcon() {\n return (\n \n \n \n );\n}\n","import React from 'react';\n\nexport function SearchIcon() {\n return (\n \n \n \n );\n}\n","import React, { useMemo } from 'react';\n\nimport { ControlKeyIcon } from './icons/ControlKeyIcon';\nimport { SearchIcon } from './icons/SearchIcon';\n\nexport type ButtonTranslations = Partial<{\n buttonText: string;\n buttonAriaLabel: string;\n}>;\n\nexport type DocSearchButtonProps = React.ComponentProps<'button'> & {\n translations?: ButtonTranslations;\n};\n\nconst ACTION_KEY_DEFAULT = 'Ctrl' as const;\nconst ACTION_KEY_APPLE = '⌘' as const;\n\nfunction isAppleDevice() {\n return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);\n}\n\nexport const DocSearchButton = React.forwardRef<\n HTMLButtonElement,\n DocSearchButtonProps\n>(({ translations = {}, ...props }, ref) => {\n const { buttonText = 'Search', buttonAriaLabel = 'Search' } = translations;\n\n const key = useMemo<\n typeof ACTION_KEY_APPLE | typeof ACTION_KEY_DEFAULT | null\n >(() => {\n if (typeof navigator !== 'undefined') {\n return isAppleDevice() ? ACTION_KEY_APPLE : ACTION_KEY_DEFAULT;\n }\n return null;\n }, []);\n\n return (\n \n \n \n {buttonText}\n \n\n \n {key !== null && (\n <>\n \n {key === ACTION_KEY_DEFAULT ? : key}\n \n K\n \n )}\n \n \n );\n});\n","export function flatten(values) {\n return values.reduce(function (a, b) {\n return a.concat(b);\n }, []);\n}","var autocompleteId = 0;\nexport function generateAutocompleteId() {\n return \"autocomplete-\".concat(autocompleteId++);\n}","export function getItemsCount(state) {\n if (state.collections.length === 0) {\n return 0;\n }\n\n return state.collections.reduce(function (sum, collection) {\n return sum + collection.items.length;\n }, 0);\n}","export var noop = function noop() {};","import { version } from './version';\nexport var userAgents = [{\n segment: 'autocomplete-core',\n version: version\n}];","export var version = '1.5.2';","function createInternalCancelablePromise(promise, initialState) {\n var state = initialState;\n return {\n then: function then(onfulfilled, onrejected) {\n return createInternalCancelablePromise(promise.then(createCallback(onfulfilled, state, promise), createCallback(onrejected, state, promise)), state);\n },\n catch: function _catch(onrejected) {\n return createInternalCancelablePromise(promise.catch(createCallback(onrejected, state, promise)), state);\n },\n finally: function _finally(onfinally) {\n if (onfinally) {\n state.onCancelList.push(onfinally);\n }\n\n return createInternalCancelablePromise(promise.finally(createCallback(onfinally && function () {\n state.onCancelList = [];\n return onfinally();\n }, state, promise)), state);\n },\n cancel: function cancel() {\n state.isCanceled = true;\n var callbacks = state.onCancelList;\n state.onCancelList = [];\n callbacks.forEach(function (callback) {\n callback();\n });\n },\n isCanceled: function isCanceled() {\n return state.isCanceled === true;\n }\n };\n}\n\nexport function createCancelablePromise(executor) {\n return createInternalCancelablePromise(new Promise(function (resolve, reject) {\n return executor(resolve, reject);\n }), {\n isCanceled: false,\n onCancelList: []\n });\n}\n\ncreateCancelablePromise.resolve = function (value) {\n return cancelable(Promise.resolve(value));\n};\n\ncreateCancelablePromise.reject = function (reason) {\n return cancelable(Promise.reject(reason));\n};\n\nexport function cancelable(promise) {\n return createInternalCancelablePromise(promise, {\n isCanceled: false,\n onCancelList: []\n });\n}\n\nfunction createCallback(onResult, state, fallback) {\n if (!onResult) {\n return fallback;\n }\n\n return function callback(arg) {\n if (state.isCanceled) {\n return arg;\n }\n\n return onResult(arg);\n };\n}","/**\n * Returns the next active item ID from the current state.\n *\n * We allow circular keyboard navigation from the base index.\n * The base index can either be `null` (nothing is highlighted) or `0`\n * (the first item is highlighted).\n * The base index is allowed to get assigned `null` only if\n * `props.defaultActiveItemId` is `null`. This pattern allows to \"stop\"\n * by the actual query before navigating to other suggestions as seen on\n * Google or Amazon.\n *\n * @param moveAmount The offset to increment (or decrement) the last index\n * @param baseIndex The current index to compute the next index from\n * @param itemCount The number of items\n * @param defaultActiveItemId The default active index to fallback to\n */\nexport function getNextActiveItemId(moveAmount, baseIndex, itemCount, defaultActiveItemId) {\n if (!itemCount) {\n return null;\n }\n\n if (moveAmount < 0 && (baseIndex === null || defaultActiveItemId !== null && baseIndex === 0)) {\n return itemCount + moveAmount;\n }\n\n var numericIndex = (baseIndex === null ? -1 : baseIndex) + moveAmount;\n\n if (numericIndex <= -1 || numericIndex >= itemCount) {\n return defaultActiveItemId === null ? null : 0;\n }\n\n return numericIndex;\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { invariant, decycle, noop } from '@algolia/autocomplete-shared';\nexport function getNormalizedSources(getSources, params) {\n var seenSourceIds = [];\n return Promise.resolve(getSources(params)).then(function (sources) {\n invariant(Array.isArray(sources), function () {\n return \"The `getSources` function must return an array of sources but returned type \".concat(JSON.stringify(_typeof(sources)), \":\\n\\n\").concat(JSON.stringify(decycle(sources), null, 2));\n });\n return Promise.all(sources // We allow `undefined` and `false` sources to allow users to use\n // `Boolean(query) && source` (=> `false`).\n // We need to remove these values at this point.\n .filter(function (maybeSource) {\n return Boolean(maybeSource);\n }).map(function (source) {\n invariant(typeof source.sourceId === 'string', 'A source must provide a `sourceId` string.');\n\n if (seenSourceIds.includes(source.sourceId)) {\n throw new Error(\"[Autocomplete] The `sourceId` \".concat(JSON.stringify(source.sourceId), \" is not unique.\"));\n }\n\n seenSourceIds.push(source.sourceId);\n\n var normalizedSource = _objectSpread({\n getItemInputValue: function getItemInputValue(_ref) {\n var state = _ref.state;\n return state.query;\n },\n getItemUrl: function getItemUrl() {\n return undefined;\n },\n onSelect: function onSelect(_ref2) {\n var setIsOpen = _ref2.setIsOpen;\n setIsOpen(false);\n },\n onActive: noop\n }, source);\n\n return Promise.resolve(normalizedSource);\n }));\n });\n}","// We don't have access to the autocomplete source when we call `onKeyDown`\n// or `onClick` because those are native browser events.\n// However, we can get the source from the suggestion index.\nfunction getCollectionFromActiveItemId(state) {\n // Given 3 sources with respectively 1, 2 and 3 suggestions: [1, 2, 3]\n // We want to get the accumulated counts:\n // [1, 1 + 2, 1 + 2 + 3] = [1, 3, 3 + 3] = [1, 3, 6]\n var accumulatedCollectionsCount = state.collections.map(function (collections) {\n return collections.items.length;\n }).reduce(function (acc, collectionsCount, index) {\n var previousValue = acc[index - 1] || 0;\n var nextValue = previousValue + collectionsCount;\n acc.push(nextValue);\n return acc;\n }, []); // Based on the accumulated counts, we can infer the index of the suggestion.\n\n var collectionIndex = accumulatedCollectionsCount.reduce(function (acc, current) {\n if (current <= state.activeItemId) {\n return acc + 1;\n }\n\n return acc;\n }, 0);\n return state.collections[collectionIndex];\n}\n/**\n * Gets the highlighted index relative to a suggestion object (not the absolute\n * highlighted index).\n *\n * Example:\n * [['a', 'b'], ['c', 'd', 'e'], ['f']]\n * ↑\n * (absolute: 3, relative: 1)\n */\n\n\nfunction getRelativeActiveItemId(_ref) {\n var state = _ref.state,\n collection = _ref.collection;\n var isOffsetFound = false;\n var counter = 0;\n var previousItemsOffset = 0;\n\n while (isOffsetFound === false) {\n var currentCollection = state.collections[counter];\n\n if (currentCollection === collection) {\n isOffsetFound = true;\n break;\n }\n\n previousItemsOffset += currentCollection.items.length;\n counter++;\n }\n\n return state.activeItemId - previousItemsOffset;\n}\n\nexport function getActiveItem(state) {\n var collection = getCollectionFromActiveItemId(state);\n\n if (!collection) {\n return null;\n }\n\n var item = collection.items[getRelativeActiveItemId({\n state: state,\n collection: collection\n })];\n var source = collection.source;\n var itemInputValue = source.getItemInputValue({\n item: item,\n state: state\n });\n var itemUrl = source.getItemUrl({\n item: item,\n state: state\n });\n return {\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n source: source\n };\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nexport function mapToAlgoliaResponse(rawResults) {\n var results = rawResults.map(function (result) {\n var _hits;\n\n return _objectSpread(_objectSpread({}, result), {}, {\n hits: (_hits = result.hits) === null || _hits === void 0 ? void 0 : _hits.map(function (hit) {\n // Bring support for the Insights plugin.\n return _objectSpread(_objectSpread({}, hit), {}, {\n __autocomplete_indexName: result.index,\n __autocomplete_queryID: result.queryID\n });\n })\n });\n });\n return {\n results: results,\n hits: results.map(function (result) {\n return result.hits;\n }).filter(Boolean),\n facetHits: results.map(function (result) {\n var _facetHits;\n\n return (_facetHits = result.facetHits) === null || _facetHits === void 0 ? void 0 : _facetHits.map(function (facetHit) {\n // Bring support for the highlighting components.\n return {\n label: facetHit.value,\n count: facetHit.count,\n _highlightResult: {\n label: {\n value: facetHit.highlighted\n }\n }\n };\n });\n }).filter(Boolean)\n };\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { createCancelablePromiseList } from './utils';\nexport function createStore(reducer, props, onStoreStateChange) {\n var state = props.initialState;\n return {\n getState: function getState() {\n return state;\n },\n dispatch: function dispatch(action, payload) {\n var prevState = _objectSpread({}, state);\n\n state = reducer(state, {\n type: action,\n props: props,\n payload: payload\n });\n onStoreStateChange({\n state: state,\n prevState: prevState\n });\n },\n pendingRequests: createCancelablePromiseList()\n };\n}","export function createCancelablePromiseList() {\n var list = [];\n return {\n add: function add(cancelablePromise) {\n list.push(cancelablePromise);\n return cancelablePromise.finally(function () {\n list = list.filter(function (item) {\n return item !== cancelablePromise;\n });\n });\n },\n cancelAll: function cancelAll() {\n list.forEach(function (promise) {\n return promise.cancel();\n });\n },\n isEmpty: function isEmpty() {\n return list.length === 0;\n }\n };\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { flatten } from '@algolia/autocomplete-shared';\nexport function getAutocompleteSetters(_ref) {\n var store = _ref.store;\n\n var setActiveItemId = function setActiveItemId(value) {\n store.dispatch('setActiveItemId', value);\n };\n\n var setQuery = function setQuery(value) {\n store.dispatch('setQuery', value);\n };\n\n var setCollections = function setCollections(rawValue) {\n var baseItemId = 0;\n var value = rawValue.map(function (collection) {\n return _objectSpread(_objectSpread({}, collection), {}, {\n // We flatten the stored items to support calling `getAlgoliaResults`\n // from the source itself.\n items: flatten(collection.items).map(function (item) {\n return _objectSpread(_objectSpread({}, item), {}, {\n __autocomplete_id: baseItemId++\n });\n })\n });\n });\n store.dispatch('setCollections', value);\n };\n\n var setIsOpen = function setIsOpen(value) {\n store.dispatch('setIsOpen', value);\n };\n\n var setStatus = function setStatus(value) {\n store.dispatch('setStatus', value);\n };\n\n var setContext = function setContext(value) {\n store.dispatch('setContext', value);\n };\n\n return {\n setActiveItemId: setActiveItemId,\n setQuery: setQuery,\n setCollections: setCollections,\n setIsOpen: setIsOpen,\n setStatus: setStatus,\n setContext: setContext\n };\n}","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { getItemsCount, generateAutocompleteId, flatten } from '@algolia/autocomplete-shared';\nimport { getNormalizedSources } from './utils';\nexport function getDefaultProps(props, pluginSubscribers) {\n var _props$id;\n\n /* eslint-disable no-restricted-globals */\n var environment = typeof window !== 'undefined' ? window : {};\n /* eslint-enable no-restricted-globals */\n\n var plugins = props.plugins || [];\n return _objectSpread(_objectSpread({\n debug: false,\n openOnFocus: false,\n placeholder: '',\n autoFocus: false,\n defaultActiveItemId: null,\n stallThreshold: 300,\n environment: environment,\n shouldPanelOpen: function shouldPanelOpen(_ref) {\n var state = _ref.state;\n return getItemsCount(state) > 0;\n },\n reshape: function reshape(_ref2) {\n var sources = _ref2.sources;\n return sources;\n }\n }, props), {}, {\n // Since `generateAutocompleteId` triggers a side effect (it increments\n // an internal counter), we don't want to execute it if unnecessary.\n id: (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : generateAutocompleteId(),\n plugins: plugins,\n // The following props need to be deeply defaulted.\n initialState: _objectSpread({\n activeItemId: null,\n query: '',\n completion: null,\n collections: [],\n isOpen: false,\n status: 'idle',\n context: {}\n }, props.initialState),\n onStateChange: function onStateChange(params) {\n var _props$onStateChange;\n\n (_props$onStateChange = props.onStateChange) === null || _props$onStateChange === void 0 ? void 0 : _props$onStateChange.call(props, params);\n plugins.forEach(function (x) {\n var _x$onStateChange;\n\n return (_x$onStateChange = x.onStateChange) === null || _x$onStateChange === void 0 ? void 0 : _x$onStateChange.call(x, params);\n });\n },\n onSubmit: function onSubmit(params) {\n var _props$onSubmit;\n\n (_props$onSubmit = props.onSubmit) === null || _props$onSubmit === void 0 ? void 0 : _props$onSubmit.call(props, params);\n plugins.forEach(function (x) {\n var _x$onSubmit;\n\n return (_x$onSubmit = x.onSubmit) === null || _x$onSubmit === void 0 ? void 0 : _x$onSubmit.call(x, params);\n });\n },\n onReset: function onReset(params) {\n var _props$onReset;\n\n (_props$onReset = props.onReset) === null || _props$onReset === void 0 ? void 0 : _props$onReset.call(props, params);\n plugins.forEach(function (x) {\n var _x$onReset;\n\n return (_x$onReset = x.onReset) === null || _x$onReset === void 0 ? void 0 : _x$onReset.call(x, params);\n });\n },\n getSources: function getSources(params) {\n return Promise.all([].concat(_toConsumableArray(plugins.map(function (plugin) {\n return plugin.getSources;\n })), [props.getSources]).filter(Boolean).map(function (getSources) {\n return getNormalizedSources(getSources, params);\n })).then(function (nested) {\n return flatten(nested);\n }).then(function (sources) {\n return sources.map(function (source) {\n return _objectSpread(_objectSpread({}, source), {}, {\n onSelect: function onSelect(params) {\n source.onSelect(params);\n pluginSubscribers.forEach(function (x) {\n var _x$onSelect;\n\n return (_x$onSelect = x.onSelect) === null || _x$onSelect === void 0 ? void 0 : _x$onSelect.call(x, params);\n });\n },\n onActive: function onActive(params) {\n source.onActive(params);\n pluginSubscribers.forEach(function (x) {\n var _x$onActive;\n\n return (_x$onActive = x.onActive) === null || _x$onActive === void 0 ? void 0 : _x$onActive.call(x, params);\n });\n }\n });\n });\n });\n },\n navigator: _objectSpread({\n navigate: function navigate(_ref3) {\n var itemUrl = _ref3.itemUrl;\n environment.location.assign(itemUrl);\n },\n navigateNewTab: function navigateNewTab(_ref4) {\n var itemUrl = _ref4.itemUrl;\n var windowReference = environment.open(itemUrl, '_blank', 'noopener');\n windowReference === null || windowReference === void 0 ? void 0 : windowReference.focus();\n },\n navigateNewWindow: function navigateNewWindow(_ref5) {\n var itemUrl = _ref5.itemUrl;\n environment.open(itemUrl, '_blank', 'noopener');\n }\n }, props.navigator)\n });\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { flatten } from '@algolia/autocomplete-shared';\nexport function reshape(_ref) {\n var collections = _ref.collections,\n props = _ref.props,\n state = _ref.state;\n // Sources are grouped by `sourceId` to conveniently pick them via destructuring.\n // Example: `const { recentSearchesPlugin } = sourcesBySourceId`\n var sourcesBySourceId = collections.reduce(function (acc, collection) {\n return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, collection.source.sourceId, _objectSpread(_objectSpread({}, collection.source), {}, {\n getItems: function getItems() {\n // We provide the resolved items from the collection to the `reshape` prop.\n return flatten(collection.items);\n }\n })));\n }, {});\n var reshapeSources = props.reshape({\n sources: Object.values(sourcesBySourceId),\n sourcesBySourceId: sourcesBySourceId,\n state: state\n }); // We reconstruct the collections with the items modified by the `reshape` prop.\n\n return flatten(reshapeSources).filter(Boolean).map(function (source) {\n return {\n source: source,\n items: source.getItems()\n };\n });\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { decycle, flatten, invariant } from '@algolia/autocomplete-shared';\nimport { mapToAlgoliaResponse } from './utils';\n\nfunction isDescription(item) {\n return Boolean(item.execute);\n}\n\nfunction isRequesterDescription(description) {\n return Boolean(description === null || description === void 0 ? void 0 : description.execute);\n}\n\nexport function preResolve(itemsOrDescription, sourceId) {\n if (isRequesterDescription(itemsOrDescription)) {\n return _objectSpread(_objectSpread({}, itemsOrDescription), {}, {\n requests: itemsOrDescription.queries.map(function (query) {\n return {\n query: query,\n sourceId: sourceId,\n transformResponse: itemsOrDescription.transformResponse\n };\n })\n });\n }\n\n return {\n items: itemsOrDescription,\n sourceId: sourceId\n };\n}\nexport function resolve(items) {\n var packed = items.reduce(function (acc, current) {\n if (!isDescription(current)) {\n acc.push(current);\n return acc;\n }\n\n var searchClient = current.searchClient,\n execute = current.execute,\n requests = current.requests;\n var container = acc.find(function (item) {\n return isDescription(current) && isDescription(item) && item.searchClient === searchClient && item.execute === execute;\n });\n\n if (container) {\n var _container$items;\n\n (_container$items = container.items).push.apply(_container$items, _toConsumableArray(requests));\n } else {\n var request = {\n execute: execute,\n items: requests,\n searchClient: searchClient\n };\n acc.push(request);\n }\n\n return acc;\n }, []);\n var values = packed.map(function (maybeDescription) {\n if (!isDescription(maybeDescription)) {\n return Promise.resolve(maybeDescription);\n }\n\n var _ref = maybeDescription,\n execute = _ref.execute,\n items = _ref.items,\n searchClient = _ref.searchClient;\n return execute({\n searchClient: searchClient,\n requests: items\n });\n });\n return Promise.all(values).then(function (responses) {\n return flatten(responses);\n });\n}\nexport function postResolve(responses, sources) {\n return sources.map(function (source) {\n var matches = responses.filter(function (response) {\n return response.sourceId === source.sourceId;\n });\n var results = matches.map(function (_ref2) {\n var items = _ref2.items;\n return items;\n });\n var transform = matches[0].transformResponse;\n var items = transform ? transform(mapToAlgoliaResponse(results)) : results;\n invariant(Array.isArray(items), function () {\n return \"The `getItems` function from source \\\"\".concat(source.sourceId, \"\\\" must return an array of items but returned type \").concat(JSON.stringify(_typeof(items)), \":\\n\\n\").concat(JSON.stringify(decycle(items), null, 2), \".\\n\\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems\");\n });\n invariant(items.every(Boolean), \"The `getItems` function from source \\\"\".concat(source.sourceId, \"\\\" must return an array of items but returned \").concat(JSON.stringify(undefined), \".\\n\\nDid you forget to return items?\\n\\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems\"));\n return {\n source: source,\n items: items\n };\n });\n}","var _excluded = [\"event\", \"nextState\", \"props\", \"query\", \"refresh\", \"store\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { reshape } from './reshape';\nimport { preResolve, resolve, postResolve } from './resolve';\nimport { cancelable, createConcurrentSafePromise, getActiveItem } from './utils';\nvar lastStalledId = null;\nvar runConcurrentSafePromise = createConcurrentSafePromise();\nexport function onInput(_ref) {\n var event = _ref.event,\n _ref$nextState = _ref.nextState,\n nextState = _ref$nextState === void 0 ? {} : _ref$nextState,\n props = _ref.props,\n query = _ref.query,\n refresh = _ref.refresh,\n store = _ref.store,\n setters = _objectWithoutProperties(_ref, _excluded);\n\n if (lastStalledId) {\n props.environment.clearTimeout(lastStalledId);\n }\n\n var setCollections = setters.setCollections,\n setIsOpen = setters.setIsOpen,\n setQuery = setters.setQuery,\n setActiveItemId = setters.setActiveItemId,\n setStatus = setters.setStatus;\n setQuery(query);\n setActiveItemId(props.defaultActiveItemId);\n\n if (!query && props.openOnFocus === false) {\n var _nextState$isOpen;\n\n var collections = store.getState().collections.map(function (collection) {\n return _objectSpread(_objectSpread({}, collection), {}, {\n items: []\n });\n });\n setStatus('idle');\n setCollections(collections);\n setIsOpen((_nextState$isOpen = nextState.isOpen) !== null && _nextState$isOpen !== void 0 ? _nextState$isOpen : props.shouldPanelOpen({\n state: store.getState()\n })); // We make sure to update the latest resolved value of the tracked\n // promises to keep late resolving promises from \"cancelling\" the state\n // updates performed in this code path.\n // We chain with a void promise to respect `onInput`'s expected return type.\n\n var _request = cancelable(runConcurrentSafePromise(collections).then(function () {\n return Promise.resolve();\n }));\n\n return store.pendingRequests.add(_request);\n }\n\n setStatus('loading');\n lastStalledId = props.environment.setTimeout(function () {\n setStatus('stalled');\n }, props.stallThreshold); // We track the entire promise chain triggered by `onInput` before mutating\n // the Autocomplete state to make sure that any state manipulation is based on\n // fresh data regardless of when promises individually resolve.\n // We don't track nested promises and only rely on the full chain resolution,\n // meaning we should only ever manipulate the state once this concurrent-safe\n // promise is resolved.\n\n var request = cancelable(runConcurrentSafePromise(props.getSources(_objectSpread({\n query: query,\n refresh: refresh,\n state: store.getState()\n }, setters)).then(function (sources) {\n return Promise.all(sources.map(function (source) {\n return Promise.resolve(source.getItems(_objectSpread({\n query: query,\n refresh: refresh,\n state: store.getState()\n }, setters))).then(function (itemsOrDescription) {\n return preResolve(itemsOrDescription, source.sourceId);\n });\n })).then(resolve).then(function (responses) {\n return postResolve(responses, sources);\n }).then(function (collections) {\n return reshape({\n collections: collections,\n props: props,\n state: store.getState()\n });\n });\n }))).then(function (collections) {\n var _nextState$isOpen2;\n\n // Parameters passed to `onInput` could be stale when the following code\n // executes, because `onInput` calls may not resolve in order.\n // If it becomes a problem we'll need to save the last passed parameters.\n // See: https://codesandbox.io/s/agitated-cookies-y290z\n setStatus('idle');\n setCollections(collections);\n var isPanelOpen = props.shouldPanelOpen({\n state: store.getState()\n });\n setIsOpen((_nextState$isOpen2 = nextState.isOpen) !== null && _nextState$isOpen2 !== void 0 ? _nextState$isOpen2 : props.openOnFocus && !query && isPanelOpen || isPanelOpen);\n var highlightedItem = getActiveItem(store.getState());\n\n if (store.getState().activeItemId !== null && highlightedItem) {\n var item = highlightedItem.item,\n itemInputValue = highlightedItem.itemInputValue,\n itemUrl = highlightedItem.itemUrl,\n source = highlightedItem.source;\n source.onActive(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n }\n }).finally(function () {\n setStatus('idle');\n\n if (lastStalledId) {\n props.environment.clearTimeout(lastStalledId);\n }\n });\n return store.pendingRequests.add(request);\n}","/**\n * Creates a runner that executes promises in a concurrent-safe way.\n *\n * This is useful to prevent older promises to resolve after a newer promise,\n * otherwise resulting in stale resolved values.\n */\nexport function createConcurrentSafePromise() {\n var basePromiseId = -1;\n var latestResolvedId = -1;\n var latestResolvedValue = undefined;\n return function runConcurrentSafePromise(promise) {\n basePromiseId++;\n var currentPromiseId = basePromiseId;\n return Promise.resolve(promise).then(function (x) {\n // The promise might take too long to resolve and get outdated. This would\n // result in resolving stale values.\n // When this happens, we ignore the promise value and return the one\n // coming from the latest resolved value.\n //\n // +----------------------------------+\n // | 100ms |\n // | run(1) +---> R1 |\n // | 300ms |\n // | run(2) +-------------> R2 (SKIP) |\n // | 200ms |\n // | run(3) +--------> R3 |\n // +----------------------------------+\n if (latestResolvedValue && currentPromiseId < latestResolvedId) {\n return latestResolvedValue;\n }\n\n latestResolvedId = currentPromiseId;\n latestResolvedValue = x;\n return x;\n });\n };\n}","var _excluded = [\"event\", \"props\", \"refresh\", \"store\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { onInput } from './onInput';\nimport { getActiveItem } from './utils';\nexport function onKeyDown(_ref) {\n var event = _ref.event,\n props = _ref.props,\n refresh = _ref.refresh,\n store = _ref.store,\n setters = _objectWithoutProperties(_ref, _excluded);\n\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n // eslint-disable-next-line no-inner-declarations\n var triggerScrollIntoView = function triggerScrollIntoView() {\n var nodeItem = props.environment.document.getElementById(\"\".concat(props.id, \"-item-\").concat(store.getState().activeItemId));\n\n if (nodeItem) {\n if (nodeItem.scrollIntoViewIfNeeded) {\n nodeItem.scrollIntoViewIfNeeded(false);\n } else {\n nodeItem.scrollIntoView(false);\n }\n }\n }; // eslint-disable-next-line no-inner-declarations\n\n\n var triggerOnActive = function triggerOnActive() {\n var highlightedItem = getActiveItem(store.getState());\n\n if (store.getState().activeItemId !== null && highlightedItem) {\n var item = highlightedItem.item,\n itemInputValue = highlightedItem.itemInputValue,\n itemUrl = highlightedItem.itemUrl,\n source = highlightedItem.source;\n source.onActive(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n }\n }; // Default browser behavior changes the caret placement on ArrowUp and\n // ArrowDown.\n\n\n event.preventDefault(); // When re-opening the panel, we need to split the logic to keep the actions\n // synchronized as `onInput` returns a promise.\n\n if (store.getState().isOpen === false && (props.openOnFocus || Boolean(store.getState().query))) {\n onInput(_objectSpread({\n event: event,\n props: props,\n query: store.getState().query,\n refresh: refresh,\n store: store\n }, setters)).then(function () {\n store.dispatch(event.key, {\n nextActiveItemId: props.defaultActiveItemId\n });\n triggerOnActive(); // Since we rely on the DOM, we need to wait for all the micro tasks to\n // finish (which include re-opening the panel) to make sure all the\n // elements are available.\n\n setTimeout(triggerScrollIntoView, 0);\n });\n } else {\n store.dispatch(event.key, {});\n triggerOnActive();\n triggerScrollIntoView();\n }\n } else if (event.key === 'Escape') {\n // This prevents the default browser behavior on `input[type=\"search\"]`\n // from removing the query right away because we first want to close the\n // panel.\n event.preventDefault();\n store.dispatch(event.key, null); // Hitting the `Escape` key signals the end of a user interaction with the\n // autocomplete. At this point, we should ignore any requests that are still\n // pending and could reopen the panel once they resolve, because that would\n // result in an unsolicited UI behavior.\n\n store.pendingRequests.cancelAll();\n } else if (event.key === 'Enter') {\n // No active item, so we let the browser handle the native `onSubmit` form\n // event.\n if (store.getState().activeItemId === null || store.getState().collections.every(function (collection) {\n return collection.items.length === 0;\n })) {\n return;\n } // This prevents the `onSubmit` event to be sent because an item is\n // highlighted.\n\n\n event.preventDefault();\n\n var _ref2 = getActiveItem(store.getState()),\n item = _ref2.item,\n itemInputValue = _ref2.itemInputValue,\n itemUrl = _ref2.itemUrl,\n source = _ref2.source;\n\n if (event.metaKey || event.ctrlKey) {\n if (itemUrl !== undefined) {\n source.onSelect(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n props.navigator.navigateNewTab({\n itemUrl: itemUrl,\n item: item,\n state: store.getState()\n });\n }\n } else if (event.shiftKey) {\n if (itemUrl !== undefined) {\n source.onSelect(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n props.navigator.navigateNewWindow({\n itemUrl: itemUrl,\n item: item,\n state: store.getState()\n });\n }\n } else if (event.altKey) {// Keep native browser behavior\n } else {\n if (itemUrl !== undefined) {\n source.onSelect(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n props.navigator.navigate({\n itemUrl: itemUrl,\n item: item,\n state: store.getState()\n });\n return;\n }\n\n onInput(_objectSpread({\n event: event,\n nextState: {\n isOpen: false\n },\n props: props,\n query: itemInputValue,\n refresh: refresh,\n store: store\n }, setters)).then(function () {\n source.onSelect(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n });\n }\n }\n}","var _excluded = [\"props\", \"refresh\", \"store\"],\n _excluded2 = [\"inputElement\", \"formElement\", \"panelElement\"],\n _excluded3 = [\"inputElement\"],\n _excluded4 = [\"inputElement\", \"maxLength\"],\n _excluded5 = [\"item\", \"source\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { onInput } from './onInput';\nimport { onKeyDown as _onKeyDown } from './onKeyDown';\nimport { getActiveItem, isOrContainsNode } from './utils';\nexport function getPropGetters(_ref) {\n var props = _ref.props,\n refresh = _ref.refresh,\n store = _ref.store,\n setters = _objectWithoutProperties(_ref, _excluded);\n\n var getEnvironmentProps = function getEnvironmentProps(providedProps) {\n var inputElement = providedProps.inputElement,\n formElement = providedProps.formElement,\n panelElement = providedProps.panelElement,\n rest = _objectWithoutProperties(providedProps, _excluded2);\n\n return _objectSpread({\n // On touch devices, we do not rely on the native `blur` event of the\n // input to close the panel, but rather on a custom `touchstart` event\n // outside of the autocomplete elements.\n // This ensures a working experience on mobile because we blur the input\n // on touch devices when the user starts scrolling (`touchmove`).\n // @TODO: support cases where there are multiple Autocomplete instances.\n // Right now, a second instance makes this computation return false.\n onTouchStart: function onTouchStart(event) {\n // The `onTouchStart` event shouldn't trigger the `blur` handler when\n // it's not an interaction with Autocomplete. We detect it with the\n // following heuristics:\n // - the panel is closed AND there are no pending requests\n // (no interaction with the autocomplete, no future state updates)\n // - OR the touched target is the input element (should open the panel)\n var isAutocompleteInteraction = store.getState().isOpen || !store.pendingRequests.isEmpty();\n\n if (!isAutocompleteInteraction || event.target === inputElement) {\n return;\n }\n\n var isTargetWithinAutocomplete = [formElement, panelElement].some(function (contextNode) {\n return isOrContainsNode(contextNode, event.target);\n });\n\n if (isTargetWithinAutocomplete === false) {\n store.dispatch('blur', null); // If requests are still pending when the user closes the panel, they\n // could reopen the panel once they resolve.\n // We want to prevent any subsequent query from reopening the panel\n // because it would result in an unsolicited UI behavior.\n\n if (!props.debug) {\n store.pendingRequests.cancelAll();\n }\n }\n },\n // When scrolling on touch devices (mobiles, tablets, etc.), we want to\n // mimic the native platform behavior where the input is blurred to\n // hide the virtual keyboard. This gives more vertical space to\n // discover all the suggestions showing up in the panel.\n onTouchMove: function onTouchMove(event) {\n if (store.getState().isOpen === false || inputElement !== props.environment.document.activeElement || event.target === inputElement) {\n return;\n }\n\n inputElement.blur();\n }\n }, rest);\n };\n\n var getRootProps = function getRootProps(rest) {\n return _objectSpread({\n role: 'combobox',\n 'aria-expanded': store.getState().isOpen,\n 'aria-haspopup': 'listbox',\n 'aria-owns': store.getState().isOpen ? \"\".concat(props.id, \"-list\") : undefined,\n 'aria-labelledby': \"\".concat(props.id, \"-label\")\n }, rest);\n };\n\n var getFormProps = function getFormProps(providedProps) {\n var inputElement = providedProps.inputElement,\n rest = _objectWithoutProperties(providedProps, _excluded3);\n\n return _objectSpread({\n action: '',\n noValidate: true,\n role: 'search',\n onSubmit: function onSubmit(event) {\n var _providedProps$inputE;\n\n event.preventDefault();\n props.onSubmit(_objectSpread({\n event: event,\n refresh: refresh,\n state: store.getState()\n }, setters));\n store.dispatch('submit', null);\n (_providedProps$inputE = providedProps.inputElement) === null || _providedProps$inputE === void 0 ? void 0 : _providedProps$inputE.blur();\n },\n onReset: function onReset(event) {\n var _providedProps$inputE2;\n\n event.preventDefault();\n props.onReset(_objectSpread({\n event: event,\n refresh: refresh,\n state: store.getState()\n }, setters));\n store.dispatch('reset', null);\n (_providedProps$inputE2 = providedProps.inputElement) === null || _providedProps$inputE2 === void 0 ? void 0 : _providedProps$inputE2.focus();\n }\n }, rest);\n };\n\n var getInputProps = function getInputProps(providedProps) {\n function onFocus(event) {\n // We want to trigger a query when `openOnFocus` is true\n // because the panel should open with the current query.\n if (props.openOnFocus || Boolean(store.getState().query)) {\n onInput(_objectSpread({\n event: event,\n props: props,\n query: store.getState().completion || store.getState().query,\n refresh: refresh,\n store: store\n }, setters));\n }\n\n store.dispatch('focus', null);\n }\n\n var isTouchDevice = ('ontouchstart' in props.environment);\n\n var _ref2 = providedProps || {},\n inputElement = _ref2.inputElement,\n _ref2$maxLength = _ref2.maxLength,\n maxLength = _ref2$maxLength === void 0 ? 512 : _ref2$maxLength,\n rest = _objectWithoutProperties(_ref2, _excluded4);\n\n var activeItem = getActiveItem(store.getState());\n return _objectSpread({\n 'aria-autocomplete': 'both',\n 'aria-activedescendant': store.getState().isOpen && store.getState().activeItemId !== null ? \"\".concat(props.id, \"-item-\").concat(store.getState().activeItemId) : undefined,\n 'aria-controls': store.getState().isOpen ? \"\".concat(props.id, \"-list\") : undefined,\n 'aria-labelledby': \"\".concat(props.id, \"-label\"),\n value: store.getState().completion || store.getState().query,\n id: \"\".concat(props.id, \"-input\"),\n autoComplete: 'off',\n autoCorrect: 'off',\n autoCapitalize: 'off',\n enterKeyHint: activeItem !== null && activeItem !== void 0 && activeItem.itemUrl ? 'go' : 'search',\n spellCheck: 'false',\n autoFocus: props.autoFocus,\n placeholder: props.placeholder,\n maxLength: maxLength,\n type: 'search',\n onChange: function onChange(event) {\n onInput(_objectSpread({\n event: event,\n props: props,\n query: event.currentTarget.value.slice(0, maxLength),\n refresh: refresh,\n store: store\n }, setters));\n },\n onKeyDown: function onKeyDown(event) {\n _onKeyDown(_objectSpread({\n event: event,\n props: props,\n refresh: refresh,\n store: store\n }, setters));\n },\n onFocus: onFocus,\n onBlur: function onBlur() {\n // We do rely on the `blur` event on touch devices.\n // See explanation in `onTouchStart`.\n if (!isTouchDevice) {\n store.dispatch('blur', null); // If requests are still pending when the user closes the panel, they\n // could reopen the panel once they resolve.\n // We want to prevent any subsequent query from reopening the panel\n // because it would result in an unsolicited UI behavior.\n\n if (!props.debug) {\n store.pendingRequests.cancelAll();\n }\n }\n },\n onClick: function onClick(event) {\n // When the panel is closed and you click on the input while\n // the input is focused, the `onFocus` event is not triggered\n // (default browser behavior).\n // In an autocomplete context, it makes sense to open the panel in this\n // case.\n // We mimic this event by catching the `onClick` event which\n // triggers the `onFocus` for the panel to open.\n if (providedProps.inputElement === props.environment.document.activeElement && !store.getState().isOpen) {\n onFocus(event);\n }\n }\n }, rest);\n };\n\n var getLabelProps = function getLabelProps(rest) {\n return _objectSpread({\n htmlFor: \"\".concat(props.id, \"-input\"),\n id: \"\".concat(props.id, \"-label\")\n }, rest);\n };\n\n var getListProps = function getListProps(rest) {\n return _objectSpread({\n role: 'listbox',\n 'aria-labelledby': \"\".concat(props.id, \"-label\"),\n id: \"\".concat(props.id, \"-list\")\n }, rest);\n };\n\n var getPanelProps = function getPanelProps(rest) {\n return _objectSpread({\n onMouseDown: function onMouseDown(event) {\n // Prevents the `activeElement` from being changed to the panel so\n // that the blur event is not triggered, otherwise it closes the\n // panel.\n event.preventDefault();\n },\n onMouseLeave: function onMouseLeave() {\n store.dispatch('mouseleave', null);\n }\n }, rest);\n };\n\n var getItemProps = function getItemProps(providedProps) {\n var item = providedProps.item,\n source = providedProps.source,\n rest = _objectWithoutProperties(providedProps, _excluded5);\n\n return _objectSpread({\n id: \"\".concat(props.id, \"-item-\").concat(item.__autocomplete_id),\n role: 'option',\n 'aria-selected': store.getState().activeItemId === item.__autocomplete_id,\n onMouseMove: function onMouseMove(event) {\n if (item.__autocomplete_id === store.getState().activeItemId) {\n return;\n }\n\n store.dispatch('mousemove', item.__autocomplete_id);\n var activeItem = getActiveItem(store.getState());\n\n if (store.getState().activeItemId !== null && activeItem) {\n var _item = activeItem.item,\n itemInputValue = activeItem.itemInputValue,\n itemUrl = activeItem.itemUrl,\n _source = activeItem.source;\n\n _source.onActive(_objectSpread({\n event: event,\n item: _item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: _source,\n state: store.getState()\n }, setters));\n }\n },\n onMouseDown: function onMouseDown(event) {\n // Prevents the `activeElement` from being changed to the item so it\n // can remain with the current `activeElement`.\n event.preventDefault();\n },\n onClick: function onClick(event) {\n var itemInputValue = source.getItemInputValue({\n item: item,\n state: store.getState()\n });\n var itemUrl = source.getItemUrl({\n item: item,\n state: store.getState()\n }); // If `getItemUrl` is provided, it means that the suggestion\n // is a link, not plain text that aims at updating the query.\n // We can therefore skip the state change because it will update\n // the `activeItemId`, resulting in a UI flash, especially\n // noticeable on mobile.\n\n var runPreCommand = itemUrl ? Promise.resolve() : onInput(_objectSpread({\n event: event,\n nextState: {\n isOpen: false\n },\n props: props,\n query: itemInputValue,\n refresh: refresh,\n store: store\n }, setters));\n runPreCommand.then(function () {\n source.onSelect(_objectSpread({\n event: event,\n item: item,\n itemInputValue: itemInputValue,\n itemUrl: itemUrl,\n refresh: refresh,\n source: source,\n state: store.getState()\n }, setters));\n });\n }\n }, rest);\n };\n\n return {\n getEnvironmentProps: getEnvironmentProps,\n getRootProps: getRootProps,\n getFormProps: getFormProps,\n getLabelProps: getLabelProps,\n getInputProps: getInputProps,\n getPanelProps: getPanelProps,\n getListProps: getListProps,\n getItemProps: getItemProps\n };\n}","export function isOrContainsNode(parent, child) {\n return parent === child || parent.contains(child);\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { userAgents } from '@algolia/autocomplete-shared';\nexport function getMetadata(_ref) {\n var _, _options$__autocomple, _options$__autocomple2, _options$__autocomple3;\n\n var plugins = _ref.plugins,\n options = _ref.options;\n var optionsKey = (_ = (((_options$__autocomple = options.__autocomplete_metadata) === null || _options$__autocomple === void 0 ? void 0 : _options$__autocomple.userAgents) || [])[0]) === null || _ === void 0 ? void 0 : _.segment;\n var extraOptions = optionsKey ? _defineProperty({}, optionsKey, Object.keys(((_options$__autocomple2 = options.__autocomplete_metadata) === null || _options$__autocomple2 === void 0 ? void 0 : _options$__autocomple2.options) || {})) : {};\n return {\n plugins: plugins.map(function (plugin) {\n return {\n name: plugin.name,\n options: Object.keys(plugin.__autocomplete_pluginOptions || [])\n };\n }),\n options: _objectSpread({\n 'autocomplete-core': Object.keys(options)\n }, extraOptions),\n ua: userAgents.concat(((_options$__autocomple3 = options.__autocomplete_metadata) === null || _options$__autocomple3 === void 0 ? void 0 : _options$__autocomple3.userAgents) || [])\n };\n}\nexport function injectMetadata(_ref3) {\n var _environment$navigato;\n\n var metadata = _ref3.metadata,\n environment = _ref3.environment;\n var isMetadataEnabled = (_environment$navigato = environment.navigator) === null || _environment$navigato === void 0 ? void 0 : _environment$navigato.userAgent.includes('Algolia Crawler');\n\n if (isMetadataEnabled) {\n var metadataContainer = environment.document.createElement('meta');\n var headRef = environment.document.querySelector('head');\n metadataContainer.name = 'algolia:metadata';\n setTimeout(function () {\n metadataContainer.content = JSON.stringify(metadata);\n headRef.appendChild(metadataContainer);\n }, 0);\n }\n}","import { getActiveItem } from './utils';\nexport function getCompletion(_ref) {\n var _getActiveItem;\n\n var state = _ref.state;\n\n if (state.isOpen === false || state.activeItemId === null) {\n return null;\n }\n\n return ((_getActiveItem = getActiveItem(state)) === null || _getActiveItem === void 0 ? void 0 : _getActiveItem.itemInputValue) || null;\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { getItemsCount, invariant } from '@algolia/autocomplete-shared';\nimport { getCompletion } from './getCompletion';\nimport { getNextActiveItemId } from './utils';\nexport var stateReducer = function stateReducer(state, action) {\n switch (action.type) {\n case 'setActiveItemId':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: action.payload\n });\n }\n\n case 'setQuery':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n query: action.payload,\n completion: null\n });\n }\n\n case 'setCollections':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n collections: action.payload\n });\n }\n\n case 'setIsOpen':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n isOpen: action.payload\n });\n }\n\n case 'setStatus':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n status: action.payload\n });\n }\n\n case 'setContext':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n context: _objectSpread(_objectSpread({}, state.context), action.payload)\n });\n }\n\n case 'ArrowDown':\n {\n var nextState = _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: action.payload.hasOwnProperty('nextActiveItemId') ? action.payload.nextActiveItemId : getNextActiveItemId(1, state.activeItemId, getItemsCount(state), action.props.defaultActiveItemId)\n });\n\n return _objectSpread(_objectSpread({}, nextState), {}, {\n completion: getCompletion({\n state: nextState\n })\n });\n }\n\n case 'ArrowUp':\n {\n var _nextState = _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: getNextActiveItemId(-1, state.activeItemId, getItemsCount(state), action.props.defaultActiveItemId)\n });\n\n return _objectSpread(_objectSpread({}, _nextState), {}, {\n completion: getCompletion({\n state: _nextState\n })\n });\n }\n\n case 'Escape':\n {\n if (state.isOpen) {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: null,\n isOpen: false,\n completion: null\n });\n }\n\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: null,\n query: '',\n status: 'idle',\n collections: []\n });\n }\n\n case 'submit':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: null,\n isOpen: false,\n status: 'idle'\n });\n }\n\n case 'reset':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: // Since we open the panel on reset when openOnFocus=true\n // we need to restore the highlighted index to the defaultActiveItemId. (DocSearch use-case)\n // Since we close the panel when openOnFocus=false\n // we lose track of the highlighted index. (Query-suggestions use-case)\n action.props.openOnFocus === true ? action.props.defaultActiveItemId : null,\n status: 'idle',\n query: ''\n });\n }\n\n case 'focus':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: action.props.defaultActiveItemId,\n isOpen: (action.props.openOnFocus || Boolean(state.query)) && action.props.shouldPanelOpen({\n state: state\n })\n });\n }\n\n case 'blur':\n {\n if (action.props.debug) {\n return state;\n }\n\n return _objectSpread(_objectSpread({}, state), {}, {\n isOpen: false,\n activeItemId: null\n });\n }\n\n case 'mousemove':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: action.payload\n });\n }\n\n case 'mouseleave':\n {\n return _objectSpread(_objectSpread({}, state), {}, {\n activeItemId: action.props.defaultActiveItemId\n });\n }\n\n default:\n invariant(false, \"The reducer action \".concat(JSON.stringify(action.type), \" is not supported.\"));\n return state;\n }\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { checkOptions } from './checkOptions';\nimport { createStore } from './createStore';\nimport { getAutocompleteSetters } from './getAutocompleteSetters';\nimport { getDefaultProps } from './getDefaultProps';\nimport { getPropGetters } from './getPropGetters';\nimport { getMetadata, injectMetadata } from './metadata';\nimport { onInput } from './onInput';\nimport { stateReducer } from './stateReducer';\nexport function createAutocomplete(options) {\n checkOptions(options);\n var subscribers = [];\n var props = getDefaultProps(options, subscribers);\n var store = createStore(stateReducer, props, onStoreStateChange);\n var setters = getAutocompleteSetters({\n store: store\n });\n var propGetters = getPropGetters(_objectSpread({\n props: props,\n refresh: refresh,\n store: store\n }, setters));\n\n function onStoreStateChange(_ref) {\n var prevState = _ref.prevState,\n state = _ref.state;\n props.onStateChange(_objectSpread({\n prevState: prevState,\n state: state,\n refresh: refresh\n }, setters));\n }\n\n function refresh() {\n return onInput(_objectSpread({\n event: new Event('input'),\n nextState: {\n isOpen: store.getState().isOpen\n },\n props: props,\n query: store.getState().query,\n refresh: refresh,\n store: store\n }, setters));\n }\n\n props.plugins.forEach(function (plugin) {\n var _plugin$subscribe;\n\n return (_plugin$subscribe = plugin.subscribe) === null || _plugin$subscribe === void 0 ? void 0 : _plugin$subscribe.call(plugin, _objectSpread(_objectSpread({}, setters), {}, {\n refresh: refresh,\n onSelect: function onSelect(fn) {\n subscribers.push({\n onSelect: fn\n });\n },\n onActive: function onActive(fn) {\n subscribers.push({\n onActive: fn\n });\n }\n }));\n });\n injectMetadata({\n metadata: getMetadata({\n plugins: props.plugins,\n options: options\n }),\n environment: props.environment\n });\n return _objectSpread(_objectSpread({\n refresh: refresh\n }, propGetters), setters);\n}","import React from 'react';\n\ntype AlgoliaLogoTranslations = Partial<{\n searchByText: string;\n}>;\n\ntype AlgoliaLogoProps = {\n translations?: AlgoliaLogoTranslations;\n};\n\nexport function AlgoliaLogo({ translations = {} }: AlgoliaLogoProps) {\n const { searchByText = 'Search by' } = translations;\n\n return (\n \n {searchByText}\n \n \n \n \n );\n}\n","import React from 'react';\n\nimport { AlgoliaLogo } from './AlgoliaLogo';\n\nexport type FooterTranslations = Partial<{\n selectText: string;\n selectKeyAriaLabel: string;\n navigateText: string;\n navigateUpKeyAriaLabel: string;\n navigateDownKeyAriaLabel: string;\n closeText: string;\n closeKeyAriaLabel: string;\n searchByText: string;\n}>;\n\ntype FooterProps = Partial<{\n translations: FooterTranslations;\n}>;\n\ninterface CommandIconProps {\n children: React.ReactNode;\n ariaLabel: string;\n}\n\nfunction CommandIcon(props: CommandIconProps) {\n return (\n \n \n {props.children}\n \n \n );\n}\n\nexport function Footer({ translations = {} }: FooterProps) {\n const {\n selectText = 'to select',\n selectKeyAriaLabel = 'Enter key',\n navigateText = 'to navigate',\n navigateUpKeyAriaLabel = 'Arrow up',\n navigateDownKeyAriaLabel = 'Arrow down',\n closeText = 'to close',\n closeKeyAriaLabel = 'Escape key',\n searchByText = 'Search by',\n } = translations;\n\n return (\n <>\n
\n \n
\n
    \n
  • \n \n \n \n \n \n {selectText}\n
  • \n
  • \n \n \n \n \n \n \n \n \n \n \n {navigateText}\n
  • \n
  • \n \n \n \n \n \n {closeText}\n
  • \n
\n \n );\n}\n","import React from 'react';\n\nimport type { InternalDocSearchHit, StoredDocSearchHit } from './types';\n\ninterface HitProps {\n hit: InternalDocSearchHit | StoredDocSearchHit;\n children: React.ReactNode;\n}\n\nexport function Hit({ hit, children }: HitProps) {\n return {children};\n}\n","import React from 'react';\n\nexport function LoadingIcon() {\n return (\n \n \n \n \n \n \n \n \n \n \n );\n}\n","import React from 'react';\n\nexport function RecentIcon() {\n return (\n \n \n \n \n \n \n );\n}\n","import React from 'react';\n\nexport function ResetIcon() {\n return (\n \n \n \n );\n}\n","import React from 'react';\n\nexport function SelectIcon() {\n return (\n \n \n \n \n \n \n );\n}\n","import React from 'react';\n\nconst LvlIcon: React.FC = () => {\n return (\n \n \n \n );\n};\n\nexport function SourceIcon(props: { type: string }) {\n switch (props.type) {\n case 'lvl1':\n return ;\n case 'content':\n return ;\n default:\n return ;\n }\n}\n\nfunction AnchorIcon() {\n return (\n \n \n \n );\n}\n\nfunction ContentIcon() {\n return (\n \n \n \n );\n}\n","import React from 'react';\n\nexport function StarIcon() {\n return (\n \n \n \n );\n}\n","import React from 'react';\n\nexport function ErrorIcon() {\n return (\n \n \n \n );\n}\n","import React from 'react';\n\nexport function NoResultsIcon() {\n return (\n \n \n \n );\n}\n","import React from 'react';\n\nimport { ErrorIcon } from './icons';\n\nexport type ErrorScreenTranslations = Partial<{\n titleText: string;\n helpText: string;\n}>;\n\ntype ErrorScreenProps = {\n translations?: ErrorScreenTranslations;\n};\n\nexport function ErrorScreen({ translations = {} }: ErrorScreenProps) {\n const {\n titleText = 'Unable to fetch results',\n helpText = 'You might want to check your network connection.',\n } = translations;\n return (\n
\n
\n \n
\n

{titleText}

\n

{helpText}

\n
\n );\n}\n","import React from 'react';\n\nimport { NoResultsIcon } from './icons';\nimport type { ScreenStateProps } from './ScreenState';\nimport type { InternalDocSearchHit } from './types';\n\nexport type NoResultsScreenTranslations = Partial<{\n noResultsText: string;\n suggestedQueryText: string;\n reportMissingResultsText: string;\n reportMissingResultsLinkText: string;\n}>;\n\ntype NoResultsScreenProps = Omit<\n ScreenStateProps,\n 'translations'\n> & {\n translations?: NoResultsScreenTranslations;\n};\n\nexport function NoResultsScreen({\n translations = {},\n ...props\n}: NoResultsScreenProps) {\n const {\n noResultsText = 'No results for',\n suggestedQueryText = 'Try searching for',\n reportMissingResultsText = 'Believe this query should return results?',\n reportMissingResultsLinkText = 'Let us know.',\n } = translations;\n const searchSuggestions: string[] | undefined = props.state.context\n .searchSuggestions as string[];\n\n return (\n
\n
\n \n
\n

\n {noResultsText} \"{props.state.query}\"\n

\n\n {searchSuggestions && searchSuggestions.length > 0 && (\n
\n

{suggestedQueryText}:

\n
    \n {searchSuggestions.slice(0, 3).reduce(\n (acc, search) => [\n ...acc,\n
  • \n {\n props.setQuery(search.toLowerCase() + ' ');\n props.refresh();\n props.inputRef.current!.focus();\n }}\n >\n {search}\n \n
  • ,\n ],\n []\n )}\n
\n
\n )}\n\n {props.getMissingResultsUrl && (\n

\n {`${reportMissingResultsText} `}\n \n {reportMissingResultsLinkText}\n \n

\n )}\n
\n );\n}\n","import { createElement } from 'react';\n\nimport type { StoredDocSearchHit } from './types';\n\nfunction getPropertyByPath(object: Record, path: string): any {\n const parts = path.split('.');\n\n return parts.reduce((prev, current) => {\n if (prev?.[current]) return prev[current];\n return null;\n }, object);\n}\n\ninterface SnippetProps {\n hit: TItem;\n attribute: string;\n tagName?: string;\n [prop: string]: unknown;\n}\n\nexport function Snippet({\n hit,\n attribute,\n tagName = 'span',\n ...rest\n}: SnippetProps) {\n return createElement(tagName, {\n ...rest,\n dangerouslySetInnerHTML: {\n __html:\n getPropertyByPath(hit, `_snippetResult.${attribute}.value`) ||\n getPropertyByPath(hit, attribute),\n },\n });\n}\n","import type {\n AutocompleteApi,\n AutocompleteState,\n BaseItem,\n} from '@algolia/autocomplete-core';\nimport React from 'react';\n\nimport type { DocSearchProps } from './DocSearch';\nimport { Snippet } from './Snippet';\nimport type { InternalDocSearchHit, StoredDocSearchHit } from './types';\n\ninterface ResultsProps\n extends AutocompleteApi<\n TItem,\n React.FormEvent,\n React.MouseEvent,\n React.KeyboardEvent\n > {\n title: string;\n collection: AutocompleteState['collections'][0];\n renderIcon: (props: { item: TItem; index: number }) => React.ReactNode;\n renderAction: (props: {\n item: TItem;\n runDeleteTransition: (cb: () => void) => void;\n runFavoriteTransition: (cb: () => void) => void;\n }) => React.ReactNode;\n onItemClick: (item: TItem) => void;\n hitComponent: DocSearchProps['hitComponent'];\n}\n\nexport function Results(\n props: ResultsProps\n) {\n if (!props.collection || props.collection.items.length === 0) {\n return null;\n }\n\n return (\n
\n
{props.title}
\n\n
    \n {props.collection.items.map((item, index) => {\n return (\n \n );\n })}\n
\n
\n );\n}\n\ninterface ResultProps extends ResultsProps {\n item: TItem;\n index: number;\n}\n\nfunction Result({\n item,\n index,\n renderIcon,\n renderAction,\n getItemProps,\n onItemClick,\n collection,\n hitComponent,\n}: ResultProps) {\n const [isDeleting, setIsDeleting] = React.useState(false);\n const [isFavoriting, setIsFavoriting] = React.useState(false);\n const action = React.useRef<(() => void) | null>(null);\n const Hit = hitComponent!;\n\n function runDeleteTransition(cb: () => void) {\n setIsDeleting(true);\n action.current = cb;\n }\n\n function runFavoriteTransition(cb: () => void) {\n setIsFavoriting(true);\n action.current = cb;\n }\n\n return (\n {\n if (action.current) {\n action.current();\n }\n }}\n {...getItemProps({\n item,\n source: collection.source,\n onClick() {\n onItemClick(item);\n },\n })}\n >\n \n
\n {renderIcon({ item, index })}\n\n {item.hierarchy[item.type] && item.type === 'lvl1' && (\n
\n \n {item.content && (\n \n )}\n
\n )}\n\n {item.hierarchy[item.type] &&\n (item.type === 'lvl2' ||\n item.type === 'lvl3' ||\n item.type === 'lvl4' ||\n item.type === 'lvl5' ||\n item.type === 'lvl6') && (\n
\n \n \n
\n )}\n\n {item.type === 'content' && (\n
\n \n \n
\n )}\n\n {renderAction({ item, runDeleteTransition, runFavoriteTransition })}\n
\n
\n \n );\n}\n","export function groupBy>(\n values: TValue[],\n predicate: (value: TValue) => string\n): Record {\n return values.reduce>((acc, item) => {\n const key = predicate(item);\n\n if (!acc.hasOwnProperty(key)) {\n acc[key] = [];\n }\n\n // We limit each section to show 5 hits maximum.\n // This acts as a frontend alternative to `distinct`.\n if (acc[key].length < 5) {\n acc[key].push(item);\n }\n\n return acc;\n }, {});\n}\n","export function identity(x: TParam): TParam {\n return x;\n}\n","export function noop(..._args: any[]): void {}\n","import type { DocSearchHit, InternalDocSearchHit } from '../types';\n\nconst regexHighlightTags = /(|<\\/mark>)/g;\nconst regexHasHighlightTags = RegExp(regexHighlightTags.source);\n\nexport function removeHighlightTags(\n hit: DocSearchHit | InternalDocSearchHit\n): string {\n const internalDocSearchHit = hit as InternalDocSearchHit;\n\n if (!internalDocSearchHit.__docsearch_parent && !hit._highlightResult) {\n return hit.hierarchy.lvl0;\n }\n\n const { value } =\n (internalDocSearchHit.__docsearch_parent\n ? internalDocSearchHit.__docsearch_parent?._highlightResult?.hierarchy\n ?.lvl0\n : hit._highlightResult?.hierarchy?.lvl0) || {};\n\n return value && regexHasHighlightTags.test(value)\n ? value.replace(regexHighlightTags, '')\n : value;\n}\n","import React from 'react';\n\nimport { SelectIcon, SourceIcon } from './icons';\nimport { Results } from './Results';\nimport type { ScreenStateProps } from './ScreenState';\nimport type { InternalDocSearchHit } from './types';\nimport { removeHighlightTags } from './utils';\n\ntype ResultsScreenProps = Omit<\n ScreenStateProps,\n 'translations'\n>;\n\nexport function ResultsScreen(props: ResultsScreenProps) {\n return (\n
\n {props.state.collections.map((collection) => {\n if (collection.items.length === 0) {\n return null;\n }\n\n const title = removeHighlightTags(collection.items[0]);\n\n return (\n (\n <>\n {item.__docsearch_parent && (\n \n \n {item.__docsearch_parent !==\n collection.items[index + 1]?.__docsearch_parent ? (\n \n ) : (\n \n )}\n \n \n )}\n\n
\n \n
\n \n )}\n renderAction={() => (\n
\n \n
\n )}\n />\n );\n })}\n\n {props.resultsFooterComponent && (\n
\n \n
\n )}\n
\n );\n}\n","import React from 'react';\n\nimport { RecentIcon, ResetIcon, StarIcon } from './icons';\nimport { Results } from './Results';\nimport type { ScreenStateProps } from './ScreenState';\nimport type { InternalDocSearchHit } from './types';\n\nexport type StartScreenTranslations = Partial<{\n recentSearchesTitle: string;\n noRecentSearchesText: string;\n saveRecentSearchButtonTitle: string;\n removeRecentSearchButtonTitle: string;\n favoriteSearchesTitle: string;\n removeFavoriteSearchButtonTitle: string;\n}>;\n\ntype StartScreenProps = Omit<\n ScreenStateProps,\n 'translations'\n> & {\n hasCollections: boolean;\n translations?: StartScreenTranslations;\n};\n\nexport function StartScreen({ translations = {}, ...props }: StartScreenProps) {\n const {\n recentSearchesTitle = 'Recent',\n noRecentSearchesText = 'No recent searches',\n saveRecentSearchButtonTitle = 'Save this search',\n removeRecentSearchButtonTitle = 'Remove this search from history',\n favoriteSearchesTitle = 'Favorite',\n removeFavoriteSearchButtonTitle = 'Remove this search from favorites',\n } = translations;\n if (props.state.status === 'idle' && props.hasCollections === false) {\n if (props.disableUserPersonalization) {\n return null;\n }\n\n return (\n
\n

{noRecentSearchesText}

\n
\n );\n }\n\n if (props.hasCollections === false) {\n return null;\n }\n\n return (\n
\n (\n
\n \n
\n )}\n renderAction={({\n item,\n runFavoriteTransition,\n runDeleteTransition,\n }) => (\n <>\n
\n {\n event.preventDefault();\n event.stopPropagation();\n runFavoriteTransition(() => {\n props.favoriteSearches.add(item);\n props.recentSearches.remove(item);\n props.refresh();\n });\n }}\n >\n \n \n
\n
\n {\n event.preventDefault();\n event.stopPropagation();\n runDeleteTransition(() => {\n props.recentSearches.remove(item);\n props.refresh();\n });\n }}\n >\n \n \n
\n \n )}\n />\n\n (\n
\n \n
\n )}\n renderAction={({ item, runDeleteTransition }) => (\n
\n {\n event.preventDefault();\n event.stopPropagation();\n runDeleteTransition(() => {\n props.favoriteSearches.remove(item);\n props.refresh();\n });\n }}\n >\n \n \n
\n )}\n />\n
\n );\n}\n","import type {\n AutocompleteApi,\n AutocompleteState,\n BaseItem,\n} from '@algolia/autocomplete-core';\nimport React from 'react';\n\nimport type { DocSearchProps } from './DocSearch';\nimport type { ErrorScreenTranslations } from './ErrorScreen';\nimport { ErrorScreen } from './ErrorScreen';\nimport type { NoResultsScreenTranslations } from './NoResultsScreen';\nimport { NoResultsScreen } from './NoResultsScreen';\nimport { ResultsScreen } from './ResultsScreen';\nimport type { StartScreenTranslations } from './StartScreen';\nimport { StartScreen } from './StartScreen';\nimport type { StoredSearchPlugin } from './stored-searches';\nimport type { InternalDocSearchHit, StoredDocSearchHit } from './types';\n\nexport type ScreenStateTranslations = Partial<{\n errorScreen: ErrorScreenTranslations;\n startScreen: StartScreenTranslations;\n noResultsScreen: NoResultsScreenTranslations;\n}>;\n\nexport interface ScreenStateProps\n extends AutocompleteApi<\n TItem,\n React.FormEvent,\n React.MouseEvent,\n React.KeyboardEvent\n > {\n state: AutocompleteState;\n recentSearches: StoredSearchPlugin;\n favoriteSearches: StoredSearchPlugin;\n onItemClick: (item: InternalDocSearchHit) => void;\n inputRef: React.MutableRefObject;\n hitComponent: DocSearchProps['hitComponent'];\n indexName: DocSearchProps['indexName'];\n disableUserPersonalization: boolean;\n resultsFooterComponent: DocSearchProps['resultsFooterComponent'];\n translations: ScreenStateTranslations;\n getMissingResultsUrl?: DocSearchProps['getMissingResultsUrl'];\n}\n\nexport const ScreenState = React.memo(\n ({ translations = {}, ...props }: ScreenStateProps) => {\n if (props.state.status === 'error') {\n return ;\n }\n\n const hasCollections = props.state.collections.some(\n (collection) => collection.items.length > 0\n );\n\n if (!props.state.query) {\n return (\n \n );\n }\n\n if (hasCollections === false) {\n return (\n \n );\n }\n\n return ;\n },\n function areEqual(_prevProps, nextProps) {\n // We don't update the screen when Autocomplete is loading or stalled to\n // avoid UI flashes:\n // - Empty screen → Results screen\n // - NoResults screen → NoResults screen with another query\n return (\n nextProps.state.status === 'loading' ||\n nextProps.state.status === 'stalled'\n );\n }\n);\n","import type {\n AutocompleteApi,\n AutocompleteState,\n} from '@algolia/autocomplete-core';\nimport type { MutableRefObject } from 'react';\nimport React from 'react';\n\nimport { MAX_QUERY_SIZE } from './constants';\nimport { LoadingIcon } from './icons/LoadingIcon';\nimport { ResetIcon } from './icons/ResetIcon';\nimport { SearchIcon } from './icons/SearchIcon';\nimport type { InternalDocSearchHit } from './types';\n\nexport type SearchBoxTranslations = Partial<{\n resetButtonTitle: string;\n resetButtonAriaLabel: string;\n cancelButtonText: string;\n cancelButtonAriaLabel: string;\n}>;\n\ninterface SearchBoxProps\n extends AutocompleteApi<\n InternalDocSearchHit,\n React.FormEvent,\n React.MouseEvent,\n React.KeyboardEvent\n > {\n state: AutocompleteState;\n autoFocus: boolean;\n inputRef: MutableRefObject;\n onClose: () => void;\n isFromSelection: boolean;\n translations?: SearchBoxTranslations;\n}\n\nexport function SearchBox({ translations = {}, ...props }: SearchBoxProps) {\n const {\n resetButtonTitle = 'Clear the query',\n resetButtonAriaLabel = 'Clear the query',\n cancelButtonText = 'Cancel',\n cancelButtonAriaLabel = 'Cancel',\n } = translations;\n const { onReset } = props.getFormProps({\n inputElement: props.inputRef.current,\n });\n\n React.useEffect(() => {\n if (props.autoFocus && props.inputRef.current) {\n props.inputRef.current.focus();\n }\n }, [props.autoFocus, props.inputRef]);\n\n React.useEffect(() => {\n if (props.isFromSelection && props.inputRef.current) {\n props.inputRef.current.select();\n }\n }, [props.isFromSelection, props.inputRef]);\n\n return (\n <>\n {\n event.preventDefault();\n }}\n onReset={onReset}\n >\n \n\n
\n \n
\n\n \n\n