blog-hexo/public/js/5f00f278.js
2023-12-25 16:39:03 +08:00

2 lines
62 KiB
JavaScript

/*! For license information please see 5f00f278.js.LICENSE.txt */
(()=>{var e={886:function(e){e.exports=function(){"use strict";function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(n){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?t(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}function r(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function a(e){var t,n="algoliasearch-client-js-".concat(e.key),r=function(){return void 0===t&&(t=e.localStorage||window.localStorage),t},i=function(){return JSON.parse(r().getItem(n)||"{}")},a=function(e){r().setItem(n,JSON.stringify(e))},s=function(){var t=e.timeToLive?1e3*e.timeToLive:null,n=i(),r=Object.fromEntries(Object.entries(n).filter((function(e){return void 0!==o(e,2)[1].timestamp})));if(a(r),t){var s=Object.fromEntries(Object.entries(r).filter((function(e){var n=o(e,2)[1],r=(new Date).getTime();return!(n.timestamp+t<r)})));a(s)}};return{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){s();var t=JSON.stringify(e);return i()[t]})).then((function(e){return Promise.all([e?e.value:t(),void 0!==e])})).then((function(e){var t=o(e,2),r=t[0],i=t[1];return Promise.all([r,i||n.miss(r)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var o=i();return o[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:t},r().setItem(n,JSON.stringify(o)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=i();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){r().removeItem(n)}))}}}function s(e){var t=i(e.caches),n=t.shift();return void 0===n?{get:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,n.miss(e)])})).then((function(e){return o(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(e,r,o).catch((function(){return s({caches:t}).get(e,r,o)}))},set:function(e,r){return n.set(e,r).catch((function(){return s({caches:t}).set(e,r)}))},delete:function(e){return n.delete(e).catch((function(){return s({caches:t}).delete(e)}))},clear:function(){return n.clear().catch((function(){return s({caches:t}).clear()}))}}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},i=JSON.stringify(n);if(i in t)return Promise.resolve(e.serializable?JSON.parse(t[i]):t[i]);var a=r(),s=o&&o.miss||function(){return Promise.resolve()};return a.then((function(e){return s(e)})).then((function(){return a}))},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function c(e,t,n){var r={"x-algolia-api-key":n,"x-algolia-application-id":t};return{headers:function(){return e===h.WithinHeaders?r:{}},queryParameters:function(){return e===h.WithinQueryParameters?r:{}}}}function l(e){var t=0;return e((function n(){return t++,new Promise((function(r){setTimeout((function(){r(e(n))}),Math.min(100*t,1e3))}))}))}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return Promise.resolve()};return Object.assign(e,{wait:function(n){return d(e.then((function(e){return Promise.all([t(e,n),e])})).then((function(e){return e[1]})))}})}function f(e){for(var t=e.length-1;t>0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}function p(e,t){return t?(Object.keys(t).forEach((function(n){e[n]=t[n](e)})),e):e}function m(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0;return e.replace(/%s/g,(function(){return encodeURIComponent(n[o++])}))}var h={WithinQueryParameters:0,WithinHeaders:1};function y(e,t){var n=e||{},r=n.data||{};return Object.keys(n).forEach((function(e){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(r[e]=n[e])})),{data:Object.entries(r).length>0?r:void 0,timeout:n.timeout||t,headers:n.headers||{},queryParameters:n.queryParameters||{},cacheable:n.cacheable}}var g={Read:1,Write:2,Any:3},v=1,b=2,w=3;function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;return n(n({},e),{},{status:t,lastUpdate:Date.now()})}function E(e){return"string"==typeof e?{protocol:"https",url:e,accept:g.Any}:{protocol:e.protocol||"https",url:e.url,accept:e.accept||g.Any}}var T="DELETE",S="GET",D="POST",k="PUT";function I(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(x(t))}))}))).then((function(e){var n=e.filter((function(e){return function(e){return e.status===v||Date.now()-e.lastUpdate>12e4}(e)})),r=e.filter((function(e){return function(e){return e.status===w&&Date.now()-e.lastUpdate<=12e4}(e)})),o=[].concat(i(n),i(r));return{getTimeout:function(e,t){return(0===r.length&&0===e?1:r.length+3+e)*t},statelessHosts:o.length>0?o.map((function(e){return E(e)})):t}}))}function O(e,t,r,o){var a=[],s=function(e,t){if(e.method!==S&&(void 0!==e.data||void 0!==t.data)){var r=Array.isArray(e.data)?e.data:n(n({},e.data),t.data);return JSON.stringify(r)}}(r,o),u=function(e,t){var r=n(n({},e.headers),t.headers),o={};return Object.keys(r).forEach((function(e){var t=r[e];o[e.toLowerCase()]=t})),o}(e,o),c=r.method,l=r.method!==S?{}:n(n({},r.data),o.data),d=n(n(n({"x-algolia-agent":e.userAgent.value},e.queryParameters),l),o.queryParameters),f=0,p=function t(n,i){var l=n.pop();if(void 0===l)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:C(a)};var p={data:s,headers:u,method:c,url:R(l,r.path,d),connectTimeout:i(f,e.timeouts.connect),responseTimeout:i(f,o.timeout)},m=function(e){var t={request:p,response:e,host:l,triesLeft:n.length};return a.push(t),t},h={onSuccess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(r){var o=m(r);return r.isTimedOut&&f++,Promise.all([e.logger.info("Retryable failure",L(o)),e.hostsCache.set(l,x(l,r.isTimedOut?w:b))]).then((function(){return t(n,i)}))},onFail:function(e){throw m(e),function(e,t){var n=e.content,r=e.status,o=n;try{o=JSON.parse(n).message}catch(e){}return function(e,t,n){return{name:"ApiError",message:e,status:t,transporterStackTrace:n}}(o,r,t)}(e,C(a))}};return e.requester.send(p).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,n=e.status;return!t&&0==~~n}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSuccess(e):t.onFail(e)}(e,h)}))};return I(e.hostsCache,t).then((function(e){return p(i(e.statelessHosts).reverse(),e.getTimeout)}))}function A(e){var t=e.hostsCache,n=e.logger,r=e.requester,i=e.requestsCache,a=e.responsesCache,s=e.timeouts,u=e.userAgent,c=e.hosts,l=e.queryParameters,d={hostsCache:t,logger:n,requester:r,requestsCache:i,responsesCache:a,timeouts:s,userAgent:u,headers:e.headers,queryParameters:l,hosts:c.map((function(e){return E(e)})),read:function(e,t){var n=y(t,d.timeouts.read),r=function(){return O(d,d.hosts.filter((function(e){return 0!=(e.accept&g.Read)})),e,n)};if(!0!==(void 0!==n.cacheable?n.cacheable:e.cacheable))return r();var i={request:e,mappedRequestOptions:n,transporter:{queryParameters:d.queryParameters,headers:d.headers}};return d.responsesCache.get(i,(function(){return d.requestsCache.get(i,(function(){return d.requestsCache.set(i,r()).then((function(e){return Promise.all([d.requestsCache.delete(i),e])}),(function(e){return Promise.all([d.requestsCache.delete(i),Promise.reject(e)])})).then((function(e){var t=o(e,2);return t[0],t[1]}))}))}),{miss:function(e){return d.responsesCache.set(i,e)}})},write:function(e,t){return O(d,d.hosts.filter((function(e){return 0!=(e.accept&g.Write)})),e,y(t,d.timeouts.write))}};return d}function N(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var n="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(n)&&(t.value="".concat(t.value).concat(n)),t}};return t}function R(e,t,n){var r=P(n),o="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return r.length&&(o+="?".concat(r)),o}function P(e){return Object.keys(e).map((function(t){return m("%s=%s",t,(n=e[t],"[object Object]"===Object.prototype.toString.call(n)||"[object Array]"===Object.prototype.toString.call(n)?JSON.stringify(e[t]):e[t]));var n})).join("&")}function C(e){return e.map((function(e){return L(e)}))}function L(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return n(n({},e),{},{request:n(n({},e.request),{},{headers:n(n({},e.request.headers),t)})})}var _=function(e){return function(t,n){return e.transporter.write({method:D,path:"2/abtests",data:t},n)}},j=function(e){return function(t,n){return e.transporter.write({method:T,path:m("2/abtests/%s",t)},n)}},q=function(e){return function(t,n){return e.transporter.read({method:S,path:m("2/abtests/%s",t)},n)}},M=function(e){return function(t){return e.transporter.read({method:S,path:"2/abtests"},t)}},U=function(e){return function(t,n){return e.transporter.write({method:D,path:m("2/abtests/%s/stop",t)},n)}},z=function(e){return function(t){return e.transporter.read({method:S,path:"1/strategies/personalization"},t)}},F=function(e){return function(t,n){return e.transporter.write({method:D,path:"1/strategies/personalization",data:t},n)}};function H(e){return function t(n){return e.request(n).then((function(r){if(void 0!==e.batch&&e.batch(r.hits),!e.shouldStop(r))return r.cursor?t({cursor:r.cursor}):t({page:(n.page||0)+1})}))}({})}var W=function(e){return function(t,o){var i=o||{},a=i.queryParameters,s=r(i,["queryParameters"]),u=n({acl:t},void 0!==a?{queryParameters:a}:{});return d(e.transporter.write({method:D,path:"1/keys",data:u},s),(function(t,n){return l((function(r){return ee(e)(t.key,n).catch((function(e){if(404!==e.status)throw e;return r()}))}))}))}},B=function(e){return function(t,n,r){var o=y(r);return o.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:D,path:"1/clusters/mapping",data:{cluster:n}},o)}},K=function(e){return function(t,n,r){return e.transporter.write({method:D,path:"1/clusters/mapping/batch",data:{users:t,cluster:n}},r)}},G=function(e){return function(t,n){return d(e.transporter.write({method:D,path:m("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},n),(function(t,n){return De(e)(t.taskID,n)}))}},Y=function(e){return function(t,n,r){return d(e.transporter.write({method:D,path:m("1/indexes/%s/operation",t),data:{operation:"copy",destination:n}},r),(function(n,r){return se(e)(t,{methods:{waitTask:dt}}).waitTask(n.taskID,r)}))}},J=function(e){return function(t,r,o){return Y(e)(t,r,n(n({},o),{},{scope:[pt.Rules]}))}},V=function(e){return function(t,r,o){return Y(e)(t,r,n(n({},o),{},{scope:[pt.Settings]}))}},X=function(e){return function(t,r,o){return Y(e)(t,r,n(n({},o),{},{scope:[pt.Synonyms]}))}},Q=function(e){return function(t,n){return t.method===S?e.transporter.read(t,n):e.transporter.write(t,n)}},$=function(e){return function(t,n){return d(e.transporter.write({method:T,path:m("1/keys/%s",t)},n),(function(n,r){return l((function(n){return ee(e)(t,r).then(n).catch((function(e){if(404!==e.status)throw e}))}))}))}},Z=function(e){return function(t,n,r){var o=n.map((function(e){return{action:"deleteEntry",body:{objectID:e}}}));return d(e.transporter.write({method:D,path:m("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!1,requests:o}},r),(function(t,n){return De(e)(t.taskID,n)}))}},ee=function(e){return function(t,n){return e.transporter.read({method:S,path:m("1/keys/%s",t)},n)}},te=function(e){return function(t,n){return e.transporter.read({method:S,path:m("1/task/%s",t.toString())},n)}},ne=function(e){return function(t){return e.transporter.read({method:S,path:"/1/dictionaries/*/settings"},t)}},re=function(e){return function(t){return e.transporter.read({method:S,path:"1/logs"},t)}},oe=function(e){return function(t){return e.transporter.read({method:S,path:"1/clusters/mapping/top"},t)}},ie=function(e){return function(t,n){return e.transporter.read({method:S,path:m("1/clusters/mapping/%s",t)},n)}},ae=function(e){return function(t){var n=t||{},o=n.retrieveMappings,i=r(n,["retrieveMappings"]);return!0===o&&(i.getClusters=!0),e.transporter.read({method:S,path:"1/clusters/mapping/pending"},i)}},se=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return p({transporter:e.transporter,appId:e.appId,indexName:t},n.methods)}},ue=function(e){return function(t){return e.transporter.read({method:S,path:"1/keys"},t)}},ce=function(e){return function(t){return e.transporter.read({method:S,path:"1/clusters"},t)}},le=function(e){return function(t){return e.transporter.read({method:S,path:"1/indexes"},t)}},de=function(e){return function(t){return e.transporter.read({method:S,path:"1/clusters/mapping"},t)}},fe=function(e){return function(t,n,r){return d(e.transporter.write({method:D,path:m("1/indexes/%s/operation",t),data:{operation:"move",destination:n}},r),(function(n,r){return se(e)(t,{methods:{waitTask:dt}}).waitTask(n.taskID,r)}))}},pe=function(e){return function(t,n){return d(e.transporter.write({method:D,path:"1/indexes/*/batch",data:{requests:t}},n),(function(t,n){return Promise.all(Object.keys(t.taskID).map((function(r){return se(e)(r,{methods:{waitTask:dt}}).waitTask(t.taskID[r],n)})))}))}},me=function(e){return function(t,n){return e.transporter.read({method:D,path:"1/indexes/*/objects",data:{requests:t}},n)}},he=function(e){return function(t,r){var o=t.map((function(e){return n(n({},e),{},{params:P(e.params||{})})}));return e.transporter.read({method:D,path:"1/indexes/*/queries",data:{requests:o},cacheable:!0},r)}},ye=function(e){return function(t,o){return Promise.all(t.map((function(t){var i=t.params,a=i.facetName,s=i.facetQuery,u=r(i,["facetName","facetQuery"]);return se(e)(t.indexName,{methods:{searchForFacetValues:st}}).searchForFacetValues(a,s,n(n({},o),u))})))}},ge=function(e){return function(t,n){var r=y(n);return r.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:T,path:"1/clusters/mapping"},r)}},ve=function(e){return function(t,n,r){var o=n.map((function(e){return{action:"addEntry",body:e}}));return d(e.transporter.write({method:D,path:m("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!0,requests:o}},r),(function(t,n){return De(e)(t.taskID,n)}))}},be=function(e){return function(t,n){return d(e.transporter.write({method:D,path:m("1/keys/%s/restore",t)},n),(function(n,r){return l((function(n){return ee(e)(t,r).catch((function(e){if(404!==e.status)throw e;return n()}))}))}))}},we=function(e){return function(t,n,r){var o=n.map((function(e){return{action:"addEntry",body:e}}));return d(e.transporter.write({method:D,path:m("/1/dictionaries/%s/batch",t),data:{clearExistingDictionaryEntries:!1,requests:o}},r),(function(t,n){return De(e)(t.taskID,n)}))}},xe=function(e){return function(t,n,r){return e.transporter.read({method:D,path:m("/1/dictionaries/%s/search",t),data:{query:n},cacheable:!0},r)}},Ee=function(e){return function(t,n){return e.transporter.read({method:D,path:"1/clusters/mapping/search",data:{query:t}},n)}},Te=function(e){return function(t,n){return d(e.transporter.write({method:k,path:"/1/dictionaries/*/settings",data:t},n),(function(t,n){return De(e)(t.taskID,n)}))}},Se=function(e){return function(t,n){var o=Object.assign({},n),i=n||{},a=i.queryParameters,s=r(i,["queryParameters"]),u=a?{queryParameters:a}:{},c=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return d(e.transporter.write({method:k,path:m("1/keys/%s",t),data:u},s),(function(n,r){return l((function(n){return ee(e)(t,r).then((function(e){return function(e){return Object.keys(o).filter((function(e){return-1!==c.indexOf(e)})).every((function(t){if(Array.isArray(e[t])&&Array.isArray(o[t])){var n=e[t];return n.length===o[t].length&&n.every((function(e,n){return e===o[t][n]}))}return e[t]===o[t]}))}(e)?Promise.resolve():n()}))}))}))}},De=function(e){return function(t,n){return l((function(r){return te(e)(t,n).then((function(e){return"published"!==e.status?r():void 0}))}))}},ke=function(e){return function(t,n){return d(e.transporter.write({method:D,path:m("1/indexes/%s/batch",e.indexName),data:{requests:t}},n),(function(t,n){return dt(e)(t.taskID,n)}))}},Ie=function(e){return function(t){return H(n(n({shouldStop:function(e){return void 0===e.cursor}},t),{},{request:function(n){return e.transporter.read({method:D,path:m("1/indexes/%s/browse",e.indexName),data:n},t)}}))}},Oe=function(e){return function(t){var r=n({hitsPerPage:1e3},t);return H(n(n({shouldStop:function(e){return e.hits.length<r.hitsPerPage}},r),{},{request:function(t){return ut(e)("",n(n({},r),t)).then((function(e){return n(n({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},Ae=function(e){return function(t){var r=n({hitsPerPage:1e3},t);return H(n(n({shouldStop:function(e){return e.hits.length<r.hitsPerPage}},r),{},{request:function(t){return ct(e)("",n(n({},r),t)).then((function(e){return n(n({},e),{},{hits:e.hits.map((function(e){return delete e._highlightResult,e}))})}))}}))}},Ne=function(e){return function(t,n,o){var i=o||{},a=i.batchSize,s=r(i,["batchSize"]),u={taskIDs:[],objectIDs:[]};return d(function r(){var o,i=[];for(o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;o<t.length&&(i.push(t[o]),i.length!==(a||1e3));o++);return 0===i.length?Promise.resolve(u):ke(e)(i.map((function(e){return{action:n,body:e}})),s).then((function(e){return u.objectIDs=u.objectIDs.concat(e.objectIDs),u.taskIDs.push(e.taskID),o++,r(o)}))}(),(function(t,n){return Promise.all(t.taskIDs.map((function(t){return dt(e)(t,n)})))}))}},Re=function(e){return function(t){return d(e.transporter.write({method:D,path:m("1/indexes/%s/clear",e.indexName)},t),(function(t,n){return dt(e)(t.taskID,n)}))}},Pe=function(e){return function(t){var n=t||{},o=n.forwardToReplicas,i=y(r(n,["forwardToReplicas"]));return o&&(i.queryParameters.forwardToReplicas=1),d(e.transporter.write({method:D,path:m("1/indexes/%s/rules/clear",e.indexName)},i),(function(t,n){return dt(e)(t.taskID,n)}))}},Ce=function(e){return function(t){var n=t||{},o=n.forwardToReplicas,i=y(r(n,["forwardToReplicas"]));return o&&(i.queryParameters.forwardToReplicas=1),d(e.transporter.write({method:D,path:m("1/indexes/%s/synonyms/clear",e.indexName)},i),(function(t,n){return dt(e)(t.taskID,n)}))}},Le=function(e){return function(t,n){return d(e.transporter.write({method:D,path:m("1/indexes/%s/deleteByQuery",e.indexName),data:t},n),(function(t,n){return dt(e)(t.taskID,n)}))}},_e=function(e){return function(t){return d(e.transporter.write({method:T,path:m("1/indexes/%s",e.indexName)},t),(function(t,n){return dt(e)(t.taskID,n)}))}},je=function(e){return function(t,n){return d(qe(e)([t],n).then((function(e){return{taskID:e.taskIDs[0]}})),(function(t,n){return dt(e)(t.taskID,n)}))}},qe=function(e){return function(t,n){var r=t.map((function(e){return{objectID:e}}));return Ne(e)(r,ft.DeleteObject,n)}},Me=function(e){return function(t,n){var o=n||{},i=o.forwardToReplicas,a=y(r(o,["forwardToReplicas"]));return i&&(a.queryParameters.forwardToReplicas=1),d(e.transporter.write({method:T,path:m("1/indexes/%s/rules/%s",e.indexName,t)},a),(function(t,n){return dt(e)(t.taskID,n)}))}},Ue=function(e){return function(t,n){var o=n||{},i=o.forwardToReplicas,a=y(r(o,["forwardToReplicas"]));return i&&(a.queryParameters.forwardToReplicas=1),d(e.transporter.write({method:T,path:m("1/indexes/%s/synonyms/%s",e.indexName,t)},a),(function(t,n){return dt(e)(t.taskID,n)}))}},ze=function(e){return function(t){return Ye(e)(t).then((function(){return!0})).catch((function(e){if(404!==e.status)throw e;return!1}))}},Fe=function(e){return function(t,n,r){return e.transporter.read({method:D,path:m("1/answers/%s/prediction",e.indexName),data:{query:t,queryLanguages:n},cacheable:!0},r)}},He=function(e){return function(t,i){var a=i||{},s=a.query,u=a.paginate,c=r(a,["query","paginate"]),l=0;return function r(){return at(e)(s||"",n(n({},c),{},{page:l})).then((function(e){for(var n=0,i=Object.entries(e.hits);n<i.length;n++){var a=o(i[n],2),s=a[0],c=a[1];if(t(c))return{object:c,position:parseInt(s,10),page:l}}if(l++,!1===u||l>=e.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return r()}))}()}},We=function(e){return function(t,n){return e.transporter.read({method:S,path:m("1/indexes/%s/%s",e.indexName,t)},n)}},Be=function(){return function(e,t){for(var n=0,r=Object.entries(e.hits);n<r.length;n++){var i=o(r[n],2),a=i[0];if(i[1].objectID===t)return parseInt(a,10)}return-1}},Ke=function(e){return function(t,o){var i=o||{},a=i.attributesToRetrieve,s=r(i,["attributesToRetrieve"]),u=t.map((function(t){return n({indexName:e.indexName,objectID:t},a?{attributesToRetrieve:a}:{})}));return e.transporter.read({method:D,path:"1/indexes/*/objects",data:{requests:u}},s)}},Ge=function(e){return function(t,n){return e.transporter.read({method:S,path:m("1/indexes/%s/rules/%s",e.indexName,t)},n)}},Ye=function(e){return function(t){return e.transporter.read({method:S,path:m("1/indexes/%s/settings",e.indexName),data:{getVersion:2}},t)}},Je=function(e){return function(t,n){return e.transporter.read({method:S,path:m("1/indexes/%s/synonyms/%s",e.indexName,t)},n)}},Ve=function(e){return function(t,n){return d(Xe(e)([t],n).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,n){return dt(e)(t.taskID,n)}))}},Xe=function(e){return function(t,n){var o=n||{},i=o.createIfNotExists,a=r(o,["createIfNotExists"]),s=i?ft.PartialUpdateObject:ft.PartialUpdateObjectNoCreate;return Ne(e)(t,s,a)}},Qe=function(e){return function(t,a){var s=a||{},u=s.safe,c=s.autoGenerateObjectIDIfNotExist,l=s.batchSize,f=r(s,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),p=function(t,n,r,o){return d(e.transporter.write({method:D,path:m("1/indexes/%s/operation",t),data:{operation:r,destination:n}},o),(function(t,n){return dt(e)(t.taskID,n)}))},h=Math.random().toString(36).substring(7),y="".concat(e.indexName,"_tmp_").concat(h),g=tt({appId:e.appId,transporter:e.transporter,indexName:y}),v=[],b=p(e.indexName,y,"copy",n(n({},f),{},{scope:["settings","synonyms","rules"]}));return v.push(b),d((u?b.wait(f):b).then((function(){var e=g(t,n(n({},f),{},{autoGenerateObjectIDIfNotExist:c,batchSize:l}));return v.push(e),u?e.wait(f):e})).then((function(){var t=p(y,e.indexName,"move",f);return v.push(t),u?t.wait(f):t})).then((function(){return Promise.all(v)})).then((function(e){var t=o(e,3),n=t[0],r=t[1],a=t[2];return{objectIDs:r.objectIDs,taskIDs:[n.taskID].concat(i(r.taskIDs),[a.taskID])}})),(function(e,t){return Promise.all(v.map((function(e){return e.wait(t)})))}))}},$e=function(e){return function(t,r){return rt(e)(t,n(n({},r),{},{clearExistingRules:!0}))}},Ze=function(e){return function(t,r){return it(e)(t,n(n({},r),{},{clearExistingSynonyms:!0}))}},et=function(e){return function(t,n){return d(tt(e)([t],n).then((function(e){return{objectID:e.objectIDs[0],taskID:e.taskIDs[0]}})),(function(t,n){return dt(e)(t.taskID,n)}))}},tt=function(e){return function(t,n){var o=n||{},i=o.autoGenerateObjectIDIfNotExist,a=r(o,["autoGenerateObjectIDIfNotExist"]),s=i?ft.AddObject:ft.UpdateObject;if(s===ft.UpdateObject){var u=!0,c=!1,l=void 0;try{for(var f,p=t[Symbol.iterator]();!(u=(f=p.next()).done);u=!0)if(void 0===f.value.objectID)return d(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(e){c=!0,l=e}finally{try{u||null==p.return||p.return()}finally{if(c)throw l}}}return Ne(e)(t,s,a)}},nt=function(e){return function(t,n){return rt(e)([t],n)}},rt=function(e){return function(t,n){var o=n||{},i=o.forwardToReplicas,a=o.clearExistingRules,s=y(r(o,["forwardToReplicas","clearExistingRules"]));return i&&(s.queryParameters.forwardToReplicas=1),a&&(s.queryParameters.clearExistingRules=1),d(e.transporter.write({method:D,path:m("1/indexes/%s/rules/batch",e.indexName),data:t},s),(function(t,n){return dt(e)(t.taskID,n)}))}},ot=function(e){return function(t,n){return it(e)([t],n)}},it=function(e){return function(t,n){var o=n||{},i=o.forwardToReplicas,a=o.clearExistingSynonyms,s=o.replaceExistingSynonyms,u=y(r(o,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return i&&(u.queryParameters.forwardToReplicas=1),(s||a)&&(u.queryParameters.replaceExistingSynonyms=1),d(e.transporter.write({method:D,path:m("1/indexes/%s/synonyms/batch",e.indexName),data:t},u),(function(t,n){return dt(e)(t.taskID,n)}))}},at=function(e){return function(t,n){return e.transporter.read({method:D,path:m("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},n)}},st=function(e){return function(t,n,r){return e.transporter.read({method:D,path:m("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:n},cacheable:!0},r)}},ut=function(e){return function(t,n){return e.transporter.read({method:D,path:m("1/indexes/%s/rules/search",e.indexName),data:{query:t}},n)}},ct=function(e){return function(t,n){return e.transporter.read({method:D,path:m("1/indexes/%s/synonyms/search",e.indexName),data:{query:t}},n)}},lt=function(e){return function(t,n){var o=n||{},i=o.forwardToReplicas,a=y(r(o,["forwardToReplicas"]));return i&&(a.queryParameters.forwardToReplicas=1),d(e.transporter.write({method:k,path:m("1/indexes/%s/settings",e.indexName),data:t},a),(function(t,n){return dt(e)(t.taskID,n)}))}},dt=function(e){return function(t,n){return l((function(r){return function(e){return function(t,n){return e.transporter.read({method:S,path:m("1/indexes/%s/task/%s",e.indexName,t.toString())},n)}}(e)(t,n).then((function(e){return"published"!==e.status?r():void 0}))}))}},ft={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},pt={Settings:"settings",Synonyms:"synonyms",Rules:"rules"};function mt(e,t,r){var o={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return n.setRequestHeader(t,e.headers[t])}));var r,o=function(e,r){return setTimeout((function(){n.abort(),t({status:0,content:r,isTimedOut:!0})}),1e3*e)},i=o(e.connectTimeout,"Connection timeout");n.onreadystatechange=function(){n.readyState>n.OPENED&&void 0===r&&(clearTimeout(i),r=o(e.responseTimeout,"Socket timeout"))},n.onerror=function(){0===n.status&&(clearTimeout(i),clearTimeout(r),t({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=function(){clearTimeout(i),clearTimeout(r),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)}))}},logger:{debug:function(e,t){return Promise.resolve()},info:function(e,t){return Promise.resolve()},error:function(e,t){return Promise.resolve()}},responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:s({caches:[a({key:"".concat("4.20.0","-").concat(e)}),u()]}),userAgent:N("4.20.0").add({segment:"Browser"})},i=n(n({},o),r),l=function(){return function(e){return function(e){var t=e.region||"us",r=c(h.WithinHeaders,e.appId,e.apiKey),o=A(n(n({hosts:[{url:"personalization.".concat(t,".algolia.com")}]},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/json"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return p({appId:e.appId,transporter:o},e.methods)}(n(n(n({},o),e),{},{methods:{getPersonalizationStrategy:z,setPersonalizationStrategy:F}}))}};return function(e){var t=e.appId,r=c(void 0!==e.authMode?e.authMode:h.WithinHeaders,t,e.apiKey),o=A(n(n({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:g.Read},{url:"".concat(t,".algolia.net"),accept:g.Write}].concat(f([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/x-www-form-urlencoded"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return p({transporter:o,appId:t,addAlgoliaAgent:function(e,t){o.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then((function(){}))}},e.methods)}(n(n({},i),{},{methods:{search:he,searchForFacetValues:ye,multipleBatch:pe,multipleGetObjects:me,multipleQueries:he,copyIndex:Y,copySettings:V,copySynonyms:X,copyRules:J,moveIndex:fe,listIndices:le,getLogs:re,listClusters:ce,multipleSearchForFacetValues:ye,getApiKey:ee,addApiKey:W,listApiKeys:ue,updateApiKey:Se,deleteApiKey:$,restoreApiKey:be,assignUserID:B,assignUserIDs:K,getUserID:ie,searchUserIDs:Ee,listUserIDs:de,getTopUserIDs:oe,removeUserID:ge,hasPendingMappings:ae,clearDictionaryEntries:G,deleteDictionaryEntries:Z,getDictionarySettings:ne,getAppTask:te,replaceDictionaryEntries:ve,saveDictionaryEntries:we,searchDictionaryEntries:xe,setDictionarySettings:Te,waitAppTask:De,customRequest:Q,initIndex:function(e){return function(t){return se(e)(t,{methods:{batch:ke,delete:_e,findAnswers:Fe,getObject:We,getObjects:Ke,saveObject:et,saveObjects:tt,search:at,searchForFacetValues:st,waitTask:dt,setSettings:lt,getSettings:Ye,partialUpdateObject:Ve,partialUpdateObjects:Xe,deleteObject:je,deleteObjects:qe,deleteBy:Le,clearObjects:Re,browseObjects:Ie,getObjectPosition:Be,findObject:He,exists:ze,saveSynonym:ot,saveSynonyms:it,getSynonym:Je,searchSynonyms:ct,browseSynonyms:Ae,deleteSynonym:Ue,clearSynonyms:Ce,replaceAllObjects:Qe,replaceAllSynonyms:Ze,searchRules:ut,getRule:Ge,deleteRule:Me,saveRule:nt,saveRules:rt,replaceAllRules:$e,browseRules:Oe,clearRules:Pe}})}},initAnalytics:function(){return function(e){return function(e){var t=e.region||"us",r=c(h.WithinHeaders,e.appId,e.apiKey),o=A(n(n({hosts:[{url:"analytics.".concat(t,".algolia.com")}]},e),{},{headers:n(n(n({},r.headers()),{"content-type":"application/json"}),e.headers),queryParameters:n(n({},r.queryParameters()),e.queryParameters)}));return p({appId:e.appId,transporter:o},e.methods)}(n(n(n({},o),e),{},{methods:{addABTest:_,getABTest:q,getABTests:M,stopABTest:U,deleteABTest:j}}))}},initPersonalization:l,initRecommendation:function(){return function(e){return i.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),l()(e)}}}}))}return mt.version="4.20.0",mt}()},76:function(e){e.exports=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:o}=Object;let{freeze:i,seal:a,create:s}=Object,{apply:u,construct:c}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),u||(u=function(e,t,n){return e.apply(t,n)}),c||(c=function(e,t){return new e(...t)});const l=x(Array.prototype.forEach),d=x(Array.prototype.pop),f=x(Array.prototype.push),p=x(String.prototype.toLowerCase),m=x(String.prototype.toString),h=x(String.prototype.match),y=x(String.prototype.replace),g=x(String.prototype.indexOf),v=x(String.prototype.trim),b=x(RegExp.prototype.test),w=E(TypeError);function x(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return u(e,t,r)}}function E(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return c(e,n)}}function T(e,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p;t&&t(e,null);let i=r.length;for(;i--;){let t=r[i];if("string"==typeof t){const e=o(t);e!==t&&(n(r)||(r[i]=e),t=e)}e[t]=!0}return e}function S(t){const n=s(null);for(const[r,i]of e(t))void 0!==o(t,r)&&(n[r]=i);return n}function D(e,t){for(;null!==e;){const n=o(e,t);if(n){if(n.get)return x(n.get);if("function"==typeof n.value)return x(n.value)}e=r(e)}function n(e){return null}return n}const k=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),I=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),O=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),A=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),N=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),R=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),P=i(["#text"]),C=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),L=i(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),_=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),j=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),q=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),M=a(/<%[\w\W]*|[\w\W]*%>/gm),U=a(/\${[\w\W]*}/gm),z=a(/^data-[\-\w.\u00B7-\uFFFF]/),F=a(/^aria-[\-\w]+$/),H=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),W=a(/^(?:\w+script|data):/i),B=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i);var G=Object.freeze({__proto__:null,MUSTACHE_EXPR:q,ERB_EXPR:M,TMPLIT_EXPR:U,DATA_ATTR:z,ARIA_ATTR:F,IS_ALLOWED_URI:H,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:B,DOCTYPE_NAME:K});const Y=function(){return"undefined"==typeof window?null:window},J=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return null}};function V(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Y();const n=e=>V(e);if(n.version="3.0.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const o=r,a=o.currentScript,{DocumentFragment:u,HTMLTemplateElement:c,Node:x,Element:E,NodeFilter:q,NamedNodeMap:M=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:U,DOMParser:z,trustedTypes:F}=t,W=E.prototype,B=D(W,"cloneNode"),X=D(W,"nextSibling"),Q=D(W,"childNodes"),$=D(W,"parentNode");if("function"==typeof c){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let Z,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:re,getElementsByTagName:oe}=r,{importNode:ie}=o;let ae={};n.isSupported="function"==typeof e&&"function"==typeof $&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:se,ERB_EXPR:ue,TMPLIT_EXPR:ce,DATA_ATTR:le,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:fe,ATTR_WHITESPACE:pe}=G;let{IS_ALLOWED_URI:me}=G,he=null;const ye=T({},[...k,...I,...O,...N,...P]);let ge=null;const ve=T({},[...C,...L,..._,...j]);let be=Object.seal(s(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),we=null,xe=null,Ee=!0,Te=!0,Se=!1,De=!0,ke=!1,Ie=!1,Oe=!1,Ae=!1,Ne=!1,Re=!1,Pe=!1,Ce=!0,Le=!1;const _e="user-content-";let je=!0,qe=!1,Me={},Ue=null;const ze=T({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Fe=null;const He=T({},["audio","video","img","source","image","track"]);let We=null;const Be=T({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ke="http://www.w3.org/1998/Math/MathML",Ge="http://www.w3.org/2000/svg",Ye="http://www.w3.org/1999/xhtml";let Je=Ye,Ve=!1,Xe=null;const Qe=T({},[Ke,Ge,Ye],m);let $e=null;const Ze=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const rt=r.createElement("form"),ot=function(e){return e instanceof RegExp||e instanceof Function},it=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}),e=S(e),$e=$e=-1===Ze.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===$e?m:p,he="ALLOWED_TAGS"in e?T({},e.ALLOWED_TAGS,tt):ye,ge="ALLOWED_ATTR"in e?T({},e.ALLOWED_ATTR,tt):ve,Xe="ALLOWED_NAMESPACES"in e?T({},e.ALLOWED_NAMESPACES,m):Qe,We="ADD_URI_SAFE_ATTR"in e?T(S(Be),e.ADD_URI_SAFE_ATTR,tt):Be,Fe="ADD_DATA_URI_TAGS"in e?T(S(He),e.ADD_DATA_URI_TAGS,tt):He,Ue="FORBID_CONTENTS"in e?T({},e.FORBID_CONTENTS,tt):ze,we="FORBID_TAGS"in e?T({},e.FORBID_TAGS,tt):{},xe="FORBID_ATTR"in e?T({},e.FORBID_ATTR,tt):{},Me="USE_PROFILES"in e&&e.USE_PROFILES,Ee=!1!==e.ALLOW_ARIA_ATTR,Te=!1!==e.ALLOW_DATA_ATTR,Se=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ke=e.SAFE_FOR_TEMPLATES||!1,Ie=e.WHOLE_DOCUMENT||!1,Ne=e.RETURN_DOM||!1,Re=e.RETURN_DOM_FRAGMENT||!1,Pe=e.RETURN_TRUSTED_TYPE||!1,Ae=e.FORCE_BODY||!1,Ce=!1!==e.SANITIZE_DOM,Le=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,qe=e.IN_PLACE||!1,me=e.ALLOWED_URI_REGEXP||H,Je=e.NAMESPACE||Ye,be=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(be.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(Te=!1),Re&&(Ne=!0),Me&&(he=T({},[...P]),ge=[],!0===Me.html&&(T(he,k),T(ge,C)),!0===Me.svg&&(T(he,I),T(ge,L),T(ge,j)),!0===Me.svgFilters&&(T(he,O),T(ge,L),T(ge,j)),!0===Me.mathMl&&(T(he,N),T(ge,_),T(ge,j))),e.ADD_TAGS&&(he===ye&&(he=S(he)),T(he,e.ADD_TAGS,tt)),e.ADD_ATTR&&(ge===ve&&(ge=S(ge)),T(ge,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&T(We,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(Ue===ze&&(Ue=S(Ue)),T(Ue,e.FORBID_CONTENTS,tt)),je&&(he["#text"]=!0),Ie&&T(he,["html","head","body"]),he.table&&(T(he,["tbody"]),delete we.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Z=e.TRUSTED_TYPES_POLICY,ee=Z.createHTML("")}else void 0===Z&&(Z=J(F,a)),null!==Z&&"string"==typeof ee&&(ee=Z.createHTML(""));i&&i(e),nt=e}},at=T({},["mi","mo","mn","ms","mtext"]),st=T({},["foreignobject","desc","title","annotation-xml"]),ut=T({},["title","style","font","a","script"]),ct=T({},I);T(ct,O),T(ct,A);const lt=T({},N);T(lt,R);const dt=function(e){let t=$(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});const n=p(e.tagName),r=p(t.tagName);return!!Xe[e.namespaceURI]&&(e.namespaceURI===Ge?t.namespaceURI===Ye?"svg"===n:t.namespaceURI===Ke?"svg"===n&&("annotation-xml"===r||at[r]):Boolean(ct[n]):e.namespaceURI===Ke?t.namespaceURI===Ye?"math"===n:t.namespaceURI===Ge?"math"===n&&st[r]:Boolean(lt[n]):e.namespaceURI===Ye?!(t.namespaceURI===Ge&&!st[r])&&!(t.namespaceURI===Ke&&!at[r])&&!lt[n]&&(ut[n]||!ct[n]):!("application/xhtml+xml"!==$e||!Xe[e.namespaceURI]))},ft=function(e){f(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},pt=function(e,t){try{f(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ge[e])if(Ne||Re)try{ft(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},mt=function(e){let t=null,n=null;if(Ae)e="<remove></remove>"+e;else{const t=h(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===$e&&Je===Ye&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=Z?Z.createHTML(e):e;if(Je===Ye)try{t=(new z).parseFromString(o,$e)}catch(e){}if(!t||!t.documentElement){t=te.createDocument(Je,"template",null);try{t.documentElement.innerHTML=Ve?ee:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Je===Ye?oe.call(t,Ie?"html":"body")[0]:Ie?t.documentElement:i},ht=function(e){return ne.call(e.ownerDocument||e,e,q.SHOW_ELEMENT|q.SHOW_COMMENT|q.SHOW_TEXT,null)},yt=function(e){return e instanceof U&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof M)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},gt=function(e){return"function"==typeof x&&e instanceof x},vt=function(e,t,r){ae[e]&&l(ae[e],(e=>{e.call(n,t,r,nt)}))},bt=function(e){let t=null;if(vt("beforeSanitizeElements",e,null),yt(e))return ft(e),!0;const r=tt(e.nodeName);if(vt("uponSanitizeElement",e,{tagName:r,allowedTags:he}),e.hasChildNodes()&&!gt(e.firstElementChild)&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return ft(e),!0;if(!he[r]||we[r]){if(!we[r]&&xt(r)){if(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,r))return!1;if(be.tagNameCheck instanceof Function&&be.tagNameCheck(r))return!1}if(je&&!Ue[r]){const t=$(e)||e.parentNode,n=Q(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(B(n[r],!0),X(e))}return ft(e),!0}return e instanceof E&&!dt(e)?(ft(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(ke&&3===e.nodeType&&(t=e.textContent,l([se,ue,ce],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(n.removed,{element:e.cloneNode()}),e.textContent=t)),vt("afterSanitizeElements",e,null),!1):(ft(e),!0)},wt=function(e,t,n){if(Ce&&("id"===t||"name"===t)&&(n in r||n in rt))return!1;if(Te&&!xe[t]&&b(le,t));else if(Ee&&b(de,t));else if(!ge[t]||xe[t]){if(!(xt(e)&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,e)||be.tagNameCheck instanceof Function&&be.tagNameCheck(e))&&(be.attributeNameCheck instanceof RegExp&&b(be.attributeNameCheck,t)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(t))||"is"===t&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,n)||be.tagNameCheck instanceof Function&&be.tagNameCheck(n))))return!1}else if(We[t]);else if(b(me,y(n,pe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==g(n,"data:")||!Fe[e])if(Se&&!b(fe,y(n,pe,"")));else if(n)return!1;return!0},xt=function(e){return e.indexOf("-")>0},Et=function(e){vt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ge};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:u}=i,c=tt(a);let f="value"===a?u:v(u);if(r.attrName=c,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,vt("uponSanitizeAttribute",e,r),f=r.attrValue,r.forceKeepAttr)continue;if(pt(a,e),!r.keepAttr)continue;if(!De&&b(/\/>/i,f)){pt(a,e);continue}ke&&l([se,ue,ce],(e=>{f=y(f,e," ")}));const p=tt(e.nodeName);if(wt(p,c,f)){if(!Le||"id"!==c&&"name"!==c||(pt(a,e),f=_e+f),Z&&"object"==typeof F&&"function"==typeof F.getAttributeType)if(s);else switch(F.getAttributeType(p,c)){case"TrustedHTML":f=Z.createHTML(f);break;case"TrustedScriptURL":f=Z.createScriptURL(f)}try{s?e.setAttributeNS(s,a,f):e.setAttribute(a,f),d(n.removed)}catch(e){}}}vt("afterSanitizeAttributes",e,null)},Tt=function e(t){let n=null;const r=ht(t);for(vt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)vt("uponSanitizeShadowNode",n,null),bt(n)||(n.content instanceof u&&e(n.content),Et(n));vt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,s=null;if(Ve=!e,Ve&&(e="\x3c!--\x3e"),"string"!=typeof e&&!gt(e)){if("function"!=typeof e.toString)throw w("toString is not a function");if("string"!=typeof(e=e.toString()))throw w("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Oe||it(t),n.removed=[],"string"==typeof e&&(qe=!1),qe){if(e.nodeName){const t=tt(e.nodeName);if(!he[t]||we[t])throw w("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof x)r=mt("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!Ne&&!ke&&!Ie&&-1===e.indexOf("<"))return Z&&Pe?Z.createHTML(e):e;if(r=mt(e),!r)return Ne?null:Pe?ee:""}r&&Ae&&ft(r.firstChild);const c=ht(qe?e:r);for(;a=c.nextNode();)bt(a)||(a.content instanceof u&&Tt(a.content),Et(a));if(qe)return e;if(Ne){if(Re)for(s=re.call(r.ownerDocument);r.firstChild;)s.appendChild(r.firstChild);else s=r;return(ge.shadowroot||ge.shadowrootmode)&&(s=ie.call(o,s,!0)),s}let d=Ie?r.outerHTML:r.innerHTML;return Ie&&he["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&b(K,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),ke&&l([se,ue,ce],(e=>{d=y(d,e," ")})),Z&&Pe?Z.createHTML(d):d},n.setConfig=function(){it(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Oe=!0},n.clearConfig=function(){nt=null,Oe=!1},n.isValidAttribute=function(e,t,n){nt||it({});const r=tt(e),o=tt(t);return wt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(ae[e]=ae[e]||[],f(ae[e],t))},n.removeHook=function(e){if(ae[e])return d(ae[e])},n.removeHooks=function(e){ae[e]&&(ae[e]=[])},n.removeAllHooks=function(){ae={}},n}return V()}()}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(i=o.key,a=void 0,a=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(i,"string"),"symbol"===e(a)?a:String(a)),o)}var i,a}var r,o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,r,o;return n=e,r=[{key:"emit",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});n.dispatchEvent(r)}},{key:"on",value:function(e,t){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:document).addEventListener(e,t)}},{key:"off",value:function(e,t){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:document).removeEventListener(e,t)}}],r&&t(n.prototype,r),o&&t(n,o),Object.defineProperty(n,"prototype",{writable:!1}),e}(),i=(new o,n(886)),a=n.n(i),s=n(76),u=n.n(s);class c{constructor({appId:e,SearchOnlyAPIKey:t}){this.currentSelectedIndex=-1,this.resultLinks=[],this.initAlgolia(e,t),this.initElements(),this.bindEvents()}initAlgolia(e,t){this.client=a()(e,t),this.index=this.client.initIndex("hex-blog")}initElements(){this.maskElement=this.createElement("div",{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"var(--color-body-bg)",zIndex:"1000",display:"none",backdropFilter:"blur(5px)","-webkit-backdrop-filter":"blur(5px)"}),this.maskElement.classList.add("blur-behind","search-mask"),this.parentDiv=this.createElement("div",{position:"absolute",display:"flex",flexDirection:"column",top:"57px",left:"50%",transform:"translateX(-50%)",borderRadius:"8px",width:"80%",maxHeight:"60%",border:"1px solid var(--color-border)",background:"var(--color-bg-2)",boxShadow:"rgba(0, 0, 0, 0.2) 0px 16px 70px"}),this.searchWrapper=this.createElement("div",{}),this.searchInputElement=this.createElement("input",{outline:"none",border:"0",borderBottom:"1px solid var(--color-border)",width:"100%",fontSize:"18px",color:"var(--color-font)",borderRadius:"8px 8px 0 0",background:"transparent",fontFamily:"var(--font-regular)",padding:"1.2rem",type:"text"}),this.searchResultsDiv=this.createElement("div",{flex:"1",overflowY:"auto",borderRadius:"0 0 8px 8px"}),this.bottomKeycapsDiv=this.createElement("div",{display:"flex",alignItems:"center",gap:"12px",padding:"1rem 1.2rem"}),this.bottomKeycapsDiv=this.createStyledElement("div",{display:"flex",alignItems:"center",padding:"1rem 1.2rem"}),this.bottomKeycapsDiv.appendChild(this.createKeyElement("↵")),this.bottomKeycapsDiv.appendChild(this.createTipElement(window.i18n["text-select"])),this.bottomKeycapsDiv.appendChild(this.createKeyElement("↑")),this.bottomKeycapsDiv.appendChild(this.createKeyElement("↓")),this.bottomKeycapsDiv.appendChild(this.createTipElement(window.i18n["text-move"])),this.bottomKeycapsDiv.appendChild(this.createKeyElement("esc")),this.bottomKeycapsDiv.appendChild(this.createTipElement(window.i18n["text-esc"])),this.searchResultsDiv.classList.add("cosy-scrollbar"),this.searchWrapper.appendChild(this.searchInputElement),this.parentDiv.append(this.searchWrapper,this.searchResultsDiv,this.bottomKeycapsDiv),this.maskElement.appendChild(this.parentDiv),document.body.appendChild(this.maskElement)}createStyledElement(e,t){const n=document.createElement(e);for(const[e,r]of Object.entries(t))n.style[e]=r;return n}createKeyElement(e){const t=document.createElement("cosy-short-key");return t.textContent=e,t}createTipElement(e){const t=this.createStyledElement("em",{fontWeight:"300",fontStyle:"initial",fontSize:"12px",color:"var(--color-font-2)",margin:"0 20px 0 6px"});return t.textContent=e,t}createArrowRightSVG(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("viewBox","0 0 20 20"),e.setAttribute("width","12px"),e.setAttribute("height","12px");const t=document.createElementNS("http://www.w3.org/2000/svg","g");t.setAttribute("fill","none");const n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d","M7.646 4.147a.5.5 0 0 1 .707-.001l5.484 5.465a.55.55 0 0 1 0 .779l-5.484 5.465a.5.5 0 0 1-.706-.708L12.812 10L7.647 4.854a.5.5 0 0 1-.001-.707z"),n.setAttribute("fill","currentColor"),t.appendChild(n),e.appendChild(t),e}createElement(e,t){const n=document.createElement(e);return Object.assign(n.style,t),n}show(){this.maskElement.style.display="block",this.searchInputElement.focus()}hide(){this.maskElement.style.display="none"}bindEvents(){this.maskElement.addEventListener("click",(e=>{e.target===this.maskElement?this.hide():this.searchInputElement.focus()})),this.searchInputElement.addEventListener("input",(()=>this.performSearch())),document.addEventListener("keydown",(e=>{"block"===this.maskElement.style.display&&this.handleKeydown(e),"Escape"===e.key&&this.hide()}))}performSearch(){const e=this.searchInputElement.value;e?this.index.search(e).then((({hits:t})=>{if(this.searchResultsDiv.innerHTML="",this.currentSelectedIndex=-1,this.resultLinks=[],0===t.length)return this.searchResultsDiv.style.display="none";t.forEach(((t,n)=>{const r=this.createResultLink(t,e,n);this.searchResultsDiv.appendChild(r),this.resultLinks.push(r)})),this.searchResultsDiv.style.display="block"})):this.searchResultsDiv.style.display="none"}createResultLink(e,t,n){var r,o;const i=this.createElement("a",{margin:"10px 0 0 0",display:"block",padding:"0 10px",textDecoration:"none"});i.href=e.permalink;const a=this.createElement("div",{fontFamily:"var(--font-regular)",padding:"8px",borderRadius:"var(--radius-base,4px)",transition:"all .25s ease"}),s=this.createElement("span",{display:"flex",alignItems:"center",fontSize:"12px",color:"var(--color-font-2)"}),u=this.createElement("span",{padding:"0 0 0 5px",fontSize:"13px",letterSpacing:"1px",fontWeight:"300",color:"var(--color-font)"});u.textContent=e.title,s.append(e.categories[0],this.createArrowRightSVG(),u);const c=this.createElement("div",{paddingTop:"6px",fontFamily:"var(--font-regular)",color:"var(--color-font-2)",whiteSpace:"nowrap",lineHeight:"1.2",overflow:"hidden",textOverflow:"ellipsis",fontSize:"12px"});return c.innerHTML=this.highlightKeyword(null!==(o=null!==(r=e.content)&&void 0!==r?r:e.contentStrip)&&void 0!==o?o:e.contentStripTruncate,t),a.append(s,c),i.append(a),i.addEventListener("mouseenter",(()=>{this.updateCurrentSelectedIndex(n)})),i.addEventListener("mouseleave",(()=>{i.children[0].style.backgroundColor="transparent"})),i}highlightKeyword(e,t){return u().sanitize(e,{ALLOWED_TAGS:["em","strong","b","i"]}).replace(new RegExp(t,"g"),`<mark style="margin:0 3px;background:transparent;color:var(--color-primary);">${t}</mark>`)}updateCurrentSelectedIndex(e){if(-1!==this.currentSelectedIndex){this.resultLinks[this.currentSelectedIndex].children[0].style.backgroundColor="transparent"}this.currentSelectedIndex=e;this.resultLinks[this.currentSelectedIndex].children[0].style.backgroundColor="var(--color-bg-3)"}handleKeydown(e){switch(e.key){case"ArrowUp":this.moveSelection(-1),e.preventDefault();break;case"ArrowDown":this.moveSelection(1),e.preventDefault();break;case"Enter":-1!==this.currentSelectedIndex&&(window.location.href=this.resultLinks[this.currentSelectedIndex].href)}}ensureActiveLinkVisible(){const e=this.resultLinks[this.currentSelectedIndex];if(!e)return;if(0===this.currentSelectedIndex)return void(this.searchResultsDiv.scrollTop=0);const t=e.offsetTop,n=e.offsetHeight,r=this.searchResultsDiv.scrollTop,o=this.searchResultsDiv.offsetHeight;t<r?this.searchResultsDiv.scrollTop=t:t+n>r+o&&(this.searchResultsDiv.scrollTop=t+n-o)}moveSelection(e){if(-1!==this.currentSelectedIndex){this.resultLinks[this.currentSelectedIndex].children[0].style.backgroundColor="transparent"}this.currentSelectedIndex=Math.max(0,Math.min(this.currentSelectedIndex+e,this.resultLinks.length-1));this.resultLinks[this.currentSelectedIndex].children[0].style.backgroundColor="var(--color-bg-3)",this.ensureActiveLinkVisible()}}r=()=>{if(document.querySelector("#post-search")){const i=new c({appId:window.algolia.appId,SearchOnlyAPIKey:window.algolia.SearchOnlyAPIKey});t=(e={selector:"#post-search",eventType:"click",handler:()=>i.show()}).selector,n=e.eventType,r=e.handler,null==(o=document.querySelector(t))||o.addEventListener(n,r),function(e){var t=e.key,n=e.handler,r=e.preventDefault,o=void 0!==r&&r,i=t.toLowerCase().split("+").map((function(e){return e.trim()})),a=/Mac|iPod|iPhone|iPad/.test(navigator.platform),s=function(e){i.every((function(t){return"control"===t?a?e.metaKey:e.ctrlKey:e.key.toLowerCase()===t}))&&(o&&e.preventDefault(),n(e))};document.addEventListener("keydown",s)}({key:"control+k",preventDefault:!0,handler:()=>{i.show()}})}var e,t,n,r,o},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",r):r()})()})();