mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
10 lines
62 KiB
JavaScript
10 lines
62 KiB
JavaScript
var At=Object.defineProperty;var Ct=(a,e,t)=>e in a?At(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var Me=(a,e,t)=>Ct(a,typeof e!="symbol"?e+"":e,t);import{V as nt,q as Be,ah as Mt,h as be,ai as rt,aj as Lt,ak as Dt,al as Pt,G as ce,d as zt,am as it,p as he,an as Vt,ao as jt,s as $t,ap as Bt,v as Le,P as ve,O as _e,aq as Wt,ar as Kt,W as Jt,R as qt,$ as Ut,o as q,b as Ht,j as T,a0 as Gt,k as P,as as Qt,at as Yt,au as Zt,c as Q,n as st,e as xe,B as at,F as ot,a as pe,t as me,av as Xt,aw as lt,ax as en,a5 as tn,aa as nn,ay as rn,_ as sn}from"./framework.DEqXEGcv.js";import{u as an,c as on}from"./theme.DcdcgJt5.js";const ln={root:()=>nt(()=>import("./@localSearchIndexroot.DEoGPlWF.js"),[]),zh:()=>nt(()=>import("./@localSearchIndexzh.dDuBvO1t.js"),[])};/*!
|
|
* tabbable 6.4.0
|
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
*/var bt=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ke=bt.join(","),yt=typeof Element>"u",ae=yt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ne=!yt&&Element.prototype.getRootNode?function(a){var e;return a==null||(e=a.getRootNode)===null||e===void 0?void 0:e.call(a)}:function(a){return a==null?void 0:a.ownerDocument},Fe=function(e,t){var n;t===void 0&&(t=!0);var r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"inert"),s=r===""||r==="true",i=s||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):Fe(e.parentNode));return i},cn=function(e){var t,n=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return n===""||n==="true"},wt=function(e,t,n){if(Fe(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ke));return t&&ae.call(e,ke)&&r.unshift(e),r=r.filter(n),r},Re=function(e,t,n){for(var r=[],s=Array.from(e);s.length;){var i=s.shift();if(!Fe(i,!1))if(i.tagName==="SLOT"){var o=i.assignedElements(),l=o.length?o:i.children,c=Re(l,!0,n);n.flatten?r.push.apply(r,c):r.push({scopeParent:i,candidates:c})}else{var h=ae.call(i,ke);h&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var m=i.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(i),p=!Fe(m,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(m&&p){var b=Re(m===!0?i.children:m.children,!0,n);n.flatten?r.push.apply(r,b):r.push({scopeParent:i,candidates:b})}else s.unshift.apply(s,i.children)}}return r},St=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},se=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||cn(e))&&!St(e)?0:e.tabIndex},un=function(e,t){var n=se(e);return n<0&&t&&!St(e)?0:n},dn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},_t=function(e){return e.tagName==="INPUT"},fn=function(e){return _t(e)&&e.type==="hidden"},hn=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(n){return n.tagName==="SUMMARY"});return t},vn=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},pn=function(e){if(!e.name)return!0;var t=e.form||Ne(e),n=function(o){return t.querySelectorAll('input[type="radio"][name="'+o+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=n(window.CSS.escape(e.name));else try{r=n(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 s=vn(r,e.form);return!s||s===e},mn=function(e){return _t(e)&&e.type==="radio"},gn=function(e){return mn(e)&&!pn(e)},bn=function(e){var t,n=e&&Ne(e),r=(t=n)===null||t===void 0?void 0:t.host,s=!1;if(n&&n!==e){var i,o,l;for(s=!!((i=r)!==null&&i!==void 0&&(o=i.ownerDocument)!==null&&o!==void 0&&o.contains(r)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!s&&r;){var c,h,m;n=Ne(r),r=(c=n)===null||c===void 0?void 0:c.host,s=!!((h=r)!==null&&h!==void 0&&(m=h.ownerDocument)!==null&&m!==void 0&&m.contains(r))}}return s},ct=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},yn=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n==="full-native"&&"checkVisibility"in e){var s=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(e).visibility==="hidden")return!0;var i=ae.call(e,"details>summary:first-of-type"),o=i?e.parentElement:e;if(ae.call(o,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="full-native"||n==="legacy-full"){if(typeof r=="function"){for(var l=e;e;){var c=e.parentElement,h=Ne(e);if(c&&!c.shadowRoot&&r(c)===!0)return ct(e);e.assignedSlot?e=e.assignedSlot:!c&&h!==e.ownerDocument?e=h.host:e=c}e=l}if(bn(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return ct(e);return!1},wn=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName==="LEGEND")return ae.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Oe=function(e,t){return!(t.disabled||fn(t)||yn(t,e)||hn(t)||wn(t))},We=function(e,t){return!(gn(t)||se(t)<0||!Oe(e,t))},Sn=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},xt=function(e){var t=[],n=[];return e.forEach(function(r,s){var i=!!r.scopeParent,o=i?r.scopeParent:r,l=un(o,i),c=i?xt(r.candidates):o;l===0?i?t.push.apply(t,c):t.push(o):n.push({documentOrder:s,tabIndex:l,item:r,isScope:i,content:c})}),n.sort(dn).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(t)},_n=function(e,t){t=t||{};var n;return t.getShadowRoot?n=Re([e],t.includeContainer,{filter:We.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Sn}):n=wt(e,t.includeContainer,We.bind(null,t)),xt(n)},xn=function(e,t){t=t||{};var n;return t.getShadowRoot?n=Re([e],t.includeContainer,{filter:Oe.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):n=wt(e,t.includeContainer,Oe.bind(null,t)),n},oe=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return ae.call(e,ke)===!1?!1:We(t,e)},Tn=bt.concat("iframe:not([inert]):not([inert] *)").join(","),De=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return ae.call(e,Tn)===!1?!1:Oe(t,e)};/*!
|
|
* focus-trap 7.8.0
|
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
*/function Ke(a,e){(e==null||e>a.length)&&(e=a.length);for(var t=0,n=Array(e);t<e;t++)n[t]=a[t];return n}function En(a){if(Array.isArray(a))return Ke(a)}function ut(a,e){var t=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(!t){if(Array.isArray(a)||(t=Tt(a))||e){t&&(a=t);var n=0,r=function(){};return{s:r,n:function(){return n>=a.length?{done:!0}:{done:!1,value:a[n++]}},e:function(l){throw l},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,i=!0,o=!1;return{s:function(){t=t.call(a)},n:function(){var l=t.next();return i=l.done,l},e:function(l){o=!0,s=l},f:function(){try{i||t.return==null||t.return()}finally{if(o)throw s}}}}function In(a,e,t){return(e=On(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function kn(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function Nn(){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 dt(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),t.push.apply(t,n)}return t}function ft(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dt(Object(t),!0).forEach(function(n){In(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):dt(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function Fn(a){return En(a)||kn(a)||Tt(a)||Nn()}function Rn(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function On(a){var e=Rn(a,"string");return typeof e=="symbol"?e:e+""}function Tt(a,e){if(a){if(typeof a=="string")return Ke(a,e);var t={}.toString.call(a).slice(8,-1);return t==="Object"&&a.constructor&&(t=a.constructor.name),t==="Map"||t==="Set"?Array.from(a):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ke(a,e):void 0}}var U={getActiveTrap:function(e){return(e==null?void 0:e.length)>0?e[e.length-1]:null},activateTrap:function(e,t){var n=U.getActiveTrap(e);t!==n&&U.pauseTrap(e);var r=e.indexOf(t);r===-1||e.splice(r,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),U.unpauseTrap(e)},pauseTrap:function(e){var t=U.getActiveTrap(e);t==null||t._setPausedState(!0)},unpauseTrap:function(e){var t=U.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},An=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},Cn=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},Mn=function(e){return ye(e)&&!e.shiftKey},Ln=function(e){return ye(e)&&e.shiftKey},ht=function(e){return setTimeout(e,0)},ge=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return typeof e=="function"?e.apply(void 0,n):e},Te=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},Dn=[],Pn=function(e,t){var n=(t==null?void 0:t.document)||document,r=(t==null?void 0:t.trapStack)||Dn,s=ft({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:Mn,isKeyBackward:Ln},t),i={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,l=function(u,f,g){return u&&u[f]!==void 0?u[f]:s[g||f]},c=function(u,f){var g=typeof(f==null?void 0:f.composedPath)=="function"?f.composedPath():void 0;return i.containerGroups.findIndex(function(E){var x=E.container,I=E.tabbableNodes;return x.contains(u)||(g==null?void 0:g.includes(x))||I.find(function(S){return S===u})})},h=function(u){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=f.hasFallback,E=g===void 0?!1:g,x=f.params,I=x===void 0?[]:x,S=s[u];if(typeof S=="function"&&(S=S.apply(void 0,Fn(I))),S===!0&&(S=void 0),!S){if(S===void 0||S===!1)return S;throw new Error("`".concat(u,"` was specified but was not a node, or did not return a node"))}var v=S;if(typeof S=="string"){try{v=n.querySelector(S)}catch(d){throw new Error("`".concat(u,'` appears to be an invalid selector; error="').concat(d.message,'"'))}if(!v&&!E)throw new Error("`".concat(u,"` as selector refers to no known node"))}return v},m=function(){var u=h("initialFocus",{hasFallback:!0});if(u===!1)return!1;if(u===void 0||u&&!De(u,s.tabbableOptions))if(c(n.activeElement)>=0)u=n.activeElement;else{var f=i.tabbableGroups[0],g=f&&f.firstTabbableNode;u=g||h("fallbackFocus")}else u===null&&(u=h("fallbackFocus"));if(!u)throw new Error("Your focus-trap needs to have at least one focusable element");return u},p=function(){if(i.containerGroups=i.containers.map(function(u){var f=_n(u,s.tabbableOptions),g=xn(u,s.tabbableOptions),E=f.length>0?f[0]:void 0,x=f.length>0?f[f.length-1]:void 0,I=g.find(function(d){return oe(d)}),S=g.slice().reverse().find(function(d){return oe(d)}),v=!!f.find(function(d){return se(d)>0});return{container:u,tabbableNodes:f,focusableNodes:g,posTabIndexesFound:v,firstTabbableNode:E,lastTabbableNode:x,firstDomTabbableNode:I,lastDomTabbableNode:S,nextTabbableNode:function(_){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,A=f.indexOf(_);return A<0?R?g.slice(g.indexOf(_)+1).find(function(C){return oe(C)}):g.slice(0,g.indexOf(_)).reverse().find(function(C){return oe(C)}):f[A+(R?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(u){return u.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!h("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(u){return u.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.")},b=function(u){var f=u.activeElement;if(f)return f.shadowRoot&&f.shadowRoot.activeElement!==null?b(f.shadowRoot):f},w=function(u){if(u!==!1&&u!==b(document)){if(!u||!u.focus){w(m());return}u.focus({preventScroll:!!s.preventScroll}),i.mostRecentlyFocusedNode=u,An(u)&&u.select()}},k=function(u){var f=h("setReturnFocus",{params:[u]});return f||(f===!1?!1:u)},y=function(u){var f=u.target,g=u.event,E=u.isBackward,x=E===void 0?!1:E;f=f||Te(g),p();var I=null;if(i.tabbableGroups.length>0){var S=c(f,g),v=S>=0?i.containerGroups[S]:void 0;if(S<0)x?I=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:I=i.tabbableGroups[0].firstTabbableNode;else if(x){var d=i.tabbableGroups.findIndex(function(F){var V=F.firstTabbableNode;return f===V});if(d<0&&(v.container===f||De(f,s.tabbableOptions)&&!oe(f,s.tabbableOptions)&&!v.nextTabbableNode(f,!1))&&(d=S),d>=0){var _=d===0?i.tabbableGroups.length-1:d-1,R=i.tabbableGroups[_];I=se(f)>=0?R.lastTabbableNode:R.lastDomTabbableNode}else ye(g)||(I=v.nextTabbableNode(f,!1))}else{var A=i.tabbableGroups.findIndex(function(F){var V=F.lastTabbableNode;return f===V});if(A<0&&(v.container===f||De(f,s.tabbableOptions)&&!oe(f,s.tabbableOptions)&&!v.nextTabbableNode(f))&&(A=S),A>=0){var C=A===i.tabbableGroups.length-1?0:A+1,D=i.tabbableGroups[C];I=se(f)>=0?D.firstTabbableNode:D.firstDomTabbableNode}else ye(g)||(I=v.nextTabbableNode(f))}}else I=h("fallbackFocus");return I},O=function(u){var f=Te(u);if(!(c(f,u)>=0)){if(ge(s.clickOutsideDeactivates,u)){o.deactivate({returnFocus:s.returnFocusOnDeactivate});return}ge(s.allowOutsideClick,u)||u.preventDefault()}},L=function(u){var f=Te(u),g=c(f,u)>=0;if(g||f instanceof Document)g&&(i.mostRecentlyFocusedNode=f);else{u.stopImmediatePropagation();var E,x=!0;if(i.mostRecentlyFocusedNode)if(se(i.mostRecentlyFocusedNode)>0){var I=c(i.mostRecentlyFocusedNode),S=i.containerGroups[I].tabbableNodes;if(S.length>0){var v=S.findIndex(function(d){return d===i.mostRecentlyFocusedNode});v>=0&&(s.isKeyForward(i.recentNavEvent)?v+1<S.length&&(E=S[v+1],x=!1):v-1>=0&&(E=S[v-1],x=!1))}}else i.containerGroups.some(function(d){return d.tabbableNodes.some(function(_){return se(_)>0})})||(x=!1);else x=!1;x&&(E=y({target:i.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(i.recentNavEvent)})),w(E||i.mostRecentlyFocusedNode||m())}i.recentNavEvent=void 0},K=function(u){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=u;var g=y({event:u,isBackward:f});g&&(ye(u)&&u.preventDefault(),w(g))},H=function(u){(s.isKeyForward(u)||s.isKeyBackward(u))&&K(u,s.isKeyBackward(u))},W=function(u){Cn(u)&&ge(s.escapeDeactivates,u)!==!1&&(u.preventDefault(),o.deactivate())},j=function(u){var f=Te(u);c(f,u)>=0||ge(s.clickOutsideDeactivates,u)||ge(s.allowOutsideClick,u)||(u.preventDefault(),u.stopImmediatePropagation())},$=function(){if(i.active)return U.activateTrap(r,o),i.delayInitialFocusTimer=s.delayInitialFocus?ht(function(){w(m())}):w(m()),n.addEventListener("focusin",L,!0),n.addEventListener("mousedown",O,{capture:!0,passive:!1}),n.addEventListener("touchstart",O,{capture:!0,passive:!1}),n.addEventListener("click",j,{capture:!0,passive:!1}),n.addEventListener("keydown",H,{capture:!0,passive:!1}),n.addEventListener("keydown",W),o},Ce=function(u){i.active&&!i.paused&&o._setSubtreeIsolation(!1),i.adjacentElements.clear(),i.alreadySilent.clear();var f=new Set,g=new Set,E=ut(u),x;try{for(E.s();!(x=E.n()).done;){var I=x.value;f.add(I);for(var S=typeof ShadowRoot<"u"&&I.getRootNode()instanceof ShadowRoot,v=I;v;){f.add(v);var d=v.parentElement,_=[];d?_=d.children:!d&&S&&(_=v.getRootNode().children,d=v.getRootNode().host,S=typeof ShadowRoot<"u"&&d.getRootNode()instanceof ShadowRoot);var R=ut(_),A;try{for(R.s();!(A=R.n()).done;){var C=A.value;g.add(C)}}catch(D){R.e(D)}finally{R.f()}v=d}}}catch(D){E.e(D)}finally{E.f()}f.forEach(function(D){g.delete(D)}),i.adjacentElements=g},M=function(){if(i.active)return n.removeEventListener("focusin",L,!0),n.removeEventListener("mousedown",O,!0),n.removeEventListener("touchstart",O,!0),n.removeEventListener("click",j,!0),n.removeEventListener("keydown",H,!0),n.removeEventListener("keydown",W),o},Z=function(u){var f=u.some(function(g){var E=Array.from(g.removedNodes);return E.some(function(x){return x===i.mostRecentlyFocusedNode})});f&&w(m())},X=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(Z):void 0,ee=function(){X&&(X.disconnect(),i.active&&!i.paused&&i.containers.map(function(u){X.observe(u,{subtree:!0,childList:!0})}))};return o={get active(){return i.active},get paused(){return i.paused},activate:function(u){if(i.active)return this;var f=l(u,"onActivate"),g=l(u,"onPostActivate"),E=l(u,"checkCanFocusTrap"),x=U.getActiveTrap(r),I=!1;if(x&&!x.paused){var S;(S=x._setSubtreeIsolation)===null||S===void 0||S.call(x,!1),I=!0}try{E||p(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=b(n),f==null||f();var v=function(){E&&p(),$(),ee(),s.isolateSubtrees&&o._setSubtreeIsolation(!0),g==null||g()};if(E)return E(i.containers.concat()).then(v,v),this;v()}catch(_){if(x===U.getActiveTrap(r)&&I){var d;(d=x._setSubtreeIsolation)===null||d===void 0||d.call(x,!0)}throw _}return this},deactivate:function(u){if(!i.active)return this;var f=ft({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},u);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,i.paused||o._setSubtreeIsolation(!1),i.alreadySilent.clear(),M(),i.active=!1,i.paused=!1,ee(),U.deactivateTrap(r,o);var g=l(f,"onDeactivate"),E=l(f,"onPostDeactivate"),x=l(f,"checkCanReturnFocus"),I=l(f,"returnFocus","returnFocusOnDeactivate");g==null||g();var S=function(){ht(function(){I&&w(k(i.nodeFocusedBeforeActivation)),E==null||E()})};return I&&x?(x(k(i.nodeFocusedBeforeActivation)).then(S,S),this):(S(),this)},pause:function(u){return i.active?(i.manuallyPaused=!0,this._setPausedState(!0,u)):this},unpause:function(u){return i.active?(i.manuallyPaused=!1,r[r.length-1]!==this?this:this._setPausedState(!1,u)):this},updateContainerElements:function(u){var f=[].concat(u).filter(Boolean);return i.containers=f.map(function(g){return typeof g=="string"?n.querySelector(g):g}),s.isolateSubtrees&&Ce(i.containers),i.active&&(p(),s.isolateSubtrees&&!i.paused&&o._setSubtreeIsolation(!0)),ee(),this}},Object.defineProperties(o,{_isManuallyPaused:{value:function(){return i.manuallyPaused}},_setPausedState:{value:function(u,f){if(i.paused===u)return this;if(i.paused=u,u){var g=l(f,"onPause"),E=l(f,"onPostPause");g==null||g(),M(),ee(),o._setSubtreeIsolation(!1),E==null||E()}else{var x=l(f,"onUnpause"),I=l(f,"onPostUnpause");x==null||x(),o._setSubtreeIsolation(!0),p(),$(),ee(),I==null||I()}return this}},_setSubtreeIsolation:{value:function(u){s.isolateSubtrees&&i.adjacentElements.forEach(function(f){var g;if(u)switch(s.isolateSubtrees){case"aria-hidden":(f.ariaHidden==="true"||((g=f.getAttribute("aria-hidden"))===null||g===void 0?void 0:g.toLowerCase())==="true")&&i.alreadySilent.add(f),f.setAttribute("aria-hidden","true");break;default:(f.inert||f.hasAttribute("inert"))&&i.alreadySilent.add(f),f.setAttribute("inert",!0);break}else if(!i.alreadySilent.has(f))switch(s.isolateSubtrees){case"aria-hidden":f.removeAttribute("aria-hidden");break;default:f.removeAttribute("inert");break}})}}}),o.updateContainerElements(e),o};function zn(a,e={}){let t;const{immediate:n,...r}=e,s=ce(!1),i=ce(!1),o=p=>t&&t.activate(p),l=p=>t&&t.deactivate(p),c=()=>{t&&(t.pause(),i.value=!0)},h=()=>{t&&(t.unpause(),i.value=!1)},m=be(()=>{const p=rt(a);return Lt(p).map(b=>{const w=rt(b);return typeof w=="string"?w:Dt(w)}).filter(Pt)});return Be(m,p=>{p.length&&(t=Pn(p,{...r,onActivate(){s.value=!0,e.onActivate&&e.onActivate()},onDeactivate(){s.value=!1,e.onDeactivate&&e.onDeactivate()}}),n&&o())},{flush:"post"}),Mt(()=>l()),{hasFocus:s,isPaused:i,activate:o,deactivate:l,pause:c,unpause:h}}class ue{constructor(e,t=!0,n=[],r=5e3){this.ctx=e,this.iframes=t,this.exclude=n,this.iframesTimeout=r}static matches(e,t){const n=typeof t=="string"?[t]:t,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(r){let s=!1;return n.every(i=>r.call(e,i)?(s=!0,!1):!0),s}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(n=>{const r=t.filter(s=>s.contains(n)).length>0;t.indexOf(n)===-1&&!r&&t.push(n)}),t}getIframeContents(e,t,n=()=>{}){let r;try{const s=e.contentWindow;if(r=s.document,!s||!r)throw new Error("iframe inaccessible")}catch{n()}r&&t(r)}isIframeBlank(e){const t="about:blank",n=e.getAttribute("src").trim();return e.contentWindow.location.href===t&&n!==t&&n}observeIframeLoad(e,t,n){let r=!1,s=null;const i=()=>{if(!r){r=!0,clearTimeout(s);try{this.isIframeBlank(e)||(e.removeEventListener("load",i),this.getIframeContents(e,t,n))}catch{n()}}};e.addEventListener("load",i),s=setTimeout(i,this.iframesTimeout)}onIframeReady(e,t,n){try{e.contentWindow.document.readyState==="complete"?this.isIframeBlank(e)?this.observeIframeLoad(e,t,n):this.getIframeContents(e,t,n):this.observeIframeLoad(e,t,n)}catch{n()}}waitForIframes(e,t){let n=0;this.forEachIframe(e,()=>!0,r=>{n++,this.waitForIframes(r.querySelector("html"),()=>{--n||t()})},r=>{r||t()})}forEachIframe(e,t,n,r=()=>{}){let s=e.querySelectorAll("iframe"),i=s.length,o=0;s=Array.prototype.slice.call(s);const l=()=>{--i<=0&&r(o)};i||l(),s.forEach(c=>{ue.matches(c,this.exclude)?l():this.onIframeReady(c,h=>{t(c)&&(o++,n(h)),l()},l)})}createIterator(e,t,n){return document.createNodeIterator(e,t,n,!1)}createInstanceOnIframe(e){return new ue(e.querySelector("html"),this.iframes)}compareNodeIframe(e,t,n){const r=e.compareDocumentPosition(n),s=Node.DOCUMENT_POSITION_PRECEDING;if(r&s)if(t!==null){const i=t.compareDocumentPosition(n),o=Node.DOCUMENT_POSITION_FOLLOWING;if(i&o)return!0}else return!0;return!1}getIteratorNode(e){const t=e.previousNode();let n;return t===null?n=e.nextNode():n=e.nextNode()&&e.nextNode(),{prevNode:t,node:n}}checkIframeFilter(e,t,n,r){let s=!1,i=!1;return r.forEach((o,l)=>{o.val===n&&(s=l,i=o.handled)}),this.compareNodeIframe(e,t,n)?(s===!1&&!i?r.push({val:n,handled:!0}):s!==!1&&!i&&(r[s].handled=!0),!0):(s===!1&&r.push({val:n,handled:!1}),!1)}handleOpenIframes(e,t,n,r){e.forEach(s=>{s.handled||this.getIframeContents(s.val,i=>{this.createInstanceOnIframe(i).forEachNode(t,n,r)})})}iterateThroughNodes(e,t,n,r,s){const i=this.createIterator(t,e,r);let o=[],l=[],c,h,m=()=>({prevNode:h,node:c}=this.getIteratorNode(i),c);for(;m();)this.iframes&&this.forEachIframe(t,p=>this.checkIframeFilter(c,h,p,o),p=>{this.createInstanceOnIframe(p).forEachNode(e,b=>l.push(b),r)}),l.push(c);l.forEach(p=>{n(p)}),this.iframes&&this.handleOpenIframes(o,e,n,r),s()}forEachNode(e,t,n,r=()=>{}){const s=this.getContexts();let i=s.length;i||r(),s.forEach(o=>{const l=()=>{this.iterateThroughNodes(e,o,t,n,()=>{--i<=0&&r()})};this.iframes?this.waitForIframes(o,l):l()})}}let Vn=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 ue(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}log(e,t="debug"){const n=this.opt.log;this.opt.debug&&typeof n=="object"&&typeof n[t]=="function"&&n[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,n=this.opt.caseSensitive?"":"i",r=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(let s in t)if(t.hasOwnProperty(s)){const i=t[s],o=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(s):this.escapeStr(s),l=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(i):this.escapeStr(i);o!==""&&l!==""&&(e=e.replace(new RegExp(`(${this.escapeStr(o)}|${this.escapeStr(l)})`,`gm${n}`),r+`(${this.processSynomyms(o)}|${this.processSynomyms(l)})`+r))}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,n,r)=>{let s=r.charAt(n+1);return/[(|)\\]/.test(s)||s===""?t:t+"\0"})}createJoinersRegExp(e){let t=[];const n=this.opt.ignorePunctuation;return Array.isArray(n)&&n.length&&t.push(this.escapeStr(n.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",n=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 r=[];return e.split("").forEach(s=>{n.every(i=>{if(i.indexOf(s)!==-1){if(r.indexOf(i)>-1)return!1;e=e.replace(new RegExp(`[${i}]`,`gm${t}`),`[${i}]`),r.push(i)}return!0})}),e}createMergedBlanksRegExp(e){return e.replace(/[\s]+/gmi,"[\\s]+")}createAccuracyRegExp(e){const t="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿";let n=this.opt.accuracy,r=typeof n=="string"?n:n.value,s=typeof n=="string"?[]:n.limiters,i="";switch(s.forEach(o=>{i+=`|${this.escapeStr(o)}`}),r){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(n=>{this.opt.separateWordSearch?n.split(" ").forEach(r=>{r.trim()&&t.indexOf(r)===-1&&t.push(r)}):n.trim()&&t.indexOf(n)===-1&&t.push(n)}),{keywords:t.sort((n,r)=>r.length-n.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 n=0;return e.sort((r,s)=>r.start-s.start).forEach(r=>{let{start:s,end:i,valid:o}=this.callNoMatchOnInvalidRanges(r,n);o&&(r.start=s,r.length=i-s,t.push(r),n=i)}),t}callNoMatchOnInvalidRanges(e,t){let n,r,s=!1;return e&&typeof e.start<"u"?(n=parseInt(e.start,10),r=n+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&r-t>0&&r-n>0?s=!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:n,end:r,valid:s}}checkWhitespaceRanges(e,t,n){let r,s=!0,i=n.length,o=t-i,l=parseInt(e.start,10)-o;return l=l>i?i:l,r=l+parseInt(e.length,10),r>i&&(r=i,this.log(`End range automatically set to the max value of ${i}`)),l<0||r-l<0||l>i||r>i?(s=!1,this.log(`Invalid range: ${JSON.stringify(e)}`),this.opt.noMatch(e)):n.substring(l,r).replace(/\s+/g,"")===""&&(s=!1,this.log("Skipping whitespace only range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:l,end:r,valid:s}}getTextNodes(e){let t="",n=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,r=>{n.push({start:t.length,end:(t+=r.textContent).length,node:r})},r=>this.matchesExclude(r.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT,()=>{e({value:t,nodes:n})})}matchesExclude(e){return ue.matches(e,this.opt.exclude.concat(["script","style","title","head","html"]))}wrapRangeInTextNode(e,t,n){const r=this.opt.element?this.opt.element:"mark",s=e.splitText(t),i=s.splitText(n-t);let o=document.createElement(r);return o.setAttribute("data-markjs","true"),this.opt.className&&o.setAttribute("class",this.opt.className),o.textContent=s.textContent,s.parentNode.replaceChild(o,s),i}wrapRangeInMappedTextNode(e,t,n,r,s){e.nodes.every((i,o)=>{const l=e.nodes[o+1];if(typeof l>"u"||l.start>t){if(!r(i.node))return!1;const c=t-i.start,h=(n>i.end?i.end:n)-i.start,m=e.value.substr(0,i.start),p=e.value.substr(h+i.start);if(i.node=this.wrapRangeInTextNode(i.node,c,h),e.value=m+p,e.nodes.forEach((b,w)=>{w>=o&&(e.nodes[w].start>0&&w!==o&&(e.nodes[w].start-=h),e.nodes[w].end-=h)}),n-=h,s(i.node.previousSibling,i.start),n>i.end)t=i.end;else return!1}return!0})}wrapMatches(e,t,n,r,s){const i=t===0?0:t+1;this.getTextNodes(o=>{o.nodes.forEach(l=>{l=l.node;let c;for(;(c=e.exec(l.textContent))!==null&&c[i]!=="";){if(!n(c[i],l))continue;let h=c.index;if(i!==0)for(let m=1;m<i;m++)h+=c[m].length;l=this.wrapRangeInTextNode(l,h,h+c[i].length),r(l.previousSibling),e.lastIndex=0}}),s()})}wrapMatchesAcrossElements(e,t,n,r,s){const i=t===0?0:t+1;this.getTextNodes(o=>{let l;for(;(l=e.exec(o.value))!==null&&l[i]!=="";){let c=l.index;if(i!==0)for(let m=1;m<i;m++)c+=l[m].length;const h=c+l[i].length;this.wrapRangeInMappedTextNode(o,c,h,m=>n(l[i],m),(m,p)=>{e.lastIndex=p,r(m)})}s()})}wrapRangeFromIndex(e,t,n,r){this.getTextNodes(s=>{const i=s.value.length;e.forEach((o,l)=>{let{start:c,end:h,valid:m}=this.checkWhitespaceRanges(o,i,s.value);m&&this.wrapRangeInMappedTextNode(s,c,h,p=>t(p,o,s.value.substring(c,h),l),p=>{n(p,o)})}),r()})}unwrapMatches(e){const t=e.parentNode;let n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.removeChild(e.firstChild));t.replaceChild(n,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 n=0,r="wrapMatches";const s=i=>{n++,this.opt.each(i)};this.opt.acrossElements&&(r="wrapMatchesAcrossElements"),this[r](e,this.opt.ignoreGroups,(i,o)=>this.opt.filter(o,i,n),s,()=>{n===0&&this.opt.noMatch(e),this.opt.done(n)})}mark(e,t){this.opt=t;let n=0,r="wrapMatches";const{keywords:s,length:i}=this.getSeparatedKeywords(typeof e=="string"?[e]:e),o=this.opt.caseSensitive?"":"i",l=c=>{let h=new RegExp(this.createRegExp(c),`gm${o}`),m=0;this.log(`Searching with expression "${h}"`),this[r](h,1,(p,b)=>this.opt.filter(b,c,n,m),p=>{m++,n++,this.opt.each(p)},()=>{m===0&&this.opt.noMatch(c),s[i-1]===c?this.opt.done(n):l(s[s.indexOf(c)+1])})};this.opt.acrossElements&&(r="wrapMatchesAcrossElements"),i===0?this.opt.done(n):l(s[0])}markRanges(e,t){this.opt=t;let n=0,r=this.checkRanges(e);r&&r.length?(this.log("Starting to mark with the following ranges: "+JSON.stringify(r)),this.wrapRangeFromIndex(r,(s,i,o,l)=>this.opt.filter(s,i,o,l),(s,i)=>{n++,this.opt.each(s,i)},()=>{this.opt.done(n)})):this.opt.done(n)}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,n=>{this.unwrapMatches(n)},n=>{const r=ue.matches(n,t),s=this.matchesExclude(n);return!r||s?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}};function jn(a){const e=new Vn(a);return this.mark=(t,n)=>(e.mark(t,n),this),this.markRegExp=(t,n)=>(e.markRegExp(t,n),this),this.markRanges=(t,n)=>(e.markRanges(t,n),this),this.unmark=t=>(e.unmark(t),this),this}const $n="ENTRIES",Et="KEYS",It="VALUES",z="";class Pe{constructor(e,t){const n=e._tree,r=Array.from(n.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:n,keys:r}]:[]}next(){const e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:e,keys:t}=le(this._path);if(le(t)===z)return{done:!1,value:this.result()};const n=e.get(le(t));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const e=le(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>le(e)).filter(e=>e!==z).join("")}value(){return le(this._path).node.get(z)}result(){switch(this._type){case It:return this.value();case Et:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const le=a=>a[a.length-1],Bn=(a,e,t)=>{const n=new Map;if(e===void 0)return n;const r=e.length+1,s=r+t,i=new Uint8Array(s*r).fill(t+1);for(let o=0;o<r;++o)i[o]=o;for(let o=1;o<s;++o)i[o*r]=o;return kt(a,e,t,n,i,1,r,""),n},kt=(a,e,t,n,r,s,i,o)=>{const l=s*i;e:for(const c of a.keys())if(c===z){const h=r[l-1];h<=t&&n.set(o,[a.get(c),h])}else{let h=s;for(let m=0;m<c.length;++m,++h){const p=c[m],b=i*h,w=b-i;let k=r[b];const y=Math.max(0,h-t-1),O=Math.min(i-1,h+t);for(let L=y;L<O;++L){const K=p!==e[L],H=r[w+L]+ +K,W=r[w+L+1]+1,j=r[b+L]+1,$=r[b+L+1]=Math.min(H,W,j);$<k&&(k=$)}if(k>t)continue e}kt(a.get(c),e,t,n,r,h,i,o+c)}};class Y{constructor(e=new Map,t=""){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(e){if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");const[t,n]=Ae(this._tree,e.slice(this._prefix.length));if(t===void 0){const[r,s]=He(n);for(const i of r.keys())if(i!==z&&i.startsWith(s)){const o=new Map;return o.set(i.slice(s.length),r.get(i)),new Y(o,e)}}return new Y(t,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,Wn(this._tree,e)}entries(){return new Pe(this,$n)}forEach(e){for(const[t,n]of this)e(t,n,this)}fuzzyGet(e,t){return Bn(this._tree,e,t)}get(e){const t=Je(this._tree,e);return t!==void 0?t.get(z):void 0}has(e){const t=Je(this._tree,e);return t!==void 0&&t.has(z)}keys(){return new Pe(this,Et)}set(e,t){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,ze(this._tree,e).set(z,t),this}get size(){if(this._size)return this._size;this._size=0;const e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;const n=ze(this._tree,e);return n.set(z,t(n.get(z))),this}fetch(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;const n=ze(this._tree,e);let r=n.get(z);return r===void 0&&n.set(z,r=t()),r}values(){return new Pe(this,It)}[Symbol.iterator](){return this.entries()}static from(e){const t=new Y;for(const[n,r]of e)t.set(n,r);return t}static fromObject(e){return Y.from(Object.entries(e))}}const Ae=(a,e,t=[])=>{if(e.length===0||a==null)return[a,t];for(const n of a.keys())if(n!==z&&e.startsWith(n))return t.push([a,n]),Ae(a.get(n),e.slice(n.length),t);return t.push([a,e]),Ae(void 0,"",t)},Je=(a,e)=>{if(e.length===0||a==null)return a;for(const t of a.keys())if(t!==z&&e.startsWith(t))return Je(a.get(t),e.slice(t.length))},ze=(a,e)=>{const t=e.length;e:for(let n=0;a&&n<t;){for(const s of a.keys())if(s!==z&&e[n]===s[0]){const i=Math.min(t-n,s.length);let o=1;for(;o<i&&e[n+o]===s[o];)++o;const l=a.get(s);if(o===s.length)a=l;else{const c=new Map;c.set(s.slice(o),l),a.set(e.slice(n,n+o),c),a.delete(s),a=c}n+=o;continue e}const r=new Map;return a.set(e.slice(n),r),r}return a},Wn=(a,e)=>{const[t,n]=Ae(a,e);if(t!==void 0){if(t.delete(z),t.size===0)Nt(n);else if(t.size===1){const[r,s]=t.entries().next().value;Ft(n,r,s)}}},Nt=a=>{if(a.length===0)return;const[e,t]=He(a);if(e.delete(t),e.size===0)Nt(a.slice(0,-1));else if(e.size===1){const[n,r]=e.entries().next().value;n!==z&&Ft(a.slice(0,-1),n,r)}},Ft=(a,e,t)=>{if(a.length===0)return;const[n,r]=He(a);n.set(r+e,t),n.delete(r)},He=a=>a[a.length-1],Ge="or",Rt="and",Kn="and_not";class de{constructor(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const t=e.autoVacuum==null||e.autoVacuum===!0?$e:e.autoVacuum;this._options={...je,...e,autoVacuum:t,searchOptions:{...vt,...e.searchOptions||{}},autoSuggestOptions:{...Gn,...e.autoSuggestOptions||{}}},this._index=new Y,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=Ue,this.addFields(this._options.fields)}add(e){const{extractField:t,stringifyField:n,tokenize:r,processTerm:s,fields:i,idField:o}=this._options,l=t(e,o);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);if(this._idToShortId.has(l))throw new Error(`MiniSearch: duplicate ID ${l}`);const c=this.addDocumentId(l);this.saveStoredFields(c,e);for(const h of i){const m=t(e,h);if(m==null)continue;const p=r(n(m,h),h),b=this._fieldIds[h],w=new Set(p).size;this.addFieldLength(c,b,this._documentCount-1,w);for(const k of p){const y=s(k,h);if(Array.isArray(y))for(const O of y)this.addTerm(b,c,O);else y&&this.addTerm(b,c,y)}}}addAll(e){for(const t of e)this.add(t)}addAllAsync(e,t={}){const{chunkSize:n=10}=t,r={chunk:[],promise:Promise.resolve()},{chunk:s,promise:i}=e.reduce(({chunk:o,promise:l},c,h)=>(o.push(c),(h+1)%n===0?{chunk:[],promise:l.then(()=>new Promise(m=>setTimeout(m,0))).then(()=>this.addAll(o))}:{chunk:o,promise:l}),r);return i.then(()=>this.addAll(s))}remove(e){const{tokenize:t,processTerm:n,extractField:r,stringifyField:s,fields:i,idField:o}=this._options,l=r(e,o);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);const c=this._idToShortId.get(l);if(c==null)throw new Error(`MiniSearch: cannot remove document with ID ${l}: it is not in the index`);for(const h of i){const m=r(e,h);if(m==null)continue;const p=t(s(m,h),h),b=this._fieldIds[h],w=new Set(p).size;this.removeFieldLength(c,b,this._documentCount,w);for(const k of p){const y=n(k,h);if(Array.isArray(y))for(const O of y)this.removeTerm(b,c,O);else y&&this.removeTerm(b,c,y)}}this._storedFields.delete(c),this._documentIds.delete(c),this._idToShortId.delete(l),this._fieldLength.delete(c),this._documentCount-=1}removeAll(e){if(e)for(const t of e)this.remove(t);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Y,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(e){const t=this._idToShortId.get(e);if(t==null)throw new Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(t),this._storedFields.delete(t),(this._fieldLength.get(t)||[]).forEach((n,r)=>{this.removeFieldLength(t,r,this._documentCount,n)}),this._fieldLength.delete(t),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:e,minDirtCount:t,batchSize:n,batchWait:r}=this._options.autoVacuum;this.conditionalVacuum({batchSize:n,batchWait:r},{minDirtCount:t,minDirtFactor:e})}discardAll(e){const t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const n of e)this.discard(n)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){const{idField:t,extractField:n}=this._options,r=n(e,t);this.discard(r),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const n=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=Ue,this.performVacuuming(e,n)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,t){const n=this._dirtCount;if(this.vacuumConditionsMet(t)){const r=e.batchSize||qe.batchSize,s=e.batchWait||qe.batchWait;let i=1;for(const[o,l]of this._index){for(const[c,h]of l)for(const[m]of h)this._documentIds.has(m)||(h.size<=1?l.delete(c):h.delete(m));this._index.get(o).size===0&&this._index.delete(o),i%r===0&&await new Promise(c=>setTimeout(c,s)),i+=1}this._dirtCount-=n}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:n}=e;return t=t||$e.minDirtCount,n=n||$e.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=n}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(e){return this._idToShortId.has(e)}getStoredFields(e){const t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(e,t={}){const{searchOptions:n}=this._options,r={...n,...t},s=this.executeQuery(e,t),i=[];for(const[o,{score:l,terms:c,match:h}]of s){const m=c.length||1,p={id:this._documentIds.get(o),score:l*m,terms:Object.keys(h),queryTerms:c,match:h};Object.assign(p,this._storedFields.get(o)),(r.filter==null||r.filter(p))&&i.push(p)}return e===de.wildcard&&r.boostDocument==null||i.sort(mt),i}autoSuggest(e,t={}){t={...this._options.autoSuggestOptions,...t};const n=new Map;for(const{score:s,terms:i}of this.search(e,t)){const o=i.join(" "),l=n.get(o);l!=null?(l.score+=s,l.count+=1):n.set(o,{score:s,terms:i,count:1})}const r=[];for(const[s,{score:i,terms:o,count:l}]of n)r.push({suggestion:s,terms:o,score:i/l});return r.sort(mt),r}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(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)}static async loadJSONAsync(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(e),t)}static getDefault(e){if(je.hasOwnProperty(e))return Ve(je,e);throw new Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){const{index:n,documentIds:r,fieldLength:s,storedFields:i,serializationVersion:o}=e,l=this.instantiateMiniSearch(e,t);l._documentIds=Ee(r),l._fieldLength=Ee(s),l._storedFields=Ee(i);for(const[c,h]of l._documentIds)l._idToShortId.set(h,c);for(const[c,h]of n){const m=new Map;for(const p of Object.keys(h)){let b=h[p];o===1&&(b=b.ds),m.set(parseInt(p,10),Ee(b))}l._index.set(c,m)}return l}static async loadJSAsync(e,t){const{index:n,documentIds:r,fieldLength:s,storedFields:i,serializationVersion:o}=e,l=this.instantiateMiniSearch(e,t);l._documentIds=await Ie(r),l._fieldLength=await Ie(s),l._storedFields=await Ie(i);for(const[h,m]of l._documentIds)l._idToShortId.set(m,h);let c=0;for(const[h,m]of n){const p=new Map;for(const b of Object.keys(m)){let w=m[b];o===1&&(w=w.ds),p.set(parseInt(b,10),await Ie(w))}++c%1e3===0&&await Ot(0),l._index.set(h,p)}return l}static instantiateMiniSearch(e,t){const{documentCount:n,nextId:r,fieldIds:s,averageFieldLength:i,dirtCount:o,serializationVersion:l}=e;if(l!==1&&l!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const c=new de(t);return c._documentCount=n,c._nextId=r,c._idToShortId=new Map,c._fieldIds=s,c._avgFieldLength=i,c._dirtCount=o||0,c._index=new Y,c}executeQuery(e,t={}){if(e===de.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){const p={...t,...e,queries:void 0},b=e.queries.map(w=>this.executeQuery(w,p));return this.combineResults(b,p.combineWith)}const{tokenize:n,processTerm:r,searchOptions:s}=this._options,i={tokenize:n,processTerm:r,...s,...t},{tokenize:o,processTerm:l}=i,m=o(e).flatMap(p=>l(p)).filter(p=>!!p).map(Hn(i)).map(p=>this.executeQuerySpec(p,i));return this.combineResults(m,i.combineWith)}executeQuerySpec(e,t){const n={...this._options.searchOptions,...t},r=(n.fields||this._options.fields).reduce((k,y)=>({...k,[y]:Ve(n.boost,y)||1}),{}),{boostDocument:s,weights:i,maxFuzzy:o,bm25:l}=n,{fuzzy:c,prefix:h}={...vt.weights,...i},m=this._index.get(e.term),p=this.termResults(e.term,e.term,1,e.termBoost,m,r,s,l);let b,w;if(e.prefix&&(b=this._index.atPrefix(e.term)),e.fuzzy){const k=e.fuzzy===!0?.2:e.fuzzy,y=k<1?Math.min(o,Math.round(e.term.length*k)):k;y&&(w=this._index.fuzzyGet(e.term,y))}if(b)for(const[k,y]of b){const O=k.length-e.term.length;if(!O)continue;w==null||w.delete(k);const L=h*k.length/(k.length+.3*O);this.termResults(e.term,k,L,e.termBoost,y,r,s,l,p)}if(w)for(const k of w.keys()){const[y,O]=w.get(k);if(!O)continue;const L=c*k.length/(k.length+O);this.termResults(e.term,k,L,e.termBoost,y,r,s,l,p)}return p}executeWildcardQuery(e){const t=new Map,n={...this._options.searchOptions,...e};for(const[r,s]of this._documentIds){const i=n.boostDocument?n.boostDocument(s,"",this._storedFields.get(r)):1;t.set(r,{score:i,terms:[],match:{}})}return t}combineResults(e,t=Ge){if(e.length===0)return new Map;const n=t.toLowerCase(),r=Jn[n];if(!r)throw new Error(`Invalid combination operator: ${t}`);return e.reduce(r)||new Map}toJSON(){const e=[];for(const[t,n]of this._index){const r={};for(const[s,i]of n)r[s]=Object.fromEntries(i);e.push([t,r])}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:e,serializationVersion:2}}termResults(e,t,n,r,s,i,o,l,c=new Map){if(s==null)return c;for(const h of Object.keys(i)){const m=i[h],p=this._fieldIds[h],b=s.get(p);if(b==null)continue;let w=b.size;const k=this._avgFieldLength[p];for(const y of b.keys()){if(!this._documentIds.has(y)){this.removeTerm(p,y,t),w-=1;continue}const O=o?o(this._documentIds.get(y),t,this._storedFields.get(y)):1;if(!O)continue;const L=b.get(y),K=this._fieldLength.get(y)[p],H=Un(L,w,this._documentCount,K,k,l),W=n*r*m*O*H,j=c.get(y);if(j){j.score+=W,Qn(j.terms,e);const $=Ve(j.match,t);$?$.push(h):j.match[t]=[h]}else c.set(y,{score:W,terms:[e],match:{[t]:[h]}})}}return c}addTerm(e,t,n){const r=this._index.fetch(n,gt);let s=r.get(e);if(s==null)s=new Map,s.set(t,1),r.set(e,s);else{const i=s.get(t);s.set(t,(i||0)+1)}}removeTerm(e,t,n){if(!this._index.has(n)){this.warnDocumentChanged(t,e,n);return}const r=this._index.fetch(n,gt),s=r.get(e);s==null||s.get(t)==null?this.warnDocumentChanged(t,e,n):s.get(t)<=1?s.size<=1?r.delete(e):s.delete(t):s.set(t,s.get(t)-1),this._index.get(n).size===0&&this._index.delete(n)}warnDocumentChanged(e,t,n){for(const r of Object.keys(this._fieldIds))if(this._fieldIds[r]===t){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${n}" was not present in field "${r}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(e){const t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t}addFields(e){for(let t=0;t<e.length;t++)this._fieldIds[e[t]]=t}addFieldLength(e,t,n,r){let s=this._fieldLength.get(e);s==null&&this._fieldLength.set(e,s=[]),s[t]=r;const o=(this._avgFieldLength[t]||0)*n+r;this._avgFieldLength[t]=o/(n+1)}removeFieldLength(e,t,n,r){if(n===1){this._avgFieldLength[t]=0;return}const s=this._avgFieldLength[t]*n-r;this._avgFieldLength[t]=s/(n-1)}saveStoredFields(e,t){const{storeFields:n,extractField:r}=this._options;if(n==null||n.length===0)return;let s=this._storedFields.get(e);s==null&&this._storedFields.set(e,s={});for(const i of n){const o=r(t,i);o!==void 0&&(s[i]=o)}}}de.wildcard=Symbol("*");const Ve=(a,e)=>Object.prototype.hasOwnProperty.call(a,e)?a[e]:void 0,Jn={[Ge]:(a,e)=>{for(const t of e.keys()){const n=a.get(t);if(n==null)a.set(t,e.get(t));else{const{score:r,terms:s,match:i}=e.get(t);n.score=n.score+r,n.match=Object.assign(n.match,i),pt(n.terms,s)}}return a},[Rt]:(a,e)=>{const t=new Map;for(const n of e.keys()){const r=a.get(n);if(r==null)continue;const{score:s,terms:i,match:o}=e.get(n);pt(r.terms,i),t.set(n,{score:r.score+s,terms:r.terms,match:Object.assign(r.match,o)})}return t},[Kn]:(a,e)=>{for(const t of e.keys())a.delete(t);return a}},qn={k:1.2,b:.7,d:.5},Un=(a,e,t,n,r,s)=>{const{k:i,b:o,d:l}=s;return Math.log(1+(t-e+.5)/(e+.5))*(l+a*(i+1)/(a+i*(1-o+o*n/r)))},Hn=a=>(e,t,n)=>{const r=typeof a.fuzzy=="function"?a.fuzzy(e,t,n):a.fuzzy||!1,s=typeof a.prefix=="function"?a.prefix(e,t,n):a.prefix===!0,i=typeof a.boostTerm=="function"?a.boostTerm(e,t,n):1;return{term:e,fuzzy:r,prefix:s,termBoost:i}},je={idField:"id",extractField:(a,e)=>a[e],stringifyField:(a,e)=>a.toString(),tokenize:a=>a.split(Yn),processTerm:a=>a.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(a,e)=>{typeof(console==null?void 0:console[a])=="function"&&console[a](e)},autoVacuum:!0},vt={combineWith:Ge,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:qn},Gn={combineWith:Rt,prefix:(a,e,t)=>e===t.length-1},qe={batchSize:1e3,batchWait:10},Ue={minDirtFactor:.1,minDirtCount:20},$e={...qe,...Ue},Qn=(a,e)=>{a.includes(e)||a.push(e)},pt=(a,e)=>{for(const t of e)a.includes(t)||a.push(t)},mt=({score:a},{score:e})=>e-a,gt=()=>new Map,Ee=a=>{const e=new Map;for(const t of Object.keys(a))e.set(parseInt(t,10),a[t]);return e},Ie=async a=>{const e=new Map;let t=0;for(const n of Object.keys(a))e.set(parseInt(n,10),a[n]),++t%1e3===0&&await Ot(0);return e},Ot=a=>new Promise(e=>setTimeout(e,a)),Yn=/[\n\r\p{Z}\p{P}]+/u;class Zn{constructor(e=10){Me(this,"max");Me(this,"cache");this.max=e,this.cache=new Map}get(e){let t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){this.cache.has(e)?this.cache.delete(e):this.cache.size===this.max&&this.cache.delete(this.first()),this.cache.set(e,t)}first(){return this.cache.keys().next().value}clear(){this.cache.clear()}}const Xn=["aria-owns"],er={class:"shell"},tr=["title"],nr={class:"search-actions before"},rr=["title"],ir=["aria-activedescendant","aria-controls","placeholder"],sr={class:"search-actions"},ar=["title"],or=["disabled","title"],lr=["id","role","aria-labelledby"],cr=["id","aria-selected"],ur=["href","aria-label","onMouseenter","onFocusin","data-index"],dr={class:"titles"},fr=["innerHTML"],hr={class:"title main"},vr=["innerHTML"],pr={key:0,class:"excerpt-wrapper"},mr={key:0,class:"excerpt",inert:""},gr=["innerHTML"],br={key:0,class:"no-results"},yr={class:"search-keyboard-shortcuts"},wr=["aria-label"],Sr=["aria-label"],_r=["aria-label"],xr=["aria-label"],Tr=zt({__name:"VPLocalSearchBox",emits:["close"],setup(a,{emit:e}){var I,S;const t=e,n=ce(),r=ce(),s=ce(ln),i=an(),{activate:o}=zn(n,{immediate:!0,allowOutsideClick:!0,clickOutsideDeactivates:!0,escapeDeactivates:!0}),{localeIndex:l,theme:c}=i,h=it(async()=>{var v,d,_,R,A,C,D,F,V;return lt(de.loadJSON((_=await((d=(v=s.value)[l.value])==null?void 0:d.call(v)))==null?void 0:_.default,{fields:["title","titles","text"],storeFields:["title","titles"],searchOptions:{fuzzy:.2,prefix:!0,boost:{title:4,text:2,titles:1},...((R=c.value.search)==null?void 0:R.provider)==="local"&&((C=(A=c.value.search.options)==null?void 0:A.miniSearch)==null?void 0:C.searchOptions)},...((D=c.value.search)==null?void 0:D.provider)==="local"&&((V=(F=c.value.search.options)==null?void 0:F.miniSearch)==null?void 0:V.options)}))}),p=be(()=>{var v,d;return((v=c.value.search)==null?void 0:v.provider)==="local"&&((d=c.value.search.options)==null?void 0:d.disableQueryPersistence)===!0}).value?he(""):Vt("vitepress:local-search-filter",""),b=jt("vitepress:local-search-detailed-list",((I=c.value.search)==null?void 0:I.provider)==="local"&&((S=c.value.search.options)==null?void 0:S.detailedView)===!0),w=be(()=>{var v,d,_;return((v=c.value.search)==null?void 0:v.provider)==="local"&&(((d=c.value.search.options)==null?void 0:d.disableDetailedView)===!0||((_=c.value.search.options)==null?void 0:_.detailedView)===!1)}),k=be(()=>{var d,_,R,A,C,D,F;const v=((d=c.value.search)==null?void 0:d.options)??c.value.algolia;return((C=(A=(R=(_=v==null?void 0:v.locales)==null?void 0:_[l.value])==null?void 0:R.translations)==null?void 0:A.button)==null?void 0:C.buttonText)||((F=(D=v==null?void 0:v.translations)==null?void 0:D.button)==null?void 0:F.buttonText)||"Search"});$t(()=>{w.value&&(b.value=!1)});const y=ce([]),O=he(!1);Be(p,()=>{O.value=!1});const L=it(async()=>{if(r.value)return lt(new jn(r.value))},null),K=new Zn(16);Bt(()=>[h.value,p.value,b.value],async([v,d,_],R,A)=>{var te,we,Qe,Ye;(R==null?void 0:R[0])!==v&&K.clear();let C=!1;if(A(()=>{C=!0}),!v)return;y.value=v.search(d).slice(0,16),O.value=!0;const D=_?await Promise.all(y.value.map(B=>H(B.id))):[];if(C)return;for(const{id:B,mod:ne}of D){const re=B.slice(0,B.indexOf("#"));let G=K.get(re);if(G)continue;G=new Map,K.set(re,G);const J=ne.default??ne;if(J!=null&&J.render||J!=null&&J.setup){const ie=en(J);ie.config.warnHandler=()=>{},ie.provide(tn,i),Object.defineProperties(ie.config.globalProperties,{$frontmatter:{get(){return i.frontmatter.value}},$params:{get(){return i.page.value.params}}});const Ze=document.createElement("div");ie.mount(Ze),Ze.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(fe=>{var tt;const Se=(tt=fe.querySelector("a"))==null?void 0:tt.getAttribute("href"),Xe=(Se==null?void 0:Se.startsWith("#"))&&Se.slice(1);if(!Xe)return;let et="";for(;(fe=fe.nextElementSibling)&&!/^h[1-6]$/i.test(fe.tagName);)et+=fe.outerHTML;G.set(Xe,et)}),ie.unmount()}if(C)return}const F=new Set;if(y.value=y.value.map(B=>{const[ne,re]=B.id.split("#"),G=K.get(ne),J=(G==null?void 0:G.get(re))??"";for(const ie in B.match)F.add(ie);return{...B,text:J}}),await ve(),C)return;await new Promise(B=>{var ne;(ne=L.value)==null||ne.unmark({done:()=>{var re;(re=L.value)==null||re.markRegExp(E(F),{done:B})}})});const V=((te=n.value)==null?void 0:te.querySelectorAll(".result .excerpt"))??[];for(const B of V)(we=B.querySelector('mark[data-markjs="true"]'))==null||we.scrollIntoView({block:"center"});(Ye=(Qe=r.value)==null?void 0:Qe.firstElementChild)==null||Ye.scrollIntoView({block:"start"})},{debounce:200,immediate:!0});async function H(v){const d=nn(v.slice(0,v.indexOf("#")));try{if(!d)throw new Error(`Cannot find file for id: ${v}`);return{id:v,mod:await import(d)}}catch(_){return console.error(_),{id:v,mod:{}}}}const W=he(),j=be(()=>{var v;return((v=p.value)==null?void 0:v.length)<=0});function $(v=!0){var d,_;(d=W.value)==null||d.focus(),v&&((_=W.value)==null||_.select())}Le(()=>{$()});function Ce(v){v.pointerType==="mouse"&&$()}const M=he(-1),Z=he(!0);Be(y,v=>{M.value=v.length?0:-1,X()});function X(){ve(()=>{const v=document.querySelector(".result.selected");v==null||v.scrollIntoView({block:"nearest"})})}_e("ArrowUp",v=>{v.preventDefault(),M.value--,M.value<0&&(M.value=y.value.length-1),Z.value=!0,X()}),_e("ArrowDown",v=>{v.preventDefault(),M.value++,M.value>=y.value.length&&(M.value=0),Z.value=!0,X()});const ee=Wt();_e("Enter",v=>{if(v.isComposing||v.target instanceof HTMLButtonElement&&v.target.type!=="submit")return;const d=y.value[M.value];if(v.target instanceof HTMLInputElement&&!d){v.preventDefault();return}d&&(ee.go(d.id),t("close"))}),_e("Escape",()=>{t("close")});const u=on({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"}}});Le(()=>{window.history.pushState(null,"",null)}),Kt("popstate",v=>{v.preventDefault(),t("close")});const f=Jt(qt?document.body:null);Le(()=>{ve(()=>{f.value=!0,ve().then(()=>o())})}),Ut(()=>{f.value=!1});function g(){p.value="",ve().then(()=>$(!1))}function E(v){return new RegExp([...v].sort((d,_)=>_.length-d.length).map(d=>`(${rn(d)})`).join("|"),"gi")}function x(v){var R;if(!Z.value)return;const d=(R=v.target)==null?void 0:R.closest(".result"),_=Number.parseInt(d==null?void 0:d.dataset.index);_>=0&&_!==M.value&&(M.value=_),Z.value=!1}return(v,d)=>{var _,R,A,C,D;return q(),Ht(Xt,{to:"body"},[T("div",{ref_key:"el",ref:n,role:"button","aria-owns":(_=y.value)!=null&&_.length?"localsearch-list":void 0,"aria-expanded":"true","aria-haspopup":"listbox","aria-labelledby":"localsearch-label",class:"VPLocalSearchBox"},[T("div",{class:"backdrop",onClick:d[0]||(d[0]=F=>v.$emit("close"))}),T("div",er,[T("form",{class:"search-bar",onPointerup:d[4]||(d[4]=F=>Ce(F)),onSubmit:d[5]||(d[5]=Gt(()=>{},["prevent"]))},[T("label",{title:k.value,id:"localsearch-label",for:"localsearch-input"},[...d[7]||(d[7]=[T("span",{"aria-hidden":"true",class:"vpi-search search-icon local-search-icon"},null,-1)])],8,tr),T("div",nr,[T("button",{class:"back-button",title:P(u)("modal.backButtonTitle"),onClick:d[1]||(d[1]=F=>v.$emit("close"))},[...d[8]||(d[8]=[T("span",{class:"vpi-arrow-left local-search-icon"},null,-1)])],8,rr)]),Qt(T("input",{ref_key:"searchInput",ref:W,"onUpdate:modelValue":d[2]||(d[2]=F=>Zt(p)?p.value=F:null),"aria-activedescendant":M.value>-1?"localsearch-item-"+M.value:void 0,"aria-autocomplete":"both","aria-controls":(R=y.value)!=null&&R.length?"localsearch-list":void 0,"aria-labelledby":"localsearch-label",autocapitalize:"off",autocomplete:"off",autocorrect:"off",class:"search-input",id:"localsearch-input",enterkeyhint:"go",maxlength:"64",placeholder:k.value,spellcheck:"false",type:"search"},null,8,ir),[[Yt,P(p)]]),T("div",sr,[w.value?xe("",!0):(q(),Q("button",{key:0,class:st(["toggle-layout-button",{"detailed-list":P(b)}]),type:"button",title:P(u)("modal.displayDetails"),onClick:d[3]||(d[3]=F=>M.value>-1&&(b.value=!P(b)))},[...d[9]||(d[9]=[T("span",{class:"vpi-layout-list local-search-icon"},null,-1)])],10,ar)),T("button",{class:"clear-button",type:"reset",disabled:j.value,title:P(u)("modal.resetButtonTitle"),onClick:g},[...d[10]||(d[10]=[T("span",{class:"vpi-delete local-search-icon"},null,-1)])],8,or)])],32),T("ul",{ref_key:"resultsEl",ref:r,id:(A=y.value)!=null&&A.length?"localsearch-list":void 0,role:(C=y.value)!=null&&C.length?"listbox":void 0,"aria-labelledby":(D=y.value)!=null&&D.length?"localsearch-label":void 0,class:"results",onMousemove:x},[(q(!0),Q(ot,null,at(y.value,(F,V)=>(q(),Q("li",{key:F.id,id:"localsearch-item-"+V,"aria-selected":M.value===V?"true":"false",role:"option"},[T("a",{href:F.id,class:st(["result",{selected:M.value===V}]),"aria-label":[...F.titles,F.title].join(" > "),onMouseenter:te=>!Z.value&&(M.value=V),onFocusin:te=>M.value=V,onClick:d[6]||(d[6]=te=>v.$emit("close")),"data-index":V},[T("div",null,[T("div",dr,[d[12]||(d[12]=T("span",{class:"title-icon"},"#",-1)),(q(!0),Q(ot,null,at(F.titles,(te,we)=>(q(),Q("span",{key:we,class:"title"},[T("span",{class:"text",innerHTML:te},null,8,fr),d[11]||(d[11]=T("span",{class:"vpi-chevron-right local-search-icon"},null,-1))]))),128)),T("span",hr,[T("span",{class:"text",innerHTML:F.title},null,8,vr)])]),P(b)?(q(),Q("div",pr,[F.text?(q(),Q("div",mr,[T("div",{class:"vp-doc",innerHTML:F.text},null,8,gr)])):xe("",!0),d[13]||(d[13]=T("div",{class:"excerpt-gradient-bottom"},null,-1)),d[14]||(d[14]=T("div",{class:"excerpt-gradient-top"},null,-1))])):xe("",!0)])],42,ur)],8,cr))),128)),P(p)&&!y.value.length&&O.value?(q(),Q("li",br,[pe(me(P(u)("modal.noResultsText"))+' "',1),T("strong",null,me(P(p)),1),d[15]||(d[15]=pe('" ',-1))])):xe("",!0)],40,lr),T("div",yr,[T("span",null,[T("kbd",{"aria-label":P(u)("modal.footer.navigateUpKeyAriaLabel")},[...d[16]||(d[16]=[T("span",{class:"vpi-arrow-up navigate-icon"},null,-1)])],8,wr),T("kbd",{"aria-label":P(u)("modal.footer.navigateDownKeyAriaLabel")},[...d[17]||(d[17]=[T("span",{class:"vpi-arrow-down navigate-icon"},null,-1)])],8,Sr),pe(" "+me(P(u)("modal.footer.navigateText")),1)]),T("span",null,[T("kbd",{"aria-label":P(u)("modal.footer.selectKeyAriaLabel")},[...d[18]||(d[18]=[T("span",{class:"vpi-corner-down-left navigate-icon"},null,-1)])],8,_r),pe(" "+me(P(u)("modal.footer.selectText")),1)]),T("span",null,[T("kbd",{"aria-label":P(u)("modal.footer.closeKeyAriaLabel")},"esc",8,xr),pe(" "+me(P(u)("modal.footer.closeText")),1)])])])],8,Xn)])}}}),Rr=sn(Tr,[["__scopeId","data-v-a2e1798b"]]);export{Rr as default};
|