diff --git a/CHANGELOG.md b/CHANGELOG.md index e3bea80..87739a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +* [PR-15](https://github.com/itk-dev/rpa-process-overview/pull/15) + Clean up div/add aria-hidden to icons * [PR-14](https://github.com/itk-dev/rpa-process-overview/pull/14) Light mode added * [PR-13](https://github.com/itk-dev/rpa-process-overview/pull/13) diff --git a/public/widgets/ProcessOverview.min.js b/public/widgets/ProcessOverview.min.js index 0c8d3f4..1e6c5d6 100644 --- a/public/widgets/ProcessOverview.min.js +++ b/public/widgets/ProcessOverview.min.js @@ -1 +1,3123 @@ -(function(pn){typeof define=="function"&&define.amd?define(pn):pn()})(function(){"use strict";var gn=Array.isArray,Le=Array.prototype.indexOf,wn=Array.from,mn=Object.defineProperty,yt=Object.getOwnPropertyDescriptor,Ie=Object.prototype,Fe=Array.prototype,Re=Object.getPrototypeOf,Kn=Object.isExtensible;const Be=()=>{},Dt=16,Qt=32,Vn=64,G=256,yn=512,A=1024,nt=2048,st=4096,H=8192,xt=16384,xn=32768,$t=65536,Ue=1<<17,Hn=1<<19,bn=1<<21,Te=1<<22,ft=1<<23,Xt=Symbol("$state"),We=Symbol("legacy props"),_n=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},M=Symbol();function Jn(t){return t===this.v}function Qn(t){return n=t,e=this.v,!(n!=n?e==e:n!==e||n!==null&&typeof n=="object"||typeof n=="function");var n,e}let qt=!1,j=null;function Yt(t){j=t}function tn(t,n=!1,e){j={p:j,c:null,e:null,s:t,x:null,l:qt&&!n?{s:null,u:null,$:[]}:null}}function nn(t){var n=j,e=n.e;if(e!==null)for(var r of(n.e=null,e))ve(r);return j=n.p,{}}function Lt(){return!qt||j!==null&&j.l===null}const Ze=new WeakMap;function kn(t,n){for(;n!==null;){if(128&n.f)try{return void n.b.error(t)}catch(e){t=e}n=n.parent}throw t instanceof Error&&Xn(t),t}function Xn(t){const n=Ze.get(t);n&&(mn(t,"message",{value:n.message}),mn(t,"stack",{value:n.stack}))}let bt=[];function Yn(t){if(bt.length===0){var n=bt;queueMicrotask(()=>{n===bt&&(function(){var e=bt;bt=[],(function(r){for(var l=0;l{try{var u=t();i&&Promise.resolve(u).catch(()=>{})}catch(f){u=Promise.reject(f)}var a=()=>u;l=i?.then(a,a)??Promise.resolve(u),i=l;var s=D,d=r.is_pending();c&&(r.update_pending_count(1),d||s.increment());const v=(f,p=void 0)=>{i=null,d||s.activate(),p?p!==_n&&(o.f|=ft,Rt(o,p)):((o.f&ft)!==0&&(o.f^=ft),Rt(o,f)),c&&(r.update_pending_count(-1),d||s.decrement()),re()};if(l.then(v,f=>v(null,f||"unknown")),s)return()=>{queueMicrotask(()=>s.neuter())}}),new Promise(u=>{(function a(s){function d(){s===l?u(o):a(l)}s.then(d,d)})(l)})}function te(t){const n=Cn(t);return xe(n),n}function Sn(t){const n=Cn(t);return n.equals=Qn,n}function ne(t){var n=t.effects;if(n!==null){t.effects=null;for(var e=0;eGe(v))).then(v=>{u?.activate(),s();try{e([...t.map(r),...v])}catch(f){(a.f&xt)===0&&kn(f,a)}u?.deactivate(),re()}).catch(v=>{d.error(v)})}else e(t.map(r))}function re(){ot(null),Q(null),Yt(null)}const Nn=new Set;let D=null,le=new Set,It=[],Pn=null,Mn=!1;class _t{current=new Map;#a=new Map;#l=new Set;#t=0;#s=null;#f=!1;#e=[];#o=[];#r=[];#n=[];#u=[];#c=[];#v=[];skipped_effects=new Set;process(n){It=[];for(const l of n)this.#h(l);if(this.#e.length===0&&this.#t===0){this.#d();var e=this.#r,r=this.#n;this.#r=[],this.#n=[],this.#u=[],D=null,oe(e),oe(r),D===null?D=this:Nn.delete(this),this.#s?.resolve()}else this.#i(this.#r),this.#i(this.#n),this.#i(this.#u);for(const l of this.#e)Pt(l);for(const l of this.#o)Pt(l);this.#e=[],this.#o=[]}#h(n){n.f^=A;for(var e=n.first;e!==null;){var r=e.f,l=!!(96&r);if(!(l&&(r&A)!==0||(r&H)!==0||this.skipped_effects.has(e))&&e.fn!==null){l?e.f^=A:4&r?this.#n.push(e):(r&A)===0&&((r&Te)!==0?(e.b?.is_pending()?this.#o:this.#e).push(e):un(e)&&((e.f&Dt)!==0&&this.#u.push(e),Pt(e)));var o=e.first;if(o!==null){e=o;continue}}var i=e.parent;for(e=e.next;e===null&&i!==null;)e=i.next,i=i.parent}}#i(n){for(const e of n)((e.f&nt)!==0?this.#c:this.#v).push(e),R(e,A);n.length=0}capture(n,e){this.#a.has(n)||this.#a.set(n,e),this.current.set(n,n.v)}activate(){D=this}deactivate(){D=null;for(const n of le)if(le.delete(n),n(),D!==null)break}neuter(){this.#f=!0}flush(){It.length>0?(function(){var n=Nt;Mn=!0;try{var e=0;for(me(!0);It.length>0;){var r=_t.ensure();e++>1e3&&Ve(),r.process(It),lt.clear()}}finally{Mn=!1,me(n),Pn=null}})():this.#d(),D===this&&(this.#t===0&&Nn.delete(this),this.deactivate())}#d(){if(!this.#f)for(const n of this.#l)n();this.#l.clear()}increment(){this.#t+=1}decrement(){if(this.#t-=1,this.#t===0){for(const n of this.#c)R(n,nt),kt(n);for(const n of this.#v)R(n,st),kt(n);this.#r=[],this.#n=[],this.flush()}else this.deactivate()}add_callback(n){this.#l.add(n)}settled(){return(this.#s??={promise:new Promise((r,l)=>{n=r,e=l}),resolve:n,reject:e}).promise;var n,e}static ensure(){if(D===null){const n=D=new _t;Nn.add(D),_t.enqueue(()=>{D===n&&n.flush()})}return D}static enqueue(n){Yn(n)}}function Ve(){try{(function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")})()}catch(t){kn(t,Pn)}}let ct=null;function oe(t){var n=t.length;if(n!==0){for(var e=0;e0)){lt.clear();for(const l of ct)Pt(l);ct=[]}}ct=null}}function kt(t){for(var n=Pn=t;n.parent!==null;){var e=(n=n.parent).f;if(Mn&&n===y&&(e&Dt)!==0)return;if(96&e){if((e&A)===0)return;n.f^=A}}It.push(n)}const lt=new Map;function Ft(t,n){return{f:0,v:t,reactions:null,equals:Jn,rv:0,wv:0}}function U(t,n){const e=Ft(t);return xe(e),e}function I(t,n,e=!1){return x!==null&&(!ht||(x.f&Ue)!==0)&&Lt()&&4325394&x.f&&!et?.includes(t)&&(function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")})(),Rt(t,e?Ct(n):n)}function Rt(t,n){if(!t.equals(n)){var e=t.v;dt?lt.set(t,n):lt.set(t,e),t.v=n,_t.ensure().capture(t,e),2&t.f&&((t.f&nt)!==0&&En(t),R(t,(t.f&G)===0?A:st)),t.wv=ke(),ue(t,nt),!Lt()||y===null||(y.f&A)===0||96&y.f||(W===null?(function(r){W=r})([t]):W.push(t))}return n}function On(t){I(t,t.v+1)}function ue(t,n){var e=t.reactions;if(e!==null)for(var r=Lt(),l=e.length,o=0;o{if(pt===o)return c();var u=x,a=pt;Q(null),_e(o);var s=c();return Q(u),_e(a),s};return r&&e.set("length",U(t.length)),new Proxy(t,{defineProperty(c,u,a){"value"in a&&a.configurable!==!1&&a.enumerable!==!1&&a.writable!==!1||(function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")})();var s=e.get(u);return s===void 0?s=i(()=>{var d=U(a.value);return e.set(u,d),d}):I(s,a.value,!0),!0},deleteProperty(c,u){var a=e.get(u);if(a===void 0){if(u in c){const s=i(()=>U(M));e.set(u,s),On(l)}}else I(a,M),On(l);return!0},get(c,u,a){if(u===Xt)return t;var s=e.get(u),d=u in c;if(s!==void 0||d&&!yt(c,u)?.writable||(s=i(()=>U(Ct(d?c[u]:M))),e.set(u,s)),s!==void 0){var v=b(s);return v===M?void 0:v}return Reflect.get(c,u,a)},getOwnPropertyDescriptor(c,u){var a=Reflect.getOwnPropertyDescriptor(c,u);if(a&&"value"in a){var s=e.get(u);s&&(a.value=b(s))}else if(a===void 0){var d=e.get(u),v=d?.v;if(d!==void 0&&v!==M)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return a},has(c,u){if(u===Xt)return!0;var a=e.get(u),s=a!==void 0&&a.v!==M||Reflect.has(c,u);return(a!==void 0||y!==null&&(!s||yt(c,u)?.writable))&&(a===void 0&&(a=i(()=>U(s?Ct(c[u]):M)),e.set(u,a)),b(a)===M)?!1:s},set(c,u,a,s){var d=e.get(u),v=u in c;if(r&&u==="length")for(var f=a;fU(M)),e.set(f+"",p))}d===void 0?v&&!yt(c,u)?.writable||(I(d=i(()=>U(void 0)),Ct(a)),e.set(u,d)):(v=d.v!==M,I(d,i(()=>Ct(a))));var h=Reflect.getOwnPropertyDescriptor(c,u);if(h?.set&&h.set.call(s,a),!v){if(r&&typeof u=="string"){var g=e.get("length"),m=Number(u);Number.isInteger(m)&&m>=g.v&&I(g,m+1)}On(l)}return!0},ownKeys(c){b(l);var u=Reflect.ownKeys(c).filter(d=>{var v=e.get(d);return v===void 0||v.v!==M});for(var[a,s]of e)s.v===M||a in c||u.push(a);return u},setPrototypeOf(){(function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")})()}})}var ie,ae,se,fe;function en(t=""){return document.createTextNode(t)}function Bt(t){return se.call(t)}function rn(t){return fe.call(t)}function P(t,n){return Bt(t)}function Ut(t,n){var e=Bt(t);return e instanceof Comment&&e.data===""?rn(e):e}function St(t,n=1,e=!1){let r=t;for(;n--;)r=rn(r);return r}function ce(t){var n=x,e=y;Q(null),ot(null);try{return t()}finally{Q(n),ot(e)}}function He(t){y===null&&x===null&&(function(){throw new Error("https://svelte.dev/e/effect_orphan")})(),x!==null&&(x.f&G)!==0&&y===null&&(function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")})(),dt&&(function(){throw new Error("https://svelte.dev/e/effect_in_teardown")})()}function Et(t,n,e,r=!0){var l=y;l!==null&&(l.f&H)!==0&&(t|=H);var o={ctx:j,deps:null,nodes_start:null,nodes_end:null,f:t|nt,first:null,fn:n,last:null,next:null,parent:l,b:l&&l.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(e)try{Pt(o),o.f|=xn}catch(u){throw J(o),u}else n!==null&&kt(o);if(r){var i=o;if(e&&i.deps===null&&i.teardown===null&&i.nodes_start===null&&i.first===i.last&&(i.f&Hn)===0&&(i=i.first),i!==null&&(i.parent=l,l!==null&&(function(u,a){var s=a.last;s===null?a.last=a.first=u:(s.next=u,u.prev=s,a.last=u)})(i,l),x!==null&&2&x.f&&(t&Vn)===0)){var c=x;(c.effects??=[]).push(i)}}return o}function ve(t){return Et(1048580,t,!1)}function T(t,n=[],e=[]){Ke(n,e,r=>{Et(8,()=>t(...r.map(b)),!0)})}function ln(t,n=0){return Et(Dt|n,t,!0)}function vt(t,n=!0){return Et(524320,t,!0,n)}function de(t){var n=t.teardown;if(n!==null){const e=dt,r=x;ye(!0),Q(null);try{n.call(null)}finally{ye(e),Q(r)}}}function he(t,n=!1){var e=t.first;for(t.first=t.last=null;e!==null;){const l=e.ac;l!==null&&ce(()=>{l.abort(_n)});var r=e.next;(e.f&Vn)!==0?e.parent=null:J(e,n),e=r}}function J(t,n=!0){var e=!1;(n||262144&t.f)&&t.nodes_start!==null&&t.nodes_end!==null&&((function(o,i){for(;o!==null;){var c=o===i?null:rn(o);o.remove(),o=c}})(t.nodes_start,t.nodes_end),e=!0),he(t,n&&!e),an(t,0),R(t,xt);var r=t.transitions;if(r!==null)for(const o of r)o.stop();de(t);var l=t.parent;l!==null&&l.first!==null&&pe(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function pe(t){var n=t.parent,e=t.prev,r=t.next;e!==null&&(e.next=r),r!==null&&(r.prev=e),n!==null&&(n.first===t&&(n.first=r),n.last===t&&(n.last=e))}function on(t,n){var e=[];jn(t,e,!0),ge(e,()=>{J(t),n&&n()})}function ge(t,n){var e=t.length;if(e>0){var r=()=>--e||n();for(var l of t)l.out(r)}else n()}function jn(t,n,e){if((t.f&H)===0){if(t.f^=H,t.transitions!==null)for(const o of t.transitions)(o.is_global||e)&&n.push(o);for(var r=t.first;r!==null;){var l=r.next;jn(r,n,((r.f&$t)!==0||(r.f&Qt)!==0)&&e),r=l}}}function An(t){we(t,!0)}function we(t,n){if((t.f&H)!==0){t.f^=H,(t.f&A)===0&&(R(t,nt),kt(t));for(var e=t.first;e!==null;){var r=e.next;we(e,((e.f&$t)!==0||(e.f&Qt)!==0)&&n),e=r}if(t.transitions!==null)for(const l of t.transitions)(l.is_global||n)&&l.in()}}let Nt=!1;function me(t){Nt=t}let dt=!1;function ye(t){dt=t}let x=null,ht=!1;function Q(t){x=t}let y=null;function ot(t){y=t}let et=null;function xe(t){x!==null&&(et===null?et=[t]:et.push(t))}let $=null,F=0,W=null,be=1,Tt=0,pt=Tt;function _e(t){pt=t}let ut=!1;function ke(){return++be}function un(t){var n=t.f;if((n&nt)!==0)return!0;if((n&st)!==0){var e=t.deps,r=(n&G)!==0;if(e!==null){var l,o,i=(n&yn)!==0,c=r&&y!==null&&!ut,u=e.length;if((i||c)&&(y===null||(y.f&xt)===0)){var a=t,s=a.parent;for(l=0;lt.wv)return!0}r&&(y===null||ut)||R(t,A)}return!1}function Ce(t,n,e=!0){var r=t.reactions;if(r!==null&&!et?.includes(t))for(var l=0;l{t.ac.abort(_n)}),t.ac=null);try{t.f|=bn;var d=(0,t.fn)(),v=t.deps;if($!==null){var f;if(an(t,F),v!==null&&F>0)for(v.length=F+$.length,f=0;f<$.length;f++)v[F+f]=$[f];else t.deps=v=$;if(!ut||2&s&&t.reactions!==null)for(f=F;fo||e});var s=x,d=y;Q(null),ot(null);try{for(var v,f=[];o!==null;){var p=o.assignedSlot||o.parentNode||o.host||null;try{var h=o["__"+r];if(h!=null&&(!o.disabled||t.target===o))if(gn(h)){var[g,...m]=h;g.apply(o,[t,...m])}else h.call(o,t)}catch(w){v?f.push(w):v=w}if(t.cancelBubble||p===n||p===null)break;o=p}if(v){for(let w of f)queueMicrotask(()=>{throw w});throw v}}finally{t.__root=n,delete t.currentTarget,Q(s),ot(d)}}}function Me(t){var n=document.createElement("template");return n.innerHTML=t.replaceAll("",""),n.content}function Dn(t,n){var e=y;e.nodes_start===null&&(e.nodes_start=t,e.nodes_end=n)}function B(t,n){var e,r=!!(2&n),l=!t.startsWith("");return()=>{e===void 0&&(e=Bt(e=Me(l?t:""+t)));var o=r||ae?document.importNode(e,!0):e.cloneNode(!0);return Dn(o,o),o}}function fn(t,n){return(function(e,r,l="svg"){var o,i=`<${l}>${e.startsWith("")?""+e:e}`;return()=>{if(!o){var c=Bt(Me(i));o=Bt(c)}var u=o.cloneNode(!0);return Dn(u,u),u}})(t,0,"svg")}function Wt(){var t=document.createDocumentFragment(),n=document.createComment(""),e=en();return t.append(n,e),Dn(n,e),t}function E(t,n){t!==null&&t.before(n)}function Mt(t,n){var e=n==null?"":typeof n=="object"?n+"":n;e!==(t.__t??=t.nodeValue)&&(t.__t=e,t.nodeValue=e+"")}function nr(t,n){return(function(e,{target:r,anchor:l,props:o={},events:i,context:c,intro:u=!0}){(function(){if(ie===void 0){ie=window,ae=/Firefox/.test(navigator.userAgent);var f=Element.prototype,p=Node.prototype,h=Text.prototype;se=yt(p,"firstChild").get,fe=yt(p,"nextSibling").get,Kn(f)&&(f.__click=void 0,f.__className=void 0,f.__attributes=null,f.__style=void 0,f.__e=void 0),Kn(h)&&(h.__t=void 0)}})();var a=new Set,s=f=>{for(var p=0;pnew Promise(g=>{h.outro?on(p,()=>{J(p),g(void 0)}):(J(p),g(void 0))})})(()=>{var f=l??r.appendChild(en());return vt(()=>{c&&(tn({}),j.c=c),i&&(o.$$events=i),d=e(f,o)||{},c&&nn()}),()=>{for(var p of a){r.removeEventListener(p,sn);var h=Ot.get(p);--h===0?(document.removeEventListener(p,sn),Ot.delete(p)):Ot.set(p,h)}Ne.delete(s),f!==l&&f.parentNode?.removeChild(f)}});return $n.set(d,v),d})(t,n)}const Ot=new Map;let $n=new WeakMap;function gt(t,n,e=!1){var r=t,l=null,o=null,i=M,c=!1;const u=(v,f=!0)=>{c=!0,d(f,v)};var a=null;function s(){a!==null&&(a.lastChild.remove(),r.before(a),a=null);var v=i?l:o,f=i?o:l;v&&An(v),f&&on(f,()=>{i?o=null:l=null})}const d=(v,f)=>{if(i!==(i=v)){var p=!1,h=r;i?l??=f&&vt(()=>f(h)):o??=f&&vt(()=>f(h)),s()}};ln(()=>{c=!1,n(u),c||d(null,null)},e?$t:0)}function qn(t,n){return n}function Ln(t,n,e,r,l,o=null){var i=t,c={flags:n,items:new Map,first:null};!(4&n)||(i=t.appendChild(en()));var u,a,s=null,d=!1,v=new Map,f=Sn(()=>{var h=e();return gn(h)?h:h==null?[]:wn(h)});function p(){(function(h,g,m,w,N,Z,q,K,Gt){var O,z,it,V,_,S,at=!!(8&q),Kt=!!(3&q),Vt=g.length,rt=m.items,jt=m.first,k=jt,C=null,L=[],Y=[];if(at)for(S=0;S0){var Er=4&q&&Vt===0?N:null;if(at){for(S=0;S0&&Wn.length===0&&Tn!==null;if(zn){var qe=Tn.parentNode;qe.textContent="",qe.append(Tn),$e.clear(),X(Un,Jt[0].prev,Jt[dn-1].next)}ge(Wn,()=>{for(var Gn=0;Gn{if(z!==void 0)for(_ of z)_.a?.apply()});for(var Nr of(h.first=m.first&&m.first.e,h.last=C&&C.e,w.values()))J(Nr.e);w.clear()})(a,u,c,v,i,l,n,r,e),o!==null&&(u.length===0?s?An(s):s=vt(()=>o(i)):s!==null&&on(s,()=>{s=null}))}ln(()=>{a??=y;var h=(u=b(f)).length;d&&h===0||(d=h===0,p(),b(f))})}function er(t,n,e,r){1&r&&Rt(t.v,n),2&r?Rt(t.i,e):t.i=e}function rr(t,n,e,r,l,o,i,c,u,a,s){var d=1&u?16&u?Ft(l):(function(p,h=!1,g=!0){const m=Ft(p);return h||(m.equals=Qn),qt&&g&&j!==null&&j.l!==null&&(j.l.s??=[]).push(m),m})(l,!1,!1):l,v=2&u?Ft(i):i,f={i:v,v:d,k:o,a:null,e:null,prev:e,next:r};try{return t===null&&document.createDocumentFragment().append(t=en()),f.e=vt(()=>c(t,d,v,a),!1),f.e.prev=e&&e.e,f.e.next=r&&r.e,e===null?s||(n.first=f):(e.next=f,e.e.next=f.e),r!==null&&(r.prev=f,r.e.prev=f.e),f}finally{}}function In(t,n,e){for(var r=t.next?t.next.e.nodes_start:e,l=n?n.e.nodes_start:e,o=t.e.nodes_start;o!==null&&o!==r;){var i=rn(o);l.before(o),o=i}}function X(t,n,e){n===null?t.first=e:(n.next=e,n.e.next=e&&e.e),e!==null&&(e.prev=n,e.e.prev=n&&n.e)}function Oe(t){var n,e,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var l=t.length;for(n=0;n(a&&(a=!1,u=r),u),d=Xt in t||We in t;l=yt(t,n)?.set??(d&&n in t?w=>t[n]=w:void 0);var v,f=!1;if([o,f]=(function(w){var N=cn;try{return cn=!1,[w(),cn]}finally{cn=N}})(()=>t[n]),o===void 0&&r!==void 0&&(o=s(),l&&(i&&(function(){throw new Error("https://svelte.dev/e/props_invalid_value")})(),l(o))),v=i?()=>{var w=t[n];return w===void 0?s():(a=!0,w)}:()=>{var w=t[n];return w!==void 0&&(u=void 0),w===void 0?u:w},i&&!(4&e))return v;if(l){var p=t.$$legacy;return function(w,N){return arguments.length>0?(i&&N&&!p&&!f||l(N?v():w),w):v()}}var h=!1,g=Sn(()=>(h=!1,v()));b(g);var m=y;return function(w,N){if(arguments.length>0){const Z=N?b(g):i&&c?Ct(w):w;return I(g,Z),h=!0,u!==void 0&&(u=Z),w}return dt&&h||(m.f&xt)!==0?g.v:b(g)}}typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5"),qt=!0;var lr=B('
'),or=fn(''),ur=fn('');function ir(t,n){let e=zt(n,"className",8,"h-4 w-4");var r=ur();T(()=>wt(r,0,Zt(e()))),E(t,r)}var ar=fn('');function sr(t,n){let e=zt(n,"className",8,"h-4 w-4 dark:opacity-50");var r=ar();T(()=>wt(r,0,Zt(e()))),E(t,r)}var fr=fn('');function cr(t,n){let e=zt(n,"className",8,"h-4 w-4");var r=fr();T(()=>wt(r,0,Zt(e()))),E(t,r)}const mt={FAILED:"FAILED",PENDING:"PENDING",SUCCESS:"SUCCESS"};Object.freeze(mt);var vr=B("
"),dr=B('
');function hr(t,n){tn(n,!0);var e=dr(),r=P(e);(function(i,c,...u){var a,s=i,d=Be;ln(()=>{d!==(d=c())&&(a&&(J(a),a=null),a=vt(()=>d(s,...u)))},$t)})(P(r),()=>n.children);var l=St(r,2),o=i=>{var c=vr();T(u=>wt(c,1,`${u??""} absolute top-1/2 left-[calc(50%+16px)] h-0.5 w-[calc(100%-32px)] -translate-y-1/2 z-0`),[()=>(function(u,a){if(a===null)return!1;const s=u.findIndex(({step_index:d})=>d===a)+1;return u[s]?.status!==mt.SUCCESS})(n.row,n.cell.step_index)?"bg-neutral-400 dark:bg-neutral-800":"bg-green-700"]),E(i,c)};gt(l,i=>{(function(c,u){return cwt(r,1,`${n.className??""} w-8 h-8 rounded-full flex items-center justify-center mx-auto text-white`)),E(t,e),nn()}var pr=B(' '),gr=B(''),wr=B(' '),mr=B(''),yr=B(""),xr=B('
');function br(t,n){tn(n,!0);const e={[mt.PENDING]:sr,[mt.SUCCESS]:ir,[mt.FAILED]:cr};var r=xr(),l=P(r),o=u=>{var a=gr();Ln(P(a),21,()=>n.columns,qn,(s,d)=>{var v=pr(),f=P(v),p=P(f);T(()=>Mt(p,b(d).label)),E(s,v)}),E(u,a)};gt(l,u=>{n.columns&&u(o)});var i=St(l),c=u=>{var a=yr(),s=P(a),d=v=>{var f=Wt();Ln(Ut(f),17,()=>n.rows,qn,(p,h)=>{var g=mr();Ln(g,21,()=>b(h),qn,(m,w,N)=>{var Z=Wt(),q=Ut(Z),K=O=>{{let z=te(()=>b(w).status===mt.SUCCESS?"bg-green-700":b(w).status===mt.FAILED?"bg-rose-700":"bg-neutral-400 dark:bg-neutral-800");hr(O,{get cell(){return b(w)},get row(){return b(h)},i:N,get className(){return b(z)},children:(it,V)=>{const _=te(()=>e[b(w).status]);var S=Wt();(function(at,Kt,Vt){var rt,jt,k=at,C=null,L=null;function Y(){jt&&(on(jt),jt=null),C&&(C.lastChild.remove(),k.before(C),C=null),jt=L,L=null}ln(()=>{if(rt!==(rt=Kt())){if(rt){var tt=k;L=vt(()=>Vt(tt,rt))}Y()}},$t)})(Ut(S),()=>b(_),(at,Kt)=>{Kt(at,{})}),E(it,S)},$$slots:{default:!0}})}},Gt=O=>{var z=wr(),it=P(z);T(()=>Mt(it,b(w).value??b(w).status??"👻")),E(O,z)};gt(q,O=>{b(w).status?O(K):O(Gt,!1)}),E(m,Z)}),E(p,g)}),E(v,f)};gt(s,v=>{n.rows.length>0&&v(d)}),E(u,a)};gt(i,u=>{n.columns&&n.rows!=null&&u(c)}),E(t,r),nn()}const je=(()=>{const t=document.querySelector("[data-rpa-process-overview-config]");if(t!==null)try{const n=t.dataset.rpaProcessOverviewConfig;if(n)return JSON.parse(n)}catch{}return{}})(),Fn=t=>je.messages?.[t]??t+" (missing translation)";var _r=B('

'),kr=B('
'),Cr=B('

'),Sr=B('

');(function(t,n){const e=new URLSearchParams(window.location.search).get("target")??n,r=nr(t,{target:document.getElementById(e)??document.body});window[e]={stop:()=>(function(l,o){const i=$n.get(l);return i?($n.delete(l),i(o)):Promise.resolve()})(r)}})(function(t,n){tn(n,!0);let e=U(!1),r=U(null),l=U(null),o=U(!0);(function(s){He();var d=y.f;if(x||(d&Qt)===0||(d&xn)!==0)return ve(s);var v=j;(v.e??=[]).push(s)})(()=>{I(o,!0);const s=new URL(je.data_url,document.location.href);fetch(s.toString()).then(d=>d.json()).then(({data:d,meta:v})=>{d&&(I(l,v?.total??null,!0),I(r,d,!0)),I(o,!1)}).catch(()=>{I(e,!0)})});var i=Wt(),c=Ut(i),u=s=>{var d=kr();(function(v,f){let p=zt(f,"className",8,"w-8 h-8 animate-spin dark:text-gray-800 fill-blue-900");var h=lr(),g=P(h);(function(m,w,N,Z){var q=w.$$slots?.[N],K=!1;q===!0&&(q=w.children,K=!0),q===void 0||q(m,K?()=>Z:Z)})(St(g,2),f,"default",{}),T(()=>wt(g,0,Zt(p()))),E(v,h)})(P(d),{children:(v,f)=>{var p=_r(),h=P(p);T(g=>Mt(h,g),[()=>Fn("Loading data...")]),E(v,p)},$$slots:{default:!0}}),E(s,d)},a=s=>{var d=Wt(),v=Ut(d),f=h=>{var g=Cr(),m=P(g),w=P(m);T(N=>Mt(w,N),[()=>Fn("Missing data")]),E(h,g)},p=h=>{var g=Sr(),m=P(g),w=P(m);(function(K,Gt){let O=zt(Gt,"className",8,"w-5 h-5 mr-2 text-rose-700");var z=or();T(()=>wt(z,0,Zt(O()))),E(K,z)})(w,{});var N=St(w,2),Z=P(N),q=P(St(N,2));br(P(St(m,2)),{get columns(){return b(r).columns},get rows(){return b(r).rows}}),T(K=>{Mt(Z,K),Mt(q,b(l)??"?")},[()=>Fn("Failed processes")]),E(h,g)};gt(v,h=>{b(r)===null?h(f):h(p,!1)},!0),E(s,d)};gt(c,s=>{b(o)?s(u):s(a,!1)}),E(t,i),nn()},"ProcessOverview")}); +(function(factory) { + typeof define === "function" && define.amd ? define(factory) : factory(); +})((function() { + "use strict"; + const DEV = false; + var is_array = Array.isArray; + var index_of = Array.prototype.indexOf; + var array_from = Array.from; + var define_property = Object.defineProperty; + var get_descriptor = Object.getOwnPropertyDescriptor; + var object_prototype = Object.prototype; + var array_prototype = Array.prototype; + var get_prototype_of = Object.getPrototypeOf; + var is_extensible = Object.isExtensible; + const noop = () => { + }; + function run_all(arr) { + for (var i = 0; i < arr.length; i++) { + arr[i](); + } + } + function deferred() { + var resolve; + var reject; + var promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + return { promise, resolve, reject }; + } + const DERIVED = 1 << 1; + const EFFECT = 1 << 2; + const RENDER_EFFECT = 1 << 3; + const BLOCK_EFFECT = 1 << 4; + const BRANCH_EFFECT = 1 << 5; + const ROOT_EFFECT = 1 << 6; + const BOUNDARY_EFFECT = 1 << 7; + const UNOWNED = 1 << 8; + const DISCONNECTED = 1 << 9; + const CLEAN = 1 << 10; + const DIRTY = 1 << 11; + const MAYBE_DIRTY = 1 << 12; + const INERT = 1 << 13; + const DESTROYED = 1 << 14; + const EFFECT_RAN = 1 << 15; + const EFFECT_TRANSPARENT = 1 << 16; + const INSPECT_EFFECT = 1 << 17; + const HEAD_EFFECT = 1 << 18; + const EFFECT_PRESERVED = 1 << 19; + const USER_EFFECT = 1 << 20; + const REACTION_IS_UPDATING = 1 << 21; + const ASYNC = 1 << 22; + const ERROR_VALUE = 1 << 23; + const STATE_SYMBOL = Symbol("$state"); + const LEGACY_PROPS = Symbol("legacy props"); + const STALE_REACTION = new class StaleReactionError extends Error { + name = "StaleReactionError"; + message = "The reaction that called `getAbortSignal()` was re-run or destroyed"; + }(); + function await_outside_boundary() { + { + throw new Error(`https://svelte.dev/e/await_outside_boundary`); + } + } + function async_derived_orphan() { + { + throw new Error(`https://svelte.dev/e/async_derived_orphan`); + } + } + function effect_in_teardown(rune) { + { + throw new Error(`https://svelte.dev/e/effect_in_teardown`); + } + } + function effect_in_unowned_derived() { + { + throw new Error(`https://svelte.dev/e/effect_in_unowned_derived`); + } + } + function effect_orphan(rune) { + { + throw new Error(`https://svelte.dev/e/effect_orphan`); + } + } + function effect_update_depth_exceeded() { + { + throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`); + } + } + function props_invalid_value(key) { + { + throw new Error(`https://svelte.dev/e/props_invalid_value`); + } + } + function state_descriptors_fixed() { + { + throw new Error(`https://svelte.dev/e/state_descriptors_fixed`); + } + } + function state_prototype_fixed() { + { + throw new Error(`https://svelte.dev/e/state_prototype_fixed`); + } + } + function state_unsafe_mutation() { + { + throw new Error(`https://svelte.dev/e/state_unsafe_mutation`); + } + } + const EACH_ITEM_REACTIVE = 1; + const EACH_INDEX_REACTIVE = 1 << 1; + const EACH_IS_CONTROLLED = 1 << 2; + const EACH_IS_ANIMATED = 1 << 3; + const EACH_ITEM_IMMUTABLE = 1 << 4; + const PROPS_IS_RUNES = 1 << 1; + const PROPS_IS_UPDATED = 1 << 2; + const PROPS_IS_BINDABLE = 1 << 3; + const TEMPLATE_USE_IMPORT_NODE = 1 << 1; + const UNINITIALIZED = Symbol(); + let hydrating = false; + function equals(value) { + return value === this.v; + } + function safe_not_equal(a, b) { + return a != a ? b == b : a !== b || a !== null && typeof a === "object" || typeof a === "function"; + } + function safe_equals(value) { + return !safe_not_equal(value, this.v); + } + let legacy_mode_flag = false; + let tracing_mode_flag = false; + function enable_legacy_mode_flag() { + legacy_mode_flag = true; + } + let component_context = null; + function set_component_context(context) { + component_context = context; + } + function push(props, runes = false, fn) { + component_context = { + p: component_context, + c: null, + e: null, + s: props, + x: null, + l: legacy_mode_flag && !runes ? { s: null, u: null, $: [] } : null + }; + } + function pop(component2) { + var context = ( + /** @type {ComponentContext} */ + component_context + ); + var effects = context.e; + if (effects !== null) { + context.e = null; + for (var fn of effects) { + create_user_effect(fn); + } + } + component_context = context.p; + return ( + /** @type {T} */ + {} + ); + } + function is_runes() { + return !legacy_mode_flag || component_context !== null && component_context.l === null; + } + const adjustments = /* @__PURE__ */ new WeakMap(); + function handle_error(error) { + var effect = active_effect; + if (effect === null) { + active_reaction.f |= ERROR_VALUE; + return error; + } + if ((effect.f & EFFECT_RAN) === 0) { + if ((effect.f & BOUNDARY_EFFECT) === 0) { + if (!effect.parent && error instanceof Error) { + apply_adjustments(error); + } + throw error; + } + effect.b.error(error); + } else { + invoke_error_boundary(error, effect); + } + } + function invoke_error_boundary(error, effect) { + while (effect !== null) { + if ((effect.f & BOUNDARY_EFFECT) !== 0) { + try { + effect.b.error(error); + return; + } catch (e) { + error = e; + } + } + effect = effect.parent; + } + if (error instanceof Error) { + apply_adjustments(error); + } + throw error; + } + function apply_adjustments(error) { + const adjusted = adjustments.get(error); + if (adjusted) { + define_property(error, "message", { + value: adjusted.message + }); + define_property(error, "stack", { + value: adjusted.stack + }); + } + } + let micro_tasks = []; + function run_micro_tasks() { + var tasks = micro_tasks; + micro_tasks = []; + run_all(tasks); + } + function queue_micro_task(fn) { + if (micro_tasks.length === 0 && true) { + var tasks = micro_tasks; + queueMicrotask(() => { + if (tasks === micro_tasks) run_micro_tasks(); + }); + } + micro_tasks.push(fn); + } + function get_boundary() { + const boundary = ( + /** @type {Effect} */ + active_effect.b + ); + if (boundary === null) { + await_outside_boundary(); + } + return boundary; + } + // @__NO_SIDE_EFFECTS__ + function derived(fn) { + var flags = DERIVED | DIRTY; + var parent_derived = active_reaction !== null && (active_reaction.f & DERIVED) !== 0 ? ( + /** @type {Derived} */ + active_reaction + ) : null; + if (active_effect === null || parent_derived !== null && (parent_derived.f & UNOWNED) !== 0) { + flags |= UNOWNED; + } else { + active_effect.f |= EFFECT_PRESERVED; + } + const signal = { + ctx: component_context, + deps: null, + effects: null, + equals, + f: flags, + fn, + reactions: null, + rv: 0, + v: ( + /** @type {V} */ + UNINITIALIZED + ), + wv: 0, + parent: parent_derived ?? active_effect, + ac: null + }; + return signal; + } + // @__NO_SIDE_EFFECTS__ + function async_derived(fn, location) { + let parent = ( + /** @type {Effect | null} */ + active_effect + ); + if (parent === null) { + async_derived_orphan(); + } + var boundary = ( + /** @type {Boundary} */ + parent.b + ); + var promise = ( + /** @type {Promise} */ + /** @type {unknown} */ + void 0 + ); + var signal = source( + /** @type {V} */ + UNINITIALIZED + ); + var prev = null; + var should_suspend = !active_reaction; + async_effect(() => { + try { + var p = fn(); + if (prev) Promise.resolve(p).catch(() => { + }); + } catch (error) { + p = Promise.reject(error); + } + var r2 = () => p; + promise = prev?.then(r2, r2) ?? Promise.resolve(p); + prev = promise; + var batch = ( + /** @type {Batch} */ + current_batch + ); + var pending = boundary.is_pending(); + if (should_suspend) { + boundary.update_pending_count(1); + if (!pending) batch.increment(); + } + const handler = (value, error = void 0) => { + prev = null; + if (!pending) batch.activate(); + if (error) { + if (error !== STALE_REACTION) { + signal.f |= ERROR_VALUE; + internal_set(signal, error); + } + } else { + if ((signal.f & ERROR_VALUE) !== 0) { + signal.f ^= ERROR_VALUE; + } + internal_set(signal, value); + } + if (should_suspend) { + boundary.update_pending_count(-1); + if (!pending) batch.decrement(); + } + unset_context(); + }; + promise.then(handler, (e) => handler(null, e || "unknown")); + if (batch) { + return () => { + queueMicrotask(() => batch.neuter()); + }; + } + }); + return new Promise((fulfil) => { + function next(p) { + function go() { + if (p === promise) { + fulfil(signal); + } else { + next(promise); + } + } + p.then(go, go); + } + next(promise); + }); + } + // @__NO_SIDE_EFFECTS__ + function user_derived(fn) { + const d = /* @__PURE__ */ derived(fn); + push_reaction_value(d); + return d; + } + // @__NO_SIDE_EFFECTS__ + function derived_safe_equal(fn) { + const signal = /* @__PURE__ */ derived(fn); + signal.equals = safe_equals; + return signal; + } + function destroy_derived_effects(derived2) { + var effects = derived2.effects; + if (effects !== null) { + derived2.effects = null; + for (var i = 0; i < effects.length; i += 1) { + destroy_effect( + /** @type {Effect} */ + effects[i] + ); + } + } + } + function get_derived_parent_effect(derived2) { + var parent = derived2.parent; + while (parent !== null) { + if ((parent.f & DERIVED) === 0) { + return ( + /** @type {Effect} */ + parent + ); + } + parent = parent.parent; + } + return null; + } + function execute_derived(derived2) { + var value; + var prev_active_effect = active_effect; + set_active_effect(get_derived_parent_effect(derived2)); + { + try { + destroy_derived_effects(derived2); + value = update_reaction(derived2); + } finally { + set_active_effect(prev_active_effect); + } + } + return value; + } + function update_derived(derived2) { + var value = execute_derived(derived2); + if (!derived2.equals(value)) { + derived2.v = value; + derived2.wv = increment_write_version(); + } + if (is_destroying_effect) { + return; + } + { + var status = (skip_reaction || (derived2.f & UNOWNED) !== 0) && derived2.deps !== null ? MAYBE_DIRTY : CLEAN; + set_signal_status(derived2, status); + } + } + function flatten(sync, async, fn) { + const d = is_runes() ? derived : derived_safe_equal; + if (async.length === 0) { + fn(sync.map(d)); + return; + } + var batch = current_batch; + var parent = ( + /** @type {Effect} */ + active_effect + ); + var restore = capture(); + var boundary = get_boundary(); + Promise.all(async.map((expression) => /* @__PURE__ */ async_derived(expression))).then((result) => { + batch?.activate(); + restore(); + try { + fn([...sync.map(d), ...result]); + } catch (error) { + if ((parent.f & DESTROYED) === 0) { + invoke_error_boundary(error, parent); + } + } + batch?.deactivate(); + unset_context(); + }).catch((error) => { + boundary.error(error); + }); + } + function capture() { + var previous_effect = active_effect; + var previous_reaction = active_reaction; + var previous_component_context = component_context; + var previous_batch = current_batch; + return function restore() { + set_active_effect(previous_effect); + set_active_reaction(previous_reaction); + set_component_context(previous_component_context); + previous_batch?.activate(); + }; + } + function unset_context() { + set_active_effect(null); + set_active_reaction(null); + set_component_context(null); + } + const batches = /* @__PURE__ */ new Set(); + let current_batch = null; + let effect_pending_updates = /* @__PURE__ */ new Set(); + let queued_root_effects = []; + let last_scheduled_effect = null; + let is_flushing = false; + class Batch { + /** + * The current values of any sources that are updated in this batch + * They keys of this map are identical to `this.#previous` + * @type {Map} + */ + current = /* @__PURE__ */ new Map(); + /** + * The values of any sources that are updated in this batch _before_ those updates took place. + * They keys of this map are identical to `this.#current` + * @type {Map} + */ + #previous = /* @__PURE__ */ new Map(); + /** + * When the batch is committed (and the DOM is updated), we need to remove old branches + * and append new ones by calling the functions added inside (if/each/key/etc) blocks + * @type {Set<() => void>} + */ + #callbacks = /* @__PURE__ */ new Set(); + /** + * The number of async effects that are currently in flight + */ + #pending = 0; + /** + * A deferred that resolves when the batch is committed, used with `settled()` + * TODO replace with Promise.withResolvers once supported widely enough + * @type {{ promise: Promise, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null} + */ + #deferred = null; + /** + * True if an async effect inside this batch resolved and + * its parent branch was already deleted + */ + #neutered = false; + /** + * Async effects (created inside `async_derived`) encountered during processing. + * These run after the rest of the batch has updated, since they should + * always have the latest values + * @type {Effect[]} + */ + #async_effects = []; + /** + * The same as `#async_effects`, but for effects inside a newly-created + * `` — these do not prevent the batch from committing + * @type {Effect[]} + */ + #boundary_async_effects = []; + /** + * Template effects and `$effect.pre` effects, which run when + * a batch is committed + * @type {Effect[]} + */ + #render_effects = []; + /** + * The same as `#render_effects`, but for `$effect` (which runs after) + * @type {Effect[]} + */ + #effects = []; + /** + * Block effects, which may need to re-run on subsequent flushes + * in order to update internal sources (e.g. each block items) + * @type {Effect[]} + */ + #block_effects = []; + /** + * Deferred effects (which run after async work has completed) that are DIRTY + * @type {Effect[]} + */ + #dirty_effects = []; + /** + * Deferred effects that are MAYBE_DIRTY + * @type {Effect[]} + */ + #maybe_dirty_effects = []; + /** + * A set of branches that still exist, but will be destroyed when this batch + * is committed — we skip over these during `process` + * @type {Set} + */ + skipped_effects = /* @__PURE__ */ new Set(); + /** + * + * @param {Effect[]} root_effects + */ + process(root_effects) { + queued_root_effects = []; + for (const root2 of root_effects) { + this.#traverse_effect_tree(root2); + } + if (this.#async_effects.length === 0 && this.#pending === 0) { + this.#commit(); + var render_effects = this.#render_effects; + var effects = this.#effects; + this.#render_effects = []; + this.#effects = []; + this.#block_effects = []; + current_batch = null; + flush_queued_effects(render_effects); + flush_queued_effects(effects); + if (current_batch === null) { + current_batch = this; + } else { + batches.delete(this); + } + this.#deferred?.resolve(); + } else { + this.#defer_effects(this.#render_effects); + this.#defer_effects(this.#effects); + this.#defer_effects(this.#block_effects); + } + for (const effect of this.#async_effects) { + update_effect(effect); + } + for (const effect of this.#boundary_async_effects) { + update_effect(effect); + } + this.#async_effects = []; + this.#boundary_async_effects = []; + } + /** + * Traverse the effect tree, executing effects or stashing + * them for later execution as appropriate + * @param {Effect} root + */ + #traverse_effect_tree(root2) { + root2.f ^= CLEAN; + var effect = root2.first; + while (effect !== null) { + var flags = effect.f; + var is_branch = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0; + var is_skippable_branch = is_branch && (flags & CLEAN) !== 0; + var skip = is_skippable_branch || (flags & INERT) !== 0 || this.skipped_effects.has(effect); + if (!skip && effect.fn !== null) { + if (is_branch) { + effect.f ^= CLEAN; + } else if ((flags & EFFECT) !== 0) { + this.#effects.push(effect); + } else if ((flags & CLEAN) === 0) { + if ((flags & ASYNC) !== 0) { + var effects = effect.b?.is_pending() ? this.#boundary_async_effects : this.#async_effects; + effects.push(effect); + } else if (is_dirty(effect)) { + if ((effect.f & BLOCK_EFFECT) !== 0) this.#block_effects.push(effect); + update_effect(effect); + } + } + var child2 = effect.first; + if (child2 !== null) { + effect = child2; + continue; + } + } + var parent = effect.parent; + effect = effect.next; + while (effect === null && parent !== null) { + effect = parent.next; + parent = parent.parent; + } + } + } + /** + * @param {Effect[]} effects + */ + #defer_effects(effects) { + for (const e of effects) { + const target = (e.f & DIRTY) !== 0 ? this.#dirty_effects : this.#maybe_dirty_effects; + target.push(e); + set_signal_status(e, CLEAN); + } + effects.length = 0; + } + /** + * Associate a change to a given source with the current + * batch, noting its previous and current values + * @param {Source} source + * @param {any} value + */ + capture(source2, value) { + if (!this.#previous.has(source2)) { + this.#previous.set(source2, value); + } + this.current.set(source2, source2.v); + } + activate() { + current_batch = this; + } + deactivate() { + current_batch = null; + for (const update of effect_pending_updates) { + effect_pending_updates.delete(update); + update(); + if (current_batch !== null) { + break; + } + } + } + neuter() { + this.#neutered = true; + } + flush() { + if (queued_root_effects.length > 0) { + flush_effects(); + } else { + this.#commit(); + } + if (current_batch !== this) { + return; + } + if (this.#pending === 0) { + batches.delete(this); + } + this.deactivate(); + } + /** + * Append and remove branches to/from the DOM + */ + #commit() { + if (!this.#neutered) { + for (const fn of this.#callbacks) { + fn(); + } + } + this.#callbacks.clear(); + } + increment() { + this.#pending += 1; + } + decrement() { + this.#pending -= 1; + if (this.#pending === 0) { + for (const e of this.#dirty_effects) { + set_signal_status(e, DIRTY); + schedule_effect(e); + } + for (const e of this.#maybe_dirty_effects) { + set_signal_status(e, MAYBE_DIRTY); + schedule_effect(e); + } + this.#render_effects = []; + this.#effects = []; + this.flush(); + } else { + this.deactivate(); + } + } + /** @param {() => void} fn */ + add_callback(fn) { + this.#callbacks.add(fn); + } + settled() { + return (this.#deferred ??= deferred()).promise; + } + static ensure() { + if (current_batch === null) { + const batch = current_batch = new Batch(); + batches.add(current_batch); + { + Batch.enqueue(() => { + if (current_batch !== batch) { + return; + } + batch.flush(); + }); + } + } + return current_batch; + } + /** @param {() => void} task */ + static enqueue(task) { + queue_micro_task(task); + } + } + function flush_effects() { + var was_updating_effect = is_updating_effect; + is_flushing = true; + try { + var flush_count = 0; + set_is_updating_effect(true); + while (queued_root_effects.length > 0) { + var batch = Batch.ensure(); + if (flush_count++ > 1e3) { + var updates, entry; + if (DEV) ; + infinite_loop_guard(); + } + batch.process(queued_root_effects); + old_values.clear(); + } + } finally { + is_flushing = false; + set_is_updating_effect(was_updating_effect); + last_scheduled_effect = null; + } + } + function infinite_loop_guard() { + try { + effect_update_depth_exceeded(); + } catch (error) { + invoke_error_boundary(error, last_scheduled_effect); + } + } + let eager_block_effects = null; + function flush_queued_effects(effects) { + var length = effects.length; + if (length === 0) return; + var i = 0; + while (i < length) { + var effect = effects[i++]; + if ((effect.f & (DESTROYED | INERT)) === 0 && is_dirty(effect)) { + eager_block_effects = []; + update_effect(effect); + if (effect.deps === null && effect.first === null && effect.nodes_start === null) { + if (effect.teardown === null && effect.ac === null) { + unlink_effect(effect); + } else { + effect.fn = null; + } + } + if (eager_block_effects?.length > 0) { + old_values.clear(); + for (const e of eager_block_effects) { + update_effect(e); + } + eager_block_effects = []; + } + } + } + eager_block_effects = null; + } + function schedule_effect(signal) { + var effect = last_scheduled_effect = signal; + while (effect.parent !== null) { + effect = effect.parent; + var flags = effect.f; + if (is_flushing && effect === active_effect && (flags & BLOCK_EFFECT) !== 0) { + return; + } + if ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) { + if ((flags & CLEAN) === 0) return; + effect.f ^= CLEAN; + } + } + queued_root_effects.push(effect); + } + const old_values = /* @__PURE__ */ new Map(); + function source(v, stack) { + var signal = { + f: 0, + // TODO ideally we could skip this altogether, but it causes type errors + v, + reactions: null, + equals, + rv: 0, + wv: 0 + }; + return signal; + } + // @__NO_SIDE_EFFECTS__ + function state(v, stack) { + const s = source(v); + push_reaction_value(s); + return s; + } + // @__NO_SIDE_EFFECTS__ + function mutable_source(initial_value, immutable = false, trackable = true) { + const s = source(initial_value); + if (!immutable) { + s.equals = safe_equals; + } + if (legacy_mode_flag && trackable && component_context !== null && component_context.l !== null) { + (component_context.l.s ??= []).push(s); + } + return s; + } + function set(source2, value, should_proxy = false) { + if (active_reaction !== null && // since we are untracking the function inside `$inspect.with` we need to add this check + // to ensure we error if state is set inside an inspect effect + (!untracking || (active_reaction.f & INSPECT_EFFECT) !== 0) && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | INSPECT_EFFECT)) !== 0 && !current_sources?.includes(source2)) { + state_unsafe_mutation(); + } + let new_value = should_proxy ? proxy(value) : value; + return internal_set(source2, new_value); + } + function internal_set(source2, value) { + if (!source2.equals(value)) { + var old_value = source2.v; + if (is_destroying_effect) { + old_values.set(source2, value); + } else { + old_values.set(source2, old_value); + } + source2.v = value; + var batch = Batch.ensure(); + batch.capture(source2, old_value); + if ((source2.f & DERIVED) !== 0) { + if ((source2.f & DIRTY) !== 0) { + execute_derived( + /** @type {Derived} */ + source2 + ); + } + set_signal_status(source2, (source2.f & UNOWNED) === 0 ? CLEAN : MAYBE_DIRTY); + } + source2.wv = increment_write_version(); + mark_reactions(source2, DIRTY); + if (is_runes() && active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0) { + if (untracked_writes === null) { + set_untracked_writes([source2]); + } else { + untracked_writes.push(source2); + } + } + } + return value; + } + function increment(source2) { + set(source2, source2.v + 1); + } + function mark_reactions(signal, status) { + var reactions = signal.reactions; + if (reactions === null) return; + var runes = is_runes(); + var length = reactions.length; + for (var i = 0; i < length; i++) { + var reaction = reactions[i]; + var flags = reaction.f; + if (!runes && reaction === active_effect) continue; + var not_dirty = (flags & DIRTY) === 0; + if (not_dirty) { + set_signal_status(reaction, status); + } + if ((flags & DERIVED) !== 0) { + mark_reactions( + /** @type {Derived} */ + reaction, + MAYBE_DIRTY + ); + } else if (not_dirty) { + if ((flags & BLOCK_EFFECT) !== 0) { + if (eager_block_effects !== null) { + eager_block_effects.push( + /** @type {Effect} */ + reaction + ); + } + } + schedule_effect( + /** @type {Effect} */ + reaction + ); + } + } + } + function proxy(value) { + if (typeof value !== "object" || value === null || STATE_SYMBOL in value) { + return value; + } + const prototype = get_prototype_of(value); + if (prototype !== object_prototype && prototype !== array_prototype) { + return value; + } + var sources = /* @__PURE__ */ new Map(); + var is_proxied_array = is_array(value); + var version = /* @__PURE__ */ state(0); + var parent_version = update_version; + var with_parent = (fn) => { + if (update_version === parent_version) { + return fn(); + } + var reaction = active_reaction; + var version2 = update_version; + set_active_reaction(null); + set_update_version(parent_version); + var result = fn(); + set_active_reaction(reaction); + set_update_version(version2); + return result; + }; + if (is_proxied_array) { + sources.set("length", /* @__PURE__ */ state( + /** @type {any[]} */ + value.length + )); + } + return new Proxy( + /** @type {any} */ + value, + { + defineProperty(_, prop2, descriptor) { + if (!("value" in descriptor) || descriptor.configurable === false || descriptor.enumerable === false || descriptor.writable === false) { + state_descriptors_fixed(); + } + var s = sources.get(prop2); + if (s === void 0) { + s = with_parent(() => { + var s2 = /* @__PURE__ */ state(descriptor.value); + sources.set(prop2, s2); + return s2; + }); + } else { + set(s, descriptor.value, true); + } + return true; + }, + deleteProperty(target, prop2) { + var s = sources.get(prop2); + if (s === void 0) { + if (prop2 in target) { + const s2 = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED)); + sources.set(prop2, s2); + increment(version); + } + } else { + set(s, UNINITIALIZED); + increment(version); + } + return true; + }, + get(target, prop2, receiver) { + if (prop2 === STATE_SYMBOL) { + return value; + } + var s = sources.get(prop2); + var exists = prop2 in target; + if (s === void 0 && (!exists || get_descriptor(target, prop2)?.writable)) { + s = with_parent(() => { + var p = proxy(exists ? target[prop2] : UNINITIALIZED); + var s2 = /* @__PURE__ */ state(p); + return s2; + }); + sources.set(prop2, s); + } + if (s !== void 0) { + var v = get(s); + return v === UNINITIALIZED ? void 0 : v; + } + return Reflect.get(target, prop2, receiver); + }, + getOwnPropertyDescriptor(target, prop2) { + var descriptor = Reflect.getOwnPropertyDescriptor(target, prop2); + if (descriptor && "value" in descriptor) { + var s = sources.get(prop2); + if (s) descriptor.value = get(s); + } else if (descriptor === void 0) { + var source2 = sources.get(prop2); + var value2 = source2?.v; + if (source2 !== void 0 && value2 !== UNINITIALIZED) { + return { + enumerable: true, + configurable: true, + value: value2, + writable: true + }; + } + } + return descriptor; + }, + has(target, prop2) { + if (prop2 === STATE_SYMBOL) { + return true; + } + var s = sources.get(prop2); + var has = s !== void 0 && s.v !== UNINITIALIZED || Reflect.has(target, prop2); + if (s !== void 0 || active_effect !== null && (!has || get_descriptor(target, prop2)?.writable)) { + if (s === void 0) { + s = with_parent(() => { + var p = has ? proxy(target[prop2]) : UNINITIALIZED; + var s2 = /* @__PURE__ */ state(p); + return s2; + }); + sources.set(prop2, s); + } + var value2 = get(s); + if (value2 === UNINITIALIZED) { + return false; + } + } + return has; + }, + set(target, prop2, value2, receiver) { + var s = sources.get(prop2); + var has = prop2 in target; + if (is_proxied_array && prop2 === "length") { + for (var i = value2; i < /** @type {Source} */ + s.v; i += 1) { + var other_s = sources.get(i + ""); + if (other_s !== void 0) { + set(other_s, UNINITIALIZED); + } else if (i in target) { + other_s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED)); + sources.set(i + "", other_s); + } + } + } + if (s === void 0) { + if (!has || get_descriptor(target, prop2)?.writable) { + s = with_parent(() => /* @__PURE__ */ state(void 0)); + set(s, proxy(value2)); + sources.set(prop2, s); + } + } else { + has = s.v !== UNINITIALIZED; + var p = with_parent(() => proxy(value2)); + set(s, p); + } + var descriptor = Reflect.getOwnPropertyDescriptor(target, prop2); + if (descriptor?.set) { + descriptor.set.call(receiver, value2); + } + if (!has) { + if (is_proxied_array && typeof prop2 === "string") { + var ls = ( + /** @type {Source} */ + sources.get("length") + ); + var n = Number(prop2); + if (Number.isInteger(n) && n >= ls.v) { + set(ls, n + 1); + } + } + increment(version); + } + return true; + }, + ownKeys(target) { + get(version); + var own_keys = Reflect.ownKeys(target).filter((key2) => { + var source3 = sources.get(key2); + return source3 === void 0 || source3.v !== UNINITIALIZED; + }); + for (var [key, source2] of sources) { + if (source2.v !== UNINITIALIZED && !(key in target)) { + own_keys.push(key); + } + } + return own_keys; + }, + setPrototypeOf() { + state_prototype_fixed(); + } + } + ); + } + var $window; + var is_firefox; + var first_child_getter; + var next_sibling_getter; + function init_operations() { + if ($window !== void 0) { + return; + } + $window = window; + is_firefox = /Firefox/.test(navigator.userAgent); + var element_prototype = Element.prototype; + var node_prototype = Node.prototype; + var text_prototype = Text.prototype; + first_child_getter = get_descriptor(node_prototype, "firstChild").get; + next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get; + if (is_extensible(element_prototype)) { + element_prototype.__click = void 0; + element_prototype.__className = void 0; + element_prototype.__attributes = null; + element_prototype.__style = void 0; + element_prototype.__e = void 0; + } + if (is_extensible(text_prototype)) { + text_prototype.__t = void 0; + } + } + function create_text(value = "") { + return document.createTextNode(value); + } + // @__NO_SIDE_EFFECTS__ + function get_first_child(node) { + return first_child_getter.call(node); + } + // @__NO_SIDE_EFFECTS__ + function get_next_sibling(node) { + return next_sibling_getter.call(node); + } + function child(node, is_text) { + { + return /* @__PURE__ */ get_first_child(node); + } + } + function first_child(fragment, is_text) { + { + var first = ( + /** @type {DocumentFragment} */ + /* @__PURE__ */ get_first_child( + /** @type {Node} */ + fragment + ) + ); + if (first instanceof Comment && first.data === "") return /* @__PURE__ */ get_next_sibling(first); + return first; + } + } + function sibling(node, count = 1, is_text = false) { + let next_sibling = node; + while (count--) { + next_sibling = /** @type {TemplateNode} */ + /* @__PURE__ */ get_next_sibling(next_sibling); + } + { + return next_sibling; + } + } + function clear_text_content(node) { + node.textContent = ""; + } + function should_defer_append() { + return false; + } + function without_reactive_context(fn) { + var previous_reaction = active_reaction; + var previous_effect = active_effect; + set_active_reaction(null); + set_active_effect(null); + try { + return fn(); + } finally { + set_active_reaction(previous_reaction); + set_active_effect(previous_effect); + } + } + function validate_effect(rune) { + if (active_effect === null && active_reaction === null) { + effect_orphan(); + } + if (active_reaction !== null && (active_reaction.f & UNOWNED) !== 0 && active_effect === null) { + effect_in_unowned_derived(); + } + if (is_destroying_effect) { + effect_in_teardown(); + } + } + function push_effect(effect, parent_effect) { + var parent_last = parent_effect.last; + if (parent_last === null) { + parent_effect.last = parent_effect.first = effect; + } else { + parent_last.next = effect; + effect.prev = parent_last; + parent_effect.last = effect; + } + } + function create_effect(type, fn, sync, push2 = true) { + var parent = active_effect; + if (parent !== null && (parent.f & INERT) !== 0) { + type |= INERT; + } + var effect = { + ctx: component_context, + deps: null, + nodes_start: null, + nodes_end: null, + f: type | DIRTY, + first: null, + fn, + last: null, + next: null, + parent, + b: parent && parent.b, + prev: null, + teardown: null, + transitions: null, + wv: 0, + ac: null + }; + if (sync) { + try { + update_effect(effect); + effect.f |= EFFECT_RAN; + } catch (e2) { + destroy_effect(effect); + throw e2; + } + } else if (fn !== null) { + schedule_effect(effect); + } + if (push2) { + var e = effect; + if (sync && e.deps === null && e.teardown === null && e.nodes_start === null && e.first === e.last && // either `null`, or a singular child + (e.f & EFFECT_PRESERVED) === 0) { + e = e.first; + } + if (e !== null) { + e.parent = parent; + if (parent !== null) { + push_effect(e, parent); + } + if (active_reaction !== null && (active_reaction.f & DERIVED) !== 0 && (type & ROOT_EFFECT) === 0) { + var derived2 = ( + /** @type {Derived} */ + active_reaction + ); + (derived2.effects ??= []).push(e); + } + } + } + return effect; + } + function user_effect(fn) { + validate_effect(); + var flags = ( + /** @type {Effect} */ + active_effect.f + ); + var defer = !active_reaction && (flags & BRANCH_EFFECT) !== 0 && (flags & EFFECT_RAN) === 0; + if (defer) { + var context = ( + /** @type {ComponentContext} */ + component_context + ); + (context.e ??= []).push(fn); + } else { + return create_user_effect(fn); + } + } + function create_user_effect(fn) { + return create_effect(EFFECT | USER_EFFECT, fn, false); + } + function component_root(fn) { + Batch.ensure(); + const effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn, true); + return (options = {}) => { + return new Promise((fulfil) => { + if (options.outro) { + pause_effect(effect, () => { + destroy_effect(effect); + fulfil(void 0); + }); + } else { + destroy_effect(effect); + fulfil(void 0); + } + }); + }; + } + function async_effect(fn) { + return create_effect(ASYNC | EFFECT_PRESERVED, fn, true); + } + function template_effect(fn, sync = [], async = []) { + flatten(sync, async, (values) => { + create_effect(RENDER_EFFECT, () => fn(...values.map(get)), true); + }); + } + function block(fn, flags = 0) { + var effect = create_effect(BLOCK_EFFECT | flags, fn, true); + return effect; + } + function branch(fn, push2 = true) { + return create_effect(BRANCH_EFFECT | EFFECT_PRESERVED, fn, true, push2); + } + function execute_effect_teardown(effect) { + var teardown = effect.teardown; + if (teardown !== null) { + const previously_destroying_effect = is_destroying_effect; + const previous_reaction = active_reaction; + set_is_destroying_effect(true); + set_active_reaction(null); + try { + teardown.call(null); + } finally { + set_is_destroying_effect(previously_destroying_effect); + set_active_reaction(previous_reaction); + } + } + } + function destroy_effect_children(signal, remove_dom = false) { + var effect = signal.first; + signal.first = signal.last = null; + while (effect !== null) { + const controller = effect.ac; + if (controller !== null) { + without_reactive_context(() => { + controller.abort(STALE_REACTION); + }); + } + var next = effect.next; + if ((effect.f & ROOT_EFFECT) !== 0) { + effect.parent = null; + } else { + destroy_effect(effect, remove_dom); + } + effect = next; + } + } + function destroy_block_effect_children(signal) { + var effect = signal.first; + while (effect !== null) { + var next = effect.next; + if ((effect.f & BRANCH_EFFECT) === 0) { + destroy_effect(effect); + } + effect = next; + } + } + function destroy_effect(effect, remove_dom = true) { + var removed = false; + if ((remove_dom || (effect.f & HEAD_EFFECT) !== 0) && effect.nodes_start !== null && effect.nodes_end !== null) { + remove_effect_dom( + effect.nodes_start, + /** @type {TemplateNode} */ + effect.nodes_end + ); + removed = true; + } + destroy_effect_children(effect, remove_dom && !removed); + remove_reactions(effect, 0); + set_signal_status(effect, DESTROYED); + var transitions = effect.transitions; + if (transitions !== null) { + for (const transition of transitions) { + transition.stop(); + } + } + execute_effect_teardown(effect); + var parent = effect.parent; + if (parent !== null && parent.first !== null) { + unlink_effect(effect); + } + effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes_start = effect.nodes_end = effect.ac = null; + } + function remove_effect_dom(node, end) { + while (node !== null) { + var next = node === end ? null : ( + /** @type {TemplateNode} */ + /* @__PURE__ */ get_next_sibling(node) + ); + node.remove(); + node = next; + } + } + function unlink_effect(effect) { + var parent = effect.parent; + var prev = effect.prev; + var next = effect.next; + if (prev !== null) prev.next = next; + if (next !== null) next.prev = prev; + if (parent !== null) { + if (parent.first === effect) parent.first = next; + if (parent.last === effect) parent.last = prev; + } + } + function pause_effect(effect, callback) { + var transitions = []; + pause_children(effect, transitions, true); + run_out_transitions(transitions, () => { + destroy_effect(effect); + if (callback) callback(); + }); + } + function run_out_transitions(transitions, fn) { + var remaining = transitions.length; + if (remaining > 0) { + var check = () => --remaining || fn(); + for (var transition of transitions) { + transition.out(check); + } + } else { + fn(); + } + } + function pause_children(effect, transitions, local) { + if ((effect.f & INERT) !== 0) return; + effect.f ^= INERT; + if (effect.transitions !== null) { + for (const transition of effect.transitions) { + if (transition.is_global || local) { + transitions.push(transition); + } + } + } + var child2 = effect.first; + while (child2 !== null) { + var sibling2 = child2.next; + var transparent = (child2.f & EFFECT_TRANSPARENT) !== 0 || (child2.f & BRANCH_EFFECT) !== 0; + pause_children(child2, transitions, transparent ? local : false); + child2 = sibling2; + } + } + function resume_effect(effect) { + resume_children(effect, true); + } + function resume_children(effect, local) { + if ((effect.f & INERT) === 0) return; + effect.f ^= INERT; + if ((effect.f & CLEAN) === 0) { + set_signal_status(effect, DIRTY); + schedule_effect(effect); + } + var child2 = effect.first; + while (child2 !== null) { + var sibling2 = child2.next; + var transparent = (child2.f & EFFECT_TRANSPARENT) !== 0 || (child2.f & BRANCH_EFFECT) !== 0; + resume_children(child2, transparent ? local : false); + child2 = sibling2; + } + if (effect.transitions !== null) { + for (const transition of effect.transitions) { + if (transition.is_global || local) { + transition.in(); + } + } + } + } + let is_updating_effect = false; + function set_is_updating_effect(value) { + is_updating_effect = value; + } + let is_destroying_effect = false; + function set_is_destroying_effect(value) { + is_destroying_effect = value; + } + let active_reaction = null; + let untracking = false; + function set_active_reaction(reaction) { + active_reaction = reaction; + } + let active_effect = null; + function set_active_effect(effect) { + active_effect = effect; + } + let current_sources = null; + function push_reaction_value(value) { + if (active_reaction !== null && true) { + if (current_sources === null) { + current_sources = [value]; + } else { + current_sources.push(value); + } + } + } + let new_deps = null; + let skipped_deps = 0; + let untracked_writes = null; + function set_untracked_writes(value) { + untracked_writes = value; + } + let write_version = 1; + let read_version = 0; + let update_version = read_version; + function set_update_version(value) { + update_version = value; + } + let skip_reaction = false; + function increment_write_version() { + return ++write_version; + } + function is_dirty(reaction) { + var flags = reaction.f; + if ((flags & DIRTY) !== 0) { + return true; + } + if ((flags & MAYBE_DIRTY) !== 0) { + var dependencies = reaction.deps; + var is_unowned = (flags & UNOWNED) !== 0; + if (dependencies !== null) { + var i; + var dependency; + var is_disconnected = (flags & DISCONNECTED) !== 0; + var is_unowned_connected = is_unowned && active_effect !== null && !skip_reaction; + var length = dependencies.length; + if ((is_disconnected || is_unowned_connected) && (active_effect === null || (active_effect.f & DESTROYED) === 0)) { + var derived2 = ( + /** @type {Derived} */ + reaction + ); + var parent = derived2.parent; + for (i = 0; i < length; i++) { + dependency = dependencies[i]; + if (is_disconnected || !dependency?.reactions?.includes(derived2)) { + (dependency.reactions ??= []).push(derived2); + } + } + if (is_disconnected) { + derived2.f ^= DISCONNECTED; + } + if (is_unowned_connected && parent !== null && (parent.f & UNOWNED) === 0) { + derived2.f ^= UNOWNED; + } + } + for (i = 0; i < length; i++) { + dependency = dependencies[i]; + if (is_dirty( + /** @type {Derived} */ + dependency + )) { + update_derived( + /** @type {Derived} */ + dependency + ); + } + if (dependency.wv > reaction.wv) { + return true; + } + } + } + if (!is_unowned || active_effect !== null && !skip_reaction) { + set_signal_status(reaction, CLEAN); + } + } + return false; + } + function schedule_possible_effect_self_invalidation(signal, effect, root2 = true) { + var reactions = signal.reactions; + if (reactions === null) return; + if (current_sources?.includes(signal)) { + return; + } + for (var i = 0; i < reactions.length; i++) { + var reaction = reactions[i]; + if ((reaction.f & DERIVED) !== 0) { + schedule_possible_effect_self_invalidation( + /** @type {Derived} */ + reaction, + effect, + false + ); + } else if (effect === reaction) { + if (root2) { + set_signal_status(reaction, DIRTY); + } else if ((reaction.f & CLEAN) !== 0) { + set_signal_status(reaction, MAYBE_DIRTY); + } + schedule_effect( + /** @type {Effect} */ + reaction + ); + } + } + } + function update_reaction(reaction) { + var previous_deps = new_deps; + var previous_skipped_deps = skipped_deps; + var previous_untracked_writes = untracked_writes; + var previous_reaction = active_reaction; + var previous_skip_reaction = skip_reaction; + var previous_sources = current_sources; + var previous_component_context = component_context; + var previous_untracking = untracking; + var previous_update_version = update_version; + var flags = reaction.f; + new_deps = /** @type {null | Value[]} */ + null; + skipped_deps = 0; + untracked_writes = null; + skip_reaction = (flags & UNOWNED) !== 0 && (untracking || !is_updating_effect || active_reaction === null); + active_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null; + current_sources = null; + set_component_context(reaction.ctx); + untracking = false; + update_version = ++read_version; + if (reaction.ac !== null) { + without_reactive_context(() => { + reaction.ac.abort(STALE_REACTION); + }); + reaction.ac = null; + } + try { + reaction.f |= REACTION_IS_UPDATING; + var fn = ( + /** @type {Function} */ + reaction.fn + ); + var result = fn(); + var deps = reaction.deps; + if (new_deps !== null) { + var i; + remove_reactions(reaction, skipped_deps); + if (deps !== null && skipped_deps > 0) { + deps.length = skipped_deps + new_deps.length; + for (i = 0; i < new_deps.length; i++) { + deps[skipped_deps + i] = new_deps[i]; + } + } else { + reaction.deps = deps = new_deps; + } + if (!skip_reaction || // Deriveds that already have reactions can cleanup, so we still add them as reactions + (flags & DERIVED) !== 0 && /** @type {import('#client').Derived} */ + reaction.reactions !== null) { + for (i = skipped_deps; i < deps.length; i++) { + (deps[i].reactions ??= []).push(reaction); + } + } + } else if (deps !== null && skipped_deps < deps.length) { + remove_reactions(reaction, skipped_deps); + deps.length = skipped_deps; + } + if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0) { + for (i = 0; i < /** @type {Source[]} */ + untracked_writes.length; i++) { + schedule_possible_effect_self_invalidation( + untracked_writes[i], + /** @type {Effect} */ + reaction + ); + } + } + if (previous_reaction !== null && previous_reaction !== reaction) { + read_version++; + if (untracked_writes !== null) { + if (previous_untracked_writes === null) { + previous_untracked_writes = untracked_writes; + } else { + previous_untracked_writes.push(.../** @type {Source[]} */ + untracked_writes); + } + } + } + if ((reaction.f & ERROR_VALUE) !== 0) { + reaction.f ^= ERROR_VALUE; + } + return result; + } catch (error) { + return handle_error(error); + } finally { + reaction.f ^= REACTION_IS_UPDATING; + new_deps = previous_deps; + skipped_deps = previous_skipped_deps; + untracked_writes = previous_untracked_writes; + active_reaction = previous_reaction; + skip_reaction = previous_skip_reaction; + current_sources = previous_sources; + set_component_context(previous_component_context); + untracking = previous_untracking; + update_version = previous_update_version; + } + } + function remove_reaction(signal, dependency) { + let reactions = dependency.reactions; + if (reactions !== null) { + var index2 = index_of.call(reactions, signal); + if (index2 !== -1) { + var new_length = reactions.length - 1; + if (new_length === 0) { + reactions = dependency.reactions = null; + } else { + reactions[index2] = reactions[new_length]; + reactions.pop(); + } + } + } + if (reactions === null && (dependency.f & DERIVED) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps` + // allows us to skip the expensive work of disconnecting and immediately reconnecting it + (new_deps === null || !new_deps.includes(dependency))) { + set_signal_status(dependency, MAYBE_DIRTY); + if ((dependency.f & (UNOWNED | DISCONNECTED)) === 0) { + dependency.f ^= DISCONNECTED; + } + destroy_derived_effects( + /** @type {Derived} **/ + dependency + ); + remove_reactions( + /** @type {Derived} **/ + dependency, + 0 + ); + } + } + function remove_reactions(signal, start_index) { + var dependencies = signal.deps; + if (dependencies === null) return; + for (var i = start_index; i < dependencies.length; i++) { + remove_reaction(signal, dependencies[i]); + } + } + function update_effect(effect) { + var flags = effect.f; + if ((flags & DESTROYED) !== 0) { + return; + } + set_signal_status(effect, CLEAN); + var previous_effect = active_effect; + var was_updating_effect = is_updating_effect; + active_effect = effect; + is_updating_effect = true; + try { + if ((flags & BLOCK_EFFECT) !== 0) { + destroy_block_effect_children(effect); + } else { + destroy_effect_children(effect); + } + execute_effect_teardown(effect); + var teardown = update_reaction(effect); + effect.teardown = typeof teardown === "function" ? teardown : null; + effect.wv = write_version; + var dep; + if (DEV && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) ; + } finally { + is_updating_effect = was_updating_effect; + active_effect = previous_effect; + } + } + function get(signal) { + var flags = signal.f; + var is_derived = (flags & DERIVED) !== 0; + if (active_reaction !== null && !untracking) { + var destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0; + if (!destroyed && !current_sources?.includes(signal)) { + var deps = active_reaction.deps; + if ((active_reaction.f & REACTION_IS_UPDATING) !== 0) { + if (signal.rv < read_version) { + signal.rv = read_version; + if (new_deps === null && deps !== null && deps[skipped_deps] === signal) { + skipped_deps++; + } else if (new_deps === null) { + new_deps = [signal]; + } else if (!skip_reaction || !new_deps.includes(signal)) { + new_deps.push(signal); + } + } + } else { + (active_reaction.deps ??= []).push(signal); + var reactions = signal.reactions; + if (reactions === null) { + signal.reactions = [active_reaction]; + } else if (!reactions.includes(active_reaction)) { + reactions.push(active_reaction); + } + } + } + } else if (is_derived && /** @type {Derived} */ + signal.deps === null && /** @type {Derived} */ + signal.effects === null) { + var derived2 = ( + /** @type {Derived} */ + signal + ); + var parent = derived2.parent; + if (parent !== null && (parent.f & UNOWNED) === 0) { + derived2.f ^= UNOWNED; + } + } + if (is_destroying_effect) { + if (old_values.has(signal)) { + return old_values.get(signal); + } + if (is_derived) { + derived2 = /** @type {Derived} */ + signal; + var value = derived2.v; + if ((derived2.f & CLEAN) === 0 && derived2.reactions !== null || depends_on_old_values(derived2)) { + value = execute_derived(derived2); + } + old_values.set(derived2, value); + return value; + } + } else if (is_derived) { + derived2 = /** @type {Derived} */ + signal; + if (is_dirty(derived2)) { + update_derived(derived2); + } + } + if ((signal.f & ERROR_VALUE) !== 0) { + throw signal.v; + } + return signal.v; + } + function depends_on_old_values(derived2) { + if (derived2.v === UNINITIALIZED) return true; + if (derived2.deps === null) return false; + for (const dep of derived2.deps) { + if (old_values.has(dep)) { + return true; + } + if ((dep.f & DERIVED) !== 0 && depends_on_old_values( + /** @type {Derived} */ + dep + )) { + return true; + } + } + return false; + } + const STATUS_MASK = -7169; + function set_signal_status(signal, status) { + signal.f = signal.f & STATUS_MASK | status; + } + const PASSIVE_EVENTS = ["touchstart", "touchmove"]; + function is_passive_event(name) { + return PASSIVE_EVENTS.includes(name); + } + const all_registered_events = /* @__PURE__ */ new Set(); + const root_event_handles = /* @__PURE__ */ new Set(); + let last_propagated_event = null; + function handle_event_propagation(event) { + var handler_element = this; + var owner_document = ( + /** @type {Node} */ + handler_element.ownerDocument + ); + var event_name = event.type; + var path = event.composedPath?.() || []; + var current_target = ( + /** @type {null | Element} */ + path[0] || event.target + ); + last_propagated_event = event; + var path_idx = 0; + var handled_at = last_propagated_event === event && event.__root; + if (handled_at) { + var at_idx = path.indexOf(handled_at); + if (at_idx !== -1 && (handler_element === document || handler_element === /** @type {any} */ + window)) { + event.__root = handler_element; + return; + } + var handler_idx = path.indexOf(handler_element); + if (handler_idx === -1) { + return; + } + if (at_idx <= handler_idx) { + path_idx = at_idx; + } + } + current_target = /** @type {Element} */ + path[path_idx] || event.target; + if (current_target === handler_element) return; + define_property(event, "currentTarget", { + configurable: true, + get() { + return current_target || owner_document; + } + }); + var previous_reaction = active_reaction; + var previous_effect = active_effect; + set_active_reaction(null); + set_active_effect(null); + try { + var throw_error; + var other_errors = []; + while (current_target !== null) { + var parent_element = current_target.assignedSlot || current_target.parentNode || /** @type {any} */ + current_target.host || null; + try { + var delegated = current_target["__" + event_name]; + if (delegated != null && (!/** @type {any} */ + current_target.disabled || // DOM could've been updated already by the time this is reached, so we check this as well + // -> the target could not have been disabled because it emits the event in the first place + event.target === current_target)) { + if (is_array(delegated)) { + var [fn, ...data] = delegated; + fn.apply(current_target, [event, ...data]); + } else { + delegated.call(current_target, event); + } + } + } catch (error) { + if (throw_error) { + other_errors.push(error); + } else { + throw_error = error; + } + } + if (event.cancelBubble || parent_element === handler_element || parent_element === null) { + break; + } + current_target = parent_element; + } + if (throw_error) { + for (let error of other_errors) { + queueMicrotask(() => { + throw error; + }); + } + throw throw_error; + } + } finally { + event.__root = handler_element; + delete event.currentTarget; + set_active_reaction(previous_reaction); + set_active_effect(previous_effect); + } + } + function create_fragment_from_html(html) { + var elem = document.createElement("template"); + elem.innerHTML = html.replaceAll("", ""); + return elem.content; + } + function assign_nodes(start, end) { + var effect = ( + /** @type {Effect} */ + active_effect + ); + if (effect.nodes_start === null) { + effect.nodes_start = start; + effect.nodes_end = end; + } + } + // @__NO_SIDE_EFFECTS__ + function from_html(content, flags) { + var use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0; + var node; + var has_start = !content.startsWith(""); + return () => { + if (node === void 0) { + node = create_fragment_from_html(has_start ? content : "" + content); + node = /** @type {Node} */ + /* @__PURE__ */ get_first_child(node); + } + var clone = ( + /** @type {TemplateNode} */ + use_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true) + ); + { + assign_nodes(clone, clone); + } + return clone; + }; + } + // @__NO_SIDE_EFFECTS__ + function from_namespace(content, flags, ns = "svg") { + var has_start = !content.startsWith(""); + var wrapped = `<${ns}>${has_start ? content : "" + content}`; + var node; + return () => { + if (!node) { + var fragment = ( + /** @type {DocumentFragment} */ + create_fragment_from_html(wrapped) + ); + var root2 = ( + /** @type {Element} */ + /* @__PURE__ */ get_first_child(fragment) + ); + { + node = /** @type {Element} */ + /* @__PURE__ */ get_first_child(root2); + } + } + var clone = ( + /** @type {TemplateNode} */ + node.cloneNode(true) + ); + { + assign_nodes(clone, clone); + } + return clone; + }; + } + // @__NO_SIDE_EFFECTS__ + function from_svg(content, flags) { + return /* @__PURE__ */ from_namespace(content, flags, "svg"); + } + function comment() { + var frag = document.createDocumentFragment(); + var start = document.createComment(""); + var anchor = create_text(); + frag.append(start, anchor); + assign_nodes(start, anchor); + return frag; + } + function append(anchor, dom) { + if (anchor === null) { + return; + } + anchor.before( + /** @type {Node} */ + dom + ); + } + function set_text(text, value) { + var str = value == null ? "" : typeof value === "object" ? value + "" : value; + if (str !== (text.__t ??= text.nodeValue)) { + text.__t = str; + text.nodeValue = str + ""; + } + } + function mount(component2, options) { + return _mount(component2, options); + } + const document_listeners = /* @__PURE__ */ new Map(); + function _mount(Component, { target, anchor, props = {}, events, context, intro = true }) { + init_operations(); + var registered_events = /* @__PURE__ */ new Set(); + var event_handle = (events2) => { + for (var i = 0; i < events2.length; i++) { + var event_name = events2[i]; + if (registered_events.has(event_name)) continue; + registered_events.add(event_name); + var passive = is_passive_event(event_name); + target.addEventListener(event_name, handle_event_propagation, { passive }); + var n = document_listeners.get(event_name); + if (n === void 0) { + document.addEventListener(event_name, handle_event_propagation, { passive }); + document_listeners.set(event_name, 1); + } else { + document_listeners.set(event_name, n + 1); + } + } + }; + event_handle(array_from(all_registered_events)); + root_event_handles.add(event_handle); + var component2 = void 0; + var unmount2 = component_root(() => { + var anchor_node = anchor ?? target.appendChild(create_text()); + branch(() => { + if (context) { + push({}); + var ctx = ( + /** @type {ComponentContext} */ + component_context + ); + ctx.c = context; + } + if (events) { + props.$$events = events; + } + component2 = Component(anchor_node, props) || {}; + if (context) { + pop(); + } + }); + return () => { + for (var event_name of registered_events) { + target.removeEventListener(event_name, handle_event_propagation); + var n = ( + /** @type {number} */ + document_listeners.get(event_name) + ); + if (--n === 0) { + document.removeEventListener(event_name, handle_event_propagation); + document_listeners.delete(event_name); + } else { + document_listeners.set(event_name, n); + } + } + root_event_handles.delete(event_handle); + if (anchor_node !== anchor) { + anchor_node.parentNode?.removeChild(anchor_node); + } + }; + }); + mounted_components.set(component2, unmount2); + return component2; + } + let mounted_components = /* @__PURE__ */ new WeakMap(); + function unmount(component2, options) { + const fn = mounted_components.get(component2); + if (fn) { + mounted_components.delete(component2); + return fn(options); + } + return Promise.resolve(); + } + function if_block(node, fn, elseif = false) { + var anchor = node; + var consequent_effect = null; + var alternate_effect = null; + var condition = UNINITIALIZED; + var flags = elseif ? EFFECT_TRANSPARENT : 0; + var has_branch = false; + const set_branch = (fn2, flag = true) => { + has_branch = true; + update_branch(flag, fn2); + }; + var offscreen_fragment = null; + function commit() { + if (offscreen_fragment !== null) { + offscreen_fragment.lastChild.remove(); + anchor.before(offscreen_fragment); + offscreen_fragment = null; + } + var active = condition ? consequent_effect : alternate_effect; + var inactive = condition ? alternate_effect : consequent_effect; + if (active) { + resume_effect(active); + } + if (inactive) { + pause_effect(inactive, () => { + if (condition) { + alternate_effect = null; + } else { + consequent_effect = null; + } + }); + } + } + const update_branch = (new_condition, fn2) => { + if (condition === (condition = new_condition)) return; + var defer = should_defer_append(); + var target = anchor; + if (defer) { + offscreen_fragment = document.createDocumentFragment(); + offscreen_fragment.append(target = create_text()); + } + if (condition) { + consequent_effect ??= fn2 && branch(() => fn2(target)); + } else { + alternate_effect ??= fn2 && branch(() => fn2(target)); + } + if (defer) { + var batch = ( + /** @type {Batch} */ + current_batch + ); + var active = condition ? consequent_effect : alternate_effect; + var inactive = condition ? alternate_effect : consequent_effect; + if (active) batch.skipped_effects.delete(active); + if (inactive) batch.skipped_effects.add(inactive); + batch.add_callback(commit); + } else { + commit(); + } + }; + block(() => { + has_branch = false; + fn(set_branch); + if (!has_branch) { + update_branch(null, null); + } + }, flags); + } + function index(_, i) { + return i; + } + function pause_effects(state2, items, controlled_anchor) { + var items_map = state2.items; + var transitions = []; + var length = items.length; + for (var i = 0; i < length; i++) { + pause_children(items[i].e, transitions, true); + } + var is_controlled = length > 0 && transitions.length === 0 && controlled_anchor !== null; + if (is_controlled) { + var parent_node = ( + /** @type {Element} */ + /** @type {Element} */ + controlled_anchor.parentNode + ); + clear_text_content(parent_node); + parent_node.append( + /** @type {Element} */ + controlled_anchor + ); + items_map.clear(); + link(state2, items[0].prev, items[length - 1].next); + } + run_out_transitions(transitions, () => { + for (var i2 = 0; i2 < length; i2++) { + var item = items[i2]; + if (!is_controlled) { + items_map.delete(item.k); + link(state2, item.prev, item.next); + } + destroy_effect(item.e, !is_controlled); + } + }); + } + function each(node, flags, get_collection, get_key, render_fn, fallback_fn = null) { + var anchor = node; + var state2 = { flags, items: /* @__PURE__ */ new Map(), first: null }; + var is_controlled = (flags & EACH_IS_CONTROLLED) !== 0; + if (is_controlled) { + var parent_node = ( + /** @type {Element} */ + node + ); + anchor = parent_node.appendChild(create_text()); + } + var fallback = null; + var was_empty = false; + var offscreen_items = /* @__PURE__ */ new Map(); + var each_array = /* @__PURE__ */ derived_safe_equal(() => { + var collection = get_collection(); + return is_array(collection) ? collection : collection == null ? [] : array_from(collection); + }); + var array; + var each_effect; + function commit() { + reconcile( + each_effect, + array, + state2, + offscreen_items, + anchor, + render_fn, + flags, + get_key, + get_collection + ); + if (fallback_fn !== null) { + if (array.length === 0) { + if (fallback) { + resume_effect(fallback); + } else { + fallback = branch(() => fallback_fn(anchor)); + } + } else if (fallback !== null) { + pause_effect(fallback, () => { + fallback = null; + }); + } + } + } + block(() => { + each_effect ??= /** @type {Effect} */ + active_effect; + array = /** @type {V[]} */ + get(each_array); + var length = array.length; + if (was_empty && length === 0) { + return; + } + was_empty = length === 0; + var item, i, value, key; + { + if (should_defer_append()) { + var keys = /* @__PURE__ */ new Set(); + var batch = ( + /** @type {Batch} */ + current_batch + ); + for (i = 0; i < length; i += 1) { + value = array[i]; + key = get_key(value, i); + var existing = state2.items.get(key) ?? offscreen_items.get(key); + if (existing) { + if ((flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0) { + update_item(existing, value, i, flags); + } + } else { + item = create_item( + null, + state2, + null, + null, + value, + key, + i, + render_fn, + flags, + get_collection, + true + ); + offscreen_items.set(key, item); + } + keys.add(key); + } + for (const [key2, item2] of state2.items) { + if (!keys.has(key2)) { + batch.skipped_effects.add(item2.e); + } + } + batch.add_callback(commit); + } else { + commit(); + } + } + get(each_array); + }); + } + function reconcile(each_effect, array, state2, offscreen_items, anchor, render_fn, flags, get_key, get_collection) { + var is_animated = (flags & EACH_IS_ANIMATED) !== 0; + var should_update = (flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0; + var length = array.length; + var items = state2.items; + var first = state2.first; + var current = first; + var seen; + var prev = null; + var to_animate; + var matched = []; + var stashed = []; + var value; + var key; + var item; + var i; + if (is_animated) { + for (i = 0; i < length; i += 1) { + value = array[i]; + key = get_key(value, i); + item = items.get(key); + if (item !== void 0) { + item.a?.measure(); + (to_animate ??= /* @__PURE__ */ new Set()).add(item); + } + } + } + for (i = 0; i < length; i += 1) { + value = array[i]; + key = get_key(value, i); + item = items.get(key); + if (item === void 0) { + var pending = offscreen_items.get(key); + if (pending !== void 0) { + offscreen_items.delete(key); + items.set(key, pending); + var next = prev ? prev.next : current; + link(state2, prev, pending); + link(state2, pending, next); + move(pending, next, anchor); + prev = pending; + } else { + var child_anchor = current ? ( + /** @type {TemplateNode} */ + current.e.nodes_start + ) : anchor; + prev = create_item( + child_anchor, + state2, + prev, + prev === null ? state2.first : prev.next, + value, + key, + i, + render_fn, + flags, + get_collection + ); + } + items.set(key, prev); + matched = []; + stashed = []; + current = prev.next; + continue; + } + if (should_update) { + update_item(item, value, i, flags); + } + if ((item.e.f & INERT) !== 0) { + resume_effect(item.e); + if (is_animated) { + item.a?.unfix(); + (to_animate ??= /* @__PURE__ */ new Set()).delete(item); + } + } + if (item !== current) { + if (seen !== void 0 && seen.has(item)) { + if (matched.length < stashed.length) { + var start = stashed[0]; + var j; + prev = start.prev; + var a = matched[0]; + var b = matched[matched.length - 1]; + for (j = 0; j < matched.length; j += 1) { + move(matched[j], start, anchor); + } + for (j = 0; j < stashed.length; j += 1) { + seen.delete(stashed[j]); + } + link(state2, a.prev, b.next); + link(state2, prev, a); + link(state2, b, start); + current = start; + prev = b; + i -= 1; + matched = []; + stashed = []; + } else { + seen.delete(item); + move(item, current, anchor); + link(state2, item.prev, item.next); + link(state2, item, prev === null ? state2.first : prev.next); + link(state2, prev, item); + prev = item; + } + continue; + } + matched = []; + stashed = []; + while (current !== null && current.k !== key) { + if ((current.e.f & INERT) === 0) { + (seen ??= /* @__PURE__ */ new Set()).add(current); + } + stashed.push(current); + current = current.next; + } + if (current === null) { + continue; + } + item = current; + } + matched.push(item); + prev = item; + current = item.next; + } + if (current !== null || seen !== void 0) { + var to_destroy = seen === void 0 ? [] : array_from(seen); + while (current !== null) { + if ((current.e.f & INERT) === 0) { + to_destroy.push(current); + } + current = current.next; + } + var destroy_length = to_destroy.length; + if (destroy_length > 0) { + var controlled_anchor = (flags & EACH_IS_CONTROLLED) !== 0 && length === 0 ? anchor : null; + if (is_animated) { + for (i = 0; i < destroy_length; i += 1) { + to_destroy[i].a?.measure(); + } + for (i = 0; i < destroy_length; i += 1) { + to_destroy[i].a?.fix(); + } + } + pause_effects(state2, to_destroy, controlled_anchor); + } + } + if (is_animated) { + queue_micro_task(() => { + if (to_animate === void 0) return; + for (item of to_animate) { + item.a?.apply(); + } + }); + } + each_effect.first = state2.first && state2.first.e; + each_effect.last = prev && prev.e; + for (var unused of offscreen_items.values()) { + destroy_effect(unused.e); + } + offscreen_items.clear(); + } + function update_item(item, value, index2, type) { + if ((type & EACH_ITEM_REACTIVE) !== 0) { + internal_set(item.v, value); + } + if ((type & EACH_INDEX_REACTIVE) !== 0) { + internal_set( + /** @type {Value} */ + item.i, + index2 + ); + } else { + item.i = index2; + } + } + function create_item(anchor, state2, prev, next, value, key, index2, render_fn, flags, get_collection, deferred2) { + var reactive = (flags & EACH_ITEM_REACTIVE) !== 0; + var mutable = (flags & EACH_ITEM_IMMUTABLE) === 0; + var v = reactive ? mutable ? /* @__PURE__ */ mutable_source(value, false, false) : source(value) : value; + var i = (flags & EACH_INDEX_REACTIVE) === 0 ? index2 : source(index2); + var item = { + i, + v, + k: key, + a: null, + // @ts-expect-error + e: null, + prev, + next + }; + try { + if (anchor === null) { + var fragment = document.createDocumentFragment(); + fragment.append(anchor = create_text()); + } + item.e = branch(() => render_fn( + /** @type {Node} */ + anchor, + v, + i, + get_collection + ), hydrating); + item.e.prev = prev && prev.e; + item.e.next = next && next.e; + if (prev === null) { + if (!deferred2) { + state2.first = item; + } + } else { + prev.next = item; + prev.e.next = item.e; + } + if (next !== null) { + next.prev = item; + next.e.prev = item.e; + } + return item; + } finally { + } + } + function move(item, next, anchor) { + var end = item.next ? ( + /** @type {TemplateNode} */ + item.next.e.nodes_start + ) : anchor; + var dest = next ? ( + /** @type {TemplateNode} */ + next.e.nodes_start + ) : anchor; + var node = ( + /** @type {TemplateNode} */ + item.e.nodes_start + ); + while (node !== null && node !== end) { + var next_node = ( + /** @type {TemplateNode} */ + /* @__PURE__ */ get_next_sibling(node) + ); + dest.before(node); + node = next_node; + } + } + function link(state2, prev, next) { + if (prev === null) { + state2.first = next; + } else { + prev.next = next; + prev.e.next = next && next.e; + } + if (next !== null) { + next.prev = prev; + next.e.prev = prev && prev.e; + } + } + function slot(anchor, $$props, name, slot_props, fallback_fn) { + var slot_fn = $$props.$$slots?.[name]; + var is_interop = false; + if (slot_fn === true) { + slot_fn = $$props["children"]; + is_interop = true; + } + if (slot_fn === void 0) ; + else { + slot_fn(anchor, is_interop ? () => slot_props : slot_props); + } + } + function snippet(node, get_snippet, ...args) { + var anchor = node; + var snippet2 = noop; + var snippet_effect; + block(() => { + if (snippet2 === (snippet2 = get_snippet())) return; + if (snippet_effect) { + destroy_effect(snippet_effect); + snippet_effect = null; + } + snippet_effect = branch(() => ( + /** @type {SnippetFn} */ + snippet2(anchor, ...args) + )); + }, EFFECT_TRANSPARENT); + } + function component(node, get_component, render_fn) { + var anchor = node; + var component2; + var effect; + var offscreen_fragment = null; + var pending_effect = null; + function commit() { + if (effect) { + pause_effect(effect); + effect = null; + } + if (offscreen_fragment) { + offscreen_fragment.lastChild.remove(); + anchor.before(offscreen_fragment); + offscreen_fragment = null; + } + effect = pending_effect; + pending_effect = null; + } + block(() => { + if (component2 === (component2 = get_component())) return; + var defer = should_defer_append(); + if (component2) { + var target = anchor; + if (defer) { + offscreen_fragment = document.createDocumentFragment(); + offscreen_fragment.append(target = create_text()); + if (effect) { + current_batch.skipped_effects.add(effect); + } + } + pending_effect = branch(() => render_fn(target, component2)); + } + if (defer) { + current_batch.add_callback(commit); + } else { + commit(); + } + }, EFFECT_TRANSPARENT); + } + function r(e) { + var t2, f, n = ""; + if ("string" == typeof e || "number" == typeof e) n += e; + else if ("object" == typeof e) if (Array.isArray(e)) { + var o = e.length; + for (t2 = 0; t2 < o; t2++) e[t2] && (f = r(e[t2])) && (n && (n += " "), n += f); + } else for (f in e) e[f] && (n && (n += " "), n += f); + return n; + } + function clsx$1() { + for (var e, t2, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t2 = r(e)) && (n && (n += " "), n += t2); + return n; + } + function clsx(value) { + if (typeof value === "object") { + return clsx$1(value); + } else { + return value ?? ""; + } + } + function to_class(value, hash, directives) { + var classname = value == null ? "" : "" + value; + return classname === "" ? null : classname; + } + function set_class(dom, is_html, value, hash, prev_classes, next_classes) { + var prev = dom.__className; + if (prev !== value || prev === void 0) { + var next_class_name = to_class(value); + { + if (next_class_name == null) { + dom.removeAttribute("class"); + } else if (is_html) { + dom.className = next_class_name; + } else { + dom.setAttribute("class", next_class_name); + } + } + dom.__className = value; + } + return next_classes; + } + let is_store_binding = false; + function capture_store_binding(fn) { + var previous_is_store_binding = is_store_binding; + try { + is_store_binding = false; + return [fn(), is_store_binding]; + } finally { + is_store_binding = previous_is_store_binding; + } + } + function prop(props, key, flags, fallback) { + var runes = !legacy_mode_flag || (flags & PROPS_IS_RUNES) !== 0; + var bindable = (flags & PROPS_IS_BINDABLE) !== 0; + var fallback_value = ( + /** @type {V} */ + fallback + ); + var fallback_dirty = true; + var get_fallback = () => { + if (fallback_dirty) { + fallback_dirty = false; + fallback_value = /** @type {V} */ + fallback; + } + return fallback_value; + }; + var setter; + { + var is_entry_props = STATE_SYMBOL in props || LEGACY_PROPS in props; + setter = get_descriptor(props, key)?.set ?? (is_entry_props && key in props ? (v) => props[key] = v : void 0); + } + var initial_value; + var is_store_sub = false; + { + [initial_value, is_store_sub] = capture_store_binding(() => ( + /** @type {V} */ + props[key] + )); + } + if (initial_value === void 0 && fallback !== void 0) { + initial_value = get_fallback(); + if (setter) { + if (runes) props_invalid_value(); + setter(initial_value); + } + } + var getter; + if (runes) { + getter = () => { + var value = ( + /** @type {V} */ + props[key] + ); + if (value === void 0) return get_fallback(); + fallback_dirty = true; + return value; + }; + } else { + getter = () => { + var value = ( + /** @type {V} */ + props[key] + ); + if (value !== void 0) { + fallback_value = /** @type {V} */ + void 0; + } + return value === void 0 ? fallback_value : value; + }; + } + if (runes && (flags & PROPS_IS_UPDATED) === 0) { + return getter; + } + if (setter) { + var legacy_parent = props.$$legacy; + return ( + /** @type {() => V} */ + (function(value, mutation) { + if (arguments.length > 0) { + if (!runes || !mutation || legacy_parent || is_store_sub) { + setter(mutation ? getter() : value); + } + return value; + } + return getter(); + }) + ); + } + var overridden = false; + var d = /* @__PURE__ */ derived_safe_equal(() => { + overridden = false; + return getter(); + }); + get(d); + var parent_effect = ( + /** @type {Effect} */ + active_effect + ); + return ( + /** @type {() => V} */ + (function(value, mutation) { + if (arguments.length > 0) { + const new_value = mutation ? get(d) : runes && bindable ? proxy(value) : value; + set(d, new_value); + overridden = true; + if (fallback_value !== void 0) { + fallback_value = new_value; + } + return value; + } + if (is_destroying_effect && overridden || (parent_effect.f & DESTROYED) !== 0) { + return d.v; + } + return get(d); + }) + ); + } + function autoEmbedWithTarget(component2, targetId) { + const target = new URLSearchParams(window.location.search).get("target") ?? targetId; + const instance = mount(component2, { + target: document.getElementById(target) ?? document.body + }); + window[target] = { + stop: () => unmount(instance) + }; + } + const PUBLIC_VERSION = "5"; + if (typeof window !== "undefined") { + ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(PUBLIC_VERSION); + } + enable_legacy_mode_flag(); + var root$6 = /* @__PURE__ */ from_html(`
`); + function Spinner($$anchor, $$props) { + let className = prop($$props, "className", 8, "w-8 h-8 animate-spin dark:text-gray-800 fill-blue-900"); + var div = root$6(); + var svg = child(div); + var node = sibling(svg, 2); + slot(node, $$props, "default", {}); + template_effect(() => set_class(svg, 0, clsx(className()))); + append($$anchor, div); + } + var root$5 = /* @__PURE__ */ from_svg(``); + function ExclamationMark($$anchor, $$props) { + let className = prop($$props, "className", 8, "w-5 h-5 mr-2 text-rose-700"); + var svg = root$5(); + template_effect(() => set_class(svg, 0, clsx(className()))); + append($$anchor, svg); + } + var root$4 = /* @__PURE__ */ from_svg(``); + function CheckMark($$anchor, $$props) { + let className = prop($$props, "className", 8, "h-4 w-4"); + var svg = root$4(); + template_effect(() => set_class(svg, 0, clsx(className()))); + append($$anchor, svg); + } + var root$3 = /* @__PURE__ */ from_svg(``); + function Clock($$anchor, $$props) { + let className = prop($$props, "className", 8, "h-4 w-4 dark:opacity-50"); + var svg = root$3(); + template_effect(() => set_class(svg, 0, clsx(className()))); + append($$anchor, svg); + } + var root$2 = /* @__PURE__ */ from_svg(``); + function Close($$anchor, $$props) { + let className = prop($$props, "className", 8, "h-4 w-4"); + var svg = root$2(); + template_effect(() => set_class(svg, 0, clsx(className()))); + append($$anchor, svg); + } + const Status = { + FAILED: "FAILED", + PENDING: "PENDING", + SUCCESS: "SUCCESS" + }; + Object.freeze(Status); + var root_1$2 = /* @__PURE__ */ from_html(`
`); + var root$1 = /* @__PURE__ */ from_html(`
`); + function TableCell($$anchor, $$props) { + push($$props, true); + function isTheNextStepFailed(row, stepIndex) { + if (stepIndex === null) return false; + const indexElement = row.findIndex(({ step_index }) => step_index === stepIndex); + const nextElement = indexElement + 1; + return row[nextElement]?.status !== Status.SUCCESS; + } + function notTheLastStep(index2, rowLength) { + return index2 < rowLength - 1; + } + var td = root$1(); + var div = child(td); + var node = child(div); + snippet(node, () => $$props.children); + var node_1 = sibling(div, 2); + { + var consequent = ($$anchor2) => { + var div_1 = root_1$2(); + template_effect(($0) => set_class(div_1, 1, `${$0 ?? ""} absolute top-1/2 left-[calc(50%+16px)] h-0.5 w-[calc(100%-32px)] -translate-y-1/2 z-0`), [ + () => isTheNextStepFailed($$props.row, $$props.cell.step_index) ? "bg-neutral-400 dark:bg-neutral-800" : "bg-green-700" + ]); + append($$anchor2, div_1); + }; + if_block(node_1, ($$render) => { + if (notTheLastStep($$props.i, $$props.row.length)) $$render(consequent); + }); + } + template_effect(() => set_class(div, 1, `${$$props.className ?? ""} w-8 h-8 rounded-full flex items-center justify-center mx-auto text-white`)); + append($$anchor, td); + pop(); + } + var root_2$1 = /* @__PURE__ */ from_html(` `); + var root_1$1 = /* @__PURE__ */ from_html(``); + var root_9 = /* @__PURE__ */ from_html(` `); + var root_5$1 = /* @__PURE__ */ from_html(``); + var root_3 = /* @__PURE__ */ from_html(``); + var root = /* @__PURE__ */ from_html(`
`); + function Table($$anchor, $$props) { + push($$props, true); + const icons = { + [Status.PENDING]: Clock, + [Status.SUCCESS]: CheckMark, + [Status.FAILED]: Close + }; + var table = root(); + var node = child(table); + { + var consequent = ($$anchor2) => { + var thead = root_1$1(); + var tr = child(thead); + each(tr, 21, () => $$props.columns, index, ($$anchor3, $$item) => { + let label = () => get($$item).label; + var th = root_2$1(); + var span = child(th); + var text = child(span); + template_effect(() => set_text(text, label())); + append($$anchor3, th); + }); + append($$anchor2, thead); + }; + if_block(node, ($$render) => { + if ($$props.columns) $$render(consequent); + }); + } + var node_1 = sibling(node); + { + var consequent_3 = ($$anchor2) => { + var tbody = root_3(); + var node_2 = child(tbody); + { + var consequent_2 = ($$anchor3) => { + var fragment = comment(); + var node_3 = first_child(fragment); + each(node_3, 17, () => $$props.rows, index, ($$anchor4, row) => { + var tr_1 = root_5$1(); + each(tr_1, 21, () => get(row), index, ($$anchor5, cell, i) => { + var fragment_1 = comment(); + var node_4 = first_child(fragment_1); + { + var consequent_1 = ($$anchor6) => { + { + let $0 = /* @__PURE__ */ user_derived(() => get(cell).status === Status.SUCCESS ? "bg-green-700" : get(cell).status === Status.FAILED ? "bg-rose-700" : "bg-neutral-400 dark:bg-neutral-800"); + TableCell($$anchor6, { + get cell() { + return get(cell); + }, + get row() { + return get(row); + }, + i, + get className() { + return get($0); + }, + children: ($$anchor7, $$slotProps) => { + const IconComponent = /* @__PURE__ */ user_derived(() => icons[get(cell).status]); + var fragment_3 = comment(); + var node_5 = first_child(fragment_3); + component(node_5, () => get(IconComponent), ($$anchor8, IconComponent_1) => { + IconComponent_1($$anchor8, {}); + }); + append($$anchor7, fragment_3); + }, + $$slots: { default: true } + }); + } + }; + var alternate = ($$anchor6) => { + var td = root_9(); + var text_1 = child(td); + template_effect(() => set_text(text_1, get(cell).value ?? get(cell).status ?? "👻")); + append($$anchor6, td); + }; + if_block(node_4, ($$render) => { + if (get(cell).status) $$render(consequent_1); + else $$render(alternate, false); + }); + } + append($$anchor5, fragment_1); + }); + append($$anchor4, tr_1); + }); + append($$anchor3, fragment); + }; + if_block(node_2, ($$render) => { + if ($$props.rows.length > 0) $$render(consequent_2); + }); + } + append($$anchor2, tbody); + }; + if_block(node_1, ($$render) => { + if ($$props.columns && $$props.rows != null) $$render(consequent_3); + }); + } + append($$anchor, table); + pop(); + } + const config = (() => { + const el = document.querySelector("[data-rpa-process-overview-config]"); + if (el !== null) { + try { + const configString = el.dataset.rpaProcessOverviewConfig; + if (configString) { + return JSON.parse(configString); + } + } catch (error) { + } + } + return {}; + })(); + const t = (text) => config.messages?.[text] ?? text + " (missing translation)"; + var root_2 = /* @__PURE__ */ from_html(`

`); + var root_1 = /* @__PURE__ */ from_html(`
`); + var root_4 = /* @__PURE__ */ from_html(`

`); + var root_5 = /* @__PURE__ */ from_html(`

`); + function ProcessOverview($$anchor, $$props) { + push($$props, true); + let error = /* @__PURE__ */ state(false); + let data = /* @__PURE__ */ state(null); + let total = /* @__PURE__ */ state(null); + let fetching = /* @__PURE__ */ state(true); + user_effect(() => { + set(fetching, true); + const url = new URL(config.data_url, document.location.href); + fetch(url.toString()).then((response) => response.json()).then(({ data: recievedData, meta }) => { + if (recievedData) { + set(total, meta?.total ?? null, true); + set(data, recievedData, true); + } + set(fetching, false); + }).catch(() => { + set(error, true); + }); + }); + var fragment = comment(); + var node = first_child(fragment); + { + var consequent = ($$anchor2) => { + var div = root_1(); + var node_1 = child(div); + Spinner(node_1, { + children: ($$anchor3, $$slotProps) => { + var h2 = root_2(); + var text = child(h2); + template_effect(($0) => set_text(text, $0), [() => t("Loading data...")]); + append($$anchor3, h2); + }, + $$slots: { default: true } + }); + append($$anchor2, div); + }; + var alternate_1 = ($$anchor2) => { + var fragment_1 = comment(); + var node_2 = first_child(fragment_1); + { + var consequent_1 = ($$anchor3) => { + var h2_1 = root_4(); + var text_1 = child(h2_1); + template_effect(($0) => set_text(text_1, $0), [() => t("Missing data")]); + append($$anchor3, h2_1); + }; + var alternate = ($$anchor3) => { + var div_1 = root_5(); + var div_2 = child(div_1); + var node_3 = child(div_2); + ExclamationMark(node_3, {}); + var h2_2 = sibling(node_3, 2); + var text_2 = child(h2_2); + var span = sibling(h2_2, 2); + var text_3 = child(span); + var div_3 = sibling(div_2, 2); + var node_4 = child(div_3); + Table(node_4, { + get columns() { + return get(data).columns; + }, + get rows() { + return get(data).rows; + } + }); + template_effect( + ($0) => { + set_text(text_2, $0); + set_text(text_3, get(total) ?? "?"); + }, + [() => t("Failed processes")] + ); + append($$anchor3, div_1); + }; + if_block( + node_2, + ($$render) => { + if (null === get(data)) $$render(consequent_1); + else $$render(alternate, false); + }, + true + ); + } + append($$anchor2, fragment_1); + }; + if_block(node, ($$render) => { + if (get(fetching)) $$render(consequent); + else $$render(alternate_1, false); + }); + } + append($$anchor, fragment); + pop(); + } + autoEmbedWithTarget(ProcessOverview, "ProcessOverview"); +})); diff --git a/public/widgets/ProcessSearch.min.js b/public/widgets/ProcessSearch.min.js index dbf9b69..eaa38ab 100644 --- a/public/widgets/ProcessSearch.min.js +++ b/public/widgets/ProcessSearch.min.js @@ -1 +1,2400 @@ -(function(jn){typeof define=="function"&&define.amd?define(jn):jn()})(function(){"use strict";var tt=Array.isArray,Ut=Array.prototype.indexOf,Vt=Array.from,Ln=Object.defineProperty,cn=Object.getOwnPropertyDescriptor,Ft=Object.prototype,Kt=Array.prototype,Ht=Object.getPrototypeOf,et=Object.isExtensible;function rt(n){for(var t=0;t0||En.length>0}function Yt(){var n;W.length>0&&ft(),En.length>0&&(n=En,En=[],rt(n))}function Zt(){const n=w.b;return n===null&&(function(){throw new Error("https://svelte.dev/e/await_outside_boundary")})(),n}function ne(n){var t=2050,e=g!==null&&2&g.f?g:null;return w===null||e!==null&&(e.f&M)!==0?t|=M:w.f|=ut,{ctx:j,deps:null,effects:null,equals:it,f:t,fn:n,reactions:null,rv:0,v:x,wv:0,parent:e??w,ac:null}}function te(n,t){let e=w;e===null&&(function(){throw new Error("https://svelte.dev/e/async_derived_orphan")})();var r=e.b,l=void 0,u=wt(x),o=null,s=!g;return(function(i){Q(4718592,i,!0)})(()=>{try{var i=n();o&&Promise.resolve(i).catch(()=>{})}catch(f){i=Promise.reject(f)}var a=()=>i;l=o?.then(a,a)??Promise.resolve(i),o=l;var c=y,d=r.is_pending();s&&(r.update_pending_count(1),d||c.increment());const v=(f,p=void 0)=>{o=null,d||c.activate(),p?p!==Wn&&(u.f|=K,Un(u,p)):((u.f&K)!==0&&(u.f^=K),Un(u,f)),s&&(r.update_pending_count(-1),d||c.decrement()),dt()};if(l.then(v,f=>v(null,f||"unknown")),c)return()=>{queueMicrotask(()=>c.neuter())}}),new Promise(i=>{(function a(c){function d(){c===l?i(u):a(l)}c.then(d,d)})(l)})}function ct(n){var t=n.effects;if(t!==null){n.effects=null;for(var e=0;ete(i))).then(i=>{l?.activate(),o();try{e([...n.map(r),...i])}catch(a){(u.f&dn)===0&&$n(a,u)}l?.deactivate(),dt()}).catch(i=>{s.error(i)})}else e(n.map(r))}function dt(){B(null),C(null),xn(null)}const In=new Set;let y=null,Pn=null,ht=new Set,H=[],Sn=null,Jn=!1,hn=!1;class nn{current=new Map;#a=new Map;#l=new Set;#n=0;#s=null;#f=!1;#e=[];#u=[];#r=[];#t=[];#i=[];#c=[];#v=[];skipped_effects=new Set;process(t){H=[],Pn=null;for(const l of t)this.#h(l);if(this.#e.length===0&&this.#n===0){this.#d();var e=this.#r,r=this.#t;this.#r=[],this.#t=[],this.#i=[],Pn=y,y=null,gt(e),gt(r),y===null?y=this:In.delete(this),this.#s?.resolve()}else this.#o(this.#r),this.#o(this.#t),this.#o(this.#i);for(const l of this.#e)ln(l);for(const l of this.#u)ln(l);this.#e=[],this.#u=[]}#h(t){t.f^=E;for(var e=t.first;e!==null;){var r=e.f,l=!!(96&r);if(!(l&&(r&E)!==0||(r&F)!==0||this.skipped_effects.has(e))&&e.fn!==null){l?e.f^=E:4&r?this.#t.push(e):(r&E)===0&&((r&Gt)!==0?(e.b?.is_pending()?this.#u:this.#e).push(e):kn(e)&&((e.f&vn)!==0&&this.#i.push(e),ln(e)));var u=e.first;if(u!==null){e=u;continue}}var o=e.parent;for(e=e.next;e===null&&o!==null;)e=o.next,o=o.parent}}#o(t){for(const e of t)((e.f&D)!==0?this.#c:this.#v).push(e),k(e,E);t.length=0}capture(t,e){this.#a.has(t)||this.#a.set(t,e),this.current.set(t,t.v)}activate(){y=this}deactivate(){y=null,Pn=null;for(const t of ht)if(ht.delete(t),t(),y!==null)break}neuter(){this.#f=!0}flush(){H.length>0?pt():this.#d(),y===this&&(this.#n===0&&In.delete(this),this.deactivate())}#d(){if(!this.#f)for(const t of this.#l)t();this.#l.clear()}increment(){this.#n+=1}decrement(){if(this.#n-=1,this.#n===0){for(const t of this.#c)k(t,D),tn(t);for(const t of this.#v)k(t,V),tn(t);this.#r=[],this.#t=[],this.flush()}else this.deactivate()}add_callback(t){this.#l.add(t)}settled(){return(this.#s??={promise:new Promise((r,l)=>{t=r,e=l}),resolve:t,reject:e}).promise;var t,e}static ensure(){if(y===null){const t=y=new nn;In.add(y),hn||nn.enqueue(()=>{y===t&&t.flush()})}return y}static enqueue(t){(function(e){if(W.length===0&&!hn){var r=W;queueMicrotask(()=>{r===W&&ft()})}W.push(e)})(t)}}function pt(){var n=en;Jn=!0;try{var t=0;for(Lt(!0);H.length>0;){var e=nn.ensure();t++>1e3&&re(),e.process(H),$.clear()}}finally{Jn=!1,Lt(n),Sn=null}}function re(){try{(function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")})()}catch(n){$n(n,Sn)}}let z=null;function gt(n){var t=n.length;if(t!==0){for(var e=0;e0)){$.clear();for(const l of z)ln(l);z=[]}}z=null}}function tn(n){for(var t=Sn=n;t.parent!==null;){var e=(t=t.parent).f;if(Jn&&t===w&&(e&vn)!==0)return;if(96&e){if((e&E)===0)return;t.f^=E}}H.push(t)}const $=new Map;function wt(n,t){return{f:0,v:n,reactions:null,equals:it,rv:0,wv:0}}function L(n,t){const e=wt(n);var r;return r=e,g!==null&&(T===null?T=[r]:T.push(r)),e}function R(n,t,e=!1){return g===null||A&&(g.f&zt)===0||!(4325394&g.f)||T?.includes(n)||(function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")})(),Un(n,e?pn(t):t)}function Un(n,t){if(!n.equals(t)){var e=n.v;rn?$.set(n,t):$.set(n,e),n.v=t,nn.ensure().capture(n,e),2&n.f&&((n.f&D)!==0&&Bn(n),k(n,(n.f&M)===0?E:V)),n.wv=Dt(),mt(n,D),w===null||(w.f&E)===0||96&w.f||(N===null?(function(r){N=r})([n]):N.push(n))}return t}function Vn(n){R(n,n.v+1)}function mt(n,t){var e=n.reactions;if(e!==null)for(var r=e.length,l=0;l{if(Y===u)return s();var i=g,a=Y;C(null),Ct(u);var c=s();return C(i),Ct(a),c};return r&&e.set("length",L(n.length)),new Proxy(n,{defineProperty(s,i,a){"value"in a&&a.configurable!==!1&&a.enumerable!==!1&&a.writable!==!1||(function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")})();var c=e.get(i);return c===void 0?c=o(()=>{var d=L(a.value);return e.set(i,d),d}):R(c,a.value,!0),!0},deleteProperty(s,i){var a=e.get(i);if(a===void 0){if(i in s){const c=o(()=>L(x));e.set(i,c),Vn(l)}}else R(a,x),Vn(l);return!0},get(s,i,a){if(i===Tn)return n;var c=e.get(i),d=i in s;if(c!==void 0||d&&!cn(s,i)?.writable||(c=o(()=>L(pn(d?s[i]:x))),e.set(i,c)),c!==void 0){var v=_(c);return v===x?void 0:v}return Reflect.get(s,i,a)},getOwnPropertyDescriptor(s,i){var a=Reflect.getOwnPropertyDescriptor(s,i);if(a&&"value"in a){var c=e.get(i);c&&(a.value=_(c))}else if(a===void 0){var d=e.get(i),v=d?.v;if(d!==void 0&&v!==x)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return a},has(s,i){if(i===Tn)return!0;var a=e.get(i),c=a!==void 0&&a.v!==x||Reflect.has(s,i);return(a!==void 0||w!==null&&(!c||cn(s,i)?.writable))&&(a===void 0&&(a=o(()=>L(c?pn(s[i]):x)),e.set(i,a)),_(a)===x)?!1:c},set(s,i,a,c){var d=e.get(i),v=i in s;if(r&&i==="length")for(var f=a;fL(x)),e.set(f+"",p))}d===void 0?v&&!cn(s,i)?.writable||(R(d=o(()=>L(void 0)),pn(a)),e.set(i,d)):(v=d.v!==x,R(d,o(()=>pn(a))));var h=Reflect.getOwnPropertyDescriptor(s,i);if(h?.set&&h.set.call(c,a),!v){if(r&&typeof i=="string"){var b=e.get("length"),m=Number(i);Number.isInteger(m)&&m>=b.v&&R(b,m+1)}Vn(l)}return!0},ownKeys(s){_(l);var i=Reflect.ownKeys(s).filter(d=>{var v=e.get(d);return v===void 0||v.v!==x});for(var[a,c]of e)c.v===x||a in s||i.push(a);return i},setPrototypeOf(){(function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")})()}})}var yt,_t,bt,xt;function Et(n=""){return document.createTextNode(n)}function On(n){return bt.call(n)}function Fn(n){return xt.call(n)}function S(n,t){return On(n)}function Kn(n,t){var e=On(n);return e instanceof Comment&&e.data===""?Fn(e):e}function G(n,t=1,e=!1){let r=n;for(;t--;)r=Fn(r);return r}let Pt=!1;function Hn(n){var t=g,e=w;C(null),B(null);try{return n()}finally{C(t),B(e)}}function le(n,t,e,r=e){n.addEventListener(t,()=>Hn(e));const l=n.__on_r;n.__on_r=l?()=>{l(),r(!0)}:()=>r(!0),Pt||(Pt=!0,document.addEventListener("reset",u=>{Promise.resolve().then(()=>{if(!u.defaultPrevented)for(const o of u.target.elements)o.__on_r?.()})},{capture:!0}))}function ue(n){w===null&&g===null&&(function(){throw new Error("https://svelte.dev/e/effect_orphan")})(),g!==null&&(g.f&M)!==0&&w===null&&(function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")})(),rn&&(function(){throw new Error("https://svelte.dev/e/effect_in_teardown")})()}function Q(n,t,e,r=!0){var l=w;l!==null&&(l.f&F)!==0&&(n|=F);var u={ctx:j,deps:null,nodes_start:null,nodes_end:null,f:n|D,first:null,fn:t,last:null,next:null,parent:l,b:l&&l.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(e)try{ln(u),u.f|=An}catch(i){throw X(u),i}else t!==null&&tn(u);if(r){var o=u;if(e&&o.deps===null&&o.teardown===null&&o.nodes_start===null&&o.first===o.last&&(o.f&ut)===0&&(o=o.first),o!==null&&(o.parent=l,l!==null&&(function(i,a){var c=a.last;c===null?a.last=a.first=i:(c.next=i,i.prev=c,a.last=i)})(o,l),g!==null&&2&g.f&&(n<)===0)){var s=g;(s.effects??=[]).push(o)}}return u}function St(n){return Q(1048580,n,!1)}function gn(n,t=[],e=[]){ee(t,e,r=>{Q(8,()=>n(...r.map(_)),!0)})}function zn(n,t=!0){return Q(524320,n,!0,t)}function Ot(n){var t=n.teardown;if(t!==null){const e=rn,r=g;Rt(!0),C(null);try{t.call(null)}finally{Rt(e),C(r)}}}function kt(n,t=!1){var e=n.first;for(n.first=n.last=null;e!==null;){const l=e.ac;l!==null&&Hn(()=>{l.abort(Wn)});var r=e.next;(e.f<)!==0?e.parent=null:X(e,t),e=r}}function X(n,t=!0){var e=!1;(t||262144&n.f)&&n.nodes_start!==null&&n.nodes_end!==null&&((function(u,o){for(;u!==null;){var s=u===o?null:Fn(u);u.remove(),u=s}})(n.nodes_start,n.nodes_end),e=!0),kt(n,t&&!e),qn(n,0),k(n,dn);var r=n.transitions;if(r!==null)for(const u of r)u.stop();Ot(n);var l=n.parent;l!==null&&l.first!==null&&qt(n),n.next=n.prev=n.teardown=n.ctx=n.deps=n.fn=n.nodes_start=n.nodes_end=n.ac=null}function qt(n){var t=n.parent,e=n.prev,r=n.next;e!==null&&(e.next=r),r!==null&&(r.prev=e),t!==null&&(t.first===n&&(t.first=r),t.last===n&&(t.last=e))}function Nt(n,t){var e=[];Mt(n,e,!0),(function(r,l){var u=r.length;if(u>0){var o=()=>--u||l();for(var s of r)s.out(o)}else l()})(e,()=>{X(n),t&&t()})}function Mt(n,t,e){if((n.f&F)===0){if(n.f^=F,n.transitions!==null)for(const u of n.transitions)(u.is_global||e)&&t.push(u);for(var r=n.first;r!==null;){var l=r.next;Mt(r,t,((r.f&Cn)!==0||(r.f&bn)!==0)&&e),r=l}}}function ie(n){jt(n,!0)}function jt(n,t){if((n.f&F)!==0){n.f^=F,(n.f&E)===0&&(k(n,D),tn(n));for(var e=n.first;e!==null;){var r=e.next;jt(e,((e.f&Cn)!==0||(e.f&bn)!==0)&&t),e=r}if(n.transitions!==null)for(const l of n.transitions)(l.is_global||t)&&l.in()}}let en=!1;function Lt(n){en=n}let rn=!1;function Rt(n){rn=n}let g=null,A=!1;function C(n){g=n}let w=null;function B(n){w=n}let T=null,P=null,O=0,N=null,At=1,wn=0,Y=wn;function Ct(n){Y=n}let I=!1;function Dt(){return++At}function kn(n){var t=n.f;if((t&D)!==0)return!0;if((t&V)!==0){var e=n.deps,r=(t&M)!==0;if(e!==null){var l,u,o=(t&Rn)!==0,s=r&&w!==null&&!I,i=e.length;if((o||s)&&(w===null||(w.f&dn)===0)){var a=n,c=a.parent;for(l=0;ln.wv)return!0}r&&(w===null||I)||k(n,E)}return!1}function Tt(n,t,e=!0){var r=n.reactions;if(r!==null&&!T?.includes(n))for(var l=0;l{n.ac.abort(Wn)}),n.ac=null);try{n.f|=Dn;var d=(0,n.fn)(),v=n.deps;if(P!==null){var f;if(qn(n,O),v!==null&&O>0)for(v.length=O+P.length,f=0;fu||e});var c=g,d=w;C(null),B(null);try{for(var v,f=[];u!==null;){var p=u.assignedSlot||u.parentNode||u.host||null;try{var h=u["__"+r];if(h!=null&&(!u.disabled||n.target===u))if(tt(h)){var[b,...m]=h;b.apply(u,[n,...m])}else h.call(u,n)}catch(q){v?f.push(q):v=q}if(n.cancelBubble||p===t||p===null)break;u=p}if(v){for(let q of f)queueMicrotask(()=>{throw q});throw v}}finally{n.__root=t,delete n.currentTarget,C(c),B(d)}}}function Gn(n,t){var e=w;e.nodes_start===null&&(e.nodes_start=n,e.nodes_end=t)}function un(n,t){var e,r=!!(1&t),l=!!(2&t),u=!n.startsWith("");return()=>{var o,s;e===void 0&&(o=u?n:""+n,(s=document.createElement("template")).innerHTML=o.replaceAll("",""),e=s.content,r||(e=On(e)));var i=l||_t?document.importNode(e,!0):e.cloneNode(!0);return r?Gn(On(i),i.lastChild):Gn(i,i),i}}function Z(n,t){n!==null&&n.before(t)}function on(n,t){var e=t==null?"":typeof t=="object"?t+"":t;e!==(n.__t??=n.nodeValue)&&(n.__t=e,n.nodeValue=e+"")}function de(n,t){return(function(e,{target:r,anchor:l,props:u={},events:o,context:s,intro:i=!0}){(function(){if(yt===void 0){yt=window,_t=/Firefox/.test(navigator.userAgent);var f=Element.prototype,p=Node.prototype,h=Text.prototype;bt=cn(p,"firstChild").get,xt=cn(p,"nextSibling").get,et(f)&&(f.__click=void 0,f.__className=void 0,f.__attributes=null,f.__style=void 0,f.__e=void 0),et(h)&&(h.__t=void 0)}})();var a=new Set,c=f=>{for(var p=0;pnew Promise(b=>{h.outro?Nt(p,()=>{X(p),b(void 0)}):(X(p),b(void 0))})})(()=>{var f=l??r.appendChild(Et());return zn(()=>{s&&(ot({}),j.c=s),o&&(u.$$events=o),d=e(f,u)||{},s&&at()}),()=>{for(var p of a){r.removeEventListener(p,Nn);var h=an.get(p);--h===0?(document.removeEventListener(p,Nn),an.delete(p)):an.set(p,h)}Bt.delete(c),f!==l&&f.parentNode?.removeChild(f)}});return Qn.set(d,v),d})(n,t)}const an=new Map;let Qn=new WeakMap;function Xn(n,t,e=!1){var r=n,l=null,u=null,o=x,s=!1;const i=(v,f=!0)=>{s=!0,d(f,v)};var a=null;function c(){a!==null&&(a.lastChild.remove(),r.before(a),a=null);var v=o?l:u,f=o?u:l;v&&ie(v),f&&Nt(f,()=>{o?u=null:l=null})}const d=(v,f)=>{if(o!==(o=v)){var p=!1,h=r;o?l??=f&&zn(()=>f(h)):u??=f&&zn(()=>f(h)),c()}};(function(v,f=0){Q(vn|f,v,!0)})(()=>{s=!1,t(i),s||d(null,null)},e?Cn:0)}function he(n,t,e=t){var r=new WeakSet;le(n,"input",async l=>{var u=l?n.defaultValue:n.value;if(u=Yn(n)?Zn(u):u,e(u),y!==null&&r.add(y),await ae(),u!==(u=t())){var o=n.selectionStart,s=n.selectionEnd;n.value=u??"",s!==null&&(n.selectionStart=o,n.selectionEnd=Math.min(s,n.value.length))}}),(function(l){var u=A;try{return A=!0,l()}finally{A=u}})(t)==null&&n.value&&(e(Yn(n)?Zn(n.value):n.value),y!==null&&r.add(y)),(function(l,u=0){Q(8|u,l,!0)})(()=>{var l=t();if(n===document.activeElement){var u=Pn??y;if(r.has(u))return}Yn(n)&&l===Zn(n.value)||(n.type!=="date"||l||n.value)&&l!==n.value&&(n.value=l??"")})}function Yn(n){var t=n.type;return t==="number"||t==="range"}function Zn(n){return n===""?null:+n}typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");var pe=un('

No results matching

'),ge=un('

One result matching

'),we=un('

'),me=un("
 
",1),ye=un("

Enter a non-empty query.

"),_e=un('
Config and data
 
',1);(function(n,t){const e=new URLSearchParams(window.location.search).get("target")??t,r=de(n,{target:document.getElementById(e)??document.body});window[e]={stop:()=>(function(l,u){const o=Qn.get(l);return o?(Qn.delete(l),o(u)):Promise.resolve()})(r)}})(function(n,t){ot(t,!0);const e=(()=>{try{return JSON.parse(document.getElementById("ProcessSearch")?.dataset.config||"{}")}catch{return{}}})();let r=L(""),l=L(""),u=L(null);(function(m){ue();var q=w.f;if(g||(q&bn)===0||(q&An)!==0)return St(m);var J=j;(J.e??=[]).push(m)})(()=>{if(R(l,_(r).trim(),!0),_(l)){const m=new URL(document.location.href);m.searchParams.set("q",_(l)),history.replaceState({},"",m);const q=new URL(e.search_url,document.location.href);q.searchParams.set("q",_(l)),R(u,null),fetch(q.toString()).then(J=>J.json()).then(J=>R(u,J,!0))}});var o=_e(),s=Kn(o),i=S(s),a=S(i),c=G(s,2),d=m=>{var q=me(),J=Kn(q),be=U=>{var sn=pe(),mn=G(S(sn)),yn=S(mn);gn(()=>on(yn,_(l))),Z(U,sn)},xe=U=>{var sn,mn,yn,Jt=(sn=document.createDocumentFragment(),mn=document.createComment(""),yn=Et(),sn.append(mn,yn),Gn(mn,yn),sn),Se=Kn(Jt),Oe=fn=>{var _n=ge(),Mn=G(S(_n)),nt=S(Mn);gn(()=>on(nt,_(l))),Z(fn,_n)},ke=fn=>{var _n=we(),Mn=S(_n),nt=S(G(Mn));gn(()=>{on(Mn,`${_(u)?.rows?.length??""} results matching `),on(nt,_(l))}),Z(fn,_n)};Xn(Se,fn=>{_(u)?.rows?.length===1?fn(Oe):fn(ke,!1)},!0),Z(U,Jt)};Xn(J,U=>{(_(u)?.rows??[]).length===0?U(be):U(xe,!1)});var Ee=S(G(J,2)),Pe=S(Ee);gn(U=>on(Pe,U),[()=>JSON.stringify(_(u)?.rows)]),Z(m,q)},v=m=>{Z(m,ye())};Xn(c,m=>{_(l)?m(d):m(v,!1)});var f=G(c,2),p=G(S(f),2),h=S(p),b=S(h);gn(m=>on(b,m),[()=>JSON.stringify({config:e,data:_(u)},null,2)]),he(a,()=>_(r),m=>R(r,m)),Z(n,o),at()},"ProcessSearch")}); +(function(factory) { + typeof define === "function" && define.amd ? define(factory) : factory(); +})((function() { + "use strict"; + const DEV = false; + var is_array = Array.isArray; + var index_of = Array.prototype.indexOf; + var array_from = Array.from; + var define_property = Object.defineProperty; + var get_descriptor = Object.getOwnPropertyDescriptor; + var object_prototype = Object.prototype; + var array_prototype = Array.prototype; + var get_prototype_of = Object.getPrototypeOf; + var is_extensible = Object.isExtensible; + function run_all(arr) { + for (var i = 0; i < arr.length; i++) { + arr[i](); + } + } + function deferred() { + var resolve; + var reject; + var promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + return { promise, resolve, reject }; + } + const DERIVED = 1 << 1; + const EFFECT = 1 << 2; + const RENDER_EFFECT = 1 << 3; + const BLOCK_EFFECT = 1 << 4; + const BRANCH_EFFECT = 1 << 5; + const ROOT_EFFECT = 1 << 6; + const BOUNDARY_EFFECT = 1 << 7; + const UNOWNED = 1 << 8; + const DISCONNECTED = 1 << 9; + const CLEAN = 1 << 10; + const DIRTY = 1 << 11; + const MAYBE_DIRTY = 1 << 12; + const INERT = 1 << 13; + const DESTROYED = 1 << 14; + const EFFECT_RAN = 1 << 15; + const EFFECT_TRANSPARENT = 1 << 16; + const INSPECT_EFFECT = 1 << 17; + const HEAD_EFFECT = 1 << 18; + const EFFECT_PRESERVED = 1 << 19; + const USER_EFFECT = 1 << 20; + const REACTION_IS_UPDATING = 1 << 21; + const ASYNC = 1 << 22; + const ERROR_VALUE = 1 << 23; + const STATE_SYMBOL = Symbol("$state"); + const STALE_REACTION = new class StaleReactionError extends Error { + name = "StaleReactionError"; + message = "The reaction that called `getAbortSignal()` was re-run or destroyed"; + }(); + function await_outside_boundary() { + { + throw new Error(`https://svelte.dev/e/await_outside_boundary`); + } + } + function async_derived_orphan() { + { + throw new Error(`https://svelte.dev/e/async_derived_orphan`); + } + } + function effect_in_teardown(rune) { + { + throw new Error(`https://svelte.dev/e/effect_in_teardown`); + } + } + function effect_in_unowned_derived() { + { + throw new Error(`https://svelte.dev/e/effect_in_unowned_derived`); + } + } + function effect_orphan(rune) { + { + throw new Error(`https://svelte.dev/e/effect_orphan`); + } + } + function effect_update_depth_exceeded() { + { + throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`); + } + } + function state_descriptors_fixed() { + { + throw new Error(`https://svelte.dev/e/state_descriptors_fixed`); + } + } + function state_prototype_fixed() { + { + throw new Error(`https://svelte.dev/e/state_prototype_fixed`); + } + } + function state_unsafe_mutation() { + { + throw new Error(`https://svelte.dev/e/state_unsafe_mutation`); + } + } + const TEMPLATE_FRAGMENT = 1; + const TEMPLATE_USE_IMPORT_NODE = 1 << 1; + const UNINITIALIZED = Symbol(); + function equals(value) { + return value === this.v; + } + let tracing_mode_flag = false; + let component_context = null; + function set_component_context(context) { + component_context = context; + } + function push(props, runes = false, fn) { + component_context = { + p: component_context, + c: null, + e: null, + s: props, + x: null, + l: null + }; + } + function pop(component) { + var context = ( + /** @type {ComponentContext} */ + component_context + ); + var effects = context.e; + if (effects !== null) { + context.e = null; + for (var fn of effects) { + create_user_effect(fn); + } + } + component_context = context.p; + return ( + /** @type {T} */ + {} + ); + } + function is_runes() { + return true; + } + const adjustments = /* @__PURE__ */ new WeakMap(); + function handle_error(error) { + var effect = active_effect; + if (effect === null) { + active_reaction.f |= ERROR_VALUE; + return error; + } + if ((effect.f & EFFECT_RAN) === 0) { + if ((effect.f & BOUNDARY_EFFECT) === 0) { + if (!effect.parent && error instanceof Error) { + apply_adjustments(error); + } + throw error; + } + effect.b.error(error); + } else { + invoke_error_boundary(error, effect); + } + } + function invoke_error_boundary(error, effect) { + while (effect !== null) { + if ((effect.f & BOUNDARY_EFFECT) !== 0) { + try { + effect.b.error(error); + return; + } catch (e) { + error = e; + } + } + effect = effect.parent; + } + if (error instanceof Error) { + apply_adjustments(error); + } + throw error; + } + function apply_adjustments(error) { + const adjusted = adjustments.get(error); + if (adjusted) { + define_property(error, "message", { + value: adjusted.message + }); + define_property(error, "stack", { + value: adjusted.stack + }); + } + } + let micro_tasks = []; + let idle_tasks = []; + function run_micro_tasks() { + var tasks = micro_tasks; + micro_tasks = []; + run_all(tasks); + } + function run_idle_tasks() { + var tasks = idle_tasks; + idle_tasks = []; + run_all(tasks); + } + function has_pending_tasks() { + return micro_tasks.length > 0 || idle_tasks.length > 0; + } + function queue_micro_task(fn) { + if (micro_tasks.length === 0 && !is_flushing_sync) { + var tasks = micro_tasks; + queueMicrotask(() => { + if (tasks === micro_tasks) run_micro_tasks(); + }); + } + micro_tasks.push(fn); + } + function flush_tasks() { + if (micro_tasks.length > 0) { + run_micro_tasks(); + } + if (idle_tasks.length > 0) { + run_idle_tasks(); + } + } + function get_boundary() { + const boundary = ( + /** @type {Effect} */ + active_effect.b + ); + if (boundary === null) { + await_outside_boundary(); + } + return boundary; + } + // @__NO_SIDE_EFFECTS__ + function derived(fn) { + var flags = DERIVED | DIRTY; + var parent_derived = active_reaction !== null && (active_reaction.f & DERIVED) !== 0 ? ( + /** @type {Derived} */ + active_reaction + ) : null; + if (active_effect === null || parent_derived !== null && (parent_derived.f & UNOWNED) !== 0) { + flags |= UNOWNED; + } else { + active_effect.f |= EFFECT_PRESERVED; + } + const signal = { + ctx: component_context, + deps: null, + effects: null, + equals, + f: flags, + fn, + reactions: null, + rv: 0, + v: ( + /** @type {V} */ + UNINITIALIZED + ), + wv: 0, + parent: parent_derived ?? active_effect, + ac: null + }; + return signal; + } + // @__NO_SIDE_EFFECTS__ + function async_derived(fn, location) { + let parent = ( + /** @type {Effect | null} */ + active_effect + ); + if (parent === null) { + async_derived_orphan(); + } + var boundary = ( + /** @type {Boundary} */ + parent.b + ); + var promise = ( + /** @type {Promise} */ + /** @type {unknown} */ + void 0 + ); + var signal = source( + /** @type {V} */ + UNINITIALIZED + ); + var prev = null; + var should_suspend = !active_reaction; + async_effect(() => { + try { + var p = fn(); + if (prev) Promise.resolve(p).catch(() => { + }); + } catch (error) { + p = Promise.reject(error); + } + var r = () => p; + promise = prev?.then(r, r) ?? Promise.resolve(p); + prev = promise; + var batch = ( + /** @type {Batch} */ + current_batch + ); + var pending = boundary.is_pending(); + if (should_suspend) { + boundary.update_pending_count(1); + if (!pending) batch.increment(); + } + const handler = (value, error = void 0) => { + prev = null; + if (!pending) batch.activate(); + if (error) { + if (error !== STALE_REACTION) { + signal.f |= ERROR_VALUE; + internal_set(signal, error); + } + } else { + if ((signal.f & ERROR_VALUE) !== 0) { + signal.f ^= ERROR_VALUE; + } + internal_set(signal, value); + } + if (should_suspend) { + boundary.update_pending_count(-1); + if (!pending) batch.decrement(); + } + unset_context(); + }; + promise.then(handler, (e) => handler(null, e || "unknown")); + if (batch) { + return () => { + queueMicrotask(() => batch.neuter()); + }; + } + }); + return new Promise((fulfil) => { + function next(p) { + function go() { + if (p === promise) { + fulfil(signal); + } else { + next(promise); + } + } + p.then(go, go); + } + next(promise); + }); + } + function destroy_derived_effects(derived2) { + var effects = derived2.effects; + if (effects !== null) { + derived2.effects = null; + for (var i = 0; i < effects.length; i += 1) { + destroy_effect( + /** @type {Effect} */ + effects[i] + ); + } + } + } + function get_derived_parent_effect(derived2) { + var parent = derived2.parent; + while (parent !== null) { + if ((parent.f & DERIVED) === 0) { + return ( + /** @type {Effect} */ + parent + ); + } + parent = parent.parent; + } + return null; + } + function execute_derived(derived2) { + var value; + var prev_active_effect = active_effect; + set_active_effect(get_derived_parent_effect(derived2)); + { + try { + destroy_derived_effects(derived2); + value = update_reaction(derived2); + } finally { + set_active_effect(prev_active_effect); + } + } + return value; + } + function update_derived(derived2) { + var value = execute_derived(derived2); + if (!derived2.equals(value)) { + derived2.v = value; + derived2.wv = increment_write_version(); + } + if (is_destroying_effect) { + return; + } + { + var status = (skip_reaction || (derived2.f & UNOWNED) !== 0) && derived2.deps !== null ? MAYBE_DIRTY : CLEAN; + set_signal_status(derived2, status); + } + } + function flatten(sync, async, fn) { + const d = derived; + if (async.length === 0) { + fn(sync.map(d)); + return; + } + var batch = current_batch; + var parent = ( + /** @type {Effect} */ + active_effect + ); + var restore = capture(); + var boundary = get_boundary(); + Promise.all(async.map((expression) => /* @__PURE__ */ async_derived(expression))).then((result) => { + batch?.activate(); + restore(); + try { + fn([...sync.map(d), ...result]); + } catch (error) { + if ((parent.f & DESTROYED) === 0) { + invoke_error_boundary(error, parent); + } + } + batch?.deactivate(); + unset_context(); + }).catch((error) => { + boundary.error(error); + }); + } + function capture() { + var previous_effect = active_effect; + var previous_reaction = active_reaction; + var previous_component_context = component_context; + var previous_batch2 = current_batch; + return function restore() { + set_active_effect(previous_effect); + set_active_reaction(previous_reaction); + set_component_context(previous_component_context); + previous_batch2?.activate(); + }; + } + function unset_context() { + set_active_effect(null); + set_active_reaction(null); + set_component_context(null); + } + const batches = /* @__PURE__ */ new Set(); + let current_batch = null; + let previous_batch = null; + let effect_pending_updates = /* @__PURE__ */ new Set(); + let queued_root_effects = []; + let last_scheduled_effect = null; + let is_flushing = false; + let is_flushing_sync = false; + class Batch { + /** + * The current values of any sources that are updated in this batch + * They keys of this map are identical to `this.#previous` + * @type {Map} + */ + current = /* @__PURE__ */ new Map(); + /** + * The values of any sources that are updated in this batch _before_ those updates took place. + * They keys of this map are identical to `this.#current` + * @type {Map} + */ + #previous = /* @__PURE__ */ new Map(); + /** + * When the batch is committed (and the DOM is updated), we need to remove old branches + * and append new ones by calling the functions added inside (if/each/key/etc) blocks + * @type {Set<() => void>} + */ + #callbacks = /* @__PURE__ */ new Set(); + /** + * The number of async effects that are currently in flight + */ + #pending = 0; + /** + * A deferred that resolves when the batch is committed, used with `settled()` + * TODO replace with Promise.withResolvers once supported widely enough + * @type {{ promise: Promise, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null} + */ + #deferred = null; + /** + * True if an async effect inside this batch resolved and + * its parent branch was already deleted + */ + #neutered = false; + /** + * Async effects (created inside `async_derived`) encountered during processing. + * These run after the rest of the batch has updated, since they should + * always have the latest values + * @type {Effect[]} + */ + #async_effects = []; + /** + * The same as `#async_effects`, but for effects inside a newly-created + * `` — these do not prevent the batch from committing + * @type {Effect[]} + */ + #boundary_async_effects = []; + /** + * Template effects and `$effect.pre` effects, which run when + * a batch is committed + * @type {Effect[]} + */ + #render_effects = []; + /** + * The same as `#render_effects`, but for `$effect` (which runs after) + * @type {Effect[]} + */ + #effects = []; + /** + * Block effects, which may need to re-run on subsequent flushes + * in order to update internal sources (e.g. each block items) + * @type {Effect[]} + */ + #block_effects = []; + /** + * Deferred effects (which run after async work has completed) that are DIRTY + * @type {Effect[]} + */ + #dirty_effects = []; + /** + * Deferred effects that are MAYBE_DIRTY + * @type {Effect[]} + */ + #maybe_dirty_effects = []; + /** + * A set of branches that still exist, but will be destroyed when this batch + * is committed — we skip over these during `process` + * @type {Set} + */ + skipped_effects = /* @__PURE__ */ new Set(); + /** + * + * @param {Effect[]} root_effects + */ + process(root_effects) { + queued_root_effects = []; + previous_batch = null; + for (const root2 of root_effects) { + this.#traverse_effect_tree(root2); + } + if (this.#async_effects.length === 0 && this.#pending === 0) { + this.#commit(); + var render_effects = this.#render_effects; + var effects = this.#effects; + this.#render_effects = []; + this.#effects = []; + this.#block_effects = []; + previous_batch = current_batch; + current_batch = null; + flush_queued_effects(render_effects); + flush_queued_effects(effects); + if (current_batch === null) { + current_batch = this; + } else { + batches.delete(this); + } + this.#deferred?.resolve(); + } else { + this.#defer_effects(this.#render_effects); + this.#defer_effects(this.#effects); + this.#defer_effects(this.#block_effects); + } + for (const effect of this.#async_effects) { + update_effect(effect); + } + for (const effect of this.#boundary_async_effects) { + update_effect(effect); + } + this.#async_effects = []; + this.#boundary_async_effects = []; + } + /** + * Traverse the effect tree, executing effects or stashing + * them for later execution as appropriate + * @param {Effect} root + */ + #traverse_effect_tree(root2) { + root2.f ^= CLEAN; + var effect = root2.first; + while (effect !== null) { + var flags = effect.f; + var is_branch = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0; + var is_skippable_branch = is_branch && (flags & CLEAN) !== 0; + var skip = is_skippable_branch || (flags & INERT) !== 0 || this.skipped_effects.has(effect); + if (!skip && effect.fn !== null) { + if (is_branch) { + effect.f ^= CLEAN; + } else if ((flags & EFFECT) !== 0) { + this.#effects.push(effect); + } else if ((flags & CLEAN) === 0) { + if ((flags & ASYNC) !== 0) { + var effects = effect.b?.is_pending() ? this.#boundary_async_effects : this.#async_effects; + effects.push(effect); + } else if (is_dirty(effect)) { + if ((effect.f & BLOCK_EFFECT) !== 0) this.#block_effects.push(effect); + update_effect(effect); + } + } + var child2 = effect.first; + if (child2 !== null) { + effect = child2; + continue; + } + } + var parent = effect.parent; + effect = effect.next; + while (effect === null && parent !== null) { + effect = parent.next; + parent = parent.parent; + } + } + } + /** + * @param {Effect[]} effects + */ + #defer_effects(effects) { + for (const e of effects) { + const target = (e.f & DIRTY) !== 0 ? this.#dirty_effects : this.#maybe_dirty_effects; + target.push(e); + set_signal_status(e, CLEAN); + } + effects.length = 0; + } + /** + * Associate a change to a given source with the current + * batch, noting its previous and current values + * @param {Source} source + * @param {any} value + */ + capture(source2, value) { + if (!this.#previous.has(source2)) { + this.#previous.set(source2, value); + } + this.current.set(source2, source2.v); + } + activate() { + current_batch = this; + } + deactivate() { + current_batch = null; + previous_batch = null; + for (const update of effect_pending_updates) { + effect_pending_updates.delete(update); + update(); + if (current_batch !== null) { + break; + } + } + } + neuter() { + this.#neutered = true; + } + flush() { + if (queued_root_effects.length > 0) { + flush_effects(); + } else { + this.#commit(); + } + if (current_batch !== this) { + return; + } + if (this.#pending === 0) { + batches.delete(this); + } + this.deactivate(); + } + /** + * Append and remove branches to/from the DOM + */ + #commit() { + if (!this.#neutered) { + for (const fn of this.#callbacks) { + fn(); + } + } + this.#callbacks.clear(); + } + increment() { + this.#pending += 1; + } + decrement() { + this.#pending -= 1; + if (this.#pending === 0) { + for (const e of this.#dirty_effects) { + set_signal_status(e, DIRTY); + schedule_effect(e); + } + for (const e of this.#maybe_dirty_effects) { + set_signal_status(e, MAYBE_DIRTY); + schedule_effect(e); + } + this.#render_effects = []; + this.#effects = []; + this.flush(); + } else { + this.deactivate(); + } + } + /** @param {() => void} fn */ + add_callback(fn) { + this.#callbacks.add(fn); + } + settled() { + return (this.#deferred ??= deferred()).promise; + } + static ensure() { + if (current_batch === null) { + const batch = current_batch = new Batch(); + batches.add(current_batch); + if (!is_flushing_sync) { + Batch.enqueue(() => { + if (current_batch !== batch) { + return; + } + batch.flush(); + }); + } + } + return current_batch; + } + /** @param {() => void} task */ + static enqueue(task) { + queue_micro_task(task); + } + } + function flushSync(fn) { + var was_flushing_sync = is_flushing_sync; + is_flushing_sync = true; + try { + var result; + if (fn) ; + while (true) { + flush_tasks(); + if (queued_root_effects.length === 0 && !has_pending_tasks()) { + current_batch?.flush(); + if (queued_root_effects.length === 0) { + last_scheduled_effect = null; + return ( + /** @type {T} */ + result + ); + } + } + flush_effects(); + } + } finally { + is_flushing_sync = was_flushing_sync; + } + } + function flush_effects() { + var was_updating_effect = is_updating_effect; + is_flushing = true; + try { + var flush_count = 0; + set_is_updating_effect(true); + while (queued_root_effects.length > 0) { + var batch = Batch.ensure(); + if (flush_count++ > 1e3) { + var updates, entry; + if (DEV) ; + infinite_loop_guard(); + } + batch.process(queued_root_effects); + old_values.clear(); + } + } finally { + is_flushing = false; + set_is_updating_effect(was_updating_effect); + last_scheduled_effect = null; + } + } + function infinite_loop_guard() { + try { + effect_update_depth_exceeded(); + } catch (error) { + invoke_error_boundary(error, last_scheduled_effect); + } + } + let eager_block_effects = null; + function flush_queued_effects(effects) { + var length = effects.length; + if (length === 0) return; + var i = 0; + while (i < length) { + var effect = effects[i++]; + if ((effect.f & (DESTROYED | INERT)) === 0 && is_dirty(effect)) { + eager_block_effects = []; + update_effect(effect); + if (effect.deps === null && effect.first === null && effect.nodes_start === null) { + if (effect.teardown === null && effect.ac === null) { + unlink_effect(effect); + } else { + effect.fn = null; + } + } + if (eager_block_effects?.length > 0) { + old_values.clear(); + for (const e of eager_block_effects) { + update_effect(e); + } + eager_block_effects = []; + } + } + } + eager_block_effects = null; + } + function schedule_effect(signal) { + var effect = last_scheduled_effect = signal; + while (effect.parent !== null) { + effect = effect.parent; + var flags = effect.f; + if (is_flushing && effect === active_effect && (flags & BLOCK_EFFECT) !== 0) { + return; + } + if ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) { + if ((flags & CLEAN) === 0) return; + effect.f ^= CLEAN; + } + } + queued_root_effects.push(effect); + } + const old_values = /* @__PURE__ */ new Map(); + function source(v, stack) { + var signal = { + f: 0, + // TODO ideally we could skip this altogether, but it causes type errors + v, + reactions: null, + equals, + rv: 0, + wv: 0 + }; + return signal; + } + // @__NO_SIDE_EFFECTS__ + function state(v, stack) { + const s = source(v); + push_reaction_value(s); + return s; + } + function set(source2, value, should_proxy = false) { + if (active_reaction !== null && // since we are untracking the function inside `$inspect.with` we need to add this check + // to ensure we error if state is set inside an inspect effect + (!untracking || (active_reaction.f & INSPECT_EFFECT) !== 0) && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | INSPECT_EFFECT)) !== 0 && !current_sources?.includes(source2)) { + state_unsafe_mutation(); + } + let new_value = should_proxy ? proxy(value) : value; + return internal_set(source2, new_value); + } + function internal_set(source2, value) { + if (!source2.equals(value)) { + var old_value = source2.v; + if (is_destroying_effect) { + old_values.set(source2, value); + } else { + old_values.set(source2, old_value); + } + source2.v = value; + var batch = Batch.ensure(); + batch.capture(source2, old_value); + if ((source2.f & DERIVED) !== 0) { + if ((source2.f & DIRTY) !== 0) { + execute_derived( + /** @type {Derived} */ + source2 + ); + } + set_signal_status(source2, (source2.f & UNOWNED) === 0 ? CLEAN : MAYBE_DIRTY); + } + source2.wv = increment_write_version(); + mark_reactions(source2, DIRTY); + if (active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0) { + if (untracked_writes === null) { + set_untracked_writes([source2]); + } else { + untracked_writes.push(source2); + } + } + } + return value; + } + function increment(source2) { + set(source2, source2.v + 1); + } + function mark_reactions(signal, status) { + var reactions = signal.reactions; + if (reactions === null) return; + var length = reactions.length; + for (var i = 0; i < length; i++) { + var reaction = reactions[i]; + var flags = reaction.f; + var not_dirty = (flags & DIRTY) === 0; + if (not_dirty) { + set_signal_status(reaction, status); + } + if ((flags & DERIVED) !== 0) { + mark_reactions( + /** @type {Derived} */ + reaction, + MAYBE_DIRTY + ); + } else if (not_dirty) { + if ((flags & BLOCK_EFFECT) !== 0) { + if (eager_block_effects !== null) { + eager_block_effects.push( + /** @type {Effect} */ + reaction + ); + } + } + schedule_effect( + /** @type {Effect} */ + reaction + ); + } + } + } + function proxy(value) { + if (typeof value !== "object" || value === null || STATE_SYMBOL in value) { + return value; + } + const prototype = get_prototype_of(value); + if (prototype !== object_prototype && prototype !== array_prototype) { + return value; + } + var sources = /* @__PURE__ */ new Map(); + var is_proxied_array = is_array(value); + var version = /* @__PURE__ */ state(0); + var parent_version = update_version; + var with_parent = (fn) => { + if (update_version === parent_version) { + return fn(); + } + var reaction = active_reaction; + var version2 = update_version; + set_active_reaction(null); + set_update_version(parent_version); + var result = fn(); + set_active_reaction(reaction); + set_update_version(version2); + return result; + }; + if (is_proxied_array) { + sources.set("length", /* @__PURE__ */ state( + /** @type {any[]} */ + value.length + )); + } + return new Proxy( + /** @type {any} */ + value, + { + defineProperty(_, prop, descriptor) { + if (!("value" in descriptor) || descriptor.configurable === false || descriptor.enumerable === false || descriptor.writable === false) { + state_descriptors_fixed(); + } + var s = sources.get(prop); + if (s === void 0) { + s = with_parent(() => { + var s2 = /* @__PURE__ */ state(descriptor.value); + sources.set(prop, s2); + return s2; + }); + } else { + set(s, descriptor.value, true); + } + return true; + }, + deleteProperty(target, prop) { + var s = sources.get(prop); + if (s === void 0) { + if (prop in target) { + const s2 = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED)); + sources.set(prop, s2); + increment(version); + } + } else { + set(s, UNINITIALIZED); + increment(version); + } + return true; + }, + get(target, prop, receiver) { + if (prop === STATE_SYMBOL) { + return value; + } + var s = sources.get(prop); + var exists = prop in target; + if (s === void 0 && (!exists || get_descriptor(target, prop)?.writable)) { + s = with_parent(() => { + var p = proxy(exists ? target[prop] : UNINITIALIZED); + var s2 = /* @__PURE__ */ state(p); + return s2; + }); + sources.set(prop, s); + } + if (s !== void 0) { + var v = get(s); + return v === UNINITIALIZED ? void 0 : v; + } + return Reflect.get(target, prop, receiver); + }, + getOwnPropertyDescriptor(target, prop) { + var descriptor = Reflect.getOwnPropertyDescriptor(target, prop); + if (descriptor && "value" in descriptor) { + var s = sources.get(prop); + if (s) descriptor.value = get(s); + } else if (descriptor === void 0) { + var source2 = sources.get(prop); + var value2 = source2?.v; + if (source2 !== void 0 && value2 !== UNINITIALIZED) { + return { + enumerable: true, + configurable: true, + value: value2, + writable: true + }; + } + } + return descriptor; + }, + has(target, prop) { + if (prop === STATE_SYMBOL) { + return true; + } + var s = sources.get(prop); + var has = s !== void 0 && s.v !== UNINITIALIZED || Reflect.has(target, prop); + if (s !== void 0 || active_effect !== null && (!has || get_descriptor(target, prop)?.writable)) { + if (s === void 0) { + s = with_parent(() => { + var p = has ? proxy(target[prop]) : UNINITIALIZED; + var s2 = /* @__PURE__ */ state(p); + return s2; + }); + sources.set(prop, s); + } + var value2 = get(s); + if (value2 === UNINITIALIZED) { + return false; + } + } + return has; + }, + set(target, prop, value2, receiver) { + var s = sources.get(prop); + var has = prop in target; + if (is_proxied_array && prop === "length") { + for (var i = value2; i < /** @type {Source} */ + s.v; i += 1) { + var other_s = sources.get(i + ""); + if (other_s !== void 0) { + set(other_s, UNINITIALIZED); + } else if (i in target) { + other_s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED)); + sources.set(i + "", other_s); + } + } + } + if (s === void 0) { + if (!has || get_descriptor(target, prop)?.writable) { + s = with_parent(() => /* @__PURE__ */ state(void 0)); + set(s, proxy(value2)); + sources.set(prop, s); + } + } else { + has = s.v !== UNINITIALIZED; + var p = with_parent(() => proxy(value2)); + set(s, p); + } + var descriptor = Reflect.getOwnPropertyDescriptor(target, prop); + if (descriptor?.set) { + descriptor.set.call(receiver, value2); + } + if (!has) { + if (is_proxied_array && typeof prop === "string") { + var ls = ( + /** @type {Source} */ + sources.get("length") + ); + var n = Number(prop); + if (Number.isInteger(n) && n >= ls.v) { + set(ls, n + 1); + } + } + increment(version); + } + return true; + }, + ownKeys(target) { + get(version); + var own_keys = Reflect.ownKeys(target).filter((key2) => { + var source3 = sources.get(key2); + return source3 === void 0 || source3.v !== UNINITIALIZED; + }); + for (var [key, source2] of sources) { + if (source2.v !== UNINITIALIZED && !(key in target)) { + own_keys.push(key); + } + } + return own_keys; + }, + setPrototypeOf() { + state_prototype_fixed(); + } + } + ); + } + var $window; + var is_firefox; + var first_child_getter; + var next_sibling_getter; + function init_operations() { + if ($window !== void 0) { + return; + } + $window = window; + is_firefox = /Firefox/.test(navigator.userAgent); + var element_prototype = Element.prototype; + var node_prototype = Node.prototype; + var text_prototype = Text.prototype; + first_child_getter = get_descriptor(node_prototype, "firstChild").get; + next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get; + if (is_extensible(element_prototype)) { + element_prototype.__click = void 0; + element_prototype.__className = void 0; + element_prototype.__attributes = null; + element_prototype.__style = void 0; + element_prototype.__e = void 0; + } + if (is_extensible(text_prototype)) { + text_prototype.__t = void 0; + } + } + function create_text(value = "") { + return document.createTextNode(value); + } + // @__NO_SIDE_EFFECTS__ + function get_first_child(node) { + return first_child_getter.call(node); + } + // @__NO_SIDE_EFFECTS__ + function get_next_sibling(node) { + return next_sibling_getter.call(node); + } + function child(node, is_text) { + { + return /* @__PURE__ */ get_first_child(node); + } + } + function first_child(fragment, is_text) { + { + var first = ( + /** @type {DocumentFragment} */ + /* @__PURE__ */ get_first_child( + /** @type {Node} */ + fragment + ) + ); + if (first instanceof Comment && first.data === "") return /* @__PURE__ */ get_next_sibling(first); + return first; + } + } + function sibling(node, count = 1, is_text = false) { + let next_sibling = node; + while (count--) { + next_sibling = /** @type {TemplateNode} */ + /* @__PURE__ */ get_next_sibling(next_sibling); + } + { + return next_sibling; + } + } + function should_defer_append() { + return false; + } + let listening_to_form_reset = false; + function add_form_reset_listener() { + if (!listening_to_form_reset) { + listening_to_form_reset = true; + document.addEventListener( + "reset", + (evt) => { + Promise.resolve().then(() => { + if (!evt.defaultPrevented) { + for ( + const e of + /**@type {HTMLFormElement} */ + evt.target.elements + ) { + e.__on_r?.(); + } + } + }); + }, + // In the capture phase to guarantee we get noticed of it (no possiblity of stopPropagation) + { capture: true } + ); + } + } + function without_reactive_context(fn) { + var previous_reaction = active_reaction; + var previous_effect = active_effect; + set_active_reaction(null); + set_active_effect(null); + try { + return fn(); + } finally { + set_active_reaction(previous_reaction); + set_active_effect(previous_effect); + } + } + function listen_to_event_and_reset_event(element, event, handler, on_reset = handler) { + element.addEventListener(event, () => without_reactive_context(handler)); + const prev = element.__on_r; + if (prev) { + element.__on_r = () => { + prev(); + on_reset(true); + }; + } else { + element.__on_r = () => on_reset(true); + } + add_form_reset_listener(); + } + function validate_effect(rune) { + if (active_effect === null && active_reaction === null) { + effect_orphan(); + } + if (active_reaction !== null && (active_reaction.f & UNOWNED) !== 0 && active_effect === null) { + effect_in_unowned_derived(); + } + if (is_destroying_effect) { + effect_in_teardown(); + } + } + function push_effect(effect, parent_effect) { + var parent_last = parent_effect.last; + if (parent_last === null) { + parent_effect.last = parent_effect.first = effect; + } else { + parent_last.next = effect; + effect.prev = parent_last; + parent_effect.last = effect; + } + } + function create_effect(type, fn, sync, push2 = true) { + var parent = active_effect; + if (parent !== null && (parent.f & INERT) !== 0) { + type |= INERT; + } + var effect = { + ctx: component_context, + deps: null, + nodes_start: null, + nodes_end: null, + f: type | DIRTY, + first: null, + fn, + last: null, + next: null, + parent, + b: parent && parent.b, + prev: null, + teardown: null, + transitions: null, + wv: 0, + ac: null + }; + if (sync) { + try { + update_effect(effect); + effect.f |= EFFECT_RAN; + } catch (e2) { + destroy_effect(effect); + throw e2; + } + } else if (fn !== null) { + schedule_effect(effect); + } + if (push2) { + var e = effect; + if (sync && e.deps === null && e.teardown === null && e.nodes_start === null && e.first === e.last && // either `null`, or a singular child + (e.f & EFFECT_PRESERVED) === 0) { + e = e.first; + } + if (e !== null) { + e.parent = parent; + if (parent !== null) { + push_effect(e, parent); + } + if (active_reaction !== null && (active_reaction.f & DERIVED) !== 0 && (type & ROOT_EFFECT) === 0) { + var derived2 = ( + /** @type {Derived} */ + active_reaction + ); + (derived2.effects ??= []).push(e); + } + } + } + return effect; + } + function user_effect(fn) { + validate_effect(); + var flags = ( + /** @type {Effect} */ + active_effect.f + ); + var defer = !active_reaction && (flags & BRANCH_EFFECT) !== 0 && (flags & EFFECT_RAN) === 0; + if (defer) { + var context = ( + /** @type {ComponentContext} */ + component_context + ); + (context.e ??= []).push(fn); + } else { + return create_user_effect(fn); + } + } + function create_user_effect(fn) { + return create_effect(EFFECT | USER_EFFECT, fn, false); + } + function component_root(fn) { + Batch.ensure(); + const effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn, true); + return (options = {}) => { + return new Promise((fulfil) => { + if (options.outro) { + pause_effect(effect, () => { + destroy_effect(effect); + fulfil(void 0); + }); + } else { + destroy_effect(effect); + fulfil(void 0); + } + }); + }; + } + function async_effect(fn) { + return create_effect(ASYNC | EFFECT_PRESERVED, fn, true); + } + function render_effect(fn, flags = 0) { + return create_effect(RENDER_EFFECT | flags, fn, true); + } + function template_effect(fn, sync = [], async = []) { + flatten(sync, async, (values) => { + create_effect(RENDER_EFFECT, () => fn(...values.map(get)), true); + }); + } + function block(fn, flags = 0) { + var effect = create_effect(BLOCK_EFFECT | flags, fn, true); + return effect; + } + function branch(fn, push2 = true) { + return create_effect(BRANCH_EFFECT | EFFECT_PRESERVED, fn, true, push2); + } + function execute_effect_teardown(effect) { + var teardown = effect.teardown; + if (teardown !== null) { + const previously_destroying_effect = is_destroying_effect; + const previous_reaction = active_reaction; + set_is_destroying_effect(true); + set_active_reaction(null); + try { + teardown.call(null); + } finally { + set_is_destroying_effect(previously_destroying_effect); + set_active_reaction(previous_reaction); + } + } + } + function destroy_effect_children(signal, remove_dom = false) { + var effect = signal.first; + signal.first = signal.last = null; + while (effect !== null) { + const controller = effect.ac; + if (controller !== null) { + without_reactive_context(() => { + controller.abort(STALE_REACTION); + }); + } + var next = effect.next; + if ((effect.f & ROOT_EFFECT) !== 0) { + effect.parent = null; + } else { + destroy_effect(effect, remove_dom); + } + effect = next; + } + } + function destroy_block_effect_children(signal) { + var effect = signal.first; + while (effect !== null) { + var next = effect.next; + if ((effect.f & BRANCH_EFFECT) === 0) { + destroy_effect(effect); + } + effect = next; + } + } + function destroy_effect(effect, remove_dom = true) { + var removed = false; + if ((remove_dom || (effect.f & HEAD_EFFECT) !== 0) && effect.nodes_start !== null && effect.nodes_end !== null) { + remove_effect_dom( + effect.nodes_start, + /** @type {TemplateNode} */ + effect.nodes_end + ); + removed = true; + } + destroy_effect_children(effect, remove_dom && !removed); + remove_reactions(effect, 0); + set_signal_status(effect, DESTROYED); + var transitions = effect.transitions; + if (transitions !== null) { + for (const transition of transitions) { + transition.stop(); + } + } + execute_effect_teardown(effect); + var parent = effect.parent; + if (parent !== null && parent.first !== null) { + unlink_effect(effect); + } + effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes_start = effect.nodes_end = effect.ac = null; + } + function remove_effect_dom(node, end) { + while (node !== null) { + var next = node === end ? null : ( + /** @type {TemplateNode} */ + /* @__PURE__ */ get_next_sibling(node) + ); + node.remove(); + node = next; + } + } + function unlink_effect(effect) { + var parent = effect.parent; + var prev = effect.prev; + var next = effect.next; + if (prev !== null) prev.next = next; + if (next !== null) next.prev = prev; + if (parent !== null) { + if (parent.first === effect) parent.first = next; + if (parent.last === effect) parent.last = prev; + } + } + function pause_effect(effect, callback) { + var transitions = []; + pause_children(effect, transitions, true); + run_out_transitions(transitions, () => { + destroy_effect(effect); + if (callback) callback(); + }); + } + function run_out_transitions(transitions, fn) { + var remaining = transitions.length; + if (remaining > 0) { + var check = () => --remaining || fn(); + for (var transition of transitions) { + transition.out(check); + } + } else { + fn(); + } + } + function pause_children(effect, transitions, local) { + if ((effect.f & INERT) !== 0) return; + effect.f ^= INERT; + if (effect.transitions !== null) { + for (const transition of effect.transitions) { + if (transition.is_global || local) { + transitions.push(transition); + } + } + } + var child2 = effect.first; + while (child2 !== null) { + var sibling2 = child2.next; + var transparent = (child2.f & EFFECT_TRANSPARENT) !== 0 || (child2.f & BRANCH_EFFECT) !== 0; + pause_children(child2, transitions, transparent ? local : false); + child2 = sibling2; + } + } + function resume_effect(effect) { + resume_children(effect, true); + } + function resume_children(effect, local) { + if ((effect.f & INERT) === 0) return; + effect.f ^= INERT; + if ((effect.f & CLEAN) === 0) { + set_signal_status(effect, DIRTY); + schedule_effect(effect); + } + var child2 = effect.first; + while (child2 !== null) { + var sibling2 = child2.next; + var transparent = (child2.f & EFFECT_TRANSPARENT) !== 0 || (child2.f & BRANCH_EFFECT) !== 0; + resume_children(child2, transparent ? local : false); + child2 = sibling2; + } + if (effect.transitions !== null) { + for (const transition of effect.transitions) { + if (transition.is_global || local) { + transition.in(); + } + } + } + } + let is_updating_effect = false; + function set_is_updating_effect(value) { + is_updating_effect = value; + } + let is_destroying_effect = false; + function set_is_destroying_effect(value) { + is_destroying_effect = value; + } + let active_reaction = null; + let untracking = false; + function set_active_reaction(reaction) { + active_reaction = reaction; + } + let active_effect = null; + function set_active_effect(effect) { + active_effect = effect; + } + let current_sources = null; + function push_reaction_value(value) { + if (active_reaction !== null && true) { + if (current_sources === null) { + current_sources = [value]; + } else { + current_sources.push(value); + } + } + } + let new_deps = null; + let skipped_deps = 0; + let untracked_writes = null; + function set_untracked_writes(value) { + untracked_writes = value; + } + let write_version = 1; + let read_version = 0; + let update_version = read_version; + function set_update_version(value) { + update_version = value; + } + let skip_reaction = false; + function increment_write_version() { + return ++write_version; + } + function is_dirty(reaction) { + var flags = reaction.f; + if ((flags & DIRTY) !== 0) { + return true; + } + if ((flags & MAYBE_DIRTY) !== 0) { + var dependencies = reaction.deps; + var is_unowned = (flags & UNOWNED) !== 0; + if (dependencies !== null) { + var i; + var dependency; + var is_disconnected = (flags & DISCONNECTED) !== 0; + var is_unowned_connected = is_unowned && active_effect !== null && !skip_reaction; + var length = dependencies.length; + if ((is_disconnected || is_unowned_connected) && (active_effect === null || (active_effect.f & DESTROYED) === 0)) { + var derived2 = ( + /** @type {Derived} */ + reaction + ); + var parent = derived2.parent; + for (i = 0; i < length; i++) { + dependency = dependencies[i]; + if (is_disconnected || !dependency?.reactions?.includes(derived2)) { + (dependency.reactions ??= []).push(derived2); + } + } + if (is_disconnected) { + derived2.f ^= DISCONNECTED; + } + if (is_unowned_connected && parent !== null && (parent.f & UNOWNED) === 0) { + derived2.f ^= UNOWNED; + } + } + for (i = 0; i < length; i++) { + dependency = dependencies[i]; + if (is_dirty( + /** @type {Derived} */ + dependency + )) { + update_derived( + /** @type {Derived} */ + dependency + ); + } + if (dependency.wv > reaction.wv) { + return true; + } + } + } + if (!is_unowned || active_effect !== null && !skip_reaction) { + set_signal_status(reaction, CLEAN); + } + } + return false; + } + function schedule_possible_effect_self_invalidation(signal, effect, root2 = true) { + var reactions = signal.reactions; + if (reactions === null) return; + if (current_sources?.includes(signal)) { + return; + } + for (var i = 0; i < reactions.length; i++) { + var reaction = reactions[i]; + if ((reaction.f & DERIVED) !== 0) { + schedule_possible_effect_self_invalidation( + /** @type {Derived} */ + reaction, + effect, + false + ); + } else if (effect === reaction) { + if (root2) { + set_signal_status(reaction, DIRTY); + } else if ((reaction.f & CLEAN) !== 0) { + set_signal_status(reaction, MAYBE_DIRTY); + } + schedule_effect( + /** @type {Effect} */ + reaction + ); + } + } + } + function update_reaction(reaction) { + var previous_deps = new_deps; + var previous_skipped_deps = skipped_deps; + var previous_untracked_writes = untracked_writes; + var previous_reaction = active_reaction; + var previous_skip_reaction = skip_reaction; + var previous_sources = current_sources; + var previous_component_context = component_context; + var previous_untracking = untracking; + var previous_update_version = update_version; + var flags = reaction.f; + new_deps = /** @type {null | Value[]} */ + null; + skipped_deps = 0; + untracked_writes = null; + skip_reaction = (flags & UNOWNED) !== 0 && (untracking || !is_updating_effect || active_reaction === null); + active_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null; + current_sources = null; + set_component_context(reaction.ctx); + untracking = false; + update_version = ++read_version; + if (reaction.ac !== null) { + without_reactive_context(() => { + reaction.ac.abort(STALE_REACTION); + }); + reaction.ac = null; + } + try { + reaction.f |= REACTION_IS_UPDATING; + var fn = ( + /** @type {Function} */ + reaction.fn + ); + var result = fn(); + var deps = reaction.deps; + if (new_deps !== null) { + var i; + remove_reactions(reaction, skipped_deps); + if (deps !== null && skipped_deps > 0) { + deps.length = skipped_deps + new_deps.length; + for (i = 0; i < new_deps.length; i++) { + deps[skipped_deps + i] = new_deps[i]; + } + } else { + reaction.deps = deps = new_deps; + } + if (!skip_reaction || // Deriveds that already have reactions can cleanup, so we still add them as reactions + (flags & DERIVED) !== 0 && /** @type {import('#client').Derived} */ + reaction.reactions !== null) { + for (i = skipped_deps; i < deps.length; i++) { + (deps[i].reactions ??= []).push(reaction); + } + } + } else if (deps !== null && skipped_deps < deps.length) { + remove_reactions(reaction, skipped_deps); + deps.length = skipped_deps; + } + if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0) { + for (i = 0; i < /** @type {Source[]} */ + untracked_writes.length; i++) { + schedule_possible_effect_self_invalidation( + untracked_writes[i], + /** @type {Effect} */ + reaction + ); + } + } + if (previous_reaction !== null && previous_reaction !== reaction) { + read_version++; + if (untracked_writes !== null) { + if (previous_untracked_writes === null) { + previous_untracked_writes = untracked_writes; + } else { + previous_untracked_writes.push(.../** @type {Source[]} */ + untracked_writes); + } + } + } + if ((reaction.f & ERROR_VALUE) !== 0) { + reaction.f ^= ERROR_VALUE; + } + return result; + } catch (error) { + return handle_error(error); + } finally { + reaction.f ^= REACTION_IS_UPDATING; + new_deps = previous_deps; + skipped_deps = previous_skipped_deps; + untracked_writes = previous_untracked_writes; + active_reaction = previous_reaction; + skip_reaction = previous_skip_reaction; + current_sources = previous_sources; + set_component_context(previous_component_context); + untracking = previous_untracking; + update_version = previous_update_version; + } + } + function remove_reaction(signal, dependency) { + let reactions = dependency.reactions; + if (reactions !== null) { + var index = index_of.call(reactions, signal); + if (index !== -1) { + var new_length = reactions.length - 1; + if (new_length === 0) { + reactions = dependency.reactions = null; + } else { + reactions[index] = reactions[new_length]; + reactions.pop(); + } + } + } + if (reactions === null && (dependency.f & DERIVED) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps` + // allows us to skip the expensive work of disconnecting and immediately reconnecting it + (new_deps === null || !new_deps.includes(dependency))) { + set_signal_status(dependency, MAYBE_DIRTY); + if ((dependency.f & (UNOWNED | DISCONNECTED)) === 0) { + dependency.f ^= DISCONNECTED; + } + destroy_derived_effects( + /** @type {Derived} **/ + dependency + ); + remove_reactions( + /** @type {Derived} **/ + dependency, + 0 + ); + } + } + function remove_reactions(signal, start_index) { + var dependencies = signal.deps; + if (dependencies === null) return; + for (var i = start_index; i < dependencies.length; i++) { + remove_reaction(signal, dependencies[i]); + } + } + function update_effect(effect) { + var flags = effect.f; + if ((flags & DESTROYED) !== 0) { + return; + } + set_signal_status(effect, CLEAN); + var previous_effect = active_effect; + var was_updating_effect = is_updating_effect; + active_effect = effect; + is_updating_effect = true; + try { + if ((flags & BLOCK_EFFECT) !== 0) { + destroy_block_effect_children(effect); + } else { + destroy_effect_children(effect); + } + execute_effect_teardown(effect); + var teardown = update_reaction(effect); + effect.teardown = typeof teardown === "function" ? teardown : null; + effect.wv = write_version; + var dep; + if (DEV && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) ; + } finally { + is_updating_effect = was_updating_effect; + active_effect = previous_effect; + } + } + async function tick() { + await Promise.resolve(); + flushSync(); + } + function get(signal) { + var flags = signal.f; + var is_derived = (flags & DERIVED) !== 0; + if (active_reaction !== null && !untracking) { + var destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0; + if (!destroyed && !current_sources?.includes(signal)) { + var deps = active_reaction.deps; + if ((active_reaction.f & REACTION_IS_UPDATING) !== 0) { + if (signal.rv < read_version) { + signal.rv = read_version; + if (new_deps === null && deps !== null && deps[skipped_deps] === signal) { + skipped_deps++; + } else if (new_deps === null) { + new_deps = [signal]; + } else if (!skip_reaction || !new_deps.includes(signal)) { + new_deps.push(signal); + } + } + } else { + (active_reaction.deps ??= []).push(signal); + var reactions = signal.reactions; + if (reactions === null) { + signal.reactions = [active_reaction]; + } else if (!reactions.includes(active_reaction)) { + reactions.push(active_reaction); + } + } + } + } else if (is_derived && /** @type {Derived} */ + signal.deps === null && /** @type {Derived} */ + signal.effects === null) { + var derived2 = ( + /** @type {Derived} */ + signal + ); + var parent = derived2.parent; + if (parent !== null && (parent.f & UNOWNED) === 0) { + derived2.f ^= UNOWNED; + } + } + if (is_destroying_effect) { + if (old_values.has(signal)) { + return old_values.get(signal); + } + if (is_derived) { + derived2 = /** @type {Derived} */ + signal; + var value = derived2.v; + if ((derived2.f & CLEAN) === 0 && derived2.reactions !== null || depends_on_old_values(derived2)) { + value = execute_derived(derived2); + } + old_values.set(derived2, value); + return value; + } + } else if (is_derived) { + derived2 = /** @type {Derived} */ + signal; + if (is_dirty(derived2)) { + update_derived(derived2); + } + } + if ((signal.f & ERROR_VALUE) !== 0) { + throw signal.v; + } + return signal.v; + } + function depends_on_old_values(derived2) { + if (derived2.v === UNINITIALIZED) return true; + if (derived2.deps === null) return false; + for (const dep of derived2.deps) { + if (old_values.has(dep)) { + return true; + } + if ((dep.f & DERIVED) !== 0 && depends_on_old_values( + /** @type {Derived} */ + dep + )) { + return true; + } + } + return false; + } + function untrack(fn) { + var previous_untracking = untracking; + try { + untracking = true; + return fn(); + } finally { + untracking = previous_untracking; + } + } + const STATUS_MASK = -7169; + function set_signal_status(signal, status) { + signal.f = signal.f & STATUS_MASK | status; + } + const PASSIVE_EVENTS = ["touchstart", "touchmove"]; + function is_passive_event(name) { + return PASSIVE_EVENTS.includes(name); + } + const all_registered_events = /* @__PURE__ */ new Set(); + const root_event_handles = /* @__PURE__ */ new Set(); + let last_propagated_event = null; + function handle_event_propagation(event) { + var handler_element = this; + var owner_document = ( + /** @type {Node} */ + handler_element.ownerDocument + ); + var event_name = event.type; + var path = event.composedPath?.() || []; + var current_target = ( + /** @type {null | Element} */ + path[0] || event.target + ); + last_propagated_event = event; + var path_idx = 0; + var handled_at = last_propagated_event === event && event.__root; + if (handled_at) { + var at_idx = path.indexOf(handled_at); + if (at_idx !== -1 && (handler_element === document || handler_element === /** @type {any} */ + window)) { + event.__root = handler_element; + return; + } + var handler_idx = path.indexOf(handler_element); + if (handler_idx === -1) { + return; + } + if (at_idx <= handler_idx) { + path_idx = at_idx; + } + } + current_target = /** @type {Element} */ + path[path_idx] || event.target; + if (current_target === handler_element) return; + define_property(event, "currentTarget", { + configurable: true, + get() { + return current_target || owner_document; + } + }); + var previous_reaction = active_reaction; + var previous_effect = active_effect; + set_active_reaction(null); + set_active_effect(null); + try { + var throw_error; + var other_errors = []; + while (current_target !== null) { + var parent_element = current_target.assignedSlot || current_target.parentNode || /** @type {any} */ + current_target.host || null; + try { + var delegated = current_target["__" + event_name]; + if (delegated != null && (!/** @type {any} */ + current_target.disabled || // DOM could've been updated already by the time this is reached, so we check this as well + // -> the target could not have been disabled because it emits the event in the first place + event.target === current_target)) { + if (is_array(delegated)) { + var [fn, ...data] = delegated; + fn.apply(current_target, [event, ...data]); + } else { + delegated.call(current_target, event); + } + } + } catch (error) { + if (throw_error) { + other_errors.push(error); + } else { + throw_error = error; + } + } + if (event.cancelBubble || parent_element === handler_element || parent_element === null) { + break; + } + current_target = parent_element; + } + if (throw_error) { + for (let error of other_errors) { + queueMicrotask(() => { + throw error; + }); + } + throw throw_error; + } + } finally { + event.__root = handler_element; + delete event.currentTarget; + set_active_reaction(previous_reaction); + set_active_effect(previous_effect); + } + } + function create_fragment_from_html(html) { + var elem = document.createElement("template"); + elem.innerHTML = html.replaceAll("", ""); + return elem.content; + } + function assign_nodes(start, end) { + var effect = ( + /** @type {Effect} */ + active_effect + ); + if (effect.nodes_start === null) { + effect.nodes_start = start; + effect.nodes_end = end; + } + } + // @__NO_SIDE_EFFECTS__ + function from_html(content, flags) { + var is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0; + var use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0; + var node; + var has_start = !content.startsWith(""); + return () => { + if (node === void 0) { + node = create_fragment_from_html(has_start ? content : "" + content); + if (!is_fragment) node = /** @type {Node} */ + /* @__PURE__ */ get_first_child(node); + } + var clone = ( + /** @type {TemplateNode} */ + use_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true) + ); + if (is_fragment) { + var start = ( + /** @type {TemplateNode} */ + /* @__PURE__ */ get_first_child(clone) + ); + var end = ( + /** @type {TemplateNode} */ + clone.lastChild + ); + assign_nodes(start, end); + } else { + assign_nodes(clone, clone); + } + return clone; + }; + } + function comment() { + var frag = document.createDocumentFragment(); + var start = document.createComment(""); + var anchor = create_text(); + frag.append(start, anchor); + assign_nodes(start, anchor); + return frag; + } + function append(anchor, dom) { + if (anchor === null) { + return; + } + anchor.before( + /** @type {Node} */ + dom + ); + } + function set_text(text, value) { + var str = value == null ? "" : typeof value === "object" ? value + "" : value; + if (str !== (text.__t ??= text.nodeValue)) { + text.__t = str; + text.nodeValue = str + ""; + } + } + function mount(component, options) { + return _mount(component, options); + } + const document_listeners = /* @__PURE__ */ new Map(); + function _mount(Component, { target, anchor, props = {}, events, context, intro = true }) { + init_operations(); + var registered_events = /* @__PURE__ */ new Set(); + var event_handle = (events2) => { + for (var i = 0; i < events2.length; i++) { + var event_name = events2[i]; + if (registered_events.has(event_name)) continue; + registered_events.add(event_name); + var passive = is_passive_event(event_name); + target.addEventListener(event_name, handle_event_propagation, { passive }); + var n = document_listeners.get(event_name); + if (n === void 0) { + document.addEventListener(event_name, handle_event_propagation, { passive }); + document_listeners.set(event_name, 1); + } else { + document_listeners.set(event_name, n + 1); + } + } + }; + event_handle(array_from(all_registered_events)); + root_event_handles.add(event_handle); + var component = void 0; + var unmount2 = component_root(() => { + var anchor_node = anchor ?? target.appendChild(create_text()); + branch(() => { + if (context) { + push({}); + var ctx = ( + /** @type {ComponentContext} */ + component_context + ); + ctx.c = context; + } + if (events) { + props.$$events = events; + } + component = Component(anchor_node, props) || {}; + if (context) { + pop(); + } + }); + return () => { + for (var event_name of registered_events) { + target.removeEventListener(event_name, handle_event_propagation); + var n = ( + /** @type {number} */ + document_listeners.get(event_name) + ); + if (--n === 0) { + document.removeEventListener(event_name, handle_event_propagation); + document_listeners.delete(event_name); + } else { + document_listeners.set(event_name, n); + } + } + root_event_handles.delete(event_handle); + if (anchor_node !== anchor) { + anchor_node.parentNode?.removeChild(anchor_node); + } + }; + }); + mounted_components.set(component, unmount2); + return component; + } + let mounted_components = /* @__PURE__ */ new WeakMap(); + function unmount(component, options) { + const fn = mounted_components.get(component); + if (fn) { + mounted_components.delete(component); + return fn(options); + } + return Promise.resolve(); + } + function if_block(node, fn, elseif = false) { + var anchor = node; + var consequent_effect = null; + var alternate_effect = null; + var condition = UNINITIALIZED; + var flags = elseif ? EFFECT_TRANSPARENT : 0; + var has_branch = false; + const set_branch = (fn2, flag = true) => { + has_branch = true; + update_branch(flag, fn2); + }; + var offscreen_fragment = null; + function commit() { + if (offscreen_fragment !== null) { + offscreen_fragment.lastChild.remove(); + anchor.before(offscreen_fragment); + offscreen_fragment = null; + } + var active = condition ? consequent_effect : alternate_effect; + var inactive = condition ? alternate_effect : consequent_effect; + if (active) { + resume_effect(active); + } + if (inactive) { + pause_effect(inactive, () => { + if (condition) { + alternate_effect = null; + } else { + consequent_effect = null; + } + }); + } + } + const update_branch = (new_condition, fn2) => { + if (condition === (condition = new_condition)) return; + var defer = should_defer_append(); + var target = anchor; + if (defer) { + offscreen_fragment = document.createDocumentFragment(); + offscreen_fragment.append(target = create_text()); + } + if (condition) { + consequent_effect ??= fn2 && branch(() => fn2(target)); + } else { + alternate_effect ??= fn2 && branch(() => fn2(target)); + } + if (defer) { + var batch = ( + /** @type {Batch} */ + current_batch + ); + var active = condition ? consequent_effect : alternate_effect; + var inactive = condition ? alternate_effect : consequent_effect; + if (active) batch.skipped_effects.delete(active); + if (inactive) batch.skipped_effects.add(inactive); + batch.add_callback(commit); + } else { + commit(); + } + }; + block(() => { + has_branch = false; + fn(set_branch); + if (!has_branch) { + update_branch(null, null); + } + }, flags); + } + function bind_value(input, get2, set2 = get2) { + var batches2 = /* @__PURE__ */ new WeakSet(); + listen_to_event_and_reset_event(input, "input", async (is_reset) => { + var value = is_reset ? input.defaultValue : input.value; + value = is_numberlike_input(input) ? to_number(value) : value; + set2(value); + if (current_batch !== null) { + batches2.add(current_batch); + } + await tick(); + if (value !== (value = get2())) { + var start = input.selectionStart; + var end = input.selectionEnd; + input.value = value ?? ""; + if (end !== null) { + input.selectionStart = start; + input.selectionEnd = Math.min(end, input.value.length); + } + } + }); + if ( + // If we are hydrating and the value has since changed, + // then use the updated value from the input instead. + // If defaultValue is set, then value == defaultValue + // TODO Svelte 6: remove input.value check and set to empty string? + untrack(get2) == null && input.value + ) { + set2(is_numberlike_input(input) ? to_number(input.value) : input.value); + if (current_batch !== null) { + batches2.add(current_batch); + } + } + render_effect(() => { + var value = get2(); + if (input === document.activeElement) { + var batch = ( + /** @type {Batch} */ + previous_batch ?? current_batch + ); + if (batches2.has(batch)) { + return; + } + } + if (is_numberlike_input(input) && value === to_number(input.value)) { + return; + } + if (input.type === "date" && !value && !input.value) { + return; + } + if (value !== input.value) { + input.value = value ?? ""; + } + }); + } + function is_numberlike_input(input) { + var type = input.type; + return type === "number" || type === "range"; + } + function to_number(value) { + return value === "" ? null : +value; + } + function autoEmbedWithTarget(component, targetId) { + const target = new URLSearchParams(window.location.search).get("target") ?? targetId; + const instance = mount(component, { + target: document.getElementById(target) ?? document.body + }); + window[target] = { + stop: () => unmount(instance) + }; + } + const PUBLIC_VERSION = "5"; + if (typeof window !== "undefined") { + ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(PUBLIC_VERSION); + } + var root_2 = /* @__PURE__ */ from_html(`

No results matching

`); + var root_4 = /* @__PURE__ */ from_html(`

One result matching

`); + var root_5 = /* @__PURE__ */ from_html(`

`); + var root_1 = /* @__PURE__ */ from_html(`
 
`, 1); + var root_6 = /* @__PURE__ */ from_html(`

Enter a non-empty query.

`); + var root = /* @__PURE__ */ from_html(`
Config and data
 
`, 1); + function ProcessSearch($$anchor, $$props) { + push($$props, true); + const config = (() => { + try { + return JSON.parse(document.getElementById("ProcessSearch")?.dataset.config || "{}"); + } catch (error) { + return {}; + } + })(); + let query = /* @__PURE__ */ state(""); + let parsedQuery = /* @__PURE__ */ state(""); + let data = /* @__PURE__ */ state(null); + user_effect(() => { + set(parsedQuery, get(query).trim(), true); + if (get(parsedQuery)) { + const pageUrl = new URL(document.location.href); + pageUrl.searchParams.set("q", get(parsedQuery)); + history.replaceState({}, "", pageUrl); + const url = new URL(config.search_url, document.location.href); + url.searchParams.set("q", get(parsedQuery)); + set(data, null); + fetch(url.toString()).then((response) => response.json()).then((result) => set(data, result, true)); + } + }); + var fragment = root(); + var form = first_child(fragment); + var div = child(form); + var input = child(div); + var node = sibling(form, 2); + { + var consequent_2 = ($$anchor2) => { + var fragment_1 = root_1(); + var node_1 = first_child(fragment_1); + { + var consequent = ($$anchor3) => { + var h1 = root_2(); + var em = sibling(child(h1)); + var text = child(em); + template_effect(() => set_text(text, get(parsedQuery))); + append($$anchor3, h1); + }; + var alternate_1 = ($$anchor3) => { + var fragment_2 = comment(); + var node_2 = first_child(fragment_2); + { + var consequent_1 = ($$anchor4) => { + var h1_1 = root_4(); + var em_1 = sibling(child(h1_1)); + var text_1 = child(em_1); + template_effect(() => set_text(text_1, get(parsedQuery))); + append($$anchor4, h1_1); + }; + var alternate = ($$anchor4) => { + var h1_2 = root_5(); + var text_2 = child(h1_2); + var em_2 = sibling(text_2); + var text_3 = child(em_2); + template_effect(() => { + set_text(text_2, `${get(data)?.rows?.length ?? ""} results matching `); + set_text(text_3, get(parsedQuery)); + }); + append($$anchor4, h1_2); + }; + if_block( + node_2, + ($$render) => { + if (1 === get(data)?.rows?.length) $$render(consequent_1); + else $$render(alternate, false); + }, + true + ); + } + append($$anchor3, fragment_2); + }; + if_block(node_1, ($$render) => { + if (0 === (get(data)?.rows ?? []).length) $$render(consequent); + else $$render(alternate_1, false); + }); + } + var code = sibling(node_1, 2); + var pre = child(code); + var text_4 = child(pre); + template_effect(($0) => set_text(text_4, $0), [() => JSON.stringify(get(data)?.rows)]); + append($$anchor2, fragment_1); + }; + var alternate_2 = ($$anchor2) => { + var p = root_6(); + append($$anchor2, p); + }; + if_block(node, ($$render) => { + if (get(parsedQuery)) $$render(consequent_2); + else $$render(alternate_2, false); + }); + } + var details = sibling(node, 2); + var code_1 = sibling(child(details), 2); + var pre_1 = child(code_1); + var text_5 = child(pre_1); + template_effect(($0) => set_text(text_5, $0), [() => JSON.stringify({ config, data: get(data) }, null, 2)]); + bind_value(input, () => get(query), ($$value) => set(query, $$value)); + append($$anchor, fragment); + pop(); + } + autoEmbedWithTarget(ProcessSearch, "ProcessSearch"); +})); diff --git a/widgets/src/_standalone/ProcessOverview/Icons/CheckMark.svelte b/widgets/src/_standalone/ProcessOverview/Icons/CheckMark.svelte index f2456eb..befcaa8 100644 --- a/widgets/src/_standalone/ProcessOverview/Icons/CheckMark.svelte +++ b/widgets/src/_standalone/ProcessOverview/Icons/CheckMark.svelte @@ -7,6 +7,7 @@ fill="none" viewBox="0 0 24 24" stroke-width="1.5" + aria-hidden={true} stroke="currentColor" class={className} > diff --git a/widgets/src/_standalone/ProcessOverview/Icons/Clock.svelte b/widgets/src/_standalone/ProcessOverview/Icons/Clock.svelte index 11245c0..b7df579 100644 --- a/widgets/src/_standalone/ProcessOverview/Icons/Clock.svelte +++ b/widgets/src/_standalone/ProcessOverview/Icons/Clock.svelte @@ -7,6 +7,7 @@ fill="none" viewBox="0 0 24 24" stroke-width="1.5" + aria-hidden={true} stroke="currentColor" class={className} > diff --git a/widgets/src/_standalone/ProcessOverview/Icons/Close.svelte b/widgets/src/_standalone/ProcessOverview/Icons/Close.svelte index 9cbe12c..c46a2e5 100644 --- a/widgets/src/_standalone/ProcessOverview/Icons/Close.svelte +++ b/widgets/src/_standalone/ProcessOverview/Icons/Close.svelte @@ -6,6 +6,7 @@ xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" + aria-hidden={true} stroke-width="1.5" stroke="currentColor" class={className} diff --git a/widgets/src/_standalone/ProcessOverview/Icons/ExclamationMark.svelte b/widgets/src/_standalone/ProcessOverview/Icons/ExclamationMark.svelte index a6da940..d5a54ad 100644 --- a/widgets/src/_standalone/ProcessOverview/Icons/ExclamationMark.svelte +++ b/widgets/src/_standalone/ProcessOverview/Icons/ExclamationMark.svelte @@ -4,6 +4,7 @@

{t('Missing data')}

+

{t('Missing data')}

{:else}