2022-01-19 21:19:28 -05:00
|
|
|
var e,t,n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=function(e){try{return!!e()}catch(e){return!0}},o=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),i=function(e){return e&&e.Math==Math&&e},u=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof n&&n)||function(){return this}()||Function("return this")(),c=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),a=c,l=Function.prototype,f=l.bind,s=l.call,p=a&&f.bind(s,s),d=a?function(e){return e&&p(e)}:function(e){return e&&function(){return s.apply(e,arguments)}},g=function(e){return"function"==typeof e},v=r,y=g,h=/#|\.prototype\./,b=function(e,t){var n=x[m(e)];return n==w||n!=S&&(y(t)?v(t):!!t)},m=b.normalize=function(e){return String(e).replace(h,".").toLowerCase()},x=b.data={},S=b.NATIVE="N",w=b.POLYFILL="P",O=b,E=g,j=function(e){return"object"==typeof e?null!==e:E(e)},R=u,I=j,T=R.String,P=R.TypeError,C=function(e){if(I(e))return e;throw P(T(e)+" is not an object")},_=u,k=g,A=_.String,N=_.TypeError,$=d,M=C,F=function(e){if("object"==typeof e||k(e))return e;throw N("Can't set "+A(e)+" as a prototype")},L=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=$(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return M(n),F(r),t?e(n,r):n.__proto__=r,n}}():void 0),D=g,z=j,K=L,B={},U=j,W=u.document,Y=U(W)&&U(W.createElement),G=function(e){return Y?W.createElement(e):{}},V=G,q=!o&&!r((function(){return 7!=Object.defineProperty(V("div"),"a",{get:function(){return 7}}).a})),X=o&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),H=c,J=Function.prototype.call,Q=H?J.bind(J):function(){return J.apply(J,arguments)},Z=u,ee=g,te=function(e){return ee(e)?e:void 0},ne=function(e,t){return arguments.length<2?te(Z[e]):Z[e]&&Z[e][t]},re=d({}.isPrototypeOf),oe=u,ie=ne("navigator","userAgent")||"",ue=oe.process,ce=oe.Deno,ae=ue&&ue.versions||ce&&ce.version,le=ae&&ae.v8;le&&(t=(e=le.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&ie&&(!(e=ie.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=ie.match(/Chrome\/(\d+)/))&&(t=+e[1]);var fe=t,se=r,pe=!!Object.getOwnPropertySymbols&&!se((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&fe&&fe<41})),de=pe&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ge=ne,ve=g,ye=re,he=de,be=u.Object,me=he?function(e){return"symbol"==typeof e}:function(e){var t=ge("Symbol");return ve(t)&&ye(t.prototype,be(e))},xe=u.String,Se=g,we=function(e){try{return xe(e)}catch(e){return"Object"}},Oe=u.TypeError,Ee=function(e){if(Se(e))return e;throw Oe(we(e)+" is not a function")},je=function(e,t){var n=e[t];return null==n?void 0:Ee(n)},Re=Q,Ie=g,Te=j,Pe=u.TypeError,Ce={exports:{}},_e=u,ke=Object.defineProperty,Ae=function(e,t){try{ke(_e,e,{value:t,configurable:!0,writable:!0})}catch(n){_e[e]=t}return t},Ne=Ae,$e=u["__core-js_shared__"]||Ne("__core-js_shared__",{}),Me=$e;(Ce.exports=function(e,t){return Me[e]||(Me[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.20.3",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"});var Fe=u.TypeError,Le=function(e){if(null==e)throw Fe("Can't call method on "+e);return e},De=Le,ze=u.Object,Ke=function(e){return ze(De(e))},Be=Ke,Ue=d({}.hasOwnProperty),We=Object.hasOwn||function(e,t){return Ue(Be(e),t)},Ye=d,Ge=0,Ve=Math.random(),qe=Ye(1..toString),Xe=function(e){return"Symbol("+(void 0===e?"":e)+")_"+qe(++Ge+Ve,36)},He=u,Je=Ce.exports,Qe=We,Ze=Xe,et=pe,tt=de,nt=Je("wks"),rt=He.Symbol,ot=rt&&rt.for,it=tt?rt:rt&&rt.withoutSetter||Ze,ut=function(e){if(!Qe(nt,e)||!et&&"string"!=typeof nt[e]){var t="Symbol."+e;et&&Qe(rt,e)?nt[e]=rt[e]:nt[e]=tt&&ot?ot(t):it(t)}return nt[e]
|
2022-01-19 21:19:28 -05:00
|
|
|
*/;var Ec=function(){var e,t,n,r,o,i,u;function c(){(t=document.createElement("div")).classList.add("searchbox"),t.style.position="absolute",t.style.top="10px",t.style.right="10px",t.style.zIndex=10,t.innerHTML='<input type="search" class="searchinput" placeholder="Search..." style="vertical-align: top;"/>\n\t\t</span>',(n=t.querySelector(".searchinput")).style.width="240px",n.style.fontSize="14px",n.style.padding="4px 6px",n.style.color="#000",n.style.background="#fff",n.style.borderRadius="2px",n.style.border="0",n.style.outline="0",n.style.boxShadow="0 2px 18px rgba(0, 0, 0, 0.2)",n.style["-webkit-appearance"]="none",e.getRevealElement().appendChild(t),n.addEventListener("keyup",(function(t){if(13===t.keyCode)t.preventDefault(),function(){if(i){var t=n.value;""===t?(u&&u.remove(),r=null):(u=new f("slidecontent"),r=u.apply(t),o=0)}r&&(r.length&&r.length<=o&&(o=0),r.length>o&&(e.slide(r[o].h,r[o].v),o++))}(),i=!1;else i=!0}),!1),l()}function a(){t||c(),t.style.display="inline",n.focus(),n.select()}function l(){t||c(),t.style.display="none",u&&u.remove()}function f(t,n){var r=document.getElementById(t)||document.body,o=n||"EM",i=new RegExp("^(?:"+o+"|SCRIPT|FORM)$"),u=["#ff6","#a0ffff","#9f9","#f99","#f6f"],c=[],a=0,l="",f=[];this.setRegex=function(e){e=e.replace(/^[^\w]+|[^\w]+$/g,"").replace(/[^\w'-]+/g,"|"),l=new RegExp("("+e+")","i")},this.getRegex=function(){return l.toString().replace(/^\/\\b\(|\)\\b\/i$/g,"").replace(/\|/g," ")},this.hiliteWords=function(t){if(null!=t&&t&&l&&!i.test(t.nodeName)){if(t.hasChildNodes())for(var n=0;n<t.childNodes.length;n++)this.hiliteWords(t.childNodes[n]);var r,s;if(3==t.nodeType)if((r=t.nodeValue)&&(s=l.exec(r))){for(var p=t;null!=p&&"SECTION"!=p.nodeName;)p=p.parentNode;var d=e.getIndices(p),g=f.length,v=!1;for(n=0;n<g;n++)f[n].h===d.h&&f[n].v===d.v&&(v=!0);v||f.push(d),c[s[0].toLowerCase()]||(c[s[0].toLowerCase()]=u[a++%u.length]);var y=document.createElement(o);y.appendChild(document.createTextNode(s[0])),y.style.backgroundColor=c[s[0].toLowerCase()],y.style.fontStyle="inherit",y.style.color="#000";var h=t.splitText(s.index);h.nodeValue=h.nodeValue.substring(s[0].length),t.parentNode.insertBefore(y,h)}}},this.remove=function(){for(var e,t=document.getElementsByTagName(o);t.length&&(e=t[0]);)e.parentNode.replaceChild(e.firstChild,e)},this.apply=function(e){if(null!=e&&e)return this.remove(),this.setRegex(e),this.hiliteWords(r),f}}return{id:"search",init:function(n){(e=n).registerKeyboardShortcut("CTRL + Shift + F","Search"),document.addEventListener("keydown",(function(e){"F"==e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),t||c(),"inline"!==t.style.display?a():l())}),!1)},open:a}};export{Ec as default};
|