| 1 | (()=>{if("undefined"==typeof navigation)return;let t,e=0,r=new Set,n=!1,o=null;function a(){navigation.addEventListener("navigate",t=>{let i;t.intercept({handler:()=>new Promise(t=>{i=t}),scroll:"manual",focusReset:"manual"});let s=()=>{n?a():(r.forEach(t=>t()),r.clear(),e=0,o=null)};t.signal.addEventListener("abort",s),o=()=>{t.signal.removeEventListener("abort",s),i()}},{once:!0})}function i(){a(),navigation.navigate(location.href,{history:"replace"})}htmx.registerExtension("browser-indicator",{init:e=>{t=e},htmx_before_history_update:()=>{n=!0},htmx_after_history_update:()=>{n=!1},htmx_before_request:(n,o)=>{(function(e){return"true"===t.attributeValue(e,"hx-browser-indicator")||!(!htmx.config.boostBrowserIndicator||!e._htmx?.boosted)})(n)&&(o.ctx._browserIndicator=!0,o.ctx.request?.abort&&r.add(o.ctx.request.abort),e++,1===e&&i())},htmx_finally_request:(t,n)=>{n.ctx._browserIndicator&&(n.ctx.request?.abort&&r.delete(n.ctx.request.abort),0!==e&&(e--,0===e&&o&&(o(),o=null)))}})})(); |