machinechecked 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. machinechecked-0.1.0.dist-info/METADATA +108 -0
  2. machinechecked-0.1.0.dist-info/RECORD +58 -0
  3. machinechecked-0.1.0.dist-info/WHEEL +5 -0
  4. machinechecked-0.1.0.dist-info/entry_points.txt +3 -0
  5. machinechecked-0.1.0.dist-info/licenses/LICENSE +201 -0
  6. machinechecked-0.1.0.dist-info/top_level.txt +1 -0
  7. prooflens/__init__.py +1 -0
  8. prooflens/__main__.py +3 -0
  9. prooflens/assess.py +504 -0
  10. prooflens/audit.py +115 -0
  11. prooflens/bundle.py +70 -0
  12. prooflens/cli.py +542 -0
  13. prooflens/config.py +145 -0
  14. prooflens/data/ProofLensProbe.lean +469 -0
  15. prooflens/data/prooflens.sty +75 -0
  16. prooflens/data/schema/evidence.schema.json +24 -0
  17. prooflens/data/schema/inventory.schema.json +55 -0
  18. prooflens/data/schema/manifest-claim.schema.json +126 -0
  19. prooflens/data/schema/manifest-index.schema.json +128 -0
  20. prooflens/evidence.py +60 -0
  21. prooflens/export.py +227 -0
  22. prooflens/formalization.py +106 -0
  23. prooflens/manifest.py +296 -0
  24. prooflens/pdfclaims.py +129 -0
  25. prooflens/pipeline.py +331 -0
  26. prooflens/probe.py +126 -0
  27. prooflens/promote.py +204 -0
  28. prooflens/review_queue.py +138 -0
  29. prooflens/reviews.py +105 -0
  30. prooflens/schemas.py +19 -0
  31. prooflens/server.py +63 -0
  32. prooflens/simple.py +628 -0
  33. prooflens/sources.py +164 -0
  34. prooflens/tex.py +408 -0
  35. prooflens/util.py +66 -0
  36. prooflens/web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  37. prooflens/web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  38. prooflens/web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  39. prooflens/web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  40. prooflens/web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  41. prooflens/web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  42. prooflens/web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  43. prooflens/web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  44. prooflens/web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  45. prooflens/web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  46. prooflens/web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  47. prooflens/web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  48. prooflens/web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  49. prooflens/web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  50. prooflens/web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  51. prooflens/web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  52. prooflens/web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  53. prooflens/web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  54. prooflens/web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  55. prooflens/web/assets/index-B2GDDbsW.css +1 -0
  56. prooflens/web/assets/index-DN7uLe7p.js +285 -0
  57. prooflens/web/assets/pdf.worker.min-yatZIOMy.mjs +21 -0
  58. prooflens/web/index.html +14 -0
@@ -0,0 +1,285 @@
1
+ (function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible,d=()=>{};function f(e){for(var t=0;t<e.length;t++)e[t]()}function p(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function m(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var h=1024,g=2048,_=4096,v=8192,y=16384,b=32768,x=1<<25,S=65536,ee=1<<19,te=1<<20,ne=1<<25,C=1<<21,re=1<<22,ie=1<<23,ae=Symbol(`$state`),w=Symbol(`component`),oe=Symbol(`legacy props`),se=Symbol(``),ce=Symbol(`attributes`),le=Symbol(`class`),ue=Symbol(`style`),de=Symbol(`text`),fe=Symbol(`form reset`),pe=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},me=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),he={},ge=Symbol(`uninitialized`),_e=`http://www.w3.org/1999/xhtml`;function ve(){console.warn(`https://svelte.dev/e/derived_inert`)}function ye(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function be(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function xe(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var Se=!1;function Ce(e){Se=e}var we;function Te(e){if(e===null)throw ye(),he;return we=e}function Ee(){return Te(pn(we))}function T(e){if(Se){if(pn(we)!==null)throw ye(),he;we=e}}function De(e=1){if(Se){for(var t=e,n=we;t--;)n=pn(n);we=n}}function Oe(e=!0){for(var t=0,n=we;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=pn(n);e&&n.remove(),n=i}}function ke(e){if(!e||e.nodeType!==8)throw ye(),he;return e.data}function Ae(e){return e===this.v}function je(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Me(e){return!je(e,this.v)}function Ne(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Pe(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Fe(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Ie(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Le(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Re(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function ze(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Be(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Ve(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function He(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Ue(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var We=[];function Ge(e,t=!1,n=!1){return Ke(e,new Map,``,We,null,n)}function Ke(t,n,r,i,a=null,o=!1){if(typeof t==`object`&&t){var c=n.get(t);if(c!==void 0)return c;if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);if(e(t)){var u=Array(t.length);n.set(t,u),a!==null&&n.set(a,u);for(var d=0;d<t.length;d+=1){var f=t[d];d in t&&(u[d]=Ke(f,n,r,i,null,o))}return u}if(l(t)===s){u={},n.set(t,u),a!==null&&n.set(a,u);for(var p of Object.keys(t))u[p]=Ke(t[p],n,r,i,null,o);return u}if(t instanceof Date)return t.getTime(),structuredClone(t);if(typeof t.toJSON==`function`&&!o)return Ke(t.toJSON(),n,r,i,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return t}}var qe=null;function Je(e){qe=e}function Ye(e,t=!1,n){qe={p:qe,i:!1,c:null,e:null,s:e,x:null,r:Xn,l:null}}function Xe(e){var t=qe,n=t.e;if(n!==null){t.e=null;for(var r of n)En(r)}return e!==void 0&&(t.x=e),t.i=!0,qe=t.p,Ze(e)}function Ze(e={}){return i(e,w,{value:!0}),e}function Qe(){return!0}var $e=[];function et(){var e=$e;$e=[],f(e)}function tt(e){if($e.length===0&&!At){var t=$e;queueMicrotask(()=>{t===$e&&et()})}$e.push(e)}function nt(){for(;$e.length>0;)et()}var rt=~(g|_|h);function it(e,t){e.f=e.f&rt|t}function at(e){e.f&512||e.deps===null?it(e,h):it(e,_)}function ot(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),it(e,h)}function st(e){Se&&fn(e)!==null&&mn(e)}var ct=!1;function lt(){ct||(ct=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[fe]?.()})},{capture:!0}))}function ut(e){var t=qn,n=Xn;Yn(null),Zn(null);try{return e()}finally{Yn(t),Zn(n)}}function dt(e,t,n,r=n){e.addEventListener(t,()=>ut(n));let i=e[fe];e[fe]=i?()=>{i(),r(!0)}:()=>r(!0),lt()}function ft(e,t,n,r){let i=Qe()?gt:yt;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=Xn,c=pt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){yn(e,s)}mt()}}var d=ht();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>vt(e))).then(u).catch(e=>yn(e,s)).finally(d)}l?l.then(()=>{s.f&16384?d():(c(),f(),mt())}):f()}function pt(){var e=Xn,t=qn,n=qe,r=Et;return function(i=!0){Zn(e),Yn(t),Je(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function mt(e=!0){Zn(null),Yn(null),Je(null),e&&Et?.deactivate()}function ht(){var e=Xn,t=e.b,n=Et,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function gt(e){var t=2|g;return Xn!==null&&(Xn.f|=ee),{ctx:qe,deps:null,effects:null,equals:Ae,f:t,fn:e,reactions:null,rv:0,v:ge,wv:0,parent:Xn,ac:null}}var _t=Symbol(`obsolete`);function vt(e,t,n){let r=Xn;r===null&&Ne();var i=void 0,a=qt(ge),o=!qn,s=new Set;return kn(()=>{var t=Xn,n=p();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==pe&&n.reject(e)}).finally(mt)}catch(e){n.reject(e),mt()}var c=Et;if(o){if(t.f&32768)var l=ht();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(_t);else for(let e of s.values())e.reject(_t);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==_t&&(c.activate(),t?(a.f|=ie,Qt(a,t)):(a.f&8388608&&(a.f^=ie),Qt(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),wn(()=>{for(let e of s)e.reject(_t)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function E(e){let t=gt(e);return $n(t),t}function yt(e){let t=gt(e);return t.equals=Me,t}function bt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)In(t[n])}}function xt(e){var t,n=Xn,r=e.parent;if(!Gn&&r!==null&&e.v!==ge&&r.f&24576)return ve(),e.v;Zn(r);try{bt(e),t=dr(e)}finally{Zn(n)}return t}function St(e){var t=xt(e);!e.equals(t)&&(e.wv=cr(),(!Et?.is_fork||e.deps===null)&&(Et===null?e.v=t:(Et.capture(e,t,!0),Dt?.capture(e,t,!0)),e.deps===null))?it(e,h):Gn||(Ot===null?at(e):(Cn()||Et?.is_fork)&&Ot.set(e,t))}function Ct(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac!==null&&ut(()=>{t.ac.abort(pe),t.ac=null}),t.fn!==null&&(t.teardown=d),mr(t,0),Pn(t))}function wt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&hr(t)}var Tt=null,Et=null,Dt=null,Ot=null,kt=null,At=!1,jt=!1,Mt=null,Nt=null,Pt=0,Ft=1,It=class e{id=Ft++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){Tt===null?Tt=this:(Tt.#n=this,this.#t=Tt),Tt=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)it(r,g),t(r);for(r of n.m)it(r,_),t(r)}this.#p.add(e)}#g(){var e=[];for(let i of this.#c)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=h}}n||e.push(t)}return this.#c=[],e}#_(){this.#e=!0;for(let e of this.#u)this.#d.delete(e),it(e,g),this.schedule(e);for(let e of this.#d)it(e,_),this.schedule(e);this.apply();for(var t=Mt=[],n=[],r=Nt=[];this.#c.length>0;){Pt++>1e3&&(this.#S(),Rt());for(let e of this.#g())try{this.#v(e,t,n)}catch(t){throw Ut(e),this.#h()||this.discard(),t}}if(Et=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(Mt=null,Nt=null,this.#h()){this.#x(n),this.#x(t);for(let[e,t]of this.#f)Ht(e,t);r.length>0&&Et.#_();return}let a=this.#y();if(a)this.#x(n),this.#x(t),a.#b(this);else{this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),Dt=this,Bt(n),Bt(t),Dt=null,this.#s?.resolve();var o=Et;if(this.#a===0&&(this.#c.length===0||o!==null)&&this.#S(),this.#c.length>0){if(o!==null){for(let e of this.#c)o.#c.push(e);this.#c=[]}else o=this}o!==null&&(Gt.clear(),o.#_())}}#v(e,t,n){e.f^=h;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=h:i&4?t.push(r):lr(r)&&(i&16&&this.#d.add(r),hr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#y(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#b(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),it(i,g),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),Et=this,this.#_()}#x(e){for(var t=0;t<e.length;t+=1)ot(e[t],this.#u,this.#d)}capture(e,t,n=!1){e.v!==ge&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),Ot?.set(e,t)),this.is_fork||(e.v=t)}activate(){Et=this}deactivate(){Et=null,Ot=null}flush(){try{jt=!0,Et=this,this.#_()}finally{Pt=0,kt=null,Mt=null,Nt=null,jt=!1,Et=null,Ot=null,Gt.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(_t);this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,tt(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=p()).promise}static ensure(){if(Et===null){let t=Et=new e;!jt&&!At&&tt(()=>{t.#e||t.flush()})}return Et}apply(){Ot=null}schedule(e){kt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)?e.b.defer_effect(e):this.#c.push(e)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?Tt=e:t.#t=e,this.linked=!1}}};function Lt(e){var t=At,n=Dt;Dt=null,At=!0;try{var r;for(e&&(Lt(),r=e());;){if(nt(),Et===null)return r;Et.flush()}}finally{At=t,Dt=n}}function Rt(){try{Re()}catch(e){yn(e,kt)}}var zt=null;function Bt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&lr(r)&&(zt=new Set,hr(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Rn(r),zt?.size>0)){Gt.clear();for(let e of zt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)zt.has(n)&&(zt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||hr(n)}}zt.clear()}}zt=null}}function Vt(e){Et.schedule(e)}function Ht(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),it(e,h);for(var n=e.first;n!==null;)Ht(n,t),n=n.next}}function Ut(e){it(e,h);for(var t=e.first;t!==null;)Ut(t),t=t.next}var Wt=new Set,Gt=new Map,Kt=!1;function qt(e,t){return{f:0,v:e,reactions:null,equals:Ae,rv:0,wv:0}}function Jt(e,t){let n=qt(e,t);return $n(n),n}function Yt(e,t=!1,n=!0){let r=qt(e);return t||(r.equals=Me),r}function D(e,t,n=!1){return qn!==null&&(!Jn||qn.f&131072)&&Qe()&&qn.f&4325394&&(Qn===null||!Qn.has(e))&&He(),Qt(e,n?nn(t):t,Nt)}var Xt=null,Zt=0;function Qt(e,t,n=null){if(!e.equals(t)){Gn?Gt.set(e,t):Gt.has(e)||Gt.set(e,e.v);var r=It.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&xt(t),Ot===null&&at(t)}e.wv=cr(),Xt=null,Zt=0,tn(e,g,n),Xt=null,Qe()&&Xn!==null&&Xn.f&1024&&!(Xn.f&96)&&(nr===null?rr([e]):nr.push(e)),!r.is_fork&&Wt.size>0&&!Kt&&$t()}return t}function $t(){Kt=!1;for(let e of Wt){e.f&1024&&it(e,_);let t;try{t=lr(e)}catch{t=!0}t&&hr(e)}Wt.clear()}function en(e){D(e,e.v+1)}function tn(e,t,n){var r=e.reactions;if(r!==null){var i=Qe(),a=r.length;if(Zt+=a,Zt>1e5&&Xt===null&&(Xt=new Set),Xt!==null){if(Xt.has(e))return;Xt.add(e)}for(var o=0;o<a;o++){var s=r[o],c=s.f;if(i||s!==Xn){var l=(c&g)===0;if(l&&it(s,t),c&131072)Wt.add(s);else if(c&2){var u=s;Ot?.delete(u),tn(u,_,n)}else if(l){var d=s;c&16&&zt!==null&&zt.add(d),n===null?Vt(d):n.push(d)}}}}}function nn(t){if(typeof t!=`object`||!t||ae in t||w in t)return t;let n=l(t);if(n!==s&&n!==c)return t;var r=new Map,i=e(t),o=Jt(0),u=null,d=or,f=e=>{if(or===d)return e();var t=qn,n=or;Yn(null),sr(d);var r=e();return Yn(t),sr(n),r};return i&&r.set(`length`,Jt(t.length,u)),new Proxy(t,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&Be();var i=r.get(t);return i===void 0?f(()=>{var e=Jt(n.value,u);return r.set(t,e),e}):D(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>Jt(ge,u));r.set(t,e),en(o)}}else D(n,ge),en(o);return!0},get(e,n,i){if(n===ae)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>Jt(nn(s?e[n]:ge),u)),r.set(n,o)),o!==void 0){var c=N(o);return c===ge?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var n=Reflect.getOwnPropertyDescriptor(e,t),i=r.get(t);if(i!==void 0){var a=N(i);if(a===ge)return;if(n&&`value`in n)n.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return n},has(e,t){if(t===ae)return!0;var n=r.get(t),i=n!==void 0&&n.v!==ge||Reflect.has(e,t);return(n!==void 0||Xn!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>Jt(i?nn(e[t]):ge,u)),r.set(t,n)),N(n)===ge)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;d<c.v;d+=1){var p=r.get(d+``);p===void 0?d in e&&(p=f(()=>Jt(ge,u)),r.set(d+``,p)):D(p,ge)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>Jt(void 0,u)),D(c,nn(n)),r.set(t,c));else{l=c.v!==ge;var m=f(()=>nn(n));D(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&D(g,_+1)}en(o)}return!0},ownKeys(e){N(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==ge});for(var[n,i]of r)i.v!==ge&&!(n in e)&&t.push(n);return t},setPrototypeOf(){Ve()}})}function rn(e){try{if(typeof e==`object`&&e&&ae in e)return e[ae]}catch{}return e}function an(e,t){return Object.is(rn(e),rn(t))}var on,sn,cn,ln;function un(){if(on===void 0){on=window,sn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;cn=a(t,`firstChild`).get,ln=a(t,`nextSibling`).get,u(e)&&(e[le]=void 0,e[ce]=null,e[ue]=void 0,e.__e=void 0),u(n)&&(n[de]=void 0)}}function dn(e=``){return document.createTextNode(e)}function fn(e){return cn.call(e)}function pn(e){return ln.call(e)}function O(e,t){if(!Se)return fn(e);var n=fn(we);if(n===null)n=we.appendChild(dn());else if(t&&n.nodeType!==3){var r=dn();return n?.before(r),Te(r),r}return t&&_n(n),Te(n),n}function k(e,t=!1){if(!Se){var n=fn(e);return n instanceof Comment&&n.data===``?pn(n):n}if(t){if(we?.nodeType!==3){var r=dn();return we?.before(r),Te(r),r}_n(we)}return we}function A(e,t=!1){if(!Se)return fn(e);var n=O(e,t);return T(e),n}function j(e,t=1,n=!1){let r=Se?we:e;for(var i;t--;)i=r,r=pn(r);if(!Se)return r;if(n){if(r?.nodeType!==3){var a=dn();return r===null?i?.after(a):r.before(a),Te(a),a}_n(r)}return Te(r),r}function mn(e){e.textContent=``}function hn(){return!1}function gn(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function _n(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function vn(e){var t=Xn;if(t===null)return qn.f|=ie,e;if(!(t.f&32768)&&!(t.f&4))throw e;yn(e,t)}function yn(e,t){if(e===he)throw e;if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function bn(e){Xn===null&&(qn===null&&Le(e),Ie()),Gn&&Fe(e)}function xn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Sn(e,t){var n=Xn;n!==null&&n.f&8192&&(e|=v);var r={ctx:qe,deps:null,nodes:null,f:e|g|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};Et?.register_created_effect(r);var i=r;if(e&4)Mt===null?It.ensure().schedule(r):Mt.push(r);else if(t!==null){try{hr(r)}catch(e){throw In(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=S))}if(i!==null&&(i.parent=n,n!==null&&xn(i,n),qn!==null&&qn.f&2&&!(e&64))){var a=qn;(a.effects??=[]).push(i)}return r}function Cn(){return qn!==null&&!Jn}function wn(e){let t=Sn(8,null);return it(t,h),t.teardown=e,t}function Tn(e){bn(`$effect`);var t=Xn.f;if(!qn&&t&32&&qe!==null&&!qe.i){var n=qe;(n.e??=[]).push(e)}else return En(e)}function En(e){return Sn(4|te,e)}function Dn(e){It.ensure();let t=Sn(64|ee,e);return(e={})=>new Promise(n=>{e.outro?zn(t,()=>{In(t),n(void 0)}):(In(t),n(void 0))})}function On(e){return Sn(4,e)}function kn(e){return Sn(re|ee,e)}function An(e,t=0){return Sn(8|t,e)}function M(e,t=[],n=[],r=[]){ft(r,t,n,t=>{Sn(8,()=>{e(...t.map(N))})})}function jn(e,t=0){return Sn(16|t,e)}function Mn(e){return Sn(32|ee,e)}function Nn(e){var t=e.teardown;if(t!==null){let n=Gn,r=qn;Kn(!0),Yn(null);try{t.call(null)}catch(t){yn(t,e.parent)}finally{Kn(n),Yn(r)}}}function Pn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&ut(()=>{e.abort(pe)});var r=n.next;n.f&64?n.parent=null:In(n,t),n=r}}function Fn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||In(t),t=n}}function In(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Ln(e.nodes.start,e.nodes.end),n=!0),e.f|=x,Pn(e,t&&!n),mr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Nn(e),e.f^=x,e.f|=y;var i=e.parent;i!==null&&i.first!==null&&Rn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Ln(e,t){for(;e!==null;){var n=e===t?null:pn(e);e.remove(),e=n}}function Rn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function zn(e,t,n=!0){var r=[];e.f|=256,Bn(e,r,!0);var i=()=>{n&&In(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Bn(e,t,n){if(!(e.f&8192)){e.f^=v;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);Bn(i,t,o?n:!1)}i=a}}}function Vn(e){e.f&=-257,Hn(e,!0)}function Hn(e,t){if(!(e.f&256)&&e.f&8192){e.f^=v,e.f&1024||(it(e,g),It.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);Hn(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Un(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:pn(n);t.append(n),n=i}}var Wn=null,Gn=!1;function Kn(e){Gn=e}var qn=null,Jn=!1;function Yn(e){qn=e}var Xn=null;function Zn(e){Xn=e}var Qn=null;function $n(e){qn!==null&&(qn.f&2097152||qn.f&2)&&(Qn??=new Set).add(e)}var er=null,tr=0,nr=null;function rr(e){nr=e}var ir=1,ar=0,or=ar;function sr(e){or=e}function cr(){return++ir}function lr(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(lr(a)&&St(a),a.wv>e.wv)return!0}t&512&&Ot===null&&it(e,h)}return!1}function ur(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Qn!==null&&Qn.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?ur(a,t,!1):t===a&&(n?it(a,g):a.f&1024&&it(a,_),Vt(a))}}function dr(e){var t=er,n=tr,r=nr,i=qn,a=Qn,o=qe,s=Jn,c=or,l=e.f;er=null,tr=0,nr=null,qn=l&96?null:e,Qn=null,Je(e.ctx),Jn=!1,or=++ar,e.ac!==null&&(ut(()=>{e.ac.abort(pe)}),e.ac=null);try{e.f|=C;var u=e.fn,d=u();e.f|=b;var f=fr(e);if(Qe()&&nr!==null&&!Jn&&f!==null&&!(e.f&6146))for(var p=0;p<nr.length;p++)ur(nr[p],e);if(i!==null&&i!==e){if(ar++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=ar;if(t!==null)for(let e of t)e.rv=ar;nr!==null&&(r===null?r=nr:r.push(...nr))}return e.f&8388608&&(e.f^=ie),d}catch(t){return fr(e),vn(t)}finally{e.f^=C,er=t,tr=n,nr=r,qn=i,Qn=a,Je(o),Jn=s,or=c}}function fr(e){var t=e.deps,n=Et?.is_fork;if(er!==null){var r;if(n||mr(e,tr),t!==null&&tr>0)for(t.length=tr+er.length,r=0;r<er.length;r++)t[tr+r]=er[r];else e.deps=t=er;if(Cn()&&e.f&512)for(r=tr;r<t.length;r++)(t[r].reactions??=[]).push(e)}else!n&&t!==null&&tr<t.length&&(mr(e,tr),t.length=tr);return t}function pr(e,r){let i=r.reactions;if(i!==null){var a=t.call(i,e);if(a!==-1){var o=i.length-1;o===0?i=r.reactions=null:(i[a]=i[o],i.pop())}}if(i===null&&r.f&2&&(er===null||!n.call(er,r))){var s=r;s.f&512&&(s.f^=512),s.v!==ge&&at(s),s.ac!==null&&ut(()=>{s.ac.abort(pe),s.ac=null,it(s,g)}),Ct(s),mr(s,0)}}function mr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)pr(e,n[r])}function hr(e){var t=e.f;if(!(t&16384)){it(e,h);var n=Xn;Xn=e;try{t&16777232?Fn(e):Pn(e),Nn(e);var r=dr(e);e.teardown=typeof r==`function`?r:null,e.wv=ir}finally{Xn=n}}}async function gr(){await Promise.resolve(),Lt()}function N(e){var t=!!(e.f&2);if(Wn?.add(e),qn!==null&&!Jn&&!(Xn!==null&&Xn.f&16384)&&(Qn===null||!Qn.has(e))){var r=qn.deps;if(qn.f&2097152)e.rv<ar&&(e.rv=ar,er===null&&r!==null&&r[tr]===e?tr++:er===null?er=[e]:er.push(e));else{qn.deps??=[],n.call(qn.deps,e)||qn.deps.push(e);var i=e.reactions;i===null?e.reactions=[qn]:n.call(i,qn)||i.push(qn)}}if(Gn&&Gt.has(e))return Gt.get(e);if(t){var a=e;if(Gn){var o=a.v;return(!(a.f&1024)&&a.reactions!==null||vr(a))&&(o=xt(a)),Gt.set(a,o),o}var s=!(a.f&512)&&!Jn&&qn!==null&&!!(qn.f&512),c=(a.f&b)===0;lr(a)&&(s&&(a.f|=512),St(a)),s&&!c&&(wt(a),_r(a))}if(Ot?.has(e))return Ot.get(e);if(e.f&8388608)throw e.v;return e.v}function _r(e){if(e.f|=512,e.deps!==null)for(let r of e.deps){var t=r.reactions;t===null?r.reactions=[e]:n.call(t,e)||t.push(e),r.f&2&&!(r.f&512)&&(wt(r),_r(r))}}function vr(e){if(e.v===ge)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Gt.has(t)||t.f&2&&vr(t))return!0;return!1}function yr(e){var t=Jn;try{return Jn=!0,e()}finally{Jn=t}}function br(e){if(!(typeof e!=`object`||!e||e instanceof EventTarget)){if(ae in e)xr(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n==`object`&&n&&ae in n&&xr(n)}}}function xr(e,t=new Set){if(typeof e==`object`&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{xr(e[n],t)}catch{}let n=l(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let t=o(n);for(let n in t){let r=t[n].get;if(r)try{r.call(e)}catch{}}}}}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var Sr=[`touchstart`,`touchmove`];function Cr(e){return Sr.includes(e)}var wr=Symbol(`events`),Tr=new Set,Er=new Set;function Dr(e,t,n,r={}){function i(e){if(r.capture||Nr.call(t,e),!e.cancelBubble)return ut(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,tt(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function Or(e,t,n,r,i){var a={capture:r,passive:i},o=Dr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&wn(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function kr(e,t,n){(t[wr]??={})[e]=n}function Ar(e){for(var t=0;t<e.length;t++)Tr.add(e[t]);for(var n of Er)n(e)}var jr=null,Mr=!1;function Nr(e){var t=this,n=t.ownerDocument,r=e.type,a=e.composedPath?.()||[],o=a[0]||e.target;jr=e,Mr||(Mr=!0,setTimeout(()=>{Mr=!1,jr=null}));var s=0,c=jr===e&&e[wr];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[wr]=t;return}var u=a.indexOf(t);if(u===-1)return;l<=u&&(s=l)}if(o=a[s]||e.target,o!==t){i(e,`currentTarget`,{configurable:!0,get(){return o||n}});var d=qn,f=Xn;Yn(null),Zn(null);try{for(var p,m=[];o!==null&&o!==t;){try{var h=o[wr]?.[r];h!=null&&(!o.disabled||e.target===o)&&h.call(o,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble)break;s++,o=s<a.length?a[s]:null}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[wr]=t,delete e.currentTarget,Yn(d),Zn(f)}}}var Pr=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Fr(e){return Pr?.createHTML(e)??e}function Ir(e){var t=gn(`template`);return t.innerHTML=Fr(e.replaceAll(`<!>`,`<!---->`)),t.content}function Lr(e,t){var n=Xn;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function P(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(`<!>`);return()=>{if(Se)return Lr(we,null),we;i===void 0&&(i=Ir(a?e:`<!>`+e),n||(i=fn(i)));var t=r||sn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=fn(t),s=t.lastChild;Lr(o,s)}else Lr(t,t);return t}}function Rr(e=``){if(!Se){var t=dn(e+``);return Lr(t,t),t}var n=we;return n.nodeType===3?_n(n):(n.before(n=dn()),Te(n)),Lr(n,n),n}function zr(){if(Se)return Lr(we,null),we;var e=document.createDocumentFragment(),t=document.createComment(``),n=dn();return e.append(t,n),Lr(t,n),e}function F(e,t){if(Se){var n=Xn;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=we),Ee()}else e!==null&&e.before(t)}function Br(e){let t=0,n=qt(0),r;return()=>{Cn()&&(N(n),An(()=>(t===0&&(r=yr(()=>e(()=>en(n)))),t+=1,()=>{tt(()=>{--t,t===0&&(r?.(),r=void 0,en(n))})})))}}var Vr=S|ee;function Hr(e,t,n,r){new Ur(e,t,n,r)}var Ur=class{parent;is_pending=!1;transform_error;#e;#t=Se?we:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Br(()=>(this.#m=qt(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=Xn;t.b=this,t.f|=128,n(e)},this.parent=Xn.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=jn(()=>{if(Se){let e=ke(this.#t);Ee();let t=e===`[!`;if(e.startsWith(`[?`)){let t=JSON.parse(e.slice(2));this.#_(t)}else t?this.#b():this.#g()}else this.#x()},Vr),Se&&(this.#e=we)}#g(){try{this.#a=Mn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);tt(r),t&&(this.#s=Mn(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{this.#y()||(t?xe():(t=!0,n&&Ue(),this.#s!==null&&zn(this.#s,()=>{this.#s=null}),this.#C(()=>{this.#x()})))};return{reset:r,invoke_onerror:()=>{if(!this.#y())try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){yn(e,this.#i&&this.#i.parent)}}}}#y(){return(this.#i.f&(y|x))!==0}#b(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=Mn(()=>e(this.#e)),tt(()=>{if(!this.#y()){var e=this.#c=document.createDocumentFragment(),t=dn(),n=!1;e.append(t),this.#a=this.#C(()=>{try{return Mn(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){yn(e,this.#i.parent)}return null}}),this.#a===null?(this.#c=null,n&&this.#S(Et)):this.#u===0&&(this.#e.before(e),this.#c=null,zn(this.#o,()=>{this.#o=null}),this.#S(Et))}}))}#x(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=Mn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Un(this.#a,e);let t=this.#n.pending;this.#o=Mn(()=>t(this.#e))}else this.#S(Et)}catch(e){this.error(e)}}#S(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){ot(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#C(e){var t=Xn,n=qn,r=qe;Zn(this.#i),Yn(this.#i),Je(this.#i.ctx);try{return It.ensure(),e()}finally{Zn(t),Yn(n),Je(r)}}#w(e,t){this.has_pending_snippet()?(this.#u+=e,this.#u===0&&(this.#S(t),this.#o&&zn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))):this.parent&&this.parent.#w(e,t)}update_pending_count(e,t){this.#w(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,tt(()=>{this.#d=!1,this.#m&&Qt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),N(this.#m)}error(e){if(e===he||!this.#n.onerror&&!this.#n.failed)throw e;Et?.is_fork?(this.#a&&Et.skip_effect(this.#a),this.#o&&Et.skip_effect(this.#o),this.#s&&Et.skip_effect(this.#s),Et.oncommit(()=>{this.#y()||this.#T(e)})):this.#T(e)}#T(e){this.#a&&=(In(this.#a),null),this.#o&&=(In(this.#o),null),this.#s&&=(In(this.#s),null),Se&&(Te(this.#t),De(),Te(Oe()));let t=this.#n.failed,n=e=>{if(this.#y())return;let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&!this.#y()&&(this.#s=this.#C(()=>{try{return Mn(()=>{var r=Xn;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return yn(e,this.#i.parent),null}}))};tt(()=>{if(!this.#y()){var t;try{t=this.transform_error(e)}catch(e){yn(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>yn(e,this.#i&&this.#i.parent)):n(t)}})}};function I(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[de]??=e.nodeValue)&&(e[de]=n,e.nodeValue=`${n}`)}function Wr(e,t){return Kr(e,t)}var Gr=new Map;function Kr(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){un();var l=void 0,u=Dn(()=>{var s=n??t.appendChild(dn());Hr(s,{pending:()=>{}},t=>{Ye({});var n=qe;if(o&&(n.c=o),a&&(i.$$events=a),Se&&Lr(t,null),l=e(t,i)||Ze(),Se&&(Xn.nodes.end=we,we===null||we.nodeType!==8||we.data!==`]`))throw ye(),he;Xe()},c);var u=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=Cr(r);for(let e of[t,document]){var a=Gr.get(e);a===void 0&&(a=new Map,Gr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Nr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(r(Tr)),Er.add(d),()=>{for(var e of u)for(let n of[t,document]){var r=Gr.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Nr),r.delete(e),r.size===0&&Gr.delete(n)):r.set(e,i)}Er.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return qr.set(l,u),l}var qr=new WeakMap,Jr=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Vn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(Vn(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(In(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Un(r,t),t.append(dn()),this.#n.set(e,{effect:r,fragment:t})}else In(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),zn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(In(n.effect),this.#n.delete(e))};ensure(e,t){var n=Et,r=hn();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=dn();i.append(a),this.#n.set(e,{effect:Mn(()=>t(a)),fragment:i})}else this.#t.set(e,Mn(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else Se&&(this.anchor=we),this.#a(n)}};function L(e,t,n=!1){var r;Se&&(r=we,Ee());var i=new Jr(e),a=n?S:0;function o(e,t){if(Se){var n=ke(r);if(e!==parseInt(n.substring(1))){var a=Oe();Te(a),i.anchor=a,Ce(!1),i.ensure(e,t),Ce(!0);return}}i.ensure(e,t)}jn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Yr(e,t){return t}function Xr(e,t,n){for(var i=[],a=t.length,o,s=t.length,c=0;c<a;c++){let n=t[c];zn(n,()=>{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;Zr(e,r(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else--s},!1)}if(s===0){var l=i.length===0&&n!==null&&e.pending.size===0;if(l){var u=n,d=u.parentNode;mn(d),d.append(u),e.items.clear()}Zr(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function Zr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=ne,Un(a,document.createDocumentFragment())):In(t[i],n)}}var Qr;function $r(t,n,i,a,o,s=null){var c=t,l=new Map;if(n&4){var u=t;c=Se?Te(fn(u)):u.appendChild(dn())}Se&&Ee();var d=null,f=yt(()=>{var t=i();return e(t)?t:t==null?[]:r(t)}),p=new Map,m=!0;function h(e){if(!(_.effect.f&16384)){_.pending.delete(e);var t=N(f);_.fallback=d,ti(_,t,c,n,a),d!==null&&(t.length===0?d.f&33554432?(d.f^=ne,ri(d,null,c)):Vn(d):zn(d,()=>{d=null}))}}function g(e){_.pending.delete(e)}var _={effect:jn(()=>{var e=N(f),t=e.length;let r=!1;Se&&ke(c)===`[!`!=(t===0)&&(c=Oe(),Te(c),Ce(!1),r=!0);for(var u=new Set,_=Et,v=hn(),y=0;y<t;y+=1){Se&&we.nodeType===8&&we.data===`]`&&(c=we,r=!0,Ce(!1));var b=e[y],x=a(b,y),S=m?null:l.get(x);S?(S.v&&Qt(S.v,b),S.i&&Qt(S.i,y),v&&_.unskip_effect(S.e)):(S=ni(l,m?c:Qr??=dn(),b,x,y,o,n,i),m||(S.e.f|=ne),l.set(x,S)),u.add(x)}if(t===0&&s&&!d&&(m?d=Mn(()=>s(c)):(d=Mn(()=>s(Qr??=dn())),d.f|=ne)),t>u.size&&Pe(``,``,``),Se&&t>0&&Te(Oe()),!m){if(p.set(_,u),v){for(let[e,t]of l)u.has(e)||_.skip_effect(t.e);_.oncommit(h),_.ondiscard(g)}else h(_)}r&&Ce(!0),N(f)}),flags:n,items:l,pending:p,outrogroups:null,fallback:d};m=!1,Se&&(c=we)}function ei(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function ti(e,t,n,i,a){var o=!!(i&8),s=t.length,c=e.items,l=ei(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v<s;v+=1)h=t[v],g=a(h,v),_=c.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<s;v+=1){if(h=t[v],g=a(h,v),_=c.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(Vn(_),o&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432){if(_.f^=ne,_===l)ri(_,null,n);else{var y=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),ii(e,d,_),ii(e,_,y),ri(_,y,n),d=_,p=[],m=[],l=ei(d.next);continue}}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var b=m[0],x;d=b.prev;var S=p[0],ee=p[p.length-1];for(x=0;x<p.length;x+=1)ri(p[x],b,n);for(x=0;x<m.length;x+=1)u.delete(m[x]);ii(e,S.prev,ee.next),ii(e,d,S),ii(e,ee,b),l=b,d=ee,--v,p=[],m=[]}else u.delete(_),ri(_,l,n),ii(e,_.prev,_.next),ii(e,_,d===null?e.effect.first:d.next),ii(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;)(u??=new Set).add(l),m.push(l),l=ei(l.next);if(l===null)continue}_.f&33554432||p.push(_),d=_,l=ei(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Zr(e,r(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var te=[];if(u!==void 0)for(_ of u)_.f&8192||te.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&te.push(l),l=ei(l.next);var C=te.length;if(C>0){var re=i&4&&s===0?n:null;if(o){for(v=0;v<C;v+=1)te[v].nodes?.a?.measure();for(v=0;v<C;v+=1)te[v].nodes?.a?.fix()}Xr(e,te,re)}}o&&tt(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function ni(e,t,n,r,i,a,o,s){var c=o&1?o&16?qt(n):Yt(n,!1,!1):null,l=o&2?qt(i):null;return{v:c,i:l,e:Mn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function ri(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=pn(r);if(a.before(r),r===i)return;r=o}}function ii(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function ai(e,t,n){On(()=>{var r=yr(()=>t(e,n?.())||{});if(n&&r?.update){var i=!1,a={};An(()=>{var e=n();br(e),i&&je(a,e)&&(a=e,r.update(e))}),i=!0}if(r?.destroy)return()=>r.destroy()})}var oi=[...`
2
+ \r\f\xA0\v`];function si(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||oi.includes(r[o-1]))&&(s===r.length||oi.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function ci(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function li(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function ui(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(li)),i&&c.push(...Object.keys(i).map(li));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=li(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=ci(r)),i&&(n+=ci(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function di(e,t,n,r,i,a){var o=e[le];if(Se||o!==n||o===void 0){var s=si(n,r,a);(!Se||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[le]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function fi(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function pi(e,t,n,r){var i=e[ue];if(Se||i!==t){var a=ui(t,r);(!Se||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[ue]=t}else r&&(Array.isArray(r)?(fi(e,n?.[0],r[0]),fi(e,n?.[1],r[1],`important`)):fi(e,n,r));return r}function mi(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function hi(t,n){var r=t.__defaultValue,i=t.multiple,a=i?r??[]:null;if(!i||e(a)){var o=t.selectedIndex,s=n&&i?new Set(t.selectedOptions):null;for(var c of t.options){var l=yi(c);mi(c,i?a.includes(l):an(l,r))}if(n){if(s!==null)for(c of t.options){var u=s.has(c);c.selected!==u&&(c.selected=u)}else t.selectedIndex!==o&&(t.selectedIndex=o)}}}function gi(t,n,r=!1){if(t.multiple){if(n==null)return;if(!e(n))return be();for(var i of t.options)i.selected=n.includes(yi(i))}else{for(i of t.options)if(an(yi(i),n)){i.selected=!0;return}(!r||n!==void 0)&&(t.selectedIndex=-1)}}function _i(e){var t=new MutationObserver(t=>{t.every(bi)||(`__defaultValue`in e&&hi(e,!1),`__value`in e&&gi(e,e.__value))});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),wn(()=>{t.disconnect()})}function vi(e,t,n=t){var r=new WeakSet,i=!0;dt(e,`change`,t=>{var i=t?`[selected]`:`:checked`,a;if(e.multiple)a=[].map.call(e.querySelectorAll(i),yi);else{var o=e.querySelector(i)??e.querySelector(`option:not([disabled])`);a=o&&yi(o)}n(a),e.__value=a,Et!==null&&r.add(Et)}),On(()=>{var a=t();if(e===document.activeElement){var o=Et;if(r.has(o))return}if(gi(e,a,i),i&&a===void 0){var s=e.querySelector(`:checked`);s!==null&&(a=yi(s),n(a))}e.__value=a,i=!1})}function yi(e){return`__value`in e?e.__value:e.value}function bi(e){if(e.target.closest(`selectedcontent`)!==null)return!0;if(e.type===`childList`){var t=[...e.addedNodes,...e.removedNodes];return t.length>0&&t.every(e=>e.nodeName===`SELECTEDCONTENT`)}return!1}var xi=Symbol(`is custom element`),Si=Symbol(`is html`),Ci=me?`link`:`LINK`;function wi(e){if(Se){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Ti(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Ti(e,`checked`,null),e.checked=r}}};e[fe]=n,tt(n),lt()}}function Ti(e,t,n,r){var i=Ei(e);Se&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Ci)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[se]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&Oi(e).has(t)?e[t]=n:e.setAttribute(t,n))}function Ei(e){return e[ce]??={[xi]:e.nodeName.includes(`-`),[Si]:e.namespaceURI===_e}}var Di=new Map;function Oi(e){var t=e.getAttribute(`is`)||e.nodeName,n=Di.get(t);if(n)return n;Di.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var s in r=o(i),r)r[s].set&&s!==`innerHTML`&&s!==`textContent`&&s!==`innerText`&&n.add(s);i=l(i)}return n}function ki(e,t,n=t){var r=new WeakSet;dt(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=Pi(e)?Fi(a):a,n(a),Et!==null&&r.add(Et),await gr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(Se&&e.defaultValue!==e.value||yr(t)==null&&e.value)&&(n(Pi(e)?Fi(e.value):e.value),Et!==null&&r.add(Et)),An(()=>{var n=t();if(e===document.activeElement){var i=Et;if(r.has(i))return}Pi(e)&&n===Fi(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}var Ai=new Set;function ji(e,t,n,r,i=r){var a=n.getAttribute(`type`)===`checkbox`,o=e;let s=!1;if(t!==null)for(var c of t)o=o[c]??=[];o.push(n),dt(n,`change`,()=>{var e=n.__value;a&&(e=Ni(o,e,n.checked)),i(e)},()=>i(a?[]:null)),An(()=>{var e=r();Se&&n.defaultChecked!==n.checked?s=!0:a?(e||=[],n.checked=e.includes(n.__value)):n.checked=an(n.__value,e)}),wn(()=>{var e=o.indexOf(n);e!==-1&&o.splice(e,1)}),Ai.has(o)||(Ai.add(o),tt(()=>{o.sort((e,t)=>e.compareDocumentPosition(t)===4?-1:1),Ai.delete(o)})),tt(()=>{if(s){var e=a?Ni(o,e,n.checked):o.find(e=>e.checked)?.__value;i(e)}})}function Mi(e,t,n=t){dt(e,`change`,t=>{n(t?e.defaultChecked:e.checked)}),(Se&&e.defaultChecked!==e.checked||yr(t)==null)&&n(e.checked),An(()=>{e.checked=!!t()})}function Ni(e,t,n){for(var r=new Set,i=0;i<e.length;i+=1)e[i].checked&&r.add(e[i].__value);return n||r.delete(t),Array.from(r)}function Pi(e){var t=e.type;return t===`number`||t===`range`}function Fi(e){return e===``?null:+e}function Ii(e,t){return e===t||e?.[ae]===t}function Li(e=Ze(),t,n,r){var i=qe.r,a=Xn;return On(()=>{var o,s;return An(()=>{o=s,s=r?.()||[],yr(()=>{Ii(n(...s),e)||(t(e,...s),o&&Ii(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&Ii(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function Ri(e,t,n,r,i){var a=()=>{r(n[e])};n.addEventListener(t,a),i?An(()=>{n[e]=i()}):a(),(n===document.body||n===window||n===document)&&wn(()=>{n.removeEventListener(t,a)})}var zi=!1;function Bi(e){var t=zi;try{return zi=!1,[e(),zi]}finally{zi=t}}function Vi(e,t,n,r){var i=!0,o=!!(n&8),s=!!(n&16),c=r,l=!0,u=void 0,d=()=>s&&i?(u??=gt(r),N(u)):(l&&(l=!1,c=s?yr(r):r),c);let f;if(o){var p=ae in e||oe in e;f=a(e,t)?.set??(p&&t in e?n=>e[t]=n:void 0)}var m,h=!1;o?[m,h]=Bi(()=>e[t]):m=e[t],m===void 0&&r!==void 0&&(m=d(),f&&(i&&ze(t),f(m)));var g=i?()=>{var n=e[t];return n===void 0?d():(l=!0,n)}:()=>{var n=e[t];return n!==void 0&&(c=void 0),n===void 0?c:n};if(i&&!(n&4))return g;if(f){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||h)&&f(t?g():e),e):g()})}var v=!1,y=(n&1?gt:yt)(()=>(v=!1,g()));o&&N(y);var b=Xn;return(function(e,t){if(arguments.length>0){let n=t?N(y):i&&o?nn(e):e;return D(y,n),v=!0,c!==void 0&&(c=n),e}return Gn&&v||b.f&16384?y.v:N(y)})}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var Hi=new Map;function Ui(){let e=new URLSearchParams(location.search).get(`audit`);if(!e)return null;let t;try{t=new URL(e,location.href)}catch{return{error:`not an address: ${e}`}}let n=t.protocol===`http:`&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname);return t.protocol!==`https:`&&!n?{error:`an audit must be at an https address: ${e}`}:(t.search=``,t.hash=``,/\.(json|html?)$/i.test(t.pathname)?t.pathname=t.pathname.replace(/[^/]*$/,``):t.pathname.endsWith(`/`)||(t.pathname+=`/`),{href:t.href})}var Wi=Ui();function Gi(e){if(!Wi?.href)return e;if(!Ki(e))throw Error(`${e}: outside the audit's directory`);return new URL(e,Wi.href).href}function Ki(e){return typeof e==`string`&&e&&!/^[a-z][\w+.-]*:|^\/|(^|\/)\.\.(\/|$)/i.test(e)}async function qi(e){let t=window.__PROOFLENS__;if(t){if(!(e in t))throw Error(`${e}: not in this bundle`);return t[e]}return Hi.has(e)||Hi.set(e,Promise.resolve().then(()=>fetch(Gi(e),Wi?{credentials:`omit`,referrerPolicy:`no-referrer`}:{}).then(t=>{if(!t.ok)throw Error(`${e}: ${t.status}`);return t.json()}))),Hi.get(e)}var Ji=null,Yi=null;async function Xi(){return Yi=await Zi(),Yi}async function Zi(){if(!Wi)return qi(`data/index.json`);if(Wi.error)throw Error(Wi.error);let e=await qi(`audit.json`);if(!e||typeof e!=`object`||!String(e.schema||``).startsWith(`machinechecked/audit@`))throw Error(`audit.json is not a MachineChecked audit descriptor`);if(!Ki(e.data))throw Error(`audit.json names its data outside its directory`);return Ji=e,qi(e.data)}async function Qi(){if(window.__PROOFLENS__||Wi)return!1;try{let e=await fetch(`api/status`);return e.ok&&(await e.json()).editable===!0}catch{return!1}}async function $i(e){let t=await fetch(`api/link`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw Error(n.error||t.statusText);return n}function ea(e){return qi(e.lean_index||`data/lean-index.json`)}function ta(e){return qi(e.search||`data/search.json`)}function na(e,t){let n=e.claims.find(e=>e.id===t);return n?qi(`data/claims/${n.file}`):Promise.reject(Error(`no claim ${t} in release ${e.release}`))}function ra(e){return qi(`data/decls/${e}.json`)}var ia=[`accepted`,`proved`,`refuted`,`open`,`unspecified`,`malformed`,`out-of-scope`];function aa(e){return e.scope!==void 0&&!String(e.status).startsWith(`out of scope`)&&e.class!==`accepted`}function oa(e){return qi(e.review_queue)}function sa(e){let t=e.replace(/^#\/?/,``).split(`/`).map(decodeURIComponent),n=null;t[0]===`r`&&t.length>1&&(n=t[1],t=t.slice(2));let[r,...i]=t;return r===`read`?{release:n,view:`read`,paper:i[0],claim:i.slice(1).join(`/`)||null}:r===`claim`?{release:n,view:`claim`,claim:i.join(`/`)}:r===`changes`?{release:n,view:`changes`}:r===`review`?{release:n,view:`review`}:r===`overview`||r===`coverage`?{release:n,view:`coverage`}:{release:n,view:`read`,paper:null,claim:null}}var ca=nn(sa(location.hash));window.addEventListener(`hashchange`,()=>Object.assign(ca,{paper:null,claim:null},sa(location.hash)));function la(e,t,...n){let r=n.filter(e=>e!=null&&e!==``).map(encodeURIComponent).join(`/`),i=(t===`coverage`?`overview`:t)+(r?`/`+r:``);return`#/r/${encodeURIComponent(e)}/${i}`}function ua(e){location.hash!==e&&(location.hash=e)}var da=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},fa=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,da.range(this,t))}},R=class e{constructor(t,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}var d=Error(r);return d.name=`ParseError`,d.__proto__=e.prototype,d.position=i,i!=null&&a!=null&&(d.length=a-i),d.rawMessage=t,d}};R.prototype.__proto__=Error.prototype;var pa=function(e,t){return e.indexOf(t)!==-1},ma=function(e,t){return e===void 0?t:e},ha=/([A-Z])/g,ga=function(e){return e.replace(ha,`-$1`).toLowerCase()},_a={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},va=/[&><"']/g;function ya(e){return String(e).replace(va,e=>_a[e])}var ba=function e(t){return t.type===`ordgroup`||t.type===`color`?t.body.length===1?e(t.body[0]):t:t.type===`font`?e(t.body):t},xa=function(e){var t=ba(e);return t.type===`mathord`||t.type===`textord`||t.type===`atom`},Sa=function(e){if(!e)throw Error(`Expected non-null, but got `+String(e));return e},Ca={contains:pa,deflt:ma,escape:ya,hyphenate:ga,getBaseElem:ba,isCharacterBox:xa,protocolFromUrl:function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`}},wa={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function Ta(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if(typeof n!=`string`)return n.enum[0];switch(n){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{}}}var Ea=class{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={},wa)if(wa.hasOwnProperty(t)){var n=wa[t];this[t]=e[t]===void 0?Ta(n):n.processor?n.processor(e[t]):e[t]}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),r&&r!==`ignore`){if(r===!0||r===`error`)throw new R(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(e.url&&!e.protocol){var t=Ca.protocolFromUrl(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},Da=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Ia[La[this.id]]}sub(){return Ia[Ra[this.id]]}fracNum(){return Ia[za[this.id]]}fracDen(){return Ia[Ba[this.id]]}cramp(){return Ia[Va[this.id]]}text(){return Ia[Ha[this.id]]}isTight(){return this.size>=2}},Oa=0,ka=1,Aa=2,ja=3,Ma=4,Na=5,Pa=6,Fa=7,Ia=[new Da(Oa,0,!1),new Da(ka,0,!0),new Da(Aa,1,!1),new Da(ja,1,!0),new Da(Ma,2,!1),new Da(Na,2,!0),new Da(Pa,3,!1),new Da(Fa,3,!0)],La=[Ma,Na,Ma,Na,Pa,Fa,Pa,Fa],Ra=[Na,Na,Na,Na,Fa,Fa,Fa,Fa],za=[Aa,ja,Ma,Na,Pa,Fa,Pa,Fa],Ba=[ja,ja,Na,Na,Fa,Fa,Fa,Fa],Va=[ka,ka,ja,ja,Na,Na,Fa,Fa],Ha=[Oa,ka,Aa,ja,Aa,ja,Aa,ja],Ua={DISPLAY:Ia[Oa],TEXT:Ia[Aa],SCRIPT:Ia[Ma],SCRIPTSCRIPT:Ia[Pa]},Wa=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function Ga(e){for(var t=0;t<Wa.length;t++)for(var n=Wa[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var Ka=[];Wa.forEach(e=>e.blocks.forEach(e=>Ka.push(...e)));function qa(e){for(var t=0;t<Ka.length;t+=2)if(e>=Ka[t]&&e<=Ka[t+1])return!0;return!1}var Ja=80,Ya=function(e,t){return`M95,`+(622+e+t)+`
3
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
4
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
5
+ c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
6
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
7
+ c69,-144,104.5,-217.7,106.5,-221
8
+ l`+e/2.075+` -`+e+`
9
+ c5.3,-9.3,12,-14,20,-14
10
+ H400000v`+(40+e)+`H845.2724
11
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
12
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
13
+ M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Xa=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119
14
+ c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
15
+ c340,-704.7,510.7,-1060.3,512,-1067
16
+ l`+e/2.084+` -`+e+`
17
+ c4.7,-7.3,11,-11,19,-11
18
+ H40000v`+(40+e)+`H1012.3
19
+ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
20
+ c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
21
+ s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
22
+ c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
23
+ M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Za=function(e,t){return`M983 `+(10+e+t)+`
24
+ l`+e/3.13+` -`+e+`
25
+ c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
26
+ H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
27
+ s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
28
+ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
29
+ c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
30
+ c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
31
+ c53.7,-170.3,84.5,-266.8,92.5,-289.5z
32
+ M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Qa=function(e,t){return`M424,`+(2398+e+t)+`
33
+ c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
34
+ c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
35
+ s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
36
+ s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
37
+ l`+e/4.223+` -`+e+`c4,-6.7,10,-10,18,-10 H400000
38
+ v`+(40+e)+`H1014.6
39
+ s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
40
+ c-2,6,-10,9,-24,9
41
+ c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+`
42
+ h400000v`+(40+e)+`h-400000z`},$a=function(e,t){return`M473,`+(2713+e+t)+`
43
+ c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+`
44
+ c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
45
+ s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
46
+ c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
47
+ c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
48
+ s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
49
+ 606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},eo=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},to=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`
50
+ H742v`+r+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
51
+ h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
52
+ c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
53
+ 219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},no=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=Ya(t,Ja);break;case`sqrtSize1`:r=Xa(t,Ja);break;case`sqrtSize2`:r=Za(t,Ja);break;case`sqrtSize3`:r=Qa(t,Ja);break;case`sqrtSize4`:r=$a(t,Ja);break;case`sqrtTall`:r=to(t,Ja,n)}return r},ro=function(e,t){switch(e){case`⎜`:return`M291 0 H417 V`+t+` H291z M291 0 H417 V`+t+` H291z`;case`∣`:return`M145 0 H188 V`+t+` H145z M145 0 H188 V`+t+` H145z`;case`∥`:return`M145 0 H188 V`+t+` H145z M145 0 H188 V`+t+` H145z`+(`M367 0 H410 V`+t+` H367z M367 0 H410 V`+t+` H367z`);case`⎟`:return`M457 0 H583 V`+t+` H457z M457 0 H583 V`+t+` H457z`;case`⎢`:return`M319 0 H403 V`+t+` H319z M319 0 H403 V`+t+` H319z`;case`⎥`:return`M263 0 H347 V`+t+` H263z M263 0 H347 V`+t+` H263z`;case`⎪`:return`M384 0 H504 V`+t+` H384z M384 0 H504 V`+t+` H384z`;case`⏐`:return`M312 0 H355 V`+t+` H312z M312 0 H355 V`+t+` H312z`;case`‖`:return`M257 0 H300 V`+t+` H257z M257 0 H300 V`+t+` H257z`+(`M478 0 H521 V`+t+` H478z M478 0 H521 V`+t+` H478z`);default:return``}},io={doubleleftarrow:`M262 157
54
+ l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
55
+ 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
56
+ 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
57
+ c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
58
+ 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
59
+ -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
60
+ -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
61
+ m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
62
+ -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
63
+ 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
64
+ -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
65
+ -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
66
+ -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
67
+ c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
68
+ -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
69
+ 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
70
+ -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
71
+ c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
72
+ 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
73
+ 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
74
+ l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
75
+ -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
76
+ 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
77
+ 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
78
+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
79
+ -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
80
+ H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
81
+ 435 0h399565z`,leftgroupunder:`M400000 262
82
+ H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
83
+ 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
84
+ -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
85
+ -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
86
+ -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
87
+ 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
88
+ -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
89
+ -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
90
+ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
91
+ 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
92
+ 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
93
+ -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
94
+ 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
95
+ -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
96
+ v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
97
+ -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
98
+ -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
99
+ 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
100
+ M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
101
+ M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
102
+ -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
103
+ c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
104
+ 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
105
+ M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
106
+ c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
107
+ -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
108
+ 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
109
+ 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
110
+ c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
111
+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
112
+ 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
113
+ -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
114
+ -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
115
+ m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
116
+ 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
117
+ -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
118
+ m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
119
+ c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
120
+ -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
121
+ m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
122
+ 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
123
+ -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
124
+ m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
125
+ c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
126
+ -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
127
+ 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
128
+ 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
129
+ -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
130
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
131
+ 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
132
+ -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
133
+ s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
134
+ c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
135
+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
136
+ -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
137
+ 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
138
+ 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
139
+ -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
140
+ -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
141
+ 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
142
+ -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
143
+ 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
144
+ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
145
+ 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
146
+ -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
147
+ -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
148
+ 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
149
+ 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
150
+ -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
151
+ m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
152
+ 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
153
+ -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
154
+ 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
155
+ M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
156
+ 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
157
+ -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
158
+ -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
159
+ 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
160
+ -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
161
+ -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
162
+ -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
163
+ 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
164
+ c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
165
+ 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
166
+ 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
167
+ -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
168
+ 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
169
+ -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
170
+ 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
171
+ 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
172
+ -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
173
+ -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
174
+ 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
175
+ c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
176
+ 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
177
+ -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
178
+ 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
179
+ 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
180
+ -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
181
+ -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
182
+ 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
183
+ 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
184
+ -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
185
+ 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
186
+ 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
187
+ -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
188
+ -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
189
+ H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
190
+ c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
191
+ c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
192
+ -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
193
+ -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
194
+ -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
195
+ -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
196
+ -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
197
+ -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
198
+ -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
199
+ c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
200
+ c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
201
+ s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
202
+ 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
203
+ s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
204
+ c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
205
+ M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
206
+ -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
207
+ 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
208
+ -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
209
+ -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
210
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
211
+ 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
212
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
213
+ c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
214
+ c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
215
+ c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
216
+ M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
217
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
218
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
219
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
220
+ M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
221
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
222
+ 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
223
+ -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
224
+ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
225
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
226
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
227
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
228
+ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},ao=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 h347 v-84
229
+ H403z M403 1759 V0 H319 V1759 v`+t+` v1759 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z
230
+ M347 1759 V0 H263 V1759 v`+t+` v1759 h84z`;case`vert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
231
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
232
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z`;case`doublevert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
233
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
234
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
235
+ M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
236
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
237
+ c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+` v585 h43z`;case`lfloor`:return`M319 602 V0 H403 V602 v`+t+` v1715 h263 v84 H319z
238
+ MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`rfloor`:return`M319 602 V0 H403 V602 v`+t+` v1799 H0 v-84 H319z
239
+ MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`lceil`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v602 h84z
240
+ M403 1759 V0 H319 V1759 v`+t+` v602 h84z`;case`rceil`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v602 h84z
241
+ M347 1759 V0 h-84 V1759 v`+t+` v602 h84z`;case`lparen`:return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
242
+ c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
243
+ -36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
244
+ 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
245
+ c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
246
+ -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
247
+ l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
248
+ -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case`rparen`:return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
249
+ 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
250
+ c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
251
+ c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
252
+ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
253
+ c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
254
+ c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
255
+ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
256
+ -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}},oo=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Ca.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e=``,t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>e.toText()).join(``)}},so={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},co={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},lo={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`};function uo(e,t){so[e]=t}function fo(e,t,n){if(!so[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=so[t][r];if(!i&&e[0]in lo&&(r=lo[e[0]].charCodeAt(0),i=so[t][r]),!i&&n===`text`&&qa(r)&&(i=so[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var po={};function mo(e){var t=e>=5?0:e>=3?1:2;if(!po[t]){var n=po[t]={cssEmPerMu:co.quad[t]/18};for(var r in co)co.hasOwnProperty(r)&&(n[r]=co[r][t])}return po[t]}var ho=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],go=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],_o=function(e,t){return t.size<2?e:ho[e-1][t.size-1]},vo=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=go[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:_o(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:go[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=_o(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=mo(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};vo.BASESIZE=6;var yo={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},bo={ex:!0,em:!0,mu:!0},xo=function(e){return typeof e!=`string`&&(e=e.unit),e in yo||e in bo||e===`ex`},So=function(e,t){var n;if(e.unit in yo)n=yo[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new R(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},z=function(e){return+e.toFixed(4)+`em`},Co=function(e){return e.filter(e=>e).join(` `)},wo=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},To=function(e){var t=document.createElement(e);for(var n in t.className=Co(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&t.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t},Eo=/[\s"'>/=\x00-\x1f]/,Do=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+Ca.escape(Co(this.classes))+`"`);var n=``;for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=Ca.hyphenate(r)+`:`+this.style[r]+`;`);for(var i in n&&(t+=` style="`+Ca.escape(n)+`"`),this.attributes)if(this.attributes.hasOwnProperty(i)){if(Eo.test(i))throw new R(`Invalid attribute name '`+i+`'`);t+=` `+i+`="`+Ca.escape(this.attributes[i])+`"`}t+=`>`;for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+=`</`+e+`>`,t},Oo=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,wo.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Ca.contains(this.classes,e)}toNode(){return To.call(this,`span`)}toMarkup(){return Do.call(this,`span`)}},ko=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,wo.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Ca.contains(this.classes,e)}toNode(){return To.call(this,`a`)}toMarkup(){return Do.call(this,`a`)}},Ao=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.style=n}hasClass(e){return Ca.contains(this.classes,e)}toNode(){var e=document.createElement(`img`);for(var t in e.src=this.src,e.alt=this.alt,e.className=`mord`,this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e=`<img src="`+Ca.escape(this.src)+`"`+(` alt="`+Ca.escape(this.alt)+`"`),t=``;for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=Ca.hyphenate(n)+`:`+this.style[n]+`;`);return t&&(e+=` style="`+Ca.escape(t)+`"`),e+=`'/>`,e}},jo={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},Mo=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=Ga(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=jo[this.text])}hasClass(e){return Ca.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;for(var n in this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=z(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=Co(this.classes)),this.style)this.style.hasOwnProperty(n)&&(t||=document.createElement(`span`),t.style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=Ca.escape(Co(this.classes)),t+=`"`);var n=``;for(var r in this.italic>0&&(n+=`margin-right:`+this.italic+`em;`),this.style)this.style.hasOwnProperty(r)&&(n+=Ca.hyphenate(r)+`:`+this.style[r]+`;`);n&&(e=!0,t+=` style="`+Ca.escape(n)+`"`);var i=Ca.escape(this.text);return e?(t+=`>`,t+=i,t+=`</span>`,t):i}},No=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<svg xmlns="http://www.w3.org/2000/svg"`;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=` `+t+`="`+Ca.escape(this.attributes[t])+`"`);e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},Po=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,io[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+Ca.escape(this.alternate)+`"/>`:`<path d="`+Ca.escape(io[this.pathName])+`"/>`}},Fo=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=`<line`;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=` `+t+`="`+Ca.escape(this.attributes[t])+`"`);return e+=`/>`,e}};function Io(e){if(e instanceof Mo)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function Lo(e){if(e instanceof Oo)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var Ro={bin:1,close:1,inner:1,open:1,punct:1,rel:1},zo={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Bo={math:{},text:{}};function B(e,t,n,r,i,a){Bo[e][i]={font:t,group:n,replace:r},a&&r&&(Bo[e][r]=Bo[e][i])}var V=`math`,H=`text`,U=`main`,W=`ams`,Vo=`accent-token`,G=`bin`,Ho=`close`,Uo=`inner`,Wo=`mathord`,Go=`op-token`,Ko=`open`,qo=`punct`,K=`rel`,Jo=`spacing`,q=`textord`;B(V,U,K,`≡`,`\\equiv`,!0),B(V,U,K,`≺`,`\\prec`,!0),B(V,U,K,`≻`,`\\succ`,!0),B(V,U,K,`∼`,`\\sim`,!0),B(V,U,K,`⊥`,`\\perp`),B(V,U,K,`⪯`,`\\preceq`,!0),B(V,U,K,`⪰`,`\\succeq`,!0),B(V,U,K,`≃`,`\\simeq`,!0),B(V,U,K,`∣`,`\\mid`,!0),B(V,U,K,`≪`,`\\ll`,!0),B(V,U,K,`≫`,`\\gg`,!0),B(V,U,K,`≍`,`\\asymp`,!0),B(V,U,K,`∥`,`\\parallel`),B(V,U,K,`⋈`,`\\bowtie`,!0),B(V,U,K,`⌣`,`\\smile`,!0),B(V,U,K,`⊑`,`\\sqsubseteq`,!0),B(V,U,K,`⊒`,`\\sqsupseteq`,!0),B(V,U,K,`≐`,`\\doteq`,!0),B(V,U,K,`⌢`,`\\frown`,!0),B(V,U,K,`∋`,`\\ni`,!0),B(V,U,K,`∝`,`\\propto`,!0),B(V,U,K,`⊢`,`\\vdash`,!0),B(V,U,K,`⊣`,`\\dashv`,!0),B(V,U,K,`∋`,`\\owns`),B(V,U,qo,`.`,`\\ldotp`),B(V,U,qo,`⋅`,`\\cdotp`),B(V,U,q,`#`,`\\#`),B(H,U,q,`#`,`\\#`),B(V,U,q,`&`,`\\&`),B(H,U,q,`&`,`\\&`),B(V,U,q,`ℵ`,`\\aleph`,!0),B(V,U,q,`∀`,`\\forall`,!0),B(V,U,q,`ℏ`,`\\hbar`,!0),B(V,U,q,`∃`,`\\exists`,!0),B(V,U,q,`∇`,`\\nabla`,!0),B(V,U,q,`♭`,`\\flat`,!0),B(V,U,q,`ℓ`,`\\ell`,!0),B(V,U,q,`♮`,`\\natural`,!0),B(V,U,q,`♣`,`\\clubsuit`,!0),B(V,U,q,`℘`,`\\wp`,!0),B(V,U,q,`♯`,`\\sharp`,!0),B(V,U,q,`♢`,`\\diamondsuit`,!0),B(V,U,q,`ℜ`,`\\Re`,!0),B(V,U,q,`♡`,`\\heartsuit`,!0),B(V,U,q,`ℑ`,`\\Im`,!0),B(V,U,q,`♠`,`\\spadesuit`,!0),B(V,U,q,`§`,`\\S`,!0),B(H,U,q,`§`,`\\S`),B(V,U,q,`¶`,`\\P`,!0),B(H,U,q,`¶`,`\\P`),B(V,U,q,`†`,`\\dag`),B(H,U,q,`†`,`\\dag`),B(H,U,q,`†`,`\\textdagger`),B(V,U,q,`‡`,`\\ddag`),B(H,U,q,`‡`,`\\ddag`),B(H,U,q,`‡`,`\\textdaggerdbl`),B(V,U,Ho,`⎱`,`\\rmoustache`,!0),B(V,U,Ko,`⎰`,`\\lmoustache`,!0),B(V,U,Ho,`⟯`,`\\rgroup`,!0),B(V,U,Ko,`⟮`,`\\lgroup`,!0),B(V,U,G,`∓`,`\\mp`,!0),B(V,U,G,`⊖`,`\\ominus`,!0),B(V,U,G,`⊎`,`\\uplus`,!0),B(V,U,G,`⊓`,`\\sqcap`,!0),B(V,U,G,`∗`,`\\ast`),B(V,U,G,`⊔`,`\\sqcup`,!0),B(V,U,G,`◯`,`\\bigcirc`,!0),B(V,U,G,`∙`,`\\bullet`,!0),B(V,U,G,`‡`,`\\ddagger`),B(V,U,G,`≀`,`\\wr`,!0),B(V,U,G,`⨿`,`\\amalg`),B(V,U,G,`&`,`\\And`),B(V,U,K,`⟵`,`\\longleftarrow`,!0),B(V,U,K,`⇐`,`\\Leftarrow`,!0),B(V,U,K,`⟸`,`\\Longleftarrow`,!0),B(V,U,K,`⟶`,`\\longrightarrow`,!0),B(V,U,K,`⇒`,`\\Rightarrow`,!0),B(V,U,K,`⟹`,`\\Longrightarrow`,!0),B(V,U,K,`↔`,`\\leftrightarrow`,!0),B(V,U,K,`⟷`,`\\longleftrightarrow`,!0),B(V,U,K,`⇔`,`\\Leftrightarrow`,!0),B(V,U,K,`⟺`,`\\Longleftrightarrow`,!0),B(V,U,K,`↦`,`\\mapsto`,!0),B(V,U,K,`⟼`,`\\longmapsto`,!0),B(V,U,K,`↗`,`\\nearrow`,!0),B(V,U,K,`↩`,`\\hookleftarrow`,!0),B(V,U,K,`↪`,`\\hookrightarrow`,!0),B(V,U,K,`↘`,`\\searrow`,!0),B(V,U,K,`↼`,`\\leftharpoonup`,!0),B(V,U,K,`⇀`,`\\rightharpoonup`,!0),B(V,U,K,`↙`,`\\swarrow`,!0),B(V,U,K,`↽`,`\\leftharpoondown`,!0),B(V,U,K,`⇁`,`\\rightharpoondown`,!0),B(V,U,K,`↖`,`\\nwarrow`,!0),B(V,U,K,`⇌`,`\\rightleftharpoons`,!0),B(V,W,K,`≮`,`\\nless`,!0),B(V,W,K,``,`\\@nleqslant`),B(V,W,K,``,`\\@nleqq`),B(V,W,K,`⪇`,`\\lneq`,!0),B(V,W,K,`≨`,`\\lneqq`,!0),B(V,W,K,``,`\\@lvertneqq`),B(V,W,K,`⋦`,`\\lnsim`,!0),B(V,W,K,`⪉`,`\\lnapprox`,!0),B(V,W,K,`⊀`,`\\nprec`,!0),B(V,W,K,`⋠`,`\\npreceq`,!0),B(V,W,K,`⋨`,`\\precnsim`,!0),B(V,W,K,`⪹`,`\\precnapprox`,!0),B(V,W,K,`≁`,`\\nsim`,!0),B(V,W,K,``,`\\@nshortmid`),B(V,W,K,`∤`,`\\nmid`,!0),B(V,W,K,`⊬`,`\\nvdash`,!0),B(V,W,K,`⊭`,`\\nvDash`,!0),B(V,W,K,`⋪`,`\\ntriangleleft`),B(V,W,K,`⋬`,`\\ntrianglelefteq`,!0),B(V,W,K,`⊊`,`\\subsetneq`,!0),B(V,W,K,``,`\\@varsubsetneq`),B(V,W,K,`⫋`,`\\subsetneqq`,!0),B(V,W,K,``,`\\@varsubsetneqq`),B(V,W,K,`≯`,`\\ngtr`,!0),B(V,W,K,``,`\\@ngeqslant`),B(V,W,K,``,`\\@ngeqq`),B(V,W,K,`⪈`,`\\gneq`,!0),B(V,W,K,`≩`,`\\gneqq`,!0),B(V,W,K,``,`\\@gvertneqq`),B(V,W,K,`⋧`,`\\gnsim`,!0),B(V,W,K,`⪊`,`\\gnapprox`,!0),B(V,W,K,`⊁`,`\\nsucc`,!0),B(V,W,K,`⋡`,`\\nsucceq`,!0),B(V,W,K,`⋩`,`\\succnsim`,!0),B(V,W,K,`⪺`,`\\succnapprox`,!0),B(V,W,K,`≆`,`\\ncong`,!0),B(V,W,K,``,`\\@nshortparallel`),B(V,W,K,`∦`,`\\nparallel`,!0),B(V,W,K,`⊯`,`\\nVDash`,!0),B(V,W,K,`⋫`,`\\ntriangleright`),B(V,W,K,`⋭`,`\\ntrianglerighteq`,!0),B(V,W,K,``,`\\@nsupseteqq`),B(V,W,K,`⊋`,`\\supsetneq`,!0),B(V,W,K,``,`\\@varsupsetneq`),B(V,W,K,`⫌`,`\\supsetneqq`,!0),B(V,W,K,``,`\\@varsupsetneqq`),B(V,W,K,`⊮`,`\\nVdash`,!0),B(V,W,K,`⪵`,`\\precneqq`,!0),B(V,W,K,`⪶`,`\\succneqq`,!0),B(V,W,K,``,`\\@nsubseteqq`),B(V,W,G,`⊴`,`\\unlhd`),B(V,W,G,`⊵`,`\\unrhd`),B(V,W,K,`↚`,`\\nleftarrow`,!0),B(V,W,K,`↛`,`\\nrightarrow`,!0),B(V,W,K,`⇍`,`\\nLeftarrow`,!0),B(V,W,K,`⇏`,`\\nRightarrow`,!0),B(V,W,K,`↮`,`\\nleftrightarrow`,!0),B(V,W,K,`⇎`,`\\nLeftrightarrow`,!0),B(V,W,K,`△`,`\\vartriangle`),B(V,W,q,`ℏ`,`\\hslash`),B(V,W,q,`▽`,`\\triangledown`),B(V,W,q,`◊`,`\\lozenge`),B(V,W,q,`Ⓢ`,`\\circledS`),B(V,W,q,`®`,`\\circledR`),B(H,W,q,`®`,`\\circledR`),B(V,W,q,`∡`,`\\measuredangle`,!0),B(V,W,q,`∄`,`\\nexists`),B(V,W,q,`℧`,`\\mho`),B(V,W,q,`Ⅎ`,`\\Finv`,!0),B(V,W,q,`⅁`,`\\Game`,!0),B(V,W,q,`‵`,`\\backprime`),B(V,W,q,`▲`,`\\blacktriangle`),B(V,W,q,`▼`,`\\blacktriangledown`),B(V,W,q,`■`,`\\blacksquare`),B(V,W,q,`⧫`,`\\blacklozenge`),B(V,W,q,`★`,`\\bigstar`),B(V,W,q,`∢`,`\\sphericalangle`,!0),B(V,W,q,`∁`,`\\complement`,!0),B(V,W,q,`ð`,`\\eth`,!0),B(H,U,q,`ð`,`ð`),B(V,W,q,`╱`,`\\diagup`),B(V,W,q,`╲`,`\\diagdown`),B(V,W,q,`□`,`\\square`),B(V,W,q,`□`,`\\Box`),B(V,W,q,`◊`,`\\Diamond`),B(V,W,q,`¥`,`\\yen`,!0),B(H,W,q,`¥`,`\\yen`,!0),B(V,W,q,`✓`,`\\checkmark`,!0),B(H,W,q,`✓`,`\\checkmark`),B(V,W,q,`ℶ`,`\\beth`,!0),B(V,W,q,`ℸ`,`\\daleth`,!0),B(V,W,q,`ℷ`,`\\gimel`,!0),B(V,W,q,`ϝ`,`\\digamma`,!0),B(V,W,q,`ϰ`,`\\varkappa`),B(V,W,Ko,`┌`,`\\@ulcorner`,!0),B(V,W,Ho,`┐`,`\\@urcorner`,!0),B(V,W,Ko,`└`,`\\@llcorner`,!0),B(V,W,Ho,`┘`,`\\@lrcorner`,!0),B(V,W,K,`≦`,`\\leqq`,!0),B(V,W,K,`⩽`,`\\leqslant`,!0),B(V,W,K,`⪕`,`\\eqslantless`,!0),B(V,W,K,`≲`,`\\lesssim`,!0),B(V,W,K,`⪅`,`\\lessapprox`,!0),B(V,W,K,`≊`,`\\approxeq`,!0),B(V,W,G,`⋖`,`\\lessdot`),B(V,W,K,`⋘`,`\\lll`,!0),B(V,W,K,`≶`,`\\lessgtr`,!0),B(V,W,K,`⋚`,`\\lesseqgtr`,!0),B(V,W,K,`⪋`,`\\lesseqqgtr`,!0),B(V,W,K,`≑`,`\\doteqdot`),B(V,W,K,`≓`,`\\risingdotseq`,!0),B(V,W,K,`≒`,`\\fallingdotseq`,!0),B(V,W,K,`∽`,`\\backsim`,!0),B(V,W,K,`⋍`,`\\backsimeq`,!0),B(V,W,K,`⫅`,`\\subseteqq`,!0),B(V,W,K,`⋐`,`\\Subset`,!0),B(V,W,K,`⊏`,`\\sqsubset`,!0),B(V,W,K,`≼`,`\\preccurlyeq`,!0),B(V,W,K,`⋞`,`\\curlyeqprec`,!0),B(V,W,K,`≾`,`\\precsim`,!0),B(V,W,K,`⪷`,`\\precapprox`,!0),B(V,W,K,`⊲`,`\\vartriangleleft`),B(V,W,K,`⊴`,`\\trianglelefteq`),B(V,W,K,`⊨`,`\\vDash`,!0),B(V,W,K,`⊪`,`\\Vvdash`,!0),B(V,W,K,`⌣`,`\\smallsmile`),B(V,W,K,`⌢`,`\\smallfrown`),B(V,W,K,`≏`,`\\bumpeq`,!0),B(V,W,K,`≎`,`\\Bumpeq`,!0),B(V,W,K,`≧`,`\\geqq`,!0),B(V,W,K,`⩾`,`\\geqslant`,!0),B(V,W,K,`⪖`,`\\eqslantgtr`,!0),B(V,W,K,`≳`,`\\gtrsim`,!0),B(V,W,K,`⪆`,`\\gtrapprox`,!0),B(V,W,G,`⋗`,`\\gtrdot`),B(V,W,K,`⋙`,`\\ggg`,!0),B(V,W,K,`≷`,`\\gtrless`,!0),B(V,W,K,`⋛`,`\\gtreqless`,!0),B(V,W,K,`⪌`,`\\gtreqqless`,!0),B(V,W,K,`≖`,`\\eqcirc`,!0),B(V,W,K,`≗`,`\\circeq`,!0),B(V,W,K,`≜`,`\\triangleq`,!0),B(V,W,K,`∼`,`\\thicksim`),B(V,W,K,`≈`,`\\thickapprox`),B(V,W,K,`⫆`,`\\supseteqq`,!0),B(V,W,K,`⋑`,`\\Supset`,!0),B(V,W,K,`⊐`,`\\sqsupset`,!0),B(V,W,K,`≽`,`\\succcurlyeq`,!0),B(V,W,K,`⋟`,`\\curlyeqsucc`,!0),B(V,W,K,`≿`,`\\succsim`,!0),B(V,W,K,`⪸`,`\\succapprox`,!0),B(V,W,K,`⊳`,`\\vartriangleright`),B(V,W,K,`⊵`,`\\trianglerighteq`),B(V,W,K,`⊩`,`\\Vdash`,!0),B(V,W,K,`∣`,`\\shortmid`),B(V,W,K,`∥`,`\\shortparallel`),B(V,W,K,`≬`,`\\between`,!0),B(V,W,K,`⋔`,`\\pitchfork`,!0),B(V,W,K,`∝`,`\\varpropto`),B(V,W,K,`◀`,`\\blacktriangleleft`),B(V,W,K,`∴`,`\\therefore`,!0),B(V,W,K,`∍`,`\\backepsilon`),B(V,W,K,`▶`,`\\blacktriangleright`),B(V,W,K,`∵`,`\\because`,!0),B(V,W,K,`⋘`,`\\llless`),B(V,W,K,`⋙`,`\\gggtr`),B(V,W,G,`⊲`,`\\lhd`),B(V,W,G,`⊳`,`\\rhd`),B(V,W,K,`≂`,`\\eqsim`,!0),B(V,U,K,`⋈`,`\\Join`),B(V,W,K,`≑`,`\\Doteq`,!0),B(V,W,G,`∔`,`\\dotplus`,!0),B(V,W,G,`∖`,`\\smallsetminus`),B(V,W,G,`⋒`,`\\Cap`,!0),B(V,W,G,`⋓`,`\\Cup`,!0),B(V,W,G,`⩞`,`\\doublebarwedge`,!0),B(V,W,G,`⊟`,`\\boxminus`,!0),B(V,W,G,`⊞`,`\\boxplus`,!0),B(V,W,G,`⋇`,`\\divideontimes`,!0),B(V,W,G,`⋉`,`\\ltimes`,!0),B(V,W,G,`⋊`,`\\rtimes`,!0),B(V,W,G,`⋋`,`\\leftthreetimes`,!0),B(V,W,G,`⋌`,`\\rightthreetimes`,!0),B(V,W,G,`⋏`,`\\curlywedge`,!0),B(V,W,G,`⋎`,`\\curlyvee`,!0),B(V,W,G,`⊝`,`\\circleddash`,!0),B(V,W,G,`⊛`,`\\circledast`,!0),B(V,W,G,`⋅`,`\\centerdot`),B(V,W,G,`⊺`,`\\intercal`,!0),B(V,W,G,`⋒`,`\\doublecap`),B(V,W,G,`⋓`,`\\doublecup`),B(V,W,G,`⊠`,`\\boxtimes`,!0),B(V,W,K,`⇢`,`\\dashrightarrow`,!0),B(V,W,K,`⇠`,`\\dashleftarrow`,!0),B(V,W,K,`⇇`,`\\leftleftarrows`,!0),B(V,W,K,`⇆`,`\\leftrightarrows`,!0),B(V,W,K,`⇚`,`\\Lleftarrow`,!0),B(V,W,K,`↞`,`\\twoheadleftarrow`,!0),B(V,W,K,`↢`,`\\leftarrowtail`,!0),B(V,W,K,`↫`,`\\looparrowleft`,!0),B(V,W,K,`⇋`,`\\leftrightharpoons`,!0),B(V,W,K,`↶`,`\\curvearrowleft`,!0),B(V,W,K,`↺`,`\\circlearrowleft`,!0),B(V,W,K,`↰`,`\\Lsh`,!0),B(V,W,K,`⇈`,`\\upuparrows`,!0),B(V,W,K,`↿`,`\\upharpoonleft`,!0),B(V,W,K,`⇃`,`\\downharpoonleft`,!0),B(V,U,K,`⊶`,`\\origof`,!0),B(V,U,K,`⊷`,`\\imageof`,!0),B(V,W,K,`⊸`,`\\multimap`,!0),B(V,W,K,`↭`,`\\leftrightsquigarrow`,!0),B(V,W,K,`⇉`,`\\rightrightarrows`,!0),B(V,W,K,`⇄`,`\\rightleftarrows`,!0),B(V,W,K,`↠`,`\\twoheadrightarrow`,!0),B(V,W,K,`↣`,`\\rightarrowtail`,!0),B(V,W,K,`↬`,`\\looparrowright`,!0),B(V,W,K,`↷`,`\\curvearrowright`,!0),B(V,W,K,`↻`,`\\circlearrowright`,!0),B(V,W,K,`↱`,`\\Rsh`,!0),B(V,W,K,`⇊`,`\\downdownarrows`,!0),B(V,W,K,`↾`,`\\upharpoonright`,!0),B(V,W,K,`⇂`,`\\downharpoonright`,!0),B(V,W,K,`⇝`,`\\rightsquigarrow`,!0),B(V,W,K,`⇝`,`\\leadsto`),B(V,W,K,`⇛`,`\\Rrightarrow`,!0),B(V,W,K,`↾`,`\\restriction`),B(V,U,q,`‘`,"`"),B(V,U,q,`$`,`\\$`),B(H,U,q,`$`,`\\$`),B(H,U,q,`$`,`\\textdollar`),B(V,U,q,`%`,`\\%`),B(H,U,q,`%`,`\\%`),B(V,U,q,`_`,`\\_`),B(H,U,q,`_`,`\\_`),B(H,U,q,`_`,`\\textunderscore`),B(V,U,q,`∠`,`\\angle`,!0),B(V,U,q,`∞`,`\\infty`,!0),B(V,U,q,`′`,`\\prime`),B(V,U,q,`△`,`\\triangle`),B(V,U,q,`Γ`,`\\Gamma`,!0),B(V,U,q,`Δ`,`\\Delta`,!0),B(V,U,q,`Θ`,`\\Theta`,!0),B(V,U,q,`Λ`,`\\Lambda`,!0),B(V,U,q,`Ξ`,`\\Xi`,!0),B(V,U,q,`Π`,`\\Pi`,!0),B(V,U,q,`Σ`,`\\Sigma`,!0),B(V,U,q,`Υ`,`\\Upsilon`,!0),B(V,U,q,`Φ`,`\\Phi`,!0),B(V,U,q,`Ψ`,`\\Psi`,!0),B(V,U,q,`Ω`,`\\Omega`,!0),B(V,U,q,`A`,`Α`),B(V,U,q,`B`,`Β`),B(V,U,q,`E`,`Ε`),B(V,U,q,`Z`,`Ζ`),B(V,U,q,`H`,`Η`),B(V,U,q,`I`,`Ι`),B(V,U,q,`K`,`Κ`),B(V,U,q,`M`,`Μ`),B(V,U,q,`N`,`Ν`),B(V,U,q,`O`,`Ο`),B(V,U,q,`P`,`Ρ`),B(V,U,q,`T`,`Τ`),B(V,U,q,`X`,`Χ`),B(V,U,q,`¬`,`\\neg`,!0),B(V,U,q,`¬`,`\\lnot`),B(V,U,q,`⊤`,`\\top`),B(V,U,q,`⊥`,`\\bot`),B(V,U,q,`∅`,`\\emptyset`),B(V,W,q,`∅`,`\\varnothing`),B(V,U,Wo,`α`,`\\alpha`,!0),B(V,U,Wo,`β`,`\\beta`,!0),B(V,U,Wo,`γ`,`\\gamma`,!0),B(V,U,Wo,`δ`,`\\delta`,!0),B(V,U,Wo,`ϵ`,`\\epsilon`,!0),B(V,U,Wo,`ζ`,`\\zeta`,!0),B(V,U,Wo,`η`,`\\eta`,!0),B(V,U,Wo,`θ`,`\\theta`,!0),B(V,U,Wo,`ι`,`\\iota`,!0),B(V,U,Wo,`κ`,`\\kappa`,!0),B(V,U,Wo,`λ`,`\\lambda`,!0),B(V,U,Wo,`μ`,`\\mu`,!0),B(V,U,Wo,`ν`,`\\nu`,!0),B(V,U,Wo,`ξ`,`\\xi`,!0),B(V,U,Wo,`ο`,`\\omicron`,!0),B(V,U,Wo,`π`,`\\pi`,!0),B(V,U,Wo,`ρ`,`\\rho`,!0),B(V,U,Wo,`σ`,`\\sigma`,!0),B(V,U,Wo,`τ`,`\\tau`,!0),B(V,U,Wo,`υ`,`\\upsilon`,!0),B(V,U,Wo,`ϕ`,`\\phi`,!0),B(V,U,Wo,`χ`,`\\chi`,!0),B(V,U,Wo,`ψ`,`\\psi`,!0),B(V,U,Wo,`ω`,`\\omega`,!0),B(V,U,Wo,`ε`,`\\varepsilon`,!0),B(V,U,Wo,`ϑ`,`\\vartheta`,!0),B(V,U,Wo,`ϖ`,`\\varpi`,!0),B(V,U,Wo,`ϱ`,`\\varrho`,!0),B(V,U,Wo,`ς`,`\\varsigma`,!0),B(V,U,Wo,`φ`,`\\varphi`,!0),B(V,U,G,`∗`,`*`,!0),B(V,U,G,`+`,`+`),B(V,U,G,`−`,`-`,!0),B(V,U,G,`⋅`,`\\cdot`,!0),B(V,U,G,`∘`,`\\circ`,!0),B(V,U,G,`÷`,`\\div`,!0),B(V,U,G,`±`,`\\pm`,!0),B(V,U,G,`×`,`\\times`,!0),B(V,U,G,`∩`,`\\cap`,!0),B(V,U,G,`∪`,`\\cup`,!0),B(V,U,G,`∖`,`\\setminus`,!0),B(V,U,G,`∧`,`\\land`),B(V,U,G,`∨`,`\\lor`),B(V,U,G,`∧`,`\\wedge`,!0),B(V,U,G,`∨`,`\\vee`,!0),B(V,U,q,`√`,`\\surd`),B(V,U,Ko,`⟨`,`\\langle`,!0),B(V,U,Ko,`∣`,`\\lvert`),B(V,U,Ko,`∥`,`\\lVert`),B(V,U,Ho,`?`,`?`),B(V,U,Ho,`!`,`!`),B(V,U,Ho,`⟩`,`\\rangle`,!0),B(V,U,Ho,`∣`,`\\rvert`),B(V,U,Ho,`∥`,`\\rVert`),B(V,U,K,`=`,`=`),B(V,U,K,`:`,`:`),B(V,U,K,`≈`,`\\approx`,!0),B(V,U,K,`≅`,`\\cong`,!0),B(V,U,K,`≥`,`\\ge`),B(V,U,K,`≥`,`\\geq`,!0),B(V,U,K,`←`,`\\gets`),B(V,U,K,`>`,`\\gt`,!0),B(V,U,K,`∈`,`\\in`,!0),B(V,U,K,``,`\\@not`),B(V,U,K,`⊂`,`\\subset`,!0),B(V,U,K,`⊃`,`\\supset`,!0),B(V,U,K,`⊆`,`\\subseteq`,!0),B(V,U,K,`⊇`,`\\supseteq`,!0),B(V,W,K,`⊈`,`\\nsubseteq`,!0),B(V,W,K,`⊉`,`\\nsupseteq`,!0),B(V,U,K,`⊨`,`\\models`),B(V,U,K,`←`,`\\leftarrow`,!0),B(V,U,K,`≤`,`\\le`),B(V,U,K,`≤`,`\\leq`,!0),B(V,U,K,`<`,`\\lt`,!0),B(V,U,K,`→`,`\\rightarrow`,!0),B(V,U,K,`→`,`\\to`),B(V,W,K,`≱`,`\\ngeq`,!0),B(V,W,K,`≰`,`\\nleq`,!0),B(V,U,Jo,`\xA0`,`\\ `),B(V,U,Jo,`\xA0`,`\\space`),B(V,U,Jo,`\xA0`,`\\nobreakspace`),B(H,U,Jo,`\xA0`,`\\ `),B(H,U,Jo,`\xA0`,` `),B(H,U,Jo,`\xA0`,`\\space`),B(H,U,Jo,`\xA0`,`\\nobreakspace`),B(V,U,Jo,null,`\\nobreak`),B(V,U,Jo,null,`\\allowbreak`),B(V,U,qo,`,`,`,`),B(V,U,qo,`;`,`;`),B(V,W,G,`⊼`,`\\barwedge`,!0),B(V,W,G,`⊻`,`\\veebar`,!0),B(V,U,G,`⊙`,`\\odot`,!0),B(V,U,G,`⊕`,`\\oplus`,!0),B(V,U,G,`⊗`,`\\otimes`,!0),B(V,U,q,`∂`,`\\partial`,!0),B(V,U,G,`⊘`,`\\oslash`,!0),B(V,W,G,`⊚`,`\\circledcirc`,!0),B(V,W,G,`⊡`,`\\boxdot`,!0),B(V,U,G,`△`,`\\bigtriangleup`),B(V,U,G,`▽`,`\\bigtriangledown`),B(V,U,G,`†`,`\\dagger`),B(V,U,G,`⋄`,`\\diamond`),B(V,U,G,`⋆`,`\\star`),B(V,U,G,`◃`,`\\triangleleft`),B(V,U,G,`▹`,`\\triangleright`),B(V,U,Ko,`{`,`\\{`),B(H,U,q,`{`,`\\{`),B(H,U,q,`{`,`\\textbraceleft`),B(V,U,Ho,`}`,`\\}`),B(H,U,q,`}`,`\\}`),B(H,U,q,`}`,`\\textbraceright`),B(V,U,Ko,`{`,`\\lbrace`),B(V,U,Ho,`}`,`\\rbrace`),B(V,U,Ko,`[`,`\\lbrack`,!0),B(H,U,q,`[`,`\\lbrack`,!0),B(V,U,Ho,`]`,`\\rbrack`,!0),B(H,U,q,`]`,`\\rbrack`,!0),B(V,U,Ko,`(`,`\\lparen`,!0),B(V,U,Ho,`)`,`\\rparen`,!0),B(H,U,q,`<`,`\\textless`,!0),B(H,U,q,`>`,`\\textgreater`,!0),B(V,U,Ko,`⌊`,`\\lfloor`,!0),B(V,U,Ho,`⌋`,`\\rfloor`,!0),B(V,U,Ko,`⌈`,`\\lceil`,!0),B(V,U,Ho,`⌉`,`\\rceil`,!0),B(V,U,q,`\\`,`\\backslash`),B(V,U,q,`∣`,`|`),B(V,U,q,`∣`,`\\vert`),B(H,U,q,`|`,`\\textbar`,!0),B(V,U,q,`∥`,`\\|`),B(V,U,q,`∥`,`\\Vert`),B(H,U,q,`∥`,`\\textbardbl`),B(H,U,q,`~`,`\\textasciitilde`),B(H,U,q,`\\`,`\\textbackslash`),B(H,U,q,`^`,`\\textasciicircum`),B(V,U,K,`↑`,`\\uparrow`,!0),B(V,U,K,`⇑`,`\\Uparrow`,!0),B(V,U,K,`↓`,`\\downarrow`,!0),B(V,U,K,`⇓`,`\\Downarrow`,!0),B(V,U,K,`↕`,`\\updownarrow`,!0),B(V,U,K,`⇕`,`\\Updownarrow`,!0),B(V,U,Go,`∐`,`\\coprod`),B(V,U,Go,`⋁`,`\\bigvee`),B(V,U,Go,`⋀`,`\\bigwedge`),B(V,U,Go,`⨄`,`\\biguplus`),B(V,U,Go,`⋂`,`\\bigcap`),B(V,U,Go,`⋃`,`\\bigcup`),B(V,U,Go,`∫`,`\\int`),B(V,U,Go,`∫`,`\\intop`),B(V,U,Go,`∬`,`\\iint`),B(V,U,Go,`∭`,`\\iiint`),B(V,U,Go,`∏`,`\\prod`),B(V,U,Go,`∑`,`\\sum`),B(V,U,Go,`⨂`,`\\bigotimes`),B(V,U,Go,`⨁`,`\\bigoplus`),B(V,U,Go,`⨀`,`\\bigodot`),B(V,U,Go,`∮`,`\\oint`),B(V,U,Go,`∯`,`\\oiint`),B(V,U,Go,`∰`,`\\oiiint`),B(V,U,Go,`⨆`,`\\bigsqcup`),B(V,U,Go,`∫`,`\\smallint`),B(H,U,Uo,`…`,`\\textellipsis`),B(V,U,Uo,`…`,`\\mathellipsis`),B(H,U,Uo,`…`,`\\ldots`,!0),B(V,U,Uo,`…`,`\\ldots`,!0),B(V,U,Uo,`⋯`,`\\@cdots`,!0),B(V,U,Uo,`⋱`,`\\ddots`,!0),B(V,U,q,`⋮`,`\\varvdots`),B(H,U,q,`⋮`,`\\varvdots`),B(V,U,Vo,`ˊ`,`\\acute`),B(V,U,Vo,`ˋ`,`\\grave`),B(V,U,Vo,`¨`,`\\ddot`),B(V,U,Vo,`~`,`\\tilde`),B(V,U,Vo,`ˉ`,`\\bar`),B(V,U,Vo,`˘`,`\\breve`),B(V,U,Vo,`ˇ`,`\\check`),B(V,U,Vo,`^`,`\\hat`),B(V,U,Vo,`⃗`,`\\vec`),B(V,U,Vo,`˙`,`\\dot`),B(V,U,Vo,`˚`,`\\mathring`),B(V,U,Wo,``,`\\@imath`),B(V,U,Wo,``,`\\@jmath`),B(V,U,q,`ı`,`ı`),B(V,U,q,`ȷ`,`ȷ`),B(H,U,q,`ı`,`\\i`,!0),B(H,U,q,`ȷ`,`\\j`,!0),B(H,U,q,`ß`,`\\ss`,!0),B(H,U,q,`æ`,`\\ae`,!0),B(H,U,q,`œ`,`\\oe`,!0),B(H,U,q,`ø`,`\\o`,!0),B(H,U,q,`Æ`,`\\AE`,!0),B(H,U,q,`Œ`,`\\OE`,!0),B(H,U,q,`Ø`,`\\O`,!0),B(H,U,Vo,`ˊ`,`\\'`),B(H,U,Vo,`ˋ`,"\\`"),B(H,U,Vo,`ˆ`,`\\^`),B(H,U,Vo,`˜`,`\\~`),B(H,U,Vo,`ˉ`,`\\=`),B(H,U,Vo,`˘`,`\\u`),B(H,U,Vo,`˙`,`\\.`),B(H,U,Vo,`¸`,`\\c`),B(H,U,Vo,`˚`,`\\r`),B(H,U,Vo,`ˇ`,`\\v`),B(H,U,Vo,`¨`,`\\"`),B(H,U,Vo,`˝`,`\\H`),B(H,U,Vo,`◯`,`\\textcircled`);var Yo={"--":!0,"---":!0,"``":!0,"''":!0};B(H,U,q,`–`,`--`,!0),B(H,U,q,`–`,`\\textendash`),B(H,U,q,`—`,`---`,!0),B(H,U,q,`—`,`\\textemdash`),B(H,U,q,`‘`,"`",!0),B(H,U,q,`‘`,`\\textquoteleft`),B(H,U,q,`’`,`'`,!0),B(H,U,q,`’`,`\\textquoteright`),B(H,U,q,`“`,"``",!0),B(H,U,q,`“`,`\\textquotedblleft`),B(H,U,q,`”`,`''`,!0),B(H,U,q,`”`,`\\textquotedblright`),B(V,U,q,`°`,`\\degree`,!0),B(H,U,q,`°`,`\\degree`),B(H,U,q,`°`,`\\textdegree`,!0),B(V,U,q,`£`,`\\pounds`),B(V,U,q,`£`,`\\mathsterling`,!0),B(H,U,q,`£`,`\\pounds`),B(H,U,q,`£`,`\\textsterling`,!0),B(V,W,q,`✠`,`\\maltese`),B(H,W,q,`✠`,`\\maltese`);for(var Xo=`0123456789/@."`,Zo=0;Zo<Xo.length;Zo++){var Qo=Xo.charAt(Zo);B(V,U,q,Qo,Qo)}for(var $o=`0123456789!@*()-=+";:?/.,`,es=0;es<$o.length;es++){var ts=$o.charAt(es);B(H,U,q,ts,ts)}for(var ns=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,rs=0;rs<ns.length;rs++){var is=ns.charAt(rs);B(V,U,Wo,is,is),B(H,U,q,is,is)}B(V,W,q,`C`,`ℂ`),B(H,W,q,`C`,`ℂ`),B(V,W,q,`H`,`ℍ`),B(H,W,q,`H`,`ℍ`),B(V,W,q,`N`,`ℕ`),B(H,W,q,`N`,`ℕ`),B(V,W,q,`P`,`ℙ`),B(H,W,q,`P`,`ℙ`),B(V,W,q,`Q`,`ℚ`),B(H,W,q,`Q`,`ℚ`),B(V,W,q,`R`,`ℝ`),B(H,W,q,`R`,`ℝ`),B(V,W,q,`Z`,`ℤ`),B(H,W,q,`Z`,`ℤ`),B(V,U,Wo,`h`,`ℎ`),B(H,U,Wo,`h`,`ℎ`);for(var as=``,os=0;os<ns.length;os++){var ss=ns.charAt(os);as=String.fromCharCode(55349,56320+os),B(V,U,Wo,ss,as),B(H,U,q,ss,as),as=String.fromCharCode(55349,56372+os),B(V,U,Wo,ss,as),B(H,U,q,ss,as),as=String.fromCharCode(55349,56424+os),B(V,U,Wo,ss,as),B(H,U,q,ss,as),as=String.fromCharCode(55349,56580+os),B(V,U,Wo,ss,as),B(H,U,q,ss,as),as=String.fromCharCode(55349,56684+os),B(V,U,Wo,ss,as),B(H,U,q,ss,as),as=String.fromCharCode(55349,56736+os),B(V,U,Wo,ss,as),B(H,U,q,ss,as),as=String.fromCharCode(55349,56788+os),B(V,U,Wo,ss,as),B(H,U,q,ss,as),as=String.fromCharCode(55349,56840+os),B(V,U,Wo,ss,as),B(H,U,q,ss,as),as=String.fromCharCode(55349,56944+os),B(V,U,Wo,ss,as),B(H,U,q,ss,as),os<26&&(as=String.fromCharCode(55349,56632+os),B(V,U,Wo,ss,as),B(H,U,q,ss,as),as=String.fromCharCode(55349,56476+os),B(V,U,Wo,ss,as),B(H,U,q,ss,as))}as=String.fromCharCode(55349,56668),B(V,U,Wo,`k`,as),B(H,U,q,`k`,as);for(var cs=0;cs<10;cs++){var ls=cs.toString();as=String.fromCharCode(55349,57294+cs),B(V,U,Wo,ls,as),B(H,U,q,ls,as),as=String.fromCharCode(55349,57314+cs),B(V,U,Wo,ls,as),B(H,U,q,ls,as),as=String.fromCharCode(55349,57324+cs),B(V,U,Wo,ls,as),B(H,U,q,ls,as),as=String.fromCharCode(55349,57334+cs),B(V,U,Wo,ls,as),B(H,U,q,ls,as)}for(var us=`ÐÞþ`,ds=0;ds<us.length;ds++){var fs=us.charAt(ds);B(V,U,Wo,fs,fs),B(H,U,q,fs,fs)}var ps=[[`mathbf`,`textbf`,`Main-Bold`],[`mathbf`,`textbf`,`Main-Bold`],[`mathnormal`,`textit`,`Math-Italic`],[`mathnormal`,`textit`,`Math-Italic`],[`boldsymbol`,`boldsymbol`,`Main-BoldItalic`],[`boldsymbol`,`boldsymbol`,`Main-BoldItalic`],[`mathscr`,`textscr`,`Script-Regular`],[``,``,``],[``,``,``],[``,``,``],[`mathfrak`,`textfrak`,`Fraktur-Regular`],[`mathfrak`,`textfrak`,`Fraktur-Regular`],[`mathbb`,`textbb`,`AMS-Regular`],[`mathbb`,`textbb`,`AMS-Regular`],[`mathboldfrak`,`textboldfrak`,`Fraktur-Regular`],[`mathboldfrak`,`textboldfrak`,`Fraktur-Regular`],[`mathsf`,`textsf`,`SansSerif-Regular`],[`mathsf`,`textsf`,`SansSerif-Regular`],[`mathboldsf`,`textboldsf`,`SansSerif-Bold`],[`mathboldsf`,`textboldsf`,`SansSerif-Bold`],[`mathitsf`,`textitsf`,`SansSerif-Italic`],[`mathitsf`,`textitsf`,`SansSerif-Italic`],[``,``,``],[``,``,``],[`mathtt`,`texttt`,`Typewriter-Regular`],[`mathtt`,`texttt`,`Typewriter-Regular`]],ms=[[`mathbf`,`textbf`,`Main-Bold`],[``,``,``],[`mathsf`,`textsf`,`SansSerif-Regular`],[`mathboldsf`,`textboldsf`,`SansSerif-Bold`],[`mathtt`,`texttt`,`Typewriter-Regular`]],hs=function(e,t){var n=e.charCodeAt(0),r=e.charCodeAt(1),i=(n-55296)*1024+(r-56320)+65536,a=t===`math`?0:1;if(119808<=i&&i<120484){var o=Math.floor((i-119808)/26);return[ps[o][2],ps[o][a]]}if(120782<=i&&i<=120831){var s=Math.floor((i-120782)/10);return[ms[s][2],ms[s][a]]}if(i===120485||i===120486)return[ps[0][2],ps[0][a]];if(120486<i&&i<120782)return[``,``];throw new R(`Unsupported character: `+e)},gs=function(e,t,n){return Bo[n][e]&&Bo[n][e].replace&&(e=Bo[n][e].replace),{value:e,metrics:fo(e,t,n)}},_s=function(e,t,n,r,i){var a=gs(e,t,n),o=a.metrics;e=a.value;var s;if(o){var c=o.italic;(n===`text`||r&&r.font===`mathit`)&&(c=0),s=new Mo(e,o.height,o.depth,c,o.skew,o.width,i)}else typeof console<`u`&&console.warn(`No character metrics `+(`for '`+e+`' in style '`+t+`' and mode '`+n+`'`)),s=new Mo(e,0,0,0,0,0,i);if(r){s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var l=r.getColor();l&&(s.style.color=l)}return s},vs=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&gs(e,`Main-Bold`,t).metrics?_s(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||Bo[t][e].font===`main`?_s(e,`Main-Regular`,t,n,r):_s(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},ys=function(e,t,n,r,i){return i!==`textord`&&gs(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},bs=function(e,t,n){var r=e.mode,i=e.text,a=[`mord`],o=r===`math`||r===`text`&&t.font,s=o?t.font:t.fontFamily,c=``,l=``;if(i.charCodeAt(0)===55349&&([c,l]=hs(i,r)),c.length>0)return _s(i,c,r,t,a.concat(l));if(s){var u,d;if(s===`boldsymbol`){var f=ys(i,r,t,a,n);u=f.fontName,d=[f.fontClass]}else o?(u=Ps[s].fontName,d=[s]):(u=Ns(s,t.fontWeight,t.fontShape),d=[s,t.fontWeight,t.fontShape]);if(gs(i,u,r).metrics)return _s(i,u,r,t,a.concat(d));if(Yo.hasOwnProperty(i)&&u.slice(0,10)===`Typewriter`){for(var p=[],m=0;m<i.length;m++)p.push(_s(i[m],u,r,t,a.concat(d)));return Os(p)}}if(n===`mathord`)return _s(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var h=Bo[r][i]&&Bo[r][i].font;if(h===`ams`)return _s(i,Ns(`amsrm`,t.fontWeight,t.fontShape),r,t,a.concat(`amsrm`,t.fontWeight,t.fontShape));if(h===`main`||!h)return _s(i,Ns(`textrm`,t.fontWeight,t.fontShape),r,t,a.concat(t.fontWeight,t.fontShape));var g=Ns(h,t.fontWeight,t.fontShape);return _s(i,g,r,t,a.concat(g,t.fontWeight,t.fontShape))}throw Error(`unexpected type: `+n+` in makeOrd`)},xs=(e,t)=>{if(Co(e.classes)!==Co(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var i in t.style)if(t.style.hasOwnProperty(i)&&e.style[i]!==t.style[i])return!1;return!0},Ss=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof Mo&&r instanceof Mo&&xs(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},Cs=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},ws=function(e,t,n,r){var i=new Oo(e,t,n,r);return Cs(i),i},Ts=(e,t,n,r)=>new Oo(e,t,n,r),Es=function(e,t,n){var r=ws([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=z(r.height),r.maxFontSize=1,r},Ds=function(e,t,n,r){var i=new ko(e,t,n,r);return Cs(i),i},Os=function(e){var t=new oo(e);return Cs(t),t},ks=function(e,t){return e instanceof oo?ws([],[e],t):e},As=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a<t.length;a++){var o=-t[a].shift-i-t[a].elem.depth,s=o-(t[a-1].elem.height+t[a-1].elem.depth);i+=o,n.push({type:`kern`,size:s}),n.push(t[a])}return{children:n,depth:r}}var c;if(e.positionType===`top`){for(var l=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];l-=d.type===`kern`?d.size:d.elem.height+d.elem.depth}c=l}else if(e.positionType===`bottom`)c=-e.positionData;else{var f=e.children[0];if(f.type!==`elem`)throw Error(`First child must have type "elem".`);if(e.positionType===`shift`)c=-f.elem.depth-e.positionData;else if(e.positionType===`firstBaseline`)c=-f.elem.depth;else throw Error(`Invalid positionType `+e.positionType+`.`)}return{children:e.children,depth:c}},js=function(e,t){for(var{children:n,depth:r}=As(e),i=0,a=0;a<n.length;a++){var o=n[a];if(o.type===`elem`){var s=o.elem;i=Math.max(i,s.maxFontSize,s.height)}}i+=2;var c=ws([`pstrut`],[]);c.style.height=z(i);for(var l=[],u=r,d=r,f=r,p=0;p<n.length;p++){var m=n[p];if(m.type===`kern`)f+=m.size;else{var h=m.elem,g=m.wrapperClasses||[],_=m.wrapperStyle||{},v=ws(g,[c,h],void 0,_);v.style.top=z(-i-f-h.depth),m.marginLeft&&(v.style.marginLeft=m.marginLeft),m.marginRight&&(v.style.marginRight=m.marginRight),l.push(v),f+=h.height+h.depth}u=Math.min(u,f),d=Math.max(d,f)}var y=ws([`vlist`],l);y.style.height=z(d);var b;if(u<0){var x=ws([`vlist`],[ws([],[])]);x.style.height=z(-u),b=[ws([`vlist-r`],[y,ws([`vlist-s`],[new Mo(`​`)])]),ws([`vlist-r`],[x])]}else b=[ws([`vlist-r`],[y])];var S=ws([`vlist-t`],b);return b.length===2&&S.classes.push(`vlist-t2`),S.height=d,S.depth=-u,S},Ms=(e,t)=>{var n=ws([`mspace`],[],t),r=So(e,t);return n.style.marginRight=z(r),n},Ns=function(e,t,n){var r=``;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}var i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:t===`textit`?`Italic`:`Regular`;return r+`-`+i},Ps={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},Fs={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},J={fontMap:Ps,makeSymbol:_s,mathsym:vs,makeSpan:ws,makeSvgSpan:Ts,makeLineSpan:Es,makeAnchor:Ds,makeFragment:Os,wrapFragment:ks,makeVList:js,makeOrd:bs,makeGlue:Ms,staticSvg:function(e,t){var[n,r,i]=Fs[e],a=Ts([`overlay`],[new No([new Po(n)],{width:z(r),height:z(i),style:`width:`+z(r),viewBox:`0 0 `+1e3*r+` `+1e3*i,preserveAspectRatio:`xMinYMin`})],t);return a.height=i,a.style.height=z(i),a.style.width=z(r),a},svgData:Fs,tryCombineChars:Ss},Is={number:3,unit:`mu`},Ls={number:4,unit:`mu`},Rs={number:5,unit:`mu`},zs={mord:{mop:Is,mbin:Ls,mrel:Rs,minner:Is},mop:{mord:Is,mop:Is,mrel:Rs,minner:Is},mbin:{mord:Ls,mop:Ls,mopen:Ls,minner:Ls},mrel:{mord:Rs,mop:Rs,mopen:Rs,minner:Rs},mopen:{},mclose:{mop:Is,mbin:Ls,mrel:Rs,minner:Is},mpunct:{mord:Is,mop:Is,mrel:Rs,mopen:Is,mclose:Is,mpunct:Is,minner:Is},minner:{mord:Is,mop:Is,mbin:Ls,mrel:Rs,mopen:Is,mpunct:Is,minner:Is}},Bs={mord:{mop:Is},mop:{mord:Is,mop:Is},mbin:{},mrel:{},mopen:{},mclose:{mop:Is},mpunct:{},minner:{mop:Is}},Vs={},Hs={},Us={};function Y(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},c=0;c<n.length;++c)Vs[n[c]]=s;t&&(a&&(Hs[t]=a),o&&(Us[t]=o))}function Ws(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;Y({type:t,names:[],props:{numArgs:0},handler(){throw Error(`Should never be called.`)},htmlBuilder:n,mathmlBuilder:r})}var Gs=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},Ks=function(e){return e.type===`ordgroup`?e.body:[e]},qs=J.makeSpan,Js=[`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`],Ys=[`rightmost`,`mrel`,`mclose`,`mpunct`],Xs={display:Ua.DISPLAY,text:Ua.TEXT,script:Ua.SCRIPT,scriptscript:Ua.SCRIPTSCRIPT},Zs={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},Qs=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=ic(e[a],t);if(o instanceof oo){var s=o.children;i.push(...s)}else i.push(o)}if(J.tryCombineChars(i),!n)return i;var c=t;if(e.length===1){var l=e[0];l.type===`sizing`?c=t.havingSize(l.size):l.type===`styling`&&(c=t.havingStyle(Xs[l.style]))}var u=qs([r[0]||`leftmost`],[],t),d=qs([r[1]||`rightmost`],[],t),f=n===`root`;return $s(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&Ca.contains(Ys,r)?t.classes[0]=`mord`:r===`mbin`&&Ca.contains(Js,n)&&(e.classes[0]=`mord`)},{node:u},d,f),$s(i,(e,t)=>{var n=nc(t),r=nc(e),i=n&&r?e.hasClass(`mtight`)?Bs[n][r]:zs[n][r]:null;if(i)return J.makeGlue(i,c)},{node:u},d,f),i},$s=function e(t,n,r,i,a){i&&t.push(i);for(var o=0;o<t.length;o++){var s=t[o],c=ec(s);if(c)e(c.children,n,r,null,a);else{var l=!s.hasClass(`mspace`);if(l){var u=n(s,r.node);u&&(r.insertAfter?r.insertAfter(u):(t.unshift(u),o++))}l?r.node=s:a&&s.hasClass(`newline`)&&(r.node=qs([`leftmost`])),r.insertAfter=(e=>n=>{t.splice(e+1,0,n),o++})(o)}}i&&t.pop()},ec=function(e){return e instanceof oo||e instanceof ko||e instanceof Oo&&e.hasClass(`enclosing`)?e:null},tc=function e(t,n){var r=ec(t);if(r){var i=r.children;if(i.length){if(n===`right`)return e(i[i.length-1],`right`);if(n===`left`)return e(i[0],`left`)}}return t},nc=function(e,t){return e?(t&&(e=tc(e,t)),Zs[e.classes[0]]||null):null},rc=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return qs(t.concat(n))},ic=function(e,t,n){if(!e)return qs();if(Hs[e.type]){var r=Hs[e.type](e,t);if(n&&t.size!==n.size){r=qs(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new R(`Got group of unknown type: '`+e.type+`'`)};function ac(e,t){var n=qs([`base`],e,t),r=qs([`strut`]);return r.style.height=z(n.height+n.depth),n.depth&&(r.style.verticalAlign=z(-n.depth)),n.children.unshift(r),n}function oc(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=Qs(e,t,`root`),i;r.length===2&&r[1].hasClass(`tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass(`mbin`)||r[s].hasClass(`mrel`)||r[s].hasClass(`allowbreak`)){for(var c=!1;s<r.length-1&&r[s+1].hasClass(`mspace`)&&!r[s+1].hasClass(`newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(c=!0);c||(a.push(ac(o,t)),o=[])}else r[s].hasClass(`newline`)&&(o.pop(),o.length>0&&(a.push(ac(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(ac(o,t));var l;n?(l=ac(Qs(n,t,!0)),l.classes=[`tag`],a.push(l)):i&&a.push(i);var u=qs([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=z(u.height+u.depth),u.depth&&(d.style.verticalAlign=z(-u.depth))}return u}function sc(e){return new oo(e)}var cc=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=Co(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof lc&&this.children[n+1]instanceof lc){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof lc;)r+=this.children[++n].toText();e.appendChild(new lc(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=` `+t+`="`,e+=Ca.escape(this.attributes[t]),e+=`"`);this.classes.length>0&&(e+=` class ="`+Ca.escape(Co(this.classes))+`"`),e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},lc=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ca.escape(this.toText())}toText(){return this.text}},X={MathNode:cc,TextNode:lc,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?` `:e>=.1666&&e<=.1667?` `:e>=.2222&&e<=.2223?` `:e>=.2777&&e<=.2778?`  `:e>=-.05556&&e<=-.05555?` ⁣`:e>=-.1667&&e<=-.1666?` ⁣`:e>=-.2223&&e<=-.2222?` ⁣`:e>=-.2778&&e<=-.2777?` ⁣`:null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,z(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+z(this.width)+`"/>`}toText(){return this.character?this.character:` `}},newDocumentFragment:sc},uc=function(e,t,n){return Bo[t][e]&&Bo[t][e].replace&&e.charCodeAt(0)!==55349&&!(Yo.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)===`tt`||n.font&&n.font.slice(4,6)===`tt`))&&(e=Bo[t][e].replace),new X.TextNode(e)},dc=function(e){return e.length===1?e[0]:new X.MathNode(`mrow`,e)},fc=function(e,t){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`;var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode;if(n===`mathit`)return`italic`;if(n===`boldsymbol`)return e.type===`textord`?`bold`:`bold-italic`;if(n===`mathbf`)return`bold`;if(n===`mathbb`)return`double-struck`;if(n===`mathsfit`)return`sans-serif-italic`;if(n===`mathfrak`)return`fraktur`;if(n===`mathscr`||n===`mathcal`)return`script`;if(n===`mathsf`)return`sans-serif`;if(n===`mathtt`)return`monospace`;var i=e.text;if(Ca.contains([`\\imath`,`\\jmath`],i))return null;Bo[r][i]&&Bo[r][i].replace&&(i=Bo[r][i].replace);var a=J.fontMap[n].fontName;return fo(i,a,r)?J.fontMap[n].variant:null};function pc(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof lc&&t.text===`.`}if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof lc&&n.text===`,`}return!1}var mc=function(e,t,n){if(e.length===1){var r=gc(e[0],t);return n&&r instanceof cc&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o<e.length;o++){var s=gc(e[o],t);if(s instanceof cc&&a instanceof cc){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)||s.type===`mn`&&a.type===`mn`||pc(s)&&a.type===`mn`){a.children.push(...s.children);continue}if(s.type===`mn`&&pc(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||pc(a))){var c=s.children[0];c instanceof cc&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof lc&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof lc&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},hc=function(e,t,n){return dc(mc(e,t,n))},gc=function(e,t){if(!e)return new X.MathNode(`mrow`);if(Us[e.type])return Us[e.type](e,t);throw new R(`Got group of unknown type: '`+e.type+`'`)};function _c(e,t,n,r,i){var a=mc(e,n),o=a.length===1&&a[0]instanceof cc&&Ca.contains([`mrow`,`mtable`],a[0].type)?a[0]:new X.MathNode(`mrow`,a),s=new X.MathNode(`annotation`,[new X.TextNode(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new X.MathNode(`semantics`,[o,s]),l=new X.MathNode(`math`,[c]);l.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&l.setAttribute(`display`,`block`);var u=i?`katex`:`katex-mathml`;return J.makeSpan([u],[l])}var vc=function(e){return new vo({style:e.displayMode?Ua.DISPLAY:Ua.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},yc=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=J.makeSpan(n,[e])}return e},bc=function(e,t,n){var r=vc(n),i;if(n.output===`mathml`)return _c(e,t,r,n.displayMode,!0);if(n.output===`html`){var a=oc(e,r);i=J.makeSpan([`katex`],[a])}else{var o=_c(e,t,r,n.displayMode,!1),s=oc(e,r);i=J.makeSpan([`katex`],[o,s])}return yc(i,n)},xc=function(e,t,n){var r=oc(e,vc(n));return yc(J.makeSpan([`katex`],[r]),n)},Sc={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},Cc=function(e){var t=new X.MathNode(`mo`,[new X.TextNode(Sc[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},wc={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},Tc=function(e){return e.type===`ordgroup`?e.body.length:1},Ec={encloseSpan:function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=J.makeSpan([`stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new Fo({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new Fo({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`}));var l=new No(c,{width:`100%`,height:z(o)});a=J.makeSvgSpan([],[l],i)}return a.height=o,a.style.height=z(o),a},mathMLnode:Cc,svgSpan:function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(Ca.contains([`widehat`,`widecheck`,`widetilde`,`utilde`],r)){var i=Tc(e.base),a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}var l=new No([new Po(o)],{width:`100%`,height:z(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`});return{span:J.makeSvgSpan([],[l],t),minWidth:0,height:s}}var u=[],d=wc[r],[f,p,m]=d,h=m/1e3,g=f.length,_,v;if(g===1){var y=d[3];_=[`hide-tail`],v=[y]}else if(g===2)_=[`halfarrow-left`,`halfarrow-right`],v=[`xMinYMin`,`xMaxYMin`];else if(g===3)_=[`brace-left`,`brace-center`,`brace-right`],v=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support
257
+ `+g+` children.`);for(var b=0;b<g;b++){var x=new No([new Po(f[b])],{width:`400em`,height:z(h),viewBox:`0 0 `+n+` `+m,preserveAspectRatio:v[b]+` slice`}),S=J.makeSvgSpan([_[b]],[x],t);if(g===1)return{span:S,minWidth:p,height:h};S.style.height=z(h),u.push(S)}return{span:J.makeSpan([`stretchy`],u,t),minWidth:p,height:h}}var{span:r,minWidth:i,height:a}=n();return r.height=a,r.style.height=z(a),i>0&&(r.style.minWidth=z(i)),r}};function Dc(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function Oc(e){var t=kc(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function kc(e){return e&&(e.type===`atom`||zo.hasOwnProperty(e.type))?e:null}var Ac=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=Dc(e.base,`accent`),n=r.base,e.base=n,i=Lo(ic(e,t)),e.base=r):(r=Dc(e,`accent`),n=r.base);var a=ic(n,t.havingCrampedStyle()),o=r.isShifty&&Ca.isCharacterBox(n),s=0;o&&(s=Io(ic(Ca.getBaseElem(n),t.havingCrampedStyle())).skew);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=Ec.svgSpan(r,t),u=J.makeVList({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+z(2*s)+`)`,marginLeft:z(2*s)}:void 0}]},t);else{var d,f;r.label===`\\vec`?(d=J.staticSvg(`vec`,t),f=J.svgData.vec[1]):(d=J.makeOrd({mode:r.mode,text:r.label},t,`textord`),d=Io(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=J.makeSpan([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=z(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=J.makeVList({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]},t)}var h=J.makeSpan([`mord`,`accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},jc=(e,t)=>{var n=e.isStretchy?Ec.mathMLnode(e.label):new X.MathNode(`mo`,[uc(e.label,e.mode)]),r=new X.MathNode(`mover`,[gc(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},Mc=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));Y({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],props:{numArgs:1},handler:(e,t)=>{var n=Gs(t[0]),r=!Mc.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:Ac,mathmlBuilder:jc}),Y({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(e.parser.settings.reportNonstrict(`mathVsTextAccents`,`LaTeX's accent `+e.funcName+` works only in text mode`),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Ac,mathmlBuilder:jc}),Y({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=ic(e.base,t),r=Ec.svgSpan(e,t),i=e.label===`\\utilde`?.12:0,a=J.makeVList({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]},t);return J.makeSpan([`mord`,`accentunder`],[a],t)},mathmlBuilder:(e,t)=>{var n=Ec.mathMLnode(e.label),r=new X.MathNode(`munder`,[gc(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var Nc=e=>{var t=new X.MathNode(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};Y({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=J.wrapFragment(ic(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=J.wrapFragment(ic(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=Ec.svgSpan(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=J.makeVList({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c},{type:`elem`,elem:o,shift:d}]},t)}else u=J.makeVList({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c}]},t);return u.children[0].children[0].children[1].classes.push(`svg-align`),J.makeSpan([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=Ec.mathMLnode(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=Nc(gc(e.body,t));if(e.below){var a=Nc(gc(e.below,t));r=new X.MathNode(`munderover`,[n,a,i])}else r=new X.MathNode(`mover`,[n,i])}else if(e.below){var o=Nc(gc(e.below,t));r=new X.MathNode(`munder`,[n,o])}else r=Nc(),r=new X.MathNode(`mover`,[n,r]);return r}});var Pc=J.makeSpan;function Fc(e,t){var n=Qs(e.body,t,!0);return Pc([e.mclass],n,t)}function Ic(e,t){var n,r=mc(e.body,t);return e.mclass===`minner`?n=new X.MathNode(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new X.MathNode(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new X.MathNode(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):e.mclass===`mopen`||e.mclass===`mclose`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`):e.mclass===`minner`&&(n.attributes.lspace=`0.0556em`,n.attributes.width=`+0.1111em`)),n}Y({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:Ks(i),isCharacterBox:Ca.isCharacterBox(i)}},htmlBuilder:Fc,mathmlBuilder:Ic});var Lc=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};Y({type:`mclass`,names:[`\\@binrel`],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:`mclass`,mode:n.mode,mclass:Lc(t[0]),body:Ks(t[1]),isCharacterBox:Ca.isCharacterBox(t[1])}}}),Y({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:Lc(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:Ks(i)},c={type:`supsub`,mode:a.mode,base:s,sup:r===`\\underset`?null:a,sub:r===`\\underset`?a:null};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:Ca.isCharacterBox(c)}},htmlBuilder:Fc,mathmlBuilder:Ic}),Y({type:`pmb`,names:[`\\pmb`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`pmb`,mode:n.mode,mclass:Lc(t[0]),body:Ks(t[0])}},htmlBuilder(e,t){var n=Qs(e.body,t,!0),r=J.makeSpan([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=mc(e.body,t),r=new X.MathNode(`mstyle`,n);return r.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),r}});var Rc={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},zc=()=>({type:`styling`,body:[],mode:`math`,style:`display`}),Bc=e=>e.type===`textord`&&e.text===`@`,Vc=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function Hc(e,t,n){var r=Rc[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function Uc(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new R(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=zc(),c=0;c<o.length;c++)if(!Bc(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=Oc(o[c]).text,u=[,,];if(u[0]={type:`ordgroup`,mode:`math`,body:[]},u[1]={type:`ordgroup`,mode:`math`,body:[]},!(`=|.`.indexOf(l)>-1)){if(`<>AV`.indexOf(l)>-1)for(var d=0;d<2;d++){for(var f=!0,p=c+1;p<o.length;p++){if(Vc(o[p],l)){f=!1,c=p;break}if(Bc(o[p]))throw new R(`Missing a `+l+` character to complete a CD arrow.`,o[p]);u[d].body.push(o[p])}if(f)throw new R(`Missing a `+l+` character to complete a CD arrow.`,o[c])}else throw new R(`Expected one of "<>AV=|." after @`,o[c])}var m={type:`styling`,body:[Hc(l,u,e)],mode:`math`,style:`display`};r.push(m),s=zc()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}Y({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=J.wrapFragment(ic(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=z(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new X.MathNode(`mrow`,[gc(e.label,t)]);return n=new X.MathNode(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new X.MathNode(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),Y({type:`cdlabelparent`,names:[`\\\\cdparent`],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:`cdlabelparent`,mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=J.wrapFragment(ic(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new X.MathNode(`mrow`,[gc(e.fragment,t)])}}),Y({type:`textord`,names:[`\\@char`],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Dc(t[0],`ordgroup`).body,i=``,a=0;a<r.length;a++){var o=Dc(r[a],`textord`);i+=o.text}var s=parseInt(i),c;if(isNaN(s))throw new R(`\\@char has non-numeric argument `+i);if(s<0||s>=1114111)throw new R(`\\@char with invalid code point `+i);return s<=65535?c=String.fromCharCode(s):(s-=65536,c=String.fromCharCode((s>>10)+55296,(s&1023)+56320)),{type:`textord`,mode:n.mode,text:c}}});var Wc=(e,t)=>{var n=Qs(e.body,t.withColor(e.color),!1);return J.makeFragment(n)},Gc=(e,t)=>{var n=mc(e.body,t.withColor(e.color)),r=new X.MathNode(`mstyle`,n);return r.setAttribute(`mathcolor`,e.color),r};Y({type:`color`,names:[`\\textcolor`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`original`]},handler(e,t){var{parser:n}=e,r=Dc(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:Ks(i)}},htmlBuilder:Wc,mathmlBuilder:Gc}),Y({type:`color`,names:[`\\color`],props:{numArgs:1,allowedInText:!0,argTypes:[`color`]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=Dc(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}},htmlBuilder:Wc,mathmlBuilder:Gc}),Y({type:`cr`,names:[`\\\\`],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text===`[`?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior(`newLineInDisplayMode`,`In LaTeX, \\\\ or \\newline does nothing in display mode`);return{type:`cr`,mode:r.mode,newLine:a,size:i&&Dc(i,`size`).value}},htmlBuilder(e,t){var n=J.makeSpan([`mspace`],[],t);return e.newLine&&(n.classes.push(`newline`),e.size&&(n.style.marginTop=z(So(e.size,t)))),n},mathmlBuilder(e,t){var n=new X.MathNode(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,z(So(e.size,t)))),n}});var Kc={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},qc=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new R(`Expected a control sequence`,e);return t},Jc=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},Yc=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Y({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Kc[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=Kc[r.text]),Dc(t.parseFunction(),`internal`);throw new R(`Invalid token after macro prefix`,r)}}),Y({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new R(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new R(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new R(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new R(`Expected a macro definition`);else s[a].push(r.text);var{tokens:c}=t.gullet.consumeArg();return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===Kc[n]),{type:`internal`,mode:t.mode}}}),Y({type:`internal`,names:[`\\let`,`\\\\globallet`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=qc(t.gullet.popToken());return t.gullet.consumeSpaces(),Yc(t,r,Jc(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),Y({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=qc(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return Yc(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var Xc=function(e,t,n){var r=fo(Bo.math[e]&&Bo.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},Zc=function(e,t,n,r){var i=n.havingBaseStyle(t),a=J.makeSpan(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},Qc=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=z(i),e.height-=i,e.depth+=i},$c=function(e,t,n,r,i,a){var o=Zc(J.makeSymbol(e,`Main-Regular`,i,r),t,r,a);return n&&Qc(o,r,t),o},el=function(e,t,n,r){return J.makeSymbol(e,`Size`+t+`-Regular`,n,r)},tl=function(e,t,n,r,i,a){var o=el(e,t,i,r),s=Zc(J.makeSpan([`delimsizing`,`size`+t],[o],r),Ua.TEXT,r,a);return n&&Qc(s,r,Ua.TEXT),s},nl=function(e,t,n){var r=t===`Size1-Regular`?`delim-size1`:`delim-size4`;return{type:`elem`,elem:J.makeSpan([`delimsizinginner`,r],[J.makeSpan([],[J.makeSymbol(e,t,n)])])}},rl=function(e,t,n){var r=so[`Size4-Regular`][e.charCodeAt(0)]?so[`Size4-Regular`][e.charCodeAt(0)][4]:so[`Size1-Regular`][e.charCodeAt(0)][4],i=new No([new Po(`inner`,ro(e,Math.round(1e3*t)))],{width:z(r),height:z(t),style:`width:`+z(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`}),a=J.makeSvgSpan([],[i],n);return a.height=t,a.style.height=z(t),a.style.width=z(r),{type:`elem`,elem:a}},il=.008,al={type:`kern`,size:-1*il},ol=[`|`,`\\lvert`,`\\rvert`,`\\vert`],sl=[`\\|`,`\\lVert`,`\\rVert`,`\\Vert`],cl=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):Ca.contains(ol,e)?(c=`∣`,u=`vert`,d=333):Ca.contains(sl,e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=Xc(o,f,i),m=p.height+p.depth,h=Xc(c,f,i),g=h.height+h.depth,_=Xc(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=Xc(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,ee=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,te=r.fontMetrics().axisHeight;n&&(te*=r.sizeMultiplier);var ne=ee/2-te,C=[];if(u.length>0){var re=ee-m-v,ie=Math.round(ee*1e3),ae=ao(u,Math.round(re*1e3)),w=new Po(u,ae),oe=(d/1e3).toFixed(3)+`em`,se=(ie/1e3).toFixed(3)+`em`,ce=new No([w],{width:oe,height:se,viewBox:`0 0 `+d+` `+ie}),le=J.makeSvgSpan([],[ce],r);le.height=ie/1e3,le.style.width=oe,le.style.height=se,C.push({type:`elem`,elem:le})}else{if(C.push(nl(l,f,i)),C.push(al),s===null){var ue=ee-m-v+2*il;C.push(rl(c,ue,r))}else{var de=(ee-m-v-y)/2+2*il;C.push(rl(c,de,r)),C.push(al),C.push(nl(s,f,i)),C.push(al),C.push(rl(c,de,r))}C.push(al),C.push(nl(o,f,i))}var fe=r.havingBaseStyle(Ua.TEXT),pe=J.makeVList({positionType:`bottom`,positionData:ne,children:C},fe);return Zc(J.makeSpan([`delimsizing`,`mult`],[pe],fe),Ua.TEXT,r,a)},ll=80,ul=.08,dl=function(e,t,n,r,i){var a=new No([new Po(e,no(e,r,n))],{width:`400em`,height:z(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`});return J.makeSvgSpan([`hide-tail`],[a],i)},fl=function(e,t){var n=t.havingBaseSizing(),r=Sl(`\\surd`,e*n.sizeMultiplier,bl,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s=0,c=0,l=0,u;return r.type===`small`?(l=1e3+1e3*a+ll,e<1?i=1:e<1.4&&(i=.7),s=(1+a+ul)/i,c=(1+a)/i,o=dl(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+ll)*gl[r.size],c=(gl[r.size]+a)/i,s=(gl[r.size]+a+ul)/i,o=dl(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+ul,c=e+a,l=Math.floor(1e3*e+a)+ll,o=dl(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=z(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},pl=[`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`],ml=[`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`],hl=[`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`],gl=[0,1.2,1.8,2.4,3],_l=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),Ca.contains(pl,e)||Ca.contains(hl,e))return tl(e,t,!1,n,r,i);if(Ca.contains(ml,e))return cl(e,gl[t],!1,n,r,i);throw new R(`Illegal delimiter: '`+e+`'`)},vl=[{type:`small`,style:Ua.SCRIPTSCRIPT},{type:`small`,style:Ua.SCRIPT},{type:`small`,style:Ua.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],yl=[{type:`small`,style:Ua.SCRIPTSCRIPT},{type:`small`,style:Ua.SCRIPT},{type:`small`,style:Ua.TEXT},{type:`stack`}],bl=[{type:`small`,style:Ua.SCRIPTSCRIPT},{type:`small`,style:Ua.SCRIPT},{type:`small`,style:Ua.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],xl=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;throw Error(`Add support for delim type '`+e.type+`' here.`)},Sl=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length&&n[i].type!==`stack`;i++){var a=Xc(e,xl(n[i]),`math`),o=a.height+a.depth;if(n[i].type===`small`){var s=r.havingBaseStyle(n[i].style);o*=s.sizeMultiplier}if(o>t)return n[i]}return n[n.length-1]},Cl=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=Ca.contains(hl,e)?vl:Ca.contains(pl,e)?bl:yl,s=Sl(e,t,o,r);return s.type===`small`?$c(e,s.style,n,r,i,a):s.type===`large`?tl(e,s.size,n,r,i,a):cl(e,t,n,r,i,a)},wl={sqrtImage:fl,sizedDelim:_l,sizeToMaxHeight:gl,customSizedDelim:Cl,leftRightDelim:function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return Cl(e,Math.max(l/500*s,2*l-c),!0,r,i,a)}},Tl={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},El=`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`);function Dl(e,t){var n=kc(e);if(n&&Ca.contains(El,n.text))return n;throw n?new R(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new R(`Invalid delimiter type '`+e.type+`'`,e)}Y({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],props:{numArgs:1,argTypes:[`primitive`]},handler:(e,t)=>{var n=Dl(t[0],e);return{type:`delimsizing`,mode:e.parser.mode,size:Tl[e.funcName].size,mclass:Tl[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?J.makeSpan([e.mclass]):wl.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(uc(e.delim,e.mode));var n=new X.MathNode(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=z(wl.sizeToMaxHeight[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function Ol(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}Y({type:`leftright-right`,names:[`\\right`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new R(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:Dl(t[0],e).text,color:n}}}),Y({type:`leftright`,names:[`\\left`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Dl(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=Dc(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{Ol(e);for(var n=Qs(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++)n[o].isMiddle?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i));r*=t.sizeMultiplier,i*=t.sizeMultiplier;var s=e.left===`.`?rc(t,[`mopen`]):wl.leftRightDelim(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(s),a)for(var c=1;c<n.length;c++){var l=n[c].isMiddle;l&&(n[c]=wl.leftRightDelim(l.delim,r,i,l.options,e.mode,[]))}var u;if(e.right===`.`)u=rc(t,[`mclose`]);else{var d=e.rightColor?t.withColor(e.rightColor):t;u=wl.leftRightDelim(e.right,r,i,d,e.mode,[`mclose`])}return n.push(u),J.makeSpan([`minner`],n,t)},mathmlBuilder:(e,t)=>{Ol(e);var n=mc(e.body,t);if(e.left!==`.`){var r=new X.MathNode(`mo`,[uc(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new X.MathNode(`mo`,[uc(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return dc(n)}}),Y({type:`middle`,names:[`\\middle`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Dl(t[0],e);if(!e.parser.leftrightDepth)throw new R(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if(e.delim===`.`)n=rc(t,[]);else{n=wl.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n=e.delim===`\\vert`||e.delim===`|`?uc(`|`,`text`):uc(e.delim,e.mode),r=new X.MathNode(`mo`,[n]);return r.setAttribute(`fence`,`true`),r.setAttribute(`lspace`,`0.05em`),r.setAttribute(`rspace`,`0.05em`),r}});var kl=(e,t)=>{var n=J.wrapFragment(ic(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o=0,s=Ca.isCharacterBox(e.body);if(r===`sout`)a=J.makeSpan([`stretchy`,`sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=So({number:.6,unit:`pt`},t),l=So({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=z(d/2+c);var f=Math.floor(1e3*d*i),p=new No([new Po(`phase`,eo(f))],{width:`400em`,height:z(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`});a=J.makeSvgSpan([`hide-tail`],[p],t),a.style.height=z(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var m=0,h=0,g=0;/box/.test(r)?(g=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),m=t.fontMetrics().fboxsep+(r===`colorbox`?0:g),h=m):r===`angl`?(g=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),m=4*g,h=Math.max(0,.25-n.depth)):(m=s?.2:0,h=m),a=Ec.encloseSpan(n,r,m,h,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=z(g)):r===`angl`&&g!==.049&&(a.style.borderTopWidth=z(g),a.style.borderRightWidth=z(g)),o=n.depth+h,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var _;if(e.backgroundColor)_=J.makeVList({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]},t);else{var v=/cancel|phase/.test(r)?[`svg-align`]:[];_=J.makeVList({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:v}]},t)}return/cancel/.test(r)&&(_.height=n.height,_.depth=n.depth),/cancel/.test(r)&&!s?J.makeSpan([`mord`,`cancel-lap`],[_],t):J.makeSpan([`mord`],[_],t)},Al=(e,t)=>{var n=0,r=new X.MathNode(e.label.indexOf(`colorbox`)>-1?`mpadded`:`menclose`,[gc(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+i+`em solid `+String(e.borderColor))}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`)}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r};Y({type:`enclose`,names:[`\\colorbox`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`text`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Dc(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:kl,mathmlBuilder:Al}),Y({type:`enclose`,names:[`\\fcolorbox`],props:{numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`text`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Dc(t[0],`color-token`).color,o=Dc(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}},htmlBuilder:kl,mathmlBuilder:Al}),Y({type:`enclose`,names:[`\\fbox`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\fbox`,body:t[0]}}}),Y({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\sout`,`\\phase`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:kl,mathmlBuilder:Al}),Y({type:`enclose`,names:[`\\angl`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\angl`,body:t[0]}}});var jl={};function Ml(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c<n.length;++c)jl[n[c]]=s;a&&(Hs[t]=a),o&&(Us[t]=o)}var Nl={};function Z(e,t){Nl[e]=t}function Pl(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n===`\\relax`&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n===`\\hline`||n===`\\hdashline`;)e.consume(),t.push(n===`\\hdashline`),e.consumeSpaces(),n=e.fetch().text;return t}var Fl=e=>{if(!e.parser.settings.displayMode)throw new R(`{`+e.envName+`} can be used only in display mode.`)};function Il(e){if(e.indexOf(`ed`)===-1)return e.indexOf(`*`)===-1}function Ll(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:c,singleRow:l,emptySingleRow:u,maxNumCols:d,leqno:f}=t;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new R(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new fa(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(Pl(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup(),x={type:`ordgroup`,mode:e.mode,body:x},n&&(x={type:`styling`,mode:e.mode,style:n,body:[x]}),m.push(x);var S=e.fetch().text;if(S===`&`){if(d&&m.length===d){if(l||s)throw new R(`Too many tab characters: &`,e.nextToken);e.settings.reportNonstrict(`textEnv`,`Too few columns specified in the {array} column argument.`)}e.consume()}else if(S===`\\end`){b(),m.length===1&&x.type===`styling`&&x.body[0].body.length===0&&(h.length>1||!u)&&h.pop(),_.length<h.length+1&&_.push([]);break}else if(S===`\\\\`){e.consume();var ee=void 0;e.gullet.future().text!==` `&&(ee=e.parseSizeGroup(!0)),g.push(ee?ee.value:null),b(),_.push(Pl(e)),m=[],h.push(m),y()}else throw new R(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:h,cols:a,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:_,colSeparationType:s,tags:v,leqno:f}}function Rl(e){return e.slice(0,1)===`d`?`display`:`text`}var zl=function(e,t){var n,r,i=e.body.length,a=e.hLinesBeforeRow,o=0,s=Array(i),c=[],l=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,d=5*u;e.colSeparationType&&e.colSeparationType===`small`&&(d=.2778*(t.havingStyle(Ua.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?So({number:3,unit:`ex`},t):12*u,p=3*u,m=e.arraystretch*f,h=.7*m,g=.3*m,_=0;function v(e){for(var t=0;t<e.length;++t)t>0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n<e.body.length;++n){var y=e.body[n],b=h,x=g;o<y.length&&(o=y.length);var S=Array(y.length);for(r=0;r<y.length;++r){var ee=ic(y[r],t);x<ee.depth&&(x=ee.depth),b<ee.height&&(b=ee.height),S[r]=ee}var te=e.rowGaps[n],ne=0;te&&(ne=So(te,t),ne>0&&(ne+=g,x<ne&&(x=ne),ne=0)),e.addJot&&(x+=p),S.height=b,S.depth=x,_+=b,S.pos=_,_+=x+ne,s[n]=S,v(a[n+1])}var C=_/2+t.fontMetrics().axisHeight,re=e.cols||[],ie=[],ae,w,oe=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var se=s[n],ce=se.pos-C,le=e.tags[n],ue=void 0;ue=le===!0?J.makeSpan([`eqn-num`],[],t):le===!1?J.makeSpan([],[],t):J.makeSpan([],Qs(le,t,!0),t),ue.depth=se.depth,ue.height=se.height,oe.push({type:`elem`,elem:ue,shift:ce})}for(r=0,w=0;r<o||w<re.length;++r,++w){for(var de=re[w]||{},fe=!0;de.type===`separator`;){if(fe||(ae=J.makeSpan([`arraycolsep`],[]),ae.style.width=z(t.fontMetrics().doubleRuleSep),ie.push(ae)),de.separator===`|`||de.separator===`:`){var pe=de.separator===`|`?`solid`:`dashed`,me=J.makeSpan([`vertical-separator`],[],t);me.style.height=z(_),me.style.borderRightWidth=z(l),me.style.borderRightStyle=pe,me.style.margin=`0 `+z(-l/2);var he=_-C;he&&(me.style.verticalAlign=z(-he)),ie.push(me)}else throw new R(`Invalid separator type: `+de.separator);w++,de=re[w]||{},fe=!1}if(!(r>=o)){var ge=void 0;(r>0||e.hskipBeforeAndAfter)&&(ge=Ca.deflt(de.pregap,d),ge!==0&&(ae=J.makeSpan([`arraycolsep`],[]),ae.style.width=z(ge),ie.push(ae)));var _e=[];for(n=0;n<i;++n){var ve=s[n],ye=ve[r];if(ye){var be=ve.pos-C;ye.depth=ve.depth,ye.height=ve.height,_e.push({type:`elem`,elem:ye,shift:be})}}_e=J.makeVList({positionType:`individualShift`,children:_e},t),_e=J.makeSpan([`col-align-`+(de.align||`c`)],[_e]),ie.push(_e),(r<o-1||e.hskipBeforeAndAfter)&&(ge=Ca.deflt(de.postgap,d),ge!==0&&(ae=J.makeSpan([`arraycolsep`],[]),ae.style.width=z(ge),ie.push(ae)))}}if(s=J.makeSpan([`mtable`],ie),c.length>0){for(var xe=J.makeLineSpan(`hline`,t,l),Se=J.makeLineSpan(`hdashline`,t,l),Ce=[{type:`elem`,elem:s,shift:0}];c.length>0;){var we=c.pop(),Te=we.pos-C;we.isDashed?Ce.push({type:`elem`,elem:Se,shift:Te}):Ce.push({type:`elem`,elem:xe,shift:Te})}s=J.makeVList({positionType:`individualShift`,children:Ce},t)}if(oe.length===0)return J.makeSpan([`mord`],[s],t);var Ee=J.makeVList({positionType:`individualShift`,children:oe},t);return Ee=J.makeSpan([`tag`],[Ee],t),J.makeFragment([s,Ee])},Bl={c:`center `,l:`left `,r:`right `},Vl=function(e,t){for(var n=[],r=new X.MathNode(`mtd`,[],[`mtr-glue`]),i=new X.MathNode(`mtd`,[],[`mml-eqn-num`]),a=0;a<e.body.length;a++){for(var o=e.body[a],s=[],c=0;c<o.length;c++)s.push(new X.MathNode(`mtd`,[gc(o[c],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new X.MathNode(`mtr`,s))}var l=new X.MathNode(`mtable`,n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);l.setAttribute(`rowspacing`,z(u));var d=``,f=``;if(e.cols&&e.cols.length>0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++)p[v].type===`align`?(f+=Bl[p[v].align],h&&(m+=`none `),h=!0):p[v].type===`separator`&&(h&&=(m+=p[v].separator===`|`?`solid `:`dashed `,!1));l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var y=e.cols||[],b=``,x=1;x<y.length;x++)b+=x%2?`0em `:`1em `;l.setAttribute(`columnspacing`,b.trim())}else e.colSeparationType===`alignat`||e.colSeparationType===`gather`?l.setAttribute(`columnspacing`,`0em`):e.colSeparationType===`small`?l.setAttribute(`columnspacing`,`0.2778em`):e.colSeparationType===`CD`?l.setAttribute(`columnspacing`,`0.5em`):l.setAttribute(`columnspacing`,`1em`);var S=``,ee=e.hLinesBeforeRow;d+=ee[0].length>0?`left `:``,d+=ee[ee.length-1].length>0?`right `:``;for(var te=1;te<ee.length-1;te++)S+=ee[te].length===0?`none `:ee[te][0]?`dashed `:`solid `;return/[sd]/.test(S)&&l.setAttribute(`rowlines`,S.trim()),d!==``&&(l=new X.MathNode(`menclose`,[l]),l.setAttribute(`notation`,d.trim())),e.arraystretch&&e.arraystretch<1&&(l=new X.MathNode(`mstyle`,[l]),l.setAttribute(`scriptlevel`,`1`)),l},Hl=function(e,t){e.envName.indexOf(`ed`)===-1&&Fl(e);var n=[],r=e.envName.indexOf(`at`)>-1?`alignat`:`align`,i=e.envName===`split`,a=Ll(e.parser,{cols:n,addJot:!0,autoTag:i?void 0:Il(e.envName),emptySingleRow:!0,colSeparationType:r,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},`display`),o,s=0,c={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){for(var l=``,u=0;u<t[0].body.length;u++){var d=Dc(t[0].body[u],`textord`);l+=d.text}o=Number(l),s=o*2}var f=!s;a.body.forEach(function(e){for(var t=1;t<e.length;t+=2)Dc(Dc(e[t],`styling`).body[0],`ordgroup`).body.unshift(c);if(f)s<e.length&&(s=e.length);else{var n=e.length/2;if(o<n)throw new R(`Too many math in a row: `+(`expected `+o+`, but got `+n),e[0])}});for(var p=0;p<s;++p){var m=`r`,h=0;p%2==1?m=`l`:p>0&&f&&(h=1),n[p]={type:`align`,align:m,pregap:h,postgap:0}}return a.colSeparationType=f?`align`:`alignat`,a};Ml({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(kc(t[0])?[t[0]]:Dc(t[0],`ordgroup`).body).map(function(e){var t=Oc(e).text;if(`lcr`.indexOf(t)!==-1)return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new R(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return Ll(e.parser,r,Rl(e.envName))},htmlBuilder:zl,mathmlBuilder:Vl}),Ml({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,`lcr`.indexOf(n)===-1)throw new R(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=Ll(e.parser,r,Rl(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:zl,mathmlBuilder:Vl}),Ml({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=Ll(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:zl,mathmlBuilder:Vl}),Ml({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(kc(t[0])?[t[0]]:Dc(t[0],`ordgroup`).body).map(function(e){var t=Oc(e).text;if(`lc`.indexOf(t)!==-1)return{type:`align`,align:t};throw new R(`Unknown column alignment: `+t,e)});if(n.length>1)throw new R(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if(r=Ll(e.parser,r,`script`),r.body.length>0&&r.body[0].length>1)throw new R(`{subarray} can contain only one column`);return r},htmlBuilder:zl,mathmlBuilder:Vl}),Ml({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=Ll(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},Rl(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.indexOf(`r`)>-1?`.`:`\\{`,right:e.envName.indexOf(`r`)>-1?`\\}`:`.`,rightColor:void 0}},htmlBuilder:zl,mathmlBuilder:Vl}),Ml({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:Hl,htmlBuilder:zl,mathmlBuilder:Vl}),Ml({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){Ca.contains([`gather`,`gather*`],e.envName)&&Fl(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:Il(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Ll(e.parser,t,`display`)},htmlBuilder:zl,mathmlBuilder:Vl}),Ml({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:Hl,htmlBuilder:zl,mathmlBuilder:Vl}),Ml({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){Fl(e);var t={autoTag:Il(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Ll(e.parser,t,`display`)},htmlBuilder:zl,mathmlBuilder:Vl}),Ml({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return Fl(e),Uc(e.parser)},htmlBuilder:zl,mathmlBuilder:Vl}),Z(`\\nonumber`,`\\gdef\\@eqnsw{0}`),Z(`\\notag`,`\\nonumber`),Y({type:`text`,names:[`\\hline`,`\\hdashline`],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new R(e.funcName+` valid only within array environment`)}});var Ul=jl;Y({type:`environment`,names:[`\\begin`,`\\end`],props:{numArgs:1,argTypes:[`text`]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!==`ordgroup`)throw new R(`Invalid environment name`,i);for(var a=``,o=0;o<i.body.length;++o)a+=Dc(i.body[o],`textord`).text;if(r===`\\begin`){if(!Ul.hasOwnProperty(a))throw new R(`No such environment: `+a,i);var s=Ul[a],{args:c,optArgs:l}=n.parseArguments(`\\begin{`+a+`}`,s),u={mode:n.mode,envName:a,parser:n},d=s.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=Dc(n.parseFunction(),`environment`);if(p.name!==a)throw new R(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var Wl=(e,t)=>{var n=e.font,r=t.withFont(n);return ic(e.body,r)},Gl=(e,t)=>{var n=e.font,r=t.withFont(n);return gc(e.body,r)},Kl={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`,"\\bm":`\\boldsymbol`};Y({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=Gs(t[0]),a=r;return a in Kl&&(a=Kl[a]),{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:Wl,mathmlBuilder:Gl}),Y({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],i=Ca.isCharacterBox(r);return{type:`mclass`,mode:n.mode,mclass:Lc(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:i}}}),Y({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}},htmlBuilder:Wl,mathmlBuilder:Gl});var ql=(e,t)=>{var n=t;return e===`display`?n=n.id>=Ua.SCRIPT.id?n.text():Ua.DISPLAY:e===`text`&&n.size===Ua.DISPLAY.size?n=Ua.TEXT:e===`script`?n=Ua.SCRIPT:e===`scriptscript`&&(n=Ua.SCRIPTSCRIPT),n},Jl=(e,t)=>{var n=ql(e.size,t.style),r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=ic(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<c?c:o.depth}a=t.havingStyle(i);var l=ic(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=So(e.barSize,t),u=J.makeLineSpan(`frac-line`,t,d)):u=J.makeLineSpan(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===Ua.DISPLAY.size||e.size===`display`?(p=t.fontMetrics().num1,m=d>0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d)<m&&(p+=m-(p-o.depth-(_+.5*d))),_-.5*d-(l.height-h)<m&&(h+=m-(_-.5*d-(l.height-h)));var v=-(_-.5*d);g=J.makeVList({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:u,shift:v},{type:`elem`,elem:o,shift:-p}]},t)}else{var y=p-o.depth-(l.height-h);y<m&&(p+=.5*(m-y),h+=.5*(m-y)),g=J.makeVList({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:o,shift:-p}]},t)}a=t.havingStyle(n),g.height*=a.sizeMultiplier/t.sizeMultiplier,g.depth*=a.sizeMultiplier/t.sizeMultiplier;var b=n.size===Ua.DISPLAY.size?t.fontMetrics().delim1:n.size===Ua.SCRIPTSCRIPT.size?t.havingStyle(Ua.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?rc(t,[`mopen`]):wl.customSizedDelim(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?J.makeSpan([]):e.rightDelim==null?rc(t,[`mclose`]):wl.customSizedDelim(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return J.makeSpan([`mord`].concat(a.sizingClasses(t)),[x,J.makeSpan([`mfrac`],[g]),S],t)},Yl=(e,t)=>{var n=new X.MathNode(`mfrac`,[gc(e.numer,t),gc(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=So(e.barSize,t);n.setAttribute(`linethickness`,z(r))}var i=ql(e.size,t.style);if(i.size!==t.style.size){n=new X.MathNode(`mstyle`,[n]);var a=i.size===Ua.DISPLAY.size?`true`:`false`;n.setAttribute(`displaystyle`,a),n.setAttribute(`scriptlevel`,`0`)}if(e.leftDelim!=null||e.rightDelim!=null){var o=[];if(e.leftDelim!=null){var s=new X.MathNode(`mo`,[new X.TextNode(e.leftDelim.replace(`\\`,``))]);s.setAttribute(`fence`,`true`),o.push(s)}if(o.push(n),e.rightDelim!=null){var c=new X.MathNode(`mo`,[new X.TextNode(e.rightDelim.replace(`\\`,``))]);c.setAttribute(`fence`,`true`),o.push(c)}return dc(o)}return n};Y({type:`genfrac`,names:[`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1],o,s=null,c=null,l=`auto`;switch(r){case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}switch(r){case`\\dfrac`:case`\\dbinom`:l=`display`;break;case`\\tfrac`:case`\\tbinom`:l=`text`}return{type:`genfrac`,mode:n.mode,continued:!1,numer:i,denom:a,hasBarLine:o,leftDelim:s,rightDelim:c,size:l,barSize:null}},htmlBuilder:Jl,mathmlBuilder:Yl}),Y({type:`genfrac`,names:[`\\cfrac`],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=t[1];return{type:`genfrac`,mode:n.mode,continued:!0,numer:i,denom:a,hasBarLine:!0,leftDelim:null,rightDelim:null,size:`display`,barSize:null}}}),Y({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var Xl=[`display`,`text`,`script`,`scriptscript`],Zl=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};Y({type:`genfrac`,names:[`\\genfrac`],props:{numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=Gs(t[0]),o=a.type===`atom`&&a.family===`open`?Zl(a.text):null,s=Gs(t[1]),c=s.type===`atom`&&s.family===`close`?Zl(s.text):null,l=Dc(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=`auto`,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=Dc(p.body[0],`textord`);f=Xl[Number(m.text)]}}else p=Dc(p,`textord`),f=Xl[Number(p.text)];return{type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c,size:f}},htmlBuilder:Jl,mathmlBuilder:Yl}),Y({type:`infix`,names:[`\\above`],props:{numArgs:1,argTypes:[`size`],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:Dc(t[0],`size`).value,token:i}}}),Y({type:`genfrac`,names:[`\\\\abovefrac`],props:{numArgs:3,argTypes:[`math`,`size`,`math`]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=Sa(Dc(t[1],`infix`).size),o=t[2],s=a.number>0;return{type:`genfrac`,mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null,size:`auto`}},htmlBuilder:Jl,mathmlBuilder:Yl});var Ql=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?ic(e.sup,t.havingStyle(n.sup()),t):ic(e.sub,t.havingStyle(n.sub()),t),i=Dc(e.base,`horizBrace`)):i=Dc(e,`horizBrace`);var a=ic(i.base,t.havingBaseStyle(Ua.DISPLAY)),o=Ec.svgSpan(i,t),s;if(i.isOver?(s=J.makeVList({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o}]},t),s.children[0].children[0].children[1].classes.push(`svg-align`)):(s=J.makeVList({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o},{type:`kern`,size:.1},{type:`elem`,elem:a}]},t),s.children[0].children[0].children[0].classes.push(`svg-align`)),r){var c=J.makeSpan([`mord`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?J.makeVList({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]},t):J.makeVList({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]},t)}return J.makeSpan([`mord`,i.isOver?`mover`:`munder`],[s],t)};Y({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`horizBrace`,mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:Ql,mathmlBuilder:(e,t)=>{var n=Ec.mathMLnode(e.label);return new X.MathNode(e.isOver?`mover`:`munder`,[gc(e.base,t),n])}}),Y({type:`href`,names:[`\\href`],props:{numArgs:2,argTypes:[`url`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=Dc(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:Ks(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=Qs(e.body,t,!1);return J.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=hc(e.body,t);return n instanceof cc||(n=new cc(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),Y({type:`href`,names:[`\\url`],props:{numArgs:1,argTypes:[`url`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Dc(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a<r.length;a++){var o=r[a];o===`~`&&(o=`\\textasciitilde`),i.push({type:`textord`,mode:`text`,text:o})}var s={type:`text`,mode:n.mode,font:`\\texttt`,body:i};return{type:`href`,mode:n.mode,href:r,body:Ks(s)}}}),Y({type:`hbox`,names:[`\\hbox`],props:{numArgs:1,argTypes:[`text`],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:`hbox`,mode:n.mode,body:Ks(t[0])}},htmlBuilder(e,t){var n=Qs(e.body,t,!1);return J.makeFragment(n)},mathmlBuilder(e,t){return new X.MathNode(`mrow`,mc(e.body,t))}}),Y({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],props:{numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,token:i}=e,a=Dc(t[0],`raw`).string,o=t[1];n.settings.strict&&n.settings.reportNonstrict(`htmlExtension`,`HTML extension is disabled on strict mode`);var s,c={};switch(r){case`\\htmlClass`:c.class=a,s={command:`\\htmlClass`,class:a};break;case`\\htmlId`:c.id=a,s={command:`\\htmlId`,id:a};break;case`\\htmlStyle`:c.style=a,s={command:`\\htmlStyle`,style:a};break;case`\\htmlData`:for(var l=a.split(`,`),u=0;u<l.length;u++){var d=l[u].split(`=`);if(d.length!==2)throw new R(`Error parsing key-value for \\htmlData`);c[`data-`+d[0].trim()]=d[1].trim()}s={command:`\\htmlData`,attributes:c};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(s)?{type:`html`,mode:n.mode,attributes:c,body:Ks(o)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=Qs(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=J.makeSpan(r,n,t);for(var a in e.attributes)a!==`class`&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>hc(e.body,t)}),Y({type:`htmlmathml`,names:[`\\html@mathml`],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`htmlmathml`,mode:n.mode,html:Ks(t[0]),mathml:Ks(t[1])}},htmlBuilder:(e,t)=>{var n=Qs(e.html,t,!1);return J.makeFragment(n)},mathmlBuilder:(e,t)=>hc(e.mathml,t)});var $l=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new R(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!xo(n))throw new R(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};Y({type:`includegraphics`,names:[`\\includegraphics`],props:{numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=Dc(n[0],`raw`).string.split(`,`),l=0;l<c.length;l++){var u=c[l].split(`=`);if(u.length===2){var d=u[1].trim();switch(u[0].trim()){case`alt`:s=d;break;case`width`:i=$l(d);break;case`height`:a=$l(d);break;case`totalheight`:o=$l(d);break;default:throw new R(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=Dc(t[0],`url`).url;return s===``&&(s=f,s=s.replace(/^.*[\\/]/,``),s=s.substring(0,s.lastIndexOf(`.`))),r.settings.isTrusted({command:`\\includegraphics`,url:f})?{type:`includegraphics`,mode:r.mode,alt:s,width:i,height:a,totalheight:o,src:f}:r.formatUnsupportedCmd(`\\includegraphics`)},htmlBuilder:(e,t)=>{var n=So(e.height,t),r=0;e.totalheight.number>0&&(r=So(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=So(e.width,t));var a={height:z(n+r)};i>0&&(a.width=z(i)),r>0&&(a.verticalAlign=z(-r));var o=new Ao(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new X.MathNode(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=So(e.height,t),i=0;if(e.totalheight.number>0&&(i=So(e.totalheight,t)-r,n.setAttribute(`valign`,z(-i))),n.setAttribute(`height`,z(r+i)),e.width.number>0){var a=So(e.width,t);n.setAttribute(`width`,z(a))}return n.setAttribute(`src`,e.src),n}}),Y({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],props:{numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=Dc(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`)),n.mode!==`math`&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` works only in math mode`)):o&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` doesn't support mu units`)}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return J.makeGlue(e.dimension,t)},mathmlBuilder(e,t){var n=So(e.dimension,t);return new X.SpaceNode(n)}}),Y({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=J.makeSpan([],[ic(e.body,t)]),n=J.makeSpan([`inner`],[n],t)):n=J.makeSpan([`inner`],[ic(e.body,t)]);var r=J.makeSpan([`fix`],[]),i=J.makeSpan([e.alignment],[n,r],t),a=J.makeSpan([`strut`]);return a.style.height=z(i.height+i.depth),i.depth&&(a.style.verticalAlign=z(-i.depth)),i.children.unshift(a),i=J.makeSpan([`thinbox`],[i],t),J.makeSpan([`mord`,`vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new X.MathNode(`mpadded`,[gc(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),Y({type:`styling`,names:[`\\(`,`$`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,body:o}}}),Y({type:`text`,names:[`\\)`,`\\]`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new R(`Mismatched `+e.funcName)}});var eu=(e,t)=>{switch(t.style.size){case Ua.DISPLAY.size:return e.display;case Ua.TEXT.size:return e.text;case Ua.SCRIPT.size:return e.script;case Ua.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Y({type:`mathchoice`,names:[`\\mathchoice`],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`mathchoice`,mode:n.mode,display:Ks(t[0]),text:Ks(t[1]),script:Ks(t[2]),scriptscript:Ks(t[3])}},htmlBuilder:(e,t)=>{var n=Qs(eu(e,t),t,!1);return J.makeFragment(n)},mathmlBuilder:(e,t)=>hc(eu(e,t),t)});var tu=(e,t,n,r,i,a,o)=>{e=J.makeSpan([],[e]);var s=n&&Ca.isCharacterBox(n),c,l;if(t){var u=ic(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=ic(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c){var p=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o;f=J.makeVList({positionType:`bottom`,positionData:p,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:z(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:z(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]},r)}else if(c){var m=e.height-o;f=J.makeVList({positionType:`top`,positionData:m,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:z(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]},r)}else if(l){var h=e.depth+o;f=J.makeVList({positionType:`bottom`,positionData:h,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:z(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]},r)}else return e;var g=[f];if(c&&a!==0&&!s){var _=J.makeSpan([`mspace`],[],r);_.style.marginRight=z(a),g.unshift(_)}return J.makeSpan([`mop`,`op-limits`],g,r)},nu=[`\\smallint`],ru=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Dc(e.base,`op`),i=!0):a=Dc(e,`op`);var o=t.style,s=!1;o.size===Ua.DISPLAY.size&&a.symbol&&!Ca.contains(nu,a.name)&&(s=!0);var c;if(a.symbol){var l=s?`Size2-Regular`:`Size1-Regular`,u=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(u=a.name.slice(1),a.name=u===`oiint`?`\\iint`:`\\iiint`),c=J.makeSymbol(a.name,l,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),u.length>0){var d=c.italic,f=J.staticSvg(u+`Size`+(s?`2`:`1`),t);c=J.makeVList({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]},t),a.name=`\\`+u,c.classes.unshift(`mop`),c.italic=d}}else if(a.body){var p=Qs(a.body,t,!0);p.length===1&&p[0]instanceof Mo?(c=p[0],c.classes[0]=`mop`):c=J.makeSpan([`mop`],p,t)}else{for(var m=[],h=1;h<a.name.length;h++)m.push(J.mathsym(a.name[h],a.mode,t));c=J.makeSpan([`mop`],m,t)}var g=0,_=0;return(c instanceof Mo||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic),i?tu(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=z(g)),c)},iu=(e,t)=>{var n;if(e.symbol)n=new cc(`mo`,[uc(e.name,e.mode)]),Ca.contains(nu,e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new cc(`mo`,mc(e.body,t));else{n=new cc(`mi`,[new lc(e.name.slice(1))]);var r=new cc(`mo`,[uc(`⁡`,`text`)]);n=e.parentIsSupSub?new cc(`mrow`,[n,r]):sc([n,r])}return n},au={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};Y({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=au[i]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:ru,mathmlBuilder:iu}),Y({type:`op`,names:[`\\mathop`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Ks(r)}},htmlBuilder:ru,mathmlBuilder:iu});var ou={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};Y({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ru,mathmlBuilder:iu}),Y({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:ru,mathmlBuilder:iu}),Y({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=ou[r]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:ru,mathmlBuilder:iu});var su=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Dc(e.base,`operatorname`),i=!0):a=Dc(e,`operatorname`);var o;if(a.body.length>0){for(var s=Qs(a.body.map(e=>{var t=e.text;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c<s.length;c++){var l=s[c];l instanceof Mo&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=J.makeSpan([`mop`],s,t)}else o=J.makeSpan([`mop`],[],t);return i?tu(o,n,r,t,t.style,0,0):o};Y({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`operatorname`,mode:n.mode,body:Ks(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:su,mathmlBuilder:(e,t)=>{for(var n=mc(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof X.SpaceNode)){if(a instanceof X.MathNode)switch(a.type){case`mi`:case`mn`:case`ms`:case`mspace`:case`mtext`:break;case`mo`:var o=a.children[0];a.children.length===1&&o instanceof X.TextNode?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}}if(r){var s=n.map(e=>e.toText()).join(``);n=[new X.TextNode(s)]}var c=new X.MathNode(`mi`,n);c.setAttribute(`mathvariant`,`normal`);var l=new X.MathNode(`mo`,[uc(`⁡`,`text`)]);return e.parentIsSupSub?new X.MathNode(`mrow`,[c,l]):X.newDocumentFragment([c,l])}}),Z(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),Ws({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?J.makeFragment(Qs(e.body,t,!1)):J.makeSpan([`mord`],Qs(e.body,t,!0),t)},mathmlBuilder(e,t){return hc(e.body,t,!0)}}),Y({type:`overline`,names:[`\\overline`],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=ic(e.body,t.havingCrampedStyle()),r=J.makeLineSpan(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness,a=J.makeVList({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]},t);return J.makeSpan([`mord`,`overline`],[a],t)},mathmlBuilder(e,t){var n=new X.MathNode(`mo`,[new X.TextNode(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new X.MathNode(`mover`,[gc(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),Y({type:`phantom`,names:[`\\phantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`phantom`,mode:n.mode,body:Ks(r)}},htmlBuilder:(e,t)=>{var n=Qs(e.body,t.withPhantom(),!1);return J.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=mc(e.body,t);return new X.MathNode(`mphantom`,n)}}),Y({type:`hphantom`,names:[`\\hphantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`hphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=J.makeSpan([],[ic(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0;return n=J.makeVList({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]},t),J.makeSpan([`mord`],[n],t)},mathmlBuilder:(e,t)=>{var n=mc(Ks(e.body),t),r=new X.MathNode(`mphantom`,n),i=new X.MathNode(`mpadded`,[r]);return i.setAttribute(`height`,`0px`),i.setAttribute(`depth`,`0px`),i}}),Y({type:`vphantom`,names:[`\\vphantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=J.makeSpan([`inner`],[ic(e.body,t.withPhantom())]),r=J.makeSpan([`fix`],[]);return J.makeSpan([`mord`,`rlap`],[n,r],t)},mathmlBuilder:(e,t)=>{var n=mc(Ks(e.body),t),r=new X.MathNode(`mphantom`,n),i=new X.MathNode(`mpadded`,[r]);return i.setAttribute(`width`,`0px`),i}}),Y({type:`raisebox`,names:[`\\raisebox`],props:{numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Dc(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=ic(e.body,t),r=So(e.dy,t);return J.makeVList({positionType:`shift`,positionData:-r,children:[{type:`elem`,elem:n}]},t)},mathmlBuilder(e,t){var n=new X.MathNode(`mpadded`,[gc(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}}),Y({type:`internal`,names:[`\\relax`],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:`internal`,mode:t.mode}}}),Y({type:`rule`,names:[`\\rule`],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`]},handler(e,t,n){var{parser:r}=e,i=n[0],a=Dc(t[0],`size`),o=Dc(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&Dc(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=J.makeSpan([`mord`,`rule`],[],t),r=So(e.width,t),i=So(e.height,t),a=e.shift?So(e.shift,t):0;return n.style.borderRightWidth=z(r),n.style.borderTopWidth=z(i),n.style.bottom=z(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=So(e.width,t),r=So(e.height,t),i=e.shift?So(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new X.MathNode(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,z(n)),o.setAttribute(`height`,z(r));var s=new X.MathNode(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,z(i)):(s.setAttribute(`height`,z(i)),s.setAttribute(`depth`,z(-i))),s.setAttribute(`voffset`,z(i)),s}});function cu(e,t,n){for(var r=Qs(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`sizing`);o<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[o+1]===`reset-size`+t.size&&(r[a].classes[o+1]=`reset-size`+n.size),r[a].height*=i,r[a].depth*=i}return J.makeFragment(r)}var lu=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];Y({type:`sizing`,names:lu,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:lu.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return cu(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=mc(e.body,n),i=new X.MathNode(`mstyle`,r);return i.setAttribute(`mathsize`,z(n.sizeMultiplier)),i}}),Y({type:`smash`,names:[`\\smash`],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&Dc(n[0],`ordgroup`);if(o)for(var s=``,c=0;c<o.body.length;++c)if(s=o.body[c].text,s===`t`)i=!0;else if(s===`b`)a=!0;else{i=!1,a=!1;break}else i=!0,a=!0;var l=t[0];return{type:`smash`,mode:r.mode,body:l,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=J.makeSpan([],[ic(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var i=0;i<n.children.length;i++)n.children[i].depth=0;var a=J.makeVList({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]},t);return J.makeSpan([`mord`],[a],t)},mathmlBuilder:(e,t)=>{var n=new X.MathNode(`mpadded`,[gc(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),Y({type:`sqrt`,names:[`\\sqrt`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=ic(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=J.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<Ua.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,o=n.height+n.depth+a+r,{span:s,ruleWidth:c,advanceWidth:l}=wl.sqrtImage(o,t),u=s.height-c;u>n.height+n.depth+a&&(a=(a+u-n.height-n.depth)/2);var d=s.height-n.height-a-c;n.style.paddingLeft=z(l);var f=J.makeVList({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+d)},{type:`elem`,elem:s},{type:`kern`,size:c}]},t);if(e.index){var p=t.havingStyle(Ua.SCRIPTSCRIPT),m=ic(e.index,p,t),h=.6*(f.height-f.depth),g=J.makeVList({positionType:`shift`,positionData:-h,children:[{type:`elem`,elem:m}]},t),_=J.makeSpan([`root`],[g]);return J.makeSpan([`mord`,`sqrt`],[_,f],t)}return J.makeSpan([`mord`,`sqrt`],[f],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new X.MathNode(`mroot`,[gc(n,t),gc(r,t)]):new X.MathNode(`msqrt`,[gc(n,t)])}});var uu={display:Ua.DISPLAY,text:Ua.TEXT,script:Ua.SCRIPT,scriptscript:Ua.SCRIPTSCRIPT};Y({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=uu[e.style],r=t.havingStyle(n).withFont(``);return cu(e.body,r,t)},mathmlBuilder(e,t){var n=uu[e.style],r=t.havingStyle(n),i=mc(e.body,r),a=new X.MathNode(`mstyle`,i),o={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return a.setAttribute(`scriptlevel`,o[0]),a.setAttribute(`displaystyle`,o[1]),a}});var du=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===Ua.DISPLAY.size||n.alwaysHandleSupSub)?ru:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===Ua.DISPLAY.size||n.limits)?su:null:n.type===`accent`?Ca.isCharacterBox(n.base)?Ac:null:n.type===`horizBrace`&&!e.sub===n.isOver?Ql:null:null};Ws({type:`supsub`,htmlBuilder(e,t){var n=du(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,o=ic(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&Ca.isCharacterBox(r);if(i){var p=t.havingStyle(t.style.sup());s=ic(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=ic(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===Ua.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=z(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof Mo||y)&&(v=z(-o.italic))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)<x){d=x-(u-s.depth)+c.height;var S=.8*l.xHeight-(u-s.depth);S>0&&(u+=S,d-=S)}var ee=[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}];b=J.makeVList({positionType:`individualShift`,children:ee},t)}else if(c){d=Math.max(d,l.sub1,c.height-.8*l.xHeight);var te=[{type:`elem`,elem:c,marginLeft:v,marginRight:_}];b=J.makeVList({positionType:`shift`,positionData:d,children:te},t)}else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=J.makeVList({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]},t);else throw Error(`supsub must have either sup or sub.`);var ne=nc(o,`right`)||`mord`;return J.makeSpan([ne],[o,J.makeSpan([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[gc(e.base,t)];e.sub&&a.push(gc(e.sub,t)),e.sup&&a.push(gc(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===Ua.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===Ua.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===Ua.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===Ua.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===Ua.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===Ua.DISPLAY)?`munder`:`msub`}return new X.MathNode(o,a)}}),Ws({type:`atom`,htmlBuilder(e,t){return J.mathsym(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new X.MathNode(`mo`,[uc(e.text,e.mode)]);if(e.family===`bin`){var r=fc(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var fu={mi:`italic`,mn:`normal`,mtext:`normal`};Ws({type:`mathord`,htmlBuilder(e,t){return J.makeOrd(e,t,`mathord`)},mathmlBuilder(e,t){var n=new X.MathNode(`mi`,[uc(e.text,e.mode,t)]),r=fc(e,t)||`italic`;return r!==fu[n.type]&&n.setAttribute(`mathvariant`,r),n}}),Ws({type:`textord`,htmlBuilder(e,t){return J.makeOrd(e,t,`textord`)},mathmlBuilder(e,t){var n=uc(e.text,e.mode,t),r=fc(e,t)||`normal`,i=e.mode===`text`?new X.MathNode(`mtext`,[n]):/[0-9]/.test(e.text)?new X.MathNode(`mn`,[n]):e.text===`\\prime`?new X.MathNode(`mo`,[n]):new X.MathNode(`mi`,[n]);return r!==fu[i.type]&&i.setAttribute(`mathvariant`,r),i}});var pu={"\\nobreak":`nobreak`,"\\allowbreak":`allowbreak`},mu={" ":{},"\\ ":{},"~":{className:`nobreak`},"\\space":{},"\\nobreakspace":{className:`nobreak`}};Ws({type:`spacing`,htmlBuilder(e,t){if(mu.hasOwnProperty(e.text)){var n=mu[e.text].className||``;if(e.mode===`text`){var r=J.makeOrd(e,t,`textord`);return r.classes.push(n),r}return J.makeSpan([`mspace`,n],[J.mathsym(e.text,e.mode,t)],t)}if(pu.hasOwnProperty(e.text))return J.makeSpan([`mspace`,pu[e.text]],[],t);throw new R(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(mu.hasOwnProperty(e.text))n=new X.MathNode(`mtext`,[new X.TextNode(`\xA0`)]);else if(pu.hasOwnProperty(e.text))return new X.MathNode(`mspace`);else throw new R(`Unknown type of space "`+e.text+`"`);return n}});var hu=()=>{var e=new X.MathNode(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};Ws({type:`tag`,mathmlBuilder(e,t){var n=new X.MathNode(`mtable`,[new X.MathNode(`mtr`,[hu(),new X.MathNode(`mtd`,[hc(e.body,t)]),hu(),new X.MathNode(`mtd`,[hc(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var gu={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},_u={"\\textbf":`textbf`,"\\textmd":`textmd`},vu={"\\textit":`textit`,"\\textup":`textup`},yu=(e,t)=>{var n=e.font;return n?gu[n]?t.withTextFontFamily(gu[n]):_u[n]?t.withTextFontWeight(_u[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(vu[n]):t};Y({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],props:{numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`text`,mode:n.mode,body:Ks(i),font:r}},htmlBuilder(e,t){var n=yu(e,t),r=Qs(e.body,n,!0);return J.makeSpan([`mord`,`text`],r,n)},mathmlBuilder(e,t){var n=yu(e,t);return hc(e.body,n)}}),Y({type:`underline`,names:[`\\underline`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`underline`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=ic(e.body,t),r=J.makeLineSpan(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness,a=J.makeVList({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]},t);return J.makeSpan([`mord`,`underline`],[a],t)},mathmlBuilder(e,t){var n=new X.MathNode(`mo`,[new X.TextNode(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new X.MathNode(`munder`,[gc(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),Y({type:`vcenter`,names:[`\\vcenter`],props:{numArgs:1,argTypes:[`original`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`vcenter`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=ic(e.body,t),r=t.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return J.makeVList({positionType:`shift`,positionData:i,children:[{type:`elem`,elem:n}]},t)},mathmlBuilder(e,t){return new X.MathNode(`mpadded`,[gc(e.body,t)],[`vcenter`])}}),Y({type:`verb`,names:[`\\verb`],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new R(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=bu(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(J.makeSymbol(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return J.makeSpan([`mord`,`text`].concat(i.sizingClasses(t)),J.tryCombineChars(r),i)},mathmlBuilder(e,t){var n=new X.TextNode(bu(e)),r=new X.MathNode(`mtext`,[n]);return r.setAttribute(`mathvariant`,`monospace`),r}});var bu=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),xu=Vs,Su=`[ \r
258
+ ]`,Cu=`\\\\[a-zA-Z@]+`,wu=`\\\\[^\ud800-\udfff]`,Tu=`(`+Cu+`)`+Su+`*`,Eu=`\\\\(
259
+ |[ \r ]+
260
+ ?)[ \r ]*`,Du=`[̀-ͯ]`,Ou=RegExp(Du+`+$`),ku=`(`+Su+`+)|`+(Eu+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+(Du+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(Du+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+Tu)+(`|`+wu+`)`),Au=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(ku,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new fa(`EOF`,new da(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new R(`Unexpected character: '`+e[t]+`'`,new fa(e[t],new da(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
261
+ `,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict(`commentAtEnd`,`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`)):this.tokenRegex.lastIndex=i+1,this.lex()}return new fa(r,new da(this,t,this.tokenRegex.lastIndex))}},ju=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new R(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}},Mu=Nl;Z(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),Z(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),Z(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),Z(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),Z(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),Z(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),Z(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Nu={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Z(`\\char`,function(e){var t=e.popToken(),n,r=``;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`"){if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new R("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=Nu[t.text],r==null||r>=n)throw new R(`Invalid base-`+n+` digit `+t.text);for(var i;(i=Nu[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var Pu=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new R(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new R(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new R(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new R(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};Z(`\\newcommand`,e=>Pu(e,!1,!0,!1)),Z(`\\renewcommand`,e=>Pu(e,!0,!1,!1)),Z(`\\providecommand`,e=>Pu(e,!0,!0,!0)),Z(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),Z(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),Z(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),xu[n],Bo.math[n],Bo.text[n]),``}),Z(`\\bgroup`,`{`),Z(`\\egroup`,`}`),Z(`~`,`\\nobreakspace`),Z(`\\lq`,"`"),Z(`\\rq`,`'`),Z(`\\aa`,`\\r a`),Z(`\\AA`,`\\r A`),Z(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),Z(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),Z(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Z(`ℬ`,`\\mathscr{B}`),Z(`ℰ`,`\\mathscr{E}`),Z(`ℱ`,`\\mathscr{F}`),Z(`ℋ`,`\\mathscr{H}`),Z(`ℐ`,`\\mathscr{I}`),Z(`ℒ`,`\\mathscr{L}`),Z(`ℳ`,`\\mathscr{M}`),Z(`ℛ`,`\\mathscr{R}`),Z(`ℭ`,`\\mathfrak{C}`),Z(`ℌ`,`\\mathfrak{H}`),Z(`ℨ`,`\\mathfrak{Z}`),Z(`\\Bbbk`,`\\Bbb{k}`),Z(`·`,`\\cdotp`),Z(`\\llap`,`\\mathllap{\\textrm{#1}}`),Z(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),Z(`\\clap`,`\\mathclap{\\textrm{#1}}`),Z(`\\mathstrut`,`\\vphantom{(}`),Z(`\\underbar`,`\\underline{\\text{#1}}`),Z(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}`),Z(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Z(`\\ne`,`\\neq`),Z(`≠`,`\\neq`),Z(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Z(`∉`,`\\notin`),Z(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Z(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Z(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Z(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Z(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Z(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Z(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Z(`⟂`,`\\perp`),Z(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),Z(`∌`,`\\notni`),Z(`⌜`,`\\ulcorner`),Z(`⌝`,`\\urcorner`),Z(`⌞`,`\\llcorner`),Z(`⌟`,`\\lrcorner`),Z(`©`,`\\copyright`),Z(`®`,`\\textregistered`),Z(`️`,`\\textregistered`),Z(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),Z(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),Z(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),Z(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),Z(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),Z(`⋮`,`\\vdots`),Z(`\\varGamma`,`\\mathit{\\Gamma}`),Z(`\\varDelta`,`\\mathit{\\Delta}`),Z(`\\varTheta`,`\\mathit{\\Theta}`),Z(`\\varLambda`,`\\mathit{\\Lambda}`),Z(`\\varXi`,`\\mathit{\\Xi}`),Z(`\\varPi`,`\\mathit{\\Pi}`),Z(`\\varSigma`,`\\mathit{\\Sigma}`),Z(`\\varUpsilon`,`\\mathit{\\Upsilon}`),Z(`\\varPhi`,`\\mathit{\\Phi}`),Z(`\\varPsi`,`\\mathit{\\Psi}`),Z(`\\varOmega`,`\\mathit{\\Omega}`),Z(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),Z(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),Z(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),Z(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),Z(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),Z(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),Z(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),Z(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var Fu={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`};Z(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in Fu?t=Fu[n]:(n.slice(0,4)===`\\not`||n in Bo.math&&Ca.contains([`bin`,`rel`],Bo.math[n].group))&&(t=`\\dotsb`),t});var Iu={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Z(`\\dotso`,function(e){return e.future().text in Iu?`\\ldots\\,`:`\\ldots`}),Z(`\\dotsc`,function(e){var t=e.future().text;return t in Iu&&t!==`,`?`\\ldots\\,`:`\\ldots`}),Z(`\\cdots`,function(e){return e.future().text in Iu?`\\@cdots\\,`:`\\@cdots`}),Z(`\\dotsb`,`\\cdots`),Z(`\\dotsm`,`\\cdots`),Z(`\\dotsi`,`\\!\\cdots`),Z(`\\dotsx`,`\\ldots\\,`),Z(`\\DOTSI`,`\\relax`),Z(`\\DOTSB`,`\\relax`),Z(`\\DOTSX`,`\\relax`),Z(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),Z(`\\,`,`\\tmspace+{3mu}{.1667em}`),Z(`\\thinspace`,`\\,`),Z(`\\>`,`\\mskip{4mu}`),Z(`\\:`,`\\tmspace+{4mu}{.2222em}`),Z(`\\medspace`,`\\:`),Z(`\\;`,`\\tmspace+{5mu}{.2777em}`),Z(`\\thickspace`,`\\;`),Z(`\\!`,`\\tmspace-{3mu}{.1667em}`),Z(`\\negthinspace`,`\\!`),Z(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),Z(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),Z(`\\enspace`,`\\kern.5em `),Z(`\\enskip`,`\\hskip.5em\\relax`),Z(`\\quad`,`\\hskip1em\\relax`),Z(`\\qquad`,`\\hskip2em\\relax`),Z(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),Z(`\\tag@paren`,`\\tag@literal{({#1})}`),Z(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new R(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),Z(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),Z(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),Z(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),Z(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),Z(`\\newline`,`\\\\\\relax`),Z(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var Lu=z(so[`Main-Regular`][84][1]-.7*so[`Main-Regular`][65][1]);Z(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+Lu+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),Z(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+Lu+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),Z(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),Z(`\\@hspace`,`\\hskip #1\\relax`),Z(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),Z(`\\ordinarycolon`,`:`),Z(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),Z(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),Z(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),Z(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),Z(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),Z(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),Z(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),Z(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),Z(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),Z(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),Z(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),Z(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),Z(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),Z(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),Z(`∷`,`\\dblcolon`),Z(`∹`,`\\eqcolon`),Z(`≔`,`\\coloneqq`),Z(`≕`,`\\eqqcolon`),Z(`⩴`,`\\Coloneqq`),Z(`\\ratio`,`\\vcentcolon`),Z(`\\coloncolon`,`\\dblcolon`),Z(`\\colonequals`,`\\coloneqq`),Z(`\\coloncolonequals`,`\\Coloneqq`),Z(`\\equalscolon`,`\\eqqcolon`),Z(`\\equalscoloncolon`,`\\Eqqcolon`),Z(`\\colonminus`,`\\coloneq`),Z(`\\coloncolonminus`,`\\Coloneq`),Z(`\\minuscolon`,`\\eqcolon`),Z(`\\minuscoloncolon`,`\\Eqcolon`),Z(`\\coloncolonapprox`,`\\Colonapprox`),Z(`\\coloncolonsim`,`\\Colonsim`),Z(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),Z(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),Z(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),Z(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),Z(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Z(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),Z(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),Z(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),Z(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),Z(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),Z(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),Z(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),Z(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),Z(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),Z(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),Z(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),Z(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),Z(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),Z(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),Z(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),Z(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),Z(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),Z(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),Z(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),Z(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),Z(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),Z(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),Z(`\\imath`,`\\html@mathml{\\@imath}{ı}`),Z(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),Z(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Z(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Z(`⟦`,`\\llbracket`),Z(`⟧`,`\\rrbracket`),Z(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Z(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Z(`⦃`,`\\lBrace`),Z(`⦄`,`\\rBrace`),Z(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Z(`⦵`,`\\minuso`),Z(`\\darr`,`\\downarrow`),Z(`\\dArr`,`\\Downarrow`),Z(`\\Darr`,`\\Downarrow`),Z(`\\lang`,`\\langle`),Z(`\\rang`,`\\rangle`),Z(`\\uarr`,`\\uparrow`),Z(`\\uArr`,`\\Uparrow`),Z(`\\Uarr`,`\\Uparrow`),Z(`\\N`,`\\mathbb{N}`),Z(`\\R`,`\\mathbb{R}`),Z(`\\Z`,`\\mathbb{Z}`),Z(`\\alef`,`\\aleph`),Z(`\\alefsym`,`\\aleph`),Z(`\\Alpha`,`\\mathrm{A}`),Z(`\\Beta`,`\\mathrm{B}`),Z(`\\bull`,`\\bullet`),Z(`\\Chi`,`\\mathrm{X}`),Z(`\\clubs`,`\\clubsuit`),Z(`\\cnums`,`\\mathbb{C}`),Z(`\\Complex`,`\\mathbb{C}`),Z(`\\Dagger`,`\\ddagger`),Z(`\\diamonds`,`\\diamondsuit`),Z(`\\empty`,`\\emptyset`),Z(`\\Epsilon`,`\\mathrm{E}`),Z(`\\Eta`,`\\mathrm{H}`),Z(`\\exist`,`\\exists`),Z(`\\harr`,`\\leftrightarrow`),Z(`\\hArr`,`\\Leftrightarrow`),Z(`\\Harr`,`\\Leftrightarrow`),Z(`\\hearts`,`\\heartsuit`),Z(`\\image`,`\\Im`),Z(`\\infin`,`\\infty`),Z(`\\Iota`,`\\mathrm{I}`),Z(`\\isin`,`\\in`),Z(`\\Kappa`,`\\mathrm{K}`),Z(`\\larr`,`\\leftarrow`),Z(`\\lArr`,`\\Leftarrow`),Z(`\\Larr`,`\\Leftarrow`),Z(`\\lrarr`,`\\leftrightarrow`),Z(`\\lrArr`,`\\Leftrightarrow`),Z(`\\Lrarr`,`\\Leftrightarrow`),Z(`\\Mu`,`\\mathrm{M}`),Z(`\\natnums`,`\\mathbb{N}`),Z(`\\Nu`,`\\mathrm{N}`),Z(`\\Omicron`,`\\mathrm{O}`),Z(`\\plusmn`,`\\pm`),Z(`\\rarr`,`\\rightarrow`),Z(`\\rArr`,`\\Rightarrow`),Z(`\\Rarr`,`\\Rightarrow`),Z(`\\real`,`\\Re`),Z(`\\reals`,`\\mathbb{R}`),Z(`\\Reals`,`\\mathbb{R}`),Z(`\\Rho`,`\\mathrm{P}`),Z(`\\sdot`,`\\cdot`),Z(`\\sect`,`\\S`),Z(`\\spades`,`\\spadesuit`),Z(`\\sub`,`\\subset`),Z(`\\sube`,`\\subseteq`),Z(`\\supe`,`\\supseteq`),Z(`\\Tau`,`\\mathrm{T}`),Z(`\\thetasym`,`\\vartheta`),Z(`\\weierp`,`\\wp`),Z(`\\Zeta`,`\\mathrm{Z}`),Z(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),Z(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),Z(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),Z(`\\bra`,`\\mathinner{\\langle{#1}|}`),Z(`\\ket`,`\\mathinner{|{#1}\\rangle}`),Z(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),Z(`\\Bra`,`\\left\\langle#1\\right|`),Z(`\\Ket`,`\\left|#1\\right\\rangle`);var Ru=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};Z(`\\bra@ket`,Ru(!1)),Z(`\\bra@set`,Ru(!0)),Z(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),Z(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),Z(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),Z(`\\angln`,`{\\angl n}`),Z(`\\blue`,`\\textcolor{##6495ed}{#1}`),Z(`\\orange`,`\\textcolor{##ffa500}{#1}`),Z(`\\pink`,`\\textcolor{##ff00af}{#1}`),Z(`\\red`,`\\textcolor{##df0030}{#1}`),Z(`\\green`,`\\textcolor{##28ae7b}{#1}`),Z(`\\gray`,`\\textcolor{gray}{#1}`),Z(`\\purple`,`\\textcolor{##9d38bd}{#1}`),Z(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),Z(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),Z(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),Z(`\\blueD`,`\\textcolor{##11accd}{#1}`),Z(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),Z(`\\tealA`,`\\textcolor{##94fff5}{#1}`),Z(`\\tealB`,`\\textcolor{##26edd5}{#1}`),Z(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),Z(`\\tealD`,`\\textcolor{##01a995}{#1}`),Z(`\\tealE`,`\\textcolor{##208170}{#1}`),Z(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),Z(`\\greenB`,`\\textcolor{##8af281}{#1}`),Z(`\\greenC`,`\\textcolor{##74cf70}{#1}`),Z(`\\greenD`,`\\textcolor{##1fab54}{#1}`),Z(`\\greenE`,`\\textcolor{##0d923f}{#1}`),Z(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),Z(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),Z(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),Z(`\\goldD`,`\\textcolor{##e07d10}{#1}`),Z(`\\goldE`,`\\textcolor{##a75a05}{#1}`),Z(`\\redA`,`\\textcolor{##fca9a9}{#1}`),Z(`\\redB`,`\\textcolor{##ff8482}{#1}`),Z(`\\redC`,`\\textcolor{##f9685d}{#1}`),Z(`\\redD`,`\\textcolor{##e84d39}{#1}`),Z(`\\redE`,`\\textcolor{##bc2612}{#1}`),Z(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),Z(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),Z(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),Z(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),Z(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),Z(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),Z(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),Z(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),Z(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),Z(`\\purpleE`,`\\textcolor{##543b78}{#1}`),Z(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),Z(`\\mintB`,`\\textcolor{##edf2df}{#1}`),Z(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),Z(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),Z(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),Z(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),Z(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),Z(`\\grayE`,`\\textcolor{##babec2}{#1}`),Z(`\\grayF`,`\\textcolor{##888d93}{#1}`),Z(`\\grayG`,`\\textcolor{##626569}{#1}`),Z(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),Z(`\\grayI`,`\\textcolor{##21242c}{#1}`),Z(`\\kaBlue`,`\\textcolor{##314453}{#1}`),Z(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var zu={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Bu=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new ju(Mu,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Au(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken(),{tokens:r,end:n}=this.consumeArg([`]`])}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new fa(`EOF`,n.loc)),this.pushTokens(r),t.range(n,``)}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new R(`Extra }`,i)}else if(i.text===`EOF`)throw new R(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new R(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new R(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new R(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new R(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new R(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new R(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}throw Error()}expandMacro(e){return this.macros.has(e)?this.expandTokens([new fa(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.indexOf(`#`)!==-1)for(var a=r.replace(/##/g,``);a.indexOf(`#`+(i+1))!==-1;)++i;for(var o=new Au(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||xu.hasOwnProperty(e)||Bo.math.hasOwnProperty(e)||Bo.text.hasOwnProperty(e)||zu.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t==null?xu.hasOwnProperty(e)&&!xu[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},Vu=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Hu=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),Uu={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},Wu={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},Gu=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new Bu(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new R(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new fa(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.indexOf(i.text)!==-1||n&&i.text===n||t&&xu[i.text]&&xu[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++)if(e[r].type===`infix`){if(t!==-1)throw new R(`only one infix operator per group`,e[r].token);t=r,n=e[r].replaceWith}if(t!==-1&&n){var i,a,o=e.slice(0,t),s=e.slice(t+1);return i=o.length===1&&o[0].type===`ordgroup`?o[0]:{type:`ordgroup`,mode:this.mode,body:o},a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},[n===`\\\\abovefrac`?this.callFunction(n,[i,e[t],a],[]):this.callFunction(n,[i,a],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new R(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new R(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new R(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new R(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new R(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(Hu[i.text]){var s=Vu.test(i.text),c=[];for(c.push(new fa(Hu[i.text])),this.consume();;){var l=this.fetch().text;if(!Hu[l]||Vu.test(l)!==s)break;c.unshift(new fa(Hu[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n||r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=xu[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new R(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new R(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new R(`Can't use function '`+r+`' in math mode`,n);var{args:a,optArgs:o}=this.parseArguments(r,i);return this.callFunction(r,a,o,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=xu[e];if(o&&o.handler)return o.handler(a,t,n);throw new R(`No function handler for `+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var r=[],i=[],a=0;a<n;a++){var o=t.argTypes&&t.argTypes[a],s=a<t.numOptionalArgs;(t.primitive&&o==null||t.type===`sqrt`&&a===1&&i[0]==null)&&(o=`primitive`);var c=this.parseGroupOfType(`argument to '`+e+`'`,o,s);if(s)i.push(c);else if(c!=null)r.push(c);else throw new R(`Null argument, please report this as a bug`)}return{args:r,optArgs:i}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`};case`raw`:var i=this.parseStringGroup(`raw`,n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new R(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new R(`Expected group as `+e,this.fetch());return a;case`original`:case null:case void 0:return this.parseArgumentGroup(n);default:throw new R(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var r=``,i;(i=this.fetch()).text!==`EOF`;)r+=i.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new R(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(`color`,e);if(t==null)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new R(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(`size`,e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new R(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!xo(i))throw new R(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(`url`,e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:da.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!zu.hasOwnProperty(r)){if(this.settings.throwOnError)throw new R(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n],i=r.text;i===`-`&&e[n+1].text===`-`&&(n+1<t&&e[n+2].text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:da.range(r,e[n+2]),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:da.range(r,e[n+1]),text:`--`}),--t)),(i===`'`||i==="`")&&e[n+1].text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:da.range(r,e[n+1]),text:i+i}),--t)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new R(`\\verb assertion failed --
262
+ please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}Wu.hasOwnProperty(t[0])&&!Bo[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Accented Unicode text character "`+t[0]+`" used in math mode`,e),t=Wu[t[0]]+t.slice(1));var i=Ou.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(Bo[this.mode][t]){this.settings.strict&&this.mode===`math`&&us.indexOf(t)>=0&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,e);var o=Bo[this.mode][t].group,s=da.range(e),c;if(Ro.hasOwnProperty(o)){var l=o;c={type:`atom`,mode:this.mode,family:l,loc:s,text:t}}else c={type:o,mode:this.mode,loc:s,text:t};a=c}else if(t.charCodeAt(0)>=128)this.settings.strict&&(qa(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:da.range(e),text:t};else return null;if(this.consume(),i)for(var u=0;u<i[0].length;u++){var d=i[0][u];if(!Uu[d])throw new R(`Unknown accent ' `+d+`'`,e);var f=Uu[d][this.mode]||Uu[d].text;if(!f)throw new R(`Accent `+d+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:da.range(e),label:f,isStretchy:!1,isShifty:!0,base:a}}return a}};Gu.endOfExpression=[`}`,`\\endgroup`,`\\end`,`\\right`,`&`];var Ku=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new Gu(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new R(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new fa(`\\df@tag`)])}]}return r},qu=function(e,t,n){t.textContent=``;var r=Zu(e,n).toNode();t.appendChild(r)};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),qu=function(){throw new R(`KaTeX doesn't work in quirks mode.`)});var Ju=function(e,t){return Zu(e,t).toMarkup()},Yu=function(e,t){return Ku(e,new Ea(t))},Xu=function(e,t,n){if(n.throwOnError||!(e instanceof R))throw e;var r=J.makeSpan([`katex-error`],[new Mo(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},Zu=function(e,t){var n=new Ea(t);try{return bc(Ku(e,n),e,n)}catch(t){return Xu(t,e,n)}},Qu={version:`0.16.22`,render:qu,renderToString:Ju,ParseError:R,SETTINGS_SCHEMA:wa,__parse:Yu,__renderToDomTree:Zu,__renderToHTMLTree:function(e,t){var n=new Ea(t);try{return xc(Ku(e,n),e,n)}catch(t){return Xu(t,e,n)}},__setFontMetrics:uo,__defineSymbol:B,__defineFunction:Y,__defineMacro:Z,__domTree:{Span:Oo,Anchor:ko,SymbolNode:Mo,SvgNode:No,PathNode:Po,LineNode:Fo}},$u=function(e,t,n){for(var r=n,i=0,a=e.length;r<t.length;){var o=t[r];if(i<=0&&t.slice(r,r+a)===e)return r;o===`\\`?r++:o===`{`?i++:o===`}`&&i--,r++}return-1},ed=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)},td=/^\\begin{/,nd=function(e,t){for(var n,r=[],i=RegExp(`(`+t.map(e=>ed(e.left)).join(`|`)+`)`);n=e.search(i),n!==-1;){n>0&&(r.push({type:`text`,data:e.slice(0,n)}),e=e.slice(n));var a=t.findIndex(t=>e.startsWith(t.left));if(n=$u(t[a].right,e,t[a].left.length),n===-1)break;var o=e.slice(0,n+t[a].right.length),s=td.test(o)?o:e.slice(t[a].left.length,n);r.push({type:`math`,data:s,rawData:o,display:t[a].display}),e=e.slice(n+t[a].right.length)}return e!==``&&r.push({type:`text`,data:e}),r},rd=function(e,t){var n=nd(e,t.delimiters);if(n.length===1&&n[0].type===`text`)return null;for(var r=document.createDocumentFragment(),i=0;i<n.length;i++)if(n[i].type===`text`)r.appendChild(document.createTextNode(n[i].data));else{var a=document.createElement(`span`),o=n[i].data;t.displayMode=n[i].display;try{t.preProcess&&(o=t.preProcess(o)),Qu.render(o,a,t)}catch(e){if(!(e instanceof Qu.ParseError))throw e;t.errorCallback("KaTeX auto-render: Failed to parse `"+n[i].data+"` with ",e),r.appendChild(document.createTextNode(n[i].rawData));continue}r.appendChild(a)}return r},id=function e(t,n){for(var r=0;r<t.childNodes.length;r++){var i=t.childNodes[r];if(i.nodeType===3){for(var a=i.textContent,o=i.nextSibling,s=0;o&&o.nodeType===Node.TEXT_NODE;)a+=o.textContent,o=o.nextSibling,s++;var c=rd(a,n);if(c){for(var l=0;l<s;l++)i.nextSibling.remove();r+=c.childNodes.length-1,t.replaceChild(c,i)}else r+=s}else i.nodeType===1&&(function(){var t=` `+i.className+` `;n.ignoredTags.indexOf(i.nodeName.toLowerCase())===-1&&n.ignoredClasses.every(e=>t.indexOf(` `+e+` `)===-1)&&e(i,n)})()}},ad=function(e,t){if(!e)throw Error(`No element provided to render`);var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);n.delimiters=n.delimiters||[{left:`$$`,right:`$$`,display:!0},{left:`\\(`,right:`\\)`,display:!1},{left:`\\begin{equation}`,right:`\\end{equation}`,display:!0},{left:`\\begin{align}`,right:`\\end{align}`,display:!0},{left:`\\begin{alignat}`,right:`\\end{alignat}`,display:!0},{left:`\\begin{gather}`,right:`\\end{gather}`,display:!0},{left:`\\begin{CD}`,right:`\\end{CD}`,display:!0},{left:`\\[`,right:`\\]`,display:!0}],n.ignoredTags=n.ignoredTags||[`script`,`noscript`,`style`,`textarea`,`pre`,`code`,`option`],n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},id(e,n)},od=P(`<span class="ti svelte-qimlcs"></span>`);function sd(e,t){Ye(t,!0);let n;function r(e){return String(e||``).replace(/\\texorpdfstring\{((?:[^{}]|\{[^{}]*\})*)\}\{(?:[^{}]|\{[^{}]*\})*\}/g,`$1`).replace(/\\(emph|textit|textbf|textsc|textrm|textup|mbox|text)\{([^{}]*)\}/g,`$2`).replace(/\\(cite|citep|citet)(\[[^\]]*\])?\{([^}]*)\}/g,`[$3]`).replace(/\\(eqref)\{([^}]*)\}/g,`($2)`).replace(/``/g,`“`).replace(/''/g,`”`).replace(/---/g,`—`).replace(/--/g,`–`).replace(/~/g,` `).replace(/\\[,;:! ]/g,` `).replace(/\\&/g,`&`)}Tn(()=>{n&&(n.textContent=r(t.text),ad(n,{delimiters:[{left:`\\(`,right:`\\)`,display:!1},{left:`$`,right:`$`,display:!1}],throwOnError:!1}))});var i={plain:r},a=od();return Li(a,e=>n=e,()=>n),F(e,a),Xe(i)}var cd=P(`<span><span class="dot svelte-1e4wiko" aria-hidden="true"></span> </span>`);function ld(e,t){let n=Vi(t,`small`,3,!1);var r=cd();let i;var a=j(O(r),1,!0);T(r),M(()=>{i=di(r,1,`chip st-`+t.cls,`svelte-1e4wiko`,i,{small:n()}),I(a,t.status)}),F(e,r)}var ud=P(`<span> </span>`),dd=P(`· revision <code> </code>`,1),fd=P(`<li class="svelte-1ihakmm"> </li>`),pd=P(`<ul class="svelte-1ihakmm"></ul>`),md=P(`<div class="gates svelte-1ihakmm"><details><summary class="svelte-1ihakmm"><strong>Consistency check</strong> <span class="faint">· every check runs; open or unreviewed claims are statuses, not failures</span></summary> <!></details> <details><summary class="svelte-1ihakmm"><strong>Release gate</strong> <span class="faint">· the paper as a whole: every claim accepted, every scope decision reviewed, a Comparator replay</span></summary> <!></details></div>`),hd=P(`<a role="listitem"><span class="num svelte-1ihakmm"> </span> <span class="kind svelte-1ihakmm"> </span></a>`),gd=P(`<h3 class="glabel svelte-1ihakmm"> <span class="faint"> </span></h3> <div class="grid svelte-1ihakmm" role="list"></div>`,1),_d=P(`<p class="muted">Every claim of this paper in scope is accepted.</p>`),vd=P(`<tr><td class="svelte-1ihakmm"><!></td><td class="n svelte-1ihakmm"> </td></tr>`),yd=P(`<span class="muted"><!></span>`),bd=P(`<li class="svelte-1ihakmm"><a> </a> <!> <!></li>`),xd=P(`<section class="paper svelte-1ihakmm"><div class="phead svelte-1ihakmm"><h2 class="svelte-1ihakmm"> </h2> <a>Read the paper →</a></div> <p class="prov faint svelte-1ihakmm"> <!></p> <!> <!> <table class="sum svelte-1ihakmm"><thead><tr><th class="svelte-1ihakmm">Status</th><th class="n svelte-1ihakmm">Claims</th></tr></thead><tbody></tbody></table> <details class="list svelte-1ihakmm"><summary class="svelte-1ihakmm">All claims as a list</summary> <ul class="svelte-1ihakmm"></ul></details></section>`),Sd=P(`<main class="cov svelte-1ihakmm"><section class="intro svelte-1ihakmm"><h1 class="svelte-1ihakmm">Coverage</h1> <p class="muted svelte-1ihakmm">Every numbered claim of each paper, by what has been established about it. Accepted means
263
+ a kernel-checked proof of a locked statement whose meaning was reviewed by someone other
264
+ than its author; anything less is shown as what it is.</p> <div class="tools svelte-1ihakmm"><label><input type="checkbox"/> Show only what is not accepted</label> <span class="findings svelte-1ihakmm"></span></div></section> <!></main>`);function Cd(e,t){Ye(t,!0);let n=Jt(!1),r=e=>/^[A-Z][a-z]+ [A-Z]?[0-9][0-9.]*[a-z]?$/.test(e.number||``),i=e=>r(e)?e.number.replace(/^[A-Za-z]+ /,``):e.number||e.id,a=E(()=>t.index.papers.map(e=>{let r=t.index.claims.filter(t=>t.paper===e.id);return{...e,claims:r,shown:N(n)?r.filter(aa):r}})),o=E(()=>t.index.findings.total||{});var s=Sd(),c=O(s),l=j(O(c),4),u=O(l),d=O(u);wi(d),De(),T(u);var f=j(u,2);$r(f,20,()=>[`violation`,`warning`,`obligation`],Yr,(e,t)=>{var n=ud(),r=A(n);M(()=>{di(n,1,`tier `+t,`svelte-1ihakmm`),Ti(n,`title`,t===`warning`?`heuristics that may be wrong; not defects`:``),I(r,`${(N(o)[t]||0)??``} ${t??``}${(N(o)[t]||0)===1?``:`s`}${t===`warning`?` (heuristic)`:``}`)}),F(e,n)}),T(f),T(l),T(c),$r(j(c,2),17,()=>N(a),e=>e.id,(e,n)=>{var a=xd(),o=O(a),s=O(o),c=A(s,!0),l=j(s,2);T(o);var u=j(o,2),d=O(u),f=j(d),p=e=>{var t=dd(),r=A(j(k(t)),!0);M(e=>I(r,e),[()=>N(n).revision.slice(0,12)]),F(e,t)};L(f,e=>{N(n).revision&&e(p)}),T(u);var h=j(u,2),g=e=>{let r=E(()=>t.index.gates[N(n).id]);var i=md(),a=O(i),o=O(a),s=j(O(o));De(),T(o);var c=j(o,2),l=e=>{var t=pd();$r(t,21,()=>N(r).consistency.failures,Yr,(e,t)=>{var n=fd(),r=A(n,!0);M(()=>I(r,N(t))),F(e,n)}),T(t),F(e,t)};L(c,e=>{N(r).consistency.failures.length&&e(l)}),T(a);var u=j(a,2),d=O(u),f=j(O(d));De(),T(d);var p=j(d,2),m=e=>{var t=pd();$r(t,21,()=>N(r).release.reasons,Yr,(e,t)=>{var n=fd(),r=A(n,!0);M(()=>I(r,N(t))),F(e,n)}),T(t),F(e,t)};L(p,e=>{N(r).release.reasons.length&&e(m)}),T(u),T(i),M(()=>{di(a,1,`gate `+(N(r).consistency.pass?`pass`:`fail`),`svelte-1ihakmm`),I(s,`: ${N(r).consistency.pass?`passed`:`failed (${N(r).consistency.failures.length})`} `),di(u,1,`gate `+(N(r).release.pass?`pass`:`fail`),`svelte-1ihakmm`),I(f,`: ${N(r).release.pass?`passed`:`not passed (${N(r).release.reasons.length} reasons)`} `)}),F(e,i)};L(h,e=>{t.index.gates?.[N(n).id]&&e(g)});var _=j(h,2);$r(_,17,()=>[[`Numbered statements`,N(n).shown.filter(r)],[`Equations, parts and prose claims`,N(n).shown.filter(e=>!r(e))]],Yr,(e,a)=>{var o=E(()=>m(N(a),2));let s=()=>N(o)[0],c=()=>N(o)[1];var l=zr(),u=k(l),d=e=>{var a=gd(),o=k(a),l=O(o),u=A(j(l));T(o);var d=j(o,2);$r(d,21,c,e=>e.id,(e,a)=>{var o=hd(),s=O(o),c=A(s,!0),l=A(j(s,2),!0);T(o),M((e,t,n)=>{di(o,1,`cell st-`+N(a).class,`svelte-1ihakmm`),Ti(o,`href`,e),Ti(o,`title`,`${N(a).number||N(a).id}: ${N(a).status}`),I(c,t),I(l,n)},[()=>la(t.index.release,`read`,N(n).id,N(a).id),()=>i(N(a)),()=>r(N(a))?(N(a).number||``).split(` `)[0]:N(a).kind]),F(e,o)}),T(d),M(()=>{I(l,`${s()??``} `),I(u,`(${c().length??``})`)}),F(e,a)};L(u,e=>{c().length&&e(d)}),F(e,l)},e=>{F(e,_d())});var v=j(_,2),y=j(O(v));$r(y,21,()=>Object.entries(t.index.summary[N(n).id]||{}).sort((e,n)=>ia.indexOf(t.index.classes[e[0]])-ia.indexOf(t.index.classes[n[0]])),Yr,(e,n)=>{var r=E(()=>m(N(n),2));let i=()=>N(r)[0],a=()=>N(r)[1];var o=vd(),s=O(o);ld(O(s),{get status(){return i()},get cls(){return t.index.classes[i()]}}),T(s);var c=A(j(s),!0);T(o),M(()=>I(c,a())),F(e,o)}),T(y),T(v);var b=j(v,2),x=j(O(b),2);$r(x,21,()=>N(n).shown,e=>e.id,(e,n)=>{var r=bd(),i=O(r),a=A(i,!0),o=j(i,2),s=e=>{var t=yd(),r=O(t);{let e=E(()=>N(n).heading||N(n).title);sd(r,{get text(){return N(e)}})}T(t),F(e,t)};L(o,e=>{(N(n).heading||N(n).title)&&e(s)}),ld(j(o,2),{get status(){return N(n).status},get cls(){return N(n).class},small:!0}),T(r),M(e=>{Ti(i,`href`,e),I(a,N(n).number||N(n).id)},[()=>la(t.index.release,`claim`,N(n).id)]),F(e,r)}),T(x),T(b),T(a),M(e=>{I(c,N(n).title),Ti(l,`href`,e),I(d,`Paper ${N(n).id??``} · ${N(n).mode===`latex`?`from LaTeX source`:`PDF only: statements not hashed from source`} `)},[()=>la(t.index.release,`read`,N(n).id)]),F(e,a)}),T(s),Mi(d,()=>N(n),e=>D(n,e)),F(e,s),Xe()}var wd=`modulepreload`,Td=function(e,t){return new URL(e,t).href},Ed={},Dd=function(e){return e.pathname.endsWith(`.css`)},Od=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},kd=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Td(t,n);let r=s(t),i=Dd(r);return Od(Ed,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:wd,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ad={};Ad.d=(e,t)=>{for(var n in t)Ad.o(t,n)&&!Ad.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},Ad.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var jd=globalThis.pdfjsLib={};Ad.d(jd,{AbortException:()=>mf,AnnotationEditorLayer:()=>wg,AnnotationEditorParamsType:()=>Vd,AnnotationEditorType:()=>Bd,AnnotationEditorUIManager:()=>ap,AnnotationLayer:()=>og,AnnotationMode:()=>Rd,ColorPicker:()=>hg,DOMSVGFactory:()=>Dh,DrawLayer:()=>Tg,FeatureTest:()=>xf,GlobalWorkerOptions:()=>gm,ImageKind:()=>Wd,InvalidPDFException:()=>uf,MissingPDFException:()=>df,OPS:()=>Jd,OutputScale:()=>Xf,PDFDataRangeTransport:()=>dh,PDFDateString:()=>Uf,PDFWorker:()=>hh,PasswordResponses:()=>Yd,PermissionFlag:()=>Hd,PixelsPerInch:()=>jf,RenderingCancelledException:()=>Pf,TextLayer:()=>Zm,TouchManager:()=>sp,UnexpectedResponseException:()=>ff,Util:()=>Q,VerbosityLevel:()=>qd,XfaLayer:()=>Oh,build:()=>Sh,createValidAbsoluteUrl:()=>af,fetchData:()=>Mf,getDocument:()=>oh,getFilenameFromUrl:()=>Lf,getPdfFilenameFromUrl:()=>Rf,getXfaPageViewport:()=>Wf,isDataScheme:()=>Ff,isPdfFile:()=>If,noContextMenu:()=>Vf,normalizeUnicode:()=>Ef,setLayerDimensions:()=>Yf,shadow:()=>of,stopEvent:()=>Hf,version:()=>xh});var Md=typeof process==`object`&&process+``==`[object process]`&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!==`browser`),Nd=[1,0,0,1,0,0],Pd=[.001,0,0,.001,0,0],Fd=1e7,Id=1.35,Ld={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},Rd={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},zd=`pdfjs_internal_editor_`,Bd={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},Vd={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35,DRAW_STEP:41},Hd={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Ud={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Wd={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Gd={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},Kd={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},qd={ERRORS:0,WARNINGS:1,INFOS:5},Jd={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93},Yd={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},Xd=qd.WARNINGS;function Zd(e){Number.isInteger(e)&&(Xd=e)}function Qd(){return Xd}function $d(e){Xd>=qd.INFOS&&console.log(`Info: ${e}`)}function ef(e){Xd>=qd.WARNINGS&&console.log(`Warning: ${e}`)}function tf(e){throw Error(e)}function nf(e,t){e||tf(t)}function rf(e){switch(e?.protocol){case`http:`:case`https:`:case`ftp:`:case`mailto:`:case`tel:`:return!0;default:return!1}}function af(e,t=null,n=null){if(!e)return null;try{if(n&&typeof e==`string`&&(n.addDefaultProtocol&&e.startsWith(`www.`)&&e.match(/\./g)?.length>=2&&(e=`http://${e}`),n.tryConvertEncoding))try{e=Cf(e)}catch{}let r=t?new URL(e,t):new URL(e);if(rf(r))return r}catch{}return null}function of(e,t,n,r=!1){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}var sf=function(){function e(e,t){this.message=e,this.name=t}return e.prototype=Error(),e.constructor=e,e}(),cf=class extends sf{constructor(e,t){super(e,`PasswordException`),this.code=t}},lf=class extends sf{constructor(e,t){super(e,`UnknownErrorException`),this.details=t}},uf=class extends sf{constructor(e){super(e,`InvalidPDFException`)}},df=class extends sf{constructor(e){super(e,`MissingPDFException`)}},ff=class extends sf{constructor(e,t){super(e,`UnexpectedResponseException`),this.status=t}},pf=class extends sf{constructor(e){super(e,`FormatError`)}},mf=class extends sf{constructor(e){super(e,`AbortException`)}};function hf(e){(typeof e!=`object`||e?.length===void 0)&&tf(`Invalid argument for bytesToString`);let t=e.length,n=8192;if(t<n)return String.fromCharCode.apply(null,e);let r=[];for(let i=0;i<t;i+=n){let a=Math.min(i+n,t),o=e.subarray(i,a);r.push(String.fromCharCode.apply(null,o))}return r.join(``)}function gf(e){typeof e!=`string`&&tf(`Invalid argument for stringToBytes`);let t=e.length,n=new Uint8Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r)&255;return n}function _f(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,e&255)}function vf(e){let t=Object.create(null);for(let[n,r]of e)t[n]=r;return t}function yf(){let e=new Uint8Array(4);return e[0]=1,new Uint32Array(e.buffer,0,1)[0]===1}function bf(){try{return Function(``),!0}catch{return!1}}var xf=class{static get isLittleEndian(){return of(this,`isLittleEndian`,yf())}static get isEvalSupported(){return of(this,`isEvalSupported`,bf())}static get isOffscreenCanvasSupported(){return of(this,`isOffscreenCanvasSupported`,typeof OffscreenCanvas<`u`)}static get isImageDecoderSupported(){return of(this,`isImageDecoderSupported`,typeof ImageDecoder<`u`)}static get platform(){return typeof navigator<`u`&&typeof navigator?.platform==`string`?of(this,`platform`,{isMac:navigator.platform.includes(`Mac`),isWindows:navigator.platform.includes(`Win`),isFirefox:typeof navigator?.userAgent==`string`&&navigator.userAgent.includes(`Firefox`)}):of(this,`platform`,{isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){return of(this,`isCSSRoundSupported`,globalThis.CSS?.supports?.(`width: round(1.5px, 1px)`))}},Sf=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,`0`)),Q=class{static makeHexColor(e,t,n){return`#${Sf[e]}${Sf[t]}${Sf[n]}`}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[1],t[1]=n,n=t[2],t[2]=t[3],t[3]=n,e[1]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){let n=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/n,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/n]}static getAxialAlignedBoundingBox(e,t){let n=this.applyTransform(e,t),r=this.applyTransform(e.slice(2,4),t),i=this.applyTransform([e[0],e[3]],t),a=this.applyTransform([e[2],e[1]],t);return[Math.min(n[0],r[0],i[0],a[0]),Math.min(n[1],r[1],i[1],a[1]),Math.max(n[0],r[0],i[0],a[0]),Math.max(n[1],r[1],i[1],a[1])]}static inverseTransform(e){let t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){let t=[e[0],e[2],e[1],e[3]],n=e[0]*t[0]+e[1]*t[2],r=e[0]*t[1]+e[1]*t[3],i=e[2]*t[0]+e[3]*t[2],a=e[2]*t[1]+e[3]*t[3],o=(n+a)/2,s=Math.sqrt((n+a)**2-4*(n*a-i*r))/2,c=o+s||1,l=o-s||1;return[Math.sqrt(c),Math.sqrt(l)]}static normalizeRect(e){let t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){let n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>r)return null;let i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>a?null:[n,i,r,a]}static#e(e,t,n,r,i,a,o,s,c,l){if(c<=0||c>=1)return;let u=1-c,d=c*c,f=d*c,p=u*(u*(u*e+3*c*t)+3*d*n)+f*r,m=u*(u*(u*i+3*c*a)+3*d*o)+f*s;l[0]=Math.min(l[0],p),l[1]=Math.min(l[1],m),l[2]=Math.max(l[2],p),l[3]=Math.max(l[3],m)}static#t(e,t,n,r,i,a,o,s,c,l,u,d){if(Math.abs(c)<1e-12){Math.abs(l)>=1e-12&&this.#e(e,t,n,r,i,a,o,s,-u/l,d);return}let f=l**2-4*u*c;if(f<0)return;let p=Math.sqrt(f),m=2*c;this.#e(e,t,n,r,i,a,o,s,(-l+p)/m,d),this.#e(e,t,n,r,i,a,o,s,(-l-p)/m,d)}static bezierBoundingBox(e,t,n,r,i,a,o,s,c){return c?(c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],t,s),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],t,s)):c=[Math.min(e,o),Math.min(t,s),Math.max(e,o),Math.max(t,s)],this.#t(e,n,i,o,t,r,a,s,3*(-e+3*(n-i)+o),6*(e-2*n+i),3*(n-e),c),this.#t(e,n,i,o,t,r,a,s,3*(-t+3*(r-a)+s),6*(t-2*r+a),3*(r-t),c),c}};function Cf(e){return decodeURIComponent(escape(e))}var wf=null,Tf=null;function Ef(e){return wf||(wf=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,Tf=new Map([[`ſt`,`ſt`]])),e.replaceAll(wf,(e,t,n)=>t?t.normalize(`NFKC`):Tf.get(n))}function Df(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(32);return crypto.getRandomValues(e),hf(e)}var Of=`pdfjs_internal_id_`;function kf(e){return Uint8Array.prototype.toBase64?e.toBase64():btoa(hf(e))}typeof Promise.try!=`function`&&(Promise.try=function(e,...t){return new Promise(n=>{n(e(...t))})});var Af=`http://www.w3.org/2000/svg`,jf=class{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF};async function Mf(e,t=`text`){if(Bf(e,document.baseURI)){let n=await fetch(e);if(!n.ok)throw Error(n.statusText);switch(t){case`arraybuffer`:return n.arrayBuffer();case`blob`:return n.blob();case`json`:return n.json()}return n.text()}return new Promise((n,r)=>{let i=new XMLHttpRequest;i.open(`GET`,e,!0),i.responseType=t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(t){case`arraybuffer`:case`blob`:case`json`:n(i.response);return}n(i.responseText)}else r(Error(i.statusText))}},i.send(null)})}var Nf=class e{constructor({viewBox:e,userUnit:t,scale:n,rotation:r,offsetX:i=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=t,this.scale=n,this.rotation=r,this.offsetX=i,this.offsetY=a,n*=t;let s=(e[2]+e[0])/2,c=(e[3]+e[1])/2,l,u,d,f;switch(r%=360,r<0&&(r+=360),r){case 180:l=-1,u=0,d=0,f=1;break;case 90:l=0,u=1,d=1,f=0;break;case 270:l=0,u=-1,d=-1,f=0;break;case 0:l=1,u=0,d=0,f=-1;break;default:throw Error(`PageViewport: Invalid rotation, must be a multiple of 90 degrees.`)}o&&(d=-d,f=-f);let p,m,h,g;l===0?(p=Math.abs(c-e[1])*n+i,m=Math.abs(s-e[0])*n+a,h=(e[3]-e[1])*n,g=(e[2]-e[0])*n):(p=Math.abs(s-e[0])*n+i,m=Math.abs(c-e[1])*n+a,h=(e[2]-e[0])*n,g=(e[3]-e[1])*n),this.transform=[l*n,u*n,d*n,f*n,p-l*n*s-d*n*c,m-u*n*s-f*n*c],this.width=h,this.height=g}get rawDims(){let{userUnit:e,viewBox:t}=this,n=t.map(t=>t*e);return of(this,`rawDims`,{pageWidth:n[2]-n[0],pageHeight:n[3]-n[1],pageX:n[0],pageY:n[1]})}clone({scale:t=this.scale,rotation:n=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:a=!1}={}){return new e({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:n,offsetX:r,offsetY:i,dontFlip:a})}convertToViewportPoint(e,t){return Q.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){let t=Q.applyTransform([e[0],e[1]],this.transform),n=Q.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){return Q.applyInverseTransform([e,t],this.transform)}},Pf=class extends sf{constructor(e,t=0){super(e,`RenderingCancelledException`),this.extraDelay=t}};function Ff(e){let t=e.length,n=0;for(;n<t&&e[n].trim()===``;)n++;return e.substring(n,n+5).toLowerCase()===`data:`}function If(e){return typeof e==`string`&&/\.pdf$/i.test(e)}function Lf(e){return[e]=e.split(/[#?]/,1),e.substring(e.lastIndexOf(`/`)+1)}function Rf(e,t=`document.pdf`){if(typeof e!=`string`)return t;if(Ff(e))return ef(`getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.`),t;let n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=n.exec(e),a=r.exec(i[1])||r.exec(i[2])||r.exec(i[3]);if(a&&(a=a[0],a.includes(`%`)))try{a=r.exec(decodeURIComponent(a))[0]}catch{}return a||t}var zf=class{started=Object.create(null);times=[];time(e){e in this.started&&ef(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||ef(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){let e=[],t=0;for(let{name:e}of this.times)t=Math.max(e.length,t);for(let{name:n,start:r,end:i}of this.times)e.push(`${n.padEnd(t)} ${i-r}ms\n`);return e.join(``)}};function Bf(e,t){try{let{protocol:n}=t?new URL(e,t):new URL(e);return n===`http:`||n===`https:`}catch{return!1}}function Vf(e){e.preventDefault()}function Hf(e){e.preventDefault(),e.stopPropagation()}var Uf=class{static#e;static toDateObject(e){if(!e||typeof e!=`string`)return null;this.#e||=RegExp(`^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?`);let t=this.#e.exec(e);if(!t)return null;let n=parseInt(t[1],10),r=parseInt(t[2],10);r=r>=1&&r<=12?r-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let a=parseInt(t[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let s=parseInt(t[6],10);s=s>=0&&s<=59?s:0;let c=t[7]||`Z`,l=parseInt(t[8],10);l=l>=0&&l<=23?l:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,c===`-`?(a+=l,o+=u):c===`+`&&(a-=l,o-=u),new Date(Date.UTC(n,r,i,a,o,s))}};function Wf(e,{scale:t=1,rotation:n=0}){let{width:r,height:i}=e.attributes.style;return new Nf({viewBox:[0,0,parseInt(r),parseInt(i)],userUnit:1,scale:t,rotation:n})}function Gf(e){if(e.startsWith(`#`)){let t=parseInt(e.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return e.startsWith(`rgb(`)?e.slice(4,-1).split(`,`).map(e=>parseInt(e)):e.startsWith(`rgba(`)?e.slice(5,-1).split(`,`).map(e=>parseInt(e)).slice(0,3):(ef(`Not a valid color format: "${e}"`),[0,0,0])}function Kf(e){let t=document.createElement(`span`);t.style.visibility=`hidden`,document.body.append(t);for(let n of e.keys()){t.style.color=n;let r=window.getComputedStyle(t).color;e.set(n,Gf(r))}t.remove()}function qf(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform();return[t,n,r,i,a,o]}function Jf(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform().invertSelf();return[t,n,r,i,a,o]}function Yf(e,t,n=!1,r=!0){if(t instanceof Nf){let{pageWidth:r,pageHeight:i}=t.rawDims,{style:a}=e,o=xf.isCSSRoundSupported,s=`var(--scale-factor) * ${r}px`,c=`var(--scale-factor) * ${i}px`,l=o?`round(down, ${s}, var(--scale-round-x, 1px))`:`calc(${s})`,u=o?`round(down, ${c}, var(--scale-round-y, 1px))`:`calc(${c})`;!n||t.rotation%180==0?(a.width=l,a.height=u):(a.width=u,a.height=l)}r&&e.setAttribute(`data-main-rotation`,t.rotation)}var Xf=class{constructor(){let e=window.devicePixelRatio||1;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}},Zf=class e{#e=null;#t=null;#n;#r=null;#i=null;static#a=null;constructor(t){this.#n=t,e.#a||=Object.freeze({freetext:`pdfjs-editor-remove-freetext-button`,highlight:`pdfjs-editor-remove-highlight-button`,ink:`pdfjs-editor-remove-ink-button`,stamp:`pdfjs-editor-remove-stamp-button`})}render(){let t=this.#e=document.createElement(`div`);t.classList.add(`editToolbar`,`hidden`),t.setAttribute(`role`,`toolbar`);let n=this.#n._uiManager._signal;t.addEventListener(`contextmenu`,Vf,{signal:n}),t.addEventListener(`pointerdown`,e.#o,{signal:n});let r=this.#r=document.createElement(`div`);r.className=`buttons`,t.append(r);let i=this.#n.toolbarPosition;if(i){let{style:e}=t;e.insetInlineEnd=`${100*(this.#n._uiManager.direction===`ltr`?1-i[0]:i[0])}%`,e.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return this.#u(),t}get div(){return this.#e}static#o(e){e.stopPropagation()}#s(e){this.#n._focusEventsAllowed=!1,Hf(e)}#c(e){this.#n._focusEventsAllowed=!0,Hf(e)}#l(e){let t=this.#n._uiManager._signal;e.addEventListener(`focusin`,this.#s.bind(this),{capture:!0,signal:t}),e.addEventListener(`focusout`,this.#c.bind(this),{capture:!0,signal:t}),e.addEventListener(`contextmenu`,Vf,{signal:t})}hide(){this.#e.classList.add(`hidden`),this.#t?.hideDropdown()}show(){this.#e.classList.remove(`hidden`),this.#i?.shown()}#u(){let{editorType:t,_uiManager:n}=this.#n,r=document.createElement(`button`);r.className=`delete`,r.tabIndex=0,r.setAttribute(`data-l10n-id`,e.#a[t]),this.#l(r),r.addEventListener(`click`,e=>{n.delete()},{signal:n._signal}),this.#r.append(r)}get#d(){let e=document.createElement(`div`);return e.className=`divider`,e}async addAltText(e){let t=await e.render();this.#l(t),this.#r.prepend(t,this.#d),this.#i=e}addColorPicker(e){this.#t=e;let t=e.renderButton();this.#l(t),this.#r.prepend(t,this.#d)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}},Qf=class{#e=null;#t=null;#n;constructor(e){this.#n=e}#r(){let e=this.#t=document.createElement(`div`);e.className=`editToolbar`,e.setAttribute(`role`,`toolbar`),e.addEventListener(`contextmenu`,Vf,{signal:this.#n._signal});let t=this.#e=document.createElement(`div`);return t.className=`buttons`,e.append(t),this.#a(),e}#i(e,t){let n=0,r=0;for(let i of e){let e=i.y+i.height;if(e<n)continue;let a=i.x+(t?i.width:0);e>n?(r=a,n=e):t?a>r&&(r=a):a<r&&(r=a)}return[t?1-r:r,n]}show(e,t,n){let[r,i]=this.#i(t,n),{style:a}=this.#t||=this.#r();e.append(this.#t),a.insetInlineEnd=`${100*r}%`,a.top=`calc(${100*i}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#a(){let e=document.createElement(`button`);e.className=`highlightButton`,e.tabIndex=0,e.setAttribute(`data-l10n-id`,`pdfjs-highlight-floating-button1`);let t=document.createElement(`span`);e.append(t),t.className=`visuallyHidden`,t.setAttribute(`data-l10n-id`,`pdfjs-highlight-floating-button-label`);let n=this.#n._signal;e.addEventListener(`contextmenu`,Vf,{signal:n}),e.addEventListener(`click`,()=>{this.#n.highlightSelection(`floating_button`)},{signal:n}),this.#e.append(e)}};function $f(e,t,n){for(let r of n)t.addEventListener(r,e[r].bind(e))}var ep=class{#e=0;get id(){return`${zd}${this.#e++}`}},tp=class e{#e=Df();#t=0;#n=null;static get _isSVGFittingCanvas(){let e=new OffscreenCanvas(1,3).getContext(`2d`,{willReadFrequently:!0}),t=new Image;t.src=`data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>`;let n=t.decode().then(()=>(e.drawImage(t,0,0,1,1,0,0,1,3),new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0]===0));return of(this,`_isSVGFittingCanvas`,n)}async#r(t,n){this.#n||=new Map;let r=this.#n.get(t);if(r===null)return null;if(r?.bitmap)return r.refCounter+=1,r;try{r||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let t;if(typeof n==`string`?(r.url=n,t=await Mf(n,`blob`)):n instanceof File?t=r.file=n:n instanceof Blob&&(t=n),t.type===`image/svg+xml`){let n=e._isSVGFittingCanvas,i=new FileReader,a=new Image,o=new Promise((e,t)=>{a.onload=()=>{r.bitmap=a,r.isSvg=!0,e()},i.onload=async()=>{let e=r.svgUrl=i.result;a.src=await n?`${e}#svgView(preserveAspectRatio(none))`:e},a.onerror=i.onerror=t});i.readAsDataURL(t),await o}else r.bitmap=await createImageBitmap(t);r.refCounter=1}catch(e){ef(e),r=null}return this.#n.set(t,r),r&&this.#n.set(r.id,r),r}async getFromFile(e){let{lastModified:t,name:n,size:r,type:i}=e;return this.#r(`${t}_${n}_${r}_${i}`,e)}async getFromUrl(e){return this.#r(e,e)}async getFromBlob(e,t){let n=await t;return this.#r(e,n)}async getFromId(e){this.#n||=new Map;let t=this.#n.get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){let{blobPromise:e}=t;return delete t.blobPromise,this.getFromBlob(t.id,e)}return this.getFromUrl(t.url)}getFromCanvas(e,t){this.#n||=new Map;let n=this.#n.get(e);if(n?.bitmap)return n.refCounter+=1,n;let r=new OffscreenCanvas(t.width,t.height);return r.getContext(`2d`).drawImage(t,0,0),n={bitmap:r.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#n.set(e,n),this.#n.set(n.id,n),n}getSvgUrl(e){let t=this.#n.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#n||=new Map;let t=this.#n.get(e);if(!t||(--t.refCounter,t.refCounter!==0))return;let{bitmap:n}=t;if(!t.url&&!t.file){let e=new OffscreenCanvas(n.width,n.height);e.getContext(`bitmaprenderer`).transferFromImageBitmap(n),t.blobPromise=e.convertToBlob()}n.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}},np=class{#e=[];#t=!1;#n;#r=-1;constructor(e=128){this.#n=e}add({cmd:e,undo:t,post:n,mustExec:r,type:i=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(r&&e(),this.#t)return;let s={cmd:e,undo:t,post:n,type:i};if(this.#r===-1){this.#e.length>0&&(this.#e.length=0),this.#r=0,this.#e.push(s);return}if(a&&this.#e[this.#r].type===i){o&&(s.undo=this.#e[this.#r].undo),this.#e[this.#r]=s;return}let c=this.#r+1;c===this.#n?this.#e.splice(0,1):(this.#r=c,c<this.#e.length&&this.#e.splice(c)),this.#e.push(s)}undo(){if(this.#r===-1)return;this.#t=!0;let{undo:e,post:t}=this.#e[this.#r];e(),t?.(),this.#t=!1,--this.#r}redo(){if(this.#r<this.#e.length-1){this.#r+=1,this.#t=!0;let{cmd:e,post:t}=this.#e[this.#r];e(),t?.(),this.#t=!1}}hasSomethingToUndo(){return this.#r!==-1}hasSomethingToRedo(){return this.#r<this.#e.length-1}cleanType(e){if(this.#r!==-1){for(let t=this.#r;t>=0;t--)if(this.#e[t].type!==e){this.#e.splice(t+1,this.#r-t),this.#r=t;return}this.#e.length=0,this.#r=-1}}destroy(){this.#e=null}},rp=class{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:t}=xf.platform;for(let[n,r,i={}]of e)for(let e of n){let n=e.startsWith(`mac+`);t&&n?(this.callbacks.set(e.slice(4),{callback:r,options:i}),this.allKeys.add(e.split(`+`).at(-1))):!t&&!n&&(this.callbacks.set(e,{callback:r,options:i}),this.allKeys.add(e.split(`+`).at(-1)))}}#e(e){e.altKey&&this.buffer.push(`alt`),e.ctrlKey&&this.buffer.push(`ctrl`),e.metaKey&&this.buffer.push(`meta`),e.shiftKey&&this.buffer.push(`shift`),this.buffer.push(e.key);let t=this.buffer.join(`+`);return this.buffer.length=0,t}exec(e,t){if(!this.allKeys.has(t.key))return;let n=this.callbacks.get(this.#e(t));if(!n)return;let{callback:r,options:{bubbles:i=!1,args:a=[],checker:o=null}}=n;(!o||o(e,t))&&(r.bind(e,...a,t)(),i||Hf(t))}},ip=class e{static _colorsMapping=new Map([[`CanvasText`,[0,0,0]],[`Canvas`,[255,255,255]]]);get _colors(){let e=new Map([[`CanvasText`,null],[`Canvas`,null]]);return Kf(e),of(this,`_colors`,e)}convert(t){let n=Gf(t);if(!window.matchMedia(`(forced-colors: active)`).matches)return n;for(let[t,r]of this._colors)if(r.every((e,t)=>e===n[t]))return e._colorsMapping.get(t);return n}getHexCode(e){let t=this._colors.get(e);return t?Q.makeHexColor(...t):e}},ap=class e{#e=new AbortController;#t=null;#n=new Map;#r=new Map;#i=null;#a=null;#o=null;#s=new np;#c=null;#l=null;#u=0;#d=new Set;#f=null;#p=null;#m=new Set;_editorUndoBar=null;#h=!1;#g=!1;#_=!1;#v=null;#y=null;#b=null;#x=null;#S=!1;#C=null;#w=new ep;#T=!1;#E=!1;#D=null;#O=null;#k=null;#A=null;#j=Bd.NONE;#M=new Set;#N=null;#P=null;#F=null;#I={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#L=[0,0];#R=null;#z=null;#B=null;#V=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let t=e.prototype,n=e=>e.#z.contains(document.activeElement)&&document.activeElement.tagName!==`BUTTON`&&e.hasSomethingToControl(),r=(e,{target:t})=>{if(t instanceof HTMLInputElement){let{type:e}=t;return e!==`text`&&e!==`number`}return!0},i=this.TRANSLATE_SMALL,a=this.TRANSLATE_BIG;return of(this,`_keyboardManager`,new rp([[[`ctrl+a`,`mac+meta+a`],t.selectAll,{checker:r}],[[`ctrl+z`,`mac+meta+z`],t.undo,{checker:r}],[[`ctrl+y`,`ctrl+shift+z`,`mac+meta+shift+z`,`ctrl+shift+Z`,`mac+meta+shift+Z`],t.redo,{checker:r}],[[`Backspace`,`alt+Backspace`,`ctrl+Backspace`,`shift+Backspace`,`mac+Backspace`,`mac+alt+Backspace`,`mac+ctrl+Backspace`,`Delete`,`ctrl+Delete`,`shift+Delete`,`mac+Delete`],t.delete,{checker:r}],[[`Enter`,`mac+Enter`],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#z.contains(t)&&!e.isEnterHandled}],[[` `,`mac+ `],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#z.contains(document.activeElement)}],[[`Escape`,`mac+Escape`],t.unselectAll],[[`ArrowLeft`,`mac+ArrowLeft`],t.translateSelectedEditors,{args:[-i,0],checker:n}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t.translateSelectedEditors,{args:[-a,0],checker:n}],[[`ArrowRight`,`mac+ArrowRight`],t.translateSelectedEditors,{args:[i,0],checker:n}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t.translateSelectedEditors,{args:[a,0],checker:n}],[[`ArrowUp`,`mac+ArrowUp`],t.translateSelectedEditors,{args:[0,-i],checker:n}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t.translateSelectedEditors,{args:[0,-a],checker:n}],[[`ArrowDown`,`mac+ArrowDown`],t.translateSelectedEditors,{args:[0,i],checker:n}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t.translateSelectedEditors,{args:[0,a],checker:n}]]))}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=this._signal=this.#e.signal;this.#z=e,this.#B=t,this.#i=n,this._eventBus=r,r._on(`editingaction`,this.onEditingAction.bind(this),{signal:p}),r._on(`pagechanging`,this.onPageChanging.bind(this),{signal:p}),r._on(`scalechanging`,this.onScaleChanging.bind(this),{signal:p}),r._on(`rotationchanging`,this.onRotationChanging.bind(this),{signal:p}),r._on(`setpreference`,this.onSetPreference.bind(this),{signal:p}),r._on(`switchannotationeditorparams`,e=>this.updateParams(e.type,e.value),{signal:p}),this.#q(),this.#ee(),this.#X(),this.#a=i.annotationStorage,this.#v=i.filterFactory,this.#P=a,this.#x=o||null,this.#h=s,this.#g=c,this.#_=l,this.#A=u||null,this.viewParameters={realScale:jf.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=d||null,this._supportsPinchToZoom=f!==!1}destroy(){this.#V?.resolve(),this.#V=null,this.#e?.abort(),this.#e=null,this._signal=null;for(let e of this.#r.values())e.destroy();this.#r.clear(),this.#n.clear(),this.#m.clear(),this.#t=null,this.#M.clear(),this.#s.destroy(),this.#i?.destroy(),this.#C?.hide(),this.#C=null,this.#y&&=(clearTimeout(this.#y),null),this.#R&&=(clearTimeout(this.#R),null),this._editorUndoBar?.destroy()}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#A}get useNewAltTextFlow(){return this.#g}get useNewAltTextWhenAddingImage(){return this.#_}get hcmFilter(){return of(this,`hcmFilter`,this.#P?this.#v.addHCMFilter(this.#P.foreground,this.#P.background):`none`)}get direction(){return of(this,`direction`,getComputedStyle(this.#z).direction)}get highlightColors(){return of(this,`highlightColors`,this.#x?new Map(this.#x.split(`,`).map(e=>e.split(`=`).map(e=>e.trim()))):null)}get highlightColorNames(){return of(this,`highlightColorNames`,this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#l=e}setMainHighlightColorPicker(e){this.#k=e}editAltText(e,t=!1){this.#i?.editAltText(this,e,t)}switchToMode(e,t){this._eventBus.on(`annotationeditormodechanged`,t,{once:!0,signal:this._signal}),this._eventBus.dispatch(`showannotationeditorui`,{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch(`setpreference`,{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){e===`enableNewAltTextWhenAddingImage`&&(this.#_=t)}onPageChanging({pageNumber:e}){this.#u=e-1}focusMainContainer(){this.#z.focus()}findParent(e,t){for(let n of this.#r.values()){let{x:r,y:i,width:a,height:o}=n.div.getBoundingClientRect();if(e>=r&&e<=r+a&&t>=i&&t<=i+o)return n}return null}disableUserSelect(e=!1){this.#B.classList.toggle(`noUserSelect`,e)}addShouldRescale(e){this.#m.add(e)}removeShouldRescale(e){this.#m.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*jf.PDF_TO_CSS_UNITS;for(let e of this.#m)e.onScaleChanging();this.#l?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#H({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#U(e){let{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(let t of this.#r.values())if(t.hasTextLayer(e))return t;return null}highlightSelection(e=``){let t=document.getSelection();if(!t||t.isCollapsed)return;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=t,o=t.toString(),s=this.#H(t).closest(`.textLayer`),c=this.getSelectionBoxes(s);if(!c)return;t.empty();let l=this.#U(s),u=this.#j===Bd.NONE,d=()=>{l?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:c,anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a,text:o}),u&&this.showAllEditors(`highlight`,!0,!0)};u?this.switchToMode(Bd.HIGHLIGHT,d):d()}#W(){let e=document.getSelection();if(!e||e.isCollapsed)return;let t=this.#H(e).closest(`.textLayer`),n=this.getSelectionBoxes(t);n&&(this.#C||=new Qf(this),this.#C.show(t,n,this.direction===`ltr`))}addToAnnotationStorage(e){!e.isEmpty()&&this.#a&&!this.#a.has(e.id)&&this.#a.setValue(e.id,e)}#G(){let e=document.getSelection();if(!e||e.isCollapsed){this.#N&&(this.#C?.hide(),this.#N=null,this.#te({hasSelectedText:!1}));return}let{anchorNode:t}=e;if(t===this.#N)return;let n=this.#H(e).closest(`.textLayer`);if(!n)this.#N&&(this.#C?.hide(),this.#N=null,this.#te({hasSelectedText:!1}));else if(this.#C?.hide(),this.#N=t,this.#te({hasSelectedText:!0}),(this.#j===Bd.HIGHLIGHT||this.#j===Bd.NONE)&&(this.#j===Bd.HIGHLIGHT&&this.showAllEditors(`highlight`,!0,!0),this.#S=this.isShiftKeyDown,!this.isShiftKeyDown)){let e=this.#j===Bd.HIGHLIGHT?this.#U(n):null;e?.toggleDrawing();let t=new AbortController,r=this.combinedSignal(t),i=n=>{(n.type!==`pointerup`||n.button===0)&&(t.abort(),e?.toggleDrawing(!0),n.type===`pointerup`&&this.#K(`main_toolbar`))};window.addEventListener(`pointerup`,i,{signal:r}),window.addEventListener(`blur`,i,{signal:r})}}#K(e=``){this.#j===Bd.HIGHLIGHT?this.highlightSelection(e):this.#h&&this.#W()}#q(){document.addEventListener(`selectionchange`,this.#G.bind(this),{signal:this._signal})}#J(){if(this.#b)return;this.#b=new AbortController;let e=this.combinedSignal(this.#b);window.addEventListener(`focus`,this.focus.bind(this),{signal:e}),window.addEventListener(`blur`,this.blur.bind(this),{signal:e})}#Y(){this.#b?.abort(),this.#b=null}blur(){if(this.isShiftKeyDown=!1,this.#S&&(this.#S=!1,this.#K(`main_toolbar`)),!this.hasSelection)return;let{activeElement:e}=document;for(let t of this.#M)if(t.div.contains(e)){this.#O=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#O)return;let[e,t]=this.#O;this.#O=null,t.addEventListener(`focusin`,()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}#X(){if(this.#D)return;this.#D=new AbortController;let e=this.combinedSignal(this.#D);window.addEventListener(`keydown`,this.keydown.bind(this),{signal:e}),window.addEventListener(`keyup`,this.keyup.bind(this),{signal:e})}#Z(){this.#D?.abort(),this.#D=null}#Q(){if(this.#c)return;this.#c=new AbortController;let e=this.combinedSignal(this.#c);document.addEventListener(`copy`,this.copy.bind(this),{signal:e}),document.addEventListener(`cut`,this.cut.bind(this),{signal:e}),document.addEventListener(`paste`,this.paste.bind(this),{signal:e})}#$(){this.#c?.abort(),this.#c=null}#ee(){let e=this._signal;document.addEventListener(`dragover`,this.dragOver.bind(this),{signal:e}),document.addEventListener(`drop`,this.drop.bind(this),{signal:e})}addEditListeners(){this.#X(),this.#Q()}removeEditListeners(){this.#Z(),this.#$()}dragOver(e){for(let{type:t}of e.dataTransfer.items)for(let n of this.#p)if(n.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect=`copy`,e.preventDefault();return}}drop(e){for(let t of e.dataTransfer.items)for(let n of this.#p)if(n.isHandlingMimeForPasting(t.type)){n.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;let t=[];for(let e of this.#M){let n=e.serialize(!0);n&&t.push(n)}t.length!==0&&e.clipboardData.setData(`application/pdfjs`,JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();let{clipboardData:t}=e;for(let e of t.items)for(let t of this.#p)if(t.isHandlingMimeForPasting(e.type)){t.paste(e,this.currentLayer);return}let n=t.getData(`application/pdfjs`);if(!n)return;try{n=JSON.parse(n)}catch(e){ef(`paste: "${e.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();let r=this.currentLayer;try{let e=[];for(let t of n){let n=await r.deserialize(t);if(!n)return;e.push(n)}this.addCommands({cmd:()=>{for(let t of e)this.#ae(t);this.#ce(e)},undo:()=>{for(let t of e)t.remove()},mustExec:!0})}catch(e){ef(`paste: "${e.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key===`Shift`&&(this.isShiftKeyDown=!0),this.#j!==Bd.NONE&&!this.isEditorHandlingKeyboard&&e._keyboardManager.exec(this,t)}keyup(e){this.isShiftKeyDown&&e.key===`Shift`&&(this.isShiftKeyDown=!1,this.#S&&(this.#S=!1,this.#K(`main_toolbar`)))}onEditingAction({name:e}){switch(e){case`undo`:case`redo`:case`delete`:case`selectAll`:this[e]();break;case`highlightSelection`:this.highlightSelection(`context_menu`)}}#te(e){Object.entries(e).some(([e,t])=>this.#I[e]!==t)&&(this._eventBus.dispatch(`annotationeditorstateschanged`,{source:this,details:Object.assign(this.#I,e)}),this.#j===Bd.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#ne([[Vd.HIGHLIGHT_FREE,!0]]))}#ne(e){this._eventBus.dispatch(`annotationeditorparamschanged`,{source:this,details:e})}setEditingState(e){e?(this.#J(),this.#Q(),this.#te({isEditing:this.#j!==Bd.NONE,isEmpty:this.#se(),hasSomethingToUndo:this.#s.hasSomethingToUndo(),hasSomethingToRedo:this.#s.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#Y(),this.#$(),this.#te({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#p){this.#p=e;for(let e of this.#p)this.#ne(e.defaultPropertiesToUpdate)}}getId(){return this.#w.id}get currentLayer(){return this.#r.get(this.#u)}getLayer(e){return this.#r.get(e)}get currentPageIndex(){return this.#u}addLayer(e){this.#r.set(e.pageIndex,e),this.#T?e.enable():e.disable()}removeLayer(e){this.#r.delete(e.pageIndex)}async updateMode(e,t=null,n=!1){if(this.#j!==e&&!(this.#V&&(await this.#V.promise,!this.#V))){if(this.#V=Promise.withResolvers(),this.#j=e,e===Bd.NONE)this.setEditingState(!1),this.#ie(),this._editorUndoBar?.hide(),this.#V.resolve();else{this.setEditingState(!0),await this.#re(),this.unselectAll();for(let t of this.#r.values())t.updateMode(e);if(!t)n&&this.addNewEditorFromKeyboard(),this.#V.resolve();else{for(let e of this.#n.values())e.annotationElementId===t?(this.setSelected(e),e.enterInEditMode()):e.unselect();this.#V.resolve()}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==this.#j&&this._eventBus.dispatch(`switchannotationeditormode`,{source:this,mode:e})}updateParams(e,t){if(this.#p){switch(e){case Vd.CREATE:this.currentLayer.addNewEditor();return;case Vd.HIGHLIGHT_DEFAULT_COLOR:this.#k?.updateColor(t);break;case Vd.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:{type:`highlight`,action:`toggle_visibility`}}}),(this.#F||=new Map).set(e,t),this.showAllEditors(`highlight`,t)}for(let n of this.#M)n.updateParams(e,t);for(let n of this.#p)n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){for(let n of this.#n.values())n.editorType===e&&n.show(t);(this.#F?.get(Vd.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#ne([[Vd.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#E!==e){this.#E=e;for(let t of this.#r.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle(`waiting`,e)}}async#re(){if(!this.#T){this.#T=!0;let e=[];for(let t of this.#r.values())e.push(t.enable());await Promise.all(e);for(let e of this.#n.values())e.enable()}}#ie(){if(this.unselectAll(),this.#T){this.#T=!1;for(let e of this.#r.values())e.disable();for(let e of this.#n.values())e.disable()}}getEditors(e){let t=[];for(let n of this.#n.values())n.pageIndex===e&&t.push(n);return t}getEditor(e){return this.#n.get(e)}addEditor(e){this.#n.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.focusMainContainer(),this.#y=null},0)),this.#n.delete(e.id),this.unselect(e),(!e.annotationElementId||!this.#d.has(e.annotationElementId))&&this.#a?.remove(e.id)}addDeletedAnnotationElement(e){this.#d.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#d.has(e)}removeDeletedAnnotationElement(e){this.#d.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#ae(e){let t=this.#r.get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#t!==e&&(this.#t=e,e&&this.#ne(e.propertiesToUpdate))}get#oe(){let e=null;for(e of this.#M);return e}updateUI(e){this.#oe===e&&this.#ne(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#ne(e.defaultPropertiesToUpdate)}toggleSelected(e){this.#M.has(e)?(this.#M.delete(e),e.unselect(),this.#te({hasSelectedEditor:this.hasSelection})):(this.#M.add(e),e.select(),this.#ne(e.propertiesToUpdate),this.#te({hasSelectedEditor:!0}))}setSelected(e){this.#l?.commitOrRemove();for(let t of this.#M)t!==e&&t.unselect();this.#M.clear(),this.#M.add(e),e.select(),this.#ne(e.propertiesToUpdate),this.#te({hasSelectedEditor:!0})}isSelected(e){return this.#M.has(e)}get firstSelectedEditor(){return this.#M.values().next().value}unselect(e){e.unselect(),this.#M.delete(e),this.#te({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#M.size!==0}get isEnterHandled(){return this.#M.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#s.undo(),this.#te({hasSomethingToUndo:this.#s.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#se()}),this._editorUndoBar?.hide()}redo(){this.#s.redo(),this.#te({hasSomethingToUndo:!0,hasSomethingToRedo:this.#s.hasSomethingToRedo(),isEmpty:this.#se()})}addCommands(e){this.#s.add(e),this.#te({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#se()})}cleanUndoStack(e){this.#s.cleanType(e)}#se(){if(this.#n.size===0)return!0;if(this.#n.size===1)for(let e of this.#n.values())return e.isEmpty();return!1}delete(){this.commitOrRemove();let e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;let t=e?[e]:[...this.#M],n=()=>{this._editorUndoBar?.show(r,t.length===1?t[0].editorType:t.length);for(let e of t)e.remove()},r=()=>{for(let e of t)this.#ae(e)};this.addCommands({cmd:n,undo:r,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#ce(e){for(let e of this.#M)e.unselect();this.#M.clear();for(let t of e)t.isEmpty()||(this.#M.add(t),t.select());this.#te({hasSelectedEditor:this.hasSelection})}selectAll(){for(let e of this.#M)e.commit();this.#ce(this.#n.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#j!==Bd.NONE))&&!this.#l?.commitOrRemove()&&this.hasSelection){for(let e of this.#M)e.unselect();this.#M.clear(),this.#te({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#L[0]+=e,this.#L[1]+=t;let[r,i]=this.#L,a=[...this.#M];this.#R&&clearTimeout(this.#R),this.#R=setTimeout(()=>{this.#R=null,this.#L[0]=this.#L[1]=0,this.addCommands({cmd:()=>{for(let e of a)this.#n.has(e.id)&&e.translateInPage(r,i)},undo:()=>{for(let e of a)this.#n.has(e.id)&&e.translateInPage(-r,-i)},mustExec:!1})},1e3);for(let n of a)n.translateInPage(e,t)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#f=new Map;for(let e of this.#M)this.#f.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#f)return!1;this.disableUserSelect(!1);let e=this.#f;this.#f=null;let t=!1;for(let[{x:n,y:r,pageIndex:i},a]of e)a.newX=n,a.newY=r,a.newPageIndex=i,t||=n!==a.savedX||r!==a.savedY||i!==a.savedPageIndex;if(!t)return!1;let n=(e,t,n,r)=>{if(this.#n.has(e.id)){let i=this.#r.get(r);i?e._setParentAndPosition(i,t,n):(e.pageIndex=r,e.x=t,e.y=n)}};return this.addCommands({cmd:()=>{for(let[t,{newX:r,newY:i,newPageIndex:a}]of e)n(t,r,i,a)},undo:()=>{for(let[t,{savedX:r,savedY:i,savedPageIndex:a}]of e)n(t,r,i,a)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(this.#f)for(let n of this.#f.keys())n.drag(e,t)}rebuild(e){if(e.parent===null){let t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#M.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#j}get imageManager(){return of(this,`imageManager`,new tp)}getSelectionBoxes(e){if(!e)return null;let t=document.getSelection();for(let n=0,r=t.rangeCount;n<r;n++)if(!e.contains(t.getRangeAt(n).commonAncestorContainer))return null;let{x:n,y:r,width:i,height:a}=e.getBoundingClientRect(),o;switch(e.getAttribute(`data-main-rotation`)){case`90`:o=(e,t,o,s)=>({x:(t-r)/a,y:1-(e+o-n)/i,width:s/a,height:o/i});break;case`180`:o=(e,t,o,s)=>({x:1-(e+o-n)/i,y:1-(t+s-r)/a,width:o/i,height:s/a});break;case`270`:o=(e,t,o,s)=>({x:1-(t+s-r)/a,y:(e-n)/i,width:s/a,height:o/i});break;default:o=(e,t,o,s)=>({x:(e-n)/i,y:(t-r)/a,width:o/i,height:s/a})}let s=[];for(let e=0,n=t.rangeCount;e<n;e++){let n=t.getRangeAt(e);if(!n.collapsed)for(let{x:e,y:t,width:r,height:i}of n.getClientRects())r!==0&&i!==0&&s.push(o(e,t,r,i))}return s.length===0?null:s}addChangedExistingAnnotation({annotationElementId:e,id:t}){(this.#o||=new Map).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){this.#o?.delete(e)}renderAnnotationElement(e){let t=this.#o?.get(e.data.id);if(!t)return;let n=this.#a.getRawValue(t);n&&(this.#j!==Bd.NONE||n.hasBeenModified)&&n.renderAnnotationElement(e)}},op=class e{#e=null;#t=!1;#n=null;#r=null;#i=null;#a=null;#o=!1;#s=null;#c=null;#l=null;#u=null;#d=!1;static#f=null;static _l10n=null;constructor(t){this.#c=t,this.#d=t._uiManager.useNewAltTextFlow,e.#f||=Object.freeze({added:`pdfjs-editor-new-alt-text-added-button`,"added-label":`pdfjs-editor-new-alt-text-added-button-label`,missing:`pdfjs-editor-new-alt-text-missing-button`,"missing-label":`pdfjs-editor-new-alt-text-missing-button-label`,review:`pdfjs-editor-new-alt-text-to-review-button`,"review-label":`pdfjs-editor-new-alt-text-to-review-button-label`})}static initialize(t){e._l10n??=t}async render(){let t=this.#n=document.createElement(`button`);t.className=`altText`,t.tabIndex=`0`;let n=this.#r=document.createElement(`span`);t.append(n),this.#d?(t.classList.add(`new`),t.setAttribute(`data-l10n-id`,e.#f.missing),n.setAttribute(`data-l10n-id`,e.#f[`missing-label`])):(t.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-button`),n.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-button-label`));let r=this.#c._uiManager._signal;t.addEventListener(`contextmenu`,Vf,{signal:r}),t.addEventListener(`pointerdown`,e=>e.stopPropagation(),{signal:r});let i=e=>{e.preventDefault(),this.#c._uiManager.editAltText(this.#c),this.#d&&this.#c._reportTelemetry({action:`pdfjs.image.alt_text.image_status_label_clicked`,data:{label:this.#p}})};return t.addEventListener(`click`,i,{capture:!0,signal:r}),t.addEventListener(`keydown`,e=>{e.target===t&&e.key===`Enter`&&(this.#o=!0,i(e))},{signal:r}),await this.#m(),t}get#p(){return this.#e&&`added`||this.#e===null&&this.guessedText&&`review`||`missing`}finish(){this.#n&&(this.#n.focus({focusVisible:this.#o}),this.#o=!1)}isEmpty(){return this.#d?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#d?this.#e!==null||!!this.#l:this.isEmpty()}get guessedText(){return this.#l}async setGuessedText(t){this.#e===null&&(this.#l=t,this.#u=await e._l10n.get(`pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer`,{generatedAltText:t}),this.#m())}toggleAltTextBadge(e=!1){if(!this.#d||this.#e)this.#s?.remove(),this.#s=null;else{if(!this.#s){let e=this.#s=document.createElement(`div`);e.className=`noAltTextBadge`,this.#c.div.append(e)}this.#s.classList.toggle(`hidden`,!e)}}serialize(e){let t=this.#e;return!e&&this.#l===t&&(t=this.#u),{altText:t,decorative:this.#t,guessedText:this.#l,textWithDisclaimer:this.#u}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:t,guessedText:n,textWithDisclaimer:r,cancel:i=!1}){n&&(this.#l=n,this.#u=r),(this.#e!==e||this.#t!==t)&&(i||(this.#e=e,this.#t=t),this.#m())}toggle(e=!1){this.#n&&(!e&&this.#a&&(clearTimeout(this.#a),this.#a=null),this.#n.disabled=!e)}shown(){this.#c._reportTelemetry({action:`pdfjs.image.alt_text.image_status_label_displayed`,data:{label:this.#p}})}destroy(){this.#n?.remove(),this.#n=null,this.#r=null,this.#i=null,this.#s?.remove(),this.#s=null}async#m(){let t=this.#n;if(!t)return;if(this.#d){if(t.classList.toggle(`done`,!!this.#e),t.setAttribute(`data-l10n-id`,e.#f[this.#p]),this.#r?.setAttribute(`data-l10n-id`,e.#f[`${this.#p}-label`]),!this.#e){this.#i?.remove();return}}else{if(!this.#e&&!this.#t){t.classList.remove(`done`),this.#i?.remove();return}t.classList.add(`done`),t.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-edit-button`)}let n=this.#i;if(!n){this.#i=n=document.createElement(`span`),n.className=`tooltip`,n.setAttribute(`role`,`tooltip`),n.id=`alt-text-tooltip-${this.#c.id}`;let e=this.#c._uiManager._signal;e.addEventListener(`abort`,()=>{clearTimeout(this.#a),this.#a=null},{once:!0}),t.addEventListener(`mouseenter`,()=>{this.#a=setTimeout(()=>{this.#a=null,this.#i.classList.add(`show`),this.#c._reportTelemetry({action:`alt_text_tooltip`})},100)},{signal:e}),t.addEventListener(`mouseleave`,()=>{this.#a&&=(clearTimeout(this.#a),null),this.#i?.classList.remove(`show`)},{signal:e})}this.#t?n.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-decorative-tooltip`):(n.removeAttribute(`data-l10n-id`),n.textContent=this.#e),n.parentNode||t.append(n),this.#c.getImageForAltText()?.setAttribute(`aria-describedby`,n.id)}},sp=class e{#e;#t=!1;#n=null;#r;#i;#a;#o;#s;#c=null;#l;#u=null;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:r=null,onPinching:i=null,onPinchEnd:a=null,signal:o}){this.#e=e,this.#n=n,this.#r=t,this.#i=r,this.#a=i,this.#o=a,this.#l=new AbortController,this.#s=AbortSignal.any([o,this.#l.signal]),e.addEventListener(`touchstart`,this.#d.bind(this),{passive:!1,signal:this.#s})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return of(this,`MIN_TOUCH_DISTANCE_TO_PINCH`,35/(window.devicePixelRatio||1))}#d(e){if(this.#r?.()||e.touches.length<2)return;if(!this.#u){this.#u=new AbortController;let e=AbortSignal.any([this.#s,this.#u.signal]),t=this.#e,n={signal:e,passive:!1};t.addEventListener(`touchmove`,this.#f.bind(this),n),t.addEventListener(`touchend`,this.#p.bind(this),n),t.addEventListener(`touchcancel`,this.#p.bind(this),n),this.#i?.()}if(Hf(e),e.touches.length!==2||this.#n?.()){this.#c=null;return}let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]),this.#c={touch0X:t.screenX,touch0Y:t.screenY,touch1X:n.screenX,touch1Y:n.screenY}}#f(t){if(!this.#c||t.touches.length!==2)return;let[n,r]=t.touches;n.identifier>r.identifier&&([n,r]=[r,n]);let{screenX:i,screenY:a}=n,{screenX:o,screenY:s}=r,c=this.#c,{touch0X:l,touch0Y:u,touch1X:d,touch1Y:f}=c,p=d-l,m=f-u,h=o-i,g=s-a,_=Math.hypot(h,g)||1,v=Math.hypot(p,m)||1;if(!this.#t&&Math.abs(v-_)<=e.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(c.touch0X=i,c.touch0Y=a,c.touch1X=o,c.touch1Y=s,t.preventDefault(),!this.#t){this.#t=!0;return}let y=[(i+o)/2,(a+s)/2];this.#a?.(y,v,_)}#p(e){this.#u.abort(),this.#u=null,this.#o?.(),this.#c&&(e.preventDefault(),this.#c=null,this.#t=!1)}destroy(){this.#l?.abort(),this.#l=null}},cp=class e{#e=null;#t=null;#n=null;#r=!1;#i=null;#a=``;#o=!1;#s=null;#c=null;#l=null;#u=null;#d=``;#f=!1;#p=null;#m=!1;#h=!1;#g=!1;#_=null;#v=0;#y=0;#b=null;#x=null;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#S=!1;#C=e._zIndex++;static _borderLineWidth=-1;static _colorManager=new ip;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let t=e.prototype._resizeWithKeyboard,n=ap.TRANSLATE_SMALL,r=ap.TRANSLATE_BIG;return of(this,`_resizerKeyboardManager`,new rp([[[`ArrowLeft`,`mac+ArrowLeft`],t,{args:[-n,0]}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t,{args:[-r,0]}],[[`ArrowRight`,`mac+ArrowRight`],t,{args:[n,0]}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t,{args:[r,0]}],[[`ArrowUp`,`mac+ArrowUp`],t,{args:[0,-n]}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t,{args:[0,-r]}],[[`ArrowDown`,`mac+ArrowDown`],t,{args:[0,n]}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t,{args:[0,r]}],[[`Escape`,`mac+Escape`],e.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;let{rotation:t,rawDims:{pageWidth:n,pageHeight:r,pageX:i,pageY:a}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,r],this.pageTranslation=[i,a];let[o,s]=this.parentDimensions;this.x=e.x/o,this.y=e.y/s,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get isDrawer(){return!1}static get _defaultLineColor(){return of(this,`_defaultLineColor`,this._colorManager.getHexCode(`CanvasText`))}static deleteAnnotationElement(e){let t=new lp({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(t,n){if(e._l10n??=t,e._l10nResizer||=Object.freeze({topLeft:`pdfjs-editor-resizer-top-left`,topMiddle:`pdfjs-editor-resizer-top-middle`,topRight:`pdfjs-editor-resizer-top-right`,middleRight:`pdfjs-editor-resizer-middle-right`,bottomRight:`pdfjs-editor-resizer-bottom-right`,bottomMiddle:`pdfjs-editor-resizer-bottom-middle`,bottomLeft:`pdfjs-editor-resizer-bottom-left`,middleLeft:`pdfjs-editor-resizer-middle-left`}),e._borderLineWidth!==-1)return;let r=getComputedStyle(document.documentElement);e._borderLineWidth=parseFloat(r.getPropertyValue(`--outline-width`))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){tf(`Not implemented`)}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#S}set _isDraggable(e){this.#S=e,this.div?.classList.toggle(`draggable`,e)}get isEnterHandled(){return!0}center(){let[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#C}setParent(e){e===null?this.#H():(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#f?this.#f=!1:this.parent.setSelected(this))}focusout(e){this._focusEventsAllowed&&this.isAttachedToDOM&&(e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove()))}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,r){let[i,a]=this.parentDimensions;[n,r]=this.screenToPageTranslation(n,r),this.x=(e+n)/i,this.y=(t+r)/a,this.fixAndSetPosition()}#w([e,t],n,r){[n,r]=this.screenToPageTranslation(n,r),this.x+=n/e,this.y+=r/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,t){this.#w(this.parentDimensions,e,t)}translateInPage(e,t){this.#p||=[this.x,this.y,this.width,this.height],this.#w(this.pageDimensions,e,t),this.div.scrollIntoView({block:`nearest`})}drag(e,t){this.#p||=[this.x,this.y,this.width,this.height];let{div:n,parentDimensions:[r,i]}=this;if(this.x+=e/r,this.y+=t/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:e,y:t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,e,t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this,[s,c]=this.getBaseTranslation();a+=s,o+=c;let{style:l}=n;l.left=`${(100*a).toFixed(2)}%`,l.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o),n.scrollIntoView({block:`nearest`})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!this.#p&&(this.#p[0]!==this.x||this.#p[1]!==this.y)}get _hasBeenResized(){return!!this.#p&&(this.#p[2]!==this.width||this.#p[3]!==this.height)}getBaseTranslation(){let[t,n]=this.parentDimensions,{_borderLineWidth:r}=e,i=r/t,a=r/n;switch(this.rotation){case 90:return[-i,a];case 180:return[i,a];case 270:return[i,-a];default:return[-i,-a]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){let{div:{style:t},pageDimensions:[n,r]}=this,{x:i,y:a,width:o,height:s}=this;if(o*=n,s*=r,i*=n,a*=r,this._mustFixPosition)switch(e){case 0:i=Math.max(0,Math.min(n-o,i)),a=Math.max(0,Math.min(r-s,a));break;case 90:i=Math.max(0,Math.min(n-s,i)),a=Math.min(r,Math.max(o,a));break;case 180:i=Math.min(n,Math.max(o,i)),a=Math.min(r,Math.max(s,a));break;case 270:i=Math.min(n,Math.max(s,i)),a=Math.max(0,Math.min(r-o,a))}this.x=i/=n,this.y=a/=r;let[c,l]=this.getBaseTranslation();i+=c,a+=l,t.left=`${(100*i).toFixed(2)}%`,t.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}static#T(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(t,n){return e.#T(t,n,this.parentRotation)}pageTranslationToScreen(t,n){return e.#T(t,n,360-this.parentRotation)}#E(e){switch(e){case 90:{let[e,t]=this.pageDimensions;return[0,-e/t,t/e,0]}case 180:return[-1,0,0,-1];case 270:{let[e,t]=this.pageDimensions;return[0,e/t,-t/e,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:e,pageDimensions:[t,n]}=this;return[t*e,n*e]}setDims(e,t){let[n,r]=this.parentDimensions,{style:i}=this.div;i.width=`${(100*e/n).toFixed(2)}%`,this.#o||(i.height=`${(100*t/r).toFixed(2)}%`)}fixDims(){let{style:e}=this.div,{height:t,width:n}=e,r=n.endsWith(`%`),i=!this.#o&&t.endsWith(`%`);if(r&&i)return;let[a,o]=this.parentDimensions;r||(e.width=`${(100*parseFloat(n)/a).toFixed(2)}%`),!this.#o&&!i&&(e.height=`${(100*parseFloat(t)/o).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#D(){if(this.#s)return;this.#s=document.createElement(`div`),this.#s.classList.add(`resizers`);let e=this._willKeepAspectRatio?[`topLeft`,`topRight`,`bottomRight`,`bottomLeft`]:[`topLeft`,`topMiddle`,`topRight`,`middleRight`,`bottomRight`,`bottomMiddle`,`bottomLeft`,`middleLeft`],t=this._uiManager._signal;for(let n of e){let e=document.createElement(`div`);this.#s.append(e),e.classList.add(`resizer`,n),e.setAttribute(`data-resizer-name`,n),e.addEventListener(`pointerdown`,this.#O.bind(this,n),{signal:t}),e.addEventListener(`contextmenu`,Vf,{signal:t}),e.tabIndex=-1}this.div.prepend(this.#s)}#O(e,t){t.preventDefault();let{isMac:n}=xf.platform;if(t.button!==0||t.ctrlKey&&n)return;this.#n?.toggle(!1);let r=this._isDraggable;this._isDraggable=!1,this.#c=[t.screenX,t.screenY];let i=new AbortController,a=this._uiManager.combinedSignal(i);this.parent.togglePointerEvents(!1),window.addEventListener(`pointermove`,this.#j.bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener(`touchmove`,Hf,{passive:!1,signal:a}),window.addEventListener(`contextmenu`,Vf,{signal:a}),this.#l={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let o=this.parent.div.style.cursor,s=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;let c=()=>{i.abort(),this.parent.togglePointerEvents(!0),this.#n?.toggle(!0),this._isDraggable=r,this.parent.div.style.cursor=o,this.div.style.cursor=s,this.#A()};window.addEventListener(`pointerup`,c,{signal:a}),window.addEventListener(`blur`,c,{signal:a})}#k(e,t,n,r){this.width=n,this.height=r,this.x=e,this.y=t;let[i,a]=this.parentDimensions;this.setDims(i*n,a*r),this.fixAndSetPosition(),this._onResized()}_onResized(){}#A(){if(!this.#l)return;let{savedX:e,savedY:t,savedWidth:n,savedHeight:r}=this.#l;this.#l=null;let i=this.x,a=this.y,o=this.width,s=this.height;(i!==e||a!==t||o!==n||s!==r)&&this.addCommands({cmd:this.#k.bind(this,i,a,o,s),undo:this.#k.bind(this,e,t,n,r),mustExec:!0})}static _round(e){return Math.round(e*1e4)/1e4}#j(t,n){let[r,i]=this.parentDimensions,a=this.x,o=this.y,s=this.width,c=this.height,l=e.MIN_SIZE/r,u=e.MIN_SIZE/i,d=this.#E(this.rotation),f=(e,t)=>[d[0]*e+d[2]*t,d[1]*e+d[3]*t],p=this.#E(360-this.rotation),m=(e,t)=>[p[0]*e+p[2]*t,p[1]*e+p[3]*t],h,g,_=!1,v=!1;switch(t){case`topLeft`:_=!0,h=(e,t)=>[0,0],g=(e,t)=>[e,t];break;case`topMiddle`:h=(e,t)=>[e/2,0],g=(e,t)=>[e/2,t];break;case`topRight`:_=!0,h=(e,t)=>[e,0],g=(e,t)=>[0,t];break;case`middleRight`:v=!0,h=(e,t)=>[e,t/2],g=(e,t)=>[0,t/2];break;case`bottomRight`:_=!0,h=(e,t)=>[e,t],g=(e,t)=>[0,0];break;case`bottomMiddle`:h=(e,t)=>[e/2,t],g=(e,t)=>[e/2,0];break;case`bottomLeft`:_=!0,h=(e,t)=>[0,t],g=(e,t)=>[e,0];break;case`middleLeft`:v=!0,h=(e,t)=>[0,t/2],g=(e,t)=>[e,t/2]}let y=h(s,c),b=g(s,c),x=f(...b),S=e._round(a+x[0]),ee=e._round(o+x[1]),te=1,ne=1,C,re;if(n.fromKeyboard)({deltaX:C,deltaY:re}=n);else{let{screenX:e,screenY:t}=n,[r,i]=this.#c;[C,re]=this.screenToPageTranslation(e-r,t-i),this.#c[0]=e,this.#c[1]=t}if([C,re]=m(C/r,re/i),_){let e=Math.hypot(s,c);te=ne=Math.max(Math.min(Math.hypot(b[0]-y[0]-C,b[1]-y[1]-re)/e,1/s,1/c),l/s,u/c)}else v?te=Math.max(l,Math.min(1,Math.abs(b[0]-y[0]-C)))/s:ne=Math.max(u,Math.min(1,Math.abs(b[1]-y[1]-re)))/c;let ie=e._round(s*te),ae=e._round(c*ne);x=f(...g(ie,ae));let w=S-x[0],oe=ee-x[1];this.#p||=[this.x,this.y,this.width,this.height],this.width=ie,this.height=ae,this.x=w,this.y=oe,this.setDims(r*ie,i*ae),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#n?.finish()}async addEditToolbar(){return this._editToolbar||this.#h||(this._editToolbar=new Zf(this),this.div.append(this._editToolbar.render()),this.#n&&await this._editToolbar.addAltText(this.#n)),this._editToolbar}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#n?.destroy())}addContainer(e){let t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#n||(op.initialize(e._l10n),this.#n=new op(this),this.#e&&=(this.#n.data=this.#e,null),await this.addEditToolbar())}get altTextData(){return this.#n?.data}set altTextData(e){this.#n&&(this.#n.data=e)}get guessedAltText(){return this.#n?.guessedText}async setGuessedAltText(e){await this.#n?.setGuessedText(e)}serializeAltText(e){return this.#n?.serialize(e)}hasAltText(){return!!this.#n&&!this.#n.isEmpty()}hasAltTextData(){return this.#n?.hasData()??!1}render(){this.div=document.createElement(`div`),this.div.setAttribute(`data-editor-rotation`,(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute(`id`,this.id),this.div.tabIndex=this.#r?-1:0,this._isVisible||this.div.classList.add(`hidden`),this.setInForeground(),this.#L();let[e,t]=this.parentDimensions;this.parentRotation%180!=0&&(this.div.style.maxWidth=`${(100*t/e).toFixed(2)}%`,this.div.style.maxHeight=`${(100*e/t).toFixed(2)}%`);let[n,r]=this.getInitialTranslation();return this.translate(n,r),$f(this,this.div,[`pointerdown`]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#x||=new sp({container:this.div,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#M.bind(this),onPinching:this.#N.bind(this),onPinchEnd:this.#P.bind(this),signal:this._uiManager._signal})),this._uiManager._editorUndoBar?.hide(),this.div}#M(){this.#l={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#n?.toggle(!1),this.parent.togglePointerEvents(!1)}#N(t,n,r){let i=.7,a=r/n*i+1-i;if(a===1)return;let o=this.#E(this.rotation),s=(e,t)=>[o[0]*e+o[2]*t,o[1]*e+o[3]*t],[c,l]=this.parentDimensions,u=this.x,d=this.y,f=this.width,p=this.height,m=e.MIN_SIZE/c,h=e.MIN_SIZE/l;a=Math.max(Math.min(a,1/f,1/p),m/f,h/p);let g=e._round(f*a),_=e._round(p*a);if(g===f&&_===p)return;this.#p||=[u,d,f,p];let v=s(f/2,p/2),y=e._round(u+v[0]),b=e._round(d+v[1]),x=s(g/2,_/2);this.x=y-x[0],this.y=b-x[1],this.width=g,this.height=_,this.setDims(c*g,l*_),this.fixAndSetPosition(),this._onResizing()}#P(){this.#n?.toggle(!0),this.parent.togglePointerEvents(!0),this.#A()}pointerdown(e){let{isMac:t}=xf.platform;e.button!==0||e.ctrlKey&&t?e.preventDefault():(this.#f=!0,this._isDraggable?this.#I(e):this.#F(e))}get isSelected(){return this._uiManager.isSelected(this)}#F(e){let{isMac:t}=xf.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#I(e){let{isSelected:t}=this;this._uiManager.setUpDragSession();let n=!1,r=new AbortController,i=this._uiManager.combinedSignal(r),a={capture:!0,passive:!1,signal:i},o=e=>{r.abort(),this.#i=null,this.#f=!1,this._uiManager.endDragSession()||this.#F(e),n&&this._onStopDragging()};t&&(this.#v=e.clientX,this.#y=e.clientY,this.#i=e.pointerId,this.#a=e.pointerType,window.addEventListener(`pointermove`,e=>{n||(n=!0,this._onStartDragging());let{clientX:t,clientY:r,pointerId:i}=e;if(i!==this.#i){Hf(e);return}let[a,o]=this.screenToPageTranslation(t-this.#v,r-this.#y);this.#v=t,this.#y=r,this._uiManager.dragSelectedEditors(a,o)},a),window.addEventListener(`touchmove`,Hf,a),window.addEventListener(`pointerdown`,e=>{e.pointerType===this.#a&&(this.#x||e.isPrimary)&&o(e),Hf(e)},a));let s=e=>{!this.#i||this.#i===e.pointerId?o(e):Hf(e)};window.addEventListener(`pointerup`,s,{signal:i}),window.addEventListener(`blur`,s,{signal:i})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#_&&clearTimeout(this.#_),this.#_=setTimeout(()=>{this.#_=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,n=this.rotation){let r=this.parentScale,[i,a]=this.pageDimensions,[o,s]=this.pageTranslation,c=e/r,l=t/r,u=this.x*i,d=this.y*a,f=this.width*i,p=this.height*a;switch(n){case 0:return[u+c+o,a-d-l-p+s,u+c+f+o,a-d-l+s];case 90:return[u+l+o,a-d+c+s,u+l+p+o,a-d+c+f+s];case 180:return[u-c-f+o,a-d+l+s,u-c+o,a-d+l+p+s];case 270:return[u-l-p+o,a-d-c-f+s,u-l+o,a-d-c+s];default:throw Error(`Invalid rotation`)}}getRectInCurrentCoords(e,t){let[n,r,i,a]=e,o=i-n,s=a-r;switch(this.rotation){case 0:return[n,t-a,o,s];case 90:return[n,t-r,s,o];case 180:return[i,t-r,o,s];case 270:return[i,t-a,s,o];default:throw Error(`Invalid rotation`)}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){this.#h=!0}disableEditMode(){this.#h=!1}isInEditMode(){return this.#h}shouldGetKeyboardEvents(){return this.#g}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:e,left:t,bottom:n,right:r}=this.getClientDimensions(),{innerHeight:i,innerWidth:a}=window;return t<a&&r>0&&e<i&&n>0}#L(){if(this.#u||!this.div)return;this.#u=new AbortController;let e=this._uiManager.combinedSignal(this.#u);this.div.addEventListener(`focusin`,this.focusin.bind(this),{signal:e}),this.div.addEventListener(`focusout`,this.focusout.bind(this),{signal:e})}rebuild(){this.#L()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||``}}serialize(e=!1,t=null){tf(`An editor must be serializable`)}static async deserialize(e,t,n){let r=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:n});r.rotation=e.rotation,r.#e=e.accessibilityData;let[i,a]=r.pageDimensions,[o,s,c,l]=r.getRectInCurrentCoords(e.rect,a);return r.x=o/i,r.y=s/a,r.width=c/i,r.height=l/a,r}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#u?.abort(),this.#u=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#_&&=(clearTimeout(this.#_),null),this.#H(),this.removeEditToolbar(),this.#b){for(let e of this.#b.values())clearTimeout(e);this.#b=null}this.parent=null,this.#x?.destroy(),this.#x=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#D(),this.#s.classList.remove(`hidden`),$f(this,this.div,[`keydown`]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!==`Enter`)return;this._uiManager.setSelected(this),this.#l={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let n=this.#s.children;if(!this.#t){this.#t=Array.from(n);let t=this.#R.bind(this),r=this.#z.bind(this),i=this._uiManager._signal;for(let n of this.#t){let a=n.getAttribute(`data-resizer-name`);n.setAttribute(`role`,`spinbutton`),n.addEventListener(`keydown`,t,{signal:i}),n.addEventListener(`blur`,r,{signal:i}),n.addEventListener(`focus`,this.#B.bind(this,a),{signal:i}),n.setAttribute(`data-l10n-id`,e._l10nResizer[a])}}let r=this.#t[0],i=0;for(let e of n){if(e===r)break;i++}let a=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(a!==i){if(a<i)for(let e=0;e<i-a;e++)this.#s.append(this.#s.firstChild);else if(a>i)for(let e=0;e<a-i;e++)this.#s.firstChild.before(this.#s.lastChild);let t=0;for(let r of n){let n=this.#t[t++].getAttribute(`data-resizer-name`);r.setAttribute(`data-l10n-id`,e._l10nResizer[n])}}this.#V(0),this.#g=!0,this.#s.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#R(t){e._resizerKeyboardManager.exec(this,t)}#z(e){this.#g&&e.relatedTarget?.parentNode!==this.#s&&this.#H()}#B(e){this.#d=this.#g?e:``}#V(e){if(this.#t)for(let t of this.#t)t.tabIndex=e}_resizeWithKeyboard(e,t){this.#g&&this.#j(this.#d,{deltaX:e,deltaY:t,fromKeyboard:!0})}#H(){this.#g=!1,this.#V(-1),this.#A()}_stopResizingWithKeyboard(){this.#H(),this.div.focus()}select(){this.makeResizable(),this.div?.classList.add(`selectedEditor`),this._editToolbar?(this._editToolbar?.show(),this.#n?.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{this.div?.classList.contains(`selectedEditor`)&&this._editToolbar?.show()})}unselect(){this.#s?.classList.add(`hidden`),this.div?.classList.remove(`selectedEditor`),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#n?.toggleAltTextBadge(!0)}updateParams(e,t){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#m}set isEditing(e){this.#m=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,t){this.#o=!0;let n=e/t,{style:r}=this.div;r.aspectRatio=n,r.height=`auto`}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:`added`}}get telemetryFinalData(){return null}_reportTelemetry(t,n=!1){if(n){this.#b||=new Map;let{action:n}=t,r=this.#b.get(n);r&&clearTimeout(r),r=setTimeout(()=>{this._reportTelemetry(t),this.#b.delete(n),this.#b.size===0&&(this.#b=null)},e._telemetryTimeout),this.#b.set(n,r)}else t.type||=this.editorType,this._uiManager._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:t}})}show(e=this._isVisible){this.div.classList.toggle(`hidden`,!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#r=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#r=!0}renderAnnotationElement(e){let t=e.container.querySelector(`.annotationContent`);if(!t)t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.container.prepend(t);else if(t.nodeName===`CANVAS`){let e=t;t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.before(t)}return t}resetAnnotationElement(e){let{firstChild:t}=e.container;t?.nodeName===`DIV`&&t.classList.contains(`annotationContent`)&&t.remove()}},lp=class extends cp{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},up=3285377520,dp=4294901760,fp=65535,pp=class{constructor(e){this.h1=e?e|0:up,this.h2=e?e|0:up}update(e){let t,n;if(typeof e==`string`){t=new Uint8Array(e.length*2),n=0;for(let r=0,i=e.length;r<i;r++){let i=e.charCodeAt(r);i<=255?t[n++]=i:(t[n++]=i>>>8,t[n++]=i&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),n=t.byteLength;else throw Error(`Invalid data format, must be a string or TypedArray.`);let r=n>>2,i=n-r*4,a=new Uint32Array(t.buffer,0,r),o=0,s=0,c=this.h1,l=this.h2,u=3432918353,d=461845907,f=11601,p=13715;for(let e=0;e<r;e++)e&1?(o=a[e],o=o*u&dp|o*f&fp,o=o<<15|o>>>17,o=o*d&dp|o*p&fp,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(s=a[e],s=s*u&dp|s*f&fp,s=s<<15|s>>>17,s=s*d&dp|s*p&fp,l^=s,l=l<<13|l>>>19,l=l*5+3864292196);switch(o=0,i){case 3:o^=t[r*4+2]<<16;case 2:o^=t[r*4+1]<<8;case 1:o^=t[r*4],o=o*u&dp|o*f&fp,o=o<<15|o>>>17,o=o*d&dp|o*p&fp,r&1?c^=o:l^=o}this.h1=c,this.h2=l}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&dp|e*36045&fp,t=t*4283543511&dp|((t<<16|e>>>16)*2950163797&dp)>>>16,e^=t>>>1,e=e*444984403&dp|e*60499&fp,t=t*3301882366&dp|((t<<16|e>>>16)*3120437893&dp)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,`0`)+(t>>>0).toString(16).padStart(8,`0`)}},mp=Object.freeze({map:null,hash:``,transfer:void 0}),hp=class{#e=!1;#t=null;#n=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){let n=this.#n.get(e);return n===void 0?t:Object.assign(t,n)}getRawValue(e){return this.#n.get(e)}remove(e){if(this.#n.delete(e),this.#n.size===0&&this.resetModified(),typeof this.onAnnotationEditor==`function`){for(let e of this.#n.values())if(e instanceof cp)return;this.onAnnotationEditor(null)}}setValue(e,t){let n=this.#n.get(e),r=!1;if(n!==void 0)for(let[e,i]of Object.entries(t))n[e]!==i&&(r=!0,n[e]=i);else r=!0,this.#n.set(e,t);r&&this.#r(),t instanceof cp&&typeof this.onAnnotationEditor==`function`&&this.onAnnotationEditor(t.constructor._type)}has(e){return this.#n.has(e)}getAll(){return this.#n.size>0?vf(this.#n):null}setAll(e){for(let[t,n]of Object.entries(e))this.setValue(t,n)}get size(){return this.#n.size}#r(){this.#e||(this.#e=!0,typeof this.onSetModified==`function`&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified==`function`&&this.onResetModified())}get print(){return new gp(this)}get serializable(){if(this.#n.size===0)return mp;let e=new Map,t=new pp,n=[],r=Object.create(null),i=!1;for(let[n,a]of this.#n){let o=a instanceof cp?a.serialize(!1,r):a;o&&(e.set(n,o),t.update(`${n}:${JSON.stringify(o)}`),i||=!!o.bitmap)}if(i)for(let t of e.values())t.bitmap&&n.push(t.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:n}:mp}get editorStats(){let e=null,t=new Map;for(let n of this.#n.values()){if(!(n instanceof cp))continue;let r=n.telemetryFinalData;if(!r)continue;let{type:i}=r;t.has(i)||t.set(i,Object.getPrototypeOf(n).constructor),e||=Object.create(null);let a=e[i]||=new Map;for(let[e,t]of Object.entries(r)){if(e===`type`)continue;let n=a.get(e);n||(n=new Map,a.set(e,n));let r=n.get(t)??0;n.set(t,r+1)}}for(let[n,r]of t)e[n]=r.computeTelemetryFinalData(e[n]);return e}resetModifiedIds(){this.#t=null}get modifiedIds(){if(this.#t)return this.#t;let e=[];for(let t of this.#n.values())t instanceof cp&&t.annotationElementId&&t.serialize()&&e.push(t.annotationElementId);return this.#t={ids:new Set(e),hash:e.join(`,`)}}},gp=class extends hp{#e;constructor(e){super();let{map:t,hash:n,transfer:r}=e.serializable,i=structuredClone(t,r?{transfer:r}:null);this.#e={map:i,hash:n,transfer:r}}get print(){tf(`Should not call PrintAnnotationStorage.print`)}get serializable(){return this.#e}get modifiedIds(){return of(this,`modifiedIds`,{ids:new Set,hash:``})}},_p=class{#e=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement(`style`),this._document.documentElement.getElementsByTagName(`head`)[0].append(this.styleElement));let t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(let e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&=(this.styleElement.remove(),null)}async loadSystemFont({systemFontInfo:e,_inspectFont:t}){if(e&&!this.#e.has(e.loadedName)){if(nf(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:n,src:r,style:i}=e,a=new FontFace(n,r,i);this.addNativeFontFace(a);try{await a.load(),this.#e.add(n),t?.(e)}catch{ef(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}}else tf(`Not implemented: loadSystemFont without the Font Loading API.`)}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){let t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw ef(`Failed to load font '${t.family}': '${n}'.`),e.disableFontFace=!0,n}}return}let t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(t=>{let n=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,n)})}}get isFontLoadingAPISupported(){let e=!!this._document?.fonts;return of(this,`isFontLoadingAPISupported`,e)}get isSyncFontLoadingSupported(){let e=!1;return(Md||typeof navigator<`u`&&typeof navigator?.userAgent==`string`&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),of(this,`isSyncFontLoadingSupported`,e)}_queueLoadingCallback(e){function t(){for(nf(!r.done,`completeRequest() cannot be called twice.`),r.done=!0;n.length>0&&n[0].done;){let e=n.shift();setTimeout(e.callback,0)}}let{loadingRequests:n}=this,r={done:!1,complete:t,callback:e};return n.push(r),r}get _loadTestFont(){let e=atob(`T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==`);return of(this,`_loadTestFont`,e)}_prepareFontLoadEvent(e,t){function n(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3)&255}function r(e,t,n,r){let i=e.substring(0,t),a=e.substring(t+n);return i+r+a}let i,a,o=this._document.createElement(`canvas`);o.width=1,o.height=1;let s=o.getContext(`2d`),c=0;function l(e,t){++c>30?(ef(`Load test font never loaded.`),t()):(s.font=`30px `+e,s.fillText(`.`,0,20),s.getImageData(0,0,1,1).data[3]>0?t():setTimeout(l.bind(null,e,t)))}let u=`lt${Date.now()}${this.loadTestFontId++}`,d=this._loadTestFont;d=r(d,976,u.length,u);let f=1482184792,p=n(d,16);for(i=0,a=u.length-3;i<a;i+=4)p=p-f+n(u,i)|0;i<u.length&&(p=p-f+n(u+`XXX`,i)|0),d=r(d,16,4,_f(p));let m=`@font-face {font-family:"${u}";src:${`url(data:font/opentype;base64,${btoa(d)});`}}`;this.insertRule(m);let h=this._document.createElement(`div`);h.style.visibility=`hidden`,h.style.width=h.style.height=`10px`,h.style.position=`absolute`,h.style.top=h.style.left=`0px`;for(let t of[e.loadedName,u]){let e=this._document.createElement(`span`);e.textContent=`Hi`,e.style.fontFamily=t,h.append(e)}this._document.body.append(h),l(u,()=>{h.remove(),t.complete()})}},vp=class{constructor(e,{disableFontFace:t=!1,fontExtraProperties:n=!1,inspectFont:r=null}){this.compiledGlyphs=Object.create(null);for(let t in e)this[t]=e[t];this.disableFontFace=t===!0,this.fontExtraProperties=n===!0,this._inspectFont=r}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{let t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;let e=`url(data:${this.mimetype};base64,${kf(this.data)});`,t;if(!this.cssFontInfo)t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let n=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(n+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${n}src:${e}}`}return this._inspectFont?.(this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let n=this.loadedName+`_path_`+t,r;try{r=e.get(n)}catch(e){ef(`getPathGenerator - ignoring character: "${e}".`)}let i=new Path2D(r||``);return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[t]=i}},yp={DATA:1,ERROR:2},bp={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function xp(){}function Sp(e){if(e instanceof mf||e instanceof uf||e instanceof df||e instanceof cf||e instanceof ff||e instanceof lf)return e;switch(e instanceof Error||typeof e==`object`&&e||tf(`wrapReason: Expected "reason" to be a (possibly cloned) Error.`),e.name){case`AbortException`:return new mf(e.message);case`InvalidPDFException`:return new uf(e.message);case`MissingPDFException`:return new df(e.message);case`PasswordException`:return new cf(e.message,e.code);case`UnexpectedResponseException`:return new ff(e.message,e.status);case`UnknownErrorException`:return new lf(e.message,e.details)}return new lf(e.message,e.toString())}var Cp=class{#e=new AbortController;constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener(`message`,this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){this.#r(e);return}if(e.callback){let t=e.callbackId,n=this.callbackCapabilities[t];if(!n)throw Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===yp.DATA)n.resolve(e.data);else if(e.callback===yp.ERROR)n.reject(Sp(e.reason));else throw Error(`Unexpected callback case`);return}let t=this.actionHandler[e.action];if(!t)throw Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let n=this.sourceName,r=e.sourceName,i=this.comObj;Promise.try(t,e.data).then(function(t){i.postMessage({sourceName:n,targetName:r,callback:yp.DATA,callbackId:e.callbackId,data:t})},function(t){i.postMessage({sourceName:n,targetName:r,callback:yp.ERROR,callbackId:e.callbackId,reason:Sp(t)})})}else e.streamId?this.#n(e):t(e.data)}on(e,t){let n=this.actionHandler;if(n[e])throw Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){let r=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[r]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},n)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,n,r){let i=this.streamId++,a=this.sourceName,o=this.targetName,s=this.comObj;return new ReadableStream({start:n=>{let c=Promise.withResolvers();return this.streamControllers[i]={controller:n,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},s.postMessage({sourceName:a,targetName:o,action:e,streamId:i,data:t,desiredSize:n.desiredSize},r),c.promise},pull:e=>{let t=Promise.withResolvers();return this.streamControllers[i].pullCall=t,s.postMessage({sourceName:a,targetName:o,stream:bp.PULL,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{nf(e instanceof Error,`cancel must have a valid reason`);let t=Promise.withResolvers();return this.streamControllers[i].cancelCall=t,this.streamControllers[i].isClosed=!0,s.postMessage({sourceName:a,targetName:o,stream:bp.CANCEL,streamId:i,reason:Sp(e)}),t.promise}},n)}#n(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this,o=this.actionHandler[e.action],s={enqueue(e,a=1,o){if(this.isCancelled)return;let s=this.desiredSize;this.desiredSize-=a,s>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),i.postMessage({sourceName:n,targetName:r,stream:bp.ENQUEUE,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:bp.CLOSE,streamId:t}),delete a.streamSinks[t])},error(e){nf(e instanceof Error,`error must have a valid reason`),!this.isCancelled&&(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:bp.ERROR,streamId:t,reason:Sp(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};s.sinkCapability.resolve(),s.ready=s.sinkCapability.promise,this.streamSinks[t]=s,Promise.try(o,e.data,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:bp.START_COMPLETE,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:bp.START_COMPLETE,streamId:t,reason:Sp(e)})})}#r(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case bp.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(Sp(e.reason));break;case bp.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(Sp(e.reason));break;case bp.PULL:if(!o){i.postMessage({sourceName:n,targetName:r,stream:bp.PULL_COMPLETE,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||xp).then(function(){i.postMessage({sourceName:n,targetName:r,stream:bp.PULL_COMPLETE,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:bp.PULL_COMPLETE,streamId:t,reason:Sp(e)})});break;case bp.ENQUEUE:if(nf(a,`enqueue should have stream controller`),a.isClosed)break;a.controller.enqueue(e.chunk);break;case bp.CLOSE:if(nf(a,`close should have stream controller`),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#i(a,t);break;case bp.ERROR:nf(a,`error should have stream controller`),a.controller.error(Sp(e.reason)),this.#i(a,t);break;case bp.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(Sp(e.reason)),this.#i(a,t);break;case bp.CANCEL:if(!o)break;let s=Sp(e.reason);Promise.try(o.onCancel||xp,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:bp.CANCEL_COMPLETE,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:bp.CANCEL_COMPLETE,streamId:t,reason:Sp(e)})}),o.sinkCapability.reject(s),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw Error(`Unexpected stream case`)}}async#i(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#e?.abort(),this.#e=null}},wp=class{#e=!1;constructor({enableHWA:e=!1}){this.#e=e}create(e,t){if(e<=0||t<=0)throw Error(`Invalid canvas size`);let n=this._createCanvas(e,t);return{canvas:n,context:n.getContext(`2d`,{willReadFrequently:!this.#e})}}reset(e,t,n){if(!e.canvas)throw Error(`Canvas is not specified`);if(t<=0||n<=0)throw Error(`Invalid canvas size`);e.canvas.width=t,e.canvas.height=n}destroy(e){if(!e.canvas)throw Error(`Canvas is not specified`);e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){tf("Abstract method `_createCanvas` called.")}},Tp=class extends wp{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){let n=this._document.createElement(`canvas`);return n.width=e,n.height=t,n}},Ep=class{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw Error(`CMap name must be specified.`);let t=this.baseUrl+e+(this.isCompressed?`.bcmap`:``);return this._fetch(t).then(e=>({cMapData:e,isCompressed:this.isCompressed})).catch(e=>{throw Error(`Unable to load ${this.isCompressed?`binary `:``}CMap at: ${t}`)})}async _fetch(e){tf("Abstract method `_fetch` called.")}},Dp=class extends Ep{async _fetch(e){let t=await Mf(e,this.isCompressed?`arraybuffer`:`text`);return t instanceof ArrayBuffer?new Uint8Array(t):gf(t)}},Op=class{addFilter(e){return`none`}addHCMFilter(e,t){return`none`}addAlphaFilter(e){return`none`}addLuminosityFilter(e){return`none`}addHighlightHCMFilter(e,t,n,r,i){return`none`}destroy(e=!1){}},kp=class extends Op{#e;#t;#n;#r;#i;#a;#o=0;constructor({docId:e,ownerDocument:t=globalThis.document}){super(),this.#r=e,this.#i=t}get#s(){return this.#t||=new Map}get#c(){return this.#a||=new Map}get#l(){if(!this.#n){let e=this.#i.createElement(`div`),{style:t}=e;t.visibility=`hidden`,t.contain=`strict`,t.width=t.height=0,t.position=`absolute`,t.top=t.left=0,t.zIndex=-1;let n=this.#i.createElementNS(Af,`svg`);n.setAttribute(`width`,0),n.setAttribute(`height`,0),this.#n=this.#i.createElementNS(Af,`defs`),e.append(n),n.append(this.#n),this.#i.body.append(e)}return this.#n}#u(e){if(e.length===1){let t=e[0],n=Array(256);for(let e=0;e<256;e++)n[e]=t[e]/255;let r=n.join(`,`);return[r,r,r]}let[t,n,r]=e,i=Array(256),a=Array(256),o=Array(256);for(let e=0;e<256;e++)i[e]=t[e]/255,a[e]=n[e]/255,o[e]=r[e]/255;return[i.join(`,`),a.join(`,`),o.join(`,`)]}#d(e){if(this.#e===void 0){this.#e=``;let e=this.#i.URL;e!==this.#i.baseURI&&(Ff(e)?ef(`#createUrl: ignore "data:"-URL for performance reasons.`):this.#e=e.split(`#`,1)[0])}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return`none`;let t=this.#s.get(e);if(t)return t;let[n,r,i]=this.#u(e),a=e.length===1?n:`${n}${r}${i}`;if(t=this.#s.get(a),t)return this.#s.set(e,t),t;let o=`g_${this.#r}_transfer_map_${this.#o++}`,s=this.#d(o);this.#s.set(e,s),this.#s.set(a,s);let c=this.#m(o);return this.#g(n,r,i,c),s}addHCMFilter(e,t){let n=`${e}-${t}`,r=`base`,i=this.#c.get(r);if(i?.key===n||(i?(i.filter?.remove(),i.key=n,i.url=`none`,i.filter=null):(i={key:n,url:`none`,filter:null},this.#c.set(r,i)),!e||!t))return i.url;let a=this.#v(e);e=Q.makeHexColor(...a);let o=this.#v(t);if(t=Q.makeHexColor(...o),this.#l.style.color=``,e===`#000000`&&t===`#ffffff`||e===t)return i.url;let s=Array(256);for(let e=0;e<=255;e++){let t=e/255;s[e]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}let c=s.join(`,`),l=`g_${this.#r}_hcm_filter`,u=i.filter=this.#m(l);this.#g(c,c,c,u),this.#p(u);let d=(e,t)=>{let n=a[e]/255,r=o[e]/255,i=Array(t+1);for(let e=0;e<=t;e++)i[e]=n+e/t*(r-n);return i.join(`,`)};return this.#g(d(0,5),d(1,5),d(2,5),u),i.url=this.#d(l),i.url}addAlphaFilter(e){let t=this.#s.get(e);if(t)return t;let[n]=this.#u([e]),r=`alpha_${n}`;if(t=this.#s.get(r),t)return this.#s.set(e,t),t;let i=`g_${this.#r}_alpha_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(r,a);let o=this.#m(i);return this.#_(n,o),a}addLuminosityFilter(e){let t=this.#s.get(e||`luminosity`);if(t)return t;let n,r;if(e?([n]=this.#u([e]),r=`luminosity_${n}`):r=`luminosity`,t=this.#s.get(r),t)return this.#s.set(e,t),t;let i=`g_${this.#r}_luminosity_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(r,a);let o=this.#m(i);return this.#f(o),e&&this.#_(n,o),a}addHighlightHCMFilter(e,t,n,r,i){let a=`${t}-${n}-${r}-${i}`,o=this.#c.get(e);if(o?.key===a||(o?(o.filter?.remove(),o.key=a,o.url=`none`,o.filter=null):(o={key:a,url:`none`,filter:null},this.#c.set(e,o)),!t||!n))return o.url;let[s,c]=[t,n].map(this.#v.bind(this)),l=Math.round(.2126*s[0]+.7152*s[1]+.0722*s[2]),u=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[d,f]=[r,i].map(this.#v.bind(this));u<l&&([l,u,d,f]=[u,l,f,d]),this.#l.style.color=``;let p=(e,t,n)=>{let r=Array(256),i=(u-l)/n,a=e/255,o=(t-e)/(255*n),s=0;for(let e=0;e<=n;e++){let t=Math.round(l+e*i),n=a+e*o;for(let e=s;e<=t;e++)r[e]=n;s=t+1}for(let e=s;e<256;e++)r[e]=r[s-1];return r.join(`,`)},m=`g_${this.#r}_hcm_${e}_filter`,h=o.filter=this.#m(m);return this.#p(h),this.#g(p(d[0],f[0],5),p(d[1],f[1],5),p(d[2],f[2],5),h),o.url=this.#d(m),o.url}destroy(e=!1){e&&this.#a?.size||(this.#n?.parentNode.parentNode.remove(),this.#n=null,this.#t?.clear(),this.#t=null,this.#a?.clear(),this.#a=null,this.#o=0)}#f(e){let t=this.#i.createElementNS(Af,`feColorMatrix`);t.setAttribute(`type`,`matrix`),t.setAttribute(`values`,`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0`),e.append(t)}#p(e){let t=this.#i.createElementNS(Af,`feColorMatrix`);t.setAttribute(`type`,`matrix`),t.setAttribute(`values`,`0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0`),e.append(t)}#m(e){let t=this.#i.createElementNS(Af,`filter`);return t.setAttribute(`color-interpolation-filters`,`sRGB`),t.setAttribute(`id`,e),this.#l.append(t),t}#h(e,t,n){let r=this.#i.createElementNS(Af,t);r.setAttribute(`type`,`discrete`),r.setAttribute(`tableValues`,n),e.append(r)}#g(e,t,n,r){let i=this.#i.createElementNS(Af,`feComponentTransfer`);r.append(i),this.#h(i,`feFuncR`,e),this.#h(i,`feFuncG`,t),this.#h(i,`feFuncB`,n)}#_(e,t){let n=this.#i.createElementNS(Af,`feComponentTransfer`);t.append(n),this.#h(n,`feFuncA`,e)}#v(e){return this.#l.style.color=e,Gf(getComputedStyle(this.#l).getPropertyValue(`color`))}},Ap=class{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw Error(`Font filename must be specified.`);let t=`${this.baseUrl}${e}`;return this._fetch(t).catch(e=>{throw Error(`Unable to load font data at: ${t}`)})}async _fetch(e){tf("Abstract method `_fetch` called.")}},jp=class extends Ap{async _fetch(e){let t=await Mf(e,`arraybuffer`);return new Uint8Array(t)}};Md&&ef("Please use the `legacy` build in Node.js environments.");async function Mp(e){let t=await process.getBuiltinModule(`fs`).promises.readFile(e);return new Uint8Array(t)}var Np=class extends Op{},Pp=class extends wp{_createCanvas(e,t){return process.getBuiltinModule(`module`).createRequire(import.meta.url)(`@napi-rs/canvas`).createCanvas(e,t)}},Fp=class extends Ep{async _fetch(e){return Mp(e)}},Ip=class extends Ap{async _fetch(e){return Mp(e)}},Lp={FILL:`Fill`,STROKE:`Stroke`,SHADING:`Shading`};function Rp(e,t){if(!t)return;let n=t[2]-t[0],r=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],n,r),e.clip(i)}var zp=class{getPattern(){tf("Abstract method `getPattern` called.")}},Bp=class extends zp{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;this._type===`axial`?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type===`radial`&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(let e of this._colorStops)t.addColorStop(e[0],e[1]);return t}getPattern(e,t,n,r){let i;if(r===Lp.STROKE||r===Lp.FILL){let a=t.current.getClippedPathBoundingBox(r,qf(e))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,s=Math.ceil(a[3]-a[1])||1,c=t.cachedCanvases.getCanvas(`pattern`,o,s),l=c.context;l.clearRect(0,0,l.canvas.width,l.canvas.height),l.beginPath(),l.rect(0,0,l.canvas.width,l.canvas.height),l.translate(-a[0],-a[1]),n=Q.transform(n,[1,0,0,1,a[0],a[1]]),l.transform(...t.baseTransform),this.matrix&&l.transform(...this.matrix),Rp(l,this._bbox),l.fillStyle=this._createGradient(l),l.fill(),i=e.createPattern(c.canvas,`no-repeat`);let u=new DOMMatrix(n);i.setTransform(u)}else Rp(e,this._bbox),i=this._createGradient(e);return i}};function Vp(e,t,n,r,i,a,o,s){let c=t.coords,l=t.colors,u=e.data,d=e.width*4,f;c[n+1]>c[r+1]&&(f=n,n=r,r=f,f=a,a=o,o=f),c[r+1]>c[i+1]&&(f=r,r=i,i=f,f=o,o=s,s=f),c[n+1]>c[r+1]&&(f=n,n=r,r=f,f=a,a=o,o=f);let p=(c[n]+t.offsetX)*t.scaleX,m=(c[n+1]+t.offsetY)*t.scaleY,h=(c[r]+t.offsetX)*t.scaleX,g=(c[r+1]+t.offsetY)*t.scaleY,_=(c[i]+t.offsetX)*t.scaleX,v=(c[i+1]+t.offsetY)*t.scaleY;if(m>=v)return;let y=l[a],b=l[a+1],x=l[a+2],S=l[o],ee=l[o+1],te=l[o+2],ne=l[s],C=l[s+1],re=l[s+2],ie=Math.round(m),ae=Math.round(v),w,oe,se,ce,le,ue,de,fe;for(let e=ie;e<=ae;e++){if(e<g){let t=e<m?0:(m-e)/(m-g);w=p-(p-h)*t,oe=y-(y-S)*t,se=b-(b-ee)*t,ce=x-(x-te)*t}else{let t;t=e>v?1:g===v?0:(g-e)/(g-v),w=h-(h-_)*t,oe=S-(S-ne)*t,se=ee-(ee-C)*t,ce=te-(te-re)*t}let t;t=e<m?0:e>v?1:(m-e)/(m-v),le=p-(p-_)*t,ue=y-(y-ne)*t,de=b-(b-C)*t,fe=x-(x-re)*t;let n=Math.round(Math.min(w,le)),r=Math.round(Math.max(w,le)),i=d*e+n*4;for(let e=n;e<=r;e++)t=(w-e)/(w-le),t<0?t=0:t>1&&(t=1),u[i++]=oe-(oe-ue)*t|0,u[i++]=se-(se-de)*t|0,u[i++]=ce-(ce-fe)*t|0,u[i++]=255}}function Hp(e,t,n){let r=t.coords,i=t.colors,a,o;switch(t.type){case`lattice`:let s=t.verticesPerRow,c=Math.floor(r.length/s)-1,l=s-1;for(a=0;a<c;a++){let t=a*s;for(let a=0;a<l;a++,t++)Vp(e,n,r[t],r[t+1],r[t+s],i[t],i[t+1],i[t+s]),Vp(e,n,r[t+s+1],r[t+1],r[t+s],i[t+s+1],i[t+1],i[t+s])}break;case`triangles`:for(a=0,o=r.length;a<o;a+=3)Vp(e,n,r[a],r[a+1],r[a+2],i[a],i[a+1],i[a+2]);break;default:throw Error(`illegal figure`)}}var Up=class extends zp{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[7],this._background=e[8],this.matrix=null}_createMeshCanvas(e,t,n){let r=1.1,i=3e3,a=Math.floor(this._bounds[0]),o=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-a,c=Math.ceil(this._bounds[3])-o,l=Math.min(Math.ceil(Math.abs(s*e[0]*r)),i),u=Math.min(Math.ceil(Math.abs(c*e[1]*r)),i),d=s/l,f=c/u,p={coords:this._coords,colors:this._colors,offsetX:-a,offsetY:-o,scaleX:1/d,scaleY:1/f},m=l+4,h=u+4,g=n.getCanvas(`mesh`,m,h),_=g.context,v=_.createImageData(l,u);if(t){let e=v.data;for(let n=0,r=e.length;n<r;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2],e[n+3]=255}for(let e of this._figures)Hp(v,e,p);return _.putImageData(v,2,2),{canvas:g.canvas,offsetX:a-2*d,offsetY:o-2*f,scaleX:d,scaleY:f}}getPattern(e,t,n,r){Rp(e,this._bbox);let i;if(r===Lp.SHADING)i=Q.singularValueDecompose2dScale(qf(e));else if(i=Q.singularValueDecompose2dScale(t.baseTransform),this.matrix){let e=Q.singularValueDecompose2dScale(this.matrix);i=[i[0]*e[0],i[1]*e[1]]}let a=this._createMeshCanvas(i,r===Lp.SHADING?null:this._background,t.cachedCanvases);return r!==Lp.SHADING&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY),e.createPattern(a.canvas,`no-repeat`)}},Wp=class extends zp{getPattern(){return`hotpink`}};function Gp(e){switch(e[0]){case`RadialAxial`:return new Bp(e);case`Mesh`:return new Up(e);case`Dummy`:return new Wp}throw Error(`Unknown IR type: ${e[0]}`)}var Kp={COLORED:1,UNCOLORED:2},qp=class e{static MAX_PATTERN_SIZE=3e3;constructor(e,t,n,r,i){this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=t,this.ctx=n,this.canvasGraphicsFactory=r,this.baseTransform=i}createPatternCanvas(e){let{bbox:t,operatorList:n,paintType:r,tilingType:i,color:a,canvasGraphicsFactory:o}=this,{xstep:s,ystep:c}=this;s=Math.abs(s),c=Math.abs(c),$d(`TilingType: `+i);let l=t[0],u=t[1],d=t[2],f=t[3],p=d-l,m=f-u,h=Q.singularValueDecompose2dScale(this.matrix),g=Q.singularValueDecompose2dScale(this.baseTransform),_=h[0]*g[0],v=h[1]*g[1],y=p,b=m,x=!1,S=!1,ee=Math.ceil(s*_),te=Math.ceil(c*v),ne=Math.ceil(p*_),C=Math.ceil(m*v);ee>=ne?y=s:x=!0,te>=C?b=c:S=!0;let re=this.getSizeAndScale(y,this.ctx.canvas.width,_),ie=this.getSizeAndScale(b,this.ctx.canvas.height,v),ae=e.cachedCanvases.getCanvas(`pattern`,re.size,ie.size),w=ae.context,oe=o.createCanvasGraphics(w);if(oe.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(oe,r,a),w.translate(-re.scale*l,-ie.scale*u),oe.transform(re.scale,0,0,ie.scale,0,0),w.save(),this.clipBbox(oe,l,u,d,f),oe.baseTransform=qf(oe.ctx),oe.executeOperatorList(n),oe.endDrawing(),w.restore(),x||S){let t=ae.canvas;x&&(y=s),S&&(b=c);let n=this.getSizeAndScale(y,this.ctx.canvas.width,_),r=this.getSizeAndScale(b,this.ctx.canvas.height,v),i=n.size,a=r.size,o=e.cachedCanvases.getCanvas(`pattern-workaround`,i,a),d=o.context,f=x?Math.floor(p/s):0,h=S?Math.floor(m/c):0;for(let e=0;e<=f;e++)for(let n=0;n<=h;n++)d.drawImage(t,i*e,a*n,i,a,0,0,i,a);return{canvas:o.canvas,scaleX:n.scale,scaleY:r.scale,offsetX:l,offsetY:u}}return{canvas:ae.canvas,scaleX:re.scale,scaleY:ie.scale,offsetX:l,offsetY:u}}getSizeAndScale(t,n,r){let i=Math.max(e.MAX_PATTERN_SIZE,n),a=Math.ceil(t*r);return a>=i?a=i:r=a/t,{scale:r,size:a}}clipBbox(e,t,n,r,i){let a=r-t,o=i-n;e.ctx.rect(t,n,a,o),e.current.updateRectMinMax(qf(e.ctx),[t,n,r,i]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){let r=e.ctx,i=e.current;switch(t){case Kp.COLORED:let e=this.ctx;r.fillStyle=e.fillStyle,r.strokeStyle=e.strokeStyle,i.fillColor=e.fillStyle,i.strokeColor=e.strokeStyle;break;case Kp.UNCOLORED:let a=Q.makeHexColor(n[0],n[1],n[2]);r.fillStyle=a,r.strokeStyle=a,i.fillColor=a,i.strokeColor=a;break;default:throw new pf(`Unsupported paint type: ${t}`)}}getPattern(e,t,n,r){let i=n;r!==Lp.SHADING&&(i=Q.transform(i,t.baseTransform),this.matrix&&(i=Q.transform(i,this.matrix)));let a=this.createPatternCanvas(t),o=new DOMMatrix(i);o=o.translate(a.offsetX,a.offsetY),o=o.scale(1/a.scaleX,1/a.scaleY);let s=e.createPattern(a.canvas,`repeat`);return s.setTransform(o),s}};function Jp({src:e,srcPos:t=0,dest:n,width:r,height:i,nonBlackColor:a=4294967295,inverseDecode:o=!1}){let s=xf.isLittleEndian?4278190080:255,[c,l]=o?[a,s]:[s,a],u=r>>3,d=r&7,f=e.length;n=new Uint32Array(n.buffer);let p=0;for(let r=0;r<i;r++){for(let r=t+u;t<r;t++){let r=t<f?e[t]:255;n[p++]=r&128?l:c,n[p++]=r&64?l:c,n[p++]=r&32?l:c,n[p++]=r&16?l:c,n[p++]=r&8?l:c,n[p++]=r&4?l:c,n[p++]=r&2?l:c,n[p++]=r&1?l:c}if(d===0)continue;let r=t<f?e[t++]:255;for(let e=0;e<d;e++)n[p++]=r&1<<7-e?l:c}return{srcPos:t,destPos:p}}var Yp=16,Xp=100,Zp=15,Qp=10,$p=1e3,em=16;function tm(e,t){if(e._removeMirroring)throw Error(`Context is already forwarding operations.`);e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,n){t.translate(e,n),this.__originalTranslate(e,n)},e.scale=function(e,n){t.scale(e,n),this.__originalScale(e,n)},e.transform=function(e,n,r,i,a,o){t.transform(e,n,r,i,a,o),this.__originalTransform(e,n,r,i,a,o)},e.setTransform=function(e,n,r,i,a,o){t.setTransform(e,n,r,i,a,o),this.__originalSetTransform(e,n,r,i,a,o)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,n){t.moveTo(e,n),this.__originalMoveTo(e,n)},e.lineTo=function(e,n){t.lineTo(e,n),this.__originalLineTo(e,n)},e.bezierCurveTo=function(e,n,r,i,a,o){t.bezierCurveTo(e,n,r,i,a,o),this.__originalBezierCurveTo(e,n,r,i,a,o)},e.rect=function(e,n,r,i){t.rect(e,n,r,i),this.__originalRect(e,n,r,i)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}var nm=class{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n){let r;return this.cache[e]===void 0?(r=this.canvasFactory.create(t,n),this.cache[e]=r):(r=this.cache[e],this.canvasFactory.reset(r,t,n)),r}delete(e){delete this.cache[e]}clear(){for(let e in this.cache){let t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}};function rm(e,t,n,r,i,a,o,s,c,l){let[u,d,f,p,m,h]=qf(e);if(d===0&&f===0){let g=o*u+m,_=Math.round(g),v=s*p+h,y=Math.round(v),b=(o+c)*u+m,x=Math.abs(Math.round(b)-_)||1,S=(s+l)*p+h,ee=Math.abs(Math.round(S)-y)||1;return e.setTransform(Math.sign(u),0,0,Math.sign(p),_,y),e.drawImage(t,n,r,i,a,0,0,x,ee),e.setTransform(u,d,f,p,m,h),[x,ee]}if(u===0&&p===0){let g=s*f+m,_=Math.round(g),v=o*d+h,y=Math.round(v),b=(s+l)*f+m,x=Math.abs(Math.round(b)-_)||1,S=(o+c)*d+h,ee=Math.abs(Math.round(S)-y)||1;return e.setTransform(0,Math.sign(d),Math.sign(f),0,_,y),e.drawImage(t,n,r,i,a,0,0,ee,x),e.setTransform(u,d,f,p,m,h),[ee,x]}e.drawImage(t,n,r,i,a,o,s,c,l);let g=Math.hypot(u,d),_=Math.hypot(f,p);return[g*c,_*l]}function im(e){let{width:t,height:n}=e;if(t>$p||n>$p)return null;let r=1e3,i=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),a=t+1,o=new Uint8Array(a*(n+1)),s,c,l,u=t+7&-8,d=new Uint8Array(u*n),f=0;for(let t of e.data){let e=128;for(;e>0;)d[f++]=t&e?0:255,e>>=1}let p=0;for(f=0,d[f]!==0&&(o[0]=1,++p),c=1;c<t;c++)d[f]!==d[f+1]&&(o[c]=d[f]?2:1,++p),f++;for(d[f]!==0&&(o[c]=2,++p),s=1;s<n;s++){f=s*u,l=s*a,d[f-u]!==d[f]&&(o[l]=d[f]?1:8,++p);let e=(d[f]?4:0)+(d[f-u]?8:0);for(c=1;c<t;c++)e=(e>>2)+(d[f+1]?4:0)+(d[f-u+1]?8:0),i[e]&&(o[l+c]=i[e],++p),f++;if(d[f-u]!==d[f]&&(o[l+c]=d[f]?2:4,++p),p>r)return null}for(f=u*(n-1),l=s*a,d[f]!==0&&(o[l]=8,++p),c=1;c<t;c++)d[f]!==d[f+1]&&(o[l+c]=d[f]?4:8,++p),f++;if(d[f]!==0&&(o[l+c]=4,++p),p>r)return null;let m=new Int32Array([0,a,-1,0,-a,0,0,0,1]),h=new Path2D;for(s=0;p&&s<=n;s++){let e=s*a,n=e+t;for(;e<n&&!o[e];)e++;if(e===n)continue;h.moveTo(e%a,s);let r=e,i=o[e];do{let t=m[i];do e+=t;while(!o[e]);let n=o[e];n!==5&&n!==10?(i=n,o[e]=0):(i=n&51*i>>4,o[e]&=i>>2|i<<2),h.lineTo(e%a,e/a|0),o[e]||--p}while(r!==e);--s}return d=null,o=null,function(e){e.save(),e.scale(1/t,-1/n),e.translate(0,-n),e.fill(h),e.beginPath(),e.restore()}}var am=class{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=Nd,this.textMatrixScale=1,this.fontMatrix=Pd,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=Ud.FILL,this.textRise=0,this.fillColor=`#000000`,this.strokeColor=`#000000`,this.patternFill=!1,this.patternStroke=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps=`none`,this.startNewPathAndClipBox([0,0,e,t])}clone(){let e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,n){[t,n]=Q.applyTransform([t,n],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(e,t){let n=Q.applyTransform(t,e),r=Q.applyTransform(t.slice(2),e),i=Q.applyTransform([t[0],t[3]],e),a=Q.applyTransform([t[2],t[1]],e);this.minX=Math.min(this.minX,n[0],r[0],i[0],a[0]),this.minY=Math.min(this.minY,n[1],r[1],i[1],a[1]),this.maxX=Math.max(this.maxX,n[0],r[0],i[0],a[0]),this.maxY=Math.max(this.maxY,n[1],r[1],i[1],a[1])}updateScalingPathMinMax(e,t){Q.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.minY=Math.min(this.minY,t[1]),this.maxX=Math.max(this.maxX,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,n,r,i,a,o,s,c,l){let u=Q.bezierBoundingBox(t,n,r,i,a,o,s,c,l);l||this.updateRectMinMax(e,u)}getPathBoundingBox(e=Lp.FILL,t=null){let n=[this.minX,this.minY,this.maxX,this.maxY];if(e===Lp.STROKE){t||tf(`Stroke bounding box must include transform.`);let e=Q.singularValueDecompose2dScale(t),r=e[0]*this.lineWidth/2,i=e[1]*this.lineWidth/2;n[0]-=r,n[1]-=i,n[2]+=r,n[3]+=i}return n}updateClipFromPath(){let e=Q.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=Lp.FILL,t=null){return Q.intersect(this.clipBox,this.getPathBoundingBox(e,t))}};function om(e,t){if(t instanceof ImageData){e.putImageData(t,0,0);return}let n=t.height,r=t.width,i=n%em,a=(n-i)/em,o=i===0?a:a+1,s=e.createImageData(r,em),c=0,l,u=t.data,d=s.data,f,p,m,h;if(t.kind===Wd.GRAYSCALE_1BPP){let t=u.byteLength,n=new Uint32Array(d.buffer,0,d.byteLength>>2),h=n.length,g=r+7>>3,_=4294967295,v=xf.isLittleEndian?4278190080:255;for(f=0;f<o;f++){for(m=f<a?em:i,l=0,p=0;p<m;p++){let e=t-c,i=0,a=e>g?r:e*8-7,o=a&-8,s=0,d=0;for(;i<o;i+=8)d=u[c++],n[l++]=d&128?_:v,n[l++]=d&64?_:v,n[l++]=d&32?_:v,n[l++]=d&16?_:v,n[l++]=d&8?_:v,n[l++]=d&4?_:v,n[l++]=d&2?_:v,n[l++]=d&1?_:v;for(;i<a;i++)s===0&&(d=u[c++],s=128),n[l++]=d&s?_:v,s>>=1}for(;l<h;)n[l++]=0;e.putImageData(s,0,f*em)}}else if(t.kind===Wd.RGBA_32BPP){for(p=0,h=r*em*4,f=0;f<a;f++)d.set(u.subarray(c,c+h)),c+=h,e.putImageData(s,0,p),p+=em;f<o&&(h=r*i*4,d.set(u.subarray(c,c+h)),e.putImageData(s,0,p))}else if(t.kind===Wd.RGB_24BPP)for(m=em,h=r*m,f=0;f<o;f++){for(f>=a&&(m=i,h=r*m),l=0,p=h;p--;)d[l++]=u[c++],d[l++]=u[c++],d[l++]=u[c++],d[l++]=255;e.putImageData(s,0,f*em)}else throw Error(`bad image kind: ${t.kind}`)}function sm(e,t){if(t.bitmap){e.drawImage(t.bitmap,0,0);return}let n=t.height,r=t.width,i=n%em,a=(n-i)/em,o=i===0?a:a+1,s=e.createImageData(r,em),c=0,l=t.data,u=s.data;for(let t=0;t<o;t++){let n=t<a?em:i;({srcPos:c}=Jp({src:l,srcPos:c,dest:u,width:r,height:n,nonBlackColor:0})),e.putImageData(s,0,t*em)}}function cm(e,t){for(let n of[`strokeStyle`,`fillStyle`,`fillRule`,`globalAlpha`,`lineWidth`,`lineCap`,`lineJoin`,`miterLimit`,`globalCompositeOperation`,`font`,`filter`])e[n]!==void 0&&(t[n]=e[n]);e.setLineDash!==void 0&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function lm(e){if(e.strokeStyle=e.fillStyle=`#000000`,e.fillRule=`nonzero`,e.globalAlpha=1,e.lineWidth=1,e.lineCap=`butt`,e.lineJoin=`miter`,e.miterLimit=10,e.globalCompositeOperation=`source-over`,e.font=`10px sans-serif`,e.setLineDash!==void 0&&(e.setLineDash([]),e.lineDashOffset=0),!Md){let{filter:t}=e;t!==`none`&&t!==``&&(e.filter=`none`)}}function um(e,t){if(t)return!0;let n=Q.singularValueDecompose2dScale(e);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);let r=Math.fround((globalThis.devicePixelRatio||1)*jf.PDF_TO_CSS_UNITS);return n[0]<=r&&n[1]<=r}var dm=[`butt`,`round`,`square`],fm=[`miter`,`round`,`bevel`],pm={},mm={},hm=class e{constructor(e,t,n,r,i,{optionalContentConfig:a,markedContentStack:o=null},s,c){this.ctx=e,this.current=new am(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=n,this.canvasFactory=r,this.filterFactory=i,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=a,this.cachedCanvases=new nm(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=s,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,t=null){return typeof e==`string`?e.startsWith(`g_`)?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:r=null}){let i=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=r||`#ffffff`,this.ctx.fillRect(0,0,i,a),this.ctx.fillStyle=o,n){let e=this.cachedCanvases.getCanvas(`transparent`,i,a);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...qf(this.compositeCtx))}this.ctx.save(),lm(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=qf(this.ctx)}executeOperatorList(e,t,n,r){let i=e.argsArray,a=e.fnArray,o=t||0,s=i.length;if(s===o)return o;let c=s-o>Qp&&typeof n==`function`,l=c?Date.now()+Zp:0,u=0,d=this.commonObjs,f=this.objs,p;for(;;){if(r!==void 0&&o===r.nextBreakPoint)return r.breakIt(o,n),o;if(p=a[o],p!==Jd.dependency)this[p].apply(this,i[o]);else for(let e of i[o]){let t=e.startsWith(`g_`)?d:f;if(!t.has(e))return t.get(e,n),o}if(o++,o===s)return o;if(c&&++u>Qp){if(Date.now()>l)return n(),o;u=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&=(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(let e of this._cachedBitmapsMap.values()){for(let t of e.values())typeof HTMLCanvasElement<`u`&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){let e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!==`none`){let t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){let n=e.width??e.displayWidth,r=e.height??e.displayHeight,i=Math.max(Math.hypot(t[0],t[1]),1),a=Math.max(Math.hypot(t[2],t[3]),1),o=n,s=r,c=`prescale1`,l,u;for(;i>2&&o>1||a>2&&s>1;){let t=o,n=s;i>2&&o>1&&(t=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),i/=o/t),a>2&&s>1&&(n=s>=16384?Math.floor(s/2)-1||1:Math.ceil(s)/2,a/=s/n),l=this.cachedCanvases.getCanvas(c,t,n),u=l.context,u.clearRect(0,0,t,n),u.drawImage(e,0,0,o,s,0,0,t,n),e=l.canvas,o=t,s=n,c=c===`prescale1`?`prescale2`:`prescale1`}return{img:e,paintWidth:o,paintHeight:s}}_createMaskCanvas(e){let t=this.ctx,{width:n,height:r}=e,i=this.current.fillColor,a=this.current.patternFill,o=qf(t),s,c,l,u;if((e.bitmap||e.data)&&e.count>1){let t=e.bitmap||e.data.buffer;c=JSON.stringify(a?o:[o.slice(0,4),i]),s=this._cachedBitmapsMap.get(t),s||(s=new Map,this._cachedBitmapsMap.set(t,s));let n=s.get(c);if(n&&!a)return{canvas:n,offsetX:Math.round(Math.min(o[0],o[2])+o[4]),offsetY:Math.round(Math.min(o[1],o[3])+o[5])};l=n}l||(u=this.cachedCanvases.getCanvas(`maskCanvas`,n,r),sm(u.context,e));let d=Q.transform(o,[1/n,0,0,-1/r,0,0]);d=Q.transform(d,[1,0,0,1,0,-r]);let[f,p,m,h]=Q.getAxialAlignedBoundingBox([0,0,n,r],d),g=Math.round(m-f)||1,_=Math.round(h-p)||1,v=this.cachedCanvases.getCanvas(`fillCanvas`,g,_),y=v.context,b=f,x=p;y.translate(-b,-x),y.transform(...d),l||(l=this._scaleImage(u.canvas,Jf(y)),l=l.img,s&&a&&s.set(c,l)),y.imageSmoothingEnabled=um(qf(y),e.interpolate),rm(y,l,0,0,l.width,l.height,0,0,n,r),y.globalCompositeOperation=`source-in`;let S=Q.transform(Jf(y),[1,0,0,1,-b,-x]);return y.fillStyle=a?i.getPattern(t,this,S,Lp.FILL):i,y.fillRect(0,0,n,r),s&&!a&&(this.cachedCanvases.delete(`fillCanvas`),s.set(c,v.canvas)),{canvas:v.canvas,offsetX:Math.round(b),offsetY:Math.round(x)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=dm[e]}setLineJoin(e){this.ctx.lineJoin=fm[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){let n=this.ctx;n.setLineDash!==void 0&&(n.setLineDash(e),n.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(let[t,n]of e)switch(t){case`LW`:this.setLineWidth(n);break;case`LC`:this.setLineCap(n);break;case`LJ`:this.setLineJoin(n);break;case`ML`:this.setMiterLimit(n);break;case`D`:this.setDash(n[0],n[1]);break;case`RI`:this.setRenderingIntent(n);break;case`FL`:this.setFlatness(n);break;case`Font`:this.setFont(n[0],n[1]);break;case`CA`:this.current.strokeAlpha=n;break;case`ca`:this.current.fillAlpha=n,this.ctx.globalAlpha=n;break;case`BM`:this.ctx.globalCompositeOperation=n;break;case`SMask`:this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case`TR`:this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw Error(`beginSMaskMode called while already in smask mode`);let e=this.ctx.canvas.width,t=this.ctx.canvas.height,n=`smaskGroupAt`+this.groupLevel,r=this.cachedCanvases.getCanvas(n,e,t);this.suspendedCtx=this.ctx,this.ctx=r.context;let i=this.ctx;i.setTransform(...qf(this.suspendedCtx)),cm(this.suspendedCtx,i),tm(i,this.suspendedCtx),this.setGState([[`BM`,`source-over`],[`ca`,1],[`CA`,1]])}endSMaskMode(){if(!this.inSMaskMode)throw Error(`endSMaskMode called while not in smask mode`);this.ctx._removeMirroring(),cm(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let t=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,t,n,r){let i=r[0],a=r[1],o=r[2]-i,s=r[3]-a;o!==0&&s!==0&&(this.genericComposeSMask(t.context,n,o,s,t.subtype,t.backdrop,t.transferMap,i,a,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation=`source-over`,e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,0,0),e.restore())}genericComposeSMask(e,t,n,r,i,a,o,s,c,l,u){let d=e.canvas,f=s-l,p=c-u;if(a){let t=Q.makeHexColor(...a);if(f<0||p<0||f+n>d.width||p+r>d.height){let e=this.cachedCanvases.getCanvas(`maskExtension`,n,r),i=e.context;i.drawImage(d,-f,-p),i.globalCompositeOperation=`destination-atop`,i.fillStyle=t,i.fillRect(0,0,n,r),i.globalCompositeOperation=`source-over`,d=e.canvas,f=p=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);let i=new Path2D;i.rect(f,p,n,r),e.clip(i),e.globalCompositeOperation=`destination-atop`,e.fillStyle=t,e.fillRect(f,p,n,r),e.restore()}}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),i===`Alpha`&&o?t.filter=this.filterFactory.addAlphaFilter(o):i===`Luminosity`&&(t.filter=this.filterFactory.addLuminosityFilter(o));let m=new Path2D;m.rect(s,c,n,r),t.clip(m),t.globalCompositeOperation=`destination-in`,t.drawImage(d,f,p,n,r,s,c,n,r),t.restore()}save(){this.inSMaskMode?(cm(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();let e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),cm(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,t,n,r,i,a){this.ctx.transform(e,t,n,r,i,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n){let r=this.ctx,i=this.current,a=i.x,o=i.y,s,c,l=qf(r),u=l[0]===0&&l[3]===0||l[1]===0&&l[2]===0,d=u?n.slice(0):null;for(let n=0,f=0,p=e.length;n<p;n++)switch(e[n]|0){case Jd.rectangle:a=t[f++],o=t[f++];let e=t[f++],n=t[f++],p=a+e,m=o+n;r.moveTo(a,o),e===0||n===0?r.lineTo(p,m):(r.lineTo(p,o),r.lineTo(p,m),r.lineTo(a,m)),u||i.updateRectMinMax(l,[a,o,p,m]),r.closePath();break;case Jd.moveTo:a=t[f++],o=t[f++],r.moveTo(a,o),u||i.updatePathMinMax(l,a,o);break;case Jd.lineTo:a=t[f++],o=t[f++],r.lineTo(a,o),u||i.updatePathMinMax(l,a,o);break;case Jd.curveTo:s=a,c=o,a=t[f+4],o=t[f+5],r.bezierCurveTo(t[f],t[f+1],t[f+2],t[f+3],a,o),i.updateCurvePathMinMax(l,s,c,t[f],t[f+1],t[f+2],t[f+3],a,o,d),f+=6;break;case Jd.curveTo2:s=a,c=o,r.bezierCurveTo(a,o,t[f],t[f+1],t[f+2],t[f+3]),i.updateCurvePathMinMax(l,s,c,a,o,t[f],t[f+1],t[f+2],t[f+3],d),a=t[f+2],o=t[f+3],f+=4;break;case Jd.curveTo3:s=a,c=o,a=t[f+2],o=t[f+3],r.bezierCurveTo(t[f],t[f+1],a,o,a,o),i.updateCurvePathMinMax(l,s,c,t[f],t[f+1],a,o,a,o,d),f+=4;break;case Jd.closePath:r.closePath()}u&&i.updateScalingPathMinMax(l,d),i.setCurrentPoint(a,o)}closePath(){this.ctx.closePath()}stroke(e=!0){let t=this.ctx,n=this.current.strokeColor;t.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof n==`object`&&n?.getPattern?(t.save(),t.strokeStyle=n.getPattern(t,this,Jf(t),Lp.STROKE),this.rescaleAndStroke(!1),t.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),t.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(e=!0){let t=this.ctx,n=this.current.fillColor,r=this.current.patternFill,i=!1;r&&(t.save(),t.fillStyle=n.getPattern(t,this,Jf(t),Lp.FILL),i=!0);let a=this.current.getClippedPathBoundingBox();this.contentVisible&&a!==null&&(this.pendingEOFill?(t.fill(`evenodd`),this.pendingEOFill=!1):t.fill()),i&&t.restore(),e&&this.consumePath(a)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=pm}eoClip(){this.pendingClip=mm}beginText(){this.current.textMatrix=Nd,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){let e=this.pendingTextPaths,t=this.ctx;if(e===void 0){t.beginPath();return}let n=new Path2D,r=t.getTransform().invertSelf();for(let{transform:t,x:i,y:a,fontSize:o,path:s}of e)n.addPath(s,new DOMMatrix(t).preMultiplySelf(r).translate(i,a).scale(o,-o));t.clip(n),t.beginPath(),delete this.pendingTextPaths}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,t){let n=this.commonObjs.get(e),r=this.current;if(!n)throw Error(`Can't find font for ${e}`);if(r.fontMatrix=n.fontMatrix||Pd,(r.fontMatrix[0]===0||r.fontMatrix[3]===0)&&ef(`Invalid font matrix for font `+e),t<0?(t=-t,r.fontDirection=-1):r.fontDirection=1,this.current.font=n,this.current.fontSize=t,n.isType3Font)return;let i=n.loadedName||`sans-serif`,a=n.systemFontInfo?.css||`"${i}", ${n.fallbackName}`,o=`normal`;n.black?o=`900`:n.bold&&(o=`bold`);let s=n.italic?`italic`:`normal`,c=t;t<Yp?c=Yp:t>Xp&&(c=Xp),this.current.fontSizeScale=t/c,this.ctx.font=`${s} ${o} ${c}px ${a}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,n,r,i,a){this.current.textMatrix=[e,t,n,r,i,a],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}#n(e,t,n){let r=new Path2D;return r.addPath(e,new DOMMatrix(n).invertSelf().multiplySelf(t)),r}paintChar(e,t,n,r,i){let a=this.ctx,o=this.current,s=o.font,c=o.textRenderingMode,l=o.fontSize/o.fontSizeScale,u=c&Ud.FILL_STROKE_MASK,d=!!(c&Ud.ADD_TO_PATH_FLAG),f=o.patternFill&&!s.missingFile,p=o.patternStroke&&!s.missingFile,m;if((s.disableFontFace||d||f||p)&&(m=s.getPathGenerator(this.commonObjs,e)),s.disableFontFace||f||p){if(a.save(),a.translate(t,n),a.scale(l,-l),u===Ud.FILL||u===Ud.FILL_STROKE){if(r){let e=a.getTransform();a.setTransform(...r),a.fill(this.#n(m,e,r))}else a.fill(m)}if(u===Ud.STROKE||u===Ud.FILL_STROKE){if(i){let e=a.getTransform();a.setTransform(...i),a.stroke(this.#n(m,e,i))}else a.lineWidth/=l,a.stroke(m)}a.restore()}else(u===Ud.FILL||u===Ud.FILL_STROKE)&&a.fillText(e,t,n),(u===Ud.STROKE||u===Ud.FILL_STROKE)&&a.strokeText(e,t,n);d&&(this.pendingTextPaths||=[]).push({transform:qf(a),x:t,y:n,fontSize:l,path:m})}get isFontSubpixelAAEnabled(){let{context:e}=this.cachedCanvases.getCanvas(`isFontSubpixelAAEnabled`,10,10);e.scale(1.5,1),e.fillText(`I`,0,10);let t=e.getImageData(0,0,10,10).data,n=!1;for(let e=3;e<t.length;e+=4)if(t[e]>0&&t[e]<255){n=!0;break}return of(this,`isFontSubpixelAAEnabled`,n)}showText(e){let t=this.current,n=t.font;if(n.isType3Font)return this.showType3Text(e);let r=t.fontSize;if(r===0)return;let i=this.ctx,a=t.fontSizeScale,o=t.charSpacing,s=t.wordSpacing,c=t.fontDirection,l=t.textHScale*c,u=e.length,d=n.vertical,f=d?1:-1,p=n.defaultVMetrics,m=r*t.fontMatrix[0],h=t.textRenderingMode===Ud.FILL&&!n.disableFontFace&&!t.patternFill;i.save(),i.transform(...t.textMatrix),i.translate(t.x,t.y+t.textRise),c>0?i.scale(l,-1):i.scale(l,1);let g,_;if(t.patternFill){i.save();let e=t.fillColor.getPattern(i,this,Jf(i),Lp.FILL);g=qf(i),i.restore(),i.fillStyle=e}if(t.patternStroke){i.save();let e=t.strokeColor.getPattern(i,this,Jf(i),Lp.STROKE);_=qf(i),i.restore(),i.strokeStyle=e}let v=t.lineWidth,y=t.textMatrixScale;if(y===0||v===0){let e=t.textRenderingMode&Ud.FILL_STROKE_MASK;(e===Ud.STROKE||e===Ud.FILL_STROKE)&&(v=this.getSinglePixelWidth())}else v/=y;if(a!==1&&(i.scale(a,a),v/=a),i.lineWidth=v,n.isInvalidPDFjsFont){let n=[],r=0;for(let t of e)n.push(t.unicode),r+=t.width;i.fillText(n.join(``),0,0),t.x+=r*m*l,i.restore(),this.compose();return}let b=0,x=0;for(;x<u;++x){let t=e[x];if(typeof t==`number`){b+=f*t*r/1e3;continue}let l=!1,u=(t.isSpace?s:0)+o,v=t.fontChar,y=t.accent,S,ee,te=t.width;if(d){let e=t.vmetric||p,n=-(t.vmetric?e[1]:te*.5)*m,r=e[2]*m;te=e?-e[0]:te,S=n/a,ee=(b+r)/a}else S=b/a,ee=0;if(n.remeasure&&te>0){let e=i.measureText(v).width*1e3/r*a;if(te<e&&this.isFontSubpixelAAEnabled){let t=te/e;l=!0,i.save(),i.scale(t,1),S/=t}else te!==e&&(S+=(te-e)/2e3*r/a)}if(this.contentVisible&&(t.isInFont||n.missingFile)){if(h&&!y)i.fillText(v,S,ee);else if(this.paintChar(v,S,ee,g,_),y){let e=S+r*y.offset.x/a,t=ee-r*y.offset.y/a;this.paintChar(y.fontChar,e,t,g,_)}}let ne=d?te*m-u*c:te*m+u*c;b+=ne,l&&i.restore()}d?t.y-=b:t.x+=b*l,i.restore(),this.compose()}showType3Text(e){let t=this.ctx,n=this.current,r=n.font,i=n.fontSize,a=n.fontDirection,o=r.vertical?1:-1,s=n.charSpacing,c=n.wordSpacing,l=n.textHScale*a,u=n.fontMatrix||Pd,d=e.length,f=n.textRenderingMode===Ud.INVISIBLE,p,m,h,g;if(!(f||i===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,t.save(),t.transform(...n.textMatrix),t.translate(n.x,n.y),t.scale(l,a),p=0;p<d;++p){if(m=e[p],typeof m==`number`){g=o*m*i/1e3,this.ctx.translate(g,0),n.x+=g*l;continue}let a=(m.isSpace?c:0)+s,d=r.charProcOperatorList[m.operatorListId];d?(this.contentVisible&&(this.processingType3=m,this.save(),t.scale(i,i),t.transform(...u),this.executeOperatorList(d),this.restore()),h=Q.applyTransform([m.width,0],u)[0]*i+a,t.translate(h,0),n.x+=h*l):ef(`Type3 character "${m.operatorListId}" is not available.`)}t.restore(),this.processingType3=null}}setCharWidth(e,t){}setCharWidthAndBounds(e,t,n,r,i,a){this.ctx.rect(n,r,i-n,a-r),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let n;if(t[0]===`TilingPattern`){let r=t[1],i=this.baseTransform||qf(this.ctx);n=new qp(t,r,this.ctx,{createCanvasGraphics:t=>new e(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})},i)}else n=this._getPattern(t[1],t[2]);return n}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,n){this.ctx.strokeStyle=this.current.strokeColor=Q.makeHexColor(e,t,n),this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor=`transparent`,this.current.patternStroke=!1}setFillRGBColor(e,t,n){this.ctx.fillStyle=this.current.fillColor=Q.makeHexColor(e,t,n),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor=`transparent`,this.current.patternFill=!1}_getPattern(e,t=null){let n;return this.cachedPatterns.has(e)?n=this.cachedPatterns.get(e):(n=Gp(this.getObject(e)),this.cachedPatterns.set(e,n)),t&&(n.matrix=t),n}shadingFill(e){if(!this.contentVisible)return;let t=this.ctx;this.save(),t.fillStyle=this._getPattern(e).getPattern(t,this,Jf(t),Lp.SHADING);let n=Jf(t);if(n){let{width:e,height:r}=t.canvas,[i,a,o,s]=Q.getAxialAlignedBoundingBox([0,0,e,r],n);this.ctx.fillRect(i,a,o-i,s-a)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){tf(`Should not call beginInlineImage`)}beginImageData(){tf(`Should not call beginImageData`)}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=qf(this.ctx),t)){let e=t[2]-t[0],n=t[3]-t[1];this.ctx.rect(t[0],t[1],e,n),this.current.updateRectMinMax(qf(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let t=this.ctx;e.isolated||$d(`TODO: Support non-isolated groups.`),e.knockout&&ef(`Knockout groups not supported.`);let n=qf(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw Error(`Bounding box is required.`);let r=Q.getAxialAlignedBoundingBox(e.bbox,qf(t)),i=[0,0,t.canvas.width,t.canvas.height];r=Q.intersect(r,i)||[0,0,0,0];let a=Math.floor(r[0]),o=Math.floor(r[1]),s=Math.max(Math.ceil(r[2])-a,1),c=Math.max(Math.ceil(r[3])-o,1);this.current.startNewPathAndClipBox([0,0,s,c]);let l=`groupAt`+this.groupLevel;e.smask&&(l+=`_smask_`+this.smaskCounter++%2);let u=this.cachedCanvases.getCanvas(l,s,c),d=u.context;d.translate(-a,-o),d.transform(...n),e.smask?this.smaskStack.push({canvas:u.canvas,context:d,offsetX:a,offsetY:o,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(a,o),t.save()),cm(t,d),this.ctx=d,this.setGState([[`BM`,`source-over`],[`ca`,1],[`CA`,1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;let t=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();let e=qf(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...e);let n=Q.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],e);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(e,t,n,r,i){if(this.#e(),lm(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),t){let r=t[2]-t[0],a=t[3]-t[1];if(i&&this.annotationCanvasMap){n=n.slice(),n[4]-=t[0],n[5]-=t[1],t=t.slice(),t[0]=t[1]=0,t[2]=r,t[3]=a;let[i,o]=Q.singularValueDecompose2dScale(qf(this.ctx)),{viewportScale:s}=this,c=Math.ceil(r*this.outputScaleX*s),l=Math.ceil(a*this.outputScaleY*s);this.annotationCanvas=this.canvasFactory.create(c,l);let{canvas:u,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(e,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(i,0,0,-o,0,a*o),lm(this.ctx)}else lm(this.ctx),this.endPath(),this.ctx.rect(t[0],t[1],r,a),this.ctx.clip(),this.ctx.beginPath()}this.current=new am(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...r)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;let t=e.count;e=this.getObject(e.data,e),e.count=t;let n=this.ctx,r=this.processingType3;if(r&&(r.compiled===void 0&&(r.compiled=im(e)),r.compiled)){r.compiled(n);return}let i=this._createMaskCanvas(e),a=i.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(a,i.offsetX,i.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,n=0,r=0,i,a){if(!this.contentVisible)return;e=this.getObject(e.data,e);let o=this.ctx;o.save();let s=qf(o);o.transform(t,n,r,i,0,0);let c=this._createMaskCanvas(e);o.setTransform(1,0,0,1,c.offsetX-s[4],c.offsetY-s[5]);for(let e=0,l=a.length;e<l;e+=2){let l=Q.transform(s,[t,n,r,i,a[e],a[e+1]]),[u,d]=Q.applyTransform([0,0],l);o.drawImage(c.canvas,u,d)}o.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;let t=this.ctx,n=this.current.fillColor,r=this.current.patternFill;for(let i of e){let{data:e,width:a,height:o,transform:s}=i,c=this.cachedCanvases.getCanvas(`maskCanvas`,a,o),l=c.context;l.save(),sm(l,this.getObject(e,i)),l.globalCompositeOperation=`source-in`,l.fillStyle=r?n.getPattern(l,this,Jf(t),Lp.FILL):n,l.fillRect(0,0,a,o),l.restore(),t.save(),t.transform(...s),t.scale(1,-1),rm(t,c.canvas,0,0,a,o,0,-1,1,1),t.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;let t=this.getObject(e);t?this.paintInlineImageXObject(t):ef(`Dependent image isn't ready yet`)}paintImageXObjectRepeat(e,t,n,r){if(!this.contentVisible)return;let i=this.getObject(e);if(!i){ef(`Dependent image isn't ready yet`);return}let a=i.width,o=i.height,s=[];for(let e=0,i=r.length;e<i;e+=2)s.push({transform:[t,0,0,n,r[e],r[e+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(i,s)}applyTransferMapsToCanvas(e){return this.current.transferMaps!==`none`&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter=`none`),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps===`none`)return e.bitmap;let{bitmap:t,width:n,height:r}=e,i=this.cachedCanvases.getCanvas(`inlineImage`,n,r),a=i.context;return a.filter=this.current.transferMaps,a.drawImage(t,0,0),a.filter=`none`,i.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;let t=e.width,n=e.height,r=this.ctx;if(this.save(),!Md){let{filter:e}=r;e!==`none`&&e!==``&&(r.filter=`none`)}r.scale(1/t,-1/n);let i;if(e.bitmap)i=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement==`function`&&e instanceof HTMLElement||!e.data)i=e;else{let r=this.cachedCanvases.getCanvas(`inlineImage`,t,n).context;om(r,e),i=this.applyTransferMapsToCanvas(r)}let a=this._scaleImage(i,Jf(r));r.imageSmoothingEnabled=um(qf(r),e.interpolate),rm(r,a.img,0,0,a.paintWidth,a.paintHeight,0,-n,t,n),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,t){if(!this.contentVisible)return;let n=this.ctx,r;if(e.bitmap)r=e.bitmap;else{let t=e.width,n=e.height,i=this.cachedCanvases.getCanvas(`inlineImage`,t,n).context;om(i,e),r=this.applyTransferMapsToCanvas(i)}for(let e of t)n.save(),n.transform(...e.transform),n.scale(1,-1),rm(n,r,e.x,e.y,e.w,e.h,0,-1,1,1),n.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,t){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t){e===`OC`?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(t)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e){let t=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);let n=this.ctx;this.pendingClip&&=(t||(this.pendingClip===mm?n.clip(`evenodd`):n.clip()),null),this.current.startNewPathAndClipBox(this.current.clipBox),n.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let e=qf(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{let t=Math.abs(e[0]*e[3]-e[2]*e[1]),n=Math.hypot(e[0],e[2]),r=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(n,r)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){let{lineWidth:e}=this.current,{a:t,b:n,c:r,d:i}=this.ctx.getTransform(),a,o;if(n===0&&r===0){let n=Math.abs(t),r=Math.abs(i);if(n===r){if(e===0)a=o=1/n;else{let t=n*e;a=o=t<1?1/t:1}}else if(e===0)a=1/n,o=1/r;else{let t=n*e,i=r*e;a=t<1?1/t:1,o=i<1?1/i:1}}else{let s=Math.abs(t*i-n*r),c=Math.hypot(t,n),l=Math.hypot(r,i);if(e===0)a=l/s,o=c/s;else{let t=e*s;a=l>t?l/t:1,o=c>t?c/t:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(e){let{ctx:t}=this,{lineWidth:n}=this.current,[r,i]=this.getScaleForStroking();if(t.lineWidth=n||1,r===1&&i===1){t.stroke();return}let a=t.getLineDash();if(e&&t.save(),t.scale(r,i),a.length>0){let e=Math.max(r,i);t.setLineDash(a.map(t=>t/e)),t.lineDashOffset/=e}t.stroke(),e&&t.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};for(let e in Jd)hm.prototype[e]!==void 0&&(hm.prototype[Jd[e]]=hm.prototype[e]);var gm=class{static#e=null;static#t=``;static get workerPort(){return this.#e}static set workerPort(e){if(!(typeof Worker<`u`&&e instanceof Worker)&&e!==null)throw Error("Invalid `workerPort` type.");this.#e=e}static get workerSrc(){return this.#t}static set workerSrc(e){if(typeof e!=`string`)throw Error("Invalid `workerSrc` type.");this.#t=e}},_m=class{#e;#t;constructor({parsedData:e,rawData:t}){this.#e=e,this.#t=t}getRaw(){return this.#t}get(e){return this.#e.get(e)??null}getAll(){return vf(this.#e)}has(e){return this.#e.has(e)}},vm=Symbol(`INTERNAL`),ym=class{#e=!1;#t=!1;#n=!1;#r=!0;constructor(e,{name:t,intent:n,usage:r,rbGroups:i}){this.#e=!!(e&Ld.DISPLAY),this.#t=!!(e&Ld.PRINT),this.name=t,this.intent=n,this.usage=r,this.rbGroups=i}get visible(){if(this.#n)return this.#r;if(!this.#r)return!1;let{print:e,view:t}=this.usage;return this.#e?t?.viewState!==`OFF`:!this.#t||e?.printState!==`OFF`}_setVisible(e,t,n=!1){e!==vm&&tf("Internal method `_setVisible` called."),this.#n=n,this.#r=t}},bm=class{#e=null;#t=new Map;#n=null;#r=null;constructor(e,t=Ld.DISPLAY){if(this.renderingIntent=t,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,this.#r=e.order;for(let n of e.groups)this.#t.set(n.id,new ym(t,n));if(e.baseState===`OFF`)for(let e of this.#t.values())e._setVisible(vm,!1);for(let t of e.on)this.#t.get(t)._setVisible(vm,!0);for(let t of e.off)this.#t.get(t)._setVisible(vm,!1);this.#n=this.getHash()}}#i(e){let t=e.length;if(t<2)return!0;let n=e[0];for(let r=1;r<t;r++){let t=e[r],i;if(Array.isArray(t))i=this.#i(t);else if(this.#t.has(t))i=this.#t.get(t).visible;else return ef(`Optional content group not found: ${t}`),!0;switch(n){case`And`:if(!i)return!1;break;case`Or`:if(i)return!0;break;case`Not`:return!i;default:return!0}}return n===`And`}isVisible(e){if(this.#t.size===0)return!0;if(!e)return $d(`Optional content group not defined.`),!0;if(e.type===`OCG`)return this.#t.has(e.id)?this.#t.get(e.id).visible:(ef(`Optional content group not found: ${e.id}`),!0);if(e.type===`OCMD`){if(e.expression)return this.#i(e.expression);if(!e.policy||e.policy===`AnyOn`){for(let t of e.ids){if(!this.#t.has(t))return ef(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!0}return!1}if(e.policy===`AllOn`){for(let t of e.ids){if(!this.#t.has(t))return ef(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!1}return!0}if(e.policy===`AnyOff`){for(let t of e.ids){if(!this.#t.has(t))return ef(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!0}return!1}if(e.policy===`AllOff`){for(let t of e.ids){if(!this.#t.has(t))return ef(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!1}return!0}return ef(`Unknown optional content policy ${e.policy}.`),!0}return ef(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,n=!0){let r=this.#t.get(e);if(!r)ef(`Optional content group not found: ${e}`);else{if(n&&t&&r.rbGroups.length)for(let t of r.rbGroups)for(let n of t)n!==e&&this.#t.get(n)?._setVisible(vm,!1,!0);r._setVisible(vm,!!t,!0),this.#e=null}}setOCGState({state:e,preserveRB:t}){let n;for(let r of e){switch(r){case`ON`:case`OFF`:case`Toggle`:n=r;continue}let e=this.#t.get(r);if(e)switch(n){case`ON`:this.setVisibility(r,!0,t);break;case`OFF`:this.setVisibility(r,!1,t);break;case`Toggle`:this.setVisibility(r,!e.visible,t)}}this.#e=null}get hasInitialVisibility(){return this.#n===null||this.getHash()===this.#n}getOrder(){return this.#t.size?this.#r?this.#r.slice():[...this.#t.keys()]:null}getGroups(){return this.#t.size>0?vf(this.#t):null}getGroup(e){return this.#t.get(e)||null}getHash(){if(this.#e!==null)return this.#e;let e=new pp;for(let[t,n]of this.#t)e.update(`${t}:${n.visible}`);return this.#e=e.hexdigest()}},xm=class{constructor(e,{disableRange:t=!1,disableStream:n=!1}){nf(e,`PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.`);let{length:r,initialData:i,progressiveDone:a,contentDispositionFilename:o}=e;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,i?.length>0){let e=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!n,this._isRangeSupported=!t,this._contentLength=r,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((e,t)=>{this._onReceiveData({begin:e,chunk:t})}),e.addProgressListener((e,t)=>{this._onProgress({loaded:e,total:t})}),e.addProgressiveReadListener(e=>{this._onReceiveData({chunk:e})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:t}){let n=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;e===void 0?this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n):nf(this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(n),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){e.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){let t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){nf(!this._fullRequestReader,`PDFDataTransportStream.getFullReader can only be called once.`);let e=this._queuedChunks;return this._queuedChunks=null,new Sm(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new Cm(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}},Sm=class{constructor(e,t,n=!1,r=null){this._stream=e,this._done=n||!1,this._filename=If(r)?r:null,this._queuedChunks=t||[],this._loaded=0;for(let e of this._queuedChunks)this._loaded+=e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||=!0}},Cm=class{constructor(e,t,n){this._stream=e,this._begin=t,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){let e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}};function wm(e){let t=!0,n=r(`filename\\*`,`i`).exec(e);if(n){n=n[1];let e=s(n);return e=unescape(e),e=c(e),e=l(e),a(e)}if(n=o(e),n)return a(l(n));if(n=r(`filename`,`i`).exec(e),n){n=n[1];let e=s(n);return e=l(e),a(e)}function r(e,t){return RegExp(`(?:^|;)\\s*`+e+`\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)`,t)}function i(e,n){if(e){if(!/^[\x00-\xFF]+$/.test(n))return n;try{let r=new TextDecoder(e,{fatal:!0}),i=gf(n);n=r.decode(i),t=!1}catch{}}return n}function a(e){return t&&/[\x80-\xff]/.test(e)&&(e=i(`utf-8`,e),t&&(e=i(`iso-8859-1`,e))),e}function o(e){let t=[],n,i=r(`filename\\*((?!0\\d)\\d+)(\\*?)`,`ig`);for(;(n=i.exec(e))!==null;){let[,e,r,i]=n;if(e=parseInt(e,10),e in t){if(e===0)break}else t[e]=[r,i]}let a=[];for(let e=0;e<t.length&&e in t;++e){let[n,r]=t[e];r=s(r),n&&(r=unescape(r),e===0&&(r=c(r))),a.push(r)}return a.join(``)}function s(e){if(e.startsWith(`"`)){let t=e.slice(1).split(`\\"`);for(let e=0;e<t.length;++e){let n=t[e].indexOf(`"`);n!==-1&&(t[e]=t[e].slice(0,n),t.length=e+1),t[e]=t[e].replaceAll(/\\(.)/g,`$1`)}e=t.join(`"`)}return e}function c(e){let t=e.indexOf(`'`);return t===-1?e:i(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,``))}function l(e){return!e.startsWith(`=?`)||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(e,t,n,r){if(n===`q`||n===`Q`)return r=r.replaceAll(`_`,` `),r=r.replaceAll(/=([0-9a-fA-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))}),i(t,r);try{r=atob(r)}catch{}return i(t,r)})}return``}function Tm(e,t){let n=new Headers;if(!e||!t||typeof t!=`object`)return n;for(let e in t){let r=t[e];r!==void 0&&n.append(e,r)}return n}function Em(e){try{return new URL(e).origin}catch{}return null}function Dm({responseHeaders:e,isHttp:t,rangeChunkSize:n,disableRange:r}){let i={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e.get(`Content-Length`),10);return!Number.isInteger(a)||(i.suggestedLength=a,a<=2*n)||r||!t||e.get(`Accept-Ranges`)!==`bytes`||(e.get(`Content-Encoding`)||`identity`)!==`identity`||(i.allowRangeRequests=!0),i}function Om(e){let t=e.get(`Content-Disposition`);if(t){let e=wm(t);if(e.includes(`%`))try{e=decodeURIComponent(e)}catch{}if(If(e))return e}return null}function km(e,t){return e===404||e===0&&t.startsWith(`file:`)?new df(`Missing PDF "`+t+`".`):new ff(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)}function Am(e){return e===200||e===206}function jm(e,t,n){return{method:`GET`,headers:e,signal:n.signal,mode:`cors`,credentials:t?`include`:`same-origin`,redirect:`follow`}}function Mm(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(ef(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}var Nm=class{_responseOrigin=null;constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=Tm(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return nf(!this._fullRequestReader,`PDFFetchStream.getFullReader can only be called once.`),this._fullRequestReader=new Pm(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new Fm(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},Pm=class{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;let t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange;let n=new Headers(e.headers),r=t.url;fetch(r,jm(n,this._withCredentials,this._abortController)).then(t=>{if(e._responseOrigin=Em(t.url),!Am(t.status))throw km(t.status,r);this._reader=t.body.getReader(),this._headersCapability.resolve();let n=t.headers,{allowRangeRequests:i,suggestedLength:a}=Dm({responseHeaders:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=a||this._contentLength,this._filename=Om(n),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new mf(`Streaming is disabled.`))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:Mm(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},Fm=class{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;let r=e.source;this._withCredentials=r.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!r.disableStream,this._abortController=new AbortController;let i=new Headers(e.headers);i.append(`Range`,`bytes=${t}-${n-1}`);let a=r.url;fetch(a,jm(i,this._withCredentials,this._abortController)).then(t=>{let n=Em(t.url);if(n!==e._responseOrigin)throw Error(`Expected range response-origin "${n}" to match "${e._responseOrigin}".`);if(!Am(t.status))throw km(t.status,a);this._readCapability.resolve(),this._reader=t.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:Mm(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},Im=200,Lm=206;function Rm(e){let t=e.response;return typeof t==`string`?gf(t).buffer:t}var zm=class{_responseOrigin=null;constructor({url:e,httpHeaders:t,withCredentials:n}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=Tm(this.isHttp,t),this.withCredentials=n||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){let t=new XMLHttpRequest,n=this.currXhrId++,r=this.pendingRequests[n]={xhr:t};t.open(`GET`,this.url),t.withCredentials=this.withCredentials;for(let[e,n]of this.headers)t.setRequestHeader(e,n);return this.isHttp&&`begin`in e&&`end`in e?(t.setRequestHeader(`Range`,`bytes=${e.begin}-${e.end-1}`),r.expectedStatus=Lm):r.expectedStatus=Im,t.responseType=`arraybuffer`,nf(e.onError,"Expected `onError` callback to be provided."),t.onerror=()=>{e.onError(t.status)},t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),r.onHeadersReceived=e.onHeadersReceived,r.onDone=e.onDone,r.onError=e.onError,r.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){let n=this.pendingRequests[e];n&&n.onProgress?.(t)}onStateChange(e,t){let n=this.pendingRequests[e];if(!n)return;let r=n.xhr;if(r.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),r.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],r.status===0&&this.isHttp){n.onError(r.status);return}let i=r.status||Im;if((i!==Im||n.expectedStatus!==Lm)&&i!==n.expectedStatus){n.onError(r.status);return}let a=Rm(r);if(i===Lm){let e=r.getResponseHeader(`Content-Range`),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);t?n.onDone({begin:parseInt(t[1],10),chunk:a}):(ef(`Missing or invalid "Content-Range" header.`),n.onError(0))}else a?n.onDone({begin:0,chunk:a}):n.onError(r.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){let t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}},Bm=class{constructor(e){this._source=e,this._manager=new zm(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){let t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return nf(!this._fullRequestReader,`PDFNetworkStream.getFullReader can only be called once.`),this._fullRequestReader=new Vm(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){let n=new Hm(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},Vm=class{constructor(e,t){this._manager=e,this._url=t.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){let e=this._fullRequestId,t=this._manager.getRequestXhr(e);this._manager._responseOrigin=Em(t.responseURL);let n=t.getAllResponseHeaders(),r=new Headers(n?n.trimStart().replace(/[^\S ]+$/,``).split(/[\r\n]+/).map(e=>{let[t,...n]=e.split(`: `);return[t,n.join(`: `)]}):[]),{allowRangeRequests:i,suggestedLength:a}=Dm({responseHeaders:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=Om(r),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=km(e,this._url),this._headersCapability.reject(this._storedError);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}},Hm=class{constructor(e,t,n){this._manager=e,this._url=e.url,this._requestId=e.request({begin:t,end:n,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){let e=Em(this._manager.getRequestXhr(this._requestId)?.responseURL);e!==this._manager._responseOrigin&&(this._storedError=Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(e){let t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??=km(e,this._url);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){let e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}},Um=/^[a-z][a-z0-9\-+.]+:/i;function Wm(e){if(Um.test(e))return new URL(e);let t=process.getBuiltinModule(`url`);return new URL(t.pathToFileURL(e))}var Gm=class{constructor(e){this.source=e,this.url=Wm(e.url),nf(this.url.protocol===`file:`,`PDFNodeStream only supports file:// URLs.`),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return nf(!this._fullRequestReader,`PDFNodeStream.getFullReader can only be called once.`),this._fullRequestReader=new Km(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new qm(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},Km=class{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;let t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();let n=process.getBuiltinModule(`fs`);n.promises.lstat(this._url).then(e=>{this._contentLength=e.size,this._setReadableStream(n.createReadStream(this._url)),this._headersCapability.resolve()},e=>{e.code===`ENOENT`&&(e=new df(`Missing PDF "${this._url}".`)),this._storedError=e,this._headersCapability.reject(e)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on(`readable`,()=>{this._readCapability.resolve()}),e.on(`end`,()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on(`error`,e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new mf(`streaming is disabled`)),this._storedError&&this._readableStream.destroy(this._storedError)}},qm=class{constructor(e,t,n){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();let r=e.source;this._isStreamingSupported=!r.disableStream;let i=process.getBuiltinModule(`fs`);this._setReadableStream(i.createReadStream(this._url,{start:t,end:n-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on(`readable`,()=>{this._readCapability.resolve()}),e.on(`end`,()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on(`error`,e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}},Jm=1e5,Ym=30,Xm=.8,Zm=class e{#e=Promise.withResolvers();#t=null;#n=!1;#r=!!globalThis.FontInspector?.enabled;#i=null;#a=null;#o=0;#s=0;#c=null;#l=null;#u=0;#d=0;#f=Object.create(null);#p=[];#m=null;#h=[];#g=new WeakMap;#_=null;static#v=new Map;static#y=new Map;static#b=new WeakMap;static#x=null;static#S=new Set;constructor({textContentSource:t,container:n,viewport:r}){if(t instanceof ReadableStream)this.#m=t;else if(typeof t==`object`)this.#m=new ReadableStream({start(e){e.enqueue(t),e.close()}});else throw Error(`No "textContentSource" parameter specified.`);this.#t=this.#l=n,this.#d=r.scale*(globalThis.devicePixelRatio||1),this.#u=r.rotation,this.#a={div:null,properties:null,ctx:null};let{pageWidth:i,pageHeight:a,pageX:o,pageY:s}=r.rawDims;this.#_=[1,0,0,-1,-o,s+a],this.#s=i,this.#o=a,e.#O(),Yf(n,r),this.#e.promise.finally(()=>{e.#S.delete(this),this.#a=null,this.#f=null}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:e,isFirefox:t}=xf.platform;return of(this,`fontFamilyMap`,new Map([[`sans-serif`,`${e&&t?`Calibri, `:``}sans-serif`],[`monospace`,`${e&&t?`Lucida Console, `:``}monospace`]]))}render(){let t=()=>{this.#c.read().then(({value:e,done:n})=>{n?this.#e.resolve():(this.#i??=e.lang,Object.assign(this.#f,e.styles),this.#C(e.items),t())},this.#e.reject)};return this.#c=this.#m.getReader(),e.#S.add(this),t(),this.#e.promise}update({viewport:t,onBefore:n=null}){let r=t.scale*(globalThis.devicePixelRatio||1),i=t.rotation;if(i!==this.#u&&(n?.(),this.#u=i,Yf(this.#l,{rotation:i})),r!==this.#d){n?.(),this.#d=r;let t={div:null,properties:null,ctx:e.#E(this.#i)};for(let e of this.#h)t.properties=this.#g.get(e),t.div=e,this.#T(t)}}cancel(){let e=new mf(`TextLayer task cancelled.`);this.#c?.cancel(e).catch(()=>{}),this.#c=null,this.#e.reject(e)}get textDivs(){return this.#h}get textContentItemsStr(){return this.#p}#C(t){if(this.#n)return;this.#a.ctx??=e.#E(this.#i);let n=this.#h,r=this.#p;for(let e of t){if(n.length>Jm){ef(`Ignoring additional textDivs for performance reasons.`),this.#n=!0;return}if(e.str===void 0){if(e.type===`beginMarkedContentProps`||e.type===`beginMarkedContent`){let t=this.#t;this.#t=document.createElement(`span`),this.#t.classList.add(`markedContent`),e.id!==null&&this.#t.setAttribute(`id`,`${e.id}`),t.append(this.#t)}else e.type===`endMarkedContent`&&(this.#t=this.#t.parentNode)}else r.push(e.str),this.#w(e)}}#w(t){let n=document.createElement(`span`),r={angle:0,canvasWidth:0,hasText:t.str!==``,hasEOL:t.hasEOL,fontSize:0};this.#h.push(n);let i=Q.transform(this.#_,t.transform),a=Math.atan2(i[1],i[0]),o=this.#f[t.fontName];o.vertical&&(a+=Math.PI/2);let s=this.#r&&o.fontSubstitution||o.fontFamily;s=e.fontFamilyMap.get(s)||s;let c=Math.hypot(i[2],i[3]),l=c*e.#k(s,this.#i),u,d;a===0?(u=i[4],d=i[5]-l):(u=i[4]+l*Math.sin(a),d=i[5]-l*Math.cos(a));let f=`calc(var(--scale-factor)*`,p=n.style;this.#t===this.#l?(p.left=`${(100*u/this.#s).toFixed(2)}%`,p.top=`${(100*d/this.#o).toFixed(2)}%`):(p.left=`${f}${u.toFixed(2)}px)`,p.top=`${f}${d.toFixed(2)}px)`),p.fontSize=`${f}${(e.#x*c).toFixed(2)}px)`,p.fontFamily=s,r.fontSize=c,n.setAttribute(`role`,`presentation`),n.textContent=t.str,n.dir=t.dir,this.#r&&(n.dataset.fontName=o.fontSubstitutionLoadedName||t.fontName),a!==0&&(r.angle=180/Math.PI*a);let m=!1;if(t.str.length>1)m=!0;else if(t.str!==` `&&t.transform[0]!==t.transform[3]){let e=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);e!==n&&Math.max(e,n)/Math.min(e,n)>1.5&&(m=!0)}if(m&&(r.canvasWidth=o.vertical?t.height:t.width),this.#g.set(n,r),this.#a.div=n,this.#a.properties=r,this.#T(this.#a),r.hasText&&this.#t.append(n),r.hasEOL){let e=document.createElement(`br`);e.setAttribute(`role`,`presentation`),this.#t.append(e)}}#T(t){let{div:n,properties:r,ctx:i}=t,{style:a}=n,o=``;if(e.#x>1&&(o=`scale(${1/e.#x})`),r.canvasWidth!==0&&r.hasText){let{fontFamily:t}=a,{canvasWidth:s,fontSize:c}=r;e.#D(i,c*this.#d,t);let{width:l}=i.measureText(n.textContent);l>0&&(o=`scaleX(${s*this.#d/l}) ${o}`)}r.angle!==0&&(o=`rotate(${r.angle}deg) ${o}`),o.length>0&&(a.transform=o)}static cleanup(){if(!(this.#S.size>0)){this.#v.clear();for(let{canvas:e}of this.#y.values())e.remove();this.#y.clear()}}static#E(e=null){let t=this.#y.get(e||=``);if(!t){let n=document.createElement(`canvas`);n.className=`hiddenCanvasElement`,n.lang=e,document.body.append(n),t=n.getContext(`2d`,{alpha:!1,willReadFrequently:!0}),this.#y.set(e,t),this.#b.set(t,{size:0,family:``})}return t}static#D(e,t,n){let r=this.#b.get(e);(t!==r.size||n!==r.family)&&(e.font=`${t}px ${n}`,r.size=t,r.family=n)}static#O(){if(this.#x!==null)return;let e=document.createElement(`div`);e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize=`1px`,e.style.position=`absolute`,e.textContent=`X`,document.body.append(e),this.#x=e.getBoundingClientRect().height,e.remove()}static#k(e,t){let n=this.#v.get(e);if(n)return n;let r=this.#E(t);r.canvas.width=r.canvas.height=Ym,this.#D(r,Ym,e);let i=r.measureText(``),a=i.fontBoundingBoxAscent,o=Math.abs(i.fontBoundingBoxDescent);if(a){let t=a/(a+o);return this.#v.set(e,t),r.canvas.width=r.canvas.height=0,t}r.strokeStyle=`red`,r.clearRect(0,0,Ym,Ym),r.strokeText(`g`,0,0);let s=r.getImageData(0,0,Ym,Ym).data;o=0;for(let e=s.length-1-3;e>=0;e-=4)if(s[e]>0){o=Math.ceil(e/4/Ym);break}r.clearRect(0,0,Ym,Ym),r.strokeText(`A`,0,Ym),s=r.getImageData(0,0,Ym,Ym).data,a=0;for(let e=0,t=s.length;e<t;e+=4)if(s[e]>0){a=Ym-Math.floor(e/4/Ym);break}r.canvas.width=r.canvas.height=0;let c=a?a/(a+o):Xm;return this.#v.set(e,c),c}},Qm=class e{static textContent(t){let n=[],r={items:n,styles:Object.create(null)};function i(t){if(!t)return;let r=null,a=t.name;if(a===`#text`)r=t.value;else if(e.shouldBuildText(a))t?.attributes?.textContent?r=t.attributes.textContent:t.value&&(r=t.value);else return;if(r!==null&&n.push({str:r}),t.children)for(let e of t.children)i(e)}return i(t),r}static shouldBuildText(e){return e!==`textarea`&&e!==`input`&&e!==`option`&&e!==`select`}},$m=65536,eh=100,th=5e3,nh=Md?Pp:Tp,rh=Md?Fp:Dp,ih=Md?Np:kp,ah=Md?Ip:jp;function oh(e={}){typeof e==`string`||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});let t=new uh,{docId:n}=t,r=e.url?sh(e.url):null,i=e.data?ch(e.data):null,a=e.httpHeaders||null,o=e.withCredentials===!0,s=e.password??null,c=e.range instanceof dh?e.range:null,l=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:$m,u=e.worker instanceof hh?e.worker:null,d=e.verbosity,f=typeof e.docBaseUrl==`string`&&!Ff(e.docBaseUrl)?e.docBaseUrl:null,p=typeof e.cMapUrl==`string`?e.cMapUrl:null,m=e.cMapPacked!==!1,h=e.CMapReaderFactory||rh,g=typeof e.standardFontDataUrl==`string`?e.standardFontDataUrl:null,_=e.StandardFontDataFactory||ah,v=e.stopAtErrors!==!0,y=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,b=e.isEvalSupported!==!1,x=typeof e.isOffscreenCanvasSupported==`boolean`?e.isOffscreenCanvasSupported:!Md,S=typeof e.isImageDecoderSupported==`boolean`?e.isImageDecoderSupported:!Md&&(xf.platform.isFirefox||!globalThis.chrome),ee=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,te=typeof e.disableFontFace==`boolean`?e.disableFontFace:Md,ne=e.fontExtraProperties===!0,C=e.enableXfa===!0,re=e.ownerDocument||globalThis.document,ie=e.disableRange===!0,ae=e.disableStream===!0,w=e.disableAutoFetch===!0,oe=e.pdfBug===!0,se=e.CanvasFactory||nh,ce=e.FilterFactory||ih,le=e.enableHWA===!0,ue=c?c.length:e.length??NaN,de=typeof e.useSystemFonts==`boolean`?e.useSystemFonts:!Md&&!te,fe=typeof e.useWorkerFetch==`boolean`?e.useWorkerFetch:h===Dp&&_===jp&&p&&g&&Bf(p,document.baseURI)&&Bf(g,document.baseURI);Zd(d);let pe={canvasFactory:new se({ownerDocument:re,enableHWA:le}),filterFactory:new ce({docId:n,ownerDocument:re}),cMapReaderFactory:fe?null:new h({baseUrl:p,isCompressed:m}),standardFontDataFactory:fe?null:new _({baseUrl:g})};if(!u){let e={verbosity:d,port:gm.workerPort};u=e.port?hh.fromPort(e):new hh(e),t._worker=u}let me={docId:n,apiVersion:`4.10.38`,data:i,password:s,disableAutoFetch:w,rangeChunkSize:l,length:ue,docBaseUrl:f,enableXfa:C,evaluatorOptions:{maxImageSize:y,disableFontFace:te,ignoreErrors:v,isEvalSupported:b,isOffscreenCanvasSupported:x,isImageDecoderSupported:S,canvasMaxAreaInBytes:ee,fontExtraProperties:ne,useSystemFonts:de,cMapUrl:fe?p:null,standardFontDataUrl:fe?g:null}},he={disableFontFace:te,fontExtraProperties:ne,ownerDocument:re,pdfBug:oe,styleElement:null,loadingParams:{disableAutoFetch:w,enableXfa:C}};return u.promise.then(function(){if(t.destroyed)throw Error(`Loading aborted`);if(u.destroyed)throw Error(`Worker was destroyed`);let e=u.messageHandler.sendWithPromise(`GetDocRequest`,me,i?[i.buffer]:null),s;if(c)s=new xm(c,{disableRange:ie,disableStream:ae});else if(!i){if(!r)throw Error("getDocument - no `url` parameter provided.");let e;if(Md){if(Bf(r)){if(typeof fetch>`u`||typeof Response>`u`||!(`body`in Response.prototype))throw Error("getDocument - the Fetch API was disabled in Node.js, see `--no-experimental-fetch`.");e=Nm}else e=Gm}else e=Bf(r)?Nm:Bm;s=new e({url:r,length:ue,httpHeaders:a,withCredentials:o,rangeChunkSize:l,disableRange:ie,disableStream:ae})}return e.then(e=>{if(t.destroyed)throw Error(`Loading aborted`);if(u.destroyed)throw Error(`Worker was destroyed`);let r=new Cp(n,e,u.port),i=new gh(r,t,s,he,pe);t._transport=i,r.send(`Ready`,null)})}).catch(t._capability.reject),t}function sh(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(Md&&typeof e==`string`)return e}throw Error(`Invalid PDF url data: either string or URL-object is expected in the url property.`)}function ch(e){if(Md&&typeof Buffer<`u`&&e instanceof Buffer)throw Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if(typeof e==`string`)return gf(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof e==`object`&&!isNaN(e?.length))return new Uint8Array(e);throw Error(`Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.`)}function lh(e){return typeof e==`object`&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0}var uh=class e{static#e=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${e.#e++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker?.destroy(),this._worker=null}},dh=class{constructor(e,t,n=!1,r=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=r,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(let n of this._rangeListeners)n(e,t)}onDataProgress(e,t){this._readyCapability.promise.then(()=>{for(let n of this._progressListeners)n(e,t)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(let t of this._progressiveReadListeners)t(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(let e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){tf(`Abstract method PDFDataRangeTransport.requestDataRange`)}abort(){}},fh=class{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return of(this,`isPureXfa`,!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e=`display`}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}},ph=class{#e=null;#t=!1;constructor(e,t,n,r=!1){this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=r?new zf:null,this._pdfBug=r,this.commonObjs=n.commonObjs,this.objs=new vh,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:n=0,offsetY:r=0,dontFlip:i=!1}={}){return new Nf({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:i})}getAnnotations({intent:e=`display`}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return of(this,`isPureXfa`,!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,viewport:t,intent:n=`display`,annotationMode:r=Rd.ENABLE,transform:i=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:s=null,pageColors:c=null,printAnnotationStorage:l=null,isEditing:u=!1}){this._stats?.time(`Overall`);let d=this._transport.getRenderingIntent(n,r,l,u),{renderingIntent:f,cacheKey:p}=d;this.#t=!1,this.#r(),o||=this._transport.getOptionalContentConfig(f);let m=this._intentStates.get(p);m||(m=Object.create(null),this._intentStates.set(p,m)),m.streamReaderCancelTimeout&&(clearTimeout(m.streamReaderCancelTimeout),m.streamReaderCancelTimeout=null);let h=!!(f&Ld.PRINT);m.displayReadyCapability||(m.displayReadyCapability=Promise.withResolvers(),m.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time(`Page Request`),this._pumpOperatorList(d));let g=e=>{m.renderTasks.delete(_),(this._maybeCleanupAfterRender||h)&&(this.#t=!0),this.#n(!h),e?(_.capability.reject(e),this._abortOperatorList({intentState:m,reason:e instanceof Error?e:Error(e)})):_.capability.resolve(),this._stats&&(this._stats.timeEnd(`Rendering`),this._stats.timeEnd(`Overall`),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},_=new bh({callback:g,params:{canvasContext:e,viewport:t,transform:i,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:s,operatorList:m.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!h,pdfBug:this._pdfBug,pageColors:c});(m.renderTasks||=new Set).add(_);let v=_.task;return Promise.all([m.displayReadyCapability.promise,o]).then(([e,t])=>{if(this.destroyed)g();else{if(this._stats?.time(`Rendering`),!(t.renderingIntent&f))throw Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");_.initializeGraphics({transparency:e,optionalContentConfig:t}),_.operatorListChanged()}}).catch(g),v}getOperatorList({intent:e=`display`,annotationMode:t=Rd.ENABLE,printAnnotationStorage:n=null,isEditing:r=!1}={}){function i(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(s))}let a=this._transport.getRenderingIntent(e,t,n,r,!0),o=this._intentStates.get(a.cacheKey);o||(o=Object.create(null),this._intentStates.set(a.cacheKey,o));let s;return o.opListReadCapability||(s=Object.create(null),s.operatorListChanged=i,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||=new Set).add(s),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time(`Page Request`),this._pumpOperatorList(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream(`GetTextContent`,{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size(e){return e.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(e=>Qm.textContent(e));let t=this.streamTextContent(e);return new Promise(function(e,n){function r(){i.read().then(function({value:t,done:n}){n?e(a):(a.lang??=t.lang,Object.assign(a.styles,t.styles),a.items.push(...t.items),r())},n)}let i=t.getReader(),a={items:[],styles:Object.create(null),lang:null};r()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let e=[];for(let t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:Error(`Page was destroyed.`),force:!0}),!t.opListReadCapability)for(let n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),this.#t=!1,this.#r(),Promise.all(e)}cleanup(e=!1){this.#t=!0;let t=this.#n(!1);return e&&t&&(this._stats&&=new zf),t}#n(e=!1){if(this.#r(),!this.#t||this.destroyed)return!1;if(e)return this.#e=setTimeout(()=>{this.#e=null,this.#n(!1)},th),!1;for(let{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}#r(){this.#e&&=(clearTimeout(this.#e),null)}_startRenderPage(e,t){let n=this._intentStates.get(t);n&&(this._stats?.timeEnd(`Page Request`),n.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let n=0,r=e.length;n<r;n++)t.operatorList.fnArray.push(e.fnArray[n]),t.operatorList.argsArray.push(e.argsArray[n]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(let e of t.renderTasks)e.operatorListChanged();e.lastChunk&&this.#n(!0)}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:n,modifiedIds:r}){let{map:i,transfer:a}=n,o=this._transport.messageHandler.sendWithStream(`GetOperatorList`,{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:i,modifiedIds:r},a).getReader(),s=this._intentStates.get(t);s.streamReader=o;let c=()=>{o.read().then(({value:e,done:t})=>{t?s.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,s),c())},e=>{if(s.streamReader=null,!this._transport.destroyed){if(s.operatorList){s.operatorList.lastChunk=!0;for(let e of s.renderTasks)e.operatorListChanged();this.#n(!0)}if(s.displayReadyCapability)s.displayReadyCapability.reject(e);else if(s.opListReadCapability)s.opListReadCapability.reject(e);else throw e}})};c()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&=(clearTimeout(e.streamReaderCancelTimeout),null),!n){if(e.renderTasks.size>0)return;if(t instanceof Pf){let n=eh;t.extraDelay>0&&t.extraDelay<1e3&&(n+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},n);return}}if(e.streamReader.cancel(new mf(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(let[t,n]of this._intentStates)if(n===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}},mh=class{#e=new Map;#t=Promise.resolve();postMessage(e,t){let n={data:structuredClone(e,t?{transfer:t}:null)};this.#t.then(()=>{for(let[e]of this.#e)e.call(this,n)})}addEventListener(e,t,n=null){let r=null;if(n?.signal instanceof AbortSignal){let{signal:i}=n;if(i.aborted){ef("LoopbackPort - cannot use an `aborted` signal.");return}let a=()=>this.removeEventListener(e,t);r=()=>i.removeEventListener(`abort`,a),i.addEventListener(`abort`,a)}this.#e.set(t,r)}removeEventListener(e,t){this.#e.get(t)?.(),this.#e.delete(t)}terminate(){for(let[,e]of this.#e)e?.();this.#e.clear()}},hh=class e{static#e=0;static#t=!1;static#n;static{Md&&(this.#t=!0,gm.workerSrc||=`./pdf.worker.mjs`),this._isSameOrigin=(e,t)=>{let n;try{if(n=new URL(e),!n.origin||n.origin===`null`)return!1}catch{return!1}let r=new URL(t,n);return n.origin===r.origin},this._createCDNWrapper=e=>{let t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:`text/javascript`}))}}constructor({name:t=null,port:n=null,verbosity:r=Qd()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=r,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,n){if(e.#n?.has(n))throw Error(`Cannot use more than one PDFWorker per port.`);(e.#n||=new WeakMap).set(n,this),this._initializeFromPort(n)}else this._initialize()}get promise(){return this._readyCapability.promise}#r(){this._readyCapability.resolve(),this._messageHandler.send(`configure`,{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new Cp(`main`,`worker`,e),this._messageHandler.on(`ready`,function(){}),this.#r()}_initialize(){if(e.#t||e.#i){this._setupFakeWorker();return}let{workerSrc:t}=e;try{e._isSameOrigin(window.location.href,t)||(t=e._createCDNWrapper(new URL(t,window.location).href));let n=new Worker(t,{type:`module`}),r=new Cp(`main`,`worker`,n),i=()=>{a.abort(),r.destroy(),n.terminate(),this.destroyed?this._readyCapability.reject(Error(`Worker was destroyed`)):this._setupFakeWorker()},a=new AbortController;n.addEventListener(`error`,()=>{this._webWorker||i()},{signal:a.signal}),r.on(`test`,e=>{a.abort(),this.destroyed||!e?i():(this._messageHandler=r,this._port=n,this._webWorker=n,this.#r())}),r.on(`ready`,e=>{if(a.abort(),this.destroyed)i();else try{o()}catch{this._setupFakeWorker()}});let o=()=>{let e=new Uint8Array;r.send(`test`,e,[e.buffer])};o();return}catch{$d(`The worker has been disabled.`)}this._setupFakeWorker()}_setupFakeWorker(){e.#t||=(ef(`Setting up fake worker.`),!0),e._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this._readyCapability.reject(Error(`Worker was destroyed`));return}let n=new mh;this._port=n;let r=`fake${e.#e++}`,i=new Cp(r+`_worker`,r,n);t.setup(i,n),this._messageHandler=new Cp(r,r+`_worker`,n),this.#r()}).catch(e=>{this._readyCapability.reject(Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this._webWorker?.terminate(),this._webWorker=null,e.#n?.delete(this._port),this._port=null,this._messageHandler?.destroy(),this._messageHandler=null}static fromPort(t){if(!t?.port)throw Error(`PDFWorker.fromPort - invalid method signature.`);let n=this.#n?.get(t.port);if(n){if(n._pendingDestroy)throw Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return n}return new e(t)}static get workerSrc(){if(gm.workerSrc)return gm.workerSrc;throw Error(`No "GlobalWorkerOptions.workerSrc" specified.`)}static get#i(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return of(this,`_setupFakeWorkerGlobal`,(async()=>this.#i?this.#i:(await kd(()=>import(this.workerSrc),[],import.meta.url)).WorkerMessageHandler)())}},gh=class{#e=new Map;#t=new Map;#n=new Map;#r=new Map;#i=null;constructor(e,t,n,r,i){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new vh,this.fontLoader=new _p({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this.loadingParams=r.loadingParams,this._params=r,this.canvasFactory=i.canvasFactory,this.filterFactory=i.filterFactory,this.cMapReaderFactory=i.cMapReaderFactory,this.standardFontDataFactory=i.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#a(e,t=null){let n=this.#e.get(e);if(n)return n;let r=this.messageHandler.sendWithPromise(e,t);return this.#e.set(e,r),r}get annotationStorage(){return of(this,`annotationStorage`,new hp)}getRenderingIntent(e,t=Rd.ENABLE,n=null,r=!1,i=!1){let a=Ld.DISPLAY,o=mp;switch(e){case`any`:a=Ld.ANY;break;case`display`:break;case`print`:a=Ld.PRINT;break;default:ef(`getRenderingIntent - invalid intent: ${e}`)}let s=a&Ld.PRINT&&n instanceof gp?n:this.annotationStorage;switch(t){case Rd.DISABLE:a+=Ld.ANNOTATIONS_DISABLE;break;case Rd.ENABLE:break;case Rd.ENABLE_FORMS:a+=Ld.ANNOTATIONS_FORMS;break;case Rd.ENABLE_STORAGE:a+=Ld.ANNOTATIONS_STORAGE,o=s.serializable;break;default:ef(`getRenderingIntent - invalid annotationMode: ${t}`)}r&&(a+=Ld.IS_EDITING),i&&(a+=Ld.OPLIST);let{ids:c,hash:l}=s.modifiedIds,u=[a,o.hash,l];return{renderingIntent:a,cacheKey:u.join(`_`),annotationStorageSerializable:o,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#i?.reject(Error(`Worker was destroyed during onPassword callback`));let e=[];for(let t of this.#t.values())e.push(t._destroy());this.#t.clear(),this.#n.clear(),this.#r.clear(),this.hasOwnProperty(`annotationStorage`)&&this.annotationStorage.resetModified();let t=this.messageHandler.sendWithPromise(`Terminate`,null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),Zm.cleanup(),this._networkStream?.cancelAllRequests(new mf(`Worker was terminated.`)),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:e,loadingTask:t}=this;e.on(`GetReader`,(e,t)=>{nf(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then(function({value:e,done:n}){n?t.close():(nf(e instanceof ArrayBuffer,`GetReader - expected an ArrayBuffer.`),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}}),e.on(`ReaderHeadersReady`,async e=>{await this._fullReader.headersReady;let{isStreamingSupported:n,isRangeSupported:r,contentLength:i}=this._fullReader;return(!n||!r)&&(this._lastProgress&&t.onProgress?.(this._lastProgress),this._fullReader.onProgress=e=>{t.onProgress?.({loaded:e.loaded,total:e.total})}),{isStreamingSupported:n,isRangeSupported:r,contentLength:i}}),e.on(`GetRangeReader`,(e,t)=>{nf(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let n=this._networkStream.getRangeReader(e.begin,e.end);n?(t.onPull=()=>{n.read().then(function({value:e,done:n}){n?t.close():(nf(e instanceof ArrayBuffer,`GetRangeReader - expected an ArrayBuffer.`),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{n.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}):t.close()}),e.on(`GetDoc`,({pdfInfo:e})=>{this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new fh(e,this))}),e.on(`DocException`,e=>{t._capability.reject(Sp(e))}),e.on(`PasswordRequest`,e=>{this.#i=Promise.withResolvers();try{if(!t.onPassword)throw Sp(e);t.onPassword(e=>{e instanceof Error?this.#i.reject(e):this.#i.resolve({password:e})},e.code)}catch(e){this.#i.reject(e)}return this.#i.promise}),e.on(`DataLoaded`,e=>{t.onProgress?.({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),e.on(`StartRenderPage`,e=>{this.destroyed||this.#t.get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)}),e.on(`commonobj`,([t,n,r])=>{if(this.destroyed||this.commonObjs.has(t))return null;switch(n){case`Font`:let{disableFontFace:i,fontExtraProperties:a,pdfBug:o}=this._params;if(`error`in r){let e=r.error;ef(`Error during font loading: ${e}`),this.commonObjs.resolve(t,e);break}let s=new vp(r,{disableFontFace:i,fontExtraProperties:a,inspectFont:o&&globalThis.FontInspector?.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null});this.fontLoader.bind(s).catch(()=>e.sendWithPromise(`FontFallback`,{id:t})).finally(()=>{!a&&s.data&&(s.data=null),this.commonObjs.resolve(t,s)});break;case`CopyLocalImage`:let{imageRef:c}=r;nf(c,`The imageRef must be defined.`);for(let e of this.#t.values())for(let[,n]of e.objs)if(n?.ref===c)return n.dataLen?(this.commonObjs.resolve(t,structuredClone(n)),n.dataLen):null;break;case`FontPath`:case`Image`:case`Pattern`:this.commonObjs.resolve(t,r);break;default:throw Error(`Got unknown common object type ${n}`)}return null}),e.on(`obj`,([e,t,n,r])=>{if(this.destroyed)return;let i=this.#t.get(t);if(!i.objs.has(e)){if(i._intentStates.size===0)r?.bitmap?.close();else switch(n){case`Image`:i.objs.resolve(e,r),r?.dataLen>Fd&&(i._maybeCleanupAfterRender=!0);break;case`Pattern`:i.objs.resolve(e,r);break;default:throw Error(`Got unknown object type ${n}`)}}}),e.on(`DocProgress`,e=>{this.destroyed||t.onProgress?.({loaded:e.loaded,total:e.total})}),e.on(`FetchBuiltInCMap`,async e=>{if(this.destroyed)throw Error(`Worker was destroyed.`);if(!this.cMapReaderFactory)throw Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.");return this.cMapReaderFactory.fetch(e)}),e.on(`FetchStandardFontData`,async e=>{if(this.destroyed)throw Error(`Worker was destroyed.`);if(!this.standardFontDataFactory)throw Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.");return this.standardFontDataFactory.fetch(e)})}getData(){return this.messageHandler.sendWithPromise(`GetData`,null)}saveDocument(){this.annotationStorage.size<=0&&ef("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise(`SaveDocument`,{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(Error(`Invalid page request.`));let t=e-1,n=this.#n.get(t);if(n)return n;let r=this.messageHandler.sendWithPromise(`GetPage`,{pageIndex:t}).then(n=>{if(this.destroyed)throw Error(`Transport destroyed`);n.refStr&&this.#r.set(n.refStr,e);let r=new ph(t,n,this,this._params.pdfBug);return this.#t.set(t,r),r});return this.#n.set(t,r),r}getPageIndex(e){return lh(e)?this.messageHandler.sendWithPromise(`GetPageIndex`,{num:e.num,gen:e.gen}):Promise.reject(Error(`Invalid pageIndex request.`))}getAnnotations(e,t){return this.messageHandler.sendWithPromise(`GetAnnotations`,{pageIndex:e,intent:t})}getFieldObjects(){return this.#a(`GetFieldObjects`)}hasJSActions(){return this.#a(`HasJSActions`)}getCalculationOrderIds(){return this.messageHandler.sendWithPromise(`GetCalculationOrderIds`,null)}getDestinations(){return this.messageHandler.sendWithPromise(`GetDestinations`,null)}getDestination(e){return typeof e==`string`?this.messageHandler.sendWithPromise(`GetDestination`,{id:e}):Promise.reject(Error(`Invalid destination request.`))}getPageLabels(){return this.messageHandler.sendWithPromise(`GetPageLabels`,null)}getPageLayout(){return this.messageHandler.sendWithPromise(`GetPageLayout`,null)}getPageMode(){return this.messageHandler.sendWithPromise(`GetPageMode`,null)}getViewerPreferences(){return this.messageHandler.sendWithPromise(`GetViewerPreferences`,null)}getOpenAction(){return this.messageHandler.sendWithPromise(`GetOpenAction`,null)}getAttachments(){return this.messageHandler.sendWithPromise(`GetAttachments`,null)}getDocJSActions(){return this.#a(`GetDocJSActions`)}getPageJSActions(e){return this.messageHandler.sendWithPromise(`GetPageJSActions`,{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise(`GetStructTree`,{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise(`GetOutline`,null)}getOptionalContentConfig(e){return this.#a(`GetOptionalContentConfig`).then(t=>new bm(t,e))}getPermissions(){return this.messageHandler.sendWithPromise(`GetPermissions`,null)}getMetadata(){let e=`GetMetadata`,t=this.#e.get(e);if(t)return t;let n=this.messageHandler.sendWithPromise(e,null).then(e=>({info:e[0],metadata:e[1]?new _m(e[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(e,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise(`GetMarkInfo`,null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise(`Cleanup`,null);for(let e of this.#t.values())if(!e.cleanup())throw Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),Zm.cleanup()}}cachedPageNumber(e){if(!lh(e))return null;let t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return this.#r.get(t)??null}},_h=Symbol(`INITIAL_DATA`),vh=class{#e=Object.create(null);#t(e){return this.#e[e]||={...Promise.withResolvers(),data:_h}}get(e,t=null){if(t){let n=this.#t(e);return n.promise.then(()=>t(n.data)),null}let n=this.#e[e];if(!n||n.data===_h)throw Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){let t=this.#e[e];return!!t&&t.data!==_h}delete(e){let t=this.#e[e];return!t||t.data===_h?!1:(delete this.#e[e],!0)}resolve(e,t=null){let n=this.#t(e);n.data=t,n.resolve()}clear(){for(let e in this.#e){let{data:t}=this.#e[e];t?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(let e in this.#e){let{data:t}=this.#e[e];t!==_h&&(yield[e,t])}}},yh=class{#e=null;constructor(e){this.#e=e,this.onContinue=null}get promise(){return this.#e.capability.promise}cancel(e=0){this.#e.cancel(null,e)}get separateAnnots(){let{separateAnnots:e}=this.#e.operatorList;if(!e)return!1;let{annotationCanvasMap:t}=this.#e;return e.form||e.canvas&&t?.size>0}},bh=class e{#e=null;static#t=new WeakSet;constructor({callback:e,params:t,objs:n,commonObjs:r,annotationCanvasMap:i,operatorList:a,pageIndex:o,canvasFactory:s,filterFactory:c,useRequestAnimationFrame:l=!1,pdfBug:u=!1,pageColors:d=null}){this.callback=e,this.params=t,this.objs=n,this.commonObjs=r,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=s,this.filterFactory=c,this._pdfBug=u,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=l===!0&&typeof window<`u`,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new yh(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:n}){if(this.cancelled)return;if(this._canvas){if(e.#t.has(this._canvas))throw Error(`Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.`);e.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());let{canvasContext:r,viewport:i,transform:a,background:o}=this.params;this.gfx=new hm(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:a,viewport:i,transparency:t,background:o}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,n=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&=(window.cancelAnimationFrame(this.#e),null),e.#t.delete(this._canvas),this.callback(t||new Pf(`Rendering cancelled, page ${this._pageIndex+1}`,n))}operatorListChanged(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),e.#t.delete(this._canvas),this.callback())))}},xh=`4.10.38`,Sh=`f9bea397f`;function Ch(e){return Math.floor(Math.max(0,Math.min(1,e))*255).toString(16).padStart(2,`0`)}function wh(e){return Math.max(0,Math.min(255,255*e))}var Th=class{static CMYK_G([e,t,n,r]){return[`G`,1-Math.min(1,.3*e+.59*n+.11*t+r)]}static G_CMYK([e]){return[`CMYK`,0,0,0,1-e]}static G_RGB([e]){return[`RGB`,e,e,e]}static G_rgb([e]){return e=wh(e),[e,e,e]}static G_HTML([e]){let t=Ch(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return[`G`,.3*e+.59*t+.11*n]}static RGB_rgb(e){return e.map(wh)}static RGB_HTML(e){return`#${e.map(Ch).join(``)}`}static T_HTML(){return`#00000000`}static T_rgb(){return[null]}static CMYK_RGB([e,t,n,r]){return[`RGB`,1-Math.min(1,e+r),1-Math.min(1,n+r),1-Math.min(1,t+r)]}static CMYK_rgb([e,t,n,r]){return[wh(1-Math.min(1,e+r)),wh(1-Math.min(1,n+r)),wh(1-Math.min(1,t+r))]}static CMYK_HTML(e){let t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){let r=1-e,i=1-t,a=1-n;return[`CMYK`,r,i,a,Math.min(r,i,a)]}},Eh=class{create(e,t,n=!1){if(e<=0||t<=0)throw Error(`Invalid SVG dimensions`);let r=this._createSVG(`svg:svg`);return r.setAttribute(`version`,`1.1`),n||(r.setAttribute(`width`,`${e}px`),r.setAttribute(`height`,`${t}px`)),r.setAttribute(`preserveAspectRatio`,`none`),r.setAttribute(`viewBox`,`0 0 ${e} ${t}`),r}createElement(e){if(typeof e!=`string`)throw Error(`Invalid SVG element type`);return this._createSVG(e)}_createSVG(e){tf("Abstract method `_createSVG` called.")}},Dh=class extends Eh{_createSVG(e){return document.createElementNS(Af,e)}},Oh=class{static setupStorage(e,t,n,r,i){let a=r.getValue(t,{value:null});switch(n.name){case`textarea`:if(a.value!==null&&(e.textContent=a.value),i===`print`)break;e.addEventListener(`input`,e=>{r.setValue(t,{value:e.target.value})});break;case`input`:if(n.attributes.type===`radio`||n.attributes.type===`checkbox`){if(a.value===n.attributes.xfaOn?e.setAttribute(`checked`,!0):a.value===n.attributes.xfaOff&&e.removeAttribute(`checked`),i===`print`)break;e.addEventListener(`change`,e=>{r.setValue(t,{value:e.target.checked?e.target.getAttribute(`xfaOn`):e.target.getAttribute(`xfaOff`)})})}else{if(a.value!==null&&e.setAttribute(`value`,a.value),i===`print`)break;e.addEventListener(`input`,e=>{r.setValue(t,{value:e.target.value})})}break;case`select`:if(a.value!==null){e.setAttribute(`value`,a.value);for(let e of n.children)e.attributes.value===a.value?e.attributes.selected=!0:e.attributes.hasOwnProperty(`selected`)&&delete e.attributes.selected}e.addEventListener(`input`,e=>{let n=e.target.options,i=n.selectedIndex===-1?``:n[n.selectedIndex].value;r.setValue(t,{value:i})})}}static setAttributes({html:e,element:t,storage:n=null,intent:r,linkService:i}){let{attributes:a}=t,o=e instanceof HTMLAnchorElement;a.type===`radio`&&(a.name=`${a.name}-${r}`);for(let[t,n]of Object.entries(a))if(n!=null)switch(t){case`class`:n.length&&e.setAttribute(t,n.join(` `));break;case`dataId`:break;case`id`:e.setAttribute(`data-element-id`,n);break;case`style`:Object.assign(e.style,n);break;case`textContent`:e.textContent=n;break;default:(!o||t!==`href`&&t!==`newWindow`)&&e.setAttribute(t,n)}o&&i.addLinkAttributes(e,a.href,a.newWindow),n&&a.dataId&&this.setupStorage(e,a.dataId,t,n)}static render(e){let t=e.annotationStorage,n=e.linkService,r=e.xfaHtml,i=e.intent||`display`,a=document.createElement(r.name);r.attributes&&this.setAttributes({html:a,element:r,intent:i,linkService:n});let o=i!==`richText`,s=e.div;if(s.append(a),e.viewport){let t=`matrix(${e.viewport.transform.join(`,`)})`;s.style.transform=t}o&&s.setAttribute(`class`,`xfaLayer xfaFont`);let c=[];if(r.children.length===0){if(r.value){let e=document.createTextNode(r.value);a.append(e),o&&Qm.shouldBuildText(r.name)&&c.push(e)}return{textDivs:c}}let l=[[r,-1,a]];for(;l.length>0;){let[e,r,a]=l.at(-1);if(r+1===e.children.length){l.pop();continue}let s=e.children[++l.at(-1)[1]];if(s===null)continue;let{name:u}=s;if(u===`#text`){let e=document.createTextNode(s.value);c.push(e),a.append(e);continue}let d=s?.attributes?.xmlns?document.createElementNS(s.attributes.xmlns,u):document.createElement(u);if(a.append(d),s.attributes&&this.setAttributes({html:d,element:s,storage:t,intent:i,linkService:n}),s.children?.length>0)l.push([s,-1,d]);else if(s.value){let e=document.createTextNode(s.value);o&&Qm.shouldBuildText(u)&&c.push(e),d.append(e)}}for(let e of s.querySelectorAll(`.xfaNonInteractive input, .xfaNonInteractive textarea`))e.setAttribute(`readOnly`,!0);return{textDivs:c}}static update(e){let t=`matrix(${e.viewport.transform.join(`,`)})`;e.div.style.transform=t,e.div.hidden=!1}},kh=1e3,Ah=9,jh=new WeakSet;function Mh(e){return{width:e[2]-e[0],height:e[3]-e[1]}}var Nh=class{static create(e){switch(e.data.annotationType){case Gd.LINK:return new Fh(e);case Gd.TEXT:return new Ih(e);case Gd.WIDGET:switch(e.data.fieldType){case`Tx`:return new Rh(e);case`Btn`:return e.data.radioButton?new Vh(e):e.data.checkBox?new Bh(e):new Hh(e);case`Ch`:return new Uh(e);case`Sig`:return new zh(e)}return new Lh(e);case Gd.POPUP:return new Wh(e);case Gd.FREETEXT:return new Kh(e);case Gd.LINE:return new qh(e);case Gd.SQUARE:return new Jh(e);case Gd.CIRCLE:return new Yh(e);case Gd.POLYLINE:return new Xh(e);case Gd.CARET:return new Qh(e);case Gd.INK:return new $h(e);case Gd.POLYGON:return new Zh(e);case Gd.HIGHLIGHT:return new eg(e);case Gd.UNDERLINE:return new tg(e);case Gd.SQUIGGLY:return new ng(e);case Gd.STRIKEOUT:return new rg(e);case Gd.STAMP:return new ig(e);case Gd.FILEATTACHMENT:return new ag(e);default:return new Ph(e)}}},Ph=class e{#e=null;#t=!1;#n=null;constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:r=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(n)),r&&this._createQuadrilaterals()}static _hasPopupData({titleObj:e,contentsObj:t,richText:n}){return!!(e?.str||t?.str||n?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return e._hasPopupData(this.data)}updateEdited(e){if(!this.container)return;this.#e||={rect:this.data.rect.slice(0)};let{rect:t}=e;t&&this.#r(t),this.#n?.popup.updateEdited(e)}resetEdited(){this.#e&&=(this.#r(this.#e.rect),this.#n?.popup.resetEdited(),null)}#r(e){let{container:{style:t},data:{rect:n,rotation:r},parent:{viewport:{rawDims:{pageWidth:i,pageHeight:a,pageX:o,pageY:s}}}}=this;n?.splice(0,4,...e);let{width:c,height:l}=Mh(e);t.left=`${100*(e[0]-o)/i}%`,t.top=`${100*(a-e[3]+s)/a}%`,r===0?(t.width=`${100*c/i}%`,t.height=`${100*l/a}%`):this.setRotation(r)}_createContainer(e){let{data:t,parent:{page:n,viewport:r}}=this,i=document.createElement(`section`);i.setAttribute(`data-annotation-id`,t.id),this instanceof Lh||(i.tabIndex=kh);let{style:a}=i;if(a.zIndex=this.parent.zIndex++,t.alternativeText&&(i.title=t.alternativeText),t.noRotate&&i.classList.add(`norotate`),!t.rect||this instanceof Wh){let{rotation:e}=t;return!t.hasOwnCanvas&&e!==0&&this.setRotation(e,i),i}let{width:o,height:s}=Mh(t.rect);if(!e&&t.borderStyle.width>0){a.borderWidth=`${t.borderStyle.width}px`;let e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;switch(e>0||n>0?a.borderRadius=`calc(${e}px * var(--scale-factor)) / calc(${n}px * var(--scale-factor))`:this instanceof Vh&&(a.borderRadius=`calc(${o}px * var(--scale-factor)) / calc(${s}px * var(--scale-factor))`),t.borderStyle.style){case Kd.SOLID:a.borderStyle=`solid`;break;case Kd.DASHED:a.borderStyle=`dashed`;break;case Kd.BEVELED:ef(`Unimplemented border style: beveled`);break;case Kd.INSET:ef(`Unimplemented border style: inset`);break;case Kd.UNDERLINE:a.borderBottomStyle=`solid`}let r=t.borderColor||null;r?(this.#t=!0,a.borderColor=Q.makeHexColor(r[0]|0,r[1]|0,r[2]|0)):a.borderWidth=0}let c=Q.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]),{pageWidth:l,pageHeight:u,pageX:d,pageY:f}=r.rawDims;a.left=`${100*(c[0]-d)/l}%`,a.top=`${100*(c[1]-f)/u}%`;let{rotation:p}=t;return t.hasOwnCanvas||p===0?(a.width=`${100*o/l}%`,a.height=`${100*s/u}%`):this.setRotation(p,i),i}setRotation(e,t=this.container){if(!this.data.rect)return;let{pageWidth:n,pageHeight:r}=this.parent.viewport.rawDims,{width:i,height:a}=Mh(this.data.rect),o,s;e%180==0?(o=100*i/n,s=100*a/r):(o=100*a/n,s=100*i/r),t.style.width=`${o}%`,t.style.height=`${s}%`,t.setAttribute(`data-main-rotation`,(360-e)%360)}get _commonActions(){let e=(e,t,n)=>{let r=n.detail[e],i=r[0],a=r.slice(1);n.target.style[t]=Th[`${i}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[t]:Th[`${i}_rgb`](a)})};return of(this,`_commonActions`,{display:e=>{let{display:t}=e.detail,n=t%2==1;this.container.style.visibility=n?`hidden`:`visible`,this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:t===1||t===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{let{hidden:t}=e.detail;this.container.style.visibility=t?`hidden`:`visible`,this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e(`bgColor`,`backgroundColor`,t)},fillColor:t=>{e(`fillColor`,`backgroundColor`,t)},fgColor:t=>{e(`fgColor`,`color`,t)},textColor:t=>{e(`textColor`,`color`,t)},borderColor:t=>{e(`borderColor`,`borderColor`,t)},strokeColor:t=>{e(`strokeColor`,`borderColor`,t)},rotation:e=>{let t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){let n=this._commonActions;for(let r of Object.keys(t.detail))(e[r]||n[r])?.(t)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;let t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;let n=this._commonActions;for(let[r,i]of Object.entries(t)){let a=n[r];a&&(a({detail:{[r]:i},target:e}),delete t[r])}}_createQuadrilaterals(){if(!this.container)return;let{quadPoints:e}=this.data;if(!e)return;let[t,n,r,i]=this.data.rect.map(e=>Math.fround(e));if(e.length===8){let[a,o,s,c]=e.subarray(2,6);if(r===a&&i===o&&t===s&&n===c)return}let{style:a}=this.container,o;if(this.#t){let{borderColor:e,borderWidth:t}=a;a.borderWidth=0,o=[`url('data:image/svg+xml;utf8,`,`<svg xmlns="http://www.w3.org/2000/svg"`,` preserveAspectRatio="none" viewBox="0 0 1 1">`,`<g fill="transparent" stroke="${e}" stroke-width="${t}">`],this.container.classList.add(`hasBorder`)}let s=r-t,c=i-n,{svgFactory:l}=this,u=l.createElement(`svg`);u.classList.add(`quadrilateralsContainer`),u.setAttribute(`width`,0),u.setAttribute(`height`,0);let d=l.createElement(`defs`);u.append(d);let f=l.createElement(`clipPath`),p=`clippath_${this.data.id}`;f.setAttribute(`id`,p),f.setAttribute(`clipPathUnits`,`objectBoundingBox`),d.append(f);for(let n=2,r=e.length;n<r;n+=8){let r=e[n],a=e[n+1],u=e[n+2],d=e[n+3],p=l.createElement(`rect`),m=(u-t)/s,h=(i-a)/c,g=(r-u)/s,_=(a-d)/c;p.setAttribute(`x`,m),p.setAttribute(`y`,h),p.setAttribute(`width`,g),p.setAttribute(`height`,_),f.append(p),o?.push(`<rect vector-effect="non-scaling-stroke" x="${m}" y="${h}" width="${g}" height="${_}"/>`)}this.#t&&(o.push(`</g></svg>')`),a.backgroundImage=o.join(``)),this.container.append(u),this.container.style.clipPath=`url(#${p})`}_createPopup(){let{data:e}=this,t=this.#n=new Wh({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]});this.parent.div.append(t.render())}render(){tf("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){let n=[];if(this._fieldObjects){let r=this._fieldObjects[e];if(r)for(let{page:e,id:i,exportValues:a}of r){if(e===-1||i===t)continue;let r=typeof a==`string`?a:null,o=document.querySelector(`[data-element-id="${i}"]`);o&&!jh.has(o)?ef(`_getElementsByName - element not allowed: ${i}`):n.push({id:i,exportValue:r,domElement:o})}return n}for(let r of document.getElementsByName(e)){let{exportValue:e}=r,i=r.getAttribute(`data-element-id`);i!==t&&jh.has(r)&&n.push({id:i,exportValue:e,domElement:r})}return n}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){let e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(let t of e)t.classList.add(`highlightArea`);else e.classList.add(`highlightArea`)}_editOnDoubleClick(){if(!this._isEditable)return;let{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener(`dblclick`,()=>{this.linkService.eventBus?.dispatch(`switchannotationeditormode`,{source:this,mode:e,editId:t})})}},Fh=class extends Ph{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){let{data:e,linkService:t}=this,n=document.createElement(`a`);n.setAttribute(`data-element-id`,e.id);let r=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(n,e.action),r=!0):e.attachment?(this.#t(n,e.attachment,e.attachmentDest),r=!0):e.setOCGState?(this.#n(n,e.setOCGState),r=!0):e.dest?(this._bindLink(n,e.dest),r=!0):(e.actions&&(e.actions.Action||e.actions[`Mouse Up`]||e.actions[`Mouse Down`])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),r=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(n,``),r=!0)),this.container.classList.add(`linkAnnotation`),r&&this.container.append(n),this.container}#e(){this.container.setAttribute(`data-internal-link`,``)}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||t===``)&&this.#e()}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(``),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),this.#e()}#t(e,t,n=null){e.href=this.linkService.getAnchorUrl(``),t.description&&(e.title=t.description),e.onclick=()=>(this.downloadManager?.openOrDownloadData(t.content,t.filename,n),!1),this.#e()}#n(e,t){e.href=this.linkService.getAnchorUrl(``),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),this.#e()}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl(``);let n=new Map([[`Action`,`onclick`],[`Mouse Up`,`onmouseup`],[`Mouse Down`,`onmousedown`]]);for(let r of Object.keys(t.actions)){let i=n.get(r);i&&(e[i]=()=>(this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t.id,name:r}}),!1))}e.onclick||=()=>!1,this.#e()}_bindResetFormAction(e,t){let n=e.onclick;n||(e.href=this.linkService.getAnchorUrl(``)),this.#e(),this._fieldObjects?e.onclick=()=>{n?.();let{fields:e,refs:r,include:i}=t,a=[];if(e.length!==0||r.length!==0){let t=new Set(r);for(let n of e){let e=this._fieldObjects[n]||[];for(let{id:n}of e)t.add(n)}for(let e of Object.values(this._fieldObjects))for(let n of e)t.has(n.id)===i&&a.push(n)}else for(let e of Object.values(this._fieldObjects))a.push(...e);let o=this.annotationStorage,s=[];for(let e of a){let{id:t}=e;switch(s.push(t),e.type){case`text`:{let n=e.defaultValue||``;o.setValue(t,{value:n});break}case`checkbox`:case`radiobutton`:{let n=e.defaultValue===e.exportValues;o.setValue(t,{value:n});break}case`combobox`:case`listbox`:{let n=e.defaultValue||``;o.setValue(t,{value:n});break}default:continue}let n=document.querySelector(`[data-element-id="${t}"]`);n&&(jh.has(n)?n.dispatchEvent(new Event(`resetform`)):ef(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:`app`,ids:s,name:`ResetForm`}}),!1}:(ef('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(e.onclick=()=>!1))}},Ih=class extends Ph{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add(`textAnnotation`);let e=document.createElement(`img`);return e.src=this.imageResourcesPath+`annotation-`+this.data.name.toLowerCase()+`.svg`,e.setAttribute(`data-l10n-id`,`pdfjs-text-annotation-type`),e.setAttribute(`data-l10n-args`,JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}},Lh=class extends Ph{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName===`CANVAS`&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return xf.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,n,r,i){n.includes(`mouse`)?e.addEventListener(n,e=>{this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:this.data.id,name:r,value:i(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})}):e.addEventListener(n,e=>{if(n===`blur`){if(!t.focused||!e.relatedTarget)return;t.focused=!1}else if(n===`focus`){if(t.focused)return;t.focused=!0}i&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:this.data.id,name:r,value:i(e)}})})}_setEventListeners(e,t,n,r){for(let[i,a]of n)(a===`Action`||this.data.actions?.[a])&&((a===`Focus`||a===`Blur`)&&(t||={focused:!1}),this._setEventListener(e,t,i,a,r),a===`Focus`&&!this.data.actions?.Blur?this._setEventListener(e,t,`blur`,`Blur`,null):a===`Blur`&&!this.data.actions?.Focus&&this._setEventListener(e,t,`focus`,`Focus`,null))}_setBackgroundColor(e){let t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?`transparent`:Q.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){let t=[`left`,`center`,`right`],{fontColor:n}=this.data.defaultAppearanceData,r=this.data.defaultAppearanceData.fontSize||Ah,i=e.style,a,o=e=>Math.round(10*e)/10;if(this.data.multiLine){let e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(Id*r))||1);a=Math.min(r,o(t/Id))}else{let e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(r,o(e/Id))}i.fontSize=`calc(${a}px * var(--scale-factor))`,i.color=Q.makeHexColor(n[0],n[1],n[2]),this.data.textAlignment!==null&&(i.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute(`required`,!0):e.removeAttribute(`required`),e.setAttribute(`aria-required`,t)}},Rh=class extends Lh{constructor(e){let t=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:t})}setPropertyOnSiblings(e,t,n,r){let i=this.annotationStorage;for(let a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[t]=n),i.setValue(a.id,{[r]:n})}render(){let e=this.annotationStorage,t=this.data.id;this.container.classList.add(`textWidgetAnnotation`);let n=null;if(this.renderForms){let r=e.getValue(t,{value:this.data.fieldValue}),i=r.value||``,a=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;a&&i.length>a&&(i=i.slice(0,a));let o=r.formattedValue||this.data.textContent?.join(`
265
+ `)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,``));let s={userValue:i,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement(`textarea`),n.textContent=o??i,this.data.doNotScroll&&(n.style.overflowY=`hidden`)):(n=document.createElement(`input`),n.type=`text`,n.setAttribute(`value`,o??i),this.data.doNotScroll&&(n.style.overflowX=`hidden`)),this.data.hasOwnCanvas&&(n.hidden=!0),jh.add(n),n.setAttribute(`data-element-id`,t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=kh,this._setRequired(n,this.data.required),a&&(n.maxLength=a),n.addEventListener(`input`,r=>{e.setValue(t,{value:r.target.value}),this.setPropertyOnSiblings(n,`value`,r.target.value,`value`),s.formattedValue=null}),n.addEventListener(`resetform`,e=>{let t=this.data.defaultFieldValue??``;n.value=s.userValue=t,s.formattedValue=null});let c=e=>{let{formattedValue:t}=s;t!=null&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener(`focus`,e=>{if(s.focused)return;let{target:t}=e;s.userValue&&(t.value=s.userValue),s.lastCommittedValue=t.value,s.commitKey=1,this.data.actions?.Focus||(s.focused=!0)}),n.addEventListener(`updatefromsandbox`,n=>{this.showElementAndHideCanvas(n.target),this._dispatchEventFromSandbox({value(n){s.userValue=n.detail.value??``,e.setValue(t,{value:s.userValue.toString()}),n.target.value=s.userValue},formattedValue(n){let{formattedValue:r}=n.detail;s.formattedValue=r,r!=null&&n.target!==document.activeElement&&(n.target.value=r),e.setValue(t,{formattedValue:r})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:n=>{let{charLimit:r}=n.detail,{target:i}=n;if(r===0){i.removeAttribute(`maxLength`);return}i.setAttribute(`maxLength`,r);let a=s.userValue;!a||a.length<=r||(a=a.slice(0,r),i.value=s.userValue=a,e.setValue(t,{value:a}),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:a,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}}))}},n)}),n.addEventListener(`keydown`,e=>{s.commitKey=1;let n=-1;if(e.key===`Escape`?n=0:e.key===`Enter`&&!this.data.multiLine?n=2:e.key===`Tab`&&(s.commitKey=3),n===-1)return;let{value:r}=e.target;s.lastCommittedValue!==r&&(s.lastCommittedValue=r,s.userValue=r,this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:r,willCommit:!0,commitKey:n,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))});let r=c;c=null,n.addEventListener(`blur`,e=>{if(!s.focused||!e.relatedTarget)return;this.data.actions?.Blur||(s.focused=!1);let{value:n}=e.target;s.userValue=n,s.lastCommittedValue!==n&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:n,willCommit:!0,commitKey:s.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}),r(e)}),this.data.actions?.Keystroke&&n.addEventListener(`beforeinput`,e=>{s.lastCommittedValue=null;let{data:n,target:r}=e,{value:i,selectionStart:a,selectionEnd:o}=r,c=a,l=o;switch(e.inputType){case`deleteWordBackward`:{let e=i.substring(0,a).match(/\w*[^\w]*$/);e&&(c-=e[0].length);break}case`deleteWordForward`:{let e=i.substring(a).match(/^[^\w]*\w*/);e&&(l+=e[0].length);break}case`deleteContentBackward`:a===o&&--c;break;case`deleteContentForward`:a===o&&(l+=1)}e.preventDefault(),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:i,change:n||``,willCommit:!1,selStart:c,selEnd:l}})}),this._setEventListeners(n,s,[[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`]],e=>e.target.value)}if(c&&n.addEventListener(`blur`,c),this.data.comb){let e=(this.data.rect[2]-this.data.rect[0])/a;n.classList.add(`comb`),n.style.letterSpacing=`calc(${e}px * var(--scale-factor) - 1ch)`}}else n=document.createElement(`div`),n.textContent=this.data.fieldValue,n.style.verticalAlign=`middle`,n.style.display=`table-cell`,this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}},zh=class extends Lh{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}},Bh=class extends Lh{constructor(e){super(e,{isRenderable:e.renderForms})}render(){let e=this.annotationStorage,t=this.data,n=t.id,r=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;typeof r==`string`&&(r=r!==`Off`,e.setValue(n,{value:r})),this.container.classList.add(`buttonWidgetAnnotation`,`checkBox`);let i=document.createElement(`input`);return jh.add(i),i.setAttribute(`data-element-id`,n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type=`checkbox`,i.name=t.fieldName,r&&i.setAttribute(`checked`,!0),i.setAttribute(`exportValue`,t.exportValue),i.tabIndex=kh,i.addEventListener(`change`,r=>{let{name:i,checked:a}=r.target;for(let r of this._getElementsByName(i,n)){let n=a&&r.exportValue===t.exportValue;r.domElement&&(r.domElement.checked=n),e.setValue(r.id,{value:n})}e.setValue(n,{value:a})}),i.addEventListener(`resetform`,e=>{let n=t.defaultFieldValue||`Off`;e.target.checked=n===t.exportValue}),this.enableScripting&&this.hasJSActions&&(i.addEventListener(`updatefromsandbox`,t=>{this._dispatchEventFromSandbox({value(t){t.target.checked=t.detail.value!==`Off`,e.setValue(n,{value:t.target.checked})}},t)}),this._setEventListeners(i,null,[[`change`,`Validate`],[`change`,`Action`],[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`]],e=>e.target.checked)),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},Vh=class extends Lh{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add(`buttonWidgetAnnotation`,`radioButton`);let e=this.annotationStorage,t=this.data,n=t.id,r=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;if(typeof r==`string`&&(r=r!==t.buttonValue,e.setValue(n,{value:r})),r)for(let r of this._getElementsByName(t.fieldName,n))e.setValue(r.id,{value:!1});let i=document.createElement(`input`);if(jh.add(i),i.setAttribute(`data-element-id`,n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type=`radio`,i.name=t.fieldName,r&&i.setAttribute(`checked`,!0),i.tabIndex=kh,i.addEventListener(`change`,t=>{let{name:r,checked:i}=t.target;for(let t of this._getElementsByName(r,n))e.setValue(t.id,{value:!1});e.setValue(n,{value:i})}),i.addEventListener(`resetform`,e=>{let n=t.defaultFieldValue;e.target.checked=n!=null&&n===t.buttonValue}),this.enableScripting&&this.hasJSActions){let r=t.buttonValue;i.addEventListener(`updatefromsandbox`,t=>{this._dispatchEventFromSandbox({value:t=>{let i=r===t.detail.value;for(let r of this._getElementsByName(t.target.name)){let t=i&&r.id===n;r.domElement&&(r.domElement.checked=t),e.setValue(r.id,{value:t})}}},t)}),this._setEventListeners(i,null,[[`change`,`Validate`],[`change`,`Action`],[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`]],e=>e.target.checked)}return this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},Hh=class extends Fh{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){let e=super.render();e.classList.add(`buttonWidgetAnnotation`,`pushButton`);let t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener(`updatefromsandbox`,e=>{this._dispatchEventFromSandbox({},e)})),e}},Uh=class extends Lh{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add(`choiceWidgetAnnotation`);let e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),r=document.createElement(`select`);jh.add(r),r.setAttribute(`data-element-id`,t),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=kh;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener(`resetform`,e=>{let t=this.data.defaultFieldValue;for(let e of r.options)e.selected=e.value===t});for(let e of this.data.options){let t=document.createElement(`option`);t.textContent=e.displayValue,t.value=e.exportValue,n.value.includes(e.exportValue)&&(t.setAttribute(`selected`,!0),i=!1),r.append(t)}let a=null;if(i){let e=document.createElement(`option`);e.value=` `,e.setAttribute(`hidden`,!0),e.setAttribute(`selected`,!0),r.prepend(e),a=()=>{e.remove(),r.removeEventListener(`input`,a),a=null},r.addEventListener(`input`,a)}let o=e=>{let t=e?`value`:`textContent`,{options:n,multiple:i}=r;return i?Array.prototype.filter.call(n,e=>e.selected).map(e=>e[t]):n.selectedIndex===-1?null:n[n.selectedIndex][t]},s=o(!1),c=e=>{let t=e.target.options;return Array.prototype.map.call(t,e=>({displayValue:e.textContent,exportValue:e.value}))};return this.enableScripting&&this.hasJSActions?(r.addEventListener(`updatefromsandbox`,n=>{this._dispatchEventFromSandbox({value(n){a?.();let i=n.detail.value,c=new Set(Array.isArray(i)?i:[i]);for(let e of r.options)e.selected=c.has(e.value);e.setValue(t,{value:o(!0)}),s=o(!1)},multipleSelection(e){r.multiple=!0},remove(n){let i=r.options,a=n.detail.remove;i[a].selected=!1,r.remove(a),i.length>0&&Array.prototype.findIndex.call(i,e=>e.selected)===-1&&(i[0].selected=!0),e.setValue(t,{value:o(!0),items:c(n)}),s=o(!1)},clear(n){for(;r.length!==0;)r.remove(0);e.setValue(t,{value:null,items:[]}),s=o(!1)},insert(n){let{index:i,displayValue:a,exportValue:l}=n.detail.insert,u=r.children[i],d=document.createElement(`option`);d.textContent=a,d.value=l,u?u.before(d):r.append(d),e.setValue(t,{value:o(!0),items:c(n)}),s=o(!1)},items(n){let{items:i}=n.detail;for(;r.length!==0;)r.remove(0);for(let e of i){let{displayValue:t,exportValue:n}=e,i=document.createElement(`option`);i.textContent=t,i.value=n,r.append(i)}r.options.length>0&&(r.options[0].selected=!0),e.setValue(t,{value:o(!0),items:c(n)}),s=o(!1)},indices(n){let r=new Set(n.detail.indices);for(let e of n.target.options)e.selected=r.has(e.index);e.setValue(t,{value:o(!0)}),s=o(!1)},editable(e){e.target.disabled=!e.detail.editable}},n)}),r.addEventListener(`input`,n=>{let r=o(!0),i=o(!1);e.setValue(t,{value:r}),n.preventDefault(),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:s,change:i,changeEx:r,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(r,null,[[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`],[`input`,`Action`],[`input`,`Validate`]],e=>e.target.value)):r.addEventListener(`input`,function(n){e.setValue(t,{value:o(!0)})}),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}},Wh=class extends Ph{constructor(e){let{data:t,elements:n}=e;super(e,{isRenderable:Ph._hasPopupData(t)}),this.elements=n,this.popup=null}render(){this.container.classList.add(`popupAnnotation`);let e=this.popup=new Gh({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),t=[];for(let n of this.elements)n.popup=e,n.container.ariaHasPopup=`dialog`,t.push(n.data.id),n.addHighlightArea();return this.container.setAttribute(`aria-controls`,t.map(e=>`${Of}${e}`).join(`,`)),this.container}},Gh=class{#e=this.#C.bind(this);#t=this.#D.bind(this);#n=this.#E.bind(this);#r=this.#T.bind(this);#i=null;#a=null;#o=null;#s=null;#c=null;#l=null;#u=null;#d=!1;#f=null;#p=null;#m=null;#h=null;#g=null;#_=null;#v=!1;constructor({container:e,color:t,elements:n,titleObj:r,modificationDate:i,contentsObj:a,richText:o,parent:s,rect:c,parentRect:l,open:u}){this.#a=e,this.#g=r,this.#o=a,this.#h=o,this.#l=s,this.#i=t,this.#m=c,this.#u=l,this.#c=n,this.#s=Uf.toDateObject(i),this.trigger=n.flatMap(e=>e.getElementsToTriggerPopup());for(let e of this.trigger)e.addEventListener(`click`,this.#r),e.addEventListener(`mouseenter`,this.#n),e.addEventListener(`mouseleave`,this.#t),e.classList.add(`popupTriggerArea`);for(let e of n)e.container?.addEventListener(`keydown`,this.#e);this.#a.hidden=!0,u&&this.#T()}render(){if(this.#f)return;let e=this.#f=document.createElement(`div`);if(e.className=`popup`,this.#i){let t=e.style.outlineColor=Q.makeHexColor(...this.#i);CSS.supports(`background-color`,`color-mix(in srgb, red 30%, white)`)?e.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`:e.style.backgroundColor=Q.makeHexColor(...this.#i.map(e=>Math.floor(.7*(255-e)+e)))}let t=document.createElement(`span`);t.className=`header`;let n=document.createElement(`h1`);if(t.append(n),{dir:n.dir,str:n.textContent}=this.#g,e.append(t),this.#s){let e=document.createElement(`span`);e.classList.add(`popupDate`),e.setAttribute(`data-l10n-id`,`pdfjs-annotation-date-time-string`),e.setAttribute(`data-l10n-args`,JSON.stringify({dateObj:this.#s.valueOf()})),t.append(e)}let r=this.#y;if(r)Oh.render({xfaHtml:r,intent:`richText`,div:e}),e.lastChild.classList.add(`richText`,`popupContent`);else{let t=this._formatContents(this.#o);e.append(t)}this.#a.append(e)}get#y(){let e=this.#h,t=this.#o;return e?.str&&(!t?.str||t.str===e.str)&&this.#h.html||null}get#b(){return this.#y?.attributes?.style?.fontSize||0}get#x(){return this.#y?.attributes?.style?.color||null}#S(e){let t=[],n={str:e,html:{name:`div`,attributes:{dir:`auto`},children:[{name:`p`,children:t}]}},r={style:{color:this.#x,fontSize:this.#b?`calc(${this.#b}px * var(--scale-factor))`:``}};for(let n of e.split(`
266
+ `))t.push({name:`span`,value:n,attributes:r});return n}_formatContents({str:e,dir:t}){let n=document.createElement(`p`);n.classList.add(`popupContent`),n.dir=t;let r=e.split(/(?:\r\n?|\n)/);for(let e=0,t=r.length;e<t;++e){let i=r[e];n.append(document.createTextNode(i)),e<t-1&&n.append(document.createElement(`br`))}return n}#C(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key===`Enter`||e.key===`Escape`&&this.#d)&&this.#T()}updateEdited({rect:e,popupContent:t}){this.#_||={contentsObj:this.#o,richText:this.#h},e&&(this.#p=null),t&&(this.#h=this.#S(t),this.#o=null),this.#f?.remove(),this.#f=null}resetEdited(){this.#_&&({contentsObj:this.#o,richText:this.#h}=this.#_,this.#_=null,this.#f?.remove(),this.#f=null,this.#p=null)}#w(){if(this.#p!==null)return;let{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:r,pageY:i}}}=this.#l,a=!!this.#u,o=a?this.#u:this.#m;for(let e of this.#c)if(!o||Q.intersect(e.data.rect,o)!==null){o=e.data.rect,a=!0;break}let s=Q.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),c=a?o[2]-o[0]+5:0,l=s[0]+c,u=s[1];this.#p=[100*(l-r)/t,100*(u-i)/n];let{style:d}=this.#a;d.left=`${this.#p[0]}%`,d.top=`${this.#p[1]}%`}#T(){this.#d=!this.#d,this.#d?(this.#E(),this.#a.addEventListener(`click`,this.#r),this.#a.addEventListener(`keydown`,this.#e)):(this.#D(),this.#a.removeEventListener(`click`,this.#r),this.#a.removeEventListener(`keydown`,this.#e))}#E(){this.#f||this.render(),this.isVisible?this.#d&&this.#a.classList.add(`focused`):(this.#w(),this.#a.hidden=!1,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)+1e3)}#D(){this.#a.classList.remove(`focused`),!(this.#d||!this.isVisible)&&(this.#a.hidden=!0,this.#a.style.zIndex=parseInt(this.#a.style.zIndex)-1e3)}forceHide(){this.#v=this.isVisible,this.#v&&(this.#a.hidden=!0)}maybeShow(){this.#v&&(this.#f||this.#E(),this.#v=!1,this.#a.hidden=!1)}get isVisible(){return this.#a.hidden===!1}},Kh=class extends Ph{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=Bd.FREETEXT}render(){if(this.container.classList.add(`freeTextAnnotation`),this.textContent){let e=document.createElement(`div`);e.classList.add(`annotationTextContent`),e.setAttribute(`role`,`comment`);for(let t of this.textContent){let n=document.createElement(`span`);n.textContent=t,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}},qh=class extends Ph{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add(`lineAnnotation`);let e=this.data,{width:t,height:n}=Mh(e.rect),r=this.svgFactory.create(t,n,!0),i=this.#e=this.svgFactory.createElement(`svg:line`);return i.setAttribute(`x1`,e.rect[2]-e.lineCoordinates[0]),i.setAttribute(`y1`,e.rect[3]-e.lineCoordinates[1]),i.setAttribute(`x2`,e.rect[2]-e.lineCoordinates[2]),i.setAttribute(`y2`,e.rect[3]-e.lineCoordinates[3]),i.setAttribute(`stroke-width`,e.borderStyle.width||1),i.setAttribute(`stroke`,`transparent`),i.setAttribute(`fill`,`transparent`),r.append(i),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},Jh=class extends Ph{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add(`squareAnnotation`);let e=this.data,{width:t,height:n}=Mh(e.rect),r=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,a=this.#e=this.svgFactory.createElement(`svg:rect`);return a.setAttribute(`x`,i/2),a.setAttribute(`y`,i/2),a.setAttribute(`width`,t-i),a.setAttribute(`height`,n-i),a.setAttribute(`stroke-width`,i||1),a.setAttribute(`stroke`,`transparent`),a.setAttribute(`fill`,`transparent`),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},Yh=class extends Ph{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add(`circleAnnotation`);let e=this.data,{width:t,height:n}=Mh(e.rect),r=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,a=this.#e=this.svgFactory.createElement(`svg:ellipse`);return a.setAttribute(`cx`,t/2),a.setAttribute(`cy`,n/2),a.setAttribute(`rx`,t/2-i/2),a.setAttribute(`ry`,n/2-i/2),a.setAttribute(`stroke-width`,i||1),a.setAttribute(`stroke`,`transparent`),a.setAttribute(`fill`,`transparent`),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},Xh=class extends Ph{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName=`polylineAnnotation`,this.svgElementName=`svg:polyline`}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,vertices:t,borderStyle:n,popupRef:r}}=this;if(!t)return this.container;let{width:i,height:a}=Mh(e),o=this.svgFactory.create(i,a,!0),s=[];for(let n=0,r=t.length;n<r;n+=2){let r=t[n]-e[0],i=e[3]-t[n+1];s.push(`${r},${i}`)}s=s.join(` `);let c=this.#e=this.svgFactory.createElement(this.svgElementName);return c.setAttribute(`points`,s),c.setAttribute(`stroke-width`,n.width||1),c.setAttribute(`stroke`,`transparent`),c.setAttribute(`fill`,`transparent`),o.append(c),this.container.append(o),!r&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},Zh=class extends Xh{constructor(e){super(e),this.containerClassName=`polygonAnnotation`,this.svgElementName=`svg:polygon`}},Qh=class extends Ph{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add(`caretAnnotation`),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}},$h=class extends Ph{#e=null;#t=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName=`inkAnnotation`,this.svgElementName=`svg:polyline`,this.annotationEditorType=this.data.it===`InkHighlight`?Bd.HIGHLIGHT:Bd.INK}#n(e,t){switch(e){case 90:return{transform:`rotate(90) translate(${-t[0]},${t[1]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};case 180:return{transform:`rotate(180) translate(${-t[2]},${t[1]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]};case 270:return{transform:`rotate(270) translate(${-t[2]},${t[3]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};default:return{transform:`translate(${-t[0]},${t[3]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]}}}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,rotation:t,inkLists:n,borderStyle:r,popupRef:i}}=this,{transform:a,width:o,height:s}=this.#n(t,e),c=this.svgFactory.create(o,s,!0),l=this.#e=this.svgFactory.createElement(`svg:g`);c.append(l),l.setAttribute(`stroke-width`,r.width||1),l.setAttribute(`stroke-linecap`,`round`),l.setAttribute(`stroke-linejoin`,`round`),l.setAttribute(`stroke-miterlimit`,10),l.setAttribute(`stroke`,`transparent`),l.setAttribute(`fill`,`transparent`),l.setAttribute(`transform`,a);for(let e=0,t=n.length;e<t;e++){let t=this.svgFactory.createElement(this.svgElementName);this.#t.push(t),t.setAttribute(`points`,n[e].join(`,`)),l.append(t)}return!i&&this.hasPopupData&&this._createPopup(),this.container.append(c),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);let{thickness:t,points:n,rect:r}=e,i=this.#e;if(t>=0&&i.setAttribute(`stroke-width`,t||1),n)for(let e=0,t=this.#t.length;e<t;e++)this.#t[e].setAttribute(`points`,n[e].join(`,`));if(r){let{transform:e,width:t,height:n}=this.#n(this.data.rotation,r);i.parentElement.setAttribute(`viewBox`,`0 0 ${t} ${n}`),i.setAttribute(`transform`,e)}}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add(`highlightArea`)}},eg=class extends Ph{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=Bd.HIGHLIGHT}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add(`highlightAnnotation`),this._editOnDoubleClick(),this.container}},tg=class extends Ph{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add(`underlineAnnotation`),this.container}},ng=class extends Ph{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add(`squigglyAnnotation`),this.container}},rg=class extends Ph{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add(`strikeoutAnnotation`),this.container}},ig=class extends Ph{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=Bd.STAMP}render(){return this.container.classList.add(`stampAnnotation`),this.container.setAttribute(`role`,`img`),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}},ag=class extends Ph{#e=null;constructor(e){super(e,{isRenderable:!0});let{file:t}=this.data;this.filename=t.filename,this.content=t.content,this.linkService.eventBus?.dispatch(`fileattachmentannotation`,{source:this,...t})}render(){this.container.classList.add(`fileAttachmentAnnotation`);let{container:e,data:t}=this,n;t.hasAppearance||t.fillAlpha===0?n=document.createElement(`div`):(n=document.createElement(`img`),n.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name)?`paperclip`:`pushpin`}.svg`,t.fillAlpha&&t.fillAlpha<1&&(n.style=`filter: opacity(${Math.round(t.fillAlpha*100)}%);`)),n.addEventListener(`dblclick`,this.#t.bind(this)),this.#e=n;let{isMac:r}=xf.platform;return e.addEventListener(`keydown`,e=>{e.key===`Enter`&&(r?e.metaKey:e.ctrlKey)&&this.#t()}),!t.popupRef&&this.hasPopupData?this._createPopup():n.classList.add(`popupTriggerArea`),e.append(n),e}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}#t(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}},og=class{#e=null;#t=null;#n=new Map;#r=null;constructor({div:e,accessibilityManager:t,annotationCanvasMap:n,annotationEditorUIManager:r,page:i,viewport:a,structTreeLayer:o}){this.div=e,this.#e=t,this.#t=n,this.#r=o||null,this.page=i,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=r}hasEditableAnnotations(){return this.#n.size>0}async#i(e,t){let n=e.firstChild||e,r=n.id=`${Of}${t}`,i=await this.#r?.getAriaAttributes(r);if(i)for(let[e,t]of i)n.setAttribute(e,t);this.div.append(e),this.#e?.moveElementInDOM(this.div,e,n,!1)}async render(e){let{annotations:t}=e,n=this.div;Yf(n,this.viewport);let r=new Map,i={data:null,layer:n,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||``,renderForms:e.renderForms!==!1,svgFactory:new Dh,annotationStorage:e.annotationStorage||new hp,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(let e of t){if(e.noHTML)continue;let t=e.annotationType===Gd.POPUP;if(t){let t=r.get(e.id);if(!t)continue;i.elements=t}else{let{width:t,height:n}=Mh(e.rect);if(t<=0||n<=0)continue}i.data=e;let n=Nh.create(i);if(!n.isRenderable)continue;if(!t&&e.popupRef){let t=r.get(e.popupRef);t?t.push(n):r.set(e.popupRef,[n])}let a=n.render();e.hidden&&(a.style.visibility=`hidden`),await this.#i(a,e.id),n._isEditable&&(this.#n.set(n.data.id,n),this._annotationEditorUIManager?.renderAnnotationElement(n))}this.#a()}update({viewport:e}){let t=this.div;this.viewport=e,Yf(t,{rotation:e.rotation}),this.#a(),t.hidden=!1}#a(){if(!this.#t)return;let e=this.div;for(let[t,n]of this.#t){let r=e.querySelector(`[data-annotation-id="${t}"]`);if(!r)continue;n.className=`annotationContent`;let{firstChild:i}=r;i?i.nodeName===`CANVAS`?i.replaceWith(n):i.classList.contains(`annotationContent`)?i.after(n):i.before(n):r.append(n)}this.#t.clear()}getEditableAnnotations(){return Array.from(this.#n.values())}getEditableAnnotation(e){return this.#n.get(e)}},sg=/\r\n?|\n/g,cg=class e extends cp{#e;#t=``;#n=`${this.id}-editor`;#r=null;#i;static _freeTextDefaultContent=``;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){let t=e.prototype,n=e=>e.isEmpty(),r=ap.TRANSLATE_SMALL,i=ap.TRANSLATE_BIG;return of(this,`_keyboardManager`,new rp([[[`ctrl+s`,`mac+meta+s`,`ctrl+p`,`mac+meta+p`],t.commitOrRemove,{bubbles:!0}],[[`ctrl+Enter`,`mac+meta+Enter`,`Escape`,`mac+Escape`],t.commitOrRemove],[[`ArrowLeft`,`mac+ArrowLeft`],t._translateEmpty,{args:[-r,0],checker:n}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t._translateEmpty,{args:[-i,0],checker:n}],[[`ArrowRight`,`mac+ArrowRight`],t._translateEmpty,{args:[r,0],checker:n}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t._translateEmpty,{args:[i,0],checker:n}],[[`ArrowUp`,`mac+ArrowUp`],t._translateEmpty,{args:[0,-r],checker:n}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t._translateEmpty,{args:[0,-i],checker:n}],[[`ArrowDown`,`mac+ArrowDown`],t._translateEmpty,{args:[0,r],checker:n}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t._translateEmpty,{args:[0,i],checker:n}]]))}static _type=`freetext`;static _editorType=Bd.FREETEXT;constructor(t){super({...t,name:`freeTextEditor`}),this.#e=t.color||e._defaultColor||cp._defaultLineColor,this.#i=t.fontSize||e._defaultFontSize}static initialize(e,t){cp.initialize(e,t);let n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue(`--freetext-padding`))}static updateDefaultParams(t,n){switch(t){case Vd.FREETEXT_SIZE:e._defaultFontSize=n;break;case Vd.FREETEXT_COLOR:e._defaultColor=n}}updateParams(e,t){switch(e){case Vd.FREETEXT_SIZE:this.#a(t);break;case Vd.FREETEXT_COLOR:this.#o(t)}}static get defaultPropertiesToUpdate(){return[[Vd.FREETEXT_SIZE,e._defaultFontSize],[Vd.FREETEXT_COLOR,e._defaultColor||cp._defaultLineColor]]}get propertiesToUpdate(){return[[Vd.FREETEXT_SIZE,this.#i],[Vd.FREETEXT_COLOR,this.#e]]}#a(e){let t=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--scale-factor))`,this.translate(0,-(e-this.#i)*this.parentScale),this.#i=e,this.#c()},n=this.#i;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Vd.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#o(e){let t=e=>{this.#e=this.editorDiv.style.color=e},n=this.#e;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Vd.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){let t=this.parentScale;return[-e._internalPadding*t,-(e._internalPadding+this.#i)*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(Bd.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove(`enabled`),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute(`aria-activedescendant`),this.#r=new AbortController;let e=this._uiManager.combinedSignal(this.#r);this.editorDiv.addEventListener(`keydown`,this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener(`focus`,this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener(`blur`,this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener(`input`,this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener(`paste`,this.editorDivPaste.bind(this),{signal:e})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add(`enabled`),this.editorDiv.contentEditable=!1,this.div.setAttribute(`aria-activedescendant`,this.#n),this._isDraggable=!0,this.#r?.abort(),this.#r=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add(`freetextEditing`))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){this.width||(this.enableEditMode(),e&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===``}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add(`freetextEditing`)),super.remove()}#s(){let t=[];this.editorDiv.normalize();let n=null;for(let r of this.editorDiv.childNodes)(n?.nodeType!==Node.TEXT_NODE||r.nodeName!==`BR`)&&(t.push(e.#l(r)),n=r);return t.join(`
267
+ `)}#c(){let[e,t]=this.parentDimensions,n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{let{currentLayer:e,div:t}=this,r=t.style.display,i=t.classList.contains(`hidden`);t.classList.remove(`hidden`),t.style.display=`hidden`,e.div.append(this.div),n=t.getBoundingClientRect(),t.remove(),t.style.display=r,t.classList.toggle(`hidden`,i)}this.rotation%180==this.parentRotation%180?(this.width=n.width/e,this.height=n.height/t):(this.width=n.height/e,this.height=n.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let e=this.#t,t=this.#t=this.#s().trimEnd();if(e===t)return;let n=e=>{this.#t=e,e?(this.#u(),this._uiManager.rebuild(this),this.#c()):this.remove()};this.addCommands({cmd:()=>{n(t)},undo:()=>{n(e)},mustExec:!1}),this.#c()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(e){this.enterInEditMode()}keydown(e){e.target===this.div&&e.key===`Enter`&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(t){e._keyboardManager.exec(this,t)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle(`freetextEditing`,this.isEmpty())}disableEditing(){this.editorDiv.setAttribute(`role`,`comment`),this.editorDiv.removeAttribute(`aria-multiline`)}enableEditing(){this.editorDiv.setAttribute(`role`,`textbox`),this.editorDiv.setAttribute(`aria-multiline`,!0)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement(`div`),this.editorDiv.className=`internal`,this.editorDiv.setAttribute(`id`,this.#n),this.editorDiv.setAttribute(`data-l10n-id`,`pdfjs-free-text2`),this.editorDiv.setAttribute(`data-l10n-attrs`,`default-content`),this.enableEditing(),this.editorDiv.contentEditable=!0;let{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#i}px * var(--scale-factor))`,n.color=this.#e,this.div.append(this.editorDiv),this.overlayDiv=document.createElement(`div`),this.overlayDiv.classList.add(`overlay`,`enabled`),this.div.append(this.overlayDiv),$f(this,this.div,[`dblclick`,`keydown`]),this.width){let[n,r]=this.parentDimensions;if(this.annotationElementId){let{position:i}=this._initialData,[a,o]=this.getInitialTranslation();[a,o]=this.pageTranslationToScreen(a,o);let[s,c]=this.pageDimensions,[l,u]=this.pageTranslation,d,f;switch(this.rotation){case 0:d=e+(i[0]-l)/s,f=t+this.height-(i[1]-u)/c;break;case 90:d=e+(i[0]-l)/s,f=t-(i[1]-u)/c,[a,o]=[o,-a];break;case 180:d=e-this.width+(i[0]-l)/s,f=t-(i[1]-u)/c,[a,o]=[-a,-o];break;case 270:d=e+(i[0]-l-this.height*c)/s,f=t+(i[1]-u-this.width*s)/c,[a,o]=[-o,a]}this.setAt(d*n,f*r,a,o)}else this.setAt(e*n,t*r,this.width*n,this.height*r);this.#u(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#l(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(sg,``)}editorDivPaste(t){let n=t.clipboardData||window.clipboardData,{types:r}=n;if(r.length===1&&r[0]===`text/plain`)return;t.preventDefault();let i=e.#f(n.getData(`text`)||``).replaceAll(sg,`
268
+ `);if(!i)return;let a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();let o=a.getRangeAt(0);if(!i.includes(`
269
+ `)){o.insertNode(document.createTextNode(i)),this.editorDiv.normalize(),a.collapseToStart();return}let{startContainer:s,startOffset:c}=o,l=[],u=[];if(s.nodeType===Node.TEXT_NODE){let t=s.parentElement;if(u.push(s.nodeValue.slice(c).replaceAll(sg,``)),t!==this.editorDiv){let n=l;for(let r of this.editorDiv.childNodes)r===t?n=u:n.push(e.#l(r))}l.push(s.nodeValue.slice(0,c).replaceAll(sg,``))}else if(s===this.editorDiv){let t=l,n=0;for(let r of this.editorDiv.childNodes)n++===c&&(t=u),t.push(e.#l(r))}this.#t=`${l.join(`
270
+ `)}${i}${u.join(`
271
+ `)}`,this.#u();let d=new Range,f=l.reduce((e,t)=>e+t.length,0);for(let{firstChild:e}of this.editorDiv.childNodes)if(e.nodeType===Node.TEXT_NODE){let t=e.nodeValue.length;if(f<=t){d.setStart(e,f),d.setEnd(e,f);break}f-=t}a.removeAllRanges(),a.addRange(d)}#u(){if(this.editorDiv.replaceChildren(),this.#t)for(let e of this.#t.split(`
272
+ `)){let t=document.createElement(`div`);t.append(e?document.createTextNode(e):document.createElement(`br`)),this.editorDiv.append(t)}}#d(){return this.#t.replaceAll(`\xA0`,` `)}static#f(e){return e.replaceAll(` `,`\xA0`)}get contentDiv(){return this.editorDiv}static async deserialize(t,n,r){let i=null;if(t instanceof Kh){let{data:{defaultAppearanceData:{fontSize:e,fontColor:n},rect:r,rotation:a,id:o,popupRef:s},textContent:c,textPosition:l,parent:{page:{pageNumber:u}}}=t;if(!c||c.length===0)return null;i=t={annotationType:Bd.FREETEXT,color:Array.from(n),fontSize:e,value:c.join(`
273
+ `),position:l,pageIndex:u-1,rect:r.slice(0),rotation:a,id:o,deleted:!1,popupRef:s}}let a=await super.deserialize(t,n,r);return a.#i=t.fontSize,a.#e=Q.makeHexColor(...t.color),a.#t=e.#f(t.value),a.annotationElementId=t.id||null,a._initialData=i,a}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let n=e._internalPadding*this.parentScale,r=this.getRect(n,n),i=cp._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#e),a={annotationType:Bd.FREETEXT,color:i,fontSize:this.#i,value:this.#d(),pageIndex:this.pageIndex,rect:r,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?a:this.annotationElementId&&!this.#p(a)?null:(a.id=this.annotationElementId,a)}#p(e){let{value:t,fontSize:n,color:r,pageIndex:i}=this._initialData;return this._hasBeenMoved||e.value!==t||e.fontSize!==n||e.color.some((e,t)=>e!==r[t])||e.pageIndex!==i}renderAnnotationElement(t){let n=super.renderAnnotationElement(t);if(this.deleted)return n;let{style:r}=n;r.fontSize=`calc(${this.#i}px * var(--scale-factor))`,r.color=this.#e,n.replaceChildren();for(let e of this.#t.split(`
274
+ `)){let t=document.createElement(`div`);t.append(e?document.createTextNode(e):document.createElement(`br`)),n.append(t)}let i=e._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(i,i),popupContent:this.#t}),n}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}},$=class{static PRECISION=1e-4;toSVGPath(){tf("Abstract method `toSVGPath` must be implemented.")}get box(){tf("Abstract getter `box` must be implemented.")}serialize(e,t){tf("Abstract method `serialize` must be implemented.")}static _rescale(e,t,n,r,i,a){a||=new Float32Array(e.length);for(let o=0,s=e.length;o<s;o+=2)a[o]=t+e[o]*r,a[o+1]=n+e[o+1]*i;return a}static _rescaleAndSwap(e,t,n,r,i,a){a||=new Float32Array(e.length);for(let o=0,s=e.length;o<s;o+=2)a[o]=t+e[o+1]*r,a[o+1]=n+e[o]*i;return a}static _translate(e,t,n,r){r||=new Float32Array(e.length);for(let i=0,a=e.length;i<a;i+=2)r[i]=t+e[i],r[i+1]=n+e[i+1];return r}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,n,r,i){switch(i){case 90:return[1-t/n,e/r];case 180:return[1-e/n,1-t/r];case 270:return[t/n,1-e/r];default:return[e/n,t/r]}}static _normalizePagePoint(e,t,n){switch(n){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}static createBezierPoints(e,t,n,r,i,a){return[(e+5*n)/6,(t+5*r)/6,(5*n+i)/6,(5*r+a)/6,(n+i)/2,(r+a)/2]}},lg=class e{#e;#t=[];#n;#r;#i=[];#a=new Float32Array(18);#o;#s;#c;#l;#u;#d;#f=[];static#p=8;static#m=2;static#h=e.#p+e.#m;constructor({x:t,y:n},r,i,a,o,s=0){this.#e=r,this.#d=a*i,this.#r=o,this.#a.set([NaN,NaN,NaN,NaN,t,n],6),this.#n=s,this.#l=e.#p*i,this.#c=e.#h*i,this.#u=i,this.#f.push(t,n)}isEmpty(){return isNaN(this.#a[8])}#g(){let e=this.#a.subarray(4,6),t=this.#a.subarray(16,18),[n,r,i,a]=this.#e;return[(this.#o+(e[0]-t[0])/2-n)/i,(this.#s+(e[1]-t[1])/2-r)/a,(this.#o+(t[0]-e[0])/2-n)/i,(this.#s+(t[1]-e[1])/2-r)/a]}add({x:e,y:t}){this.#o=e,this.#s=t;let[n,r,i,a]=this.#e,[o,s,c,l]=this.#a.subarray(8,12),u=e-c,d=t-l,f=Math.hypot(u,d);if(f<this.#c)return!1;let p=f-this.#l,m=p/f,h=m*u,g=m*d,_=o,v=s;o=c,s=l,c+=h,l+=g,this.#f?.push(e,t);let y=-g/p,b=h/p,x=y*this.#d,S=b*this.#d;return this.#a.set(this.#a.subarray(2,8),0),this.#a.set([c+x,l+S],4),this.#a.set(this.#a.subarray(14,18),12),this.#a.set([c-x,l-S],16),isNaN(this.#a[6])?(this.#i.length===0&&(this.#a.set([o+x,s+S],2),this.#i.push(NaN,NaN,NaN,NaN,(o+x-n)/i,(s+S-r)/a),this.#a.set([o-x,s-S],14),this.#t.push(NaN,NaN,NaN,NaN,(o-x-n)/i,(s-S-r)/a)),this.#a.set([_,v,o,s,c,l],6),!this.isEmpty()):(this.#a.set([_,v,o,s,c,l],6),Math.abs(Math.atan2(v-s,_-o)-Math.atan2(g,h))<Math.PI/2?([o,s,c,l]=this.#a.subarray(2,6),this.#i.push(NaN,NaN,NaN,NaN,((o+c)/2-n)/i,((s+l)/2-r)/a),[o,s,_,v]=this.#a.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((_+o)/2-n)/i,((v+s)/2-r)/a),!0):([_,v,o,s,c,l]=this.#a.subarray(0,6),this.#i.push(((_+5*o)/6-n)/i,((v+5*s)/6-r)/a,((5*o+c)/6-n)/i,((5*s+l)/6-r)/a,((o+c)/2-n)/i,((s+l)/2-r)/a),[c,l,o,s,_,v]=this.#a.subarray(12,18),this.#t.push(((_+5*o)/6-n)/i,((v+5*s)/6-r)/a,((5*o+c)/6-n)/i,((5*s+l)/6-r)/a,((o+c)/2-n)/i,((s+l)/2-r)/a),!0))}toSVGPath(){if(this.isEmpty())return``;let e=this.#i,t=this.#t;if(isNaN(this.#a[6])&&!this.isEmpty())return this.#_();let n=[];n.push(`M${e[4]} ${e[5]}`);for(let t=6;t<e.length;t+=6)isNaN(e[t])?n.push(`L${e[t+4]} ${e[t+5]}`):n.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);this.#y(n);for(let e=t.length-6;e>=6;e-=6)isNaN(t[e])?n.push(`L${t[e+4]} ${t[e+5]}`):n.push(`C${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${t[e+5]}`);return this.#v(n),n.join(` `)}#_(){let[e,t,n,r]=this.#e,[i,a,o,s]=this.#g();return`M${(this.#a[2]-e)/n} ${(this.#a[3]-t)/r} L${(this.#a[4]-e)/n} ${(this.#a[5]-t)/r} L${i} ${a} L${o} ${s} L${(this.#a[16]-e)/n} ${(this.#a[17]-t)/r} L${(this.#a[14]-e)/n} ${(this.#a[15]-t)/r} Z`}#v(e){let t=this.#t;e.push(`L${t[4]} ${t[5]} Z`)}#y(e){let[t,n,r,i]=this.#e,a=this.#a.subarray(4,6),o=this.#a.subarray(16,18),[s,c,l,u]=this.#g();e.push(`L${(a[0]-t)/r} ${(a[1]-n)/i} L${s} ${c} L${l} ${u} L${(o[0]-t)/r} ${(o[1]-n)/i}`)}newFreeDrawOutline(e,t,n,r,i,a){return new ug(e,t,n,r,i,a)}getOutlines(){let e=this.#i,t=this.#t,n=this.#a,[r,i,a,o]=this.#e,s=new Float32Array((this.#f?.length??0)+2);for(let e=0,t=s.length-2;e<t;e+=2)s[e]=(this.#f[e]-r)/a,s[e+1]=(this.#f[e+1]-i)/o;if(s[s.length-2]=(this.#o-r)/a,s[s.length-1]=(this.#s-i)/o,isNaN(n[6])&&!this.isEmpty())return this.#b(s);let c=new Float32Array(this.#i.length+24+this.#t.length),l=e.length;for(let t=0;t<l;t+=2)isNaN(e[t])?c[t]=c[t+1]=NaN:(c[t]=e[t],c[t+1]=e[t+1]);l=this.#S(c,l);for(let e=t.length-6;e>=6;e-=6)for(let n=0;n<6;n+=2)isNaN(t[e+n])?(c[l]=c[l+1]=NaN,l+=2):(c[l]=t[e+n],c[l+1]=t[e+n+1],l+=2);return this.#x(c,l),this.newFreeDrawOutline(c,s,this.#e,this.#u,this.#n,this.#r)}#b(e){let t=this.#a,[n,r,i,a]=this.#e,[o,s,c,l]=this.#g(),u=new Float32Array(36);return u.set([NaN,NaN,NaN,NaN,(t[2]-n)/i,(t[3]-r)/a,NaN,NaN,NaN,NaN,(t[4]-n)/i,(t[5]-r)/a,NaN,NaN,NaN,NaN,o,s,NaN,NaN,NaN,NaN,c,l,NaN,NaN,NaN,NaN,(t[16]-n)/i,(t[17]-r)/a,NaN,NaN,NaN,NaN,(t[14]-n)/i,(t[15]-r)/a],0),this.newFreeDrawOutline(u,e,this.#e,this.#u,this.#n,this.#r)}#x(e,t){let n=this.#t;return e.set([NaN,NaN,NaN,NaN,n[4],n[5]],t),t+=6}#S(e,t){let n=this.#a.subarray(4,6),r=this.#a.subarray(16,18),[i,a,o,s]=this.#e,[c,l,u,d]=this.#g();return e.set([NaN,NaN,NaN,NaN,(n[0]-i)/o,(n[1]-a)/s,NaN,NaN,NaN,NaN,c,l,NaN,NaN,NaN,NaN,u,d,NaN,NaN,NaN,NaN,(r[0]-i)/o,(r[1]-a)/s],t),t+=24}},ug=class extends ${#e;#t=new Float32Array(4);#n;#r;#i;#a;#o;constructor(e,t,n,r,i,a){super(),this.#o=e,this.#i=t,this.#e=n,this.#a=r,this.#n=i,this.#r=a,this.lastPoint=[NaN,NaN],this.#s(a);let[o,s,c,l]=this.#t;for(let t=0,n=e.length;t<n;t+=2)e[t]=(e[t]-o)/c,e[t+1]=(e[t+1]-s)/l;for(let e=0,n=t.length;e<n;e+=2)t[e]=(t[e]-o)/c,t[e+1]=(t[e+1]-s)/l}toSVGPath(){let e=[`M${this.#o[4]} ${this.#o[5]}`];for(let t=6,n=this.#o.length;t<n;t+=6)isNaN(this.#o[t])?e.push(`L${this.#o[t+4]} ${this.#o[t+5]}`):e.push(`C${this.#o[t]} ${this.#o[t+1]} ${this.#o[t+2]} ${this.#o[t+3]} ${this.#o[t+4]} ${this.#o[t+5]}`);return e.push(`Z`),e.join(` `)}serialize([e,t,n,r],i){let a=n-e,o=r-t,s,c;switch(i){case 0:s=$._rescale(this.#o,e,r,a,-o),c=$._rescale(this.#i,e,r,a,-o);break;case 90:s=$._rescaleAndSwap(this.#o,e,t,a,o),c=$._rescaleAndSwap(this.#i,e,t,a,o);break;case 180:s=$._rescale(this.#o,n,t,-a,o),c=$._rescale(this.#i,n,t,-a,o);break;case 270:s=$._rescaleAndSwap(this.#o,n,r,-a,-o),c=$._rescaleAndSwap(this.#i,n,r,-a,-o)}return{outline:Array.from(s),points:[Array.from(c)]}}#s(e){let t=this.#o,n=t[4],r=t[5],i=n,a=r,o=n,s=r,c=n,l=r,u=e?Math.max:Math.min;for(let e=6,d=t.length;e<d;e+=6){if(isNaN(t[e]))i=Math.min(i,t[e+4]),a=Math.min(a,t[e+5]),o=Math.max(o,t[e+4]),s=Math.max(s,t[e+5]),l<t[e+5]?(c=t[e+4],l=t[e+5]):l===t[e+5]&&(c=u(c,t[e+4]));else{let d=Q.bezierBoundingBox(n,r,...t.slice(e,e+6));i=Math.min(i,d[0]),a=Math.min(a,d[1]),o=Math.max(o,d[2]),s=Math.max(s,d[3]),l<d[3]?(c=d[2],l=d[3]):l===d[3]&&(c=u(c,d[2]))}n=t[e+4],r=t[e+5]}let d=this.#t;d[0]=i-this.#n,d[1]=a-this.#n,d[2]=o-i+2*this.#n,d[3]=s-a+2*this.#n,this.lastPoint=[c,l]}get box(){return this.#t}newOutliner(e,t,n,r,i,a=0){return new lg(e,t,n,r,i,a)}getNewOutline(e,t){let[n,r,i,a]=this.#t,[o,s,c,l]=this.#e,u=i*c,d=a*l,f=n*c+o,p=r*l+s,m=this.newOutliner({x:this.#i[0]*u+f,y:this.#i[1]*d+p},this.#e,this.#a,e,this.#r,t??this.#n);for(let e=2;e<this.#i.length;e+=2)m.add({x:this.#i[e]*u+f,y:this.#i[e+1]*d+p});return m.getOutlines()}},dg=class{#e;#t;#n=[];#r=[];constructor(e,t=0,n=0,r=!0){let i=1/0,a=-1/0,o=1/0,s=-1/0,c=10**-4;for(let{x:n,y:r,width:l,height:u}of e){let e=Math.floor((n-t)/c)*c,d=Math.ceil((n+l+t)/c)*c,f=Math.floor((r-t)/c)*c,p=Math.ceil((r+u+t)/c)*c,m=[e,f,p,!0],h=[d,f,p,!1];this.#n.push(m,h),i=Math.min(i,e),a=Math.max(a,d),o=Math.min(o,f),s=Math.max(s,p)}let l=a-i+2*n,u=s-o+2*n,d=i-n,f=o-n,p=this.#n.at(r?-1:-2),m=[p[0],p[2]];for(let e of this.#n){let[t,n,r]=e;e[0]=(t-d)/l,e[1]=(n-f)/u,e[2]=(r-f)/u}this.#e=new Float32Array([d,f,l,u]),this.#t=m}getOutlines(){this.#n.sort((e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2]);let e=[];for(let t of this.#n)t[3]?(e.push(...this.#c(t)),this.#o(t)):(this.#s(t),e.push(...this.#c(t)));return this.#i(e)}#i(e){let t=[],n=new Set;for(let n of e){let[e,r,i]=n;t.push([e,r,n],[e,i,n])}t.sort((e,t)=>e[1]-t[1]||e[0]-t[0]);for(let e=0,r=t.length;e<r;e+=2){let r=t[e][2],i=t[e+1][2];r.push(i),i.push(r),n.add(r),n.add(i)}let r=[],i;for(;n.size>0;){let e=n.values().next().value,[t,a,o,s,c]=e;n.delete(e);let l=t,u=a;for(i=[t,o],r.push(i);;){let e;if(n.has(s))e=s;else if(n.has(c))e=c;else break;n.delete(e),[t,a,o,s,c]=e,l!==t&&(i.push(l,u,t,u===a?a:o),l=t),u=u===a?o:a}i.push(l,u)}return new fg(r,this.#e,this.#t)}#a(e){let t=this.#r,n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i][0];if(a===e)return i;a<e?n=i+1:r=i-1}return r+1}#o([,e,t]){let n=this.#a(e);this.#r.splice(n,0,[e,t])}#s([,e,t]){let n=this.#a(e);for(let r=n;r<this.#r.length;r++){let[n,i]=this.#r[r];if(n!==e)break;if(n===e&&i===t){this.#r.splice(r,1);return}}for(let r=n-1;r>=0;r--){let[n,i]=this.#r[r];if(n!==e)break;if(n===e&&i===t){this.#r.splice(r,1);return}}}#c(e){let[t,n,r]=e,i=[[t,n,r]],a=this.#a(r);for(let e=0;e<a;e++){let[n,r]=this.#r[e];for(let e=0,a=i.length;e<a;e++){let[,o,s]=i[e];if(!(r<=o||s<=n)){if(o>=n){if(s>r)i[e][1]=r;else{if(a===1)return[];i.splice(e,1),e--,a--}}else i[e][2]=n,s>r&&i.push([t,r,s])}}}return i}},fg=class extends ${#e;#t;constructor(e,t,n){super(),this.#t=e,this.#e=t,this.lastPoint=n}toSVGPath(){let e=[];for(let t of this.#t){let[n,r]=t;e.push(`M${n} ${r}`);for(let i=2;i<t.length;i+=2){let a=t[i],o=t[i+1];a===n?(e.push(`V${o}`),r=o):o===r&&(e.push(`H${a}`),n=a)}e.push(`Z`)}return e.join(` `)}serialize([e,t,n,r],i){let a=[],o=n-e,s=r-t;for(let t of this.#t){let n=Array(t.length);for(let i=0;i<t.length;i+=2)n[i]=e+t[i]*o,n[i+1]=r-t[i+1]*s;a.push(n)}return a}get box(){return this.#e}get classNamesForOutlining(){return[`highlightOutline`]}},pg=class extends lg{newFreeDrawOutline(e,t,n,r,i,a){return new mg(e,t,n,r,i,a)}},mg=class extends ug{newOutliner(e,t,n,r,i,a=0){return new pg(e,t,n,r,i,a)}},hg=class e{#e=null;#t=null;#n;#r=null;#i=!1;#a=!1;#o=null;#s;#c=null;#l=null;#u;static#d=null;static get _keyboardManager(){return of(this,`_keyboardManager`,new rp([[[`Escape`,`mac+Escape`],e.prototype._hideDropdownFromKeyboard],[[` `,`mac+ `],e.prototype._colorSelectFromKeyboard],[[`ArrowDown`,`ArrowRight`,`mac+ArrowDown`,`mac+ArrowRight`],e.prototype._moveToNext],[[`ArrowUp`,`ArrowLeft`,`mac+ArrowUp`,`mac+ArrowLeft`],e.prototype._moveToPrevious],[[`Home`,`mac+Home`],e.prototype._moveToBeginning],[[`End`,`mac+End`],e.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:n=null}){t?(this.#a=!1,this.#u=Vd.HIGHLIGHT_COLOR,this.#o=t):(this.#a=!0,this.#u=Vd.HIGHLIGHT_DEFAULT_COLOR),this.#l=t?._uiManager||n,this.#s=this.#l._eventBus,this.#n=t?.color||this.#l?.highlightColors.values().next().value||`#FFFF98`,e.#d||=Object.freeze({blue:`pdfjs-editor-colorpicker-blue`,green:`pdfjs-editor-colorpicker-green`,pink:`pdfjs-editor-colorpicker-pink`,red:`pdfjs-editor-colorpicker-red`,yellow:`pdfjs-editor-colorpicker-yellow`})}renderButton(){let e=this.#e=document.createElement(`button`);e.className=`colorPicker`,e.tabIndex=`0`,e.setAttribute(`data-l10n-id`,`pdfjs-editor-colorpicker-button`),e.setAttribute(`aria-haspopup`,!0);let t=this.#l._signal;e.addEventListener(`click`,this.#h.bind(this),{signal:t}),e.addEventListener(`keydown`,this.#m.bind(this),{signal:t});let n=this.#t=document.createElement(`span`);return n.className=`swatch`,n.setAttribute(`aria-hidden`,!0),n.style.backgroundColor=this.#n,e.append(n),e}renderMainDropdown(){let e=this.#r=this.#f();return e.setAttribute(`aria-orientation`,`horizontal`),e.setAttribute(`aria-labelledby`,`highlightColorPickerLabel`),e}#f(){let t=document.createElement(`div`),n=this.#l._signal;t.addEventListener(`contextmenu`,Vf,{signal:n}),t.className=`dropdown`,t.role=`listbox`,t.setAttribute(`aria-multiselectable`,!1),t.setAttribute(`aria-orientation`,`vertical`),t.setAttribute(`data-l10n-id`,`pdfjs-editor-colorpicker-dropdown`);for(let[r,i]of this.#l.highlightColors){let a=document.createElement(`button`);a.tabIndex=`0`,a.role=`option`,a.setAttribute(`data-color`,i),a.title=r,a.setAttribute(`data-l10n-id`,e.#d[r]);let o=document.createElement(`span`);a.append(o),o.className=`swatch`,o.style.backgroundColor=i,a.setAttribute(`aria-selected`,i===this.#n),a.addEventListener(`click`,this.#p.bind(this,i),{signal:n}),t.append(a)}return t.addEventListener(`keydown`,this.#m.bind(this),{signal:n}),t}#p(e,t){t.stopPropagation(),this.#s.dispatch(`switchannotationeditorparams`,{source:this,type:this.#u,value:e})}_colorSelectFromKeyboard(e){if(e.target===this.#e){this.#h(e);return}let t=e.target.getAttribute(`data-color`);t&&this.#p(t,e)}_moveToNext(e){this.#_?e.target===this.#e?this.#r.firstChild?.focus():e.target.nextSibling?.focus():this.#h(e)}_moveToPrevious(e){e.target===this.#r?.firstChild||e.target===this.#e?this.#_&&this._hideDropdownFromKeyboard():(this.#_||this.#h(e),e.target.previousSibling?.focus())}_moveToBeginning(e){this.#_?this.#r.firstChild?.focus():this.#h(e)}_moveToEnd(e){this.#_?this.#r.lastChild?.focus():this.#h(e)}#m(t){e._keyboardManager.exec(this,t)}#h(e){if(this.#_){this.hideDropdown();return}if(this.#i=e.detail===0,this.#c||(this.#c=new AbortController,window.addEventListener(`pointerdown`,this.#g.bind(this),{signal:this.#l.combinedSignal(this.#c)})),this.#r){this.#r.classList.remove(`hidden`);return}let t=this.#r=this.#f();this.#e.append(t)}#g(e){this.#r?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#r?.classList.add(`hidden`),this.#c?.abort(),this.#c=null}get#_(){return this.#r&&!this.#r.classList.contains(`hidden`)}_hideDropdownFromKeyboard(){this.#a||(this.#_?(this.hideDropdown(),this.#e.focus({preventScroll:!0,focusVisible:this.#i})):this.#o?.unselect())}updateColor(e){if(this.#t&&(this.#t.style.backgroundColor=e),!this.#r)return;let t=this.#l.highlightColors.values();for(let n of this.#r.children)n.setAttribute(`aria-selected`,t.next().value===e)}destroy(){this.#e?.remove(),this.#e=null,this.#t=null,this.#r?.remove(),this.#r=null}},gg=class e extends cp{#e=null;#t=0;#n;#r=null;#i=null;#a=null;#o=null;#s=0;#c=null;#l=null;#u=null;#d=!1;#f=null;#p;#m=null;#h=``;#g;#_=``;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type=`highlight`;static _editorType=Bd.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId=``;static get _keyboardManager(){let t=e.prototype;return of(this,`_keyboardManager`,new rp([[[`ArrowLeft`,`mac+ArrowLeft`],t._moveCaret,{args:[0]}],[[`ArrowRight`,`mac+ArrowRight`],t._moveCaret,{args:[1]}],[[`ArrowUp`,`mac+ArrowUp`],t._moveCaret,{args:[2]}],[[`ArrowDown`,`mac+ArrowDown`],t._moveCaret,{args:[3]}]]))}constructor(t){super({...t,name:`highlightEditor`}),this.color=t.color||e._defaultColor,this.#g=t.thickness||e._defaultThickness,this.#p=t.opacity||e._defaultOpacity,this.#n=t.boxes||null,this.#_=t.methodOfCreation||``,this.#h=t.text||``,this._isDraggable=!1,t.highlightId>-1?(this.#d=!0,this.#y(t),this.#w()):this.#n&&(this.#e=t.anchorNode,this.#t=t.anchorOffset,this.#o=t.focusNode,this.#s=t.focusOffset,this.#v(),this.#w(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:`added`,type:this.#d?`free_highlight`:`highlight`,color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#g,methodOfCreation:this.#_}}get telemetryFinalData(){return{type:`highlight`,color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get(`color`).size}}#v(){let e=new dg(this.#n,.001);this.#l=e.getOutlines(),[this.x,this.y,this.width,this.height]=this.#l.box;let t=new dg(this.#n,.0025,.001,this._uiManager.direction===`ltr`);this.#a=t.getOutlines();let{lastPoint:n}=this.#a;this.#f=[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height]}#y({highlightOutlines:t,highlightId:n,clipPathId:r}){if(this.#l=t,this.#a=t.getNewOutline(this.#g/2+1.5,.0025),n>=0)this.#u=n,this.#r=r,this.parent.drawLayer.finalizeDraw(n,{bbox:t.box,path:{d:t.toSVGPath()}}),this.#m=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#a.box,path:{d:this.#a.toSVGPath()}},!0);else if(this.parent){let n=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#u,{bbox:e.#T(this.#l.box,(n-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#m,{bbox:e.#T(this.#a.box,n),path:{d:this.#a.toSVGPath()}})}let[i,a,o,s]=t.box;switch(this.rotation){case 0:this.x=i,this.y=a,this.width=o,this.height=s;break;case 90:{let[e,t]=this.parentDimensions;this.x=a,this.y=1-i,this.width=o*t/e,this.height=s*e/t;break}case 180:this.x=1-i,this.y=1-a,this.width=o,this.height=s;break;case 270:{let[e,t]=this.parentDimensions;this.x=1-a,this.y=i,this.width=o*t/e,this.height=s*e/t;break}}let{lastPoint:c}=this.#a;this.#f=[(c[0]-i)/o,(c[1]-a)/s]}static initialize(t,n){cp.initialize(t,n),e._defaultColor||=n.highlightColors?.values().next().value||`#fff066`}static updateDefaultParams(t,n){switch(t){case Vd.HIGHLIGHT_DEFAULT_COLOR:e._defaultColor=n;break;case Vd.HIGHLIGHT_THICKNESS:e._defaultThickness=n}}translateInPage(e,t){}get toolbarPosition(){return this.#f}updateParams(e,t){switch(e){case Vd.HIGHLIGHT_COLOR:this.#b(t);break;case Vd.HIGHLIGHT_THICKNESS:this.#x(t)}}static get defaultPropertiesToUpdate(){return[[Vd.HIGHLIGHT_DEFAULT_COLOR,e._defaultColor],[Vd.HIGHLIGHT_THICKNESS,e._defaultThickness]]}get propertiesToUpdate(){return[[Vd.HIGHLIGHT_COLOR,this.color||e._defaultColor],[Vd.HIGHLIGHT_THICKNESS,this.#g||e._defaultThickness],[Vd.HIGHLIGHT_FREE,this.#d]]}#b(t){let n=(e,t)=>{this.color=e,this.#p=t,this.parent?.drawLayer.updateProperties(this.#u,{root:{fill:e,"fill-opacity":t}}),this.#i?.updateColor(e)},r=this.color,i=this.#p;this.addCommands({cmd:n.bind(this,t,e._defaultOpacity),undo:n.bind(this,r,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Vd.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:`color_changed`,color:this._uiManager.highlightColorNames.get(t)},!0)}#x(e){let t=this.#g,n=e=>{this.#g=e,this.#S(e)};this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Vd.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:`thickness_changed`,thickness:e},!0)}async addEditToolbar(){let e=await super.addEditToolbar();return e?(this._uiManager.highlightColors&&(this.#i=new hg({editor:this}),e.addColorPicker(this.#i)),e):null}disableEditing(){super.disableEditing(),this.div.classList.toggle(`disabled`,!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle(`disabled`,!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#O())}getBaseTranslation(){return[0,0]}getRect(e,t){return super.getRect(e,t,this.#O())}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){this.#C(),this._reportTelemetry({action:`deleted`}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#w(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?this.#C():e&&(this.#w(e),t=!this.parent&&this.div?.classList.contains(`selectedEditor`)),super.setParent(e),this.show(this._isVisible),t&&this.select()}#S(e){if(!this.#d)return;this.#y({highlightOutlines:this.#l.getNewOutline(e/2)}),this.fixAndSetPosition();let[t,n]=this.parentDimensions;this.setDims(this.width*t,this.height*n)}#C(){this.#u!==null&&this.parent&&(this.parent.drawLayer.remove(this.#u),this.#u=null,this.parent.drawLayer.remove(this.#m),this.#m=null)}#w(e=this.parent){this.#u===null&&({id:this.#u,clipPathId:this.#r}=e.drawLayer.draw({bbox:this.#l.box,root:{viewBox:`0 0 1 1`,fill:this.color,"fill-opacity":this.#p},rootClass:{highlight:!0,free:this.#d},path:{d:this.#l.toSVGPath()}},!1,!0),this.#m=e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#d},bbox:this.#a.box,path:{d:this.#a.toSVGPath()}},this.#d),this.#c&&(this.#c.style.clipPath=this.#r))}static#T([e,t,n,r],i){switch(i){case 90:return[1-t-r,e,r,n];case 180:return[1-e-n,1-t-r,n,r];case 270:return[t,1-e-n,r,n]}return[e,t,n,r]}rotate(t){let{drawLayer:n}=this.parent,r;this.#d?(t=(t-this.rotation+360)%360,r=e.#T(this.#l.box,t)):r=e.#T([this.x,this.y,this.width,this.height],t),n.updateProperties(this.#u,{bbox:r,root:{"data-main-rotation":t}}),n.updateProperties(this.#m,{bbox:e.#T(this.#a.box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;let e=super.render();this.#h&&(e.setAttribute(`aria-label`,this.#h),e.setAttribute(`role`,`mark`)),this.#d?e.classList.add(`free`):this.div.addEventListener(`keydown`,this.#E.bind(this),{signal:this._uiManager._signal});let t=this.#c=document.createElement(`div`);e.append(t),t.setAttribute(`aria-hidden`,`true`),t.className=`internal`,t.style.clipPath=this.#r;let[n,r]=this.parentDimensions;return this.setDims(this.width*n,this.height*r),$f(this,this.#c,[`pointerover`,`pointerleave`]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{hovered:!1}})}#E(t){e._keyboardManager.exec(this,t)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#D(!0);break;case 1:case 3:this.#D(!1)}}#D(e){if(!this.#e)return;let t=window.getSelection();e?t.setPosition(this.#e,this.#t):t.setPosition(this.#o,this.#s)}select(){super.select(),this.#m&&this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#m&&(this.parent?.drawLayer.updateProperties(this.#m,{rootClass:{selected:!1}}),this.#d||this.#D(!1))}get _mustFixPosition(){return!this.#d}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(this.#u,{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(this.#m,{rootClass:{hidden:!e}}))}#O(){return this.#d?this.rotation:0}#k(){if(this.#d)return null;let[e,t]=this.pageDimensions,[n,r]=this.pageTranslation,i=this.#n,a=new Float32Array(i.length*8),o=0;for(let{x:s,y:c,width:l,height:u}of i){let i=s*e+n,d=(1-c)*t+r;a[o]=a[o+4]=i,a[o+1]=a[o+3]=d,a[o+2]=a[o+6]=i+l*e,a[o+5]=a[o+7]=d-u*t,o+=8}return a}#A(e){return this.#l.serialize(e,this.#O())}static startHighlighting(e,t,{target:n,x:r,y:i}){let{x:a,y:o,width:s,height:c}=n.getBoundingClientRect(),l=new AbortController,u=e.combinedSignal(l),d=t=>{l.abort(),this.#M(e,t)};window.addEventListener(`blur`,d,{signal:u}),window.addEventListener(`pointerup`,d,{signal:u}),window.addEventListener(`pointerdown`,Hf,{capture:!0,passive:!1,signal:u}),window.addEventListener(`contextmenu`,Vf,{signal:u}),n.addEventListener(`pointermove`,this.#j.bind(this,e),{signal:u}),this._freeHighlight=new pg({x:r,y:i},[a,o,s,c],e.scale,this._defaultThickness/2,t,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:`0 0 1 1`,fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static#j(e,t){this._freeHighlight.add(t)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#M(e,t){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(t,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:`main_toolbar`}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=``}static async deserialize(e,t,n){let r=null;if(e instanceof eg){let{data:{quadPoints:t,rect:n,rotation:i,id:a,color:o,opacity:s,popupRef:c},parent:{page:{pageNumber:l}}}=e;r=e={annotationType:Bd.HIGHLIGHT,color:Array.from(o),opacity:s,quadPoints:t,boxes:null,pageIndex:l-1,rect:n.slice(0),rotation:i,id:a,deleted:!1,popupRef:c}}else if(e instanceof $h){let{data:{inkLists:t,rect:n,rotation:i,id:a,color:o,borderStyle:{rawWidth:s},popupRef:c},parent:{page:{pageNumber:l}}}=e;r=e={annotationType:Bd.HIGHLIGHT,color:Array.from(o),thickness:s,inkLists:t,boxes:null,pageIndex:l-1,rect:n.slice(0),rotation:i,id:a,deleted:!1,popupRef:c}}let{color:i,quadPoints:a,inkLists:o,opacity:s}=e,c=await super.deserialize(e,t,n);c.color=Q.makeHexColor(...i),c.#p=s||1,o&&(c.#g=e.thickness),c.annotationElementId=e.id||null,c._initialData=r;let[l,u]=c.pageDimensions,[d,f]=c.pageTranslation;if(a){let e=c.#n=[];for(let t=0;t<a.length;t+=8)e.push({x:(a[t]-d)/l,y:1-(a[t+1]-f)/u,width:(a[t+2]-a[t])/l,height:(a[t+1]-a[t+5])/u});c.#v(),c.#w(),c.rotate(c.rotation)}else if(o){c.#d=!0;let e=o[0],n={x:e[0]-d,y:u-(e[1]-f)},r=new pg(n,[0,0,l,u],1,c.#g/2,!0,.001);for(let t=0,i=e.length;t<i;t+=2)n.x=e[t]-d,n.y=u-(e[t+1]-f),r.add(n);let{id:i,clipPathId:a}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:`0 0 1 1`,fill:c.color,"fill-opacity":c._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:r.toSVGPath()}},!0,!0);c.#y({highlightOutlines:r.getOutlines(),highlightId:i,clipPathId:a}),c.#w()}return c}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();let t=this.getRect(0,0),n=cp._colorManager.convert(this.color),r={annotationType:Bd.HIGHLIGHT,color:n,opacity:this.#p,thickness:this.#g,quadPoints:this.#k(),outlines:this.#A(t),pageIndex:this.pageIndex,rect:t,rotation:this.#O(),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!this.#N(r)?null:(r.id=this.annotationElementId,r)}#N(e){let{color:t}=this._initialData;return e.color.some((e,n)=>e!==t[n])}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}},_g=class{#e=Object.create(null);updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(let[t,n]of Object.entries(e))this.updateProperty(t,n)}updateSVGProperty(e,t){this.#e[e]=t}toSVGProperties(){let e=this.#e;return this.#e=Object.create(null),{root:e}}reset(){this.#e=Object.create(null)}updateAll(e=this){this.updateProperties(e)}clone(){tf(`Not implemented`)}},vg=class e extends cp{#e=null;#t;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#n=null;static#r=null;static#i=null;static#a=NaN;static#o=null;static#s=null;static#c=NaN;static _INNER_MARGIN=3;constructor(e){super(e),this.#t=e.mustBeCommitted||!1,e.drawOutlines&&(this.#l(e),this.#f())}#l({drawOutlines:e,drawId:t,drawingOptions:n}){this.#e=e,this._drawingOptions||=n,t>=0?(this._drawId=t,this.parent.drawLayer.finalizeDraw(t,e.defaultProperties)):this._drawId=this.#u(e,this.parent),this.#h(e.box)}#u(t,n){let{id:r}=n.drawLayer.draw(e._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return r}static _mergeSVGProperties(e,t){let n=new Set(Object.keys(e));for(let[r,i]of Object.entries(t))n.has(r)?Object.assign(e[r],i):e[r]=i;return e}static getDefaultDrawingOptions(e){tf(`Not implemented`)}static get typesMap(){tf(`Not implemented`)}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,n){let r=this.typesMap.get(t);r&&this._defaultDrawingOptions.updateProperty(r,n),this._currentParent&&(e.#n.updateProperty(r,n),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,t){let n=this.constructor.typesMap.get(e);n&&this._updateProperty(e,n,t)}static get defaultPropertiesToUpdate(){let e=[],t=this._defaultDrawingOptions;for(let[n,r]of this.typesMap)e.push([n,t[r]]);return e}get propertiesToUpdate(){let e=[],{_drawingOptions:t}=this;for(let[n,r]of this.constructor.typesMap)e.push([n,t[r]]);return e}_updateProperty(e,t,n){let r=this._drawingOptions,i=r[t],a=e=>{r.updateProperty(t,e);let n=this.#e.updateProperty(t,e);n&&this.#h(n),this.parent?.drawLayer.updateProperties(this._drawId,r.toSVGProperties())};this.addCommands({cmd:a.bind(this,n),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this.#e.getPathResizingSVGProperties(this.#m()),{bbox:this.#g()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this.#e.getPathResizedSVGProperties(this.#m()),{bbox:this.#g()}))}_onTranslating(e,t){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#g(e,t)})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this.#e.getPathTranslatedSVGProperties(this.#m(),this.parentDimensions),{bbox:this.#g()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle(`disabled`,!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle(`disabled`,!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#t&&(this.#t=!1,this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){this.#d(),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#f(),this.#h(this.#e.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),this.#d()):e&&(this._uiManager.addShouldRescale(this),this.#f(e),t=!this.parent&&this.div?.classList.contains(`selectedEditor`)),super.setParent(e),t&&this.select()}#d(){this._drawId!==null&&this.parent&&(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#f(e=this.parent){(this._drawId===null||this.parent!==e)&&(this._drawId===null?(this._drawingOptions.updateAll(),this._drawId=this.#u(this.#e,e)):this.parent.drawLayer.updateParent(this._drawId,e.drawLayer))}#p([e,t,n,r]){let{parentDimensions:[i,a],rotation:o}=this;switch(o){case 90:return[t,1-e,a/i*n,i/a*r];case 180:return[1-e,1-t,n,r];case 270:return[1-t,e,a/i*n,i/a*r];default:return[e,t,n,r]}}#m(){let{x:e,y:t,width:n,height:r,parentDimensions:[i,a],rotation:o}=this;switch(o){case 90:return[1-t,e,i/a*n,a/i*r];case 180:return[1-e,1-t,n,r];case 270:return[t,1-e,i/a*n,a/i*r];default:return[e,t,n,r]}}#h(e){if([this.x,this.y,this.width,this.height]=this.#p(e),this.div){this.fixAndSetPosition();let[e,t]=this.parentDimensions;this.setDims(this.width*e,this.height*t)}this._onResized()}#g(){let{x:e,y:t,width:n,height:r,rotation:i,parentRotation:a,parentDimensions:[o,s]}=this;switch((i*4+a)/90){case 1:return[1-t-r,e,r,n];case 2:return[1-e-n,1-t-r,n,r];case 3:return[t,1-e-n,r,n];case 4:return[e,t-o/s*n,s/o*r,o/s*n];case 5:return[1-t,e,o/s*n,s/o*r];case 6:return[1-e-s/o*r,1-t,s/o*r,o/s*n];case 7:return[t-o/s*n,1-e-s/o*r,o/s*n,s/o*r];case 8:return[e-n,t-r,n,r];case 9:return[1-t,e-n,r,n];case 10:return[1-e,1-t,n,r];case 11:return[t-r,1-e,r,n];case 12:return[e-s/o*r,t,s/o*r,o/s*n];case 13:return[1-t-o/s*n,e-s/o*r,o/s*n,s/o*r];case 14:return[1-e,1-t-o/s*n,s/o*r,o/s*n];case 15:return[t,1-e,o/s*n,s/o*r];default:return[e,t,n,r]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties({bbox:this.#g()},this.#e.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#h(this.#e.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let e=super.render();e.classList.add(`draw`);let t=document.createElement(`div`);e.append(t),t.setAttribute(`aria-hidden`,`true`),t.className=`internal`;let[n,r]=this.parentDimensions;return this.setDims(this.width*n,this.height*r),this._uiManager.addShouldRescale(this),this.disableEditing(),e}static createDrawerInstance(e,t,n,r,i){tf(`Not implemented`)}static startDrawing(t,n,r,i){let{target:a,offsetX:o,offsetY:s,pointerId:c,pointerType:l}=i;if(e.#o&&e.#o!==l)return;let{viewport:{rotation:u}}=t,{width:d,height:f}=a.getBoundingClientRect(),p=e.#r=new AbortController,m=t.combinedSignal(p);e.#a||=c,e.#o??=l,window.addEventListener(`pointerup`,t=>{e.#a===t.pointerId?this._endDraw(t):e.#s?.delete(t.pointerId)},{signal:m}),window.addEventListener(`pointercancel`,t=>{e.#a===t.pointerId?this._currentParent.endDrawingSession():e.#s?.delete(t.pointerId)},{signal:m}),window.addEventListener(`pointerdown`,t=>{e.#o===t.pointerType&&((e.#s||=new Set).add(t.pointerId),e.#n.isCancellable()&&(e.#n.removeLastElement(),e.#n.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:m}),window.addEventListener(`contextmenu`,Vf,{signal:m}),a.addEventListener(`pointermove`,this._drawMove.bind(this),{signal:m}),a.addEventListener(`touchmove`,t=>{t.timeStamp===e.#c&&Hf(t)},{signal:m}),t.toggleDrawing(),n._editorUndoBar?.hide(),e.#n?t.drawLayer.updateProperties(this._currentDrawId,e.#n.startNew(o,s,d,f,u)):(n.updateUIForDefaultProperties(this),e.#n=this.createDrawerInstance(o,s,d,f,u),e.#i=this.getDefaultDrawingOptions(),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(e.#i.toSVGProperties(),e.#n.defaultSVGProperties),!0,!1))}static _drawMove(t){if(e.#c=-1,!e.#n)return;let{offsetX:n,offsetY:r,pointerId:i}=t;e.#a===i&&(e.#s?.size>=1?this._endDraw(t):(this._currentParent.drawLayer.updateProperties(this._currentDrawId,e.#n.add(n,r)),e.#c=t.timeStamp,Hf(t)))}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,e.#n=null,e.#i=null,e.#o=null,e.#c=NaN),e.#r&&(e.#r.abort(),e.#r=null,e.#a=NaN,e.#s=null)}static _endDraw(t){let n=this._currentParent;if(n){if(n.toggleDrawing(!0),this._cleanup(!1),t&&n.drawLayer.updateProperties(this._currentDrawId,e.#n.end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){let t=e.#n,r=this._currentDrawId,i=t.getLastElement();n.addCommands({cmd:()=>{n.drawLayer.updateProperties(r,t.setLastElement(i))},undo:()=>{n.drawLayer.updateProperties(r,t.removeLastElement())},mustExec:!1,type:Vd.DRAW_STEP})}else this.endDrawing(!1)}}static endDrawing(t){let n=this._currentParent;if(!n)return null;if(n.toggleDrawing(!0),n.cleanUndoStack(Vd.DRAW_STEP),!e.#n.isEmpty()){let{pageDimensions:[r,i],scale:a}=n,o=n.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:e.#n.getOutlines(r*a,i*a,a,this._INNER_MARGIN),drawingOptions:e.#i,mustBeCommitted:!t});return this._cleanup(!0),o}return n.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,t,n,r,i,a){tf(`Not implemented`)}static async deserialize(e,t,n){let{rawDims:{pageWidth:r,pageHeight:i,pageX:a,pageY:o}}=t.viewport,s=this.deserializeDraw(a,o,r,i,this._INNER_MARGIN,e),c=await super.deserialize(e,t,n);return c.createDrawingOptions(e),c.#l({drawOutlines:s}),c.#f(),c.onScaleChanging(),c.rotate(),c}serializeDraw(e){let[t,n]=this.pageTranslation,[r,i]=this.pageDimensions;return this.#e.serialize([t,n,r,i],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}},yg=class{#e=new Float64Array(6);#t;#n;#r;#i;#a;#o=``;#s=0;#c=new bg;#l;#u;constructor(e,t,n,r,i,a){this.#l=n,this.#u=r,this.#r=i,this.#i=a,[e,t]=this.#d(e,t);let o=this.#t=[NaN,NaN,NaN,NaN,e,t];this.#a=[e,t],this.#n=[{line:o,points:this.#a}],this.#e.set(o,0)}updateProperty(e,t){e===`stroke-width`&&(this.#i=t)}#d(e,t){return $._normalizePoint(e,t,this.#l,this.#u,this.#r)}isEmpty(){return!this.#n||this.#n.length===0}isCancellable(){return this.#a.length<=10}add(e,t){[e,t]=this.#d(e,t);let[n,r,i,a]=this.#e.subarray(2,6),o=e-i,s=t-a;return Math.hypot(this.#l*o,this.#u*s)<=2?null:(this.#a.push(e,t),isNaN(n)?(this.#e.set([i,a,e,t],2),this.#t.push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(this.#e[0])&&this.#t.splice(6,6),this.#e.set([n,r,i,a,e,t],0),this.#t.push(...$.createBezierPoints(n,r,i,a,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){return this.add(e,t)||(this.#a.length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,n,r,i){this.#l=n,this.#u=r,this.#r=i,[e,t]=this.#d(e,t);let a=this.#t=[NaN,NaN,NaN,NaN,e,t];this.#a=[e,t];let o=this.#n.at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),this.#n.push({line:a,points:this.#a}),this.#e.set(a,0),this.#s=0,this.toSVGPath(),null}getLastElement(){return this.#n.at(-1)}setLastElement(e){return this.#n?(this.#n.push(e),this.#t=e.line,this.#a=e.points,this.#s=0,{path:{d:this.toSVGPath()}}):this.#c.setLastElement(e)}removeLastElement(){if(!this.#n)return this.#c.removeLastElement();this.#n.pop(),this.#o=``;for(let e=0,t=this.#n.length;e<t;e++){let{line:t,points:n}=this.#n[e];this.#t=t,this.#a=n,this.#s=0,this.toSVGPath()}return{path:{d:this.#o}}}toSVGPath(){let e=$.svgRound(this.#t[4]),t=$.svgRound(this.#t[5]);if(this.#a.length===2)return this.#o=`${this.#o} M ${e} ${t} Z`,this.#o;if(this.#a.length<=6){let n=this.#o.lastIndexOf(`M`);this.#o=`${this.#o.slice(0,n)} M ${e} ${t}`,this.#s=6}if(this.#a.length===4){let e=$.svgRound(this.#t[10]),t=$.svgRound(this.#t[11]);return this.#o=`${this.#o} L ${e} ${t}`,this.#s=12,this.#o}let n=[];this.#s===0&&(n.push(`M ${e} ${t}`),this.#s=6);for(let e=this.#s,t=this.#t.length;e<t;e+=6){let[t,r,i,a,o,s]=this.#t.slice(e,e+6).map($.svgRound);n.push(`C${t} ${r} ${i} ${a} ${o} ${s}`)}return this.#o+=n.join(` `),this.#s=this.#t.length,this.#o}getOutlines(e,t,n,r){let i=this.#n.at(-1);return i.line=new Float32Array(i.line),i.points=new Float32Array(i.points),this.#c.build(this.#n,e,t,n,this.#r,this.#i,r),this.#e=null,this.#t=null,this.#n=null,this.#o=null,this.#c}get defaultSVGProperties(){return{root:{viewBox:`0 0 10000 10000`},rootClass:{draw:!0},bbox:[0,0,1,1]}}},bg=class e extends ${#e;#t=0;#n;#r;#i;#a;#o;#s;#c;build(e,t,n,r,i,a,o){this.#i=t,this.#a=n,this.#o=r,this.#s=i,this.#c=a,this.#n=o??0,this.#r=e,this.#d()}setLastElement(e){return this.#r.push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#r.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){let e=[];for(let{line:t}of this.#r)if(e.push(`M${$.svgRound(t[4])} ${$.svgRound(t[5])}`),t.length===6)e.push(`Z`);else if(t.length===12)e.push(`L${$.svgRound(t[10])} ${$.svgRound(t[11])}`);else for(let n=6,r=t.length;n<r;n+=6){let[r,i,a,o,s,c]=t.subarray(n,n+6).map($.svgRound);e.push(`C${r} ${i} ${a} ${o} ${s} ${c}`)}return e.join(``)}serialize([e,t,n,r],i){let a=[],o=[],[s,c,l,u]=this.#u(),d,f,p,m,h,g,_,v,y;switch(this.#s){case 0:y=$._rescale,d=e,f=t+r,p=n,m=-r,h=e+s*n,g=t+(1-c-u)*r,_=e+(s+l)*n,v=t+(1-c)*r;break;case 90:y=$._rescaleAndSwap,d=e,f=t,p=n,m=r,h=e+c*n,g=t+s*r,_=e+(c+u)*n,v=t+(s+l)*r;break;case 180:y=$._rescale,d=e+n,f=t,p=-n,m=r,h=e+(1-s-l)*n,g=t+c*r,_=e+(1-s)*n,v=t+(c+u)*r;break;case 270:y=$._rescaleAndSwap,d=e+n,f=t+r,p=-n,m=-r,h=e+(1-c-u)*n,g=t+(1-s-l)*r,_=e+(1-c)*n,v=t+(1-s)*r}for(let{line:e,points:t}of this.#r)a.push(y(e,d,f,p,m,i?Array(e.length):null)),o.push(y(t,d,f,p,m,i?Array(t.length):null));return{lines:a,points:o,rect:[h,g,_,v]}}static deserialize(t,n,r,i,a,{paths:{lines:o,points:s},rotation:c,thickness:l}){let u=[],d,f,p,m,h;switch(c){case 0:h=$._rescale,d=-t/r,f=n/i+1,p=1/r,m=-1/i;break;case 90:h=$._rescaleAndSwap,d=-n/i,f=-t/r,p=1/i,m=1/r;break;case 180:h=$._rescale,d=t/r+1,f=-n/i,p=-1/r,m=1/i;break;case 270:h=$._rescaleAndSwap,d=n/i+1,f=t/r+1,p=-1/i,m=-1/r}if(!o){o=[];for(let e of s){let t=e.length;if(t===2){o.push(new Float32Array([NaN,NaN,NaN,NaN,e[0],e[1]]));continue}if(t===4){o.push(new Float32Array([NaN,NaN,NaN,NaN,e[0],e[1],NaN,NaN,NaN,NaN,e[2],e[3]]));continue}let n=new Float32Array(3*(t-2));o.push(n);let[r,i,a,s]=e.subarray(0,4);n.set([NaN,NaN,NaN,NaN,r,i],0);for(let o=4;o<t;o+=2){let t=e[o],c=e[o+1];n.set($.createBezierPoints(r,i,a,s,t,c),(o-2)*3),[r,i,a,s]=[a,s,t,c]}}}for(let e=0,t=o.length;e<t;e++)u.push({line:h(o[e].map(e=>e??NaN),d,f,p,m),points:h(s[e].map(e=>e??NaN),d,f,p,m)});let g=new e;return g.build(u,r,i,1,c,l,a),g}#l(e=this.#c){let t=this.#n+e/2*this.#o;return this.#s%180==0?[t/this.#i,t/this.#a]:[t/this.#a,t/this.#i]}#u(){let[e,t,n,r]=this.#e,[i,a]=this.#l(0);return[e+i,t+a,n-2*i,r-2*a]}#d(){let e=this.#e=new Float32Array([1/0,1/0,-1/0,-1/0]);for(let{line:t}of this.#r){if(t.length<=12){for(let n=4,r=t.length;n<r;n+=6){let[r,i]=t.subarray(n,n+2);e[0]=Math.min(e[0],r),e[1]=Math.min(e[1],i),e[2]=Math.max(e[2],r),e[3]=Math.max(e[3],i)}continue}let n=t[4],r=t[5];for(let i=6,a=t.length;i<a;i+=6){let[a,o,s,c,l,u]=t.subarray(i,i+6);Q.bezierBoundingBox(n,r,a,o,s,c,l,u,e),n=l,r=u}}let[t,n]=this.#l();e[0]=Math.min(1,Math.max(0,e[0]-t)),e[1]=Math.min(1,Math.max(0,e[1]-n)),e[2]=Math.min(1,Math.max(0,e[2]+t)),e[3]=Math.min(1,Math.max(0,e[3]+n)),e[2]-=e[0],e[3]-=e[1]}get box(){return this.#e}updateProperty(e,t){return e===`stroke-width`?this.#f(t):null}#f(e){let[t,n]=this.#l();this.#c=e;let[r,i]=this.#l(),[a,o]=[r-t,i-n],s=this.#e;return s[0]-=a,s[1]-=o,s[2]+=2*a,s[3]+=2*o,s}updateParentDimensions([e,t],n){let[r,i]=this.#l();this.#i=e,this.#a=t,this.#o=n;let[a,o]=this.#l(),s=a-r,c=o-i,l=this.#e;return l[0]-=s,l[1]-=c,l[2]+=2*s,l[3]+=2*c,l}updateRotation(e){return this.#t=e,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#e.map($.svgRound).join(` `)}get defaultProperties(){let[e,t]=this.#e;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${$.svgRound(e)} ${$.svgRound(t)}`}}}get rotationTransform(){let[,,e,t]=this.#e,n=0,r=0,i=0,a=0,o=0,s=0;switch(this.#t){case 90:r=t/e,i=-e/t,o=e;break;case 180:n=-1,a=-1,o=e,s=t;break;case 270:r=-t/e,i=e/t,s=t;break;default:return``}return`matrix(${n} ${r} ${i} ${a} ${$.svgRound(o)} ${$.svgRound(s)})`}getPathResizingSVGProperties([e,t,n,r]){let[i,a]=this.#l(),[o,s,c,l]=this.#e;if(Math.abs(c-i)<=$.PRECISION||Math.abs(l-a)<=$.PRECISION){let i=e+n/2-(o+c/2),a=t+r/2-(s+l/2);return{path:{"transform-origin":`${$.svgRound(e)} ${$.svgRound(t)}`,transform:`${this.rotationTransform} translate(${i} ${a})`}}}let u=(n-2*i)/(c-2*i),d=(r-2*a)/(l-2*a),f=c/n,p=l/r;return{path:{"transform-origin":`${$.svgRound(o)} ${$.svgRound(s)}`,transform:`${this.rotationTransform} scale(${f} ${p}) translate(${$.svgRound(i)} ${$.svgRound(a)}) scale(${u} ${d}) translate(${$.svgRound(-i)} ${$.svgRound(-a)})`}}}getPathResizedSVGProperties([e,t,n,r]){let[i,a]=this.#l(),o=this.#e,[s,c,l,u]=o;if(o[0]=e,o[1]=t,o[2]=n,o[3]=r,Math.abs(l-i)<=$.PRECISION||Math.abs(u-a)<=$.PRECISION){let i=e+n/2-(s+l/2),a=t+r/2-(c+u/2);for(let{line:e,points:t}of this.#r)$._translate(e,i,a,e),$._translate(t,i,a,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${$.svgRound(e)} ${$.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}let d=(n-2*i)/(l-2*i),f=(r-2*a)/(u-2*a),p=-d*(s+i)+e+i,m=-f*(c+a)+t+a;if(d!==1||f!==1||p!==0||m!==0)for(let{line:e,points:t}of this.#r)$._rescale(e,p,m,d,f,e),$._rescale(t,p,m,d,f,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${$.svgRound(e)} ${$.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,t],n){let[r,i]=n,a=this.#e,o=e-a[0],s=t-a[1];if(this.#i===r&&this.#a===i)for(let{line:e,points:t}of this.#r)$._translate(e,o,s,e),$._translate(t,o,s,t);else{let e=this.#i/r,t=this.#a/i;this.#i=r,this.#a=i;for(let{line:n,points:r}of this.#r)$._rescale(n,o,s,e,t,n),$._rescale(r,o,s,e,t,r);a[2]*=e,a[3]*=t}return a[0]=e,a[1]=t,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${$.svgRound(e)} ${$.svgRound(t)}`}}}get defaultSVGProperties(){let e=this.#e;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${$.svgRound(e[0])} ${$.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}},xg=class e extends _g{#e;constructor(e){super(),this.#e=e,super.updateProperties({fill:`none`,stroke:cp._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-miterlimit":10})}updateSVGProperty(e,t){e===`stroke-width`&&(t??=this[`stroke-width`],t*=this.#e.realScale),super.updateSVGProperty(e,t)}clone(){let t=new e(this.#e);return t.updateAll(this),t}},Sg=class e extends vg{static _type=`ink`;static _editorType=Bd.INK;static _defaultDrawingOptions=null;constructor(e){super({...e,name:`inkEditor`}),this._willKeepAspectRatio=!0}static initialize(e,t){cp.initialize(e,t),this._defaultDrawingOptions=new xg(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!0}static get typesMap(){return of(this,`typesMap`,new Map([[Vd.INK_THICKNESS,`stroke-width`],[Vd.INK_COLOR,`stroke`],[Vd.INK_OPACITY,`stroke-opacity`]]))}static createDrawerInstance(e,t,n,r,i){return new yg(e,t,n,r,i,this._defaultDrawingOptions[`stroke-width`])}static deserializeDraw(e,t,n,r,i,a){return bg.deserialize(e,t,n,r,i,a)}static async deserialize(e,t,n){let r=null;if(e instanceof $h){let{data:{inkLists:t,rect:n,rotation:i,id:a,color:o,opacity:s,borderStyle:{rawWidth:c},popupRef:l},parent:{page:{pageNumber:u}}}=e;r=e={annotationType:Bd.INK,color:Array.from(o),thickness:c,opacity:s,paths:{points:t},boxes:null,pageIndex:u-1,rect:n.slice(0),rotation:i,id:a,deleted:!1,popupRef:l}}let i=await super.deserialize(e,t,n);return i.annotationElementId=e.id||null,i._initialData=r,i}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();let{_drawId:e,_drawingOptions:t,parent:n}=this;t.updateSVGProperty(`stroke-width`),n.drawLayer.updateProperties(e,t.toSVGProperties())}static onScaleChangingWhenDrawing(){let e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty(`stroke-width`),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:n,opacity:r}){this._drawingOptions=e.getDefaultDrawingOptions({stroke:Q.makeHexColor(...t),"stroke-width":n,"stroke-opacity":r})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let{lines:t,points:n,rect:r}=this.serializeDraw(e),{_drawingOptions:{stroke:i,"stroke-opacity":a,"stroke-width":o}}=this,s={annotationType:Bd.INK,color:cp._colorManager.convert(i),opacity:a,thickness:o,paths:{lines:t,points:n},pageIndex:this.pageIndex,rect:r,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?s:this.annotationElementId&&!this.#e(s)?null:(s.id=this.annotationElementId,s)}#e(e){let{color:t,thickness:n,opacity:r,pageIndex:i}=this._initialData;return this._hasBeenMoved||this._hasBeenResized||e.color.some((e,n)=>e!==t[n])||e.thickness!==n||e.opacity!==r||e.pageIndex!==i}renderAnnotationElement(e){let{points:t,rect:n}=this.serializeDraw(!1);return e.updateEdited({rect:n,thickness:this._drawingOptions[`stroke-width`],points:t}),null}},Cg=class e extends cp{#e=null;#t=null;#n=null;#r=null;#i=null;#a=``;#o=null;#s=null;#c=!1;#l=!1;static _type=`stamp`;static _editorType=Bd.STAMP;constructor(e){super({...e,name:`stampEditor`}),this.#r=e.bitmapUrl,this.#i=e.bitmapFile}static initialize(e,t){cp.initialize(e,t)}static get supportedTypes(){return of(this,`supportedTypes`,[`apng`,`avif`,`bmp`,`gif`,`jpeg`,`png`,`svg+xml`,`webp`,`x-icon`].map(e=>`image/${e}`))}static get supportedTypesStr(){return of(this,`supportedTypesStr`,this.supportedTypes.join(`,`))}static isHandlingMimeForPasting(e){return this.supportedTypes.includes(e)}static paste(e,t){t.pasteEditor(Bd.STAMP,{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:`stamp`,hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){let t=e.get(`hasAltText`);return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}#u(e,t=!1){e?(this.#e=e.bitmap,t||(this.#t=e.id,this.#c=e.isSvg),e.file&&(this.#a=e.file.name),this.#p()):this.remove()}#d(){if(this.#n=null,this._uiManager.enableWaiting(!1),this.#o){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e)this._editToolbar.hide(),this._uiManager.editAltText(this,!0);else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this._reportTelemetry({action:`pdfjs.image.image_added`,data:{alt_text_modal:!1,alt_text_type:`empty`}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}}async mlGuessAltText(e=null,t=!0){if(this.hasAltTextData())return null;let{mlManager:n}=this._uiManager;if(!n)throw Error(`No ML.`);if(!await n.isEnabledFor(`altText`))throw Error(`ML isn't enabled for alt text.`);let{data:r,width:i,height:a}=e||this.copyCanvas(null,null,!0).imageData,o=await n.guess({name:`altText`,request:{data:r,width:i,height:a,channels:r.length/(i*a)}});if(!o)throw Error(`No response from the AI service.`);if(o.error)throw Error(`Error from the AI service.`);if(o.cancel)return null;if(!o.output)throw Error(`No valid response from the AI service.`);let s=o.output;return await this.setGuessedAltText(s),t&&!this.hasAltTextData()&&(this.altTextData={alt:s,decorative:!1}),s}#f(){if(this.#t){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#t).then(e=>this.#u(e,!0)).finally(()=>this.#d());return}if(this.#r){let e=this.#r;this.#r=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromUrl(e).then(e=>this.#u(e)).finally(()=>this.#d());return}if(this.#i){let e=this.#i;this.#i=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromFile(e).then(e=>this.#u(e)).finally(()=>this.#d());return}let t=document.createElement(`input`);t.type=`file`,t.accept=e.supportedTypesStr;let n=this._uiManager._signal;this.#n=new Promise(e=>{t.addEventListener(`change`,async()=>{if(!t.files||t.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);let e=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:`pdfjs.image.image_selected`,data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#u(e)}e()},{signal:n}),t.addEventListener(`cancel`,()=>{this.remove(),e()},{signal:n})}).finally(()=>this.#d()),t.click()}remove(){this.#t&&(this.#e=null,this._uiManager.imageManager.deleteId(this.#t),this.#o?.remove(),this.#o=null,this.#s&&=(clearTimeout(this.#s),null)),super.remove()}rebuild(){this.parent?(super.rebuild(),this.div!==null&&(this.#t&&this.#o===null&&this.#f(),this.isAttachedToDOM||this.parent.add(this))):this.#t&&this.#f()}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(this.#n||this.#e||this.#r||this.#i||this.#t)}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;if(this.width&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.div.setAttribute(`role`,`figure`),this.addAltTextButton(),this.#e?this.#p():this.#f(),this.width&&!this.annotationElementId){let[n,r]=this.parentDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r)}return this._uiManager.addShouldRescale(this),this.div}_onResized(){this.onScaleChanging()}onScaleChanging(){this.parent&&(this.#s!==null&&clearTimeout(this.#s),this.#s=setTimeout(()=>{this.#s=null,this.#h()},200))}#p(){let{div:e}=this,{width:t,height:n}=this.#e,[r,i]=this.pageDimensions,a=.75;if(this.width)t=this.width*r,n=this.height*i;else if(t>a*r||n>a*i){let e=Math.min(a*r/t,a*i/n);t*=e,n*=e}let[o,s]=this.parentDimensions;this.setDims(t*o/r,n*s/i),this._uiManager.enableWaiting(!1);let c=this.#o=document.createElement(`canvas`);c.setAttribute(`role`,`img`),this.addContainer(c),this.width=t/r,this.height=n/i,this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),this.#h(),this.#l||=(this.parent.addUndoableEditor(this),!0),this._reportTelemetry({action:`inserted_image`}),this.#a&&c.setAttribute(`aria-label`,this.#a)}copyCanvas(e,t,n=!1){e||=224;let{width:r,height:i}=this.#e,a=new Xf,o=this.#e,s=r,c=i,l=null;if(t){if(r>t||i>t){let e=Math.min(t/r,t/i);s=Math.floor(r*e),c=Math.floor(i*e)}l=document.createElement(`canvas`);let e=l.width=Math.ceil(s*a.sx),n=l.height=Math.ceil(c*a.sy);this.#c||(o=this.#m(e,n));let u=l.getContext(`2d`);u.filter=this._uiManager.hcmFilter;let d=`white`,f=`#cfcfd8`;this._uiManager.hcmFilter===`none`?window.matchMedia?.(`(prefers-color-scheme: dark)`).matches&&(d=`#8f8f9d`,f=`#42414d`):f=`black`;let p=15*a.sx,m=15*a.sy,h=new OffscreenCanvas(p*2,m*2),g=h.getContext(`2d`);g.fillStyle=d,g.fillRect(0,0,p*2,m*2),g.fillStyle=f,g.fillRect(0,0,p,m),g.fillRect(p,m,p,m),u.fillStyle=u.createPattern(h,`repeat`),u.fillRect(0,0,e,n),u.drawImage(o,0,0,o.width,o.height,0,0,e,n)}let u=null;if(n){let t,n;if(a.symmetric&&o.width<e&&o.height<e)t=o.width,n=o.height;else if(o=this.#e,r>e||i>e){let a=Math.min(e/r,e/i);t=Math.floor(r*a),n=Math.floor(i*a),this.#c||(o=this.#m(t,n))}let s=new OffscreenCanvas(t,n).getContext(`2d`,{willReadFrequently:!0});s.drawImage(o,0,0,o.width,o.height,0,0,t,n),u={width:t,height:n,data:s.getImageData(0,0,t,n).data}}return{canvas:l,width:s,height:c,imageData:u}}#m(e,t){let{width:n,height:r}=this.#e,i=n,a=r,o=this.#e;for(;i>2*e||a>2*t;){let n=i,r=a;i>2*e&&(i=i>=16384?Math.floor(i/2)-1:Math.ceil(i/2)),a>2*t&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));let s=new OffscreenCanvas(i,a);s.getContext(`2d`).drawImage(o,0,0,n,r,0,0,i,a),o=s.transferToImageBitmap()}return o}#h(){let[e,t]=this.parentDimensions,{width:n,height:r}=this,i=new Xf,a=Math.ceil(n*e*i.sx),o=Math.ceil(r*t*i.sy),s=this.#o;if(!s||s.width===a&&s.height===o)return;s.width=a,s.height=o;let c=this.#c?this.#e:this.#m(a,o),l=s.getContext(`2d`);l.filter=this._uiManager.hcmFilter,l.drawImage(c,0,0,c.width,c.height,0,0,a,o)}getImageForAltText(){return this.#o}#g(e){if(e){if(this.#c){let e=this._uiManager.imageManager.getSvgUrl(this.#t);if(e)return e}let e=document.createElement(`canvas`);return{width:e.width,height:e.height}=this.#e,e.getContext(`2d`).drawImage(this.#e,0,0),e.toDataURL()}if(this.#c){let[e,t]=this.pageDimensions,n=Math.round(this.width*e*jf.PDF_TO_CSS_UNITS),r=Math.round(this.height*t*jf.PDF_TO_CSS_UNITS),i=new OffscreenCanvas(n,r);return i.getContext(`2d`).drawImage(this.#e,0,0,this.#e.width,this.#e.height,0,0,n,r),i.transferToImageBitmap()}return structuredClone(this.#e)}static async deserialize(e,t,n){let r=null;if(e instanceof ig){let{data:{rect:i,rotation:a,id:o,structParent:s,popupRef:c},container:l,parent:{page:{pageNumber:u}}}=e,d=l.querySelector(`canvas`),f=n.imageManager.getFromCanvas(l.id,d);d.remove();let p=(await t._structTree.getAriaAttributes(`${Of}${o}`))?.get(`aria-label`)||``;r=e={annotationType:Bd.STAMP,bitmapId:f.id,bitmap:f.bitmap,pageIndex:u-1,rect:i.slice(0),rotation:a,id:o,deleted:!1,accessibilityData:{decorative:!1,altText:p},isSvg:!1,structParent:s,popupRef:c}}let i=await super.deserialize(e,t,n),{rect:a,bitmap:o,bitmapUrl:s,bitmapId:c,isSvg:l,accessibilityData:u}=e;c&&n.imageManager.isValidId(c)?(i.#t=c,o&&(i.#e=o)):i.#r=s,i.#c=l;let[d,f]=i.pageDimensions;return i.width=(a[2]-a[0])/d,i.height=(a[3]-a[1])/f,i.annotationElementId=e.id||null,u&&(i.altTextData=u),i._initialData=r,i.#l=!!r,i}serialize(e=!1,t=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let n={annotationType:Bd.STAMP,bitmapId:this.#t,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#c,structTreeParentId:this._structTreeParentId};if(e)return n.bitmapUrl=this.#g(!0),n.accessibilityData=this.serializeAltText(!0),n;let{decorative:r,altText:i}=this.serializeAltText(!1);if(!r&&i&&(n.accessibilityData={type:`Figure`,alt:i}),this.annotationElementId){let e=this.#_(n);if(e.isSame)return null;e.isSameAltText?delete n.accessibilityData:n.accessibilityData.structParent=this._initialData.structParent??-1}if(n.id=this.annotationElementId,t===null)return n;t.stamps||=new Map;let a=this.#c?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(!t.stamps.has(this.#t))t.stamps.set(this.#t,{area:a,serialized:n}),n.bitmap=this.#g(!1);else if(this.#c){let e=t.stamps.get(this.#t);a>e.area&&(e.area=a,e.serialized.bitmap.close(),e.serialized.bitmap=this.#g(!1))}return n}#_(e){let{pageIndex:t,accessibilityData:{altText:n}}=this._initialData,r=e.pageIndex===t,i=(e.accessibilityData?.alt||``)===n;return{isSame:!this._hasBeenMoved&&!this._hasBeenResized&&r&&i,isSameAltText:i}}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}},wg=class e{#e;#t=!1;#n=null;#r=null;#i=null;#a=new Map;#o=!1;#s=!1;#c=!1;#l=null;#u=null;#d=null;#f=null;#p;static _initialized=!1;static#m=new Map([cg,Sg,Cg,gg].map(e=>[e._editorType,e]));constructor({uiManager:t,pageIndex:n,div:r,structTreeLayer:i,accessibilityManager:a,annotationLayer:o,drawLayer:s,textLayer:c,viewport:l,l10n:u}){let d=[...e.#m.values()];if(!e._initialized){e._initialized=!0;for(let e of d)e.initialize(u,t)}t.registerEditorTypes(d),this.#p=t,this.pageIndex=n,this.div=r,this.#e=a,this.#n=o,this.viewport=l,this.#d=c,this.drawLayer=s,this._structTree=i,this.#p.addLayer(this)}get isEmpty(){return this.#a.size===0}get isInvisible(){return this.isEmpty&&this.#p.getMode()===Bd.NONE}updateToolbar(e){this.#p.updateToolbar(e)}updateMode(t=this.#p.getMode()){switch(this.#y(),t){case Bd.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case Bd.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case Bd.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);let{classList:n}=this.div;for(let r of e.#m.values())n.toggle(`${r._type}Editing`,t===r._editorType);this.div.hidden=!1}hasTextLayer(e){return e===this.#d?.div}setEditingState(e){this.#p.setEditingState(e)}addCommands(e){this.#p.addCommands(e)}cleanUndoStack(e){this.#p.cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle(`drawing`,!e)}togglePointerEvents(e=!1){this.div.classList.toggle(`disabled`,!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#n?.div.classList.toggle(`disabled`,!e)}async enable(){this.#c=!0,this.div.tabIndex=0,this.togglePointerEvents(!0);let e=new Set;for(let t of this.#a.values())t.enableEditing(),t.show(!0),t.annotationElementId&&(this.#p.removeChangedExistingAnnotation(t),e.add(t.annotationElementId));if(!this.#n){this.#c=!1;return}let t=this.#n.getEditableAnnotations();for(let n of t){if(n.hide(),this.#p.isDeletedAnnotationElement(n.data.id)||e.has(n.data.id))continue;let t=await this.deserialize(n);t&&(this.addOrRebuild(t),t.enableEditing())}this.#c=!1}disable(){this.#s=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);let t=new Map,n=new Map;for(let e of this.#a.values())e.disableEditing(),e.annotationElementId&&(e.serialize()===null?(n.set(e.annotationElementId,e),this.getEditableAnnotation(e.annotationElementId)?.show(),e.remove()):t.set(e.annotationElementId,e));if(this.#n){let e=this.#n.getEditableAnnotations();for(let r of e){let{id:e}=r.data;if(this.#p.isDeletedAnnotationElement(e))continue;let i=n.get(e);i?(i.resetAnnotationElement(r),i.show(!1),r.show()):(i=t.get(e),i&&(this.#p.addChangedExistingAnnotation(i),i.renderAnnotationElement(r)&&i.show(!1)),r.show())}}this.#y(),this.isEmpty&&(this.div.hidden=!0);let{classList:r}=this.div;for(let t of e.#m.values())r.remove(`${t._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#s=!1}getEditableAnnotation(e){return this.#n?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#p.getActive()!==e&&this.#p.setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,this.#d?.div&&!this.#f){this.#f=new AbortController;let e=this.#p.combinedSignal(this.#f);this.#d.div.addEventListener(`pointerdown`,this.#h.bind(this),{signal:e}),this.#d.div.classList.add(`highlighting`)}}disableTextSelection(){this.div.tabIndex=0,this.#d?.div&&this.#f&&(this.#f.abort(),this.#f=null,this.#d.div.classList.remove(`highlighting`))}#h(e){this.#p.unselectAll();let{target:t}=e;if(t===this.#d.div||(t.getAttribute(`role`)===`img`||t.classList.contains(`endOfContent`))&&this.#d.div.contains(t)){let{isMac:t}=xf.platform;if(e.button!==0||e.ctrlKey&&t)return;this.#p.showAllEditors(`highlight`,!0,!0),this.#d.div.classList.add(`free`),this.toggleDrawing(),gg.startHighlighting(this,this.#p.direction===`ltr`,{target:this.#d.div,x:e.x,y:e.y}),this.#d.div.addEventListener(`pointerup`,()=>{this.#d.div.classList.remove(`free`),this.toggleDrawing(!0)},{once:!0,signal:this.#p._signal}),e.preventDefault()}}enableClick(){if(this.#r)return;this.#r=new AbortController;let e=this.#p.combinedSignal(this.#r);this.div.addEventListener(`pointerdown`,this.pointerdown.bind(this),{signal:e});let t=this.pointerup.bind(this);this.div.addEventListener(`pointerup`,t,{signal:e}),this.div.addEventListener(`pointercancel`,t,{signal:e})}disableClick(){this.#r?.abort(),this.#r=null}attach(e){this.#a.set(e.id,e);let{annotationElementId:t}=e;t&&this.#p.isDeletedAnnotationElement(t)&&this.#p.removeDeletedAnnotationElement(e)}detach(e){this.#a.delete(e.id),this.#e?.removePointerInTextLayer(e.contentDiv),!this.#s&&e.annotationElementId&&this.#p.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#p.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#p.addDeletedAnnotationElement(e.annotationElementId),cp.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),this.#p.addEditor(e),this.attach(e),!e.isAttachedToDOM){let t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!this.#c),this.#p.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;let{activeElement:t}=document;e.div.contains(t)&&!this.#i&&(e._focusEventsAllowed=!1,this.#i=setTimeout(()=>{this.#i=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener(`focusin`,()=>{e._focusEventsAllowed=!0},{once:!0,signal:this.#p._signal}),t.focus())},0)),e._structTreeParentId=this.#e?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||=this,e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getNextId(){return this.#p.getId()}get#g(){return e.#m.get(this.#p.getMode())}combinedSignal(e){return this.#p.combinedSignal(e)}#_(e){let t=this.#g;return t?new t.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#g?.canCreateNewEmptyEditor()}pasteEditor(e,t){this.#p.updateToolbar(e),this.#p.updateMode(e);let{offsetX:n,offsetY:r}=this.#v(),i=this.getNextId(),a=this.#_({parent:this,id:i,x:n,y:r,uiManager:this.#p,isCentered:!0,...t});a&&this.add(a)}async deserialize(t){return await e.#m.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#p)||null}createAndAddNewEditor(e,t,n={}){let r=this.getNextId(),i=this.#_({parent:this,id:r,x:e.offsetX,y:e.offsetY,uiManager:this.#p,isCentered:t,...n});return i&&this.add(i),i}#v(){let{x:e,y:t,width:n,height:r}=this.div.getBoundingClientRect(),i=Math.max(0,e),a=Math.max(0,t),o=Math.min(window.innerWidth,e+n),s=Math.min(window.innerHeight,t+r),c=(i+o)/2-e,l=(a+s)/2-t,[u,d]=this.viewport.rotation%180==0?[c,l]:[l,c];return{offsetX:u,offsetY:d}}addNewEditor(){this.createAndAddNewEditor(this.#v(),!0)}setSelected(e){this.#p.setSelected(e)}toggleSelected(e){this.#p.toggleSelected(e)}unselect(e){this.#p.unselect(e)}pointerup(e){let{isMac:t}=xf.platform;e.button!==0||e.ctrlKey&&t||e.target===this.div&&this.#o&&(this.#o=!1,!(this.#g?.isDrawer&&this.#g.supportMultipleDrawings)&&(this.#t?this.#p.getMode()===Bd.STAMP?this.#p.unselectAll():this.createAndAddNewEditor(e,!1):this.#t=!0))}pointerdown(e){if(this.#p.getMode()===Bd.HIGHLIGHT&&this.enableTextSelection(),this.#o){this.#o=!1;return}let{isMac:t}=xf.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(this.#o=!0,this.#g?.isDrawer){this.startDrawingSession(e);return}let n=this.#p.getActive();this.#t=!n||n.isEmpty()}startDrawingSession(e){if(this.div.focus(),this.#l){this.#g.startDrawing(this,this.#p,!1,e);return}this.#p.setCurrentDrawingSession(this),this.#l=new AbortController;let t=this.#p.combinedSignal(this.#l);this.div.addEventListener(`blur`,({relatedTarget:e})=>{e&&!this.div.contains(e)&&(this.#u=null,this.commitOrRemove())},{signal:t}),this.#g.startDrawing(this,this.#p,!1,e)}pause(e){if(e){let{activeElement:e}=document;this.div.contains(e)&&(this.#u=e)}else this.#u&&setTimeout(()=>{this.#u?.focus(),this.#u=null},0)}endDrawingSession(e=!1){return this.#l?(this.#p.setCurrentDrawingSession(null),this.#l.abort(),this.#l=null,this.#u=null,this.#g.endDrawing(e)):null}findNewParent(e,t,n){let r=this.#p.findParent(t,n);return r===null||r===this?!1:(r.changeParent(e),!0)}commitOrRemove(){return this.#l?(this.endDrawingSession(),!0):!1}onScaleChanging(){this.#l&&this.#g.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#p.getActive()?.parent===this&&(this.#p.commitOrRemove(),this.#p.setActiveEditor(null)),this.#i&&=(clearTimeout(this.#i),null);for(let e of this.#a.values())this.#e?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#a.clear(),this.#p.removeLayer(this)}#y(){for(let e of this.#a.values())e.isEmpty()&&e.remove()}render({viewport:e}){this.viewport=e,Yf(this.div,e);for(let e of this.#p.getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:e}){this.#p.commitOrRemove(),this.#y();let t=this.viewport.rotation,n=e.rotation;if(this.viewport=e,Yf(this.div,{rotation:n}),t!==n)for(let e of this.#a.values())e.rotate(n)}get pageDimensions(){let{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return this.#p.viewParameters.realScale}},Tg=class e{#e=null;#t=0;#n=new Map;#r=new Map;constructor({pageIndex:e}){this.pageIndex=e}setParent(e){if(!this.#e)this.#e=e;else if(this.#e!==e){if(this.#n.size>0)for(let t of this.#n.values())t.remove(),e.append(t);this.#e=e}}static get _svgFactory(){return of(this,`_svgFactory`,new Dh)}static#i(e,[t,n,r,i]){let{style:a}=e;a.top=`${100*n}%`,a.left=`${100*t}%`,a.width=`${100*r}%`,a.height=`${100*i}%`}#a(){let t=e._svgFactory.create(1,1,!0);return this.#e.append(t),t.setAttribute(`aria-hidden`,!0),t}#o(t,n){let r=e._svgFactory.createElement(`clipPath`);t.append(r);let i=`clip_${n}`;r.setAttribute(`id`,i),r.setAttribute(`clipPathUnits`,`objectBoundingBox`);let a=e._svgFactory.createElement(`use`);return r.append(a),a.setAttribute(`href`,`#${n}`),a.classList.add(`clip`),i}#s(e,t){for(let[n,r]of Object.entries(t))r===null?e.removeAttribute(n):e.setAttribute(n,r)}draw(t,n=!1,r=!1){let i=this.#t++,a=this.#a(),o=e._svgFactory.createElement(`defs`);a.append(o);let s=e._svgFactory.createElement(`path`);o.append(s);let c=`path_p${this.pageIndex}_${i}`;s.setAttribute(`id`,c),s.setAttribute(`vector-effect`,`non-scaling-stroke`),n&&this.#r.set(i,s);let l=r?this.#o(o,c):null,u=e._svgFactory.createElement(`use`);return a.append(u),u.setAttribute(`href`,`#${c}`),this.updateProperties(a,t),this.#n.set(i,a),{id:i,clipPathId:`url(#${l})`}}drawOutline(t,n){let r=this.#t++,i=this.#a(),a=e._svgFactory.createElement(`defs`);i.append(a);let o=e._svgFactory.createElement(`path`);a.append(o);let s=`path_p${this.pageIndex}_${r}`;o.setAttribute(`id`,s),o.setAttribute(`vector-effect`,`non-scaling-stroke`);let c;if(n){let t=e._svgFactory.createElement(`mask`);a.append(t),c=`mask_p${this.pageIndex}_${r}`,t.setAttribute(`id`,c),t.setAttribute(`maskUnits`,`objectBoundingBox`);let n=e._svgFactory.createElement(`rect`);t.append(n),n.setAttribute(`width`,`1`),n.setAttribute(`height`,`1`),n.setAttribute(`fill`,`white`);let i=e._svgFactory.createElement(`use`);t.append(i),i.setAttribute(`href`,`#${s}`),i.setAttribute(`stroke`,`none`),i.setAttribute(`fill`,`black`),i.setAttribute(`fill-rule`,`nonzero`),i.classList.add(`mask`)}let l=e._svgFactory.createElement(`use`);i.append(l),l.setAttribute(`href`,`#${s}`),c&&l.setAttribute(`mask`,`url(#${c})`);let u=l.cloneNode();return i.append(u),l.classList.add(`mainOutline`),u.classList.add(`secondaryOutline`),this.updateProperties(i,t),this.#n.set(r,i),r}finalizeDraw(e,t){this.#r.delete(e),this.updateProperties(e,t)}updateProperties(t,n){if(!n)return;let{root:r,bbox:i,rootClass:a,path:o}=n,s=typeof t==`number`?this.#n.get(t):t;if(s){if(r&&this.#s(s,r),i&&e.#i(s,i),a){let{classList:e}=s;for(let[t,n]of Object.entries(a))e.toggle(t,n)}if(o){let e=s.firstChild.firstChild;this.#s(e,o)}}}updateParent(e,t){if(t===this)return;let n=this.#n.get(e);n&&(t.#e.append(n),this.#n.delete(e),t.#n.set(e,n))}remove(e){this.#r.delete(e),this.#e!==null&&(this.#n.get(e).remove(),this.#n.delete(e))}destroy(){this.#e=null;for(let e of this.#n.values())e.remove();this.#n.clear(),this.#r.clear()}};globalThis.pdfjsTestingUtils={HighlightOutliner:dg},jd.AbortException,jd.AnnotationEditorLayer,jd.AnnotationEditorParamsType,jd.AnnotationEditorType,jd.AnnotationEditorUIManager,jd.AnnotationLayer,jd.AnnotationMode,jd.ColorPicker,jd.DOMSVGFactory,jd.DrawLayer,jd.FeatureTest;var Eg=jd.GlobalWorkerOptions;jd.ImageKind,jd.InvalidPDFException,jd.MissingPDFException,jd.OPS,jd.OutputScale,jd.PDFDataRangeTransport,jd.PDFDateString,jd.PDFWorker,jd.PasswordResponses,jd.PermissionFlag,jd.PixelsPerInch,jd.RenderingCancelledException,jd.TextLayer,jd.TouchManager,jd.UnexpectedResponseException,jd.Util,jd.VerbosityLevel,jd.XfaLayer,jd.build,jd.createValidAbsoluteUrl,jd.fetchData;var Dg=jd.getDocument;jd.getFilenameFromUrl,jd.getPdfFilenameFromUrl,jd.getXfaPageViewport,jd.isDataScheme,jd.isPdfFile,jd.noContextMenu,jd.normalizeUnicode,jd.setLayerDimensions,jd.shadow,jd.stopEvent,jd.version;var Og=new URL(`pdf.worker.min-yatZIOMy.mjs`,import.meta.url).href;if(window.__PROOFLENS_WORKER__){let e=new Blob([window.__PROOFLENS_WORKER__],{type:`text/javascript`});Eg.workerSrc=URL.createObjectURL(e)}else Eg.workerSrc=Og;var kg=new Map;function Ag(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function jg(e){if(!kg.has(e)){let t=window.__PROOFLENS_PDF__?.[e],n;try{n=t?{data:Ag(t)}:{url:Gi(e),withCredentials:!1}}catch(e){return Promise.reject(e)}kg.set(e,Dg({...n,isEvalSupported:!1}).promise)}return kg.get(e)}async function Mg(e,t,n,r,i=null){let a=await e.getPage(t),o=a.getViewport({scale:1}),s=r/o.width,c=Math.min(window.devicePixelRatio||1,3),l=a.getViewport({scale:s*c}),u=i?Math.max(0,i[0])*s*c:0,d=i?Math.min(o.height,i[1])*s*c:l.height;n.width=Math.floor(l.width),n.height=Math.max(1,Math.floor(d-u)),n.style.width=r+`px`,n.style.height=n.height/c+`px`;let f=n.getContext(`2d`);return f.setTransform(1,0,0,1,0,-u),await a.render({canvasContext:f,viewport:l,canvas:n}).promise,{width:o.width,height:o.height,scale:s}}var Ng=P(`<p class="err svelte-1e5da8b"> </p>`),Pg=P(`<p class="muted wait svelte-1e5da8b">Opening the paper…</p>`),Fg=P(`<button><span class="tag svelte-1e5da8b"> </span></button>`),Ig=P(`<div class="page svelte-1e5da8b"><canvas class="svelte-1e5da8b"></canvas> <!></div>`),Lg=P(`<div class="pdf svelte-1e5da8b"><!></div>`);function Rg(e,t){Ye(t,!0);let n=Vi(t,`selected`,3,null),r=Jt(null),i=Jt(null),a=Jt(800),o,s=Jt(nn([]));Tn(()=>{D(i,null),jg(t.url).then(async e=>{let t=[];for(let n=1;n<=e.numPages;n++){let r=(await e.getPage(n)).getViewport({scale:1});t.push({no:n,w:r.width,h:r.height})}D(s,t,!0),D(r,e,!0)}).catch(e=>D(i,String(e),!0))}),Tn(()=>{if(!o)return;let e=new ResizeObserver(()=>D(a,Math.min(o.clientWidth-32,980),!0));return e.observe(o),()=>e.disconnect()});function c(e){let n=[];for(let r of t.claims){let t=r.anchor;if(!t)continue;let i=t.page_end??t.page;e<t.page||e>i||n.push({c:r,top:e===t.page?t.y0-2:36,bottom:e===i&&t.y1!=null?Math.max(t.y1+5,t.y0+16):null})}return n}Tn(()=>{if(!n()||!N(r)||!o)return;let e=o.querySelector(`[data-claim="${CSS.escape(n())}"]`);e&&e.scrollIntoView({block:`center`,behavior:`smooth`})});function l(e,t){let n=null,r=t=>{let r=t.no+`:`+t.width;r!==n&&t.doc&&(n=r,Mg(t.doc,t.no,e,t.width).catch(e=>console.error(`render`,e)))},i=new IntersectionObserver(e=>e.some(e=>e.isIntersecting)&&r(t),{rootMargin:`800px`});return i.observe(e),{update(e){t=e,n=null,r(e)},destroy(){i.disconnect()}}}var u=Lg(),d=O(u),f=e=>{var t=Ng(),n=A(t);M(()=>I(n,`The PDF could not be opened: ${N(i)??``}`)),F(e,t)},p=e=>{F(e,Pg())},m=e=>{var i=zr();$r(k(i),17,()=>N(s),e=>e.no,(e,i)=>{let o=E(()=>N(a)/N(i).w);var s=Ig();let u;var d=O(s);ai(d,(e,t)=>l?.(e,t),()=>({doc:N(r),no:N(i).no,width:N(a)})),$r(j(d,2),17,()=>c(N(i).no),e=>e.c.id+`:`+N(i).no,(e,r)=>{var a=Fg();let s,c;var l=A(O(a));T(a),M(()=>{s=di(a,1,`band st-`+N(r).c.class+(N(r).c.anchor?.kind&&N(r).c.anchor.kind!==`exact`?` `+N(r).c.anchor.kind:``),`svelte-1e5da8b`,s,{sel:N(r).c.id===n()}),Ti(a,`data-claim`,N(r).c.id),Ti(a,`title`,`${N(r).c.number}: ${N(r).c.status}`),c=pi(a,``,c,{top:N(r).top*N(o)+`px`,height:((N(r).bottom??N(i).h-36)-N(r).top)*N(o)+`px`}),I(l,`${N(r).c.status??``}${N(r).c.anchor?.kind===`approximate`?` · approximate location`:N(r).c.anchor?.kind===`manual`?` · placed by hand`:``}`)}),kr(`click`,a,()=>t.onselect(N(r).c.id)),F(e,a)}),T(s),M(()=>{u=pi(s,``,u,{width:N(a)+`px`,height:N(i).h*N(o)+`px`}),Ti(d,`aria-label`,`Page `+N(i).no)}),F(e,s)}),F(e,i)};L(d,e=>{N(i)?e(f):N(r)?e(m,-1):e(p,1)}),T(u),Li(u,e=>o=e,()=>o),F(e,u),Xe()}Ar([`click`]);function zg(e,t){let n=e.site_url||null;if(!n&&/^https?:$/.test(location.protocol)&&!/^(localhost|127\.0\.0\.1|\[::1\])$/.test(location.hostname)&&(n=location.origin+location.pathname+location.search),!n)return null;let r=new URL(n.replace(/#.*$/,``));return r.pathname.endsWith(`/`)||(r.pathname+=`/`),r.href+la(e.release,`read`,t.paper,t.id)}function Bg(e,t){return`${t.id} (${t.number||`unnumbered`}), release ${e.release}`}function Vg(e){let t=[];for(let n of e.clauses||[])for(let e of[`spec`,`accept`,`refute`])n[e]&&t.push(n[e]);for(let n of e.links||[])t.push(n.name);return[...new Set(t)]}function Hg(e,t){if(!e.issues||!/^[\w.-]+\/[\w.-]+$/.test(e.issues))return null;let n=(e.papers||[]).find(e=>e.id===t.paper)||{},r=zg(e,t),i=Vg(t),a=[`**Claim:** ${t.number||`(unnumbered)`} — \`${t.id}\``,`**Paper:** ${n.title||t.paper}${n.revision?` (revision \`${String(n.revision).slice(0,12)}\`)`:``}`,`**Lean:** ${i.length?i.map(e=>"`"+e+"`").join(`, `):`(no declaration linked)`}`,`**Project commit:** ${e.project?.commit?"`"+e.project.commit.slice(0,12)+"`":`(unknown)`}`,`**Status shown:** ${t.status} (release \`${e.release}\`)`,`**Claim in the reader:** ${r||`(not published: `+Bg(e,t)+`)`}`,``,`### What looks wrong`,``,`<!-- Which hypothesis, quantifier, definition or conclusion differs between the paper and the Lean, and where. -->`,``,`---`,`_Opened from the MachineChecked reader. A report changes no status in the audit._`],o=`[${t.number||t.id}] Possible paper/Lean mismatch`,s=new URLSearchParams({title:o,body:a.join(`
275
+ `)});return`https://github.com/${e.issues}/issues/new?${s.toString()}`}function Ug(e,t,n){let r=e.project?.repository,i=e.project?.commit;if(!r||!/^[\w.-]+\/[\w.-]+$/.test(r)||!/^[0-9a-f]{7,40}$/.test(i||``)||!t||!/^[\w.'/-]+\.lean$/.test(t)||t.split(`/`).includes(`..`))return null;let a=Number.isInteger(n)&&n>0?`#L${n}`:``;return`https://github.com/${r}/blob/${i}/${t.split(`/`).map(encodeURIComponent).join(`/`)}${a}`}function Wg(e,t,n){let r=e.project||{};if(!t||!/^[\w.']+$/.test(t)||!(r.source_roots||[]).includes(t.split(`.`)[0]))return null;let i=r.source_prefix||``;return/^([\w.'-]+\/)*$/.test(i)?Ug(e,i+t.replaceAll(`.`,`/`)+`.lean`,n):null}function Gg(e){return e.project?.repository_private?`Lean source (private repository) ↗`:`Lean source ↗`}function Kg(e){return e.project?.repository_private?`The repository is private: this opens only for people with access to it.`:`The declaration in ${e.project?.repository} at the audited commit`}var qg=P(`<p class="muted">The page could not be rendered.</p>`),Jg=P(`<canvas aria-label="The claim as printed" class="svelte-1lgwjng"></canvas>`),Yg=P(`<p class="faint small svelte-1lgwjng"> </p>`),Xg=P(`<p class="faint small svelte-1lgwjng">Found by its bold heading in the PDF; where the statement ends is estimated, and it may extend beyond this band.</p>`),Zg=P(`<div class="crop svelte-1lgwjng"><!> <!> <!></div>`);function Qg(e,t){Ye(t,!0);let n=Jt(void 0),r=Jt(void 0),i=Jt(!1);Tn(()=>{if(!N(n)||!N(r))return;let e=t.anchor.head||t.anchor.begin,a=e[0],o=t.anchor.head?e[2]-12:e[2],s=t.anchor.end&&t.anchor.end[0]===a?Math.max(t.anchor.end[2]+5,o+18)+(t.anchor.kind===`approximate`?40:0):o+220;jg(t.url).then(e=>Mg(e,a,N(n),Math.min(N(r).clientWidth,760),[o,s])).catch(e=>{console.error(`crop`,e),D(i,!0)})});var a=Zg(),o=O(a),s=e=>{F(e,qg())},c=e=>{var t=Jg();Li(t,e=>D(n,e),()=>N(n)),F(e,t)};L(o,e=>{N(i)?e(s):e(c,-1)});var l=j(o,2),u=e=>{var n=zr(),r=k(n),i=e=>{var n=Yg(),r=A(n);M(()=>I(r,`Located approximately (SyncTeX, from ${t.anchor.file??``}:${t.anchor.line??``}); the claim may extend beyond this band.`)),F(e,n)},a=e=>{F(e,Xg())};L(r,e=>{t.anchor.file?e(i):e(a,-1)}),F(e,n)},d=e=>{var n=Yg(),r=A(n);M(()=>I(r,`Placed by hand${t.anchor.by?` by `+t.anchor.by:``}${t.anchor.note?`: `+t.anchor.note:``}.`)),F(e,n)};L(l,e=>{t.anchor.kind===`approximate`?e(u):t.anchor.kind===`manual`&&e(d,1)});var f=j(l,2),p=e=>{var n=Yg(),r=A(n);M(()=>I(r,`Continues on page ${t.anchor.end[0]??``}.`)),F(e,n)};L(f,e=>{t.anchor.end&&t.anchor.end[0]!==t.anchor.begin[0]&&e(p)}),T(a),Li(a,e=>D(r,e),()=>N(r)),F(e,a),Xe()}var $g=P(`<button class="r svelte-1e51xbp"> </button>`),e_=P(`<span class="c svelte-1e51xbp"> </span>`),t_=P(`<code class="lean svelte-1e51xbp"></code>`);function n_(e,t){Ye(t,!0);let n=Vi(t,`onref`,3,null),r=Vi(t,`refs`,3,null);function i(e){let t=[];for(let n of e?.segments||[{t:e?.text||``}]){if(n.ref||!r()?.length){t.push(n);continue}let e=n.t;for(;e;){let n=null;for(let t of r()){let r=e.indexOf(t);r>=0&&(n===null||r<n.i||r===n.i&&t.length>n.r.length)&&(n={i:r,r:t})}if(!n){t.push({t:e});break}n.i&&t.push({t:e.slice(0,n.i)}),t.push({t:n.r,ref:n.r}),e=e.slice(n.i+n.r.length)}}return t}let a=e=>r()?.includes(e);var o=t_();$r(o,21,()=>i(t.pp),Yr,(e,t)=>{var r=zr(),i=k(r),o=e=>{var r=$g(),i=A(r,!0);M(()=>I(i,N(t).t)),kr(`click`,r,()=>n()(N(t).ref)),F(e,r)},s=E(()=>N(t).ref&&n()&&a(N(t).ref)),c=e=>{var n=e_(),r=A(n,!0);M(()=>{Ti(n,`title`,N(t).ref),I(r,N(t).t)}),F(e,n)},l=e=>{var n=Rr();M(()=>I(n,N(t).t)),F(e,n)};L(i,e=>{N(s)?e(o):N(t).ref?e(c,1):e(l,-1)}),F(e,r)}),T(o),F(e,o),Xe()}Ar([`click`]);var r_=P(`<p class="name svelte-1hh5t09"><code> </code></p>`),i_=P(`<span class="hn svelte-1hh5t09"> </span>`),a_=P(`<span class="v svelte-1hh5t09"> </span><span class="colon svelte-1hh5t09">:</span>`,1),o_=P(`<li><span class="role svelte-1hh5t09"> </span> <!> <!></li>`),s_=P(`<button class="more svelte-1hh5t09"> </button>`),c_=P(`<ol class="ribbon svelte-1hh5t09" aria-label="Quantifiers and hypotheses, in order"></ol> <!>`,1),l_=P(`<span class="role svelte-1hh5t09">then</span>`),u_=P(`<div class="concl svelte-1hh5t09"><!> <!></div>`),d_=P(`<p class="hint faint svelte-1hh5t09">The order of the rows is the order of the quantifiers: a “there is” above a “for all”
276
+ chooses one value for every case below it.</p>`),f_=P(`<div><!> <!> <!> <!></div>`);function p_(e,t){Ye(t,!0);let n=Vi(t,`spec`,3,null),r=Vi(t,`compact`,3,!1),i=Jt(!1),a=E(()=>N(i)||!r()?t.st.binders||[]:(t.st.binders||[]).slice(0,10)),o=E(()=>[...t.st.closure||[],...t.st.direct||[]].sort((e,t)=>t.length-e.length)),s={forall:`for all`,exists:`there is`,hypothesis:`assume`,instance:`instance`};var c=f_();let l;var u=O(c),d=e=>{var t=r_(),r=A(O(t),!0);T(t),M(()=>I(r,n())),F(e,t)};L(u,e=>{!r()&&n()&&e(d)});var f=j(u,2),p=e=>{var n=c_(),r=k(n);$r(r,21,()=>N(a),Yr,(e,n)=>{var r=o_(),i=O(r),a=A(i,!0),c=j(i,2),l=e=>{var t=i_(),r=A(t);M(()=>I(r,`(${N(n).name??``})`)),F(e,t)},u=e=>{var t=a_(),r=A(k(t),!0);De(),M(()=>I(r,N(n).name)),F(e,t)};L(c,e=>{N(n).role===`hypothesis`?e(l):N(n).role!==`instance`&&e(u,1)}),n_(j(c,2),{get pp(){return N(n).type},get onref(){return t.onref},get refs(){return N(o)}}),T(r),M(()=>{di(r,1,`b `+N(n).role,`svelte-1hh5t09`),I(a,s[N(n).role]||N(n).role)}),F(e,r)}),T(r);var c=j(r,2),l=e=>{var n=s_(),r=A(n);M(()=>I(r,`Show all ${t.st.binders.length??``} quantifiers and hypotheses`)),kr(`click`,n,()=>D(i,!0)),F(e,n)};L(c,e=>{N(a).length<t.st.binders.length&&e(l)}),F(e,n)};L(f,e=>{t.st.binders?.length&&e(p)});var m=j(f,2),h=e=>{var n=u_(),r=O(n),i=e=>{F(e,l_())};L(r,e=>{t.st.binders?.length&&e(i)}),n_(j(r,2),{get pp(){return t.st.conclusion},get onref(){return t.onref},get refs(){return N(o)}}),T(n),F(e,n)};L(m,e=>{t.st.conclusion&&e(h)});var g=j(m,2),_=e=>{F(e,d_())},v=E(()=>!r()&&t.st.binders?.some(e=>e.role===`exists`));L(g,e=>{N(v)&&e(_)}),T(c),M(()=>l=di(c,1,`stmt svelte-1hh5t09`,null,l,{compact:r()})),F(e,c),Xe()}Ar([`click`]);var m_=P(`<li><span class="m svelte-1388pfo" aria-hidden="true"> </span> <span class="n svelte-1388pfo"> </span> <span class="w svelte-1388pfo"> </span></li>`),h_=P(`<ol class="ladder svelte-1388pfo"></ol>`);function g_(e,t){let n={pass:`✓`,fail:`✗`,open:`…`,author:`◐`,none:`–`,"n/a":`–`,"pdf-only":`◌`,"not-run":`○`,unverified:`?`},r={pass:`passed`,fail:`failed`,open:`open`,author:`author only`,none:`none`,"n/a":`not applicable`,"pdf-only":`PDF only`,"not-run":`not run`,unverified:`unverified`};var i=h_();$r(i,21,()=>t.rungs,Yr,(e,t)=>{var i=m_(),a=O(i),o=A(a,!0),s=j(a,2),c=A(s,!0),l=A(j(s,2),!0);T(i),M(e=>{di(i,1,e,`svelte-1388pfo`),Ti(i,`title`,N(t).detail),I(o,n[N(t).state]||`?`),I(c,N(t).rung),I(l,r[N(t).state]||N(t).state)},[()=>`r `+N(t).state.replace(`/`,``)]),F(e,i)}),T(i),F(e,i)}var __=P(`<p class="muted">None.</p>`),v_=P(`<li class="svelte-f1muti"> </li>`),y_=P(`<div class="tier violation svelte-f1muti"><h3 class="svelte-f1muti">Violations <span class="faint svelte-f1muti">· mechanical facts that contradict acceptance</span></h3> <ul class="svelte-f1muti"></ul></div>`),b_=P(`<div class="tier obligation svelte-f1muti"><h3 class="svelte-f1muti">Review obligations <span class="faint svelte-f1muti">· judgements only a reviewer can make</span></h3> <ul class="svelte-f1muti"></ul></div>`),x_=P(`<span class="pill svelte-f1muti">low signal</span>`),S_=P(`<span class="dz svelte-f1muti"> </span>`),C_=P(`<span class="dz svelte-f1muti">an earlier dismissal no longer applies: the statement changed</span>`),w_=P(`<li> <!></li>`),T_=P(`<div><p class="gh svelte-f1muti"><code> </code> <!></p> <ul class="svelte-f1muti"></ul></div>`),E_=P(`<details class="tier warning svelte-f1muti"><summary class="svelte-f1muti"><strong>Warnings</strong> <span class="faint svelte-f1muti"> </span></summary> <!></details>`),D_=P(`<!> <!> <!> <!>`,1);function O_(e,t){Ye(t,!0);let n=E(()=>t.findings.filter(e=>!e.dismissed)),r=E(()=>N(n).filter(e=>e.tier===`violation`)),i=E(()=>N(n).filter(e=>e.tier===`obligation`)),a=E(()=>t.findings.filter(e=>e.tier===`warning`)),o=E(()=>{let e=new Map;for(let t of N(a)){let n=t.trigger||t.code;e.has(n)||e.set(n,{trigger:n,low:t.signal===`low`,items:[]}),e.get(n).items.push(t)}return[...e.values()].sort((e,t)=>e.low-t.low||t.items.length-e.items.length)}),s=e=>e.message.replace(/\s*\([^()]*occurs in [^()]*\)$/,``);var c=D_(),l=k(c),u=e=>{F(e,__())};L(l,e=>{t.findings.length||e(u)});var d=j(l,2),f=e=>{var t=y_(),n=j(O(t),2);$r(n,21,()=>N(r),e=>e.id,(e,t)=>{var n=v_(),r=A(n,!0);M(()=>I(r,N(t).message)),F(e,n)}),T(n),T(t),F(e,t)};L(d,e=>{N(r).length&&e(f)});var p=j(d,2),m=e=>{var t=b_(),n=j(O(t),2);$r(n,21,()=>N(i),e=>e.id,(e,t)=>{var n=v_(),r=A(n,!0);M(()=>I(r,N(t).message)),F(e,n)}),T(n),T(t),F(e,t)};L(p,e=>{N(i).length&&e(m)});var h=j(p,2),g=e=>{var t=E_(),n=O(t),r=A(j(O(n),2));T(n),$r(j(n,2),17,()=>N(o),e=>e.trigger,(e,t)=>{var n=T_();let r;var i=O(n),a=O(i),o=A(a,!0),c=j(a),l=j(c),u=e=>{F(e,x_())};L(l,e=>{N(t).low&&e(u)}),T(i);var d=j(i,2);$r(d,21,()=>N(t).items,e=>e.id,(e,t)=>{var n=w_();let r;var i=O(n),a=j(i),o=e=>{var n=S_(),r=A(n);M(()=>I(r,`dismissed by ${N(t).dismissed.by??``}: “${N(t).dismissed.rationale??``}”`)),F(e,n)},s=e=>{F(e,C_())};L(a,e=>{N(t).dismissed?e(o):N(t).dismissal_stale&&e(s,1)}),T(n),M(e=>{r=di(n,1,`svelte-f1muti`,null,r,{dismissed:N(t).dismissed}),I(i,`in clause ${e??``} `)},[()=>N(t).subject.split(`#`)[1]??``]),F(e,n)}),T(d),T(n),M(e=>{r=di(n,1,`group svelte-f1muti`,null,r,{low:N(t).low}),I(o,N(t).trigger),I(c,` — ${e??``} `)},[()=>s(N(t).items[0])]),F(e,n)}),T(t),M(e=>I(r,`· heuristics that may be wrong ·
277
+ ${e??``}`),[()=>N(o).map(e=>`${e.trigger} ×${e.items.length}`).join(`, `)]),F(e,t)};L(h,e=>{N(a).length&&e(g)}),F(e,c),Xe()}var k_=P(`<span> </span>`),A_=P(`<span class="faint"> </span> <!>`,1),j_=P(`<p class="err svelte-13s8f78"> </p>`),M_=P(`<p class="faint">Loading…</p>`),N_=P(`<p class="small"><a target="_blank" rel="noopener"> </a></p>`),P_=P(`<p class="lbl svelte-13s8f78">docstring (the author's words, not the definition)</p>`),F_=P(`<!> <p class="doc svelte-13s8f78"> </p>`,1),I_=P(`<p class="lbl svelte-13s8f78">type</p> <!>`,1),L_=P(`<p class="lbl svelte-13s8f78">value</p> <!>`,1),R_=P(`<pre class="rtext svelte-13s8f78"> </pre>`),z_=P(`<p class="lbl svelte-13s8f78"> </p> <!>`,1),B_=P(`<p class="lbl svelte-13s8f78"> </p>`),V_=P(`<p class="fp faint svelte-13s8f78"> </p>`),H_=P(`<!> <!> <!> <!> <!> <!>`,1),U_=P(`<details class="decl svelte-13s8f78"><summary class="svelte-13s8f78"><code> </code> <!></summary> <!></details>`);function W_(e,t){Ye(t,!0);let n=Vi(t,`open`,3,!1),r=Vi(t,`hideReview`,3,!1),i=Jt(!1),a=Jt(null);Tn(()=>{n()&&D(i,!0)});let o=Jt(null);Tn(()=>{N(i)&&!N(a)&&!N(o)&&(t.key?ra(t.key).then(e=>D(a,e,!0)).catch(e=>D(o,`record ${t.key} missing: ${e.message}`)):D(o,`not part of this claim's closure in this release`))});var s=U_(),c=O(s),l=O(c),u=A(l,!0),d=j(l,2),f=e=>{var t=A_(),n=k(t),i=A(n),o=j(n,2),s=e=>{var t=k_(),n=A(t,!0);M(()=>{di(t,1,`rv rv-`+N(a).review.state,`svelte-13s8f78`),I(n,N(a).review.state)}),F(e,t)};L(o,e=>{N(a).review&&!r()&&e(s)}),M(()=>I(i,`${N(a).kind??``}${N(a).module?` · `+N(a).module:``}${N(a).range?`:`+N(a).range.line:``}`)),F(e,t)};L(d,e=>{N(a)&&e(f)}),T(c);var p=j(c,2),m=e=>{var n=zr(),i=k(n),s=e=>{var t=j_(),n=A(t,!0);M(()=>I(n,N(o))),F(e,t)},c=e=>{F(e,M_())},l=e=>{var n=H_(),i=k(n),o=e=>{var t=N_(),n=O(t),r=A(n,!0);T(t),M((e,t,i)=>{Ti(n,`href`,e),Ti(n,`title`,t),I(r,i)},[()=>Wg(Yi,N(a).module,N(a).range?.line),()=>Kg(Yi),()=>Gg(Yi)]),F(e,t)},s=E(()=>Yi&&Wg(Yi,N(a).module,N(a).range?.line));L(i,e=>{N(s)&&e(o)});var c=j(i,2),l=e=>{var t=F_(),n=k(t),i=e=>{F(e,P_())};L(n,e=>{r()&&e(i)});var o=A(j(n,2),!0);M(()=>I(o,N(a).doc)),F(e,t)};L(c,e=>{N(a).doc&&e(l)});var u=j(c,2),d=e=>{var n=I_();n_(j(k(n),2),{get pp(){return N(a).signature},get onref(){return t.onref},get refs(){return N(a).uses}}),F(e,n)};L(u,e=>{N(a).signature&&e(d)});var f=j(u,2),p=e=>{var n=L_();n_(j(k(n),2),{get pp(){return N(a).value},get onref(){return t.onref},get refs(){return N(a).uses}}),F(e,n)};L(f,e=>{N(a).value&&e(p)});var m=j(f,2),h=e=>{},g=e=>{var t=zr();$r(k(t),17,()=>N(a).review.current,Yr,(e,t)=>{var n=z_(),r=k(n),i=A(r),a=j(r,2),o=e=>{var n=R_(),r=A(n,!0);M(()=>I(r,N(t).text)),F(e,n)};L(a,e=>{N(t).text&&e(o)}),M(()=>I(i,`review · ${N(t).by??``}${N(t).kind===`ai`?` (AI)`:N(t).kind===`human`?` (human)`:``} · ${N(t).provenance??``}`)),F(e,n)}),F(e,t)},_=e=>{var t=B_(),n=A(t);M(()=>I(n,`no current review${N(a).review.stale?.length?` (the last one is stale)`:``}`)),F(e,t)};L(m,e=>{r()?e(h):N(a).review?.current?.length?e(g,1):N(a).review&&e(_,2)});var v=j(m,2),y=e=>{var t=V_(),n=A(t);M(e=>{Ti(t,`title`,N(a).legacy_hash?`legacy `+N(a).legacy_hash:``),I(n,`${e??``}…`)},[()=>N(a).fingerprint.slice(0,24)]),F(e,t)};L(v,e=>{N(a).fingerprint&&e(y)}),F(e,n)};L(i,e=>{N(o)?e(s):N(a)?e(l,-1):e(c,1)}),F(e,n)};L(p,e=>{N(i)&&e(m)}),T(s),M(()=>{Ti(s,`id`,`decl-`+t.name),I(u,t.name)}),Ri(`open`,`toggle`,s,e=>D(i,e),()=>N(i)),F(e,s),Xe()}var G_=P(`<div class="tex svelte-p7c5l5"></div>`);function K_(e,t){Ye(t,!0);let n;Tn(()=>{n&&(n.textContent=t.text.replace(/\\label\{[^}]*\}/g,``).replace(/\\(emph|textit|textbf)\{([^}]*)\}/g,`$2`).replace(/~/g,` `),ad(n,{delimiters:[{left:`\\[`,right:`\\]`,display:!0},{left:`\\begin{equation}`,right:`\\end{equation}`,display:!0},{left:`$$`,right:`$$`,display:!0},{left:`\\(`,right:`\\)`,display:!1},{left:`$`,right:`$`,display:!1}],throwOnError:!1}))});var r=G_();Li(r,e=>n=e,()=>n),F(e,r),Xe()}var q_=P(`<li class="svelte-1y15j1a"><div class="info svelte-1y15j1a"><code> </code> <span class="faint"> </span> <div class="ty svelte-1y15j1a"> </div></div> <button class="btn svelte-1y15j1a">Link</button></li>`),J_=P(`<ul class="svelte-1y15j1a"></ul>`),Y_=P(`<p class="faint small svelte-1y15j1a">No declaration matches.</p>`),X_=P(`<div class="picker svelte-1y15j1a"><input type="search" placeholder="Link a different Lean declaration…" class="svelte-1y15j1a"/> <!></div>`);function Z_(e,t){Ye(t,!0);let n=Vi(t,`disabled`,3,!1),r=Jt(``),i=Jt(null);function a(){N(i)||ea(t.index).then(e=>D(i,e,!0)).catch(()=>D(i,[],!0))}let o=E(()=>{let e=N(r).toLowerCase().split(/\s+/).filter(Boolean);return!N(i)||!e.length?[]:N(i).filter(t=>e.every(e=>(t.name+` `+t.doc).toLowerCase().includes(e))).slice(0,12)});var s=X_(),c=O(s);wi(c);var l=j(c,2),u=e=>{var r=J_();$r(r,21,()=>N(o),e=>e.name,(e,r)=>{var i=q_(),a=O(i),o=O(a),s=A(o,!0),c=j(o,2),l=A(c,!0),u=A(j(c,2),!0);T(a);var d=j(a,2);T(i),M(()=>{I(s,N(r).name),I(l,N(r).kind),I(u,N(r).type),d.disabled=n()}),kr(`click`,d,()=>t.onpick(N(r).name)),F(e,i)}),T(r),F(e,r)},d=e=>{F(e,Y_())};L(l,e=>{N(o).length?e(u):N(r)&&N(i)&&e(d,1)}),T(s),M(()=>c.disabled=n()),Or(`focus`,c,a),ki(c,()=>N(r),e=>D(r,e)),F(e,s),Xe()}Ar([`click`]);var Q_=P(`<p> </p>`),$_=P(`<p class="muted">Loading…</p>`),ev=P(`· <a>show in the paper</a>`,1),tv=P(`<span class="title svelte-15lq3eu">&nbsp;— <!></span>`),nv=P(`<p class="desc svelte-15lq3eu"><!></p>`),rv=P(`<a class="act svelte-15lq3eu" title="Compare the paper's statement with the Lean, one unit at a time, and record what you find">Review it</a>`),iv=P(`<a class="act svelte-15lq3eu" target="_blank" rel="noopener">Raise issue ↗</a>`),av=P(`<p class="muted">The printed statement is not part of this site.</p>`),ov=P(`<span class="faint"> </span>`),sv=P(`<a class="src-link small svelte-15lq3eu" target="_blank" rel="noopener"> </a>`),cv=P(`<button class="btn ghost svelte-15lq3eu">Unlink</button>`),lv=P(`<div class="card svelte-15lq3eu"><p class="decl svelte-15lq3eu"><code> </code><!> <!></p> <p class="faint small src svelte-15lq3eu"> </p> <p class="verdict top svelte-15lq3eu"> </p> <!> <!></div>`),uv=P(`<p class="muted">Not linked to a Lean declaration.</p>`),dv=P(`<div class="row svelte-15lq3eu"><button class="btn svelte-15lq3eu">Link</button> <button class="btn ghost svelte-15lq3eu">Not this</button></div>`),fv=P(`<p class="faint small svelte-15lq3eu">A suggestion, not a link. Run <code>machinechecked view</code> to confirm it.</p>`),pv=P(`<div class="card suggestion svelte-15lq3eu"><p class="decl svelte-15lq3eu"><code> </code> <span class="faint"> </span></p> <!> <!></div>`),mv=P(`<h3 class="svelte-15lq3eu">Suggested</h3> <!>`,1),hv=P(`<p class="faint small svelte-15lq3eu">Saving the link and rebuilding…</p>`),gv=P(`<p class="bad small svelte-15lq3eu"> </p>`),_v=P(`<!> <!> <!> <!> <!>`,1),vv=P(`<span class="faint">&nbsp;— corrects “<!>”</span>`),yv=P(`<p class="cname svelte-15lq3eu"><!><!></p>`),bv=P(`<li class="add">adds the hypothesis <code class="svelte-15lq3eu"> </code></li>`),xv=P(`<li class="drop">drops the hypothesis <code class="svelte-15lq3eu"> </code></li>`),Sv=P(`<li>its variables or their types differ</li>`),Cv=P(`<div class="changes svelte-15lq3eu"><p class="small svelte-15lq3eu"><strong>Compared with “<!>”</strong></p> <ul class="small svelte-15lq3eu"><!> <!> <!> <li> </li></ul></div>`),wv=P(`<!><button class="ref svelte-15lq3eu"> </button>`,1),Tv=P(`<p></p>`),Ev=P(`<div><!> <p class="verdict top svelte-15lq3eu"> </p> <!> <!></div>`),Dv=P(`<p class="muted">No Lean statement has been written for this claim.</p>`),Ov=P(`<li><!></li>`),kv=P(`<details class="why svelte-15lq3eu"><summary class="svelte-15lq3eu">Why is this claim not accepted? <span class="faint"> </span></summary> <ul class="svelte-15lq3eu"></ul></details>`),Av=P(`<!> <!>`,1),jv=P(`<h3 class="svelte-15lq3eu">Number</h3> <p class="summary svelte-15lq3eu"> <span class="faint"> </span></p>`,1),Mv=P(`<span class="bad svelte-15lq3eu">· differs from the frozen inventory</span>`),Nv=P(`<p class="faint small svelte-15lq3eu"><code> </code> <!> <!></p>`),Pv=P(`<h3 class="svelte-15lq3eu">Source text</h3> <!> <!>`,1),Fv=P(`<p class="muted small svelte-15lq3eu"> </p>`),Iv=P(`<dt class="svelte-15lq3eu"> </dt> <dd class="svelte-15lq3eu"><code> </code> <span class="faint"> </span></dd>`,1),Lv=P(`<dl class="proof svelte-15lq3eu"></dl>`),Rv=P(`<p class="small svelte-15lq3eu">Witness <code> </code>:</p> <!>`,1),zv=P(`<li> <!></li>`),Bv=P(`<ul class="small svelte-15lq3eu"></ul>`),Vv=P(`<pre class="rtext svelte-15lq3eu"> </pre>`),Hv=P(`<div class="review svelte-15lq3eu"><p class="small svelte-15lq3eu"><strong> </strong> <span class="pill svelte-15lq3eu"> </span> <span class="pill svelte-15lq3eu"> </span></p> <!></div>`),Uv=P(`<p class="muted small svelte-15lq3eu">The proposition has no current review.</p>`),Wv=P(`<p class="small muted svelte-15lq3eu"> </p>`),Gv=P(`<h3 class="svelte-15lq3eu"><!></h3> <!> <!> <!> <!> <!> <!>`,1),Kv=P(`<button class="btn ghost svelte-15lq3eu"> </button>`),qv=P(`<h3 class="svelte-15lq3eu"> </h3> <!> <!> <!>`,1),Jv=P(`<h3 class="svelte-15lq3eu">Findings</h3> <!>`,1),Yv=P(`· project <code> </code>`,1),Xv=P(`<article><header class="svelte-15lq3eu"><p class="eyebrow svelte-15lq3eu"><!><code> </code> <!></p> <h1 class="svelte-15lq3eu"> <!></h1> <!> <!> <div class="actions svelte-15lq3eu"><button class="act svelte-15lq3eu"> </button> <!> <!></div></header> <section><!></section> <section class="lean"><h2 class="svelte-15lq3eu">In Lean</h2> <!></section> <details class="tech svelte-15lq3eu"><summary class="svelte-15lq3eu">Technical details</summary> <!> <!> <!> <!> <!> <!> <p class="faint small foot svelte-15lq3eu">Release <code> </code> · evidence <code> </code> <!> <!></p></details></article>`);function Zv(e,t){Ye(t,!0);let n=Vi(t,`full`,3,!1),r=Vi(t,`editable`,3,!1),i=Jt(null),a=Jt(null),o=Jt(null),s=Jt(!1),c=Jt(null),l=Jt(null),u={stale:0,pending:1,"author-reviewed":2,reviewed:3};Tn(()=>{D(i,null),D(a,null),D(o,null),D(s,!1),D(l,null),na(t.index,t.claimId).then(e=>D(i,e,!0)).catch(e=>D(a,String(e),!0))});let d=E(()=>N(i)&&t.index.papers.find(e=>e.id===N(i).paper)),f=E(()=>t.index.claims.find(e=>e.id===t.claimId)),p=E(()=>N(i)?.mode===`simple`);function h(e){D(o,e,!0),queueMicrotask(()=>document.getElementById(`decl-`+e)?.scrollIntoView({block:`nearest`,behavior:`smooth`}))}async function g(e,t){D(c,t,!0),D(l,null);try{await $i({key:N(i).key,...e}),location.reload()}catch(e){D(l,String(e.message||e),!0),D(c,null)}}function _(e){if(!e.corrects||!e.statement)return null;let t=N(i).clauses.find(t=>t.name===e.corrects);if(!t?.statement)return null;let n=e=>typeof e==`string`?e:e?.text??(e?.segments||[]).map(e=>e.t).join(``),r=e=>(e.binders||[]).filter(e=>e.role===`hypothesis`).map(e=>n(e.type)),a=e=>(e.binders||[]).filter(e=>e.role!==`hypothesis`).map(e=>e.role+` `+e.name+` : `+n(e.type)),o=r(t.statement),s=r(e.statement),c=s.filter(e=>!o.includes(e)),l=o.filter(e=>!s.includes(e)),u=a(t.statement),d=a(e.statement);return{label:t.label||t.name,added:c,dropped:l,varsSame:u.length===d.length&&u.every((e,t)=>e===d[t]),conclusionSame:n(t.statement.conclusion)===n(e.statement.conclusion)}}function v(e){let t=e.checks||{},n=t.accept||t.refute;if(e.state===`unchecked`)return`The Lean project was not checked in this build.`;if(e.state===`unspecified`)return`No Lean statement has been written for it yet.`;if(e.state===`stated`)return`Stated in Lean as definitions.`;if(!n)return`A Lean statement exists; it has no proof yet.`;if(!n.ok)return`The Lean proof fails a check: `+n.errors.join(`, `)+`.`;let r=t.replay?.state===`pass`?`, replayed independently`:``,i={reviewed:`its meaning reviewed independently`,"author-reviewed":`its meaning reviewed only by its author`,pending:`its meaning not yet reviewed`}[e.review]||``;return(e.state===`refuted`?`Lean proves the printed statement false`:`Proved in Lean`)+r+(i?`; `+i:``)+`.`}let y=Jt(null);async function b(){let e=zg(t.index,N(i))||Bg(t.index,N(i));try{await navigator.clipboard.writeText(e),D(y,zg(t.index,N(i))?`Link copied`:`Reference copied`,!0)}catch{window.prompt(`Copy this:`,e)}setTimeout(()=>D(y,null),2e3)}function x(e){let t=e.status||``;return t.includes(`not checked`)?`Lean has not been run on it here: the project is not built, so whether it is proved is not known.`:t.includes(`not found`)?`Not found in the built modules.`:t.includes(`definition`)?`A Lean ${e.kind||`definition`}.`:t.includes(`incomplete`)?`Its Lean proof is incomplete (it uses sorry).`:t.includes(`further axioms`)?`Its proof uses axioms beyond the standard three: `+(e.axioms||[]).join(`, `)+`.`:t===`linked: Lean proof checked`?`Proved in Lean. Whether it says what the paper says has not been reviewed.`:t}var S=zr(),ee=k(S),te=e=>{var t=Q_(),n=A(t,!0);M(()=>I(n,N(a))),F(e,t)},ne=e=>{F(e,$_())},C=e=>{var a=Xv();let S;var ee=O(a),te=O(ee),ne=O(te),C=e=>{var t=Rr();M(()=>I(t,`Paper ${N(i).paper??``} ·`)),F(e,t)};L(ne,e=>{t.index.papers.length>1&&e(C)});var re=j(ne),ie=A(re,!0),ae=j(re,2),w=e=>{var n=ev(),r=j(k(n));M(e=>Ti(r,`href`,e),[()=>la(t.index.release,`read`,N(i).paper,N(i).id)]),F(e,n)};L(ae,e=>{n()&&N(f)?.anchor&&e(w)}),T(te);var oe=j(te,2),se=O(oe,!0),ce=j(se),le=e=>{var t=tv();sd(j(O(t)),{get text(){return N(i).heading}}),T(t),F(e,t)};L(ce,e=>{N(i).heading&&e(le)}),T(oe);var ue=j(oe,2),de=e=>{var t=nv();sd(O(t),{get text(){return N(i).title}}),T(t),F(e,t)};L(ue,e=>{!N(i).heading&&N(i).title&&e(de)});var fe=j(ue,2);ld(fe,{get status(){return N(i).status},get cls(){return N(i).class}});var pe=j(fe,2),me=O(pe),he=A(me,!0),ge=j(me,2),_e=e=>{var n=rv();M(e=>Ti(n,`href`,e),[()=>la(t.index.release,`review`)]),F(e,n)},ve=E(()=>t.index.review_queue&&N(i).scope!==`out-of-scope`&&!String(N(i).status).startsWith(`out of scope`));L(ge,e=>{N(ve)&&e(_e)});var ye=j(ge,2),be=e=>{var n=iv();M(e=>{Ti(n,`href`,e),Ti(n,`title`,`Opens a draft issue in `+t.index.issues+` with this claim's details filled in`)},[()=>Hg(t.index,N(i))]),F(e,n)},xe=E(()=>Hg(t.index,N(i)));L(ye,e=>{N(xe)&&e(be)}),T(pe),T(ee);var Se=j(ee,2),Ce=O(Se),we=e=>{{let t=E(()=>`data/`+N(d).pdf);Qg(e,{get url(){return N(t)},get anchor(){return N(i).anchor}})}},Te=e=>{K_(e,{get text(){return N(i).statement_tex}})},Ee=e=>{F(e,av())};L(Ce,e=>{N(d)?.pdf&&N(i).anchor?.begin?e(we):N(i).statement_tex?e(Te,1):e(Ee,-1)}),T(Se);var Oe=j(Se,2),ke=j(O(Oe),2),Ae=e=>{var n=_v(),a=k(n);$r(a,17,()=>N(i).links,e=>e.name,(e,n)=>{var a=lv(),o=O(a),s=O(o),l=A(s,!0),u=j(s),d=e=>{var t=ov(),r=A(t);M(()=>I(r,`· ${N(n).module??``}${N(n).range?`:`+N(n).range.line:``}`)),F(e,t)};L(u,e=>{N(n).module&&e(d)});var f=j(u,2),p=e=>{var r=sv(),i=A(r,!0);M((e,t,n)=>{Ti(r,`href`,e),Ti(r,`title`,t),I(i,n)},[()=>Ug(t.index,N(n).path,N(n).range?.line),()=>Kg(t.index),()=>Gg(t.index)]),F(e,r)},m=E(()=>Ug(t.index,N(n).path,N(n).range?.line));L(f,e=>{N(m)&&e(p)}),T(o);var _=j(o,2),v=A(_,!0),y=j(_,2),b=A(y,!0),S=j(y,2),ee=e=>{p_(e,{get st(){return N(n).statement},onref:h,compact:!0})};L(S,e=>{N(n).statement&&e(ee)});var te=j(S,2),ne=e=>{var t=cv();M(()=>t.disabled=!!N(c)),kr(`click`,t,()=>g({lean:N(i).links.filter(e=>e.name!==N(n).name).map(e=>e.name)},`unlink`)),F(e,t)};L(te,e=>{r()&&e(ne)}),T(a),M(e=>{I(l,N(n).name),I(v,N(n).source===`paper`?`Linked by a \\lean{…} tag in the paper's source`:N(n).source===`formalization.yaml`?`Declared in the project's formalization.yaml`+(t.index.formalization?.review_status?` (the project describes its review as “${t.index.formalization.review_status}”)`:``):`Linked in the reader (machinechecked.links.json)`),I(b,e)},[()=>x(N(n))]),F(e,a)},e=>{F(e,uv())});var o=j(a,2),s=e=>{var t=mv();$r(j(k(t),2),17,()=>N(i).suggestions.filter(e=>!N(i).links.some(t=>t.name===e.name)),e=>e.name,(e,t)=>{var n=pv(),a=O(n),o=O(a),s=A(o,!0),l=A(j(o,2));T(a);var u=j(a,2),d=e=>{p_(e,{get st(){return N(t).statement},onref:h,compact:!0})};L(u,e=>{N(t).statement&&e(d)});var f=j(u,2),p=e=>{var n=dv(),r=O(n),a=j(r,2);T(n),M(()=>{r.disabled=!!N(c)||!N(t).kind,a.disabled=!!N(c)}),kr(`click`,r,()=>g({lean:[...N(i).links.map(e=>e.name),N(t).name]},`link`)),kr(`click`,a,()=>g({reject:[N(t).name]},`reject`)),F(e,n)},m=e=>{F(e,fv())};L(f,e=>{r()?e(p):e(m,-1)}),T(n),M(()=>{I(s,N(t).name),I(l,`— ${N(t).why??``}`)}),F(e,n)}),F(e,t)},u=E(()=>N(i).suggestions?.some(e=>!N(i).links.some(t=>t.name===e.name)));L(o,e=>{N(u)&&e(s)});var d=j(o,2),f=e=>{{let n=E(()=>!!N(c));Z_(e,{get index(){return t.index},get disabled(){return N(n)},onpick:e=>g({lean:[...N(i).links.map(e=>e.name),e]},`link`)})}};L(d,e=>{r()&&e(f)});var p=j(d,2),m=e=>{F(e,hv())};L(p,e=>{N(c)&&e(m)});var _=j(p,2),v=e=>{var t=gv(),n=A(t,!0);M(()=>I(n,N(l))),F(e,t)};L(_,e=>{N(l)&&e(v)}),F(e,n)},je=e=>{var t=Av(),n=k(t);$r(n,17,()=>N(i).clauses,Yr,(e,t)=>{var n=Ev();let r;var a=O(n),o=e=>{var n=yv(),r=O(n);{let e=E(()=>N(t).label||N(t).name);sd(r,{get text(){return N(e)}})}var i=j(r),a=e=>{var n=vv(),r=j(O(n));{let e=E(()=>N(t).corrects_label||N(t).corrects);sd(r,{get text(){return N(e)}})}De(),T(n),F(e,n)};L(i,e=>{N(t).corrects&&e(a)}),T(n),F(e,n)};L(a,e=>{N(i).clauses.length>1&&e(o)});var s=j(a,2),c=A(s,!0),l=j(s,2),u=e=>{let n=E(()=>_(N(t)));var r=Cv(),i=O(r),a=O(i);sd(j(O(a)),{get text(){return N(n).label}}),De(),T(a),T(i);var o=j(i,2),s=O(o);$r(s,17,()=>N(n).added,Yr,(e,t)=>{var n=bv(),r=A(j(O(n)),!0);T(n),M(()=>I(r,N(t))),F(e,n)});var c=j(s,2);$r(c,17,()=>N(n).dropped,Yr,(e,t)=>{var n=xv(),r=A(j(O(n)),!0);T(n),M(()=>I(r,N(t))),F(e,n)});var l=j(c,2),u=e=>{F(e,Sv())};L(l,e=>{N(n).varsSame||e(u)});var d=A(j(l,2),!0);T(o),T(r),M(()=>I(d,N(n).conclusionSame?`the same conclusion`:`a different conclusion`)),F(e,r)},d=E(()=>_(N(t)));L(l,e=>{N(d)&&e(u)});var f=j(l,2),p=e=>{p_(e,{get st(){return N(t).statement},get spec(){return N(t).spec},onref:h,compact:!0})},m=e=>{var n=Tv();$r(n,21,()=>N(t).defs,Yr,(e,t,n)=>{var r=wv(),i=k(r),a=e=>{F(e,Rr(`,`))};L(i,e=>{n&&e(a)});var o=j(i),s=A(o,!0);M(()=>I(s,N(t))),kr(`click`,o,()=>h(N(t))),F(e,r)}),T(n),F(e,n)};L(f,e=>{N(t).statement?e(p):N(t).defs?.length&&e(m,1)}),T(n),M(e=>{r=di(n,1,`card svelte-15lq3eu`,null,r,{refuted:N(t).state===`refuted`}),I(c,e)},[()=>v(N(t))]),F(e,n)},e=>{F(e,Dv())});var r=j(n,2),a=e=>{var t=kv(),n=O(t),r=A(j(O(n)));T(n);var a=j(n,2);$r(a,21,()=>N(i).blockers,Yr,(e,t)=>{var n=Ov();sd(O(n),{get text(){return N(t)}}),T(n),F(e,n)}),T(a),T(t),M(()=>I(r,`(${N(i).blockers.length??``})`)),F(e,t)};L(r,e=>{N(i).blockers?.length&&e(a)}),F(e,t)};L(ke,e=>{N(p)?e(Ae):e(je,-1)}),T(Oe);var Me=j(Oe,2),Ne=j(O(Me),2),Pe=e=>{var t=jv(),n=j(k(t),2),r=O(n),a=A(j(r));T(n),M(()=>{I(r,`${N(i).number??``} `),I(a,`(${N(i).number_note??``})`)}),F(e,t)};L(Ne,e=>{N(i).number_note&&e(Pe)});var Fe=j(Ne,2),Ie=e=>{var t=Pv(),n=j(k(t),2);K_(n,{get text(){return N(i).statement_tex}});var r=j(n,2),a=e=>{var t=Nv(),n=O(t),r=A(n),a=j(n,2),o=e=>{F(e,Rr(`· located approximately`))};L(a,e=>{N(i).anchor.kind===`approximate`&&e(o)});var s=j(a,2),c=e=>{F(e,Mv())};L(s,e=>{N(i).source_matches===!1&&e(c)}),T(t),M(()=>I(r,`${N(i).anchor.file??``}:${N(i).anchor.line??``}`)),F(e,t)};L(r,e=>{N(i).anchor?.file&&e(a)}),F(e,t)};L(Fe,e=>{N(i).statement_tex&&N(d)?.pdf&&N(i).anchor?.begin&&e(Ie)});var Le=j(Fe,2),Re=e=>{var t=Fv(),n=A(t,!0);M(()=>I(n,N(i).scope_note)),F(e,t)};L(Le,e=>{N(i).scope_note&&e(Re)});var ze=j(Le,2);$r(ze,17,()=>N(i).clauses,Yr,(e,t)=>{var n=Gv(),r=k(n),a=O(r),o=e=>{{let n=E(()=>N(t).label||N(t).name);sd(e,{get text(){return N(n)}})}},s=e=>{F(e,Rr(`Evidence`))};L(a,e=>{N(i).clauses.length>1?e(o):e(s,-1)}),T(r);var c=j(r,2);g_(c,{get rungs(){return N(t).ladder}});var l=j(c,2),d=e=>{var n=Lv();$r(n,21,()=>Object.entries(N(t).proofs),Yr,(e,t)=>{var n=E(()=>m(N(t),2));let r=()=>N(n)[0],i=()=>N(n)[1];var a=zr(),o=k(a),s=e=>{var t=Iv(),n=k(t),a=A(n,!0),o=j(n,2),s=O(o),c=A(s,!0),l=A(j(s,2));T(o),M(e=>{I(a,r()===`refute`?`Refutation`:`Proof`),I(c,i().name),I(l,`— axioms: ${e??``}`)},[()=>i().axioms.length?i().axioms.join(`, `):`none`]),F(e,t)};L(o,e=>{i()&&e(s)}),F(e,a)}),T(n),F(e,n)},f=E(()=>N(t).proofs&&Object.keys(N(t).proofs).length);L(l,e=>{N(f)&&e(d)});var p=j(l,2),g=e=>{var n=Rv(),r=k(n),i=A(j(O(r)),!0);De(),T(r);var a=j(r,2);{let e=E(()=>({binders:[],conclusion:N(t).witness_record.type}));p_(a,{get st(){return N(e)},onref:h,compact:!0})}M(()=>I(i,N(t).witness)),F(e,n)};L(p,e=>{N(t).witness_record&&e(g)});var _=j(p,2),v=e=>{var n=Bv();$r(n,21,()=>N(t).regimes,Yr,(e,t)=>{var n=zv(),r=O(n),i=j(r),a=e=>{var n=Rr();M(()=>I(n,`— ${N(t).description??``}`)),F(e,n)};L(i,e=>{N(t).description&&e(a)}),T(n),M(()=>I(r,`${N(t).discharged?`covered`:`not shown`}: ${N(t).name??``}`)),F(e,n)}),T(n),F(e,n)};L(_,e=>{N(t).regimes?.length&&e(v)});var y=j(_,2),b=e=>{var n=zr();$r(k(n),17,()=>N(t).spec_review.current,Yr,(e,t)=>{var n=Hv(),r=O(n),i=O(r),a=A(i,!0),o=j(i,2),s=A(o,!0),c=A(j(o,2),!0);T(r);var l=j(r,2),u=e=>{var n=Vv(),r=A(n,!0);M(()=>I(r,N(t).text)),F(e,n)};L(l,e=>{N(t).text&&e(u)}),T(n),M(()=>{I(a,N(t).by),I(s,N(t).kind===`ai`?`AI`:N(t).kind===`human`?`human`:`kind not recorded`),I(c,N(t).provenance)}),F(e,n)},e=>{F(e,Uv())}),F(e,n)};L(y,e=>{N(t).spec_review&&e(b)});var x=j(y,2),S=e=>{let n=E(()=>Object.entries(N(t).def_reviews).sort((e,t)=>u[e[1].state]-u[t[1].state]||e[0].localeCompare(t[0]))),r=E(()=>N(n).reduce((e,[,t])=>(e[t.state]=(e[t.state]||0)+1,e),{}));var i=Wv(),a=A(i);M(e=>I(a,`Definitions its meaning depends on: ${e??``}`),[()=>Object.entries(N(r)).map(([e,t])=>`${t} ${e}`).join(`, `)]),F(e,i)},ee=E(()=>N(t).def_reviews&&Object.keys(N(t).def_reviews).length);L(x,e=>{N(ee)&&e(S)}),F(e,n)});var Be=j(ze,2),Ve=e=>{let t=E(()=>Object.keys(N(i).decls||{}));var n=qv(),r=k(n),a=A(r),c=j(r,2),l=e=>{W_(e,{get name(){return N(o)},key:null,open:!0,onref:h})};L(c,e=>{N(o)&&!(N(o)in(N(i).decls||{}))&&e(l)});var u=j(c,2);$r(u,16,()=>N(t),e=>e,(e,n)=>{var r=zr(),a=k(r),c=e=>{{let t=E(()=>N(o)===n);W_(e,{get name(){return n},get key(){return N(i).decls[n]},get open(){return N(t)},onref:h})}};L(a,e=>{(N(t).length<=40||N(o)===n||N(s))&&e(c)}),F(e,r)});var d=j(u,2),f=e=>{var n=Kv(),r=A(n);M(()=>I(r,`Show all ${N(t).length??``}`)),kr(`click`,n,()=>D(s,!0)),F(e,n)};L(d,e=>{N(t).length>40&&!N(s)&&e(f)}),M(()=>I(a,`Definitions (${N(t).length??``})`)),F(e,n)},He=E(()=>Object.keys(N(i).decls||{}).length||N(o));L(Be,e=>{N(He)&&e(Ve)});var Ue=j(Be,2),We=e=>{var t=Jv();O_(j(k(t),2),{get findings(){return N(i).findings}}),F(e,t)};L(Ue,e=>{N(i).findings?.length&&e(We)});var Ge=j(Ue,2),Ke=j(O(Ge)),qe=A(Ke,!0),Je=j(Ke,2),Ye=A(Je,!0),Xe=j(Je,2),Ze=e=>{var n=Rr();M(()=>I(n,`· Lean ${t.index.lean.lean??``}`)),F(e,n)};L(Xe,e=>{t.index.lean&&e(Ze)});var Qe=j(Xe,2),$e=e=>{var n=Yv(),r=A(j(k(n)),!0);M(e=>I(r,e),[()=>t.index.project.commit.slice(0,12)]),F(e,n)};L(Qe,e=>{t.index.project?.commit&&e($e)}),T(Ge),T(Me),T(a),M((e,r)=>{S=di(a,1,`passport svelte-15lq3eu`,null,S,{full:n()}),I(ie,N(i).id),I(se,N(i).number||N(i).id),Ti(me,`title`,e),I(he,N(y)||`Copy link`),Me.open=!!N(o),I(qe,t.index.release),Ti(Je,`title`,t.index.evidence),I(Ye,r)},[()=>zg(t.index,N(i))||`No public address: copies the claim's reference`,()=>t.index.evidence.slice(0,12)]),kr(`click`,me,b),F(e,a)};L(ee,e=>{N(a)?e(te):N(i)?e(C,-1):e(ne,1)}),F(e,S),Xe()}Ar([`click`]);var Qv=P(`<main class="msg svelte-1hmgvz1"><p>No paper <code> </code> here.</p></main>`),$v=P(`<span class="t svelte-1hmgvz1"><!></span>`),ey=P(`<span class="na svelte-1hmgvz1" title="not located in the PDF">·</span>`),ty=P(`<li class="svelte-1hmgvz1"><button><span aria-hidden="true"></span> <span class="n svelte-1hmgvz1"> </span> <!> <!></button></li>`),ny=P(`<button class="more svelte-1hmgvz1"> </button>`),ry=P(`<nav class="toc svelte-1hmgvz1" aria-label="Claims of the paper"><div class="toc-head svelte-1hmgvz1"><span>Contents</span> <button class="x svelte-1hmgvz1" aria-label="Hide contents">‹</button></div> <ol class="svelte-1hmgvz1"></ol> <!></nav>`),iy=P(`<button class="toc-open svelte-1hmgvz1" aria-label="Show contents">Contents ›</button>`),ay=P(`<div class="msg svelte-1hmgvz1"><p>The PDF of this paper is not part of this site; choose a claim from the contents.</p></div>`),oy=P(`<aside class="side svelte-1hmgvz1" aria-label="The claim"><div class="side-head svelte-1hmgvz1"><a>Open as a page</a> <button class="x svelte-1hmgvz1" aria-label="Close">×</button></div> <!></aside>`),sy=P(`<div><!> <section class="paperpane svelte-1hmgvz1" aria-label="Paper"><!></section> <!></div>`);function cy(e,t){Ye(t,!0);let n=Vi(t,`editable`,3,!1),r=E(()=>t.index.papers.find(e=>e.id===t.paperId)),i=E(()=>t.index.claims.filter(e=>e.paper===t.paperId)),a=e=>!String(e.status).startsWith(`out of scope`),o=E(()=>[...N(i)].filter(a).sort((e,t)=>+!e.anchor-!t.anchor||(e.anchor?.page??0)-(t.anchor?.page??0)||(e.anchor?.y0??0)-(t.anchor?.y0??0))),s=Jt(nn(typeof window<`u`&&window.innerWidth>1180)),c=Jt(!1),l=e=>/^[A-Z][a-z]+ [A-Z]?[0-9][0-9.]*[a-z]?$/.test(e.number||``),u=E(()=>N(c)?N(o):N(o).filter(l)),d=E(()=>N(o).filter(e=>!l(e)).length);function f(e){ua(la(t.index.release,`read`,t.paperId,e))}function p(){ua(la(t.index.release,`read`,t.paperId))}var m=zr(),h=k(m),g=e=>{var n=Qv(),r=O(n),i=A(j(O(r)),!0);De(),T(r),T(n),M(()=>I(i,t.paperId)),F(e,n)},_=e=>{var a=sy();let o;var l=O(a),m=e=>{var n=ry(),r=O(n),i=j(O(r),2);T(r);var a=j(r,2);$r(a,21,()=>N(u),e=>e.id,(e,n)=>{var r=ty(),i=O(r);let a;var o=O(i),s=j(o,2),c=A(s,!0),l=j(s,2),u=e=>{var t=$v(),r=O(t);{let e=E(()=>N(n).heading||N(n).title);sd(r,{get text(){return N(e)}})}T(t),F(e,t)};L(l,e=>{(N(n).heading||N(n).title)&&e(u)});var d=j(l,2),p=e=>{F(e,ey())};L(d,e=>{N(n).anchor||e(p)}),T(i),T(r),M(()=>{Ti(i,`title`,N(n).status),a=di(i,1,`svelte-1hmgvz1`,null,a,{sel:N(n).id===t.claimId}),di(o,1,`dot st-`+N(n).class,`svelte-1hmgvz1`),I(c,N(n).number||N(n).id)}),kr(`click`,i,()=>f(N(n).id)),F(e,r)}),T(a);var o=j(a,2),l=e=>{var t=ny(),n=A(t,!0);M(()=>I(n,N(c)?`Only numbered statements`:`Also equations and prose claims (${N(d)})`)),kr(`click`,t,()=>D(c,!N(c))),F(e,t)};L(o,e=>{N(d)&&e(l)}),T(n),kr(`click`,i,()=>D(s,!1)),F(e,n)},h=e=>{var t=iy();kr(`click`,t,()=>D(s,!0)),F(e,t)};L(l,e=>{N(s)?e(m):e(h,-1)});var g=j(l,2),_=O(g),v=e=>{{let n=E(()=>`data/`+N(r).pdf);Rg(e,{get url(){return N(n)},get claims(){return N(i)},get selected(){return t.claimId},onselect:f})}},y=e=>{F(e,ay())};L(_,e=>{N(r).pdf?e(v):e(y,-1)}),T(g);var b=j(g,2),x=e=>{var r=oy(),i=O(r),a=O(i),o=j(a,2);T(i),Zv(j(i,2),{get index(){return t.index},get claimId(){return t.claimId},get editable(){return n()}}),T(r),M(e=>Ti(a,`href`,e),[()=>la(t.index.release,`claim`,t.claimId)]),kr(`click`,o,p),F(e,r)};L(b,e=>{t.claimId&&e(x)}),T(a),M(()=>o=di(a,1,`reader svelte-1hmgvz1`,null,o,{open:!!t.claimId,contents:N(s)})),F(e,a)};L(h,e=>{N(r)?e(_,-1):e(g)}),F(e,m),Xe()}Ar([`click`]);var ly=P(`<dt class="svelte-1muxge5">Lean</dt><dd class="svelte-1muxge5"> <span class="faint"> </span></dd>`,1),uy=P(`<code> </code>`),dy=P(`<dt class="svelte-1muxge5">Toolchain</dt><dd class="svelte-1muxge5"><code> </code></dd>`,1),fy=P(`<dt class="svelte-1muxge5"> </dt><dd class="svelte-1muxge5"><code> </code></dd>`,1),py=P(`<dt class="svelte-1muxge5">Project</dt> <dd class="svelte-1muxge5"> <!> </dd> <!> <!>`,1),my=P(`at <code> </code>`,1),hy=P(`, root <code> </code>`,1),gy=P(`, PDF <code> </code>`,1),_y=P(`<dt class="svelte-1muxge5"> </dt> <dd class="svelte-1muxge5"> <!><!><!></dd>`,1),vy=P(`<main class="ch svelte-1muxge5"><h1 class="svelte-1muxge5">Changes</h1> <p class="muted">A comparison lists, between two releases, every proposition and definition whose fingerprint
278
+ changed, the reviews that reopened as a result, the manuscript claims whose source changed, and
279
+ changes of toolchain or dependencies. This site holds one release.</p> <h2 class="svelte-1muxge5">This release</h2> <dl class="svelte-1muxge5"><dt class="svelte-1muxge5">Release</dt><dd class="svelte-1muxge5"><code> </code></dd> <dt class="svelte-1muxge5">Evidence</dt><dd class="svelte-1muxge5"><code> </code></dd> <dt class="svelte-1muxge5">Built</dt><dd class="svelte-1muxge5"> </dd> <!> <!> <!> <dt class="svelte-1muxge5">Tool</dt><dd class="svelte-1muxge5"> <span class="faint"> </span></dd></dl></main>`);function yy(e,t){Ye(t,!0);var n=vy(),r=j(O(n),6),i=j(O(r)),a=A(O(i),!0);T(i);var o=j(i,3),s=A(O(o),!0);T(o);var c=j(o,3),l=A(c,!0),u=j(c,2),d=e=>{var n=ly(),r=j(k(n)),i=O(r),a=A(j(i));T(r),M(e=>{I(i,`${t.index.lean.lean??``} `),I(a,`(${e??``})`)},[()=>t.index.lean.githash?.slice(0,12)]),F(e,n)};L(u,e=>{t.index.lean&&e(d)});var f=j(u,2),p=e=>{var n=py(),r=j(k(n),2),i=O(r),a=j(i),o=e=>{var n=uy(),r=A(n,!0);M(e=>I(r,e),[()=>t.index.project.commit.slice(0,12)]),F(e,n)};L(a,e=>{t.index.project.commit&&e(o)});var s=j(a,1,!0);T(r);var c=j(r,2),l=e=>{var n=dy(),r=j(k(n)),i=A(O(r),!0);T(r),M(()=>I(i,t.index.project.toolchain)),F(e,n)};L(c,e=>{t.index.project.toolchain&&e(l)}),$r(j(c,2),17,()=>Object.entries(t.index.project.dependencies||{}),Yr,(e,t)=>{var n=E(()=>m(N(t),2));let r=()=>N(n)[0],i=()=>N(n)[1];var a=fy(),o=k(a),s=A(o,!0),c=j(o),l=A(O(c),!0);T(c),M(()=>{I(s,r()),I(l,i())}),F(e,a)}),M(()=>{I(i,`${t.index.project.name??``} `),I(s,t.index.project.dirty?` with uncommitted changes`:``)}),F(e,n)};L(f,e=>{t.index.project&&e(p)});var h=j(f,2);$r(h,17,()=>t.index.papers,Yr,(e,t)=>{var n=_y(),r=k(n),i=A(r),a=j(r,2),o=O(a,!0),s=j(o),c=e=>{var n=my(),r=A(j(k(n)),!0);M(e=>I(r,e),[()=>N(t).revision.slice(0,12)]),F(e,n)};L(s,e=>{N(t).revision&&e(c)});var l=j(s),u=e=>{var n=hy(),r=A(j(k(n)),!0);M(()=>I(r,N(t).root)),F(e,n)};L(l,e=>{N(t).root&&e(u)});var d=j(l),f=e=>{var n=gy(),r=j(k(n)),i=A(r,!0);M(e=>{Ti(r,`title`,N(t).pdf_sha256),I(i,e)},[()=>N(t).pdf_sha256.slice(0,12)]),F(e,n)};L(d,e=>{N(t).pdf_sha256&&e(f)}),T(a),M(()=>{I(i,`Paper ${N(t).id??``}`),I(o,N(t).mode===`latex`?`LaTeX`:`PDF only`)}),F(e,n)});var g=j(h,3),_=O(g),v=A(j(_));T(g),T(r),T(n),M(()=>{I(a,t.index.release),I(s,t.index.evidence),I(l,t.index.created),I(_,`${t.index.tool?.name??``} ${t.index.tool?.version??``} `),I(v,`(${t.index.tool?.fingerprint??``})`)}),F(e,n),Xe()}var by=P(`<span class="w svelte-1wah7ro"><!></span>`),xy=P(`<span class="w svelte-1wah7ro"> </span>`),Sy=P(`<span class="t svelte-1wah7ro"> </span> <span class="p svelte-1wah7ro"> </span> <span class="s svelte-1wah7ro"> </span> <!> <!>`,1),Cy=P(`<span class="t mono svelte-1wah7ro"> </span> <span class="p svelte-1wah7ro"> </span>`,1),wy=P(`<li role="option"><button><!></button></li>`),Ty=P(`<ul class="results svelte-1wah7ro" role="listbox"></ul>`),Ey=P(`<ul class="results svelte-1wah7ro"><li class="none svelte-1wah7ro">No match.</li></ul>`),Dy=P(`<div class="search svelte-1wah7ro"><input type="search" placeholder="Search claims, statements, Lean names" aria-label="Search" class="svelte-1wah7ro"/> <!></div>`);function Oy(e,t){Ye(t,!0);let n=Jt(``),r=Jt(null),i=Jt(!1),a=Jt(0);function o(){N(r)||ta(t.index).then(e=>D(r,e,!0)).catch(()=>D(r,{claims:[],decls:[]},!0))}let s=E(()=>{let e=N(n).toLowerCase().split(/\s+/).filter(Boolean);if(!N(r)||!e.length)return[];let t=t=>{let n=t.toLowerCase();return e.every(e=>n.includes(e))},i=[];for(let n of N(r).claims){let r=`${n.number} ${n.title} ${n.id}`,a=n.lean.join(` `);t(r)?i.push({kind:`claim`,c:n,rank:0}):t(a)?i.push({kind:`claim`,c:n,rank:1,why:n.lean.find(t=>e.some(e=>t.toLowerCase().includes(e)))}):t(n.statement)&&i.push({kind:`claim`,c:n,rank:2,why:`matches the statement`})}for(let e of N(r).decls)t(e.name)&&i.push({kind:`decl`,d:e,rank:3});return i.sort((e,t)=>e.rank-t.rank).slice(0,30)}),c=e=>e.kind===`claim`?e.c.heading||e.c.title:null;function l(e){D(i,!1),D(n,``),e.kind===`claim`?ua(la(t.index.release,`read`,e.c.paper,e.c.id)):ua(la(t.index.release,`claim`,e.d.claims[0]))}function u(e){e.key===`ArrowDown`?(D(a,Math.min(N(a)+1,N(s).length-1),!0),e.preventDefault()):e.key===`ArrowUp`?(D(a,Math.max(N(a)-1,0),!0),e.preventDefault()):e.key===`Enter`&&N(s)[N(a)]?l(N(s)[N(a)]):e.key===`Escape`&&D(i,!1)}var d=Dy(),f=O(d);wi(f);var p=j(f,2),m=e=>{var t=Ty();$r(t,21,()=>N(s),Yr,(e,t,n)=>{var r=wy(),i=O(r);let o;var s=O(i),u=e=>{var n=Sy(),r=k(n),i=A(r,!0),a=j(r,2),o=A(a),s=j(a,2),l=A(s,!0),u=j(s,2),d=e=>{var n=by(),r=O(n);{let e=E(()=>c(N(t)));sd(r,{get text(){return N(e)}})}T(n),F(e,n)},f=E(()=>c(N(t)));L(u,e=>{N(f)&&e(d)});var p=j(u,2),m=e=>{var n=xy(),r=A(n,!0);M(()=>I(r,N(t).why)),F(e,n)};L(p,e=>{N(t).why&&e(m)}),M(()=>{I(i,N(t).c.number||N(t).c.id),I(o,`Paper ${N(t).c.paper??``}`),I(l,N(t).c.status)}),F(e,n)},d=e=>{var n=Cy(),r=k(n),i=A(r,!0),a=A(j(r,2));M(()=>{I(i,N(t).d.name),I(a,`declaration · in ${N(t).d.claims.length??``} claim${N(t).d.claims.length===1?``:`s`}`)}),F(e,n)};L(s,e=>{N(t).kind===`claim`?e(u):e(d,-1)}),T(i),T(r),M(()=>{Ti(r,`aria-selected`,n===N(a)),o=di(i,1,`svelte-1wah7ro`,null,o,{sel:n===N(a)})}),kr(`mousedown`,i,()=>l(N(t))),F(e,r)}),T(t),F(e,t)},h=e=>{F(e,Ey())};L(p,e=>{N(i)&&N(n)&&N(s).length?e(m):N(i)&&N(n)&&N(r)&&e(h,1)}),T(d),Or(`focus`,f,()=>{o(),D(i,!0)}),kr(`input`,f,()=>{D(i,!0),D(a,0)}),kr(`keydown`,f,u),Or(`blur`,f,()=>setTimeout(()=>D(i,!1),150)),ki(f,()=>N(n),e=>D(n,e)),F(e,d),Xe()}Ar([`input`,`keydown`,`mousedown`]);var ky=`prooflens/review-report@1`,Ay={matches:[{value:`faithful`,label:`Faithful`},{value:`faithful with representation choices`,label:`Faithful with representation choices`,detail:`List the representation choices, and say why each is harmless.`},{value:`broader`,label:`Broader, but implies the printed claim`,detail:`State the instantiation that gives the printed claim.`}],problem:[{value:`narrower`,label:`Narrower`,detail:`Say exactly how: which hypothesis is added, which case is lost.`},{value:`mismatched`,label:`Mismatched`,detail:`Say what it states instead.`},{value:`vacuous`,label:`Vacuous`,detail:`Say why the hypotheses cannot be met, or why the witness does not meet them.`},{value:`refutation not valid`,label:`Refutation not valid`,refuteOnly:!0,detail:`Say how the refuted proposition is stronger than the printed claim.`}],cannot:[{value:`cannot determine`,label:`Cannot determine`,detail:`Say what would decide it.`}]},jy={statement:[{key:`setting`,label:`Setting and objects`,hint:`the spaces, structures and standing assumptions`},{key:`hypotheses`,label:`Each hypothesis`,hint:`none missing, none added, none weakened or strengthened`},{key:`quantifiers`,label:`Quantifiers and their order`,hint:`for all / there is, and which comes first`},{key:`definitions`,label:`Definitions it relies on`,hint:`the Lean definitions mean what the paper's words mean`},{key:`conclusion`,label:`The conclusion`,hint:`the same claim, not a weaker or a different one`},{key:`constants`,label:`Constants`,hint:`what each constant may depend on`},{key:`assumed`,label:`Assumed results and axioms`,hint:`nothing taken as a hypothesis that the paper proves`}],def:[{key:`object`,label:`The object`,hint:`it is the paper's object, built from the same parts`},{key:`parameters`,label:`Its parameters`,hint:`the same inputs, with the same types and conditions`},{key:`conventions`,label:`Conventions and edge cases`,hint:`junk values, truncated subtraction, division by zero`}]},My=[{value:`matches`,label:`matches`},{value:`differs`,label:`differs`},{value:`unsure`,label:`unsure`}],Ny=[{key:`matches`,label:`Matches the paper`},{key:`problem`,label:`There's a problem`},{key:`cannot`,label:`Cannot determine`}],Py=()=>({reviewer:null,drafts:{},reports:[],skipped:[],exported:0});function Fy(e){return`prooflens-review:${e||`project`}`}function Iy(e){try{let t=localStorage.getItem(Fy(e));return t?{...Py(),...JSON.parse(t)}:Py()}catch{return Py()}}function Ly(e,t){try{return localStorage.setItem(Fy(e),JSON.stringify(t)),!0}catch{return!1}}function Ry(){return new Date().toISOString().replace(/\.\d+Z$/,`Z`)}function zy(e){if(!e)return``;let t=e=>String(e||``).trim().replace(/\s+/g,`-`);return e.kind===`model`?`llm:${t(e.model)}-${new Date().toISOString().slice(0,10)}`:`human:${t(e.name)}`}function By(e){return Object.values(Ay).flat().find(t=>t.value===e)?.detail||null}function Vy(e,t,n){if(t===`faithful`)return null;let r=t===`faithful with representation choices`||t===`broader`,i=e.claims.map(e=>e.number||e.id).join(`, `);return{kind:r?`explanatory note`:`defect`,title:`${e.name}: ${t}${i?` (${i})`:``}`,body:`Review unit \`${e.id}\`, verdict **${t}**.\n\n${n||``}`.trim()}}function Hy({index:e,unit:t,draft:n,reviewer:r}){let i=Object.fromEntries((e.papers||[]).map(e=>[e.id,e.revision||null])),a=n.verdict;return{schema:ky,unit:{id:t.id,kind:t.kind,name:t.name,lean:t.lean||[t.name],claims:t.claims.map(e=>e.id),papers:t.papers||[]},pins:{release:e.release,project_commit:e.project?.commit||null,manuscripts:Object.fromEntries((t.papers||[]).map(e=>[e,i[e]??null])),legacy_hash:t.legacy_hash||null,fingerprint:t.fingerprint||null,fingerprints:t.fingerprints||null},reviewer:{id:zy(r),kind:r.kind,name:r.name||null,model:r.kind===`model`?r.model:null,same_family_as_author:r.sameFamily||`unknown`,identity:`self-declared`},reading:{text:n.reading,locked_at:n.locked_at},comparison:{text:n.comparison||``,witness:n.witness||``,checklist:n.checklist||{},decided_at:n.decided_at},verdict:{group:n.group,value:a,detail:n.detail||``},author_review:{shown_at:n.author_shown_at,disagreements:n.disagreements||`none`},submitted_at:Ry(),issue_draft:Vy(t,a,n.detail)}}function Uy(e,t){let n={schema:`prooflens/review-reports@1`,project:e.project?.name||null,release:e.release,exported_at:Ry(),reports:t.reports},r=new Blob([JSON.stringify(n,null,2)],{type:`application/json`}),i=document.createElement(`a`),a=(t.reports.at(-1)?.reviewer?.id||`reviewer`).replace(/[^\w.-]+/g,`_`);i.href=URL.createObjectURL(r),i.download=`machinechecked-reviews-${a}-${n.exported_at.replace(/[:]/g,``)}.json`,document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(i.href),1e3)}var Wy=P(`<p class="bad svelte-1jpsao4"> </p>`),Gy=P(`<p class="muted">Loading…</p>`),Ky=P(`<label class="field svelte-1jpsao4">Your name <input placeholder="e.g. Ada Lovelace" class="svelte-1jpsao4"/></label>`),qy=P(`<label class="field svelte-1jpsao4">Model and version <input placeholder="e.g. some-model-2" class="svelte-1jpsao4"/></label> <label class="field svelte-1jpsao4"> <select class="svelte-1jpsao4"><option>yes</option><option>no</option><option>don't know</option></select></label>`,1),Jy=P(`<section class="card setup svelte-1jpsao4"><h1 class="svelte-1jpsao4">Review</h1> <p>One unit at a time: read the paper and write down what it says, then compare the Lean
280
+ with your reading and record a verdict, then read the author's review. Your reports stay
281
+ in this browser until you export them; a maintainer examines them before anything is
282
+ recorded as reviewed.</p> <fieldset class="svelte-1jpsao4"><legend>Who is reviewing?</legend> <label><input type="radio" class="svelte-1jpsao4"/> A person</label> <label><input type="radio" class="svelte-1jpsao4"/> An AI model</label></fieldset> <!> <p class="faint small svelte-1jpsao4">This is recorded as you state it (self-declared); nothing here verifies it.</p> <button class="btn svelte-1jpsao4">Start</button></section>`),Yy=P(`<option> </option>`),Xy=P(`<p class="warn svelte-1jpsao4"> </p>`),Zy=P(`<p class="faint small svelte-1jpsao4"> </p>`),Qy=P(`<section class="card issue svelte-1jpsao4"><p class="lbl svelte-1jpsao4"> </p> <p><strong> </strong></p> <pre class="svelte-1jpsao4"> </pre> <button class="btn ghost svelte-1jpsao4">Copy</button> <button class="btn ghost svelte-1jpsao4">Dismiss</button></section>`),$y=P(`<section class="card svelte-1jpsao4"><p>Nothing left to review in this selection.</p></section>`),eb=P(` <a target="_blank" rel="noopener"> </a>`,1),tb=P(`<h2 class="svelte-1jpsao4"> </h2> <p class="small svelte-1jpsao4">Used by: <!> </p>`,1),nb=P(`<span class="ht svelte-1jpsao4">&nbsp;— <!></span>`),rb=P(`<p class="desc svelte-1jpsao4"><!></p>`),ib=P(`<h2 class="svelte-1jpsao4"> <!></h2> <!> <!> <p class="small svelte-1jpsao4"><a target="_blank" rel="noopener" title="Opens the reader, where the Lean side is not hidden">Open in the paper ↗</a></p>`,1),ab=P(`<details class="also svelte-1jpsao4"><summary class="svelte-1jpsao4"> </summary> <!></details>`),ob=P(`<!> <!>`,1),sb=P(`<p class="faint small svelte-1jpsao4"> </p> <textarea rows="8" class="svelte-1jpsao4"></textarea> <div class="row svelte-1jpsao4"><button class="btn svelte-1jpsao4">Lock my reading and show the Lean</button> <button class="btn ghost svelte-1jpsao4">Skip</button></div>`,1),cb=P(`<details class="closure svelte-1jpsao4"><summary class="svelte-1jpsao4"> </summary> <!></details>`),lb=P(`<p class="small svelte-1jpsao4">Witness: <code> </code></p>`),ub=P(`<!> <!> <!>`,1),db=P(`<p class="small svelte-1jpsao4"><code> </code></p> <!>`,1),fb=P(`<p class="faint">Loading…</p>`),pb=P(`<button> </button>`),mb=P(`<li class="svelte-1jpsao4"><span class="ck-label"> <span class="faint small svelte-1jpsao4"> </span></span> <span class="ck-marks svelte-1jpsao4"></span></li>`),hb=P(`<textarea rows="3" placeholder="The witness: does it meet the hypotheses at an instance the paper intends, and is that instance non-trivial?" class="svelte-1jpsao4"></textarea>`),gb=P(`<label><input type="radio" class="svelte-1jpsao4"/> </label>`),_b=P(`<textarea rows="3" class="svelte-1jpsao4"></textarea>`),vb=P(`<div class="verdicts svelte-1jpsao4"></div> <!>`,1),yb=P(`<h3 class="svelte-1jpsao4">Comparison</h3> <ul class="checklist svelte-1jpsao4" aria-label="What to compare"></ul> <p class="faint small svelte-1jpsao4">A guide: mark each item if it helps, and write what you found below.</p> <textarea rows="6" placeholder="Item by item against your reading: each hypothesis, each quantifier and its order, the conclusion, representation choices, constants." class="svelte-1jpsao4"></textarea> <!> <div class="groups svelte-1jpsao4"></div> <!> <div class="row svelte-1jpsao4"><button class="btn svelte-1jpsao4">Record verdict and show the author's review</button> <button class="btn ghost svelte-1jpsao4">Skip</button></div>`,1),bb=P(`<p class="lbl svelte-1jpsao4"> </p> <pre class="author svelte-1jpsao4"> </pre>`,1),xb=P(`<p class="faint">No review by the author is recorded for this unit.</p>`),Sb=P(`<p class="small svelte-1jpsao4"><strong>Your verdict:</strong> <span class="faint"> </span></p> <h3 class="svelte-1jpsao4">The author's review</h3> <!> <textarea rows="3" placeholder="Where you disagree with the author's review, or where it claims more than the Lean shows (or “none”). Your verdict stays as recorded." class="svelte-1jpsao4"></textarea> <div class="row svelte-1jpsao4"><button class="btn svelte-1jpsao4">Submit report</button> <button class="btn ghost svelte-1jpsao4">Skip</button></div>`,1),Cb=P(`<pre class="locked svelte-1jpsao4"> </pre> <h3 class="svelte-1jpsao4">In Lean <code class="small svelte-1jpsao4"> </code></h3> <!> <!>`,1),wb=P(`<article class="card unit svelte-1jpsao4"><ol class="steps svelte-1jpsao4"><li>1. Read</li> <li>2. Compare</li> <li>3. Author's review</li></ol> <p class="why faint svelte-1jpsao4"> </p> <!> <h3 class="svelte-1jpsao4"> </h3> <!></article>`),Tb=P(`<div class="bar svelte-1jpsao4"><label class="svelte-1jpsao4">Paper <select class="svelte-1jpsao4"><option>All</option><!></select></label> <label class="svelte-1jpsao4">Part <select class="svelte-1jpsao4"><option>All</option><!></select></label> <span class="progress svelte-1jpsao4"> </span> <span class="who faint svelte-1jpsao4" title="self-declared"> </span> <button class="btn ghost svelte-1jpsao4">Undo last</button> <button class="btn svelte-1jpsao4"> </button></div> <!> <!> <!> <!>`,1),Eb=P(`<main class="review svelte-1jpsao4"><!></main>`);function Db(e,t){Ye(t,!0);let n=[],r=[],i=Jt(null),a=Jt(null);oa(t.index).then(e=>D(i,e,!0)).catch(e=>D(a,String(e),!0));let o=t.index.project?.name||`project`,s=nn(Iy(o)),c=Jt(!0);function l(){D(c,Ly(o,Ge(s)),!0)}let u=nn({kind:`human`,name:``,model:``,sameFamily:`no`});function f(){(u.kind===`human`?!u.name.trim():!u.model.trim())||(s.reviewer={...u,sameFamily:u.kind===`human`?`no`:u.sameFamily},l())}let p=Jt(nn(s.selection?.paper||`all`)),m=Jt(nn(s.selection?.group||`all`));function h(){s.selection={paper:N(p),group:N(m)},l()}let g=e=>e.fingerprint||JSON.stringify(e.fingerprints||{}),_=e=>s.reports.find(t=>t.unit.id===e.id&&(t.pins.fingerprint||JSON.stringify(t.pins.fingerprints||{}))===g(e)),v=e=>e.kind===`def`?`def:`+e.section:`sec:`+(e.paper||``)+`:`+e.section,y=e=>e.startsWith(`def:`)?`Definitions · `+e.slice(4):`Statements · `+(t.index.papers.length>1?`Paper `+e.split(`:`)[1]+` `:``)+`§`+e.split(`:`)[2],b=E(()=>N(i)?N(i).units.filter(e=>N(p)===`all`||(e.papers||[]).includes(N(p))):[]),x=E(()=>[...new Set(N(b).map(v))].sort()),S=E(()=>N(b).filter(e=>N(m)===`all`||v(e)===N(m))),ee=E(()=>N(S).filter(e=>e.state!==`reviewed`&&!_(e))),te=E(()=>N(ee).filter(e=>!s.skipped.includes(e.id))),ne=E(()=>N(ee).filter(e=>s.skipped.includes(e.id))),C=E(()=>N(te)[0]||N(ne)[0]||null),re=E(()=>N(S).filter(e=>_(e)).length),ie=E(()=>N(S).filter(e=>e.state===`reviewed`).length),ae=E(()=>s.reports.length-(s.exported||0));Tn(()=>{N(C)&&!s.drafts[N(C).id]&&(s.drafts[N(C).id]={stage:`read`,reading:``})});let w=E(()=>N(C)&&s.drafts[N(C).id]||null),oe=Jt(nn([]));Tn(()=>{let e=N(C);D(oe,[],!0),e&&Promise.all(e.claims.slice(0,6).map(e=>na(t.index,e.id).catch(()=>null))).then(t=>{N(C)===e&&D(oe,t.filter(Boolean),!0)})});let se=E(()=>N(C)?.kind===`spec`?N(oe).flatMap(e=>e.clauses||[]).find(e=>e.spec===N(C).name):null),ce=E(()=>N(oe)[0]),le=e=>t.index.papers.find(t=>t.id===e.paper);function ue(){(N(w).reading||``).trim().length<20||(N(w).locked_at=Ry(),N(w).stage=`compare`,l())}function de(e){N(w).group=e,N(w).verdict=Ay[e].length===1?Ay[e][0].value:null,l()}let fe=E(()=>N(w)?.verdict?By(N(w).verdict):null),pe=E(()=>!!N(w)?.verdict&&(!N(fe)||(N(w).detail||``).trim().length>0)&&(N(w).comparison||``).trim().length>0);function me(){N(pe)&&(N(w).decided_at=Ry(),N(w).stage=`author`,N(w).author_shown_at=Ry(),l())}function he(){let e=Hy({index:t.index,unit:N(C),draft:Ge(N(w)),reviewer:s.reviewer});s.reports.push(e),s.skipped=s.skipped.filter(e=>e!==N(C).id),delete s.drafts[N(C).id],D(ye,e.issue_draft,!0),l()}function ge(){s.skipped.includes(N(C).id)?s.skipped=[...s.skipped.filter(e=>e!==N(C).id),N(C).id]:s.skipped.push(N(C).id),l()}function _e(){let e=s.reports.pop();e&&(s.drafts[e.unit.id]={stage:`author`,reading:e.reading.text,locked_at:e.reading.locked_at,comparison:e.comparison.text,witness:e.comparison.witness,decided_at:e.comparison.decided_at,group:e.verdict.group,verdict:e.verdict.value,detail:e.verdict.detail,author_shown_at:e.author_review.shown_at,disagreements:e.author_review.disagreements},s.exported=Math.min(s.exported||0,s.reports.length),D(ye,null),l())}function ve(){Uy(t.index,Ge(s)),s.exported=s.reports.length,l()}let ye=Jt(null);var be=Eb(),xe=O(be),Se=e=>{var t=Wy(),n=A(t);M(()=>I(n,`The review queue could not be loaded: ${N(a)??``}`)),F(e,t)},Ce=e=>{F(e,Gy())},we=e=>{var t=Jy(),r=j(O(t),4),a=j(O(r),2),o=O(a);wi(o),o.value=o.__value=`human`,De(),T(a);var s=j(a,2),c=O(s);wi(c),c.value=c.__value=`model`,De(),T(s),T(r);var l=j(r,2),d=e=>{var t=Ky(),n=j(O(t));wi(n),T(t),ki(n,()=>u.name,e=>u.name=e),F(e,t)},p=e=>{var t=qy(),n=k(t),r=j(O(n));wi(r),T(n);var a=j(n,2),o=O(a),s=j(o),c=O(s);c.value=c.__value=`yes`;var l=j(c);l.value=l.__value=`no`;var d=j(l);d.value=d.__value=`unknown`,T(s),_i(s),T(a),M(e=>I(o,`Same model family as the author of the statements${e??``}? `),[()=>N(i).authors.length?` (${N(i).authors.join(`, `)})`:``]),ki(r,()=>u.model,e=>u.model=e),vi(s,()=>u.sameFamily,e=>u.sameFamily=e),F(e,t)};L(l,e=>{u.kind===`human`?e(d):e(p,-1)});var m=j(l,4);T(t),ji(n,[],o,()=>u.kind,e=>u.kind=e),ji(n,[],c,()=>u.kind,e=>u.kind=e),kr(`click`,m,f),F(e,t)},Te=e=>{var n=Tb(),a=k(n),o=O(a),u=j(O(o)),f=O(u);f.value=f.__value=`all`,$r(j(f),17,()=>t.index.papers,Yr,(e,n)=>{var r=Yy(),i=A(r,!0),a={};M(()=>{I(i,t.index.papers.length>1?`Paper `+N(n).id:N(n).title),a!==(a=N(n).id)&&(r.value=(r.__value=a)??``)}),F(e,r)}),T(u),_i(u),T(o);var g=j(o,2),_=j(O(g)),v=O(_);v.value=v.__value=`all`,$r(j(v),17,()=>N(x),Yr,(e,t)=>{var n=Yy(),r=A(n,!0),i={};M(e=>{I(r,e),i!==(i=N(t))&&(n.value=(n.__value=i)??``)},[()=>y(N(t))]),F(e,n)}),T(_),_i(_),T(g);var b=j(g,2),S=A(b),ee=j(b,2),be=A(ee,!0),xe=j(ee,2),Se=j(xe,2),Ce=A(Se);T(a);var we=j(a,2),Te=e=>{var t=Xy(),n=A(t,!0);M(()=>I(n,N(c)?`${N(ae)} report(s) are only in this browser until you export them.`:`This browser is not keeping your work: export after every report.`)),F(e,t)};L(we,e=>{(N(ae)>0||!N(c))&&e(Te)});var Ee=j(we,2),Oe=e=>{var t=Zy(),n=A(t);M(e=>I(n,`${e??``} claim(s) need a formal statement before they can be reviewed; they are not in the queue.`),[()=>N(i).needs_statement.filter(e=>N(p)===`all`||e.paper===N(p)).length]),F(e,t)},ke=E(()=>N(i).needs_statement.length&&(N(p)===`all`||N(i).needs_statement.some(e=>e.paper===N(p))));L(Ee,e=>{N(ke)&&e(Oe)});var Ae=j(Ee,2),je=e=>{var t=Qy(),n=O(t),r=A(n),i=j(n,2),a=A(O(i),!0);T(i);var o=j(i,2),s=A(o,!0),c=j(o,2),l=j(c,2);T(t),M(()=>{I(r,`Issue draft (${N(ye).kind??``}) — for the maintainer; nothing is filed`),I(a,N(ye).title),I(s,N(ye).body)}),kr(`click`,c,()=>navigator.clipboard?.writeText(N(ye).title+`
283
+
284
+ `+N(ye).body)),kr(`click`,l,()=>D(ye,null)),F(e,t)};L(Ae,e=>{N(ye)&&e(je)});var Me=j(Ae,2),Ne=e=>{F(e,$y())},Pe=e=>{F(e,Gy())},Fe=e=>{var n=wb(),i=O(n),a=O(i);let o;var c=j(a,2);let u;var f=j(c,2);let p;T(i);var m=j(i,2),h=A(m),g=j(m,2),_=e=>{var n=tb(),r=k(n),i=A(r),a=j(r,2),o=j(O(a));$r(o,17,()=>N(C).claims.slice(0,12),Yr,(e,n,r)=>{De();var i=eb(),a=k(i,!0);a.nodeValue=r?`, `:``;var o=j(a),s=A(o,!0);M(e=>{Ti(o,`href`,e),I(s,N(n).id)},[()=>la(t.index.release,`read`,N(n).id.split(`:`)[0],N(n).id)]),F(e,i)});var s=j(o,1,!0);T(a),M(()=>{I(i,`A definition used by ${N(C).claims.length??``} claim(s)`),I(s,N(C).claims.length>12?`, …`:``)}),F(e,n)},v=e=>{let n=(e,n=d)=>{var r=ib(),i=k(r),a=O(i,!0),o=j(a),s=e=>{var t=nb();sd(j(O(t)),{get text(){return n().heading}}),T(t),F(e,t)};L(o,e=>{n().heading&&e(s)}),T(i);var c=j(i,2),l=e=>{var t=rb();sd(O(t),{get text(){return n().title}}),T(t),F(e,t)};L(c,e=>{!n().heading&&n().title&&e(l)});var u=j(c,2),f=e=>{{let t=E(()=>`data/`+le(n()).pdf);Qg(e,{get url(){return N(t)},get anchor(){return n().anchor}})}},p=E(()=>le(n())?.pdf&&n().anchor?.begin),m=e=>{K_(e,{get text(){return n().statement_tex}})};L(u,e=>{N(p)?e(f):n().statement_tex&&e(m,1)});var h=A(j(u,2));M(e=>{I(a,n().number),Ti(h,`href`,e)},[()=>la(t.index.release,`read`,n().paper,n().id)]),F(e,r)};var r=ob(),i=k(r),a=e=>{n(e,()=>N(oe)[0])};L(i,e=>{N(oe)[0]&&e(a)});var o=j(i,2),s=e=>{var t=ab(),r=O(t),i=A(r);$r(j(r,2),17,()=>N(oe).slice(1),e=>e.id,(e,t)=>{n(e,()=>N(t))}),T(t),M(()=>I(i,`Also stated in ${N(oe).length-1} other place(s)`)),F(e,t)};L(o,e=>{N(oe).length>1&&e(s)}),F(e,r)};L(g,e=>{N(C).kind===`def`?e(_):e(v,-1)});var y=j(g,2),b=A(y),x=j(y,2),S=e=>{var t=sb(),n=k(t),r=A(n,!0),i=j(n,2);st(i);var a=j(i,2),o=O(a),s=j(o,2);T(a),M(e=>{I(r,N(C).kind===`def`?`What is this object in the paper? Its setting, what it is built from, and anything left ambiguous.`:`The setting; every hypothesis, with its quantifiers and where it holds; the notion of solution; the conclusion, with its quantifier order and what constants depend on; every ambiguity and its readings.`),o.disabled=e},[()=>(N(w).reading||``).trim().length<20]),kr(`input`,i,l),ki(i,()=>N(w).reading,e=>N(w).reading=e),kr(`click`,o,ue),kr(`click`,s,ge),F(e,t)},ee=e=>{var t=Cb(),n=k(t),i=A(n,!0),a=j(n,2),o=A(j(O(a)),!0);T(a);var s=j(a,2),c=e=>{W_(e,{get name(){return N(C).name},get key(){return N(C).key},open:!0,hideReview:!0})},u=e=>{var t=ub(),n=k(t);p_(n,{get st(){return N(se).statement},get spec(){return N(C).name}});var r=j(n,2),i=e=>{var t=cb(),n=O(t),r=A(n);$r(j(n,2),17,()=>N(se).statement.closure,Yr,(e,t)=>{{let n=E(()=>N(ce)?.decls?.[N(t)]);W_(e,{get name(){return N(t)},get key(){return N(n)},hideReview:!0})}}),T(t),M(()=>I(r,`Definitions it uses (${N(se).statement.closure.length??``})`)),F(e,t)};L(r,e=>{N(se).statement.closure?.length&&e(i)});var a=j(r,2),o=e=>{var t=lb(),n=A(j(O(t)),!0);T(t),M(()=>I(n,N(C).witness)),F(e,t)};L(a,e=>{N(C).witness&&e(o)}),F(e,t)},d=e=>{var t=zr();$r(k(t),17,()=>N(ce)?.links||[],Yr,(e,t)=>{var n=db(),r=k(n),i=A(O(r),!0);T(r);var a=j(r,2),o=e=>{p_(e,{get st(){return N(t).statement}})};L(a,e=>{N(t).statement&&e(o)}),M(()=>I(i,N(t).name)),F(e,n)}),F(e,t)},f=e=>{F(e,fb())};L(s,e=>{N(C).kind===`def`?e(c):N(C).kind===`spec`&&N(se)?.statement?e(u,1):N(C).kind===`link`?e(d,2):e(f,-1)});var p=j(s,2),m=e=>{var t=yb(),n=j(k(t),2);$r(n,21,()=>jy[N(C).kind===`def`?`def`:`statement`],e=>e.key,(e,t)=>{var n=mb(),r=O(n),i=O(r,!0),a=A(j(i));T(r);var o=j(r,2);$r(o,21,()=>My,Yr,(e,n)=>{var r=pb();let i;var a=A(r,!0);M(()=>{i=di(r,1,`mark svelte-1jpsao4`,null,i,{on:N(w).checklist?.[N(t).key]===N(n).value,differs:N(n).value===`differs`}),I(a,N(n).label)}),kr(`click`,r,()=>{N(w).checklist={...N(w).checklist||{},[N(t).key]:N(w).checklist?.[N(t).key]===N(n).value?void 0:N(n).value},l()}),F(e,r)}),T(o),T(n),M(()=>{I(i,N(t).label),I(a,` — ${N(t).hint??``}`)}),F(e,n)}),T(n);var i=j(n,4);st(i);var a=j(i,2),o=e=>{var t=hb();st(t),kr(`input`,t,l),ki(t,()=>N(w).witness,e=>N(w).witness=e),F(e,t)};L(a,e=>{N(C).kind===`spec`&&N(C).witness&&e(o)});var s=j(a,2);$r(s,21,()=>Ny,Yr,(e,t)=>{var n=pb();let r;var i=A(n,!0);M(()=>{r=di(n,1,`choice svelte-1jpsao4`,null,r,{on:N(w).group===N(t).key}),I(i,N(t).label)}),kr(`click`,n,()=>de(N(t).key)),F(e,n)}),T(s);var c=j(s,2),u=e=>{var t=vb(),n=k(t);$r(n,21,()=>Ay[N(w).group].filter(e=>!e.refuteOnly||N(C).refute),Yr,(e,t)=>{var n=gb(),i=O(n);wi(i);var a,o=j(i);T(n),M(()=>{a!==(a=N(t).value)&&(i.value=(i.__value=a)??``),I(o,` ${N(t).label??``}`)}),kr(`change`,i,l),ji(r,[],i,()=>(N(t).value,N(w).verdict),e=>N(w).verdict=e),F(e,n)}),T(n);var i=j(n,2),a=e=>{var t=_b();st(t),M(()=>Ti(t,`placeholder`,N(fe))),kr(`input`,t,l),ki(t,()=>N(w).detail,e=>N(w).detail=e),F(e,t)};L(i,e=>{N(fe)&&e(a)}),F(e,t)};L(c,e=>{N(w).group&&e(u)});var d=j(c,2),f=O(d),p=j(f,2);T(d),M(()=>f.disabled=!N(pe)),kr(`input`,i,l),ki(i,()=>N(w).comparison,e=>N(w).comparison=e),kr(`click`,f,me),kr(`click`,p,ge),F(e,t)},h=e=>{var t=Sb(),n=k(t),r=j(O(n)),i=A(j(r));T(n);var a=j(n,4);$r(a,17,()=>N(C).author_review,Yr,(e,t)=>{var n=bb(),r=k(n),i=A(r),a=A(j(r,2),!0);M(()=>{I(i,`${N(t).by??``}${N(t).file?` · `+N(t).file+(N(t).line?`:`+N(t).line:``):``}`),I(a,N(t).text||`(no text)`)}),F(e,n)},e=>{F(e,xb())});var o=j(a,2);st(o);var s=j(o,2),c=O(s),u=j(c,2);T(s),M(()=>{I(r,` ${N(w).verdict??``}${N(w).detail?` — `+N(w).detail:``} `),I(i,`(recorded ${N(w).decided_at??``})`)}),kr(`input`,o,l),ki(o,()=>N(w).disagreements,e=>N(w).disagreements=e),kr(`click`,c,he),kr(`click`,u,ge),F(e,t)};L(p,e=>{N(w).stage===`compare`?e(m):e(h,-1)}),M(()=>{I(i,N(w).reading),I(o,N(C).name)}),F(e,t)};L(x,e=>{N(w).stage===`read`?e(S):e(ee,-1)}),T(n),M(e=>{o=di(a,1,`svelte-1jpsao4`,null,o,{on:N(w).stage===`read`}),u=di(c,1,`svelte-1jpsao4`,null,u,{on:N(w).stage===`compare`}),p=di(f,1,`svelte-1jpsao4`,null,p,{on:N(w).stage===`author`}),I(h,`${N(C).kind===`def`?`Definition`:N(C).kind===`link`?`Linked claim`:`Statement`} · ${N(C).reason??``}${e??``}`),I(b,`Your reading${N(w).stage===`read`?``:` (locked `+N(w).locked_at+`)`}`)},[()=>s.skipped.includes(N(C).id)?` · skipped before`:``]),F(e,n)};L(Me,e=>{N(C)?N(w)?e(Fe,-1):e(Pe,1):e(Ne)}),M(e=>{I(S,`${N(re)??``} submitted · ${N(ne).length??``} skipped · ${N(te).length??``} to review${N(ie)?` · ${N(ie)} already independently reviewed`:``}`),I(be,e),xe.disabled=!s.reports.length,Se.disabled=!s.reports.length,I(Ce,`Export reports${N(ae)>0?` (${N(ae)} new)`:``}`)},[()=>zy(s.reviewer)]),kr(`change`,u,()=>{D(m,`all`),h()}),vi(u,()=>N(p),e=>D(p,e)),kr(`change`,_,h),vi(_,()=>N(m),e=>D(m,e)),kr(`click`,xe,_e),kr(`click`,Se,ve),F(e,n)};L(xe,e=>{N(a)?e(Se):N(i)?s.reviewer?e(Te,-1):e(we,2):e(Ce,1)}),T(be),F(e,be),Xe()}Ar([`click`,`change`,`input`]);var Ob=P(`<main class="state svelte-1n46o8q"><h1>MachineChecked</h1><p> </p></main>`),kb=P(`<main class="state svelte-1n46o8q"><p class="muted">Loading…</p></main>`),Ab=P(`<a> </a>`),jb=P(`<nav class="papers svelte-1n46o8q"></nav>`),Mb=P(`<span class="ptitle svelte-1n46o8q"> </span>`),Nb=P(`<a>Review</a>`),Pb=P(`<div class="banner svelte-1n46o8q"> <code> </code>. It records what its author linked, checked and
285
+ reviewed; MachineChecked displays it and does not endorse it.</div>`),Fb=P(`<div class="banner svelte-1n46o8q" role="alert">This link names release <code> </code>; this page shows release <code> </code>. What it says about the claim may differ.</div>`),Ib=P(`<div> </div>`),Lb=P(`<div class="banner svelte-1n46o8q"></div>`),Rb=P(`<main class="page svelte-1n46o8q"><!></main>`),zb=P(`<header class="top svelte-1n46o8q"><a class="brand svelte-1n46o8q" title="MachineChecked"><svg viewBox="0 0 32 32" width="20" height="20" aria-hidden="true"><circle cx="13" cy="13" r="9" fill="none" stroke="currentColor" stroke-width="3"></circle><path d="M20 20l8 8" stroke="currentColor" stroke-width="3" stroke-linecap="round"></path></svg></a> <!> <!> <!> <a>Overview</a></header> <!> <!> <!> <!>`,1);function Bb(e,t){Ye(t,!0);let n=Jt(null),r=Jt(null),i=Jt(!1);Xi().then(e=>D(n,e,!0)).catch(e=>D(r,String(e),!0)),Qi().then(e=>D(i,e,!0));let a=E(()=>N(n)?.papers[0]?.id),o=E(()=>ca.paper||N(a)),s=E(()=>N(n)?.papers.find(e=>e.id===N(o))),c=E(()=>N(n)&&ca.release&&ca.release!==N(n).release);var l=zr(),u=k(l),d=e=>{var t=Ob(),n=A(j(O(t)));T(t),M(()=>I(n,`The site's data could not be loaded: ${N(r)??``}`)),F(e,t)},f=e=>{F(e,kb())},p=e=>{var t=zb(),r=k(t),l=O(r),u=j(l,2),d=e=>{var t=jb();$r(t,21,()=>N(n).papers,Yr,(e,t)=>{var r=Ab();let i;var a=A(r);M(e=>{Ti(r,`href`,e),Ti(r,`title`,N(t).title),i=di(r,1,`svelte-1n46o8q`,null,i,{on:ca.view===`read`&&N(t).id===N(o)}),I(a,`Paper ${N(t).id??``}`)},[()=>la(N(n).release,`read`,N(t).id)]),F(e,r)}),T(t),F(e,t)},f=e=>{var t=Mb(),n=A(t,!0);M(()=>{Ti(t,`title`,N(s).title),I(n,N(s).title)}),F(e,t)};L(u,e=>{N(n).papers.length>1?e(d):N(s)&&e(f,1)});var p=j(u,2);Oy(p,{get index(){return N(n)}});var m=j(p,2),h=e=>{var t=Nb();let r;M(e=>{r=di(t,1,`aux svelte-1n46o8q`,null,r,{on:ca.view===`review`}),Ti(t,`href`,e)},[()=>la(N(n).release,`review`)]),F(e,t)};L(m,e=>{N(n).review_queue&&e(h)});var g=j(m,2);let _;T(r);var v=j(r,2),y=e=>{var t=Pb(),n=O(t),r=A(j(n),!0);De(),T(t),M(()=>{I(n,`An audit published by ${(Ji.author||`its author`)??``} at `),I(r,new URL(Wi.href).host)}),F(e,t)};L(v,e=>{Wi&&Ji&&e(y)});var b=j(v,2),x=e=>{var t=Fb(),r=j(O(t)),i=A(r,!0),a=A(j(r,2),!0);De(),T(t),M(()=>{I(i,ca.release),I(a,N(n).release)}),F(e,t)};L(b,e=>{N(c)&&e(x)});var S=j(b,2),ee=e=>{var t=Lb();$r(t,21,()=>N(n).notes,Yr,(e,t)=>{var n=Ib(),r=A(n,!0);M(()=>I(r,N(t))),F(e,n)}),T(t),F(e,t)};L(S,e=>{N(n).notes?.length&&e(ee)});var te=j(S,2),ne=e=>{var t=Rb();Zv(O(t),{get index(){return N(n)},get claimId(){return ca.claim},full:!0,get editable(){return N(i)}}),T(t),F(e,t)},C=e=>{Cd(e,{get index(){return N(n)}})},re=e=>{yy(e,{get index(){return N(n)}})},ie=e=>{Db(e,{get index(){return N(n)}})},ae=e=>{cy(e,{get index(){return N(n)},get paperId(){return N(o)},get claimId(){return ca.claim},get editable(){return N(i)}})};L(te,e=>{ca.view===`claim`&&ca.claim?e(ne):ca.view===`coverage`?e(C,1):ca.view===`changes`?e(re,2):ca.view===`review`&&N(n).review_queue?e(ie,3):e(ae,-1)}),M((e,t)=>{Ti(l,`href`,e),_=di(g,1,`aux svelte-1n46o8q`,null,_,{on:ca.view===`coverage`}),Ti(g,`href`,t)},[()=>la(N(n).release,`read`,N(a)),()=>la(N(n).release,`coverage`)]),F(e,t)};L(u,e=>{N(r)?e(d):N(n)?e(p,-1):e(f,1)}),F(e,l),Xe()}Wr(Bb,{target:document.getElementById(`app`)});