From d64b5f3e727cd44f958793e3541f8821ef228eb0 Mon Sep 17 00:00:00 2001 From: Rustem Mussabekov Date: Wed, 28 Aug 2024 14:28:27 +0300 Subject: [PATCH] Fix suggested fields load --- package.json | 2 +- src/co/bookmarks/edit/form/index.js | 7 ++-- .../background/highlights/highlight.js | 32 +++++++++---------- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index f2730d46..4932a1e9 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "5.6.52", + "version": "5.6.53", "description": "All-in-one bookmark manager", "author": "Rustem Mussabekov", "license": "MIT", diff --git a/src/co/bookmarks/edit/form/index.js b/src/co/bookmarks/edit/form/index.js index f5f87120..3eed978c 100644 --- a/src/co/bookmarks/edit/form/index.js +++ b/src/co/bookmarks/edit/form/index.js @@ -20,8 +20,11 @@ export default function BookmarkEditForm(props) { //load suggestions useEffect(()=> - dispatch(suggestFields(props.item)), - [props.item._id] + { + if (props.status == 'loaded' || props.status == 'new') + dispatch(suggestFields(props.item)) + }, + [props.item._id, props.status] ) const onSubmitForm = useCallback(e=>{ diff --git a/src/target/extension/background/highlights/highlight.js b/src/target/extension/background/highlights/highlight.js index 8e8430b8..18bb961a 100644 --- a/src/target/extension/background/highlights/highlight.js +++ b/src/target/extension/background/highlights/highlight.js @@ -1,31 +1,31 @@ -"use strict";var Ur=Object.defineProperty;var Dn=t=>{throw TypeError(t)};var Xr=(t,e,n)=>e in t?Ur(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ft=(t,e,n)=>Xr(t,typeof e!="symbol"?e+"":e,n),jn=(t,e,n)=>e.has(t)||Dn("Cannot "+n);var tt=(t,e,n)=>(jn(t,e,"read from private field"),n?n.call(t):e.get(t)),Ie=(t,e,n)=>e.has(t)?Dn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),qe=(t,e,n,r)=>(jn(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);(function(){var t=window.Document.prototype.createElement,e=window.Document.prototype.createElementNS,n=window.Document.prototype.importNode,r=window.Document.prototype.prepend,o=window.Document.prototype.append,i=window.DocumentFragment.prototype.prepend,l=window.DocumentFragment.prototype.append,d=window.Node.prototype.cloneNode,v=window.Node.prototype.appendChild,p=window.Node.prototype.insertBefore,g=window.Node.prototype.removeChild,w=window.Node.prototype.replaceChild,E=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),_=window.Element.prototype.attachShadow,k=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),$=window.Element.prototype.getAttribute,D=window.Element.prototype.setAttribute,O=window.Element.prototype.removeAttribute,x=window.Element.prototype.toggleAttribute,C=window.Element.prototype.getAttributeNS,j=window.Element.prototype.setAttributeNS,ct=window.Element.prototype.removeAttributeNS,A=window.Element.prototype.insertAdjacentElement,S=window.Element.prototype.insertAdjacentHTML,K=window.Element.prototype.prepend,R=window.Element.prototype.append,L=window.Element.prototype.before,W=window.Element.prototype.after,Q=window.Element.prototype.replaceWith,nt=window.Element.prototype.remove,rt=window.HTMLElement,it=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),vt=window.HTMLElement.prototype.insertAdjacentElement,Zt=window.HTMLElement.prototype.insertAdjacentHTML,wn=new Set;"annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ").forEach(function(s){return wn.add(s)});function bn(s){var a=wn.has(s);return s=/^[a-z][.0-9_a-z]*-[-.0-9_a-z]*$/.test(s),!a&&s}var Pr=document.contains?document.contains.bind(document):document.documentElement.contains.bind(document.documentElement);function B(s){var a=s.isConnected;if(a!==void 0)return a;if(Pr(s))return!0;for(;s&&!(s.__CE_isImportDocument||s instanceof Document);)s=s.parentNode||(window.ShadowRoot&&s instanceof ShadowRoot?s.host:void 0);return!(!s||!(s.__CE_isImportDocument||s instanceof Document))}function Me(s){var a=s.children;if(a)return Array.prototype.slice.call(a);for(a=[],s=s.firstChild;s;s=s.nextSibling)s.nodeType===Node.ELEMENT_NODE&&a.push(s);return a}function Re(s,a){for(;a&&a!==s&&!a.nextSibling;)a=a.parentNode;return a&&a!==s?a.nextSibling:null}function Fe(s,a,c){for(var h=s;h;){if(h.nodeType===Node.ELEMENT_NODE){var u=h;a(u);var f=u.localName;if(f==="link"&&u.getAttribute("rel")==="import"){if(h=u.import,c===void 0&&(c=new Set),h instanceof Node&&!c.has(h))for(c.add(h),h=h.firstChild;h;h=h.nextSibling)Fe(h,a,c);h=Re(s,u);continue}else if(f==="template"){h=Re(s,u);continue}if(u=u.__CE_shadowRoot)for(u=u.firstChild;u;u=u.nextSibling)Fe(u,a,c)}h=h.firstChild?h.firstChild:Re(s,h)}}function ve(){var s=!(gt==null||!gt.noDocumentConstructionObserver),a=!(gt==null||!gt.shadyDomFastWalk);this.m=[],this.g=[],this.j=!1,this.shadyDomFastWalk=a,this.I=!s}function Qt(s,a,c,h){var u=window.ShadyDOM;if(s.shadyDomFastWalk&&u&&u.inUse){if(a.nodeType===Node.ELEMENT_NODE&&c(a),a.querySelectorAll)for(s=u.nativeMethods.querySelectorAll.call(a,"*"),a=0;a"u"?t=>setTimeout(t,1):requestIdleCallback;let ke=!1,Ce=!1,Ke=[],Je=[];function nr(){ke=!1;const t=Ke.slice();Ke=[],er(t)}function rr(){Ce=!1;const t=Je.slice();Je=[],er(t)}function Rt(t){ke||(ke=!0,queueMicrotask(nr)),Ke.push(t)}function co(t){Ce||(Ce=!0,uo(rr)),Je.push(t)}function fo(){ke&&nr(),Ce&&rr()}function or(t){return t===this.v}function ho(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function po(t){return!ho(t,this.v)}function vo(t){throw new Error("effect_in_teardown")}function mo(){throw new Error("effect_in_unowned_derived")}function go(t){throw new Error("effect_orphan")}function _o(){throw new Error("effect_update_depth_exceeded")}function yo(){throw new Error("hydration_failed")}function wo(t){throw new Error("props_invalid_value")}function bo(){throw new Error("state_unsafe_mutation")}function et(t){return{f:0,v:t,reactions:null,equals:or,version:0}}function fn(t){var n;const e=et(t);return e.equals=po,X!==null&&X.l!==null&&((n=X.l).s??(n.s=[])).push(e),e}function q(t,e){return Y!==null&&Ge()&&Y.f&Ot&&bo(),t.equals(e)||(t.v=e,t.version=cr(),ir(t,Nt),Ge()&&M!==null&&M.f&pt&&!(M.f&wt)&&(U!==null&&U.includes(t)?(ut(M,Nt),De(M)):St===null?$o([t]):St.push(t))),e}function ir(t,e){var n=t.reactions;if(n!==null)for(var r=Ge(),o=n.length,i=0;it.version)return!0;r&&!Bt&&!((d=i==null?void 0:i.reactions)!=null&&d.includes(t))&&(i.reactions??(i.reactions=[])).push(t)}}ut(t,pt)}return!1}function xo(t,e,n){throw t}function fr(t){var e=U,n=J,r=St,o=Y,i=Bt;U=null,J=0,St=null,Y=t.f&(wt|an)?null:t,Bt=!Yt&&(t.f&Ft)!==0;try{var l=(0,t.fn)(),d=t.deps;if(U!==null){var v,p;if(d!==null){var g=J===0?U:d.slice(0,J).concat(U),w=g.length>16?new Set(g):null;for(p=J;p0)for(d.length=J+U.length,p=0;p1e3&&(Wt=0,_o()),Wt++}function pr(t){var e=t.length;if(e!==0){hr();var n=Yt;Yt=!0;try{for(var r=0;r1001)return;const t=jt;jt=[],pr(t),le||(Wt=0)}function De(t){ye===ar&&(le||(le=!0,queueMicrotask(To)));for(var e=t;e.parent!==null;){e=e.parent;var n=e.f;if(n&wt){if(!(n&pt))return;ut(e,Ut)}}jt.push(e)}function vr(t,e){var n=t.first,r=[];t:for(;n!==null;){var o=n.f,i=(o&(Xt|Mt))===0,l=o&wt,d=(o&pt)!==0,v=n.first;if(i&&(!l||!d)){if(l&&ut(n,pt),o&zt){if(!l&&ce(n)&&(Ae(n),v=n.first),v!==null){n=v;continue}}else if(o&Gn)if(l||d){if(v!==null){n=v;continue}}else r.push(n)}var p=n.next;if(p===null){let E=n.parent;for(;E!==null;){if(t===E)break t;var g=E.next;if(g!==null){n=g;continue t}E=E.parent}}n=p}for(var w=0;w0||o.length>0)&&Kt(),Wt=0,r}finally{ye=e,jt=n}}function N(t){var e=t.f;if(e&Xt)return t.v;if(Y!==null){var n=Y.deps;U===null&&n!==null&&n[J]===t?J++:(n===null||J===0||n[J-1]!==t)&&(U===null?U=[t]:U[U.length-1]!==t&&U.push(t)),St!==null&&M!==null&&M.f&pt&&!(M.f&wt)&&St.includes(t)&&(ut(M,Nt),De(M))}if(e&Ot){var r=t;ce(r)&&lr(r)}return t.v}function mr(t){const e=Y;try{return Y=null,t()}finally{Y=e}}const So=~(Nt|Ut|pt);function ut(t,e){t.f=t.f&So|e}function No(t){return typeof t=="object"&&t!==null&&typeof t.f=="number"}function fe(t,e=!1,n){X={p:X,c:null,e:null,m:!1,s:t,x:null,l:null},e||(X.l={s:null,u:null,r1:[],r2:et(!1)})}function de(t){const e=X;if(e!==null){t!==void 0&&(e.x=t);const r=e.e;if(r!==null){e.e=null;for(var n=0;n{Gt(e)}}function pn(t){return Jt(Gn,t,!1)}function he(t){return Jt(zt,t,!0)}function yt(t){return he(t)}function yr(t,e=0){return Jt(zt|Zn|e,t,!0)}function ae(t,e=!0){return Jt(zt|wt,t,!0,e)}function wr(t){var e=t.teardown;if(e!==null){const n=dn,r=Y;On(!0),Mn(null);try{e.call(null)}finally{On(n),Mn(r)}}}function Gt(t,e=!0){var n=!1;if((e||t.f&ro)&&t.nodes!==null){for(var r=t.nodes.start,o=t.nodes.end;r!==null;){var i=r===o?null:r.nextSibling;r.remove(),r=i}n=!0}if(hn(t,e&&!n),Ne(t,0),ut(t,Xt),t.transitions)for(const d of t.transitions)d.stop();wr(t);var l=t.parent;l!==null&&t.f&wt&&l.first!==null&&br(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.parent=t.fn=t.nodes=null}function br(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function Qe(t,e){var n=[];vn(t,n,!0),Er(n,()=>{Gt(t),e&&e()})}function Er(t,e){var n=t.length;if(n>0){var r=()=>--n||e();for(var o of t)o.out(r)}else e()}function vn(t,e,n){if(!(t.f&Mt)){if(t.f^=Mt,t.transitions!==null)for(const l of t.transitions)(l.is_global||n)&&e.push(l);for(var r=t.first;r!==null;){var o=r.next,i=(r.f&un)!==0||(r.f&wt)!==0;vn(r,e,i?n:!1),r=o}}}function $e(t){kr(t,!0)}function kr(t,e){if(t.f&Mt){t.f^=Mt,ce(t)&&Ae(t);for(var n=t.first;n!==null;){var r=n.next,o=(n.f&un)!==0||(n.f&wt)!==0;kr(n,o?e:!1),n=r}if(t.transitions!==null)for(const i of t.transitions)(i.is_global||e)&&i.in()}}function dt(t,e=null,n){if(typeof t=="object"&&t!=null&&!tr(t)&&!(Qn in t)){if(G in t){const o=t[G];if(o.t===t||o.p===t)return o.p}const r=ao(t);if(r===so||r===lo){const o=new Proxy(t,Do);return se(t,G,{value:{s:new Map,v:et(0),a:cn(t),p:o,t},writable:!0,enumerable:!1}),o}}return t}function Hn(t,e=1){q(t,t.v+e)}const Do={defineProperty(t,e,n){if(n.value){const r=t[G],o=r.s.get(e);o!==void 0&&q(o,dt(n.value,r))}return Reflect.defineProperty(t,e,n)},deleteProperty(t,e){const n=t[G],r=n.s.get(e),o=n.a,i=delete t[e];if(o&&i){const l=n.s.get("length"),d=t.length-1;l!==void 0&&l.v!==d&&q(l,d)}return r!==void 0&&q(r,te),i&&Hn(n.v),i},get(t,e,n){var i;if(e===G)return Reflect.get(t,G);const r=t[G];let o=r.s.get(e);if(o===void 0&&(!(e in t)||(i=Xe(t,e))!=null&&i.writable)&&(o=et(dt(t[e],r)),r.s.set(e,o)),o!==void 0){const l=N(o);return l===te?void 0:l}return Reflect.get(t,e,n)},getOwnPropertyDescriptor(t,e){const n=Reflect.getOwnPropertyDescriptor(t,e);if(n&&"value"in n){const o=t[G].s.get(e);o&&(n.value=N(o))}return n},has(t,e){var i;if(e===G)return!0;const n=t[G],r=Reflect.has(t,e);let o=n.s.get(e);return(o!==void 0||M!==null&&(!r||(i=Xe(t,e))!=null&&i.writable))&&(o===void 0&&(o=et(r?dt(t[e],n):te),n.s.set(e,o)),N(o)===te)?!1:r},set(t,e,n,r){const o=t[G];let i=o.s.get(e);i===void 0&&(mr(()=>r[e]),i=o.s.get(e)),i!==void 0&&q(i,dt(n,o));const l=o.a,d=!(e in t);if(l&&e==="length")for(let p=n;p{e.addEventListener(t,o,r)}):e.addEventListener(t,o,r),o}function _t(t,e,n,r,o){var i={capture:r,passive:o},l=Lo(t,e,n,i);(e===document.body||e===window||e===document)&&gr(()=>{e.removeEventListener(t,l,i)})}function xr(t){for(var e=0;e{throw O});throw g}}finally{t.__root=e,i=e}}}function Oo(t){var e=document.createElement("template");return e.innerHTML=t,e.content}function Vt(t,e){M.nodes??(M.nodes={start:t,end:e})}function bt(t,e){var n=(e&Zr)!==0,r=(e&Qr)!==0,o,i=!t.startsWith("");return()=>{if(H)return Vt(P,null),P;o||(o=Oo(i?t:""+t),n||(o=o.firstChild));var l=r?document.importNode(o,!0):o.cloneNode(!0);if(n){var d=l.firstChild,v=l.lastChild;Vt(d,v)}else Vt(l,l);return l}}function Mo(){if(H)return Vt(P,null),P;var t=document.createDocumentFragment(),e=document.createComment(""),n=pe();return t.append(e,n),Vt(e,n),t}function at(t,e){if(H){M.nodes.end=P,ue();return}t!==null&&t.before(e)}function Be(t,e){(t.__t??(t.__t=t.nodeValue))!==e&&(t.nodeValue=t.__t=e)}function Tr(t,e){const n=e.anchor??e.target.appendChild(pe());return Sr(t,{...e,anchor:n})}function Ro(t,e){e.intro=e.intro??!1;const n=e.target,r=H,o=P;try{for(var i=n.firstChild;i&&(i.nodeType!==8||i.data!==Kn);)i=i.nextSibling;if(!i)throw _e;$t(!0),xt(i),ue();const l=Sr(t,{...e,anchor:i});if(P===null||P.nodeType!==8||P.data!==ln)throw Jn(),_e;return $t(!1),l}catch(l){if(l===_e)return e.recover===!1&&yo(),Cr(),gn(n),$t(!1),Tr(t,e);throw l}finally{$t(r),xt(o)}}const qt=new Map;function Sr(t,{target:e,anchor:n,props:r={},events:o,context:i,intro:l=!0}){Cr();var d=new Set,v=w=>{for(var E=0;E(ae(()=>{if(i){fe({});var w=X;w.c=i}o&&(r.$$events=o),H&&Vt(n,null),p=t(n,r)||{},H&&(M.nodes.end=P),i&&de()}),()=>{for(var w of d){e.removeEventListener(w,ne);var E=qt.get(w);--E===0?(document.removeEventListener(w,ne),qt.delete(w)):qt.set(w,E)}tn.delete(v),en.delete(p)}));return en.set(p,g),p}let en=new WeakMap;function Fo(t){const e=en.get(t);e==null||e()}function Se(t,e,n,r=null,o=!1){H&&ue();var i=t,l=null,d=null,v=null,p=o?un:0;yr(()=>{if(v===(v=!!e()))return;let g=!1;if(H){const w=i.data===sn;v===w&&(i=Ue(),xt(i),$t(!1),g=!0)}v?(l?$e(l):l=ae(()=>n(i)),d&&Qe(d,()=>{d=null})):(d?$e(d):r&&(d=ae(()=>r(i))),l&&Qe(l,()=>{l=null})),g&&$t(!0)},p),H&&(i=P)}let Ye=null;function Ho(t,e){return e}function Po(t,e,n,r){for(var o=[],i=e.length,l=0;l0&&o.length===0&&n!==null;if(d){var v=n.parentNode;gn(v),v.append(n),r.clear(),Tt(t,e[0].prev,e[i-1].next)}Er(o,()=>{for(var p=0;p{var w=n(),E=cn(w)?w:w==null?[]:Array.from(w),_=E.length,k=d.flags;k&ze&&!tr(E)&&!(Qn in E)&&!(G in E)&&(k^=ze,k&Kr&&!(k&ie)&&(k^=ie));let $=!1;if(H){var D=l.data===sn;D!==(_===0)&&(l=Ue(),xt(l),$t(!1),$=!0)}if(H){for(var O=null,x,C=0;C<_;C++){if(P.nodeType===8&&P.data===ln){l=P,$=!0,$t(!1);break}var j=E[C],ct=r(j,C);x=Nr(P,d,O,null,j,ct,C,o,k),d.items.set(ct,x),O=x}_>0&&xt(Ue())}H||Io(E,d,l,o,k,r),i!==null&&(_===0?g?$e(g):g=ae(()=>i(l)):g!==null&&Qe(g,()=>{g=null})),$&&$t(!0)}),H&&(l=P)}function Io(t,e,n,r,o,i){var nt,rt,it,vt;var l=(o&Jr)!==0,d=(o&(ie|on))!==0,v=t.length,p=e.items,g=e.first,w=g,E=new Set,_=null,k=new Set,$=[],D=[],O,x,C,j;if(l)for(j=0;j0){var Q=o&Xn&&v===0?n:null;if(l){for(j=0;j{var Zt;for(C of k)(Zt=C.a)==null||Zt.apply()}),M.first=e.first&&e.first.e,M.last=_&&_.e}function qo(t,e,n,r){r&ie&&q(t.v,e),r&on?q(t.i,n):t.i=n}function Nr(t,e,n,r,o,i,l,d,v){var p=Ye;try{var g=(v&ie)!==0,w=(v&ze)===0,E=g?w?fn(o):et(o):o,_=v&on?et(l):l,k={i:_,v:E,k:i,a:null,e:null,prev:n,next:r};return Ye=k,k.e=ae(()=>d(t,E,_),H),k.e.prev=n&&n.e,k.e.next=r&&r.e,n===null?e.first=k:(n.next=k,n.e.next=k.e),r!==null&&(r.prev=k,r.e.prev=k.e),k}finally{Ye=p}}function Pn(t,e,n){for(var r=t.next?t.next.e.nodes.start:n,o=e?e.e.nodes.start:n,i=t.e.nodes.start;i!==r;){var l=i.nextSibling;o.before(i),i=l}}function Tt(t,e,n){e===null?t.first=n:(e.next=n,e.e.next=n&&n.e),n!==null&&(n.prev=e,n.e.prev=e&&e.e)}var In=new Set;function yn(t,e){{if(In.has(e))return;In.add(e)}Rt(()=>{var n=t.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+e.hash)){const o=document.createElement("style");o.id=e.hash,o.textContent=e.code,r.appendChild(o)}})}function Bo(t,e){{const n=document.body;t.autofocus=!0,Rt(()=>{document.activeElement===n&&t.focus()})}}function Yo(t){H&&t.firstChild!==null&&gn(t)}let qn=!1;function Ar(){qn||(qn=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n.__on_r)==null||e.call(n)})},{capture:!0}))}function Wo(t){if(H){var e=!1,n=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var r=t.value;ht(t,"value",null),t.value=r}if(t.hasAttribute("checked")){var o=t.checked;ht(t,"checked",null),t.checked=o}}};t.__on_r=n,co(n),Ar()}}function Vo(t,e){var n=t.__attributes??(t.__attributes={});n.value!==(n.value=e)&&(t.value=e)}function ht(t,e,n){n=n==null?null:n+"";var r=t.__attributes??(t.__attributes={});H&&(r[e]=t.getAttribute(e),e==="src"||e==="href"||e==="srcset")||r[e]!==(r[e]=n)&&(e==="loading"&&(t[oo]=n),n===null?t.removeAttribute(e):t.setAttribute(e,n))}function oe(t,e,n){n?t.classList.add(e):t.classList.remove(e)}function Dr(t,e,n,r=n){t.addEventListener(e,n);const o=t.__on_r;o?t.__on_r=()=>{o(),r()}:t.__on_r=r,Ar()}function zo(t,e,n){Dr(t,"input",()=>{n(Yn(t)?Wn(t.value):t.value)}),he(()=>{var r=e();if(H&&t.defaultValue!==t.value){n(t.value);return}Yn(t)&&r===Wn(t.value)||t.type==="date"&&!r&&!t.value||(t.value=r??"")})}const We=new Set;function Uo(t,e,n,r,o){var i=n.getAttribute("type")==="checkbox",l=t;let d=!1;if(e!==null)for(var v of e)l=l[v]??(l[v]=[]);l.push(n),Dr(n,"change",()=>{var p=n.__value;i&&(p=Bn(l,p,n.checked)),o(p)},()=>o(i?[]:null)),he(()=>{var p=r();if(H&&n.defaultChecked!==n.checked){d=!0;return}i?(p=p||[],n.checked=xe(p).includes(xe(n.__value))):n.checked=jo(n.__value,p)}),gr(()=>{var p=l.indexOf(n);p!==-1&&l.splice(p,1)}),We.has(l)||(We.add(l),Rt(()=>{l.sort((p,g)=>p.compareDocumentPosition(g)===4?-1:1),We.delete(l)})),Rt(()=>{if(d){var p;if(i)p=Bn(l,p,n.checked);else{var g=l.find(w=>w.checked);p=g==null?void 0:g.__value}o(p)}})}function Bn(t,e,n){for(var r=new Set,o=0;o{var o,i;return he(()=>{o=i,i=[],mr(()=>{t!==n(...i)&&(e(t,...i),o&&Vn(n(...o),t)&&e(null,...o))})}),()=>{Rt(()=>{i&&Vn(n(...i),t)&&e(null,...i)})}}),t}function je(t,e,n,r){var k;var o=(n&Gr)!==0,i=t[e],l=(k=Xe(t,e))==null?void 0:k.set,d=r,v=()=>d;i===void 0&&r!==void 0&&(l&&o&&wo(),i=v(),l&&l(i));var p;if(p=()=>{var $=t[e];return $===void 0?v():$},l){var g=t.$$legacy;return function($,D){return arguments.length>0?((!D||g)&&l(D?p():$),$):p()}}var w=!1,E=fn(i),_=Eo(()=>{var $=p(),D=N(E);return w?(w=!1,D):E.v=$});return function($,D){var O=N(_);if(arguments.length>0){const x=D?N(_):$;return _.equals(x)||(w=!0,q(E,x),N(_)),$}return O}}function Xo(t){return new Ko(t)}var kt,st;class Ko{constructor(e){Ie(this,kt);Ie(this,st);var n=new Map,r=(i,l)=>{var d=fn(l);return n.set(i,d),d};const o=new Proxy({...e.props||{},$$events:{}},{get(i,l){return N(n.get(l)??r(l,Reflect.get(i,l)))},has(i,l){return N(n.get(l)??r(l,Reflect.get(i,l))),Reflect.has(i,l)},set(i,l,d){return q(n.get(l)??r(l,d),d),Reflect.set(i,l,d)}});qe(this,st,(e.hydrate?Ro:Tr)(e.component,{target:e.target,props:o,context:e.context,intro:e.intro??!1,recover:e.recover})),Kt(),qe(this,kt,o.$$events);for(const i of Object.keys(tt(this,st)))i==="$set"||i==="$destroy"||i==="$on"||se(this,i,{get(){return tt(this,st)[i]},set(l){tt(this,st)[i]=l},enumerable:!0});tt(this,st).$set=i=>{Object.assign(o,i)},tt(this,st).$destroy=()=>{Fo(tt(this,st))}}$set(e){tt(this,st).$set(e)}$on(e,n){tt(this,kt)[e]=tt(this,kt)[e]||[];const r=(...o)=>n.call(this,...o);return tt(this,kt)[e].push(r),()=>{tt(this,kt)[e]=tt(this,kt)[e].filter(o=>o!==r)}}$destroy(){tt(this,st).$destroy()}}kt=new WeakMap,st=new WeakMap;let jr;typeof HTMLElement=="function"&&(jr=class extends HTMLElement{constructor(e,n,r){super();ft(this,"$$ctor");ft(this,"$$s");ft(this,"$$c");ft(this,"$$cn",!1);ft(this,"$$d",{});ft(this,"$$r",!1);ft(this,"$$p_d",{});ft(this,"$$l",{});ft(this,"$$l_u",new Map);ft(this,"$$me");this.$$ctor=e,this.$$s=n,r&&this.attachShadow({mode:"open"})}addEventListener(e,n,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(n),this.$$c){const o=this.$$c.$on(e,n);this.$$l_u.set(n,o)}super.addEventListener(e,n,r)}removeEventListener(e,n,r){if(super.removeEventListener(e,n,r),this.$$c){const o=this.$$l_u.get(n);o&&(o(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(o){return i=>{const l=document.createElement("slot");o!=="default"&&(l.name=o),at(i,l)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=Jo(this);for(const o of this.$$s)o in r&&(o==="default"&&!this.$$d.children?(this.$$d.children=e(o),n.default=!0):n[o]=e(o));for(const o of this.attributes){const i=this.$$g_p(o.name);i in this.$$d||(this.$$d[i]=we(i,o.value,this.$$p_d,"toProp"))}for(const o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=Xo({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=he(()=>{var o;this.$$r=!0;for(const i of Ee(this.$$c)){if(!((o=this.$$p_d[i])!=null&&o.reflect))continue;this.$$d[i]=this.$$c[i];const l=we(i,this.$$d[i],this.$$p_d,"toAttribute");l==null?this.removeAttribute(this.$$p_d[i].attribute||i):this.setAttribute(this.$$p_d[i].attribute||i,l)}this.$$r=!1});for(const o in this.$$l)for(const i of this.$$l[o]){const l=this.$$c.$on(o,i);this.$$l_u.set(i,l)}this.$$l={}}}attributeChangedCallback(e,n,r){var o;this.$$r||(e=this.$$g_p(e),this.$$d[e]=we(e,r,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),Gt(this.$$me),this.$$c=void 0)})}$$g_p(e){return Ee(this.$$p_d).find(n=>this.$$p_d[n].attribute===e||!this.$$p_d[n].attribute&&n.toLowerCase()===e)||e}});function we(t,e,n,r){var i;const o=(i=n[t])==null?void 0:i.type;if(e=o==="Boolean"&&typeof e!="boolean"?e!=null:e,!r||!n[t])return e;if(r==="toAttribute")switch(o){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Jo(t){const e={};return t.childNodes.forEach(n=>{e[n.slot||"default"]=!0}),e}function Le(t,e,n,r,o,i){let l=class extends jr{constructor(){super(t,n,o),this.$$p_d=e}static get observedAttributes(){return Ee(e).map(d=>(e[d].attribute||d).toLowerCase())}};return Ee(e).forEach(d=>{se(l.prototype,d,{get(){return this.$$c&&d in this.$$c?this.$$c[d]:this.$$d[d]},set(v){var p;v=we(d,v,e),this.$$d[d]=v,(p=this.$$c)==null||p.$set({[d]:v})}})}),r.forEach(d=>{se(l.prototype,d,{get(){var v;return(v=this.$$c)==null?void 0:v[d]}})}),t.element=l,l}const At=new Map([["yellow","#F8B920"],["red","#FF4646"],["blue","#0064FF"],["green","#00C564"]]),Go=["SCRIPT","STYLE","NOSCRIPT","TEXTAREA","OPTION"];function Lr(t){const e=document.documentElement.lang||void 0,n=t.map(d=>d.trim().toLocaleLowerCase(e)),r=n.map(()=>({start:null,end:null,shift:0})),o=n.map(()=>[]),i=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,d=>{var v,p;return Go.includes((v=d.parentNode)==null?void 0:v.tagName)||((p=d.parentNode)==null?void 0:p.contentEditable)=="true"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let l;for(;l=i.nextNode();)if(l!=null&&l.nodeValue)for(let d=0;d{var E;for(;p[r[g].shift]&&!p[r[g].shift].trim();)r[g].shift++;let w=p[r[g].shift]===v;if(!w&&r[g].shift&&(r[g].shift=0,w=p[r[g].shift]===v),w&&(r[g].shift||(r[g].start=[l,d]),r[g].end=[l,d],r[g].shift++),r[g].shift>=p.length){const _=document.createRange();_.setStart(r[g].start[0],r[g].start[1]),_.setEnd(r[g].end[0],r[g].end[1]+1),!_.collapsed&&((E=_.commonAncestorContainer.parentElement)!=null&&E.checkVisibility())?o[g].push(_):_.detach(),w=!1}w||(r[g].shift=0,r[g].start=null,r[g].end=null)})}return o}const Lt=`rh-${new Date().getTime()}-`,Oe="highlights"in CSS;function Zo(t){if(!t.length&&!CSS.highlights.size)return;const e=[];if(CSS.highlights.clear(),t.length){const r=Lr(t.map(({text:o})=>o||""));for(const o in t){if(!r[o].length)continue;const{_id:i,color:l,note:d}=t[o],v=`${Lt}${i}`;CSS.highlights.set(v,new Highlight(...r[o]));const p=r[o][0].getBoundingClientRect();e.push(` - ::highlight(${v}) { +"use strict";var Xr=Object.defineProperty;var Rn=t=>{throw TypeError(t)};var Kr=(t,e,n)=>e in t?Xr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var at=(t,e,n)=>Kr(t,typeof e!="symbol"?e+"":e,n),Fn=(t,e,n)=>e.has(t)||Rn("Cannot "+n);var X=(t,e,n)=>(Fn(t,e,"read from private field"),n?n.call(t):e.get(t)),Ve=(t,e,n)=>e.has(t)?Rn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),We=(t,e,n,r)=>(Fn(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);(function(){var t=window.Document.prototype.createElement,e=window.Document.prototype.createElementNS,n=window.Document.prototype.importNode,r=window.Document.prototype.prepend,o=window.Document.prototype.append,s=window.DocumentFragment.prototype.prepend,l=window.DocumentFragment.prototype.append,v=window.Node.prototype.cloneNode,d=window.Node.prototype.appendChild,f=window.Node.prototype.insertBefore,_=window.Node.prototype.removeChild,m=window.Node.prototype.replaceChild,b=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),g=window.Element.prototype.attachShadow,k=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),$=window.Element.prototype.getAttribute,A=window.Element.prototype.setAttribute,C=window.Element.prototype.removeAttribute,N=window.Element.prototype.toggleAttribute,x=window.Element.prototype.getAttributeNS,L=window.Element.prototype.setAttributeNS,ft=window.Element.prototype.removeAttributeNS,D=window.Element.prototype.insertAdjacentElement,M=window.Element.prototype.insertAdjacentHTML,B=window.Element.prototype.prepend,P=window.Element.prototype.append,j=window.Element.prototype.before,U=window.Element.prototype.after,z=window.Element.prototype.replaceWith,lt=window.Element.prototype.remove,xt=window.HTMLElement,yt=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),Tt=window.HTMLElement.prototype.insertAdjacentElement,re=window.HTMLElement.prototype.insertAdjacentHTML,$n=new Set;"annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ").forEach(function(i){return $n.add(i)});function xn(i){var a=$n.has(i);return i=/^[a-z][.0-9_a-z]*-[-.0-9_a-z]*$/.test(i),!a&&i}var Ir=document.contains?document.contains.bind(document):document.documentElement.contains.bind(document.documentElement);function V(i){var a=i.isConnected;if(a!==void 0)return a;if(Ir(i))return!0;for(;i&&!(i.__CE_isImportDocument||i instanceof Document);)i=i.parentNode||(window.ShadowRoot&&i instanceof ShadowRoot?i.host:void 0);return!(!i||!(i.__CE_isImportDocument||i instanceof Document))}function He(i){var a=i.children;if(a)return Array.prototype.slice.call(a);for(a=[],i=i.firstChild;i;i=i.nextSibling)i.nodeType===Node.ELEMENT_NODE&&a.push(i);return a}function Pe(i,a){for(;a&&a!==i&&!a.nextSibling;)a=a.parentNode;return a&&a!==i?a.nextSibling:null}function Ie(i,a,c){for(var p=i;p;){if(p.nodeType===Node.ELEMENT_NODE){var u=p;a(u);var h=u.localName;if(h==="link"&&u.getAttribute("rel")==="import"){if(p=u.import,c===void 0&&(c=new Set),p instanceof Node&&!c.has(p))for(c.add(p),p=p.firstChild;p;p=p.nextSibling)Ie(p,a,c);p=Pe(i,u);continue}else if(h==="template"){p=Pe(i,u);continue}if(u=u.__CE_shadowRoot)for(u=u.firstChild;u;u=u.nextSibling)Ie(u,a,c)}p=p.firstChild?p.firstChild:Pe(i,p)}}function ge(){var i=!(ht==null||!ht.noDocumentConstructionObserver),a=!(ht==null||!ht.shadyDomFastWalk);this.m=[],this.g=[],this.j=!1,this.shadyDomFastWalk=a,this.I=!i}function oe(i,a,c,p){var u=window.ShadyDOM;if(i.shadyDomFastWalk&&u&&u.inUse){if(a.nodeType===Node.ELEMENT_NODE&&c(a),a.querySelectorAll)for(i=u.nativeMethods.querySelectorAll.call(a,"*"),a=0;a{ee(e)}}function mn(t){return te(nr,t,!1)}function he(t){return te(Gt,t,!0)}function pt(t){return he(t)}function ar(t,e=0){return te(Gt|rr|e,t,!0)}function ce(t,e=!0){return te(Gt|gt,t,!0,e)}function ur(t){var e=t.teardown;if(e!==null){const n=wn,r=q;In(!0),qn(null);try{e.call(null)}finally{In(n),qn(r)}}}function ee(t,e=!0){var n=!1;if((e||t.f&io)&&t.nodes_start!==null){for(var r=t.nodes_start,o=t.nodes_end;r!==null;){var s=r===o?null:$t(r);r.remove(),r=s}n=!0}yn(t,e&&!n),de(t,0),st(t,Qt);var l=t.transitions;if(l!==null)for(const d of l)d.stop();ur(t);var v=t.parent;v!==null&&t.f>&&v.first!==null&&cr(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.parent=t.fn=t.nodes_start=t.nodes_end=null}function cr(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function Je(t,e){var n=[];gn(t,n,!0),fr(n,()=>{ee(t),e&&e()})}function fr(t,e){var n=t.length;if(n>0){var r=()=>--n||e();for(var o of t)o.out(r)}else e()}function gn(t,e,n){if(!(t.f&Pt)){if(t.f^=Pt,t.transitions!==null)for(const l of t.transitions)(l.is_global||n)&&e.push(l);for(var r=t.first;r!==null;){var o=r.next,s=(r.f&pn)!==0||(r.f>)!==0;gn(r,e,s?n:!1),r=o}}}function xe(t){dr(t,!0)}function dr(t,e){if(t.f&Pt){t.f^=Pt,ve(t)&&Le(t);for(var n=t.first;n!==null;){var r=n.next,o=(n.f&pn)!==0||(n.f>)!==0;dr(n,o?e:!1),n=r}if(t.transitions!==null)for(const s of t.transitions)(s.is_global||e)&&s.in()}}const Eo=typeof requestIdleCallback>"u"?t=>setTimeout(t,1):requestIdleCallback;let Te=!1,Ne=!1,Ge=[],Ze=[];function hr(){Te=!1;const t=Ge.slice();Ge=[],er(t)}function vr(){Ne=!1;const t=Ze.slice();Ze=[],er(t)}function It(t){Te||(Te=!0,queueMicrotask(hr)),Ge.push(t)}function ko(t){Ne||(Ne=!0,Eo(vr)),Ze.push(t)}function Co(){Te&&hr(),Ne&&vr()}function $o(t){let e=At|Dt;F===null&&(e|=qt);const n={deps:null,deriveds:null,equals:or,f:e,first:null,fn:t,last:null,reactions:null,v:null,version:0};if(q!==null&&q.f&At){var r=q;r.deriveds===null?r.deriveds=[n]:r.deriveds.push(n)}return n}function pr(t){yn(t);var e=t.deriveds;if(e!==null){t.deriveds=null;for(var n=0;nt.version)return!0;r&&!Ut&&!((v=s==null?void 0:s.reactions)!=null&&v.includes(t))&&(s.reactions??(s.reactions=[])).push(t)}}r||st(t,ct)}return!1}function Ao(t,e,n){throw t}function yr(t){var _;var e=K,n=Q,r=St,o=q,s=Ut,l=_t;K=null,Q=0,St=null,q=t.f&(gt|vn)?null:t,Ut=!Xt&&(t.f&qt)!==0,_t=null;try{var v=(0,t.fn)(),d=t.deps;if(K!==null){var f;if(de(t,Q),d!==null&&Q>0)for(d.length=Q+K.length,f=0;f1e3&&(Kt=0,ho()),Kt++}function Er(t){var e=t.length;if(e!==0){br();var n=Xt;Xt=!0;try{for(var r=0;r1001)return;const t=Rt;Rt=[],Er(t),fe||(Kt=0)}function Me(t){be===mr&&(fe||(fe=!0,queueMicrotask(Lo)));for(var e=t;e.parent!==null;){e=e.parent;var n=e.f;if(n>){if(!(n&ct))return;st(e,Zt)}}Rt.push(e)}function kr(t,e){var n=t.first,r=[];t:for(;n!==null;){var o=n.f,s=(o&(Qt|Pt))===0,l=(o>)!==0,v=(o&ct)!==0,d=n.first;if(s&&(!l||!v)){if(l&&st(n,ct),o&Gt){if(!l&&ve(n)&&(Le(n),d=n.first),d!==null){n=d;continue}}else if(o&nr)if(l||v){if(d!==null){n=d;continue}}else r.push(n)}var f=n.next;if(f===null){let b=n.parent;for(;b!==null;){if(t===b)break t;var _=b.next;if(_!==null){n=_;continue t}b=b.parent}}n=f}for(var m=0;m0||o.length>0)&&ne(),Kt=0,r}finally{be=e,Rt=n}}function T(t){var e=t.f;if(e&Qt)return t.v;if(q!==null){_t!==null&&_t.includes(t)&&go();var n=q.deps;K===null&&n!==null&&n[Q]===t?Q++:K===null?K=[t]:K.push(t),St!==null&&F!==null&&F.f&ct&&!(F.f>)&&St.includes(t)&&(st(F,Dt),Me(F))}if(e&At){var r=t;ve(r)&&_r(r)}return t.v}function Mo(t){const e=q;try{return q=null,t()}finally{q=e}}const jo=~(Dt|Zt|ct);function st(t,e){t.f=t.f&jo|e}function pe(t,e=!1,n){Y={p:Y,c:null,e:null,m:!1,s:t,x:null,l:null},e||(Y.l={s:null,u:null,r1:[],r2:tt(!1)})}function _e(t){const e=Y;if(e!==null){t!==void 0&&(e.x=t);const r=e.e;if(r!==null){e.e=null;for(var n=0;n=C.v&&I(C,N+1)}Vn(l)}return!0},ownKeys(d){T(l);var f=Reflect.ownKeys(d).filter(b=>{var g=o.get(b);return g===void 0||g.v!==Z});for(var[_,m]of o)m.v!==Z&&!(_ in d)&&f.push(_);return f},setPrototypeOf(){mo()}})}function Vn(t,e=1){I(t,t.v+e)}function Se(t){return t!==null&&typeof t=="object"&&zt in t?t[zt]:t}function Oo(t,e){return Object.is(Se(t),Se(e))}var Ae,jt,Cr,$r;function tn(){if(Ae===void 0){Ae=window,jt=document;var t=Element.prototype,e=Node.prototype;Cr=Ft(e,"firstChild").get,$r=Ft(e,"nextSibling").get,t.__click=void 0,t.__className="",t.__attributes=null,t.__e=void 0,Text.prototype.__t=void 0}}function me(t=""){return document.createTextNode(t)}function Lt(t){return Cr.call(t)}function $t(t){return $r.call(t)}function ot(t){if(!O)return Lt(t);var e=Lt(R);return e===null&&(e=R.appendChild(me())),mt(e),e}function bn(t,e){if(!O){var n=Lt(t);return n instanceof Comment&&n.data===""?$t(n):n}return R}function et(t,e=1,n=!1){let r=O?R:t;for(;e--;)r=$t(r);if(!O)return r;var o=r.nodeType;if(n&&o!==3){var s=me();return r==null||r.before(s),mt(s),s}return mt(r),r}function En(t){t.textContent=""}let O=!1;function Ct(t){O=t}let R;function mt(t){if(t===null)throw fn(),ae;return R=t}function je(){return mt($t(R))}function J(t){if(O){if($t(R)!==null)throw fn(),ae;R=t}}function Ro(t=1){if(O){for(var e=t,n=R;e--;)n=$t(n);R=n}}function en(){for(var t=0,e=R;;){if(e.nodeType===8){var n=e.data;if(n===cn){if(t===0)return e;t-=1}else(n===tr||n===un)&&(t+=1)}var r=$t(e);e.remove(),e=r}}const xr=new Set,nn=new Set;function Fo(t,e,n,r){function o(s){if(r.capture||se.call(e,s),!s.cancelBubble)return n.call(this,s)}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?It(()=>{e.addEventListener(t,o,r)}):e.addEventListener(t,o,r),o}function vt(t,e,n,r,o){var s={capture:r,passive:o},l=Fo(t,e,n,s);(e===document.body||e===window||e===document)&&sr(()=>{e.removeEventListener(t,l,s)})}function Tr(t){for(var e=0;e{throw C});throw _}}finally{t.__root=e,s=e}}}function Ho(t){var e=document.createElement("template");return e.innerHTML=t,e.content}function Jt(t,e){var n=F;n.nodes_start===null&&(n.nodes_start=t,n.nodes_end=e)}function wt(t,e){var n=(e&Qr)!==0,r=(e&to)!==0,o,s=!t.startsWith("");return()=>{if(O)return Jt(R,null),R;o===void 0&&(o=Ho(s?t:""+t),n||(o=Lt(o)));var l=r?document.importNode(o,!0):o.cloneNode(!0);if(n){var v=Lt(l),d=l.lastChild;Jt(v,d)}else Jt(l,l);return l}}function Po(){if(O)return Jt(R,null),R;var t=document.createDocumentFragment(),e=document.createComment(""),n=me();return t.append(e,n),Jt(e,n),t}function it(t,e){if(O){F.nodes_end=R,je();return}t!==null&&t.before(e)}const Io=["wheel","mousewheel","touchstart","touchmove"];function qo(t){return Io.includes(t)}function Ye(t,e){e!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=e,t.nodeValue=e==null?"":e+"")}function Nr(t,e){const n=e.anchor??e.target.appendChild(me());return Sr(t,{...e,anchor:n})}function Bo(t,e){tn(),e.intro=e.intro??!1;const n=e.target,r=O,o=R;try{for(var s=Lt(n);s&&(s.nodeType!==8||s.data!==tr);)s=$t(s);if(!s)throw ae;Ct(!0),mt(s),je();const l=Sr(t,{...e,anchor:s});if(R===null||R.nodeType!==8||R.data!==cn)throw fn(),ae;return Ct(!1),l}catch(l){if(l===ae)return e.recover===!1&&vo(),tn(),En(n),Ct(!1),Nr(t,e);throw l}finally{Ct(r),mt(o)}}const Yt=new Map;function Sr(t,{target:e,anchor:n,props:r={},events:o,context:s,intro:l=!0}){tn();var v=new Set,d=m=>{for(var b=0;b(ce(()=>{if(s){pe({});var m=Y;m.c=s}o&&(r.$$events=o),O&&Jt(n,null),f=t(n,r)||{},O&&(F.nodes_end=R),s&&_e()}),()=>{for(var m of v){e.removeEventListener(m,se);var b=Yt.get(m);--b===0?(document.removeEventListener(m,se),Yt.delete(m)):Yt.set(m,b)}nn.delete(d),rn.delete(f)}));return rn.set(f,_),f}let rn=new WeakMap;function Vo(t){const e=rn.get(t);e&&e()}function De(t,e,n,r=null,o=!1){O&&je();var s=t,l=null,v=null,d=null,f=o?pn:0;ar(()=>{if(d===(d=!!e()))return;let _=!1;if(O){const m=s.data===un;d===m&&(s=en(),mt(s),Ct(!1),_=!0)}d?(l?xe(l):l=ce(()=>n(s)),v&&Je(v,()=>{v=null})):(v?xe(v):r&&(v=ce(()=>r(s))),l&&Je(l,()=>{l=null})),_&&Ct(!0)},f),O&&(s=R)}let Ue=null;function Wo(t,e){return e}function Yo(t,e,n,r){for(var o=[],s=e.length,l=0;l0&&o.length===0&&n!==null;if(v){var d=n.parentNode;En(d),d.append(n),r.clear(),Nt(t,e[0].prev,e[s-1].next)}fr(o,()=>{for(var f=0;f{var m=n(),b=dn(m)?m:m==null?[]:hn(m),g=b.length;let k=!1;if(O){var $=l.data===un;$!==(g===0)&&(l=en(),mt(l),Ct(!1),k=!0)}if(O){for(var A=null,C,N=0;N0&&mt(en())}O||Uo(b,v,l,o,e,r),s!==null&&(g===0?_?xe(_):_=ce(()=>s(l)):_!==null&&Je(_,()=>{_=null})),k&&Ct(!0)}),O&&(l=R)}function Uo(t,e,n,r,o,s){var lt,xt,yt,Tt;var l=(o&Jr)!==0,v=(o&(ln|an))!==0,d=t.length,f=e.items,_=e.first,m=_,b,g=null,k,$=[],A=[],C,N,x,L;if(l)for(L=0;L0){var z=o&Qn&&d===0?n:null;if(l){for(L=0;L{var re;if(k!==void 0)for(x of k)(re=x.a)==null||re.apply()}),F.first=e.first&&e.first.e,F.last=g&&g.e}function zo(t,e,n,r){r&ln&&I(t.v,e),r&an?I(t.i,n):t.i=n}function Ar(t,e,n,r,o,s,l,v,d){var f=Ue;try{var _=(d&ln)!==0,m=(d&Gr)===0,b=_?m?_n(o):tt(o):o,g=d&an?tt(l):l,k={i:g,v:b,k:s,a:null,e:null,prev:n,next:r};return Ue=k,k.e=ce(()=>v(t,b,g),O),k.e.prev=n&&n.e,k.e.next=r&&r.e,n===null?e.first=k:(n.next=k,n.e.next=k.e),r!==null&&(r.prev=k,r.e.prev=k.e),k}finally{Ue=f}}function Wn(t,e,n){for(var r=t.next?t.next.e.nodes_start:n,o=e?e.e.nodes_start:n,s=t.e.nodes_start;s!==r;){var l=$t(s);o.before(s),s=l}}function Nt(t,e,n){e===null?t.first=n:(e.next=n,e.e.next=n&&n.e),n!==null&&(n.prev=e,n.e.prev=e&&e.e)}var Yn=new Set;function Cn(t,e,n=!1){if(!n){if(Yn.has(e))return;Yn.add(e)}It(()=>{var r=t.getRootNode(),o=r.host?r:r.head??r.ownerDocument.head;if(!o.querySelector("#"+e.hash)){const s=document.createElement("style");s.id=e.hash,s.textContent=e.code,o.appendChild(s)}})}function Xo(t,e){{const n=document.body;t.autofocus=!0,It(()=>{document.activeElement===n&&t.focus()})}}function Ko(t){O&&Lt(t)!==null&&En(t)}let Un=!1;function Dr(){Un||(Un=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n.__on_r)==null||e.call(n)})},{capture:!0}))}function Jo(t){if(O){var e=!1,n=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var r=t.value;ut(t,"value",null),t.value=r}if(t.hasAttribute("checked")){var o=t.checked;ut(t,"checked",null),t.checked=o}}};t.__on_r=n,ko(n),Dr()}}function Go(t,e){var n=t.__attributes??(t.__attributes={});n.value!==(n.value=e)&&(t.value=e)}function ut(t,e,n,r){n=n==null?null:n+"";var o=t.__attributes??(t.__attributes={});O&&(o[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||o[e]!==(o[e]=n)&&(e==="loading"&&(t[so]=n),n===null?t.removeAttribute(e):t.setAttribute(e,n))}function ue(t,e,n){if(n){if(t.classList.contains(e))return;t.classList.add(e)}else{if(!t.classList.contains(e))return;t.classList.remove(e)}}function Lr(t,e,n,r=n){t.addEventListener(e,n);const o=t.__on_r;o?t.__on_r=()=>{o(),r()}:t.__on_r=r,Dr()}function Zo(t,e,n){Lr(t,"input",()=>{n(Xn(t)?Kn(t.value):t.value)}),he(()=>{var r=e();if(O&&t.defaultValue!==t.value){n(t.value);return}Xn(t)&&r===Kn(t.value)||t.type==="date"&&!r&&!t.value||(t.value=r??"")})}const ze=new Set;function Qo(t,e,n,r,o){var s=n.getAttribute("type")==="checkbox",l=t;let v=!1;if(e!==null)for(var d of e)l=l[d]??(l[d]=[]);l.push(n),Lr(n,"change",()=>{var f=n.__value;s&&(f=zn(l,f,n.checked)),o(f)},()=>o(s?[]:null)),he(()=>{var f=r();if(O&&n.defaultChecked!==n.checked){v=!0;return}s?(f=f||[],n.checked=Se(f).includes(Se(n.__value))):n.checked=Oo(n.__value,f)}),sr(()=>{var f=l.indexOf(n);f!==-1&&l.splice(f,1)}),ze.has(l)||(ze.add(l),It(()=>{l.sort((f,_)=>f.compareDocumentPosition(_)===4?-1:1),ze.delete(l)})),It(()=>{if(v){var f;if(s)f=zn(l,f,n.checked);else{var _=l.find(m=>m.checked);f=_==null?void 0:_.__value}o(f)}})}function zn(t,e,n){for(var r=new Set,o=0;o{var o,s;return he(()=>{o=s,s=[],Mo(()=>{t!==n(...s)&&(e(t,...s),o&&Jn(n(...o),t)&&e(null,...o))})}),()=>{It(()=>{s&&Jn(n(...s),t)&&e(null,...s)})}}),t}function Oe(t,e,n,r){var k;var o=(n&Zr)!==0,s=t[e],l=(k=Ft(t,e))==null?void 0:k.set,v=r,d=()=>v;s===void 0&&r!==void 0&&(l&&o&&po(),s=d(),l&&l(s));var f;if(f=()=>{var $=t[e];return $===void 0?d():$},l){var _=t.$$legacy;return function($,A){return arguments.length>0?((!A||_)&&l(A?f():$),$):f()}}var m=!1,b=_n(s),g=$o(()=>{var $=f(),A=T(b);return m?(m=!1,A):b.v=$});return function($,A){var C=T(g);if(arguments.length>0){const N=A?T(g):$;return g.equals(N)||(m=!0,I(b,N),T(g)),$}return C}}function ti(t){return new ei(t)}var Et,nt;class ei{constructor(e){Ve(this,Et);Ve(this,nt);var s;var n=new Map,r=(l,v)=>{var d=_n(v);return n.set(l,d),d};const o=new Proxy({...e.props||{},$$events:{}},{get(l,v){return T(n.get(v)??r(v,Reflect.get(l,v)))},has(l,v){return T(n.get(v)??r(v,Reflect.get(l,v))),Reflect.has(l,v)},set(l,v,d){return I(n.get(v)??r(v,d),d),Reflect.set(l,v,d)}});We(this,nt,(e.hydrate?Bo:Nr)(e.component,{target:e.target,props:o,context:e.context,intro:e.intro??!1,recover:e.recover})),(!((s=e==null?void 0:e.props)!=null&&s.$$host)||e.sync===!1)&&ne(),We(this,Et,o.$$events);for(const l of Object.keys(X(this,nt)))l==="$set"||l==="$destroy"||l==="$on"||Ce(this,l,{get(){return X(this,nt)[l]},set(v){X(this,nt)[l]=v},enumerable:!0});X(this,nt).$set=l=>{Object.assign(o,l)},X(this,nt).$destroy=()=>{Vo(X(this,nt))}}$set(e){X(this,nt).$set(e)}$on(e,n){X(this,Et)[e]=X(this,Et)[e]||[];const r=(...o)=>n.call(this,...o);return X(this,Et)[e].push(r),()=>{X(this,Et)[e]=X(this,Et)[e].filter(o=>o!==r)}}$destroy(){X(this,nt).$destroy()}}Et=new WeakMap,nt=new WeakMap;let Mr;typeof HTMLElement=="function"&&(Mr=class extends HTMLElement{constructor(e,n,r){super();at(this,"$$ctor");at(this,"$$s");at(this,"$$c");at(this,"$$cn",!1);at(this,"$$d",{});at(this,"$$r",!1);at(this,"$$p_d",{});at(this,"$$l",{});at(this,"$$l_u",new Map);at(this,"$$me");this.$$ctor=e,this.$$s=n,r&&this.attachShadow({mode:"open"})}addEventListener(e,n,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(n),this.$$c){const o=this.$$c.$on(e,n);this.$$l_u.set(n,o)}super.addEventListener(e,n,r)}removeEventListener(e,n,r){if(super.removeEventListener(e,n,r),this.$$c){const o=this.$$l_u.get(n);o&&(o(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(o){return s=>{const l=document.createElement("slot");o!=="default"&&(l.name=o),it(s,l)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=ni(this);for(const o of this.$$s)o in r&&(o==="default"&&!this.$$d.children?(this.$$d.children=e(o),n.default=!0):n[o]=e(o));for(const o of this.attributes){const s=this.$$g_p(o.name);s in this.$$d||(this.$$d[s]=Ee(s,o.value,this.$$p_d,"toProp"))}for(const o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=ti({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=he(()=>{var o;this.$$r=!0;for(const s of ke(this.$$c)){if(!((o=this.$$p_d[s])!=null&&o.reflect))continue;this.$$d[s]=this.$$c[s];const l=Ee(s,this.$$d[s],this.$$p_d,"toAttribute");l==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,l)}this.$$r=!1});for(const o in this.$$l)for(const s of this.$$l[o]){const l=this.$$c.$on(o,s);this.$$l_u.set(s,l)}this.$$l={}}}attributeChangedCallback(e,n,r){var o;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ee(e,r,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),ee(this.$$me),this.$$c=void 0)})}$$g_p(e){return ke(this.$$p_d).find(n=>this.$$p_d[n].attribute===e||!this.$$p_d[n].attribute&&n.toLowerCase()===e)||e}});function Ee(t,e,n,r){var s;const o=(s=n[t])==null?void 0:s.type;if(e=o==="Boolean"&&typeof e!="boolean"?e!=null:e,!r||!n[t])return e;if(r==="toAttribute")switch(o){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function ni(t){const e={};return t.childNodes.forEach(n=>{e[n.slot||"default"]=!0}),e}function Re(t,e,n,r,o,s){let l=class extends Mr{constructor(){super(t,n,o),this.$$p_d=e}static get observedAttributes(){return ke(e).map(v=>(e[v].attribute||v).toLowerCase())}};return ke(e).forEach(v=>{Ce(l.prototype,v,{get(){return this.$$c&&v in this.$$c?this.$$c[v]:this.$$d[v]},set(d){var m;d=Ee(v,d,e),this.$$d[v]=d;var f=this.$$c;if(f){var _=(m=Ft(f,v))==null?void 0:m.get;_?f[v]=d:f.$set({[v]:d})}}})}),r.forEach(v=>{Ce(l.prototype,v,{get(){var d;return(d=this.$$c)==null?void 0:d[v]}})}),t.element=l,l}const Mt=new Map([["yellow","#F8B920"],["red","#FF4646"],["blue","#0064FF"],["green","#00C564"]]),ri=["SCRIPT","STYLE","NOSCRIPT","TEXTAREA","OPTION"];function jr(t){const e=document.documentElement.lang||void 0,n=t.map(v=>v.trim().toLocaleLowerCase(e)),r=n.map(()=>({start:null,end:null,shift:0})),o=n.map(()=>[]),s=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,v=>{var d,f;return ri.includes((d=v.parentNode)==null?void 0:d.tagName)||((f=v.parentNode)==null?void 0:f.contentEditable)=="true"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let l;for(;l=s.nextNode();)if(l!=null&&l.nodeValue)for(let v=0;v{var b;for(;f[r[_].shift]&&!f[r[_].shift].trim();)r[_].shift++;let m=f[r[_].shift]===d;if(!m&&r[_].shift&&(r[_].shift=0,m=f[r[_].shift]===d),m&&(r[_].shift||(r[_].start=[l,v]),r[_].end=[l,v],r[_].shift++),r[_].shift>=f.length){const g=document.createRange();g.setStart(r[_].start[0],r[_].start[1]),g.setEnd(r[_].end[0],r[_].end[1]+1),!g.collapsed&&((b=g.commonAncestorContainer.parentElement)!=null&&b.checkVisibility())?o[_].push(g):g.detach(),m=!1}m||(r[_].shift=0,r[_].start=null,r[_].end=null)})}return o}const Ht=`rh-${new Date().getTime()}-`,Fe="highlights"in CSS;function oi(t){if(!t.length&&!CSS.highlights.size)return;const e=[];if(CSS.highlights.clear(),t.length){const r=jr(t.map(({text:o})=>o||""));for(const o in t){if(!r[o].length)continue;const{_id:s,color:l,note:v}=t[o],d=`${Ht}${s}`;CSS.highlights.set(d,new Highlight(...r[o]));const f=r[o][0].getBoundingClientRect();e.push(` + ::highlight(${d}) { all: unset; - background-color: color-mix(in srgb, ${At.get(l)||l||"yellow"}, white 60%) !important; - color: color-mix(in srgb, ${At.get(l)||l||"yellow"}, black 80%) !important; - ${d?"text-decoration: underline wavy; -webkit-text-decoration: underline wavy;":""} + background-color: color-mix(in srgb, ${Mt.get(l)||l||"yellow"}, white 60%) !important; + color: color-mix(in srgb, ${Mt.get(l)||l||"yellow"}, black 80%) !important; + ${v?"text-decoration: underline wavy; -webkit-text-decoration: underline wavy;":""} text-decoration-thickness: from-font; } /* fuck you dark reader */ - html[data-darkreader-scheme="dark"] ::highlight(${v}) { + html[data-darkreader-scheme="dark"] ::highlight(${d}) { color: CanvasText !important; } :root { - --highlight-${i}-top: ${(100/document.documentElement.scrollHeight*(window.scrollY+p.top-10)).toFixed(2)}%; + --highlight-${s}-top: ${(100/document.documentElement.scrollHeight*(window.scrollY+f.top-10)).toFixed(2)}%; } - `);for(const g of r[o])g.detach()}}const n=(()=>{let r=document.getElementById(Lt);return r||(r=document.createElement("style"),r.id=Lt,document.head.appendChild(r)),r})();n.innerHTML=e.join(` -`)}function Qo(){var t;(t=document.getElementById(Lt))==null||t.remove()}function ti(t){var e;for(const[n,r]of CSS.highlights){const o=n.replace(Lt,"");if(t==o)for(const i of r){(e=i.startContainer.parentElement)==null||e.scrollIntoView({behavior:"smooth",block:"start"});break}}}function ei(t){let e;for(const[n,r]of CSS.highlights)for(const o of r){const i=t.compareBoundaryPoints(Range.START_TO_START,o),l=t.compareBoundaryPoints(Range.END_TO_END,o);(i==0&&l==0||t!=null&&t.collapsed&&i>=0&&l<=0)&&(e=[n.replace(Lt,""),o])}if(e)return e[0].replace(Lt,"")}const Ct=`rh-${new Date().getTime()}`;function ni(t){const e=document.body.querySelectorAll(`.${Ct}`);if(!t.length&&!e.length)return;e.forEach(i=>i.outerHTML=i.innerText);const n=[],r=Lr(t.map(({text:i})=>i||""));for(const i in t){const{_id:l,color:d}=t[i];for(const v of r[i]){const p=document.createElement("mark");p.className=Ct,p.setAttribute("data-id",String(l)),p.append(v.extractContents()),v.insertNode(p),v.detach()}n.push(` - .${Ct}[data-id="${l}"] { + `);for(const _ of r[o])_.detach()}}const n=(()=>{let r=document.getElementById(Ht);return r||(r=document.createElement("style"),r.id=Ht,document.head.appendChild(r)),r})();n.innerHTML=e.join(` +`)}function ii(){var t;(t=document.getElementById(Ht))==null||t.remove()}function si(t){var e;for(const[n,r]of CSS.highlights){const o=n.replace(Ht,"");if(t==o)for(const s of r){(e=s.startContainer.parentElement)==null||e.scrollIntoView({behavior:"smooth",block:"start"});break}}}function li(t){let e;for(const[n,r]of CSS.highlights)for(const o of r){const s=t.compareBoundaryPoints(Range.START_TO_START,o),l=t.compareBoundaryPoints(Range.END_TO_END,o);(s==0&&l==0||t!=null&&t.collapsed&&s>=0&&l<=0)&&(e=[n.replace(Ht,""),o])}if(e)return e[0].replace(Ht,"")}const kt=`rh-${new Date().getTime()}`;function ai(t){const e=document.body.querySelectorAll(`.${kt}`);if(!t.length&&!e.length)return;e.forEach(s=>s.outerHTML=s.innerText);const n=[],r=jr(t.map(({text:s})=>s||""));for(const s in t){const{_id:l,color:v}=t[s];for(const d of r[s]){const f=document.createElement("mark");f.className=kt,f.setAttribute("data-id",String(l)),f.append(d.extractContents()),d.insertNode(f),d.detach()}n.push(` + .${kt}[data-id="${l}"] { all: unset; display: inline-block !important; background-color: white !important; - background-image: linear-gradient(to bottom, ${zn(At.get(d)||d,.4)} 0, ${zn(At.get(d)||d,.4)} 100%) !important; + background-image: linear-gradient(to bottom, ${Gn(Mt.get(v)||v,.4)} 0, ${Gn(Mt.get(v)||v,.4)} 100%) !important; color: black !important; } - `)}const o=(()=>{let i=document.getElementById(Ct);return i||(i=document.createElement("style"),i.id=Ct,document.head.appendChild(i)),i})();o.innerHTML=n.join(` -`)}function ri(){var t;document.body.querySelectorAll(`.${Ct}`).forEach(e=>e.outerHTML=e.innerText),(t=document.getElementById(Ct))==null||t.remove()}function oi(t){const e=document.body.querySelector(`.${Ct}[data-id="${t}"]`);e&&e.scrollIntoView({behavior:"smooth",block:"start"})}function ii(t){const e=t.commonAncestorContainer.nodeType==Node.ELEMENT_NODE?t.commonAncestorContainer:t.commonAncestorContainer.parentElement;if((e==null?void 0:e.className)==Ct){if(!t.collapsed){const n=new Range;n.selectNodeContents(t.commonAncestorContainer);const r=t.compareBoundaryPoints(Range.START_TO_START,n),o=t.compareBoundaryPoints(Range.END_TO_END,n);if(n.detach(),r!=0||o!=0)return}return e.getAttribute("data-id")||void 0}}function zn(t,e){if(!t)return t;const n=parseInt(t.slice(1,3),16),r=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16);return`rgba(${n}, ${r}, ${o}, ${e})`}function si(t){return Oe?Zo(t):ni(t)}function Ve(t){return si(t)}function li(){return Oe?Qo():ri()}function Or(t){return Oe?ti(t):oi(t)}function Mr(){var n,r,o;const t=document.getSelection();if(!(t!=null&&t.rangeCount))return;const e=t.getRangeAt(0);if(!((o=((n=e==null?void 0:e.commonAncestorContainer)==null?void 0:n.nodeType)==1?e==null?void 0:e.commonAncestorContainer:(r=e==null?void 0:e.commonAncestorContainer)==null?void 0:r.parentElement)!=null&&o.closest('[contenteditable=""], [contenteditable=true]')))return e}function re(){const t=document.getSelection();t!=null&&t.rangeCount&&t.removeAllRanges()}function ai(t){return Oe?ei(t):ii(t)}function Un(t){if(!t)return"";var e=document.createElement("div");e.appendChild(t.cloneContents().cloneNode(!0)),document.body.appendChild(e);const n=e.innerText;return document.body.removeChild(e),e=void 0,n}function ui(t,e,n){let r=et(dt([])),o=et(!1),i=et(!1),l=et(void 0);function d(_){const k=ai(_);if(k)return N(r).find(D=>D._id==k);if(Un(_).trim())return{text:Un(_).trim()}}function v(_){const k={...typeof _._id=="string"?{_id:_._id}:{},...typeof _.text=="string"?{text:_.text}:{},...typeof _.note=="string"?{note:_.note}:{},color:_.color||"yellow"};if(!k.text)return;const $=N(r).findIndex(D=>{var O,x;return D._id==k._id||((O=D.text)==null?void 0:O.toLocaleLowerCase().trim())===((x=k.text)==null?void 0:x.toLocaleLowerCase().trim())});$!=-1?(N(r)[$]=k,e(k)):(N(r).push(k),t(k))}function p({_id:_}){q(r,dt(N(r).filter(k=>k._id!=_))),n({_id:_})}function g(_){q(l,dt(JSON.parse(JSON.stringify(_))))}function w(){N(l)&&(v(N(l)),q(l,void 0))}function E(){q(l,void 0)}return{get highlights(){return N(r)},set highlights(_){q(r,dt(_))},get pro(){return N(o)},set pro(_){q(o,dt(_))},get nav(){return N(i)},set nav(_){q(i,dt(_))},get draft(){return N(l)},find:d,upsert:v,remove:p,setDraft:g,draftSubmit:w,draftCancel:E}}const ci="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(ci);function fi(t,e){let n=null,r=!0;return function(...i){n||(r?(t(...i),r=!1):(clearTimeout(n),n=setTimeout(()=>{t(...i),clearTimeout(n),n=null},e)))}}function rn(){var t;return(t=navigator==null?void 0:navigator.userAgentData)!=null&&t.mobile?!0:/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent)}var di=bt(''),hi=bt(''),pi=bt('
');const vi={hash:"svelte-f9ok5r",code:` + `)}const o=(()=>{let s=document.getElementById(kt);return s||(s=document.createElement("style"),s.id=kt,document.head.appendChild(s)),s})();o.innerHTML=n.join(` +`)}function ui(){var t;document.body.querySelectorAll(`.${kt}`).forEach(e=>e.outerHTML=e.innerText),(t=document.getElementById(kt))==null||t.remove()}function ci(t){const e=document.body.querySelector(`.${kt}[data-id="${t}"]`);e&&e.scrollIntoView({behavior:"smooth",block:"start"})}function fi(t){const e=t.commonAncestorContainer.nodeType==Node.ELEMENT_NODE?t.commonAncestorContainer:t.commonAncestorContainer.parentElement;if((e==null?void 0:e.className)==kt){if(!t.collapsed){const n=new Range;n.selectNodeContents(t.commonAncestorContainer);const r=t.compareBoundaryPoints(Range.START_TO_START,n),o=t.compareBoundaryPoints(Range.END_TO_END,n);if(n.detach(),r!=0||o!=0)return}return e.getAttribute("data-id")||void 0}}function Gn(t,e){if(!t)return t;const n=parseInt(t.slice(1,3),16),r=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16);return`rgba(${n}, ${r}, ${o}, ${e})`}function di(t){return Fe?oi(t):ai(t)}function Xe(t){return di(t)}function hi(){return Fe?ii():ui()}function Or(t){return Fe?si(t):ci(t)}function Rr(){var n,r,o;const t=document.getSelection();if(!(t!=null&&t.rangeCount))return;const e=t.getRangeAt(0);if(!((o=((n=e==null?void 0:e.commonAncestorContainer)==null?void 0:n.nodeType)==1?e==null?void 0:e.commonAncestorContainer:(r=e==null?void 0:e.commonAncestorContainer)==null?void 0:r.parentElement)!=null&&o.closest('[contenteditable=""], [contenteditable=true]')))return e}function le(){const t=document.getSelection();t!=null&&t.rangeCount&&t.removeAllRanges()}function vi(t){return Fe?li(t):fi(t)}function Zn(t){if(!t)return"";var e=document.createElement("div");e.appendChild(t.cloneContents().cloneNode(!0)),document.body.appendChild(e);const n=e.innerText;return document.body.removeChild(e),e=void 0,n}function pi(t,e,n){let r=Ot(rt([])),o=Ot(!1),s=Ot(!1),l=Ot(void 0);function v(g){const k=vi(g);if(k)return T(r).find(A=>A._id==k);if(Zn(g).trim())return{text:Zn(g).trim()}}function d(g){const k={...typeof g._id=="string"?{_id:g._id}:{},...typeof g.text=="string"?{text:g.text}:{},...typeof g.note=="string"?{note:g.note}:{},color:g.color||"yellow"};if(!k.text)return;const $=T(r).findIndex(A=>{var C,N;return A._id==k._id||((C=A.text)==null?void 0:C.toLocaleLowerCase().trim())===((N=k.text)==null?void 0:N.toLocaleLowerCase().trim())});$!=-1?(T(r)[$]=k,e(k)):(T(r).push(k),t(k))}function f({_id:g}){I(r,rt(T(r).filter(k=>k._id!=g))),n({_id:g})}function _(g){I(l,rt(JSON.parse(JSON.stringify(g))))}function m(){T(l)&&(d(T(l)),I(l,void 0))}function b(){I(l,void 0)}return{get highlights(){return T(r)},set highlights(g){I(r,rt(g))},get pro(){return T(o)},set pro(g){I(o,rt(g))},get nav(){return T(s)},set nav(g){I(s,rt(g))},get draft(){return T(l)},find:v,upsert:d,remove:f,setDraft:_,draftSubmit:m,draftCancel:b}}const _i="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(_i);function mi(t,e){let n=null,r=!0;return function(...s){n||(r?(t(...s),r=!1):(clearTimeout(n),n=setTimeout(()=>{t(...s),clearTimeout(n),n=null},e)))}}function sn(){var t;return(t=navigator==null?void 0:navigator.userAgentData)!=null&&t.mobile?!0:/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent)}var gi=wt(''),wi=wt(''),yi=wt('
');const bi={hash:"svelte-f9ok5r",code:` .svelte-f9ok5r { user-select: none; -webkit-user-select: none; @@ -189,7 +189,7 @@ opacity: 0; } } -`};function Rr(t,e){fe(e,!0),yn(t,vi);let n=je(e,"store",7),r,o=et(void 0),i=et(!1);function l(A){if(!N(o))return;const S=A.currentTarget.returnValue;switch(A.currentTarget.returnValue="",S){case"add":n().upsert(N(o)),re();break;case"note":n().setDraft(N(o)),re();break;case"remove":n().remove(N(o)),re();break;default:if(At.has(S)){n().upsert({...N(o),color:S}),re();return}break}}function d(){q(i,!0)}function v(){q(i,!1),setTimeout(p)}function p(){if(N(i)){r==null||r.close();return}requestAnimationFrame(()=>{const A=Mr(),S=A&&n().find(A);if(!A||!(S!=null&&S._id)&&!A.toString().trim()){r==null||r.close();return}q(o,dt(S)),r.inert=!0,r==null||r.show(),r.inert=!1;const K=256,R=10,L=A.getBoundingClientRect(),W=Math.min(Math.max(L.x,R)+window.scrollX,window.innerWidth+window.scrollX-K-R),Q=Math.min(window.innerWidth-Math.max(L.x,R)-window.scrollX-L.width,window.innerWidth-window.scrollX-K-R),nt=Math.max(L.y,40)+window.scrollY+L.height+4,rt=window.innerHeight-Math.max(L.y,40)-window.scrollY+4,it=Wr=A,()=>r),yt(()=>oe(w,"mobile",rn()));var E=Z(w),_=Z(E);_n(_,69,()=>At,([A,S],K)=>A,(A,S,K)=>{let R=()=>lt(lt(S))[0],L=()=>lt(lt(S))[1];var W=di(),Q=Z(W);z(W),yt(()=>{var nt;Vo(W,R()),ht(Q,"style",`--color: ${L()??""}`),oe(Q,"active",R()==((nt=N(o))==null?void 0:nt.color))}),at(A,W)});var k=F(F(_,!0)),$=Z(k),D=Z($),O=Z(D),x=F(O),C=F(x),j=F(C);z(D),z($),z(k);var ct=F(F(k,!0));return Se(ct,()=>{var A;return(A=N(o))==null?void 0:A._id},A=>{var S=hi(),K=Z(S),R=Z(K),L=Z(R),W=F(L);F(W),z(R),z(K),z(S),at(A,S)}),z(E),z(w),yt(()=>{var A,S,K,R,L,W;oe(w,"new",!((A=N(o))!=null&&A._id)),ht(O,"fill",(S=N(o))!=null&&S.note?"currentColor":"none"),ht(O,"stroke-width",(K=N(o))!=null&&K.note?"0":void 0),ht(x,"fill",(R=N(o))!=null&&R.note?"none":"currentColor"),ht(C,"fill",(L=N(o))!=null&&L.note?"none":"currentColor"),ht(j,"fill",(W=N(o))!=null&&W.note?"none":"currentColor")}),_t("close",w,l,!1),at(t,w),de({get store(){return n()},set store(A){n(A),Kt()}})}Le(Rr,{store:{}},[],[],!0);function mi(t){const e=t.currentTarget.getBoundingClientRect();e.top<=t.clientY&&t.clientY<=e.top+e.height&&e.left<=t.clientX&&t.clientX<=e.left+e.width||(t.preventDefault(),t.currentTarget.close())}var gi=(t,e)=>q(e,!1),_i=bt(''),yi=bt('
Upgrade to Pro to unlock annotation
'),wi=bt('
',1),bi=bt('
');const Ei={hash:"svelte-n7j6yt",code:` +`};function Fr(t,e){pe(e,!0),Cn(t,bi,!0);let n=Oe(e,"store",7),r,o=Ot(void 0),s=Ot(!1);function l(D){if(!T(o))return;const M=D.currentTarget.returnValue;switch(D.currentTarget.returnValue="",M){case"add":n().upsert(T(o)),le();break;case"note":n().setDraft(T(o)),le();break;case"remove":n().remove(T(o)),le();break;default:if(Mt.has(M)){n().upsert({...T(o),color:M}),le();return}break}}function v(){I(s,!0)}function d(){I(s,!1),setTimeout(f)}function f(){if(T(s)){r==null||r.close();return}requestAnimationFrame(()=>{const D=Rr(),M=D&&n().find(D);if(!D||!(M!=null&&M._id)&&!D.toString().trim()){r==null||r.close();return}I(o,rt(M)),r.inert=!0,r==null||r.show(),r.inert=!1;const B=256,P=10,j=D.getBoundingClientRect(),U=Math.min(Math.max(j.x,P)+window.scrollX,window.innerWidth+window.scrollX-B-P),z=Math.min(window.innerWidth-Math.max(j.x,P)-window.scrollX-j.width,window.innerWidth-window.scrollX-B-P),lt=Math.max(j.y,40)+window.scrollY+j.height+4,xt=window.innerHeight-Math.max(j.y,40)-window.scrollY+4,yt=Ur=D,()=>r),pt(()=>ue(m,"mobile",sn()));var b=ot(m),g=ot(b);kn(g,17,()=>Mt,([D,M])=>D,(D,M)=>{let B=()=>T(M)[0],P=()=>T(M)[1];var j=gi(),U=ot(j);J(j),pt(()=>{var z;Go(j,B()),ut(U,"style",`--color: ${P()??""}`),ue(U,"active",B()==((z=T(o))==null?void 0:z.color))}),it(D,j)});var k=et(g,2),$=ot(k),A=ot($),C=ot(A),N=et(C),x=et(N),L=et(x);J(A),J($),J(k);var ft=et(k,2);return De(ft,()=>{var D;return(D=T(o))==null?void 0:D._id},D=>{var M=wi();it(D,M)}),J(b),J(m),pt(()=>{var D,M,B,P,j,U;ue(m,"new",!((D=T(o))!=null&&D._id)),ut(C,"fill",(M=T(o))!=null&&M.note?"currentColor":"none"),ut(C,"stroke-width",(B=T(o))!=null&&B.note?"0":void 0),ut(N,"fill",(P=T(o))!=null&&P.note?"none":"currentColor"),ut(x,"fill",(j=T(o))!=null&&j.note?"none":"currentColor"),ut(L,"fill",(U=T(o))!=null&&U.note?"none":"currentColor")}),vt("close",m,l),it(t,m),_e({get store(){return n()},set store(D){n(D),ne()}})}Re(Fr,{store:{}},[],[],!0);function Ei(t){const e=t.currentTarget.getBoundingClientRect();e.top<=t.clientY&&t.clientY<=e.top+e.height&&e.left<=t.clientX&&t.clientX<=e.left+e.width||(t.preventDefault(),t.currentTarget.close())}var ki=(t,e)=>I(e,!1),Ci=wt(''),$i=wt('
Upgrade to Pro to unlock annotation
'),xi=wt('
',1),Ti=wt('
');const Ni={hash:"svelte-n7j6yt",code:` .svelte-n7j6yt { box-sizing: border-box; -webkit-tap-highlight-color: transparent; @@ -432,7 +432,7 @@ to { opacity: 1; } } } -`};function Fr(t,e){fe(e,!0),yn(t,Ei);const n=[];let r=je(e,"store",7),o,i,l=et(!0);Ze(()=>{r().draft?(q(l,!0),o==null||o.showModal()):o==null||o.close()});function d(x){const C=x.currentTarget.returnValue;x.currentTarget.returnValue="",setTimeout(C?r().draftSubmit:r().draftCancel,200)}function v(x){var C;rn()||(x.stopImmediatePropagation(),x.stopPropagation(),x.key=="Enter"&&!x.shiftKey&&(x.preventDefault(),i&&((C=x.currentTarget.closest("form"))==null||C.requestSubmit(i))))}var p=bi();nn(p,x=>o=x,()=>o),p.__mousedown=[mi],yt(()=>oe(p,"mobile",rn()));var g=Z(p),w=Z(g);z(g);var E=F(F(g,!0)),_=Z(E);Se(_,()=>r().draft,x=>{var C=wi(),j=mn(C);j.__click=[gi,l];var ct=Z(j);yt(()=>{var R,L;return Be(ct,((L=(R=r().draft)==null?void 0:R.text)==null?void 0:L.trim())||"")}),z(j);var A=F(F(j,!0));_n(A,73,()=>At,Ho,(R,L,W)=>{let Q=()=>lt(lt(L))[0],nt=()=>lt(lt(L))[1];var rt=_i();Wo(rt);var it;yt(()=>{it!==(it=Q())&&(rt.value=(rt.__value=Q())==null?"":Q()),ht(rt,"style",`--color: ${nt()??""}`)}),Uo(n,[],rt,()=>(Q(),r().draft.color),vt=>r().draft.color=vt),at(R,rt)}),z(A);var S=F(F(A,!0));Yo(S),Bo(S),S.__keydown=v;var K=F(F(S,!0));Se(K,()=>!r().pro,R=>{var L=yi();Z(L),eo(),z(L),at(R,L)}),yt(()=>{oe(j,"compact",N(l)),S.disabled=!r().pro}),zo(S,()=>r().draft.note,R=>r().draft.note=R),at(x,C)});var k=F(F(_,!0)),$=Z(k);F(Z($)),z($);var D=F(F($,!0));nn(D,x=>i=x,()=>i);var O=Z(D);return F(O),z(D),z(k),z(E),z(p),yt(()=>{var x,C;Be(w,`${((x=r().draft)!=null&&x._id?"Edit":"New")??""} highlight`),Be(O,`${((C=r().draft)!=null&&C._id?"Update":"Create")??""} `)}),_t("close",p,d,!1),at(t,p),de({get store(){return r()},set store(x){r(x),Kt()}})}xr(["mousedown","click","keydown"]);Le(Fr,{store:{}},[],[],!0);const ki=t=>{const e=t.target.getAttribute("data-highlight");e&&(t.preventDefault(),Or(e))};var Ci=bt('
'),$i=bt('');const xi={hash:"svelte-rwfy02",code:` +`};function Hr(t,e){pe(e,!0),Cn(t,Ni,!0);const n=[];let r=Oe(e,"store",7),o,s,l=Ot(!0);Ke(()=>{r().draft?(I(l,!0),o==null||o.showModal()):o==null||o.close()});function v(C){const N=C.currentTarget.returnValue;C.currentTarget.returnValue="",setTimeout(N?r().draftSubmit:r().draftCancel,200)}function d(C){var N;sn()||(C.stopImmediatePropagation(),C.stopPropagation(),C.key=="Enter"&&!C.shiftKey&&(C.preventDefault(),s&&((N=C.currentTarget.closest("form"))==null||N.requestSubmit(s))))}var f=Ti();on(f,C=>o=C,()=>o),f.__mousedown=[Ei],pt(()=>ue(f,"mobile",sn()));var _=ot(f),m=ot(_);J(_);var b=et(_,2),g=ot(b);De(g,()=>r().draft,C=>{var N=xi(),x=bn(N);x.__click=[ki,l];var L=ot(x);pt(()=>{var B,P;return Ye(L,((P=(B=r().draft)==null?void 0:B.text)==null?void 0:P.trim())||"")}),J(x);var ft=et(x,2);kn(ft,21,()=>Mt,Wo,(B,P)=>{let j=()=>T(P)[0],U=()=>T(P)[1];var z=Ci();Jo(z);var lt;pt(()=>{lt!==(lt=j())&&(z.value=(z.__value=j())==null?"":j()),ut(z,"style",`--color: ${U()??""}`)}),Qo(n,[],z,()=>(j(),r().draft.color),xt=>r().draft.color=xt),it(B,z)}),J(ft);var D=et(ft,2);Ko(D),Xo(D),D.__keydown=d;var M=et(D,2);De(M,()=>!r().pro,B=>{var P=$i();it(B,P)}),pt(()=>{ue(x,"compact",T(l)),D.disabled=!r().pro}),Zo(D,()=>r().draft.note,B=>r().draft.note=B),it(C,N)});var k=et(g,2),$=et(ot(k),2);on($,C=>s=C,()=>s);var A=ot($);return Ro(),J($),J(k),J(b),J(f),pt(()=>{var C,N;Ye(m,`${((C=r().draft)!=null&&C._id?"Edit":"New")??""} highlight`),Ye(A,`${((N=r().draft)!=null&&N._id?"Update":"Create")??""} `)}),vt("close",f,v),it(t,f),_e({get store(){return r()},set store(C){r(C),ne()}})}Tr(["mousedown","click","keydown"]);Re(Hr,{store:{}},[],[],!0);const Si=t=>{const e=t.target.getAttribute("data-highlight");e&&(t.preventDefault(),Or(e))};var Ai=wt('
'),Di=wt('');const Li={hash:"svelte-rwfy02",code:` nav.svelte-rwfy02 { all: unset; } @@ -463,4 +463,4 @@ div.svelte-rwfy02:hover::before { width: 100%; } -`};function Hr(t,e){fe(e,!0),yn(t,xi);let n=je(e,"store",7);var r=Mo(),o=mn(r);return Se(o,()=>n().nav,i=>{var l=$i();l.__click=[ki],_n(l,77,()=>n().highlights,(d,v)=>d._id,(d,v,p)=>{var g=Ci();yt(()=>ht(g,"style",`top: var(--highlight-${lt(v)._id??""}-top); --color: ${(At.get(lt(v).color)||lt(v).color)??""}`)),yt(()=>ht(g,"data-highlight",lt(v)._id)),at(d,g)}),z(l),at(i,l)}),at(t,r),de({get store(){return n()},set store(i){n(i),Kt()}})}xr(["click"]);Le(Hr,{store:{}},[],[],!0);var Ti=bt(" ",1);function Si(t,e){fe(e,!0);let n=je(e,"store",7);Ze(()=>{Ve(n().highlights)});let r;function o(){Ve(n().highlights),clearTimeout(r),r=setTimeout(()=>Ve(n().highlights),3e3)}_r(()=>{document.readyState&&o()}),Ze(()=>li);var i=Ti();_t("load",Te,o,!1),_t("popstate",Te,o,!1);var l=mn(i);Rr(l,{get store(){return n()}});var d=F(F(l,!0));Fr(d,{get store(){return n()}});var v=F(F(d,!0));return Hr(v,{get store(){return n()}}),at(t,i),de({get store(){return n()},set store(p){n(p),Kt()}})}customElements.define("rdh-ui",Le(Si,{store:{}},[],[],!0));function Ni(t){if(typeof chrome=="object"&&chrome.runtime&&chrome.runtime.onMessage||typeof browser=="object"&&browser.runtime&&browser.runtime.onMessage){const{runtime:e}=typeof browser=="object"?browser:chrome,n=(r,o)=>{o.id==e.id&&typeof r.type=="string"&&t(r)};return e.onMessage.removeListener(n),e.onMessage.addListener(n),r=>e.sendMessage(null,r)}if(window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.rdh)return window.rdhSend=t,e=>window.webkit.messageHandlers.rdh.postMessage(e);if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&process.versions.electron){const{ipcRenderer:e}=require("electron"),n=(r,o)=>t(o);return e.removeListener("RDH",n),e.on("RDH",n),r=>e.sendToHost("RDH",r)}if("ReactNativeWebView"in window)return window.ReactNativeWebViewSendMessage=t,e=>window.ReactNativeWebView.postMessage(JSON.stringify(e));if(window.self!==window.top){const e=({data:n,source:r})=>{r!==window.parent||typeof n!="object"||typeof n.type!="string"||t(n)};return window.removeEventListener("message",e),window.addEventListener("message",e),n=>window.parent.postMessage(n,"*")}throw new Error("unsupported platform")}async function Ai(t){let e=!1;const n=new Set,r=Ni(o=>{if(!e){n.add(o);return}t(o)});await new Promise(o=>{function i(){window.removeEventListener("DOMContentLoaded",i),o()}document.readyState=="loading"?(window.removeEventListener("DOMContentLoaded",i),window.addEventListener("DOMContentLoaded",i,{once:!0})):o()}),e=!0;for(const o of n)t(o),n.delete(o);return r}const ee=document.createElement("rdh-ui");(async()=>{const t=await Ai(n=>{switch(n.type){case"RDH_APPLY":Array.isArray(n.payload)&&(e.highlights=n.payload);break;case"RDH_CONFIG":typeof n.payload.pro=="boolean"&&(e.pro=n.payload.pro),typeof n.payload.nav=="boolean"&&(e.nav=n.payload.nav),typeof n.payload.enabled=="boolean"&&(n.payload.enabled===!0?document.body.contains(ee)||document.body.appendChild(ee):document.body.contains(ee)&&document.body.removeChild(ee));break;case"RDH_SCROLL":typeof n.payload._id=="string"&&Or(n.payload._id);break;case"RDH_ADD_SELECTION":const r=Mr();if(!r)return;const o=e.find(r);if(!o)return;e.upsert(o),re();break;case"RDH_NOTE_SELECTION":console.log("not implemented yet");break}}),e=ui(n=>t({type:"RDH_ADD",payload:n}),n=>t({type:"RDH_UPDATE",payload:n}),({_id:n})=>t({type:"RDH_REMOVE",payload:{_id:n}}));ee.store=e,t({type:"RDH_READY",payload:{url:location.href}})})(); +`};function Pr(t,e){pe(e,!0),Cn(t,Li,!0);let n=Oe(e,"store",7);var r=Po(),o=bn(r);return De(o,()=>n().nav,s=>{var l=Di();l.__click=[Si],kn(l,21,()=>n().highlights,v=>v._id,(v,d)=>{var f=Ai();pt(()=>ut(f,"style",`top: var(--highlight-${T(d)._id??""}-top); --color: ${(Mt.get(T(d).color)||T(d).color)??""}`)),pt(()=>ut(f,"data-highlight",T(d)._id)),it(v,f)}),J(l),it(s,l)}),it(t,r),_e({get store(){return n()},set store(s){n(s),ne()}})}Tr(["click"]);Re(Pr,{store:{}},[],[],!0);var Mi=wt(" ",1);function ji(t,e){pe(e,!0);let n=Oe(e,"store",7);Ke(()=>{Xe(n().highlights)});let r;function o(){Xe(n().highlights),clearTimeout(r),r=setTimeout(()=>Xe(n().highlights),3e3)}lr(()=>{document.readyState&&o()}),Ke(()=>hi);var s=Mi();vt("load",Ae,o),vt("popstate",Ae,o);var l=bn(s);Fr(l,{get store(){return n()}});var v=et(l,2);Hr(v,{get store(){return n()}});var d=et(v,2);return Pr(d,{get store(){return n()}}),it(t,s),_e({get store(){return n()},set store(f){n(f),ne()}})}customElements.define("rdh-ui",Re(ji,{store:{}},[],[],!0));function Oi(t){if(typeof chrome=="object"&&chrome.runtime&&chrome.runtime.onMessage||typeof browser=="object"&&browser.runtime&&browser.runtime.onMessage){const{runtime:e}=typeof browser=="object"?browser:chrome,n=(r,o)=>{o.id==e.id&&typeof r.type=="string"&&t(r)};return e.onMessage.removeListener(n),e.onMessage.addListener(n),r=>e.sendMessage(null,r)}if(window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.rdh)return window.rdhSend=t,e=>window.webkit.messageHandlers.rdh.postMessage(e);if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&process.versions.electron){const{ipcRenderer:e}=require("electron"),n=(r,o)=>t(o);return e.removeListener("RDH",n),e.on("RDH",n),r=>e.sendToHost("RDH",r)}if("ReactNativeWebView"in window)return window.ReactNativeWebViewSendMessage=t,e=>window.ReactNativeWebView.postMessage(JSON.stringify(e));if(window.self!==window.top){const e=({data:n,source:r})=>{r!==window.parent||typeof n!="object"||typeof n.type!="string"||t(n)};return window.removeEventListener("message",e),window.addEventListener("message",e),n=>window.parent.postMessage(n,"*")}throw new Error("unsupported platform")}async function Ri(t){let e=!1;const n=new Set,r=Oi(o=>{if(!e){n.add(o);return}t(o)});await new Promise(o=>{function s(){window.removeEventListener("DOMContentLoaded",s),o()}document.readyState=="loading"?(window.removeEventListener("DOMContentLoaded",s),window.addEventListener("DOMContentLoaded",s,{once:!0})):o()}),e=!0;for(const o of n)t(o),n.delete(o);return r}const ie=document.createElement("rdh-ui");(async()=>{const t=await Ri(n=>{switch(n.type){case"RDH_APPLY":Array.isArray(n.payload)&&(e.highlights=n.payload);break;case"RDH_CONFIG":typeof n.payload.pro=="boolean"&&(e.pro=n.payload.pro),typeof n.payload.nav=="boolean"&&(e.nav=n.payload.nav),typeof n.payload.enabled=="boolean"&&(n.payload.enabled===!0?document.body.contains(ie)||document.body.appendChild(ie):document.body.contains(ie)&&document.body.removeChild(ie));break;case"RDH_SCROLL":typeof n.payload._id=="string"&&Or(n.payload._id);break;case"RDH_ADD_SELECTION":const r=Rr();if(!r)return;const o=e.find(r);if(!o)return;e.upsert(o),le();break;case"RDH_NOTE_SELECTION":console.log("not implemented yet");break}}),e=pi(n=>t({type:"RDH_ADD",payload:n}),n=>t({type:"RDH_UPDATE",payload:n}),({_id:n})=>t({type:"RDH_REMOVE",payload:{_id:n}}));ie.store=e,t({type:"RDH_READY",payload:{url:location.href}})})();