(self.webpackChunkpixelfed=self.webpackChunkpixelfed||[]).push([[898],{29655:(e,t,n)=>{"use strict";functiona(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}functionr(e,t,n){returntine?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}functiono(e,t){varn=Object.keys(e);if(Object.getOwnPropertySymbols){vara=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){returnObject.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}returnn}functioni(e){for(vart=1;t<arguments.length;t++){varn=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}returne}n.r(t),n.d(t,{default:()=>g});vars=function(e,t){returne.matches?e.matches(t):e.msMatchesSelector?e.msMatchesSelector(t):e.webkitMatchesSelector?e.webkitMatchesSelector(t):null},l=function(e,t){returne.closest?e.closest(t):function(e,t){for(varn=e;n&&1===n.nodeType;){if(s(n,t))returnn;n=n.parentNode}returnnull}(e,t)},c=function(e){returnBoolean(e&&"function"==typeofe.then)},u=functione(){vart=this,n=arguments.length>0&&void0!==arguments[0]?arguments[0]:{},o=n.search,i=n.autoSelect,s=void0!==i&&i,u=n.setValue,d=void0===u?function(){}:u,h=n.setAttribute,p=void0===h?function(){}:h,f=n.onUpdate,m=void0===f?function(){}:f,v=n.onSubmit,g=void0===v?function(){}:v,_=n.onShow,b=void0===_?function(){}:_,y=n.onHide,M=void0===y?function(){}:y,I=n.onLoading,B=void0===I?function(){}:I,k=n.onLoaded,P=void0===k?function(){}:k;a(this,e),r(this,"value",""),r(this,"searchCounter",0),r(this,"results",[]),r(this,"selectedIndex",-1),r(this,"handleInput",(function(e){varn=e.target.value;t.updateResults(n),t.value=n})),r(this,"handleKeyDown",(function(e){varn=e.key;switch(n){case"Up":case"Down":case"ArrowUp":case"ArrowDown":vara="ArrowUp"===n||"Up"===n?t.selectedIndex-1:t.selectedIndex+1;e.preventDefault(),t.handleArrows(a);break;case"Tab":t.selectResult();break;case"Enter":varr=t.results[t.selectedIndex];t.selectResult(),t.onSubmit(r);break;case"Esc":case"Escape":t.hideResults(),t.setValue();break;default:return}})),r(this,"handleFocus",(function(e){varn=e.target.value;t.updateResults(n),t.value=n})),r(this,"handleBlur",(function(){t.hideResults()})),r(this,"handleResultMouseDown",(function(e){e.preventDefault()})),r(this,"handleResultClick",(function(e){varn=e.target,a=l(n,"[data-result-index]");if(a){t.selectedIndex=parseInt(a.dataset.resultIndex,10);varr=t.results[t.selectedIndex];t.selectResult(),t.onSubmit(r)}})),r(this,"handleArrows",(function(e){varn=t.results.length;t.selectedIndex=(e%n+n)%n,t.onUpdate(t.results,t.selectedIndex)})),r(this,"selectResult",(function(){vare=t.results[t.selectedIndex];e&&t.setValue(e),t.hideResults()})),r(this,"updateResults",(function(e){varn=++t.searchCounter;t.onLoading(),t.search(e).then((function(e){n===t.searchCounter&&(t.results=e,t.onLoaded(),0!==t.results.length?(t.selectedIndex=t.autoSelect?0:-1,t.onUpdate(t.results,t.selectedIndex),t.showResults()):t.hideResults())}))})),r(this,"showResults",(function(){t.setAttribute("aria-expanded",!0),t.onShow()})),r(this,"hideResults",(function(){t.selectedIndex=-1,t.results=[],t.setAttribute("aria-expanded",!1),t.setAttribute("aria-activedescendant",""),t.onUpdate(t.results,t.selectedIndex),t.onHide()})),r(this,"checkSelectedResultVisible",(function(e){varn=e.querySelector('[data-result-index="'.concat(t.selectedIndex,'"]'));if(n){vara=e.getBoundingClientRect(),r=n.getBoundingClientRect();r.top<a.top?e.scrollTop-=a.top-r.top:r.bottom>a.bottom&&(e.scrollTop+=r.bottom-a.bottom)}})),this.search=c(o)?o:function(e){returnPromise.resolve(o(e))},this.autoSelect=s,this.setValue=d,this.setAttribute=p,this.onUpdate=m,this.onSubmit=g,this.onShow=b,this.onHide=M,this.onLoading=B,this.onLoaded=P},d=0,h=function(){vare=arguments.length>0&&void0!==arguments[0]?argum