mirror of
https://github.com/EyeTrackVR/EyeTrackVR-Docs.git
synced 2025-11-04 14:49:44 +08:00
8 lines
69 KiB
JavaScript
8 lines
69 KiB
JavaScript
import{V as pt,h as ie,x as Be,ai as Tt,aj as Nt,d as It,E as be,ak as et,g as Ie,al as Dt,am as _t,y as Ot,an as Rt,j as De,O as de,S as we,ao as Mt,ap as Lt,W as Pt,s as zt,aq as Bt,o as X,b as Vt,k as S,$ as $t,l as j,a1 as Wt,ar as jt,as as Kt,c as te,n as tt,e as xe,D as rt,F as nt,a as he,t as ve,at as Jt,p as Ut,m as Ht,au as at,av as Gt,a7 as qt,ad as Qt,_ as Yt}from"./framework.3bcc5f8c.js";import{u as Zt,d as Xt}from"./theme.ed28cbb5.js";const er={root:()=>pt(()=>import("./@localSearchIndexroot.e2ccf99b.js"),[])};/*!
|
||
* tabbable 6.2.0
|
||
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
||
*/var mt=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Se=mt.join(","),yt=typeof Element>"u",se=yt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ae=!yt&&Element.prototype.getRootNode?function(o){var e;return o==null||(e=o.getRootNode)===null||e===void 0?void 0:e.call(o)}:function(o){return o==null?void 0:o.ownerDocument},Ce=function o(e,t){var r;t===void 0&&(t=!0);var a=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),n=a===""||a==="true",i=n||t&&e&&o(e.parentNode);return i},tr=function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"},gt=function(e,t,r){if(Ce(e))return[];var a=Array.prototype.slice.apply(e.querySelectorAll(Se));return t&&se.call(e,Se)&&a.unshift(e),a=a.filter(r),a},bt=function o(e,t,r){for(var a=[],n=Array.from(e);n.length;){var i=n.shift();if(!Ce(i,!1))if(i.tagName==="SLOT"){var s=i.assignedElements(),u=s.length?s:i.children,l=o(u,!0,r);r.flatten?a.push.apply(a,l):a.push({scopeParent:i,candidates:l})}else{var d=se.call(i,Se);d&&r.filter(i)&&(t||!e.includes(i))&&a.push(i);var h=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),v=!Ce(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(h&&v){var y=o(h===!0?i.children:h.children,!0,r);r.flatten?a.push.apply(a,y):a.push({scopeParent:i,candidates:y})}else n.unshift.apply(n,i.children)}}return a},wt=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},oe=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||tr(e))&&!wt(e)?0:e.tabIndex},rr=function(e,t){var r=oe(e);return r<0&&t&&!wt(e)?0:r},nr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},xt=function(e){return e.tagName==="INPUT"},ar=function(e){return xt(e)&&e.type==="hidden"},ir=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return t},or=function(e,t){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===t)return e[r]},sr=function(e){if(!e.name)return!0;var t=e.form||Ae(e),r=function(s){return t.querySelectorAll('input[type="radio"][name="'+s+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(e.name));else try{a=r(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var n=or(a,e.form);return!n||n===e},ur=function(e){return xt(e)&&e.type==="radio"},lr=function(e){return ur(e)&&!sr(e)},cr=function(e){var t,r=e&&Ae(e),a=(t=r)===null||t===void 0?void 0:t.host,n=!1;if(r&&r!==e){var i,s,u;for(n=!!((i=a)!==null&&i!==void 0&&(s=i.ownerDocument)!==null&&s!==void 0&&s.contains(a)||e!=null&&(u=e.ownerDocument)!==null&&u!==void 0&&u.contains(e));!n&&a;){var l,d,h;r=Ae(a),a=(l=r)===null||l===void 0?void 0:l.host,n=!!((d=a)!==null&&d!==void 0&&(h=d.ownerDocument)!==null&&h!==void 0&&h.contains(a))}}return n},it=function(e){var t=e.getBoundingClientRect(),r=t.width,a=t.height;return r===0&&a===0},fr=function(e,t){var r=t.displayCheck,a=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var n=se.call(e,"details>summary:first-of-type"),i=n?e.parentElement:e;if(se.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof a=="function"){for(var s=e;e;){var u=e.parentElement,l=Ae(e);if(u&&!u.shadowRoot&&a(u)===!0)return it(e);e.assignedSlot?e=e.assignedSlot:!u&&l!==e.ownerDocument?e=l.host:e=u}e=s}if(cr(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return it(e);return!1},dr=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var r=0;r<t.children.length;r++){var a=t.children.item(r);if(a.tagName==="LEGEND")return se.call(t,"fieldset[disabled] *")?!0:!a.contains(e)}return!0}t=t.parentElement}return!1},ke=function(e,t){return!(t.disabled||Ce(t)||ar(t)||fr(t,e)||ir(t)||dr(t))},Ve=function(e,t){return!(lr(t)||oe(t)<0||!ke(e,t))},hr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},vr=function o(e){var t=[],r=[];return e.forEach(function(a,n){var i=!!a.scopeParent,s=i?a.scopeParent:a,u=rr(s,i),l=i?o(a.candidates):s;u===0?i?t.push.apply(t,l):t.push(s):r.push({documentOrder:n,tabIndex:u,item:a,isScope:i,content:l})}),r.sort(nr).reduce(function(a,n){return n.isScope?a.push.apply(a,n.content):a.push(n.content),a},[]).concat(t)},pr=function(e,t){t=t||{};var r;return t.getShadowRoot?r=bt([e],t.includeContainer,{filter:Ve.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:hr}):r=gt(e,t.includeContainer,Ve.bind(null,t)),vr(r)},mr=function(e,t){t=t||{};var r;return t.getShadowRoot?r=bt([e],t.includeContainer,{filter:ke.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):r=gt(e,t.includeContainer,ke.bind(null,t)),r},ue=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return se.call(e,Se)===!1?!1:Ve(t,e)},yr=mt.concat("iframe").join(","),_e=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return se.call(e,yr)===!1?!1:ke(t,e)};/*!
|
||
* focus-trap 7.5.4
|
||
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
||
*/function ot(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(o,a).enumerable})),t.push.apply(t,r)}return t}function st(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ot(Object(t),!0).forEach(function(r){gr(o,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):ot(Object(t)).forEach(function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(t,r))})}return o}function gr(o,e,t){return e=wr(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function br(o,e){if(typeof o!="object"||o===null)return o;var t=o[Symbol.toPrimitive];if(t!==void 0){var r=t.call(o,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function wr(o){var e=br(o,"string");return typeof e=="symbol"?e:String(e)}var ut={activateTrap:function(e,t){if(e.length>0){var r=e[e.length-1];r!==t&&r.pause()}var a=e.indexOf(t);a===-1||e.splice(a,1),e.push(t)},deactivateTrap:function(e,t){var r=e.indexOf(t);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},xr=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},Fr=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},ye=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},Er=function(e){return ye(e)&&!e.shiftKey},Sr=function(e){return ye(e)&&e.shiftKey},lt=function(e){return setTimeout(e,0)},ct=function(e,t){var r=-1;return e.every(function(a,n){return t(a)?(r=n,!1):!0}),r},pe=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];return typeof e=="function"?e.apply(void 0,r):e},Fe=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},Ar=[],Cr=function(e,t){var r=(t==null?void 0:t.document)||document,a=(t==null?void 0:t.trapStack)||Ar,n=st({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Er,isKeyBackward:Sr},t),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s,u=function(c,f,p){return c&&c[f]!==void 0?c[f]:n[p||f]},l=function(c,f){var p=typeof(f==null?void 0:f.composedPath)=="function"?f.composedPath():void 0;return i.containerGroups.findIndex(function(N){var T=N.container,M=N.tabbableNodes;return T.contains(c)||(p==null?void 0:p.includes(T))||M.find(function(P){return P===c})})},d=function(c){var f=n[c];if(typeof f=="function"){for(var p=arguments.length,N=new Array(p>1?p-1:0),T=1;T<p;T++)N[T-1]=arguments[T];f=f.apply(void 0,N)}if(f===!0&&(f=void 0),!f){if(f===void 0||f===!1)return f;throw new Error("`".concat(c,"` was specified but was not a node, or did not return a node"))}var M=f;if(typeof f=="string"&&(M=r.querySelector(f),!M))throw new Error("`".concat(c,"` as selector refers to no known node"));return M},h=function(){var c=d("initialFocus");if(c===!1)return!1;if(c===void 0||!_e(c,n.tabbableOptions))if(l(r.activeElement)>=0)c=r.activeElement;else{var f=i.tabbableGroups[0],p=f&&f.firstTabbableNode;c=p||d("fallbackFocus")}if(!c)throw new Error("Your focus-trap needs to have at least one focusable element");return c},v=function(){if(i.containerGroups=i.containers.map(function(c){var f=pr(c,n.tabbableOptions),p=mr(c,n.tabbableOptions),N=f.length>0?f[0]:void 0,T=f.length>0?f[f.length-1]:void 0,M=p.find(function(w){return ue(w)}),P=p.slice().reverse().find(function(w){return ue(w)}),m=!!f.find(function(w){return oe(w)>0});return{container:c,tabbableNodes:f,focusableNodes:p,posTabIndexesFound:m,firstTabbableNode:N,lastTabbableNode:T,firstDomTabbableNode:M,lastDomTabbableNode:P,nextTabbableNode:function(V){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,J=f.indexOf(V);return J<0?q?p.slice(p.indexOf(V)+1).find(function(U){return ue(U)}):p.slice(0,p.indexOf(V)).reverse().find(function(U){return ue(U)}):f[J+(q?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(c){return c.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!d("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(c){return c.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},y=function F(c){var f=c.activeElement;if(f)return f.shadowRoot&&f.shadowRoot.activeElement!==null?F(f.shadowRoot):f},g=function F(c){if(c!==!1&&c!==y(document)){if(!c||!c.focus){F(h());return}c.focus({preventScroll:!!n.preventScroll}),i.mostRecentlyFocusedNode=c,xr(c)&&c.select()}},b=function(c){var f=d("setReturnFocus",c);return f||(f===!1?!1:c)},x=function(c){var f=c.target,p=c.event,N=c.isBackward,T=N===void 0?!1:N;f=f||Fe(p),v();var M=null;if(i.tabbableGroups.length>0){var P=l(f,p),m=P>=0?i.containerGroups[P]:void 0;if(P<0)T?M=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:M=i.tabbableGroups[0].firstTabbableNode;else if(T){var w=ct(i.tabbableGroups,function(H){var G=H.firstTabbableNode;return f===G});if(w<0&&(m.container===f||_e(f,n.tabbableOptions)&&!ue(f,n.tabbableOptions)&&!m.nextTabbableNode(f,!1))&&(w=P),w>=0){var V=w===0?i.tabbableGroups.length-1:w-1,q=i.tabbableGroups[V];M=oe(f)>=0?q.lastTabbableNode:q.lastDomTabbableNode}else ye(p)||(M=m.nextTabbableNode(f,!1))}else{var J=ct(i.tabbableGroups,function(H){var G=H.lastTabbableNode;return f===G});if(J<0&&(m.container===f||_e(f,n.tabbableOptions)&&!ue(f,n.tabbableOptions)&&!m.nextTabbableNode(f))&&(J=P),J>=0){var U=J===i.tabbableGroups.length-1?0:J+1,$=i.tabbableGroups[U];M=oe(f)>=0?$.firstTabbableNode:$.firstDomTabbableNode}else ye(p)||(M=m.nextTabbableNode(f))}}else M=d("fallbackFocus");return M},C=function(c){var f=Fe(c);if(!(l(f,c)>=0)){if(pe(n.clickOutsideDeactivates,c)){s.deactivate({returnFocus:n.returnFocusOnDeactivate});return}pe(n.allowOutsideClick,c)||c.preventDefault()}},k=function(c){var f=Fe(c),p=l(f,c)>=0;if(p||f instanceof Document)p&&(i.mostRecentlyFocusedNode=f);else{c.stopImmediatePropagation();var N,T=!0;if(i.mostRecentlyFocusedNode)if(oe(i.mostRecentlyFocusedNode)>0){var M=l(i.mostRecentlyFocusedNode),P=i.containerGroups[M].tabbableNodes;if(P.length>0){var m=P.findIndex(function(w){return w===i.mostRecentlyFocusedNode});m>=0&&(n.isKeyForward(i.recentNavEvent)?m+1<P.length&&(N=P[m+1],T=!1):m-1>=0&&(N=P[m-1],T=!1))}}else i.containerGroups.some(function(w){return w.tabbableNodes.some(function(V){return oe(V)>0})})||(T=!1);else T=!1;T&&(N=x({target:i.mostRecentlyFocusedNode,isBackward:n.isKeyBackward(i.recentNavEvent)})),g(N||i.mostRecentlyFocusedNode||h())}i.recentNavEvent=void 0},A=function(c){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=c;var p=x({event:c,isBackward:f});p&&(ye(c)&&c.preventDefault(),g(p))},L=function(c){if(Fr(c)&&pe(n.escapeDeactivates,c)!==!1){c.preventDefault(),s.deactivate();return}(n.isKeyForward(c)||n.isKeyBackward(c))&&A(c,n.isKeyBackward(c))},O=function(c){var f=Fe(c);l(f,c)>=0||pe(n.clickOutsideDeactivates,c)||pe(n.allowOutsideClick,c)||(c.preventDefault(),c.stopImmediatePropagation())},z=function(){if(i.active)return ut.activateTrap(a,s),i.delayInitialFocusTimer=n.delayInitialFocus?lt(function(){g(h())}):g(h()),r.addEventListener("focusin",k,!0),r.addEventListener("mousedown",C,{capture:!0,passive:!1}),r.addEventListener("touchstart",C,{capture:!0,passive:!1}),r.addEventListener("click",O,{capture:!0,passive:!1}),r.addEventListener("keydown",L,{capture:!0,passive:!1}),s},E=function(){if(i.active)return r.removeEventListener("focusin",k,!0),r.removeEventListener("mousedown",C,!0),r.removeEventListener("touchstart",C,!0),r.removeEventListener("click",O,!0),r.removeEventListener("keydown",L,!0),s},I=function(c){var f=c.some(function(p){var N=Array.from(p.removedNodes);return N.some(function(T){return T===i.mostRecentlyFocusedNode})});f&&g(h())},_=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(I):void 0,R=function(){_&&(_.disconnect(),i.active&&!i.paused&&i.containers.map(function(c){_.observe(c,{subtree:!0,childList:!0})}))};return s={get active(){return i.active},get paused(){return i.paused},activate:function(c){if(i.active)return this;var f=u(c,"onActivate"),p=u(c,"onPostActivate"),N=u(c,"checkCanFocusTrap");N||v(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=r.activeElement,f==null||f();var T=function(){N&&v(),z(),R(),p==null||p()};return N?(N(i.containers.concat()).then(T,T),this):(T(),this)},deactivate:function(c){if(!i.active)return this;var f=st({onDeactivate:n.onDeactivate,onPostDeactivate:n.onPostDeactivate,checkCanReturnFocus:n.checkCanReturnFocus},c);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,E(),i.active=!1,i.paused=!1,R(),ut.deactivateTrap(a,s);var p=u(f,"onDeactivate"),N=u(f,"onPostDeactivate"),T=u(f,"checkCanReturnFocus"),M=u(f,"returnFocus","returnFocusOnDeactivate");p==null||p();var P=function(){lt(function(){M&&g(b(i.nodeFocusedBeforeActivation)),N==null||N()})};return M&&T?(T(b(i.nodeFocusedBeforeActivation)).then(P,P),this):(P(),this)},pause:function(c){if(i.paused||!i.active)return this;var f=u(c,"onPause"),p=u(c,"onPostPause");return i.paused=!0,f==null||f(),E(),R(),p==null||p(),this},unpause:function(c){if(!i.paused||!i.active)return this;var f=u(c,"onUnpause"),p=u(c,"onPostUnpause");return i.paused=!1,f==null||f(),v(),z(),R(),p==null||p(),this},updateContainerElements:function(c){var f=[].concat(c).filter(Boolean);return i.containers=f.map(function(p){return typeof p=="string"?r.querySelector(p):p}),i.active&&v(),R(),this}},s.updateContainerElements(e),s};function kr(o,e={}){let t;const{immediate:r,...a}=e,n=ie(!1),i=ie(!1),s=h=>t&&t.activate(h),u=h=>t&&t.deactivate(h),l=()=>{t&&(t.pause(),i.value=!0)},d=()=>{t&&(t.unpause(),i.value=!1)};return Be(()=>Tt(o),h=>{h&&(t=Cr(h,{...a,onActivate(){n.value=!0,e.onActivate&&e.onActivate()},onDeactivate(){n.value=!1,e.onDeactivate&&e.onDeactivate()}}),r&&s())},{flush:"post"}),Nt(()=>u()),{hasFocus:n,isPaused:i,activate:s,deactivate:u,pause:l,unpause:d}}class ce{constructor(e,t=!0,r=[],a=5e3){this.ctx=e,this.iframes=t,this.exclude=r,this.iframesTimeout=a}static matches(e,t){const r=typeof t=="string"?[t]:t,a=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(a){let n=!1;return r.every(i=>a.call(e,i)?(n=!0,!1):!0),n}else return!1}getContexts(){let e,t=[];return typeof this.ctx>"u"||!this.ctx?e=[]:NodeList.prototype.isPrototypeOf(this.ctx)?e=Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?e=this.ctx:typeof this.ctx=="string"?e=Array.prototype.slice.call(document.querySelectorAll(this.ctx)):e=[this.ctx],e.forEach(r=>{const a=t.filter(n=>n.contains(r)).length>0;t.indexOf(r)===-1&&!a&&t.push(r)}),t}getIframeContents(e,t,r=()=>{}){let a;try{const n=e.contentWindow;if(a=n.document,!n||!a)throw new Error("iframe inaccessible")}catch{r()}a&&t(a)}isIframeBlank(e){const t="about:blank",r=e.getAttribute("src").trim();return e.contentWindow.location.href===t&&r!==t&&r}observeIframeLoad(e,t,r){let a=!1,n=null;const i=()=>{if(!a){a=!0,clearTimeout(n);try{this.isIframeBlank(e)||(e.removeEventListener("load",i),this.getIframeContents(e,t,r))}catch{r()}}};e.addEventListener("load",i),n=setTimeout(i,this.iframesTimeout)}onIframeReady(e,t,r){try{e.contentWindow.document.readyState==="complete"?this.isIframeBlank(e)?this.observeIframeLoad(e,t,r):this.getIframeContents(e,t,r):this.observeIframeLoad(e,t,r)}catch{r()}}waitForIframes(e,t){let r=0;this.forEachIframe(e,()=>!0,a=>{r++,this.waitForIframes(a.querySelector("html"),()=>{--r||t()})},a=>{a||t()})}forEachIframe(e,t,r,a=()=>{}){let n=e.querySelectorAll("iframe"),i=n.length,s=0;n=Array.prototype.slice.call(n);const u=()=>{--i<=0&&a(s)};i||u(),n.forEach(l=>{ce.matches(l,this.exclude)?u():this.onIframeReady(l,d=>{t(l)&&(s++,r(d)),u()},u)})}createIterator(e,t,r){return document.createNodeIterator(e,t,r,!1)}createInstanceOnIframe(e){return new ce(e.querySelector("html"),this.iframes)}compareNodeIframe(e,t,r){const a=e.compareDocumentPosition(r),n=Node.DOCUMENT_POSITION_PRECEDING;if(a&n)if(t!==null){const i=t.compareDocumentPosition(r),s=Node.DOCUMENT_POSITION_FOLLOWING;if(i&s)return!0}else return!0;return!1}getIteratorNode(e){const t=e.previousNode();let r;return t===null?r=e.nextNode():r=e.nextNode()&&e.nextNode(),{prevNode:t,node:r}}checkIframeFilter(e,t,r,a){let n=!1,i=!1;return a.forEach((s,u)=>{s.val===r&&(n=u,i=s.handled)}),this.compareNodeIframe(e,t,r)?(n===!1&&!i?a.push({val:r,handled:!0}):n!==!1&&!i&&(a[n].handled=!0),!0):(n===!1&&a.push({val:r,handled:!1}),!1)}handleOpenIframes(e,t,r,a){e.forEach(n=>{n.handled||this.getIframeContents(n.val,i=>{this.createInstanceOnIframe(i).forEachNode(t,r,a)})})}iterateThroughNodes(e,t,r,a,n){const i=this.createIterator(t,e,a);let s=[],u=[],l,d,h=()=>({prevNode:d,node:l}=this.getIteratorNode(i),l);for(;h();)this.iframes&&this.forEachIframe(t,v=>this.checkIframeFilter(l,d,v,s),v=>{this.createInstanceOnIframe(v).forEachNode(e,y=>u.push(y),a)}),u.push(l);u.forEach(v=>{r(v)}),this.iframes&&this.handleOpenIframes(s,e,r,a),n()}forEachNode(e,t,r,a=()=>{}){const n=this.getContexts();let i=n.length;i||a(),n.forEach(s=>{const u=()=>{this.iterateThroughNodes(e,s,t,r,()=>{--i<=0&&a()})};this.iframes?this.waitForIframes(s,u):u()})}}let Tr=class{constructor(e){this.ctx=e,this.ie=!1;const t=window.navigator.userAgent;(t.indexOf("MSIE")>-1||t.indexOf("Trident")>-1)&&(this.ie=!0)}set opt(e){this._opt=Object.assign({},{element:"",className:"",exclude:[],iframes:!1,iframesTimeout:5e3,separateWordSearch:!0,diacritics:!0,synonyms:{},accuracy:"partially",acrossElements:!1,caseSensitive:!1,ignoreJoiners:!1,ignoreGroups:0,ignorePunctuation:[],wildcards:"disabled",each:()=>{},noMatch:()=>{},filter:()=>!0,done:()=>{},debug:!1,log:window.console},e)}get opt(){return this._opt}get iterator(){return new ce(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}log(e,t="debug"){const r=this.opt.log;this.opt.debug&&typeof r=="object"&&typeof r[t]=="function"&&r[t](`mark.js: ${e}`)}escapeStr(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}createRegExp(e){return this.opt.wildcards!=="disabled"&&(e=this.setupWildcardsRegExp(e)),e=this.escapeStr(e),Object.keys(this.opt.synonyms).length&&(e=this.createSynonymsRegExp(e)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),this.opt.diacritics&&(e=this.createDiacriticsRegExp(e)),e=this.createMergedBlanksRegExp(e),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.createJoinersRegExp(e)),this.opt.wildcards!=="disabled"&&(e=this.createWildcardsRegExp(e)),e=this.createAccuracyRegExp(e),e}createSynonymsRegExp(e){const t=this.opt.synonyms,r=this.opt.caseSensitive?"":"i",a=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(let n in t)if(t.hasOwnProperty(n)){const i=t[n],s=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(n):this.escapeStr(n),u=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(i):this.escapeStr(i);s!==""&&u!==""&&(e=e.replace(new RegExp(`(${this.escapeStr(s)}|${this.escapeStr(u)})`,`gm${r}`),a+`(${this.processSynomyms(s)}|${this.processSynomyms(u)})`+a))}return e}processSynomyms(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}setupWildcardsRegExp(e){return e=e.replace(/(?:\\)*\?/g,t=>t.charAt(0)==="\\"?"?":""),e.replace(/(?:\\)*\*/g,t=>t.charAt(0)==="\\"?"*":"")}createWildcardsRegExp(e){let t=this.opt.wildcards==="withSpaces";return e.replace(/\u0001/g,t?"[\\S\\s]?":"\\S?").replace(/\u0002/g,t?"[\\S\\s]*?":"\\S*")}setupIgnoreJoinersRegExp(e){return e.replace(/[^(|)\\]/g,(t,r,a)=>{let n=a.charAt(r+1);return/[(|)\\]/.test(n)||n===""?t:t+"\0"})}createJoinersRegExp(e){let t=[];const r=this.opt.ignorePunctuation;return Array.isArray(r)&&r.length&&t.push(this.escapeStr(r.join(""))),this.opt.ignoreJoiners&&t.push("\\u00ad\\u200b\\u200c\\u200d"),t.length?e.split(/\u0000+/).join(`[${t.join("")}]*`):e}createDiacriticsRegExp(e){const t=this.opt.caseSensitive?"":"i",r=this.opt.caseSensitive?["aàáảãạăằắẳẵặâầấẩẫậäåāą","AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćč","CÇĆČ","dđď","DĐĎ","eèéẻẽẹêềếểễệëěēę","EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïī","IÌÍỈĨỊÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøō","OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúủũụưừứửữựûüůū","UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿ","YÝỲỶỸỴŸ","zžżź","ZŽŻŹ"]:["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćčCÇĆČ","dđďDĐĎ","eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïīIÌÍỈĨỊÎÏĪ","lłLŁ","nñňńNÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rřRŘ","sšśșşSŠŚȘŞ","tťțţTŤȚŢ","uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿYÝỲỶỸỴŸ","zžżźZŽŻŹ"];let a=[];return e.split("").forEach(n=>{r.every(i=>{if(i.indexOf(n)!==-1){if(a.indexOf(i)>-1)return!1;e=e.replace(new RegExp(`[${i}]`,`gm${t}`),`[${i}]`),a.push(i)}return!0})}),e}createMergedBlanksRegExp(e){return e.replace(/[\s]+/gmi,"[\\s]+")}createAccuracyRegExp(e){const t="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿";let r=this.opt.accuracy,a=typeof r=="string"?r:r.value,n=typeof r=="string"?[]:r.limiters,i="";switch(n.forEach(s=>{i+=`|${this.escapeStr(s)}`}),a){case"partially":default:return`()(${e})`;case"complementary":return i="\\s"+(i||this.escapeStr(t)),`()([^${i}]*${e}[^${i}]*)`;case"exactly":return`(^|\\s${i})(${e})(?=$|\\s${i})`}}getSeparatedKeywords(e){let t=[];return e.forEach(r=>{this.opt.separateWordSearch?r.split(" ").forEach(a=>{a.trim()&&t.indexOf(a)===-1&&t.push(a)}):r.trim()&&t.indexOf(r)===-1&&t.push(r)}),{keywords:t.sort((r,a)=>a.length-r.length),length:t.length}}isNumeric(e){return Number(parseFloat(e))==e}checkRanges(e){if(!Array.isArray(e)||Object.prototype.toString.call(e[0])!=="[object Object]")return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(e),[];const t=[];let r=0;return e.sort((a,n)=>a.start-n.start).forEach(a=>{let{start:n,end:i,valid:s}=this.callNoMatchOnInvalidRanges(a,r);s&&(a.start=n,a.length=i-n,t.push(a),r=i)}),t}callNoMatchOnInvalidRanges(e,t){let r,a,n=!1;return e&&typeof e.start<"u"?(r=parseInt(e.start,10),a=r+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&a-t>0&&a-r>0?n=!0:(this.log(`Ignoring invalid or overlapping range: ${JSON.stringify(e)}`),this.opt.noMatch(e))):(this.log(`Ignoring invalid range: ${JSON.stringify(e)}`),this.opt.noMatch(e)),{start:r,end:a,valid:n}}checkWhitespaceRanges(e,t,r){let a,n=!0,i=r.length,s=t-i,u=parseInt(e.start,10)-s;return u=u>i?i:u,a=u+parseInt(e.length,10),a>i&&(a=i,this.log(`End range automatically set to the max value of ${i}`)),u<0||a-u<0||u>i||a>i?(n=!1,this.log(`Invalid range: ${JSON.stringify(e)}`),this.opt.noMatch(e)):r.substring(u,a).replace(/\s+/g,"")===""&&(n=!1,this.log("Skipping whitespace only range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:u,end:a,valid:n}}getTextNodes(e){let t="",r=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,a=>{r.push({start:t.length,end:(t+=a.textContent).length,node:a})},a=>this.matchesExclude(a.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT,()=>{e({value:t,nodes:r})})}matchesExclude(e){return ce.matches(e,this.opt.exclude.concat(["script","style","title","head","html"]))}wrapRangeInTextNode(e,t,r){const a=this.opt.element?this.opt.element:"mark",n=e.splitText(t),i=n.splitText(r-t);let s=document.createElement(a);return s.setAttribute("data-markjs","true"),this.opt.className&&s.setAttribute("class",this.opt.className),s.textContent=n.textContent,n.parentNode.replaceChild(s,n),i}wrapRangeInMappedTextNode(e,t,r,a,n){e.nodes.every((i,s)=>{const u=e.nodes[s+1];if(typeof u>"u"||u.start>t){if(!a(i.node))return!1;const l=t-i.start,d=(r>i.end?i.end:r)-i.start,h=e.value.substr(0,i.start),v=e.value.substr(d+i.start);if(i.node=this.wrapRangeInTextNode(i.node,l,d),e.value=h+v,e.nodes.forEach((y,g)=>{g>=s&&(e.nodes[g].start>0&&g!==s&&(e.nodes[g].start-=d),e.nodes[g].end-=d)}),r-=d,n(i.node.previousSibling,i.start),r>i.end)t=i.end;else return!1}return!0})}wrapMatches(e,t,r,a,n){const i=t===0?0:t+1;this.getTextNodes(s=>{s.nodes.forEach(u=>{u=u.node;let l;for(;(l=e.exec(u.textContent))!==null&&l[i]!=="";){if(!r(l[i],u))continue;let d=l.index;if(i!==0)for(let h=1;h<i;h++)d+=l[h].length;u=this.wrapRangeInTextNode(u,d,d+l[i].length),a(u.previousSibling),e.lastIndex=0}}),n()})}wrapMatchesAcrossElements(e,t,r,a,n){const i=t===0?0:t+1;this.getTextNodes(s=>{let u;for(;(u=e.exec(s.value))!==null&&u[i]!=="";){let l=u.index;if(i!==0)for(let h=1;h<i;h++)l+=u[h].length;const d=l+u[i].length;this.wrapRangeInMappedTextNode(s,l,d,h=>r(u[i],h),(h,v)=>{e.lastIndex=v,a(h)})}n()})}wrapRangeFromIndex(e,t,r,a){this.getTextNodes(n=>{const i=n.value.length;e.forEach((s,u)=>{let{start:l,end:d,valid:h}=this.checkWhitespaceRanges(s,i,n.value);h&&this.wrapRangeInMappedTextNode(n,l,d,v=>t(v,s,n.value.substring(l,d),u),v=>{r(v,s)})}),a()})}unwrapMatches(e){const t=e.parentNode;let r=document.createDocumentFragment();for(;e.firstChild;)r.appendChild(e.removeChild(e.firstChild));t.replaceChild(r,e),this.ie?this.normalizeTextNode(t):t.normalize()}normalizeTextNode(e){if(e){if(e.nodeType===3)for(;e.nextSibling&&e.nextSibling.nodeType===3;)e.nodeValue+=e.nextSibling.nodeValue,e.parentNode.removeChild(e.nextSibling);else this.normalizeTextNode(e.firstChild);this.normalizeTextNode(e.nextSibling)}}markRegExp(e,t){this.opt=t,this.log(`Searching with expression "${e}"`);let r=0,a="wrapMatches";const n=i=>{r++,this.opt.each(i)};this.opt.acrossElements&&(a="wrapMatchesAcrossElements"),this[a](e,this.opt.ignoreGroups,(i,s)=>this.opt.filter(s,i,r),n,()=>{r===0&&this.opt.noMatch(e),this.opt.done(r)})}mark(e,t){this.opt=t;let r=0,a="wrapMatches";const{keywords:n,length:i}=this.getSeparatedKeywords(typeof e=="string"?[e]:e),s=this.opt.caseSensitive?"":"i",u=l=>{let d=new RegExp(this.createRegExp(l),`gm${s}`),h=0;this.log(`Searching with expression "${d}"`),this[a](d,1,(v,y)=>this.opt.filter(y,l,r,h),v=>{h++,r++,this.opt.each(v)},()=>{h===0&&this.opt.noMatch(l),n[i-1]===l?this.opt.done(r):u(n[n.indexOf(l)+1])})};this.opt.acrossElements&&(a="wrapMatchesAcrossElements"),i===0?this.opt.done(r):u(n[0])}markRanges(e,t){this.opt=t;let r=0,a=this.checkRanges(e);a&&a.length?(this.log("Starting to mark with the following ranges: "+JSON.stringify(a)),this.wrapRangeFromIndex(a,(n,i,s,u)=>this.opt.filter(n,i,s,u),(n,i)=>{r++,this.opt.each(n,i)},()=>{this.opt.done(r)})):this.opt.done(r)}unmark(e){this.opt=e;let t=this.opt.element?this.opt.element:"*";t+="[data-markjs]",this.opt.className&&(t+=`.${this.opt.className}`),this.log(`Removal selector "${t}"`),this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT,r=>{this.unwrapMatches(r)},r=>{const a=ce.matches(r,t),n=this.matchesExclude(r);return!a||n?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}};function Nr(o){const e=new Tr(o);return this.mark=(t,r)=>(e.mark(t,r),this),this.markRegExp=(t,r)=>(e.markRegExp(t,r),this),this.markRanges=(t,r)=>(e.markRanges(t,r),this),this.unmark=t=>(e.unmark(t),this),this}var B=function(){return B=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++){t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},B.apply(this,arguments)};function Ir(o,e,t,r){function a(n){return n instanceof t?n:new t(function(i){i(n)})}return new(t||(t=Promise))(function(n,i){function s(d){try{l(r.next(d))}catch(h){i(h)}}function u(d){try{l(r.throw(d))}catch(h){i(h)}}function l(d){d.done?n(d.value):a(d.value).then(s,u)}l((r=r.apply(o,e||[])).next())})}function Dr(o,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},r,a,n,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(l){return function(d){return u([l,d])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(t=0)),t;)try{if(r=1,a&&(n=l[0]&2?a.return:l[0]?a.throw||((n=a.return)&&n.call(a),0):a.next)&&!(n=n.call(a,l[1])).done)return n;switch(a=0,n&&(l=[l[0]&2,n.value]),l[0]){case 0:case 1:n=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,a=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(n=t.trys,!(n=n.length>0&&n[n.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!n||l[1]>n[0]&&l[1]<n[3])){t.label=l[1];break}if(l[0]===6&&t.label<n[1]){t.label=n[1],n=l;break}if(n&&t.label<n[2]){t.label=n[2],t.ops.push(l);break}n[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(o,t)}catch(d){l=[6,d],a=0}finally{r=n=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function D(o){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&o[e],r=0;if(t)return t.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&r>=o.length&&(o=void 0),{value:o&&o[r++],done:!o}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function W(o,e){var t=typeof Symbol=="function"&&o[Symbol.iterator];if(!t)return o;var r=t.call(o),a,n=[],i;try{for(;(e===void 0||e-- >0)&&!(a=r.next()).done;)n.push(a.value)}catch(s){i={error:s}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(i)throw i.error}}return n}var _r="ENTRIES",Ft="KEYS",Et="VALUES",K="",Oe=function(){function o(e,t){var r=e._tree,a=Array.from(r.keys());this.set=e,this._type=t,this._path=a.length>0?[{node:r,keys:a}]:[]}return o.prototype.next=function(){var e=this.dive();return this.backtrack(),e},o.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var e=le(this._path),t=e.node,r=e.keys;if(le(r)===K)return{done:!1,value:this.result()};var a=t.get(le(r));return this._path.push({node:a,keys:Array.from(a.keys())}),this.dive()},o.prototype.backtrack=function(){if(this._path.length!==0){var e=le(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},o.prototype.key=function(){return this.set._prefix+this._path.map(function(e){var t=e.keys;return le(t)}).filter(function(e){return e!==K}).join("")},o.prototype.value=function(){return le(this._path).node.get(K)},o.prototype.result=function(){switch(this._type){case Et:return this.value();case Ft:return this.key();default:return[this.key(),this.value()]}},o.prototype[Symbol.iterator]=function(){return this},o}(),le=function(o){return o[o.length-1]},Or=function(o,e,t){var r=new Map;if(e===void 0)return r;for(var a=e.length+1,n=a+t,i=new Uint8Array(n*a).fill(t+1),s=0;s<a;++s)i[s]=s;for(var u=1;u<n;++u)i[u*a]=u;return St(o,e,t,r,i,1,a,""),r},St=function(o,e,t,r,a,n,i,s){var u,l,d=n*i;try{e:for(var h=D(o.keys()),v=h.next();!v.done;v=h.next()){var y=v.value;if(y===K){var g=a[d-1];g<=t&&r.set(s,[o.get(y),g])}else{for(var b=n,x=0;x<y.length;++x,++b){for(var C=y[x],k=i*b,A=k-i,L=a[k],O=Math.max(0,b-t-1),z=Math.min(i-1,b+t),E=O;E<z;++E){var I=C!==e[E],_=a[A+E]+ +I,R=a[A+E+1]+1,F=a[k+E]+1,c=a[k+E+1]=Math.min(_,R,F);c<L&&(L=c)}if(L>t)continue e}St(o.get(y),e,t,r,a,b,i,s+y)}}}catch(f){u={error:f}}finally{try{v&&!v.done&&(l=h.return)&&l.call(h)}finally{if(u)throw u.error}}},Re=function(){function o(e,t){e===void 0&&(e=new Map),t===void 0&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return o.prototype.atPrefix=function(e){var t,r;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var a=W(Te(this._tree,e.slice(this._prefix.length)),2),n=a[0],i=a[1];if(n===void 0){var s=W(Ke(i),2),u=s[0],l=s[1];try{for(var d=D(u.keys()),h=d.next();!h.done;h=d.next()){var v=h.value;if(v!==K&&v.startsWith(l)){var y=new Map;return y.set(v.slice(l.length),u.get(v)),new o(y,e)}}}catch(g){t={error:g}}finally{try{h&&!h.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}}return new o(n,e)},o.prototype.clear=function(){this._size=void 0,this._tree.clear()},o.prototype.delete=function(e){return this._size=void 0,Rr(this._tree,e)},o.prototype.entries=function(){return new Oe(this,_r)},o.prototype.forEach=function(e){var t,r;try{for(var a=D(this),n=a.next();!n.done;n=a.next()){var i=W(n.value,2),s=i[0],u=i[1];e(s,u,this)}}catch(l){t={error:l}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}},o.prototype.fuzzyGet=function(e,t){return Or(this._tree,e,t)},o.prototype.get=function(e){var t=$e(this._tree,e);return t!==void 0?t.get(K):void 0},o.prototype.has=function(e){var t=$e(this._tree,e);return t!==void 0&&t.has(K)},o.prototype.keys=function(){return new Oe(this,Ft)},o.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var r=Me(this._tree,e);return r.set(K,t),this},Object.defineProperty(o.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),o.prototype.update=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var r=Me(this._tree,e);return r.set(K,t(r.get(K))),this},o.prototype.fetch=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var r=Me(this._tree,e),a=r.get(K);return a===void 0&&r.set(K,a=t()),a},o.prototype.values=function(){return new Oe(this,Et)},o.prototype[Symbol.iterator]=function(){return this.entries()},o.from=function(e){var t,r,a=new o;try{for(var n=D(e),i=n.next();!i.done;i=n.next()){var s=W(i.value,2),u=s[0],l=s[1];a.set(u,l)}}catch(d){t={error:d}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return a},o.fromObject=function(e){return o.from(Object.entries(e))},o}(),Te=function(o,e,t){var r,a;if(t===void 0&&(t=[]),e.length===0||o==null)return[o,t];try{for(var n=D(o.keys()),i=n.next();!i.done;i=n.next()){var s=i.value;if(s!==K&&e.startsWith(s))return t.push([o,s]),Te(o.get(s),e.slice(s.length),t)}}catch(u){r={error:u}}finally{try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(r)throw r.error}}return t.push([o,e]),Te(void 0,"",t)},$e=function(o,e){var t,r;if(e.length===0||o==null)return o;try{for(var a=D(o.keys()),n=a.next();!n.done;n=a.next()){var i=n.value;if(i!==K&&e.startsWith(i))return $e(o.get(i),e.slice(i.length))}}catch(s){t={error:s}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}},Me=function(o,e){var t,r,a=e.length;e:for(var n=0;o&&n<a;){try{for(var i=(t=void 0,D(o.keys())),s=i.next();!s.done;s=i.next()){var u=s.value;if(u!==K&&e[n]===u[0]){for(var l=Math.min(a-n,u.length),d=1;d<l&&e[n+d]===u[d];)++d;var h=o.get(u);if(d===u.length)o=h;else{var v=new Map;v.set(u.slice(d),h),o.set(e.slice(n,n+d),v),o.delete(u),o=v}n+=d;continue e}}}catch(g){t={error:g}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}var y=new Map;return o.set(e.slice(n),y),y}return o},Rr=function(o,e){var t=W(Te(o,e),2),r=t[0],a=t[1];if(r!==void 0){if(r.delete(K),r.size===0)At(a);else if(r.size===1){var n=W(r.entries().next().value,2),i=n[0],s=n[1];Ct(a,i,s)}}},At=function(o){if(o.length!==0){var e=W(Ke(o),2),t=e[0],r=e[1];if(t.delete(r),t.size===0)At(o.slice(0,-1));else if(t.size===1){var a=W(t.entries().next().value,2),n=a[0],i=a[1];n!==K&&Ct(o.slice(0,-1),n,i)}}},Ct=function(o,e,t){if(o.length!==0){var r=W(Ke(o),2),a=r[0],n=r[1];a.set(n+e,t),a.delete(n)}},Ke=function(o){return o[o.length-1]},me,Je="or",kt="and",Mr="and_not",Lr=function(){function o(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');var t=e.autoVacuum==null||e.autoVacuum===!0?ze:e.autoVacuum;this._options=B(B(B({},Pe),e),{autoVacuum:t,searchOptions:B(B({},ft),e.searchOptions||{}),autoSuggestOptions:B(B({},$r),e.autoSuggestOptions||{})}),this._index=new Re,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=je,this.addFields(this._options.fields)}return o.prototype.add=function(e){var t,r,a,n,i,s,u=this._options,l=u.extractField,d=u.tokenize,h=u.processTerm,v=u.fields,y=u.idField,g=l(e,y);if(g==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));if(this._idToShortId.has(g))throw new Error("MiniSearch: duplicate ID ".concat(g));var b=this.addDocumentId(g);this.saveStoredFields(b,e);try{for(var x=D(v),C=x.next();!C.done;C=x.next()){var k=C.value,A=l(e,k);if(A!=null){var L=d(A.toString(),k),O=this._fieldIds[k],z=new Set(L).size;this.addFieldLength(b,O,this._documentCount-1,z);try{for(var E=(a=void 0,D(L)),I=E.next();!I.done;I=E.next()){var _=I.value,R=h(_,k);if(Array.isArray(R))try{for(var F=(i=void 0,D(R)),c=F.next();!c.done;c=F.next()){var f=c.value;this.addTerm(O,b,f)}}catch(p){i={error:p}}finally{try{c&&!c.done&&(s=F.return)&&s.call(F)}finally{if(i)throw i.error}}else R&&this.addTerm(O,b,R)}}catch(p){a={error:p}}finally{try{I&&!I.done&&(n=E.return)&&n.call(E)}finally{if(a)throw a.error}}}}}catch(p){t={error:p}}finally{try{C&&!C.done&&(r=x.return)&&r.call(x)}finally{if(t)throw t.error}}},o.prototype.addAll=function(e){var t,r;try{for(var a=D(e),n=a.next();!n.done;n=a.next()){var i=n.value;this.add(i)}}catch(s){t={error:s}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}},o.prototype.addAllAsync=function(e,t){var r=this;t===void 0&&(t={});var a=t.chunkSize,n=a===void 0?10:a,i={chunk:[],promise:Promise.resolve()},s=e.reduce(function(d,h,v){var y=d.chunk,g=d.promise;return y.push(h),(v+1)%n===0?{chunk:[],promise:g.then(function(){return new Promise(function(b){return setTimeout(b,0)})}).then(function(){return r.addAll(y)})}:{chunk:y,promise:g}},i),u=s.chunk,l=s.promise;return l.then(function(){return r.addAll(u)})},o.prototype.remove=function(e){var t,r,a,n,i,s,u=this._options,l=u.tokenize,d=u.processTerm,h=u.extractField,v=u.fields,y=u.idField,g=h(e,y);if(g==null)throw new Error('MiniSearch: document does not have ID field "'.concat(y,'"'));var b=this._idToShortId.get(g);if(b==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(g,": it is not in the index"));try{for(var x=D(v),C=x.next();!C.done;C=x.next()){var k=C.value,A=h(e,k);if(A!=null){var L=l(A.toString(),k),O=this._fieldIds[k],z=new Set(L).size;this.removeFieldLength(b,O,this._documentCount,z);try{for(var E=(a=void 0,D(L)),I=E.next();!I.done;I=E.next()){var _=I.value,R=d(_,k);if(Array.isArray(R))try{for(var F=(i=void 0,D(R)),c=F.next();!c.done;c=F.next()){var f=c.value;this.removeTerm(O,b,f)}}catch(p){i={error:p}}finally{try{c&&!c.done&&(s=F.return)&&s.call(F)}finally{if(i)throw i.error}}else R&&this.removeTerm(O,b,R)}}catch(p){a={error:p}}finally{try{I&&!I.done&&(n=E.return)&&n.call(E)}finally{if(a)throw a.error}}}}}catch(p){t={error:p}}finally{try{C&&!C.done&&(r=x.return)&&r.call(x)}finally{if(t)throw t.error}}this._storedFields.delete(b),this._documentIds.delete(b),this._idToShortId.delete(g),this._fieldLength.delete(b),this._documentCount-=1},o.prototype.removeAll=function(e){var t,r;if(e)try{for(var a=D(e),n=a.next();!n.done;n=a.next()){var i=n.value;this.remove(i)}}catch(s){t={error:s}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Re,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},o.prototype.discard=function(e){var t=this,r=this._idToShortId.get(e);if(r==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(r),this._storedFields.delete(r),(this._fieldLength.get(r)||[]).forEach(function(a,n){t.removeFieldLength(r,n,t._documentCount,a)}),this._fieldLength.delete(r),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},o.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var e=this._options.autoVacuum,t=e.minDirtFactor,r=e.minDirtCount,a=e.batchSize,n=e.batchWait;this.conditionalVacuum({batchSize:a,batchWait:n},{minDirtCount:r,minDirtFactor:t})}},o.prototype.discardAll=function(e){var t,r,a=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var n=D(e),i=n.next();!i.done;i=n.next()){var s=i.value;this.discard(s)}}catch(u){t={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}finally{this._options.autoVacuum=a}this.maybeAutoVacuum()},o.prototype.replace=function(e){var t=this._options,r=t.idField,a=t.extractField,n=a(e,r);this.discard(n),this.add(e)},o.prototype.vacuum=function(e){return e===void 0&&(e={}),this.conditionalVacuum(e)},o.prototype.conditionalVacuum=function(e,t){var r=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var a=r._enqueuedVacuumConditions;return r._enqueuedVacuumConditions=je,r.performVacuuming(e,a)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)},o.prototype.performVacuuming=function(e,t){return Ir(this,void 0,void 0,function(){var r,a,n,i,s,u,l,d,h,v,y,g,b,x,C,k,A,L,O,z,E,I,_,R,F;return Dr(this,function(c){switch(c.label){case 0:if(r=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];a=e.batchSize||We.batchSize,n=e.batchWait||We.batchWait,i=1,c.label=1;case 1:c.trys.push([1,7,8,9]),s=D(this._index),u=s.next(),c.label=2;case 2:if(u.done)return[3,6];l=W(u.value,2),d=l[0],h=l[1];try{for(v=(I=void 0,D(h)),y=v.next();!y.done;y=v.next()){g=W(y.value,2),b=g[0],x=g[1];try{for(C=(R=void 0,D(x)),k=C.next();!k.done;k=C.next())A=W(k.value,1),L=A[0],!this._documentIds.has(L)&&(x.size<=1?h.delete(b):x.delete(L))}catch(f){R={error:f}}finally{try{k&&!k.done&&(F=C.return)&&F.call(C)}finally{if(R)throw R.error}}}}catch(f){I={error:f}}finally{try{y&&!y.done&&(_=v.return)&&_.call(v)}finally{if(I)throw I.error}}return this._index.get(d).size===0&&this._index.delete(d),i%a!==0?[3,4]:[4,new Promise(function(f){return setTimeout(f,n)})];case 3:c.sent(),c.label=4;case 4:i+=1,c.label=5;case 5:return u=s.next(),[3,2];case 6:return[3,9];case 7:return O=c.sent(),z={error:O},[3,9];case 8:try{u&&!u.done&&(E=s.return)&&E.call(s)}finally{if(z)throw z.error}return[7];case 9:this._dirtCount-=r,c.label=10;case 10:return[4,null];case 11:return c.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},o.prototype.vacuumConditionsMet=function(e){if(e==null)return!0;var t=e.minDirtCount,r=e.minDirtFactor;return t=t||ze.minDirtCount,r=r||ze.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=r},Object.defineProperty(o.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),o.prototype.has=function(e){return this._idToShortId.has(e)},o.prototype.getStoredFields=function(e){var t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)},o.prototype.search=function(e,t){var r,a;t===void 0&&(t={});var n=this.executeQuery(e,t),i=[];try{for(var s=D(n),u=s.next();!u.done;u=s.next()){var l=W(u.value,2),d=l[0],h=l[1],v=h.score,y=h.terms,g=h.match,b=y.length||1,x={id:this._documentIds.get(d),score:v*b,terms:Object.keys(g),queryTerms:y,match:g};Object.assign(x,this._storedFields.get(d)),(t.filter==null||t.filter(x))&&i.push(x)}}catch(C){r={error:C}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}return e===o.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||i.sort(ht),i},o.prototype.autoSuggest=function(e,t){var r,a,n,i;t===void 0&&(t={}),t=B(B({},this._options.autoSuggestOptions),t);var s=new Map;try{for(var u=D(this.search(e,t)),l=u.next();!l.done;l=u.next()){var d=l.value,h=d.score,v=d.terms,y=v.join(" "),g=s.get(y);g!=null?(g.score+=h,g.count+=1):s.set(y,{score:h,terms:v,count:1})}}catch(O){r={error:O}}finally{try{l&&!l.done&&(a=u.return)&&a.call(u)}finally{if(r)throw r.error}}var b=[];try{for(var x=D(s),C=x.next();!C.done;C=x.next()){var k=W(C.value,2),g=k[0],A=k[1],h=A.score,v=A.terms,L=A.count;b.push({suggestion:g,terms:v,score:h/L})}}catch(O){n={error:O}}finally{try{C&&!C.done&&(i=x.return)&&i.call(x)}finally{if(n)throw n.error}}return b.sort(ht),b},Object.defineProperty(o.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),o.loadJSON=function(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)},o.getDefault=function(e){if(Pe.hasOwnProperty(e))return Le(Pe,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},o.loadJS=function(e,t){var r,a,n,i,s,u,l=e.index,d=e.documentCount,h=e.nextId,v=e.documentIds,y=e.fieldIds,g=e.fieldLength,b=e.averageFieldLength,x=e.storedFields,C=e.dirtCount,k=e.serializationVersion;if(k!==1&&k!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var A=new o(t);A._documentCount=d,A._nextId=h,A._documentIds=Ee(v),A._idToShortId=new Map,A._fieldIds=y,A._fieldLength=Ee(g),A._avgFieldLength=b,A._storedFields=Ee(x),A._dirtCount=C||0,A._index=new Re;try{for(var L=D(A._documentIds),O=L.next();!O.done;O=L.next()){var z=W(O.value,2),E=z[0],I=z[1];A._idToShortId.set(I,E)}}catch(m){r={error:m}}finally{try{O&&!O.done&&(a=L.return)&&a.call(L)}finally{if(r)throw r.error}}try{for(var _=D(l),R=_.next();!R.done;R=_.next()){var F=W(R.value,2),c=F[0],f=F[1],p=new Map;try{for(var N=(s=void 0,D(Object.keys(f))),T=N.next();!T.done;T=N.next()){var M=T.value,P=f[M];k===1&&(P=P.ds),p.set(parseInt(M,10),Ee(P))}}catch(m){s={error:m}}finally{try{T&&!T.done&&(u=N.return)&&u.call(N)}finally{if(s)throw s.error}}A._index.set(c,p)}}catch(m){n={error:m}}finally{try{R&&!R.done&&(i=_.return)&&i.call(_)}finally{if(n)throw n.error}}return A},o.prototype.executeQuery=function(e,t){var r=this;if(t===void 0&&(t={}),e===o.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){var a=B(B(B({},t),e),{queries:void 0}),n=e.queries.map(function(x){return r.executeQuery(x,a)});return this.combineResults(n,a.combineWith)}var i=this._options,s=i.tokenize,u=i.processTerm,l=i.searchOptions,d=B(B({tokenize:s,processTerm:u},l),t),h=d.tokenize,v=d.processTerm,y=h(e).flatMap(function(x){return v(x)}).filter(function(x){return!!x}),g=y.map(Vr(d)),b=g.map(function(x){return r.executeQuerySpec(x,d)});return this.combineResults(b,d.combineWith)},o.prototype.executeQuerySpec=function(e,t){var r,a,n,i,s=B(B({},this._options.searchOptions),t),u=(s.fields||this._options.fields).reduce(function(M,P){var m;return B(B({},M),(m={},m[P]=Le(s.boost,P)||1,m))},{}),l=s.boostDocument,d=s.weights,h=s.maxFuzzy,v=s.bm25,y=B(B({},ft.weights),d),g=y.fuzzy,b=y.prefix,x=this._index.get(e.term),C=this.termResults(e.term,e.term,1,x,u,l,v),k,A;if(e.prefix&&(k=this._index.atPrefix(e.term)),e.fuzzy){var L=e.fuzzy===!0?.2:e.fuzzy,O=L<1?Math.min(h,Math.round(e.term.length*L)):L;O&&(A=this._index.fuzzyGet(e.term,O))}if(k)try{for(var z=D(k),E=z.next();!E.done;E=z.next()){var I=W(E.value,2),_=I[0],R=I[1],F=_.length-e.term.length;if(F){A==null||A.delete(_);var c=b*_.length/(_.length+.3*F);this.termResults(e.term,_,c,R,u,l,v,C)}}}catch(M){r={error:M}}finally{try{E&&!E.done&&(a=z.return)&&a.call(z)}finally{if(r)throw r.error}}if(A)try{for(var f=D(A.keys()),p=f.next();!p.done;p=f.next()){var _=p.value,N=W(A.get(_),2),T=N[0],F=N[1];if(F){var c=g*_.length/(_.length+F);this.termResults(e.term,_,c,T,u,l,v,C)}}}catch(M){n={error:M}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}return C},o.prototype.executeWildcardQuery=function(e){var t,r,a=new Map,n=B(B({},this._options.searchOptions),e);try{for(var i=D(this._documentIds),s=i.next();!s.done;s=i.next()){var u=W(s.value,2),l=u[0],d=u[1],h=n.boostDocument?n.boostDocument(d,"",this._storedFields.get(l)):1;a.set(l,{score:h,terms:[],match:{}})}}catch(v){t={error:v}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return a},o.prototype.combineResults=function(e,t){if(t===void 0&&(t=Je),e.length===0)return new Map;var r=t.toLowerCase();return e.reduce(Pr[r])||new Map},o.prototype.toJSON=function(){var e,t,r,a,n=[];try{for(var i=D(this._index),s=i.next();!s.done;s=i.next()){var u=W(s.value,2),l=u[0],d=u[1],h={};try{for(var v=(r=void 0,D(d)),y=v.next();!y.done;y=v.next()){var g=W(y.value,2),b=g[0],x=g[1];h[b]=Object.fromEntries(x)}}catch(C){r={error:C}}finally{try{y&&!y.done&&(a=v.return)&&a.call(v)}finally{if(r)throw r.error}}n.push([l,h])}}catch(C){e={error:C}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:n,serializationVersion:2}},o.prototype.termResults=function(e,t,r,a,n,i,s,u){var l,d,h,v,y;if(u===void 0&&(u=new Map),a==null)return u;try{for(var g=D(Object.keys(n)),b=g.next();!b.done;b=g.next()){var x=b.value,C=n[x],k=this._fieldIds[x],A=a.get(k);if(A!=null){var L=A.size,O=this._avgFieldLength[k];try{for(var z=(h=void 0,D(A.keys())),E=z.next();!E.done;E=z.next()){var I=E.value;if(!this._documentIds.has(I)){this.removeTerm(k,I,t),L-=1;continue}var _=i?i(this._documentIds.get(I),t,this._storedFields.get(I)):1;if(_){var R=A.get(I),F=this._fieldLength.get(I)[k],c=Br(R,L,this._documentCount,F,O,s),f=r*C*_*c,p=u.get(I);if(p){p.score+=f,Wr(p.terms,e);var N=Le(p.match,t);N?N.push(x):p.match[t]=[x]}else u.set(I,{score:f,terms:[e],match:(y={},y[t]=[x],y)})}}}catch(T){h={error:T}}finally{try{E&&!E.done&&(v=z.return)&&v.call(z)}finally{if(h)throw h.error}}}}}catch(T){l={error:T}}finally{try{b&&!b.done&&(d=g.return)&&d.call(g)}finally{if(l)throw l.error}}return u},o.prototype.addTerm=function(e,t,r){var a=this._index.fetch(r,vt),n=a.get(e);if(n==null)n=new Map,n.set(t,1),a.set(e,n);else{var i=n.get(t);n.set(t,(i||0)+1)}},o.prototype.removeTerm=function(e,t,r){if(!this._index.has(r)){this.warnDocumentChanged(t,e,r);return}var a=this._index.fetch(r,vt),n=a.get(e);n==null||n.get(t)==null?this.warnDocumentChanged(t,e,r):n.get(t)<=1?n.size<=1?a.delete(e):n.delete(t):n.set(t,n.get(t)-1),this._index.get(r).size===0&&this._index.delete(r)},o.prototype.warnDocumentChanged=function(e,t,r){var a,n;try{for(var i=D(Object.keys(this._fieldIds)),s=i.next();!s.done;s=i.next()){var u=s.value;if(this._fieldIds[u]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(r,'" was not present in field "').concat(u,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(l){a={error:l}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}},o.prototype.addDocumentId=function(e){var t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},o.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},o.prototype.addFieldLength=function(e,t,r,a){var n=this._fieldLength.get(e);n==null&&this._fieldLength.set(e,n=[]),n[t]=a;var i=this._avgFieldLength[t]||0,s=i*r+a;this._avgFieldLength[t]=s/(r+1)},o.prototype.removeFieldLength=function(e,t,r,a){if(r===1){this._avgFieldLength[t]=0;return}var n=this._avgFieldLength[t]*r-a;this._avgFieldLength[t]=n/(r-1)},o.prototype.saveStoredFields=function(e,t){var r,a,n=this._options,i=n.storeFields,s=n.extractField;if(!(i==null||i.length===0)){var u=this._storedFields.get(e);u==null&&this._storedFields.set(e,u={});try{for(var l=D(i),d=l.next();!d.done;d=l.next()){var h=d.value,v=s(t,h);v!==void 0&&(u[h]=v)}}catch(y){r={error:y}}finally{try{d&&!d.done&&(a=l.return)&&a.call(l)}finally{if(r)throw r.error}}}},o.wildcard=Symbol("*"),o}(),Le=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)?o[e]:void 0},Pr=(me={},me[Je]=function(o,e){var t,r;try{for(var a=D(e.keys()),n=a.next();!n.done;n=a.next()){var i=n.value,s=o.get(i);if(s==null)o.set(i,e.get(i));else{var u=e.get(i),l=u.score,d=u.terms,h=u.match;s.score=s.score+l,s.match=Object.assign(s.match,h),dt(s.terms,d)}}}catch(v){t={error:v}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return o},me[kt]=function(o,e){var t,r,a=new Map;try{for(var n=D(e.keys()),i=n.next();!i.done;i=n.next()){var s=i.value,u=o.get(s);if(u!=null){var l=e.get(s),d=l.score,h=l.terms,v=l.match;dt(u.terms,h),a.set(s,{score:u.score+d,terms:u.terms,match:Object.assign(u.match,v)})}}}catch(y){t={error:y}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return a},me[Mr]=function(o,e){var t,r;try{for(var a=D(e.keys()),n=a.next();!n.done;n=a.next()){var i=n.value;o.delete(i)}}catch(s){t={error:s}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return o},me),zr={k:1.2,b:.7,d:.5},Br=function(o,e,t,r,a,n){var i=n.k,s=n.b,u=n.d,l=Math.log(1+(t-e+.5)/(e+.5));return l*(u+o*(i+1)/(o+i*(1-s+s*r/a)))},Vr=function(o){return function(e,t,r){var a=typeof o.fuzzy=="function"?o.fuzzy(e,t,r):o.fuzzy||!1,n=typeof o.prefix=="function"?o.prefix(e,t,r):o.prefix===!0;return{term:e,fuzzy:a,prefix:n}}},Pe={idField:"id",extractField:function(o,e){return o[e]},tokenize:function(o){return o.split(jr)},processTerm:function(o){return o.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[],logger:function(o,e){typeof(console==null?void 0:console[o])=="function"&&console[o](e)},autoVacuum:!0},ft={combineWith:Je,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:zr},$r={combineWith:kt,prefix:function(o,e,t){return e===t.length-1}},We={batchSize:1e3,batchWait:10},je={minDirtFactor:.1,minDirtCount:20},ze=B(B({},We),je),Wr=function(o,e){o.includes(e)||o.push(e)},dt=function(o,e){var t,r;try{for(var a=D(e),n=a.next();!n.done;n=a.next()){var i=n.value;o.includes(i)||o.push(i)}}catch(s){t={error:s}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}},ht=function(o,e){var t=o.score,r=e.score;return r-t},vt=function(){return new Map},Ee=function(o){var e,t,r=new Map;try{for(var a=D(Object.keys(o)),n=a.next();!n.done;n=a.next()){var i=n.value;r.set(parseInt(i,10),o[i])}}catch(s){e={error:s}}finally{try{n&&!n.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return r},jr=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;const Y=o=>(Ut("data-v-9cd6a060"),o=o(),Ht(),o),Kr=["aria-owns"],Jr={class:"shell"},Ur=["title"],Hr=Y(()=>S("svg",{class:"search-icon",width:"18",height:"18",viewBox:"0 0 24 24","aria-hidden":"true"},[S("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[S("circle",{cx:"11",cy:"11",r:"8"}),S("path",{d:"m21 21l-4.35-4.35"})])],-1)),Gr=[Hr],qr={class:"search-actions before"},Qr=["title"],Yr=Y(()=>S("svg",{width:"18",height:"18",viewBox:"0 0 24 24","aria-hidden":"true"},[S("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 12H5m7 7l-7-7l7-7"})],-1)),Zr=[Yr],Xr=["placeholder"],en={class:"search-actions"},tn=["title"],rn=Y(()=>S("svg",{width:"18",height:"18",viewBox:"0 0 24 24","aria-hidden":"true"},[S("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 14h7v7H3zM3 3h7v7H3zm11 1h7m-7 5h7m-7 6h7m-7 5h7"})],-1)),nn=[rn],an=["disabled","title"],on=Y(()=>S("svg",{width:"18",height:"18",viewBox:"0 0 24 24","aria-hidden":"true"},[S("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 5H9l-7 7l7 7h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2Zm-2 4l-6 6m0-6l6 6"})],-1)),sn=[on],un=["id","role","aria-labelledby"],ln=["aria-selected"],cn=["href","aria-label","onMouseenter","onFocusin"],fn={class:"titles"},dn=Y(()=>S("span",{class:"title-icon"},"#",-1)),hn=["innerHTML"],vn=Y(()=>S("svg",{width:"18",height:"18",viewBox:"0 0 24 24"},[S("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"})],-1)),pn={class:"title main"},mn=["innerHTML"],yn={key:0,class:"excerpt-wrapper"},gn={key:0,class:"excerpt",inert:""},bn=["innerHTML"],wn=Y(()=>S("div",{class:"excerpt-gradient-bottom"},null,-1)),xn=Y(()=>S("div",{class:"excerpt-gradient-top"},null,-1)),Fn={key:0,class:"no-results"},En={class:"search-keyboard-shortcuts"},Sn=["aria-label"],An=Y(()=>S("svg",{width:"14",height:"14",viewBox:"0 0 24 24"},[S("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 19V5m-7 7l7-7l7 7"})],-1)),Cn=[An],kn=["aria-label"],Tn=Y(()=>S("svg",{width:"14",height:"14",viewBox:"0 0 24 24"},[S("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 5v14m7-7l-7 7l-7-7"})],-1)),Nn=[Tn],In=["aria-label"],Dn=Y(()=>S("svg",{width:"14",height:"14",viewBox:"0 0 24 24"},[S("g",{fill:"none",stroke:"currentcolor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[S("path",{d:"m9 10l-5 5l5 5"}),S("path",{d:"M20 4v7a4 4 0 0 1-4 4H4"})])],-1)),_n=[Dn],On=["aria-label"],Rn=It({__name:"VPLocalSearchBox",props:{placeholder:{}},emits:["close"],setup(o,{emit:e}){var T,M,P;const t=e,r=be(),a=be(),n=be(er),i=Zt(),{activate:s}=kr(r,{immediate:!0,allowOutsideClick:!0,clickOutsideDeactivates:!0,escapeDeactivates:!0}),{localeIndex:u,theme:l}=i,d=et(async()=>{var m,w,V,q,J,U,$,H,G;return at(Lr.loadJSON((V=await((w=(m=n.value)[u.value])==null?void 0:w.call(m)))==null?void 0:V.default,{fields:["title","titles","text"],storeFields:["title","titles"],searchOptions:{fuzzy:.2,prefix:!0,boost:{title:4,text:2,titles:1},...((q=l.value.search)==null?void 0:q.provider)==="local"&&((U=(J=l.value.search.options)==null?void 0:J.miniSearch)==null?void 0:U.searchOptions)},...(($=l.value.search)==null?void 0:$.provider)==="local"&&((G=(H=l.value.search.options)==null?void 0:H.miniSearch)==null?void 0:G.options)}))}),v=Ie(()=>{var m,w;return((m=l.value.search)==null?void 0:m.provider)==="local"&&((w=l.value.search.options)==null?void 0:w.disableQueryPersistence)===!0}).value?ie(""):Dt("vitepress:local-search-filter",""),y=_t("vitepress:local-search-detailed-list",((T=l.value.search)==null?void 0:T.provider)==="local"&&((M=l.value.search.options)==null?void 0:M.detailedView)===!0),g=Ie(()=>{var m,w,V;return((m=l.value.search)==null?void 0:m.provider)==="local"&&(((w=l.value.search.options)==null?void 0:w.disableDetailedView)===!0||((V=l.value.search.options)==null?void 0:V.detailedView)===!1)});Ot(()=>{g.value&&(y.value=!1)});const b=be([]),x=ie(!1);Be(v,()=>{x.value=!1});const C=et(async()=>{if(a.value)return at(new Nr(a.value))},null);Rt(()=>[d.value,v.value,y.value],async([m,w,V],q,J)=>{var Ue,He,Ge,qe;let U=!1;if(J(()=>{U=!0}),!m)return;b.value=m.search(w).slice(0,16),x.value=!0;const $=V?await Promise.all(b.value.map(Q=>k(Q.id))):[];if(U)return;const H=new Map;for(const{id:Q,mod:re}of $){const ne=Q.slice(0,Q.indexOf("#"));let ee=H.get(ne);if(ee)continue;ee=new Map,H.set(ne,ee);const Z=re.default??re;if(Z!=null&&Z.render||Z!=null&&Z.setup){const ae=Gt(Z);ae.config.warnHandler=()=>{},ae.provide(qt,i),Object.defineProperties(ae.config.globalProperties,{$frontmatter:{get(){return i.frontmatter.value}},$params:{get(){return i.page.value.params}}});const Qe=document.createElement("div");ae.mount(Qe),Qe.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(fe=>{var Xe;const ge=(Xe=fe.querySelector("a"))==null?void 0:Xe.getAttribute("href"),Ye=(ge==null?void 0:ge.startsWith("#"))&&ge.slice(1);if(!Ye)return;let Ze="";for(;(fe=fe.nextElementSibling)&&!/^h[1-6]$/i.test(fe.tagName);)Ze+=fe.outerHTML;ee.set(Ye,Ze)}),ae.unmount()}if(U)return}const G=new Set;if(b.value=b.value.map(Q=>{const[re,ne]=Q.id.split("#"),ee=H.get(re),Z=(ee==null?void 0:ee.get(ne))??"";for(const ae in Q.match)G.add(ae);return{...Q,text:Z}}),await de(),U)return;await new Promise(Q=>{var re;(re=C.value)==null||re.unmark({done:()=>{var ne;(ne=C.value)==null||ne.markRegExp(N(G),{done:Q})}})});const Ne=((Ue=r.value)==null?void 0:Ue.querySelectorAll(".result .excerpt"))??[];for(const Q of Ne)(He=Q.querySelector('mark[data-markjs="true"]'))==null||He.scrollIntoView({block:"center"});(qe=(Ge=a.value)==null?void 0:Ge.firstElementChild)==null||qe.scrollIntoView({block:"start"})},{debounce:200,immediate:!0});async function k(m){const w=Qt(m.slice(0,m.indexOf("#")));try{if(!w)throw new Error(`Cannot find file for id: ${m}`);return{id:m,mod:await pt(()=>import(w),[])}}catch(V){return console.error(V),{id:m,mod:{}}}}const A=ie(),L=Ie(()=>{var m;return((m=v.value)==null?void 0:m.length)<=0});function O(m=!0){var w,V;(w=A.value)==null||w.focus(),m&&((V=A.value)==null||V.select())}De(()=>{O()});function z(m){m.pointerType==="mouse"&&O()}const E=ie(-1),I=ie(!1);Be(b,m=>{E.value=m.length?0:-1,_()});function _(){de(()=>{const m=document.querySelector(".result.selected");m&&m.scrollIntoView({block:"nearest"})})}we("ArrowUp",m=>{m.preventDefault(),E.value--,E.value<0&&(E.value=b.value.length-1),I.value=!0,_()}),we("ArrowDown",m=>{m.preventDefault(),E.value++,E.value>=b.value.length&&(E.value=0),I.value=!0,_()});const R=Mt();we("Enter",m=>{if(m.target instanceof HTMLButtonElement&&m.target.type!=="submit")return;const w=b.value[E.value];if(m.target instanceof HTMLInputElement&&!w){m.preventDefault();return}w&&(R.go(w.id),t("close"))}),we("Escape",()=>{t("close")});const F={modal:{displayDetails:"Display detailed list",resetButtonTitle:"Reset search",backButtonTitle:"Close search",noResultsText:"No results for",footer:{selectText:"to select",selectKeyAriaLabel:"enter",navigateText:"to navigate",navigateUpKeyAriaLabel:"up arrow",navigateDownKeyAriaLabel:"down arrow",closeText:"to close",closeKeyAriaLabel:"escape"}}},c=Xt((P=l.value.search)==null?void 0:P.options,F);De(()=>{window.history.pushState(null,"",null)}),Lt("popstate",m=>{m.preventDefault(),t("close")});const f=Pt(zt?document.body:null);De(()=>{de(()=>{f.value=!0,de().then(()=>s())})}),Bt(()=>{f.value=!1});function p(){v.value="",de().then(()=>O(!1))}function N(m){return new RegExp([...m].sort((w,V)=>V.length-w.length).map(w=>`(${w.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")})`).join("|"),"gi")}return(m,w)=>{var V,q,J,U;return X(),Vt(Jt,{to:"body"},[S("div",{ref_key:"el",ref:r,role:"button","aria-owns":(V=b.value)!=null&&V.length?"localsearch-list":void 0,"aria-expanded":"true","aria-haspopup":"listbox","aria-labelledby":"localsearch-label",class:"VPLocalSearchBox"},[S("div",{class:"backdrop",onClick:w[0]||(w[0]=$=>m.$emit("close"))}),S("div",Jr,[S("form",{class:"search-bar",onPointerup:w[4]||(w[4]=$=>z($)),onSubmit:w[5]||(w[5]=$t(()=>{},["prevent"]))},[S("label",{title:m.placeholder,id:"localsearch-label",for:"localsearch-input"},Gr,8,Ur),S("div",qr,[S("button",{class:"back-button",title:j(c)("modal.backButtonTitle"),onClick:w[1]||(w[1]=$=>m.$emit("close"))},Zr,8,Qr)]),Wt(S("input",{ref_key:"searchInput",ref:A,"onUpdate:modelValue":w[2]||(w[2]=$=>Kt(v)?v.value=$:null),placeholder:m.placeholder,id:"localsearch-input","aria-labelledby":"localsearch-label",class:"search-input"},null,8,Xr),[[jt,j(v)]]),S("div",en,[g.value?xe("",!0):(X(),te("button",{key:0,class:tt(["toggle-layout-button",{"detailed-list":j(y)}]),type:"button",title:j(c)("modal.displayDetails"),onClick:w[3]||(w[3]=$=>E.value>-1&&(y.value=!j(y)))},nn,10,tn)),S("button",{class:"clear-button",type:"reset",disabled:L.value,title:j(c)("modal.resetButtonTitle"),onClick:p},sn,8,an)])],32),S("ul",{ref_key:"resultsEl",ref:a,id:(q=b.value)!=null&&q.length?"localsearch-list":void 0,role:(J=b.value)!=null&&J.length?"listbox":void 0,"aria-labelledby":(U=b.value)!=null&&U.length?"localsearch-label":void 0,class:"results",onMousemove:w[7]||(w[7]=$=>I.value=!1)},[(X(!0),te(nt,null,rt(b.value,($,H)=>(X(),te("li",{key:$.id,role:"option","aria-selected":E.value===H?"true":"false"},[S("a",{href:$.id,class:tt(["result",{selected:E.value===H}]),"aria-label":[...$.titles,$.title].join(" > "),onMouseenter:G=>!I.value&&(E.value=H),onFocusin:G=>E.value=H,onClick:w[6]||(w[6]=G=>m.$emit("close"))},[S("div",null,[S("div",fn,[dn,(X(!0),te(nt,null,rt($.titles,(G,Ne)=>(X(),te("span",{key:Ne,class:"title"},[S("span",{class:"text",innerHTML:G},null,8,hn),vn]))),128)),S("span",pn,[S("span",{class:"text",innerHTML:$.title},null,8,mn)])]),j(y)?(X(),te("div",yn,[$.text?(X(),te("div",gn,[S("div",{class:"vp-doc",innerHTML:$.text},null,8,bn)])):xe("",!0),wn,xn])):xe("",!0)])],42,cn)],8,ln))),128)),j(v)&&!b.value.length&&x.value?(X(),te("li",Fn,[he(ve(j(c)("modal.noResultsText"))+' "',1),S("strong",null,ve(j(v)),1),he('" ')])):xe("",!0)],40,un),S("div",En,[S("span",null,[S("kbd",{"aria-label":j(c)("modal.footer.navigateUpKeyAriaLabel")},Cn,8,Sn),S("kbd",{"aria-label":j(c)("modal.footer.navigateDownKeyAriaLabel")},Nn,8,kn),he(" "+ve(j(c)("modal.footer.navigateText")),1)]),S("span",null,[S("kbd",{"aria-label":j(c)("modal.footer.selectKeyAriaLabel")},_n,8,In),he(" "+ve(j(c)("modal.footer.selectText")),1)]),S("span",null,[S("kbd",{"aria-label":j(c)("modal.footer.closeKeyAriaLabel")},"esc",8,On),he(" "+ve(j(c)("modal.footer.closeText")),1)])])])],8,Kr)])}}});const Bn=Yt(Rn,[["__scopeId","data-v-9cd6a060"]]);export{Bn as default};
|