Files
rxthinkcmf-wiki/RXThinkCMF_ThinkPhp6_EleVue/.vitepress/dist/assets/chunks/VPLocalSearchBox.Bm43Wm0W.js
T
2026-10-25 18:52:36 +08:00

10 lines
62 KiB
JavaScript

var Rt=Object.defineProperty;var At=(a,e,t)=>e in a?Rt(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var Oe=(a,e,t)=>At(a,typeof e!="symbol"?e+"":e,t);import{V as Ot,ah as je,q as $e,ai as Ct,h as me,aj as Mt,p as re,d as Lt,ak as nt,al as Dt,am as Pt,s as zt,an as Vt,v as Ce,P as fe,O as ye,ao as jt,ap as $t,W as Bt,R as Wt,$ as Kt,o as J,b as Jt,j as x,a0 as qt,k as L,aq as Ut,ar as Ht,as as Gt,c as Q,n as rt,e as we,B as it,F as st,a as he,t as ve,at as Qt,G as Se,au as at,av as Yt,a7 as Zt,ac as Xt,aw as en,_ as tn}from"./framework.B-QBKwc1.js";import{u as nn,c as rn}from"./theme.FPc7RERc.js";const sn={root:()=>Ot(()=>import("./@localSearchIndexroot.CZNs8zyN.js"),[])};function an(a){var e;const t=je(a);return(e=t==null?void 0:t.$el)!=null?e:t}/*!
* tabbable 6.5.0
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*/var mt=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[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] *)"],Ee=mt.join(","),gt=typeof Element>"u",se=gt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ie=!gt&&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},ke=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]"):ke(e.parentNode));return i},on=function(e){var t,n=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return n===""||n==="true"},bt=function(e,t,n){if(ke(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Ee));return t&&se.call(e,Ee)&&r.unshift(e),r=r.filter(n),r},Ne=function(e,t,n){for(var r=[],s=Array.from(e);s.length;){var i=s.shift();if(!ke(i,!1))if(i.tagName==="SLOT"){var o=i.assignedElements(),l=o.length?o:i.children,c=Ne(l,!0,n);n.flatten?r.push.apply(r,c):r.push({scopeParent:i,candidates:c})}else{var v=se.call(i,Ee);v&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var m=i.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(i),p=!ke(m,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(m&&p){var b=Ne(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},yt=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ie=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||on(e))&&!yt(e)?0:e.tabIndex},ln=function(e,t){var n=ie(e);return n<0&&t&&!yt(e)?0:n},cn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},wt=function(e){return e.tagName==="INPUT"},un=function(e){return wt(e)&&e.type==="hidden"},dn=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(n){return n.tagName==="SUMMARY"});return t},fn=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},hn=function(e){if(!e.name)return!0;var t=e.form||Ie(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=fn(r,e.form);return!s||s===e},vn=function(e){return wt(e)&&e.type==="radio"},pn=function(e){return vn(e)&&!hn(e)},mn=function(e){var t,n=e&&Ie(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,v,m;n=Ie(r),r=(c=n)===null||c===void 0?void 0:c.host,s=!!((v=r)!==null&&v!==void 0&&(m=v.ownerDocument)!==null&&m!==void 0&&m.contains(r))}}return s},ot=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},gn=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}var i=getComputedStyle(e),o=i.visibility;if(o==="hidden"||o==="collapse")return!0;var l=se.call(e,"details>summary:first-of-type"),c=l?e.parentElement:e;if(se.call(c,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="full-native"||n==="legacy-full"){if(typeof r=="function"){for(var v=e;e;){var m=e.parentElement,p=Ie(e);if(m&&!m.shadowRoot&&r(m)===!0)return ot(e);e.assignedSlot?e=e.assignedSlot:!m&&p!==e.ownerDocument?e=p.host:e=m}e=v}if(mn(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return ot(e);return!1},bn=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 se.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Fe=function(e,t){return!(t.disabled||un(t)||gn(t,e)||dn(t)||bn(t))},Be=function(e,t){return!(pn(t)||ie(t)<0||!Fe(e,t))},yn=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},St=function(e){var t=[],n=[];return e.forEach(function(r,s){var i=!!r.scopeParent,o=i?r.scopeParent:r,l=ln(o,i),c=i?St(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(cn).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(t)},wn=function(e,t){t=t||{};var n;return t.getShadowRoot?n=Ne([e],t.includeContainer,{filter:Be.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:yn}):n=bt(e,t.includeContainer,Be.bind(null,t)),St(n)},Sn=function(e,t){t=t||{};var n;return t.getShadowRoot?n=Ne([e],t.includeContainer,{filter:Fe.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):n=bt(e,t.includeContainer,Fe.bind(null,t)),n},oe=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return se.call(e,Ee)===!1?!1:Be(t,e)},_n=mt.concat("iframe:not([inert]):not([inert] *)").join(","),Me=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return se.call(e,_n)===!1?!1:Fe(t,e)};/*!
* focus-trap 7.8.0
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
*/function We(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 xn(a){if(Array.isArray(a))return We(a)}function lt(a,e){var t=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(!t){if(Array.isArray(a)||(t=_t(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 Tn(a,e,t){return(e=Fn(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function En(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function In(){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 ct(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 ut(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ct(Object(t),!0).forEach(function(n){Tn(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):ct(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function kn(a){return xn(a)||En(a)||_t(a)||In()}function Nn(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 Fn(a){var e=Nn(a,"string");return typeof e=="symbol"?e:e+""}function _t(a,e){if(a){if(typeof a=="string")return We(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)?We(a,e):void 0}}var q={getActiveTrap:function(e){return(e==null?void 0:e.length)>0?e[e.length-1]:null},activateTrap:function(e,t){var n=q.getActiveTrap(e);t!==n&&q.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),q.unpauseTrap(e)},pauseTrap:function(e){var t=q.getActiveTrap(e);t==null||t._setPausedState(!0)},unpauseTrap:function(e){var t=q.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},Rn=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},An=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},ge=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},On=function(e){return ge(e)&&!e.shiftKey},Cn=function(e){return ge(e)&&e.shiftKey},dt=function(e){return setTimeout(e,0)},pe=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},_e=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},Mn=[],Ln=function(e,t){var n=(t==null?void 0:t.document)||document,r=(t==null?void 0:t.trapStack)||Mn,s=ut({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:On,isKeyBackward:Cn},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,d,g){return u&&u[d]!==void 0?u[d]:s[g||d]},c=function(u,d){var g=typeof(d==null?void 0:d.composedPath)=="function"?d.composedPath():void 0;return i.containerGroups.findIndex(function(T){var _=T.container,E=T.tabbableNodes;return _.contains(u)||(g==null?void 0:g.includes(_))||E.find(function(h){return h===u})})},v=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=d.hasFallback,T=g===void 0?!1:g,_=d.params,E=_===void 0?[]:_,h=s[u];if(typeof h=="function"&&(h=h.apply(void 0,kn(E))),h===!0&&(h=void 0),!h){if(h===void 0||h===!1)return h;throw new Error("`".concat(u,"` was specified but was not a node, or did not return a node"))}var f=h;if(typeof h=="string"){try{f=n.querySelector(h)}catch(y){throw new Error("`".concat(u,'` appears to be an invalid selector; error="').concat(y.message,'"'))}if(!f&&!T)throw new Error("`".concat(u,"` as selector refers to no known node"))}return f},m=function(){var u=v("initialFocus",{hasFallback:!0});if(u===!1)return!1;if(u===void 0||u&&!Me(u,s.tabbableOptions))if(c(n.activeElement)>=0)u=n.activeElement;else{var d=i.tabbableGroups[0],g=d&&d.firstTabbableNode;u=g||v("fallbackFocus")}else u===null&&(u=v("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 d=wn(u,s.tabbableOptions),g=Sn(u,s.tabbableOptions),T=d.length>0?d[0]:void 0,_=d.length>0?d[d.length-1]:void 0,E=g.find(function(y){return oe(y)}),h=g.slice().reverse().find(function(y){return oe(y)}),f=!!d.find(function(y){return ie(y)>0});return{container:u,tabbableNodes:d,focusableNodes:g,posTabIndexesFound:f,firstTabbableNode:T,lastTabbableNode:_,firstDomTabbableNode:E,lastDomTabbableNode:h,nextTabbableNode:function(F){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,R=d.indexOf(F);return R<0?C?g.slice(g.indexOf(F)+1).find(function(k){return oe(k)}):g.slice(0,g.indexOf(F)).reverse().find(function(k){return oe(k)}):d[R+(C?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(u){return u.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!v("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 d=u.activeElement;if(d)return d.shadowRoot&&d.shadowRoot.activeElement!==null?b(d.shadowRoot):d},S=function(u){if(u!==!1&&u!==b(document)){if(!u||!u.focus){S(m());return}u.focus({preventScroll:!!s.preventScroll}),i.mostRecentlyFocusedNode=u,Rn(u)&&u.select()}},I=function(u){var d=v("setReturnFocus",{params:[u]});return d||(d===!1?!1:u)},w=function(u){var d=u.target,g=u.event,T=u.isBackward,_=T===void 0?!1:T;d=d||_e(g),p();var E=null;if(i.tabbableGroups.length>0){var h=c(d,g),f=h>=0?i.containerGroups[h]:void 0;if(h<0)_?E=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:E=i.tabbableGroups[0].firstTabbableNode;else if(_){var y=i.tabbableGroups.findIndex(function(z){var H=z.firstTabbableNode;return d===H});if(y<0&&(f.container===d||Me(d,s.tabbableOptions)&&!oe(d,s.tabbableOptions)&&!f.nextTabbableNode(d,!1))&&(y=h),y>=0){var F=y===0?i.tabbableGroups.length-1:y-1,C=i.tabbableGroups[F];E=ie(d)>=0?C.lastTabbableNode:C.lastDomTabbableNode}else ge(g)||(E=f.nextTabbableNode(d,!1))}else{var R=i.tabbableGroups.findIndex(function(z){var H=z.lastTabbableNode;return d===H});if(R<0&&(f.container===d||Me(d,s.tabbableOptions)&&!oe(d,s.tabbableOptions)&&!f.nextTabbableNode(d))&&(R=h),R>=0){var k=R===i.tabbableGroups.length-1?0:R+1,O=i.tabbableGroups[k];E=ie(d)>=0?O.firstTabbableNode:O.firstDomTabbableNode}else ge(g)||(E=f.nextTabbableNode(d))}}else E=v("fallbackFocus");return E},A=function(u){var d=_e(u);if(!(c(d,u)>=0)){if(pe(s.clickOutsideDeactivates,u)){o.deactivate({returnFocus:s.returnFocusOnDeactivate});return}pe(s.allowOutsideClick,u)||u.preventDefault()}},M=function(u){var d=_e(u),g=c(d,u)>=0;if(g||d instanceof Document)g&&(i.mostRecentlyFocusedNode=d);else{u.stopImmediatePropagation();var T,_=!0;if(i.mostRecentlyFocusedNode)if(ie(i.mostRecentlyFocusedNode)>0){var E=c(i.mostRecentlyFocusedNode),h=i.containerGroups[E].tabbableNodes;if(h.length>0){var f=h.findIndex(function(y){return y===i.mostRecentlyFocusedNode});f>=0&&(s.isKeyForward(i.recentNavEvent)?f+1<h.length&&(T=h[f+1],_=!1):f-1>=0&&(T=h[f-1],_=!1))}}else i.containerGroups.some(function(y){return y.tabbableNodes.some(function(F){return ie(F)>0})})||(_=!1);else _=!1;_&&(T=w({target:i.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(i.recentNavEvent)})),S(T||i.mostRecentlyFocusedNode||m())}i.recentNavEvent=void 0},W=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=u;var g=w({event:u,isBackward:d});g&&(ge(u)&&u.preventDefault(),S(g))},U=function(u){(s.isKeyForward(u)||s.isKeyBackward(u))&&W(u,s.isKeyBackward(u))},B=function(u){An(u)&&pe(s.escapeDeactivates,u)!==!1&&(u.preventDefault(),o.deactivate())},V=function(u){var d=_e(u);c(d,u)>=0||pe(s.clickOutsideDeactivates,u)||pe(s.allowOutsideClick,u)||(u.preventDefault(),u.stopImmediatePropagation())},j=function(){if(i.active)return q.activateTrap(r,o),i.delayInitialFocusTimer=s.delayInitialFocus?dt(function(){S(m())}):S(m()),n.addEventListener("focusin",M,!0),n.addEventListener("mousedown",A,{capture:!0,passive:!1}),n.addEventListener("touchstart",A,{capture:!0,passive:!1}),n.addEventListener("click",V,{capture:!0,passive:!1}),n.addEventListener("keydown",U,{capture:!0,passive:!1}),n.addEventListener("keydown",B),o},Ae=function(u){i.active&&!i.paused&&o._setSubtreeIsolation(!1),i.adjacentElements.clear(),i.alreadySilent.clear();var d=new Set,g=new Set,T=lt(u),_;try{for(T.s();!(_=T.n()).done;){var E=_.value;d.add(E);for(var h=typeof ShadowRoot<"u"&&E.getRootNode()instanceof ShadowRoot,f=E;f;){d.add(f);var y=f.parentElement,F=[];y?F=y.children:!y&&h&&(F=f.getRootNode().children,y=f.getRootNode().host,h=typeof ShadowRoot<"u"&&y.getRootNode()instanceof ShadowRoot);var C=lt(F),R;try{for(C.s();!(R=C.n()).done;){var k=R.value;g.add(k)}}catch(O){C.e(O)}finally{C.f()}f=y}}}catch(O){T.e(O)}finally{T.f()}d.forEach(function(O){g.delete(O)}),i.adjacentElements=g},P=function(){if(i.active)return n.removeEventListener("focusin",M,!0),n.removeEventListener("mousedown",A,!0),n.removeEventListener("touchstart",A,!0),n.removeEventListener("click",V,!0),n.removeEventListener("keydown",U,!0),n.removeEventListener("keydown",B),o},ae=function(u){var d=u.some(function(g){var T=Array.from(g.removedNodes);return T.some(function(_){return _===i.mostRecentlyFocusedNode})});d&&S(m())},Z=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(ae):void 0,X=function(){Z&&(Z.disconnect(),i.active&&!i.paused&&i.containers.map(function(u){Z.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 d=l(u,"onActivate"),g=l(u,"onPostActivate"),T=l(u,"checkCanFocusTrap"),_=q.getActiveTrap(r),E=!1;if(_&&!_.paused){var h;(h=_._setSubtreeIsolation)===null||h===void 0||h.call(_,!1),E=!0}try{T||p(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=b(n),d==null||d();var f=function(){T&&p(),j(),X(),s.isolateSubtrees&&o._setSubtreeIsolation(!0),g==null||g()};if(T)return T(i.containers.concat()).then(f,f),this;f()}catch(F){if(_===q.getActiveTrap(r)&&E){var y;(y=_._setSubtreeIsolation)===null||y===void 0||y.call(_,!0)}throw F}return this},deactivate:function(u){if(!i.active)return this;var d=ut({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(),P(),i.active=!1,i.paused=!1,X(),q.deactivateTrap(r,o);var g=l(d,"onDeactivate"),T=l(d,"onPostDeactivate"),_=l(d,"checkCanReturnFocus"),E=l(d,"returnFocus","returnFocusOnDeactivate");g==null||g();var h=function(){dt(function(){E&&S(I(i.nodeFocusedBeforeActivation)),T==null||T()})};return E&&_?(_(I(i.nodeFocusedBeforeActivation)).then(h,h),this):(h(),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 d=[].concat(u).filter(Boolean);return i.containers=d.map(function(g){return typeof g=="string"?n.querySelector(g):g}),s.isolateSubtrees&&Ae(i.containers),i.active&&(p(),s.isolateSubtrees&&!i.paused&&o._setSubtreeIsolation(!0)),X(),this}},Object.defineProperties(o,{_isManuallyPaused:{value:function(){return i.manuallyPaused}},_setPausedState:{value:function(u,d){if(i.paused===u)return this;if(i.paused=u,u){var g=l(d,"onPause"),T=l(d,"onPostPause");g==null||g(),P(),X(),o._setSubtreeIsolation(!1),T==null||T()}else{var _=l(d,"onUnpause"),E=l(d,"onPostUnpause");_==null||_(),o._setSubtreeIsolation(!0),p(),j(),X(),E==null||E()}return this}},_setSubtreeIsolation:{value:function(u){s.isolateSubtrees&&i.adjacentElements.forEach(function(d){var g;if(u)switch(s.isolateSubtrees){case"aria-hidden":(d.ariaHidden==="true"||((g=d.getAttribute("aria-hidden"))===null||g===void 0?void 0:g.toLowerCase())==="true")&&i.alreadySilent.add(d),d.setAttribute("aria-hidden","true");break;default:(d.inert||d.hasAttribute("inert"))&&i.alreadySilent.add(d),d.setAttribute("inert",!0);break}else if(!i.alreadySilent.has(d))switch(s.isolateSubtrees){case"aria-hidden":d.removeAttribute("aria-hidden");break;default:d.removeAttribute("inert");break}})}}}),o.updateContainerElements(e),o};function Dn(a,e={}){let t;const{immediate:n,...r}=e,s=re(!1),i=re(!1),o=p=>t&&t.activate(p),l=p=>t&&t.deactivate(p),c=()=>{t&&(t.pause(),i.value=!0)},v=()=>{t&&(t.unpause(),i.value=!1)},m=me(()=>{const p=je(a);return(Array.isArray(p)?p:[p]).map(b=>{const S=je(b);return typeof S=="string"?S:an(S)}).filter(Mt)});return $e(m,p=>{p.length&&(t=Ln(p,{...r,onActivate(){s.value=!0,e.onActivate&&e.onActivate()},onDeactivate(){s.value=!1,e.onDeactivate&&e.onDeactivate()}}),n&&o())},{flush:"post"}),Ct(()=>l()),{hasFocus:s,isPaused:i,activate:o,deactivate:l,pause:c,unpause:v}}class ce{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=>{ce.matches(c,this.exclude)?l():this.onIframeReady(c,v=>{t(c)&&(o++,n(v)),l()},l)})}createIterator(e,t,n){return document.createNodeIterator(e,t,n,!1)}createInstanceOnIframe(e){return new ce(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,v,m=()=>({prevNode:v,node:c}=this.getIteratorNode(i),c);for(;m();)this.iframes&&this.forEachIframe(t,p=>this.checkIframeFilter(c,v,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 Pn=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 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 ce.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,v=(n>i.end?i.end:n)-i.start,m=e.value.substr(0,i.start),p=e.value.substr(v+i.start);if(i.node=this.wrapRangeInTextNode(i.node,c,v),e.value=m+p,e.nodes.forEach((b,S)=>{S>=o&&(e.nodes[S].start>0&&S!==o&&(e.nodes[S].start-=v),e.nodes[S].end-=v)}),n-=v,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 v=c.index;if(i!==0)for(let m=1;m<i;m++)v+=c[m].length;l=this.wrapRangeInTextNode(l,v,v+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 v=c+l[i].length;this.wrapRangeInMappedTextNode(o,c,v,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:v,valid:m}=this.checkWhitespaceRanges(o,i,s.value);m&&this.wrapRangeInMappedTextNode(s,c,v,p=>t(p,o,s.value.substring(c,v),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 v=new RegExp(this.createRegExp(c),`gm${o}`),m=0;this.log(`Searching with expression "${v}"`),this[r](v,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=ce.matches(n,t),s=this.matchesExclude(n);return!r||s?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}};function zn(a){const e=new Pn(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 Vn="ENTRIES",xt="KEYS",Tt="VALUES",D="";class Le{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)===D)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!==D).join("")}value(){return le(this._path).node.get(D)}result(){switch(this._type){case Tt:return this.value();case xt:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const le=a=>a[a.length-1],jn=(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 Et(a,e,t,n,i,1,r,""),n},Et=(a,e,t,n,r,s,i,o)=>{const l=s*i;e:for(const c of a.keys())if(c===D){const v=r[l-1];v<=t&&n.set(o,[a.get(c),v])}else{let v=s;for(let m=0;m<c.length;++m,++v){const p=c[m],b=i*v,S=b-i;let I=r[b];const w=Math.max(0,v-t-1),A=Math.min(i-1,v+t);for(let M=w;M<A;++M){const W=p!==e[M],U=r[S+M]+ +W,B=r[S+M+1]+1,V=r[b+M]+1,j=r[b+M+1]=Math.min(U,B,V);j<I&&(I=j)}if(I>t)continue e}Et(a.get(c),e,t,n,r,v,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]=Re(this._tree,e.slice(this._prefix.length));if(t===void 0){const[r,s]=Ue(n);for(const i of r.keys())if(i!==D&&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,$n(this._tree,e)}entries(){return new Le(this,Vn)}forEach(e){for(const[t,n]of this)e(t,n,this)}fuzzyGet(e,t){return jn(this._tree,e,t)}get(e){const t=Ke(this._tree,e);return t!==void 0?t.get(D):void 0}has(e){const t=Ke(this._tree,e);return t!==void 0&&t.has(D)}keys(){return new Le(this,xt)}set(e,t){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,De(this._tree,e).set(D,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=De(this._tree,e);return n.set(D,t(n.get(D))),this}fetch(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;const n=De(this._tree,e);let r=n.get(D);return r===void 0&&n.set(D,r=t()),r}values(){return new Le(this,Tt)}[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 Re=(a,e,t=[])=>{if(e.length===0||a==null)return[a,t];for(const n of a.keys())if(n!==D&&e.startsWith(n))return t.push([a,n]),Re(a.get(n),e.slice(n.length),t);return t.push([a,e]),Re(void 0,"",t)},Ke=(a,e)=>{if(e.length===0||a==null)return a;for(const t of a.keys())if(t!==D&&e.startsWith(t))return Ke(a.get(t),e.slice(t.length))},De=(a,e)=>{const t=e.length;e:for(let n=0;a&&n<t;){for(const s of a.keys())if(s!==D&&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},$n=(a,e)=>{const[t,n]=Re(a,e);if(t!==void 0){if(t.delete(D),t.size===0)It(n);else if(t.size===1){const[r,s]=t.entries().next().value;kt(n,r,s)}}},It=a=>{if(a.length===0)return;const[e,t]=Ue(a);if(e.delete(t),e.size===0)It(a.slice(0,-1));else if(e.size===1){const[n,r]=e.entries().next().value;n!==D&&kt(a.slice(0,-1),n,r)}},kt=(a,e,t)=>{if(a.length===0)return;const[n,r]=Ue(a);n.set(r+e,t),n.delete(r)},Ue=a=>a[a.length-1],He="or",Nt="and",Bn="and_not";class ue{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?Ve:e.autoVacuum;this._options={...ze,...e,autoVacuum:t,searchOptions:{...ft,...e.searchOptions||{}},autoSuggestOptions:{...Un,...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=qe,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 v of i){const m=t(e,v);if(m==null)continue;const p=r(n(m,v),v),b=this._fieldIds[v],S=new Set(p).size;this.addFieldLength(c,b,this._documentCount-1,S);for(const I of p){const w=s(I,v);if(Array.isArray(w))for(const A of w)this.addTerm(b,c,A);else w&&this.addTerm(b,c,w)}}}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,v)=>(o.push(c),(v+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 v of i){const m=r(e,v);if(m==null)continue;const p=t(s(m,v),v),b=this._fieldIds[v],S=new Set(p).size;this.removeFieldLength(c,b,this._documentCount,S);for(const I of p){const w=n(I,v);if(Array.isArray(w))for(const A of w)this.removeTerm(b,c,A);else w&&this.removeTerm(b,c,w)}}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=qe,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||Je.batchSize,s=e.batchWait||Je.batchWait;let i=1;for(const[o,l]of this._index){for(const[c,v]of l)for(const[m]of v)this._documentIds.has(m)||(v.size<=1?l.delete(c):v.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||Ve.minDirtCount,n=n||Ve.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:v}]of s){const m=c.length||1,p={id:this._documentIds.get(o),score:l*m,terms:Object.keys(v),queryTerms:c,match:v};Object.assign(p,this._storedFields.get(o)),(r.filter==null||r.filter(p))&&i.push(p)}return e===ue.wildcard&&r.boostDocument==null||i.sort(vt),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(vt),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(ze.hasOwnProperty(e))return Pe(ze,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=xe(r),l._fieldLength=xe(s),l._storedFields=xe(i);for(const[c,v]of l._documentIds)l._idToShortId.set(v,c);for(const[c,v]of n){const m=new Map;for(const p of Object.keys(v)){let b=v[p];o===1&&(b=b.ds),m.set(parseInt(p,10),xe(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 Te(r),l._fieldLength=await Te(s),l._storedFields=await Te(i);for(const[v,m]of l._documentIds)l._idToShortId.set(m,v);let c=0;for(const[v,m]of n){const p=new Map;for(const b of Object.keys(m)){let S=m[b];o===1&&(S=S.ds),p.set(parseInt(b,10),await Te(S))}++c%1e3===0&&await Ft(0),l._index.set(v,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 ue(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===ue.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){const p={...t,...e,queries:void 0},b=e.queries.map(S=>this.executeQuery(S,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(qn(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((I,w)=>({...I,[w]:Pe(n.boost,w)||1}),{}),{boostDocument:s,weights:i,maxFuzzy:o,bm25:l}=n,{fuzzy:c,prefix:v}={...ft.weights,...i},m=this._index.get(e.term),p=this.termResults(e.term,e.term,1,e.termBoost,m,r,s,l);let b,S;if(e.prefix&&(b=this._index.atPrefix(e.term)),e.fuzzy){const I=e.fuzzy===!0?.2:e.fuzzy,w=I<1?Math.min(o,Math.round(e.term.length*I)):I;w&&(S=this._index.fuzzyGet(e.term,w))}if(b)for(const[I,w]of b){const A=I.length-e.term.length;if(!A)continue;S==null||S.delete(I);const M=v*I.length/(I.length+.3*A);this.termResults(e.term,I,M,e.termBoost,w,r,s,l,p)}if(S)for(const I of S.keys()){const[w,A]=S.get(I);if(!A)continue;const M=c*I.length/(I.length+A);this.termResults(e.term,I,M,e.termBoost,w,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=He){if(e.length===0)return new Map;const n=t.toLowerCase(),r=Wn[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 v of Object.keys(i)){const m=i[v],p=this._fieldIds[v],b=s.get(p);if(b==null)continue;let S=b.size;const I=this._avgFieldLength[p];for(const w of b.keys()){if(!this._documentIds.has(w)){this.removeTerm(p,w,t),S-=1;continue}const A=o?o(this._documentIds.get(w),t,this._storedFields.get(w)):1;if(!A)continue;const M=b.get(w),W=this._fieldLength.get(w)[p],U=Jn(M,S,this._documentCount,W,I,l),B=n*r*m*A*U,V=c.get(w);if(V){V.score+=B,Hn(V.terms,e);const j=Pe(V.match,t);j?j.push(v):V.match[t]=[v]}else c.set(w,{score:B,terms:[e],match:{[t]:[v]}})}}return c}addTerm(e,t,n){const r=this._index.fetch(n,pt);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,pt),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)}}}ue.wildcard=Symbol("*");const Pe=(a,e)=>Object.prototype.hasOwnProperty.call(a,e)?a[e]:void 0,Wn={[He]:(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),ht(n.terms,s)}}return a},[Nt]:(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);ht(r.terms,i),t.set(n,{score:r.score+s,terms:r.terms,match:Object.assign(r.match,o)})}return t},[Bn]:(a,e)=>{for(const t of e.keys())a.delete(t);return a}},Kn={k:1.2,b:.7,d:.5},Jn=(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)))},qn=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}},ze={idField:"id",extractField:(a,e)=>a[e],stringifyField:(a,e)=>a.toString(),tokenize:a=>a.split(Gn),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},ft={combineWith:He,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Kn},Un={combineWith:Nt,prefix:(a,e,t)=>e===t.length-1},Je={batchSize:1e3,batchWait:10},qe={minDirtFactor:.1,minDirtCount:20},Ve={...Je,...qe},Hn=(a,e)=>{a.includes(e)||a.push(e)},ht=(a,e)=>{for(const t of e)a.includes(t)||a.push(t)},vt=({score:a},{score:e})=>e-a,pt=()=>new Map,xe=a=>{const e=new Map;for(const t of Object.keys(a))e.set(parseInt(t,10),a[t]);return e},Te=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 Ft(0);return e},Ft=a=>new Promise(e=>setTimeout(e,a)),Gn=/[\n\r\p{Z}\p{P}]+/u;class Qn{constructor(e=10){Oe(this,"max");Oe(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 Yn=["aria-owns"],Zn={class:"shell"},Xn=["title"],er={class:"search-actions before"},tr=["title"],nr=["placeholder"],rr={class:"search-actions"},ir=["title"],sr=["disabled","title"],ar=["id","role","aria-labelledby"],or=["aria-selected"],lr=["href","aria-label","onMouseenter","onFocusin"],cr={class:"titles"},ur=["innerHTML"],dr={class:"title main"},fr=["innerHTML"],hr={key:0,class:"excerpt-wrapper"},vr={key:0,class:"excerpt",inert:""},pr=["innerHTML"],mr={key:0,class:"no-results"},gr={class:"search-keyboard-shortcuts"},br=["aria-label"],yr=["aria-label"],wr=["aria-label"],Sr=["aria-label"],_r=Lt({__name:"VPLocalSearchBox",emits:["close"],setup(a,{emit:e}){var _,E;const t=e,n=Se(),r=Se(),s=Se(sn),i=nn(),{activate:o}=Dn(n,{immediate:!0,allowOutsideClick:!0,clickOutsideDeactivates:!0,escapeDeactivates:!0}),{localeIndex:l,theme:c}=i,v=nt(async()=>{var h,f,y,F,C,R,k,O,z;return at(ue.loadJSON((y=await((f=(h=s.value)[l.value])==null?void 0:f.call(h)))==null?void 0:y.default,{fields:["title","titles","text"],storeFields:["title","titles"],searchOptions:{fuzzy:.2,prefix:!0,boost:{title:4,text:2,titles:1},...((F=c.value.search)==null?void 0:F.provider)==="local"&&((R=(C=c.value.search.options)==null?void 0:C.miniSearch)==null?void 0:R.searchOptions)},...((k=c.value.search)==null?void 0:k.provider)==="local"&&((z=(O=c.value.search.options)==null?void 0:O.miniSearch)==null?void 0:z.options)}))}),p=me(()=>{var h,f;return((h=c.value.search)==null?void 0:h.provider)==="local"&&((f=c.value.search.options)==null?void 0:f.disableQueryPersistence)===!0}).value?re(""):Dt("vitepress:local-search-filter",""),b=Pt("vitepress:local-search-detailed-list",((_=c.value.search)==null?void 0:_.provider)==="local"&&((E=c.value.search.options)==null?void 0:E.detailedView)===!0),S=me(()=>{var h,f,y;return((h=c.value.search)==null?void 0:h.provider)==="local"&&(((f=c.value.search.options)==null?void 0:f.disableDetailedView)===!0||((y=c.value.search.options)==null?void 0:y.detailedView)===!1)}),I=me(()=>{var f,y,F,C,R,k,O;const h=((f=c.value.search)==null?void 0:f.options)??c.value.algolia;return((R=(C=(F=(y=h==null?void 0:h.locales)==null?void 0:y[l.value])==null?void 0:F.translations)==null?void 0:C.button)==null?void 0:R.buttonText)||((O=(k=h==null?void 0:h.translations)==null?void 0:k.button)==null?void 0:O.buttonText)||"Search"});zt(()=>{S.value&&(b.value=!1)});const w=Se([]),A=re(!1);$e(p,()=>{A.value=!1});const M=nt(async()=>{if(r.value)return at(new zn(r.value))},null),W=new Qn(16);Vt(()=>[v.value,p.value,b.value],async([h,f,y],F,C)=>{var H,Ge,Qe,Ye;(F==null?void 0:F[0])!==h&&W.clear();let R=!1;if(C(()=>{R=!0}),!h)return;w.value=h.search(f).slice(0,16),A.value=!0;const k=y?await Promise.all(w.value.map($=>U($.id))):[];if(R)return;for(const{id:$,mod:ee}of k){const te=$.slice(0,$.indexOf("#"));let G=W.get(te);if(G)continue;G=new Map,W.set(te,G);const K=ee.default??ee;if(K!=null&&K.render||K!=null&&K.setup){const ne=Yt(K);ne.config.warnHandler=()=>{},ne.provide(Zt,i),Object.defineProperties(ne.config.globalProperties,{$frontmatter:{get(){return i.frontmatter.value}},$params:{get(){return i.page.value.params}}});const Ze=document.createElement("div");ne.mount(Ze),Ze.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(de=>{var tt;const be=(tt=de.querySelector("a"))==null?void 0:tt.getAttribute("href"),Xe=(be==null?void 0:be.startsWith("#"))&&be.slice(1);if(!Xe)return;let et="";for(;(de=de.nextElementSibling)&&!/^h[1-6]$/i.test(de.tagName);)et+=de.outerHTML;G.set(Xe,et)}),ne.unmount()}if(R)return}const O=new Set;if(w.value=w.value.map($=>{const[ee,te]=$.id.split("#"),G=W.get(ee),K=(G==null?void 0:G.get(te))??"";for(const ne in $.match)O.add(ne);return{...$,text:K}}),await fe(),R)return;await new Promise($=>{var ee;(ee=M.value)==null||ee.unmark({done:()=>{var te;(te=M.value)==null||te.markRegExp(T(O),{done:$})}})});const z=((H=n.value)==null?void 0:H.querySelectorAll(".result .excerpt"))??[];for(const $ of z)(Ge=$.querySelector('mark[data-markjs="true"]'))==null||Ge.scrollIntoView({block:"center"});(Ye=(Qe=r.value)==null?void 0:Qe.firstElementChild)==null||Ye.scrollIntoView({block:"start"})},{debounce:200,immediate:!0});async function U(h){const f=Xt(h.slice(0,h.indexOf("#")));try{if(!f)throw new Error(`Cannot find file for id: ${h}`);return{id:h,mod:await import(f)}}catch(y){return console.error(y),{id:h,mod:{}}}}const B=re(),V=me(()=>{var h;return((h=p.value)==null?void 0:h.length)<=0});function j(h=!0){var f,y;(f=B.value)==null||f.focus(),h&&((y=B.value)==null||y.select())}Ce(()=>{j()});function Ae(h){h.pointerType==="mouse"&&j()}const P=re(-1),ae=re(!1);$e(w,h=>{P.value=h.length?0:-1,Z()});function Z(){fe(()=>{const h=document.querySelector(".result.selected");h==null||h.scrollIntoView({block:"nearest"})})}ye("ArrowUp",h=>{h.preventDefault(),P.value--,P.value<0&&(P.value=w.value.length-1),ae.value=!0,Z()}),ye("ArrowDown",h=>{h.preventDefault(),P.value++,P.value>=w.value.length&&(P.value=0),ae.value=!0,Z()});const X=jt();ye("Enter",h=>{if(h.isComposing||h.target instanceof HTMLButtonElement&&h.target.type!=="submit")return;const f=w.value[P.value];if(h.target instanceof HTMLInputElement&&!f){h.preventDefault();return}f&&(X.go(f.id),t("close"))}),ye("Escape",()=>{t("close")});const u=rn({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"}}});Ce(()=>{window.history.pushState(null,"",null)}),$t("popstate",h=>{h.preventDefault(),t("close")});const d=Bt(Wt?document.body:null);Ce(()=>{fe(()=>{d.value=!0,fe().then(()=>o())})}),Kt(()=>{d.value=!1});function g(){p.value="",fe().then(()=>j(!1))}function T(h){return new RegExp([...h].sort((f,y)=>y.length-f.length).map(f=>`(${en(f)})`).join("|"),"gi")}return(h,f)=>{var y,F,C,R;return J(),Jt(Qt,{to:"body"},[x("div",{ref_key:"el",ref:n,role:"button","aria-owns":(y=w.value)!=null&&y.length?"localsearch-list":void 0,"aria-expanded":"true","aria-haspopup":"listbox","aria-labelledby":"localsearch-label",class:"VPLocalSearchBox"},[x("div",{class:"backdrop",onClick:f[0]||(f[0]=k=>h.$emit("close"))}),x("div",Zn,[x("form",{class:"search-bar",onPointerup:f[4]||(f[4]=k=>Ae(k)),onSubmit:f[5]||(f[5]=qt(()=>{},["prevent"]))},[x("label",{title:I.value,id:"localsearch-label",for:"localsearch-input"},[...f[8]||(f[8]=[x("span",{"aria-hidden":"true",class:"vpi-search search-icon local-search-icon"},null,-1)])],8,Xn),x("div",er,[x("button",{class:"back-button",title:L(u)("modal.backButtonTitle"),onClick:f[1]||(f[1]=k=>h.$emit("close"))},[...f[9]||(f[9]=[x("span",{class:"vpi-arrow-left local-search-icon"},null,-1)])],8,tr)]),Ut(x("input",{ref_key:"searchInput",ref:B,"onUpdate:modelValue":f[2]||(f[2]=k=>Gt(p)?p.value=k:null),placeholder:I.value,id:"localsearch-input","aria-labelledby":"localsearch-label",class:"search-input"},null,8,nr),[[Ht,L(p)]]),x("div",rr,[S.value?we("",!0):(J(),Q("button",{key:0,class:rt(["toggle-layout-button",{"detailed-list":L(b)}]),type:"button",title:L(u)("modal.displayDetails"),onClick:f[3]||(f[3]=k=>P.value>-1&&(b.value=!L(b)))},[...f[10]||(f[10]=[x("span",{class:"vpi-layout-list local-search-icon"},null,-1)])],10,ir)),x("button",{class:"clear-button",type:"reset",disabled:V.value,title:L(u)("modal.resetButtonTitle"),onClick:g},[...f[11]||(f[11]=[x("span",{class:"vpi-delete local-search-icon"},null,-1)])],8,sr)])],32),x("ul",{ref_key:"resultsEl",ref:r,id:(F=w.value)!=null&&F.length?"localsearch-list":void 0,role:(C=w.value)!=null&&C.length?"listbox":void 0,"aria-labelledby":(R=w.value)!=null&&R.length?"localsearch-label":void 0,class:"results",onMousemove:f[7]||(f[7]=k=>ae.value=!1)},[(J(!0),Q(st,null,it(w.value,(k,O)=>(J(),Q("li",{key:k.id,role:"option","aria-selected":P.value===O?"true":"false"},[x("a",{href:k.id,class:rt(["result",{selected:P.value===O}]),"aria-label":[...k.titles,k.title].join(" > "),onMouseenter:z=>!ae.value&&(P.value=O),onFocusin:z=>P.value=O,onClick:f[6]||(f[6]=z=>h.$emit("close"))},[x("div",null,[x("div",cr,[f[13]||(f[13]=x("span",{class:"title-icon"},"#",-1)),(J(!0),Q(st,null,it(k.titles,(z,H)=>(J(),Q("span",{key:H,class:"title"},[x("span",{class:"text",innerHTML:z},null,8,ur),f[12]||(f[12]=x("span",{class:"vpi-chevron-right local-search-icon"},null,-1))]))),128)),x("span",dr,[x("span",{class:"text",innerHTML:k.title},null,8,fr)])]),L(b)?(J(),Q("div",hr,[k.text?(J(),Q("div",vr,[x("div",{class:"vp-doc",innerHTML:k.text},null,8,pr)])):we("",!0),f[14]||(f[14]=x("div",{class:"excerpt-gradient-bottom"},null,-1)),f[15]||(f[15]=x("div",{class:"excerpt-gradient-top"},null,-1))])):we("",!0)])],42,lr)],8,or))),128)),L(p)&&!w.value.length&&A.value?(J(),Q("li",mr,[he(ve(L(u)("modal.noResultsText"))+' "',1),x("strong",null,ve(L(p)),1),f[16]||(f[16]=he('" ',-1))])):we("",!0)],40,ar),x("div",gr,[x("span",null,[x("kbd",{"aria-label":L(u)("modal.footer.navigateUpKeyAriaLabel")},[...f[17]||(f[17]=[x("span",{class:"vpi-arrow-up navigate-icon"},null,-1)])],8,br),x("kbd",{"aria-label":L(u)("modal.footer.navigateDownKeyAriaLabel")},[...f[18]||(f[18]=[x("span",{class:"vpi-arrow-down navigate-icon"},null,-1)])],8,yr),he(" "+ve(L(u)("modal.footer.navigateText")),1)]),x("span",null,[x("kbd",{"aria-label":L(u)("modal.footer.selectKeyAriaLabel")},[...f[19]||(f[19]=[x("span",{class:"vpi-corner-down-left navigate-icon"},null,-1)])],8,wr),he(" "+ve(L(u)("modal.footer.selectText")),1)]),x("span",null,[x("kbd",{"aria-label":L(u)("modal.footer.closeKeyAriaLabel")},"esc",8,Sr),he(" "+ve(L(u)("modal.footer.closeText")),1)])])])],8,Yn)])}}}),Nr=tn(_r,[["__scopeId","data-v-40ea83c9"]]);export{Nr as default};