@silurus/ooxml 0.74.3 → 0.74.4

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.
@@ -1,5 +1,5 @@
1
1
  //#region packages/docx/src/render-worker.ts?worker&inline
2
- var e = "var e=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,n.unregister(this),e}free(){let e=this.__destroy_into_raw();v.__wbg_docxarchive_free(e,0)}extract_image(e){let t=d(e,v.__wbindgen_malloc,v.__wbindgen_realloc),n=_,i=v.docxarchive_extract_image(this.__wbg_ptr,t,n);if(i[3])throw f(i[2]);var a=r(i[0],i[1]).slice();return v.__wbindgen_free(i[0],i[1]*1,1),a}constructor(e,t){let r=u(e,v.__wbindgen_malloc),i=_,a=v.docxarchive_new(r,i,!l(t),l(t)?BigInt(0):t);if(a[2])throw f(a[1]);return this.__wbg_ptr=a[0]>>>0,n.register(this,this.__wbg_ptr,this),this}parse(){let e=v.docxarchive_parse(this.__wbg_ptr);if(e[3])throw f(e[2]);var t=r(e[0],e[1]).slice();return v.__wbindgen_free(e[0],e[1]*1,1),t}to_markdown(){let e,t;try{let i=v.docxarchive_to_markdown(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,f(i[2]);return e=n,t=r,o(n,r)}finally{v.__wbindgen_free(e,t,1)}}};Symbol.dispose&&(e.prototype[Symbol.dispose]=e.prototype.free);function t(){return{__proto__:null,\"./docx_parser_bg.js\":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(o(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(o(e,t))}finally{v.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=d(n,v.__wbindgen_malloc,v.__wbindgen_realloc),i=_;a().setInt32(e+4,i,!0),a().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return o(e,t)},__wbindgen_init_externref_table:function(){let e=v.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}const n=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>v.__wbg_docxarchive_free(e>>>0,1));function r(e,t){return e>>>=0,c().subarray(e/1,e/1+t)}let i=null;function a(){return(i===null||i.buffer.detached===!0||i.buffer.detached===void 0&&i.buffer!==v.memory.buffer)&&(i=new DataView(v.memory.buffer)),i}function o(e,t){return e>>>=0,h(e,t)}let s=null;function c(){return(s===null||s.byteLength===0)&&(s=new Uint8Array(v.memory.buffer)),s}function l(e){return e==null}function u(e,t){let n=t(e.length*1,1)>>>0;return c().set(e,n/1),_=e.length,n}function d(e,t,n){if(n===void 0){let n=g.encode(e),r=t(n.length,1)>>>0;return c().subarray(r,r+n.length).set(n),_=n.length,r}let r=e.length,i=t(r,1)>>>0,a=c(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=c().subarray(i+o,i+r),a=g.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return _=o,i}function f(e){let t=v.__wbindgen_externrefs.get(e);return v.__externref_table_dealloc(e),t}let p=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});p.decode();let m=0;function h(e,t){return m+=t,m>=2146435072&&(p=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),p.decode(),m=t),p.decode(c().subarray(e,e+t))}const g=new TextEncoder;`encodeInto`in g||(g.encodeInto=function(e,t){let n=g.encode(e);return t.set(n),{read:e.length,written:n.length}});let _=0,v;function y(e,t){return v=e.exports,i=null,s=null,v.__wbindgen_start(),v}async function b(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}async function x(e){if(v!==void 0)return v;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`));let n=t();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:r,module:i}=await b(await e,n);return y(r,i)}async function S(e){return v=void 0,i=null,s=null,x(e)}const C=new Map;function w(e,t,n){let r=C.get(e);if(r&&r.set===t)return r.refs++,{face:r.face,isNew:!1};let i=n();return C.set(e,{face:i,set:t,refs:1}),{face:i,isNew:!0}}function T(e){let t=new Set;for(let n of e)if(!t.has(n)){t.add(n);for(let[e,t]of C)if(t.face===n){if(t.refs--,t.refs<=0){try{t.set.delete(n)}catch{}C.delete(e)}break}}}function E(e){return Promise.race([e,new Promise(e=>setTimeout(e,15e3))])}const D=new Map;function O(e){let t=[],n=/@font-face\\s*\\{([^}]*)\\}/g,r;for(;r=n.exec(e);){let e=r[1],n=t=>e.match(RegExp(`(?:^|;|\\\\n)\\\\s*${t}\\\\s*:\\\\s*([^;]+)`,`i`))?.[1].trim(),i=n(`font-family`),a=n(`src`);if(!i||!a)continue;let o={},s=n(`font-style`);s&&(o.style=s);let c=n(`font-weight`);c&&(o.weight=c);let l=n(`font-stretch`);l&&(o.stretch=l);let u=n(`unicode-range`);u&&(o.unicodeRange=u),t.push({family:i.replace(/^['\"]|['\"]$/g,``),src:a,descriptors:o})}return t}function k(){return typeof document<`u`&&document&&document.fonts?document.fonts:typeof self<`u`&&self&&`fonts`in self?self.fonts:null}function A(e,t){let n=t.descriptors;return[`gfonts`,e,t.family.toLowerCase(),n.style??``,n.weight??``,n.stretch??``,n.unicodeRange??``,t.src].join(`|`)}async function j(e,t){let n=k();if(!n||typeof FontFace>`u`||typeof fetch>`u`)return[];let r=new Set,i=new Set,a=new Set,o=new Map,s=new Set;for(let n of e){if(!n)continue;let e=n.toLowerCase();if(r.has(e))continue;r.add(e);let s=t[e];if(!s)continue;a.add(s.url);let c=(s.loadFamily??n).toLowerCase();i.add(c);let l=o.get(s.url);l||(l=new Set,o.set(s.url,l)),l.add(c)}if(i.size===0)return[];let c=await E(Promise.all([...a].map(async e=>{let t=D.get(e);if(t)return{url:e,rules:await t};let n=(async()=>{try{let t=await fetch(e);if(!t.ok)throw Error(`HTTP ${t.status}`);return O(await t.text())}catch{D.delete(e);for(let t of o.get(e)??[])s.add(t);return[]}})();return D.set(e,n),{url:e,rules:await n}}))),l=[],u=[];for(let e of Array.isArray(c)?c:[])for(let t of e.rules){let{face:r,isNew:i}=w(A(e.url,t),n,()=>{let e=new FontFace(t.family,t.src,t.descriptors);return n.add(e),e});l.push(r),i&&u.push(r)}return u.length>0&&await E(Promise.allSettled(u.map(e=>e.load())).then(e=>(e.forEach((e,t)=>{e.status===`rejected`&&s.add(u[t].family.replace(/['\"]/g,``).toLowerCase())}),n.ready))),s.size>0&&console.warn(`[ooxml] failed to preload web font(s): ${[...s].join(`, `)}; falling back to system fonts (text may shift or differ).`),l}function M(e,t){let n=N(t),r=e.slice(),i=Math.min(32,r.length);for(let e=0;e<i;e++)r[e]^=n[e%16];return r}function N(e){let t=e.replace(/[{}\\-\\s]/g,``);if(t.length!==32||/[^0-9a-fA-F]/.test(t))throw Error(`invalid fontKey GUID: ${e}`);let n=new Uint8Array(16);for(let e=0;e<16;e++)n[e]=parseInt(t.slice(e*2,e*2+2),16);return n.reverse()}function ee(e,t,n,r){let i=2166136261;for(let e=0;e<r.length;e++)i^=r[e],i=Math.imul(i,16777619);return`${e}|${t}|${n}|${r.length}|${(i>>>0).toString(16)}`}async function te(e,t=30*1024*1024){let n=k();if(!n||typeof FontFace>`u`)return[];let r=[],i=[],a=[];for(let o of e)try{if(o.bytes.length===0||o.bytes.length>t){a.push(o.family);continue}let e=o.odttf?M(o.bytes,o.fontKey??``):o.bytes,{face:s,isNew:c}=w(`embedded:${ee(o.family,o.weight,o.style,e)}`,n,()=>{let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),r=new FontFace(o.family,t,{weight:o.weight,style:o.style});return n.add(r),r});r.push(s),c&&i.push(s)}catch{a.push(o.family)}return i.length>0&&await E(Promise.allSettled(i.map(e=>e.load())).then(e=>(e.forEach((e,t)=>{e.status===`rejected`&&a.push(i[t].family)}),n.ready))),a.length>0&&console.warn(`[ooxml] failed to register embedded font(s): ${[...new Set(a)].join(`, `)}; falling back to substitute fonts (text may shift or differ).`),r}const P=`https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;700&display=swap`,ne=`https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;700&display=swap`,F={calibri:{url:`https://fonts.googleapis.com/css2?family=Carlito:ital,wght@0,400;0,700;1,400;1,700&display=swap`,loadFamily:`Carlito`},\"calibri light\":{url:`https://fonts.googleapis.com/css2?family=Carlito:ital,wght@0,400;0,700;1,400;1,700&display=swap`,loadFamily:`Carlito`},cambria:{url:`https://fonts.googleapis.com/css2?family=Caladea:ital,wght@0,400;0,700;1,400;1,700&display=swap`,loadFamily:`Caladea`},\"cambria math\":{url:`https://fonts.googleapis.com/css2?family=Caladea:ital,wght@0,400;0,700;1,400;1,700&display=swap`,loadFamily:`Caladea`},\"nunito sans\":{url:`https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap`},nunito:{url:`https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,400;0,700;1,400;1,700&display=swap`},\"open sans\":{url:`https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap`},roboto:{url:`https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700&display=swap`},lato:{url:`https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;1,400;1,700&display=swap`},montserrat:{url:`https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,700;1,400;1,700&display=swap`},poppins:{url:`https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,700;1,400;1,700&display=swap`},raleway:{url:`https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,400;0,700;1,400;1,700&display=swap`},\"playfair display\":{url:`https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&display=swap`},ubuntu:{url:`https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,400;0,700;1,400;1,700&display=swap`},\"sakkal majalla\":{url:P,loadFamily:`Noto Naskh Arabic`},\"traditional arabic\":{url:P,loadFamily:`Noto Naskh Arabic`},\"simplified arabic\":{url:P,loadFamily:`Noto Naskh Arabic`},\"arabic typesetting\":{url:P,loadFamily:`Noto Naskh Arabic`},\"univers next arabic\":{url:ne,loadFamily:`Noto Sans Arabic`},\"noto naskh arabic\":{url:P,loadFamily:`Noto Naskh Arabic`},\"noto sans arabic\":{url:ne,loadFamily:`Noto Sans Arabic`}};function I(e,t){let n=e.trim();if(!n)throw TypeError(`Canvas font route requires a family list`);return Object.freeze({familyList:n,scope:t,fingerprint:`canvas-font-route-v1:${encodeURIComponent(t)}:${encodeURIComponent(n)}`})}function L(e,t,n,r){if(!Number.isFinite(t)||t<0)throw RangeError(`Canvas font size must be finite and non-negative`);if(!Number.isFinite(n)||n<1||n>1e3)throw RangeError(`Canvas font weight must be finite and between 1 and 1000`);if(!e.familyList.trim())throw TypeError(`Canvas font route requires a family list`);return`${r} ${n} ${t}px ${e.familyList}`}function R(e){if(!e)return null;let t=e.toLowerCase();return/[ᄀ-ᇿ㄰-㆏가-힯]/.test(e)?`kr`:/[぀-ヿ]/.test(e)?`jp`:/jhenghei|微軟正黑|新細明|細明|pmingliu|mingliu|dfkai|標楷|華康|cns11643|kaiti tc|ming\\s*liu/.test(t)||/新細明體|細明體|標楷體|微軟正黑體|華康/.test(e)?`tc`:/simsun|nsimsun|simhei|simkai|simfang|yahei|dengxian|fangsong|kaiti|youyuan|lisu|stsong|stkaiti|stfangsong|stheiti|stxihei|stzhongsong|songti sc|heiti sc|微软雅黑/.test(t)||/宋体|黑体|楷体|仿宋|等线|微软雅黑|隶书|幼圆/.test(e)?`sc`:/malgun|batang|gulim|dotum|gungsuh|nanum|new gulim|hancom|hy(gothic|graphic|namu)?/.test(t)?`kr`:/\\bmeiryo\\b|\\byu\\s*(gothic|mincho)\\b|yugothic|yumincho|hiragino|\\bms\\s*(gothic|mincho|pgothic|pmincho|ui\\s*gothic)\\b|\\bms[pg]?(gothic|mincho)\\b|ipa(ex)?(gothic|mincho)|noto\\s+(sans|serif)\\s+jp|游ゴシック|游明朝|MS|メイリオ|ヒラギノ/.test(t)||/游ゴシック|游明朝|MS ゴシック|MS 明朝|MS Pゴシック|メイリオ|ヒラギノ/.test(e)?`jp`:null}function z(e){if(!e)return`sans`;let t=e.toLowerCase();return/mono|courier|consolas|等幅|gothic_m/.test(t)?`mono`:/roman|times|cambria|caladea|georgia|garamond|century(?!\\s*gothic)|palatino|antiqua|didot|bodoni|playfair|source serif|noto serif|min\\s*cho|明朝体|明朝|song|sung|simsun|nsimsun|batang|gungsuh|ming\\s*liu|mingliu|pmingliu|fang\\s*song|fangsong|kai\\s*ti|kaiti|simkai|simfang|stsong|stkaiti|stfangsong|stzhongsong|新細明|細明|宋体|楷体|楷體|仿宋|標楷|游明朝|MS 明朝|ms mincho|yu mincho|hiragino mincho|ヒラギノ明朝/.test(t)||/新細明體|細明體|宋体|明朝|楷体|楷體|仿宋|標楷體|游明朝|MS 明朝/.test(e)?`serif`:`sans`}function B(e,t){let n=t===`serif`?`Noto Serif`:`Noto Sans`,r={jp:[`jp`,`sc`,`tc`,`kr`],sc:[`sc`,`tc`,`jp`,`kr`],tc:[`tc`,`sc`,`jp`,`kr`],kr:[`kr`,`jp`,`sc`,`tc`]},i={kr:`KR`,sc:`SC`,tc:`TC`,jp:`JP`};return r[e].map(e=>`${n} ${i[e]}`)}const V=[`Noto Sans`,`Noto Sans Hebrew`,`Noto Sans Thai`,`Noto Sans Devanagari`],H=[`Noto Serif`,`Noto Serif Hebrew`],U=e=>`https://fonts.googleapis.com/css2?family=${e}:wght@400;700&display=swap`,re={\"noto sans kr\":{url:U(`Noto+Sans+KR`)},\"noto sans sc\":{url:U(`Noto+Sans+SC`)},\"noto sans tc\":{url:U(`Noto+Sans+TC`)},\"noto sans jp\":{url:U(`Noto+Sans+JP`)},\"noto serif kr\":{url:U(`Noto+Serif+KR`)},\"noto serif sc\":{url:U(`Noto+Serif+SC`)},\"noto serif tc\":{url:U(`Noto+Serif+TC`)},\"noto serif jp\":{url:U(`Noto+Serif+JP`)},\"noto sans\":{url:U(`Noto+Sans`)},\"noto serif\":{url:U(`Noto+Serif`)},\"noto sans devanagari\":{url:U(`Noto+Sans+Devanagari`)},\"noto sans thai\":{url:U(`Noto+Sans+Thai`)},\"noto sans hebrew\":{url:U(`Noto+Sans+Hebrew`)},\"noto serif hebrew\":{url:U(`Noto+Serif+Hebrew`)}};function ie(e,t){let n=!1,r=!1,i=!1,a=!1,o=!1,s=!1,c=!1,l=!1,u=()=>n&&r&&i&&a&&o&&s&&c&&l;outer:for(let t of e)if(t)for(let e of t){let t=e.codePointAt(0);if(t!==void 0&&!(t<=591)&&(t>=4352&&t<=4607||t>=12592&&t<=12687||t>=44032&&t<=55215?r=!0:t>=12352&&t<=12543?i=!0:t>=13312&&t<=19903||t>=19968&&t<=40959||t>=63744&&t<=64255||t>=131072&&t<=195103?n=!0:t>=1536&&t<=1791||t>=1872&&t<=1919||t>=2208&&t<=2303||t>=64336&&t<=65023||t>=65136&&t<=65279?a=!0:t>=3584&&t<=3711?o=!0:t>=1424&&t<=1535||t>=64285&&t<=64335?s=!0:t>=2304&&t<=2431?c=!0:(t>=1024&&t<=1279||t>=880&&t<=1023)&&(l=!0),u()))break outer}let d=[],f=new Set;r&&f.add(`kr`),i&&f.add(`jp`),n&&f.size===0&&f.add(t??`jp`);for(let e of[`kr`,`sc`,`tc`,`jp`])if(f.has(e)){let t={kr:`KR`,sc:`SC`,tc:`TC`,jp:`JP`}[e];d.push(`Noto Sans ${t}`,`Noto Serif ${t}`)}return l&&d.push(`Noto Sans`,`Noto Serif`),a&&d.push(`Noto Naskh Arabic`,`Noto Sans Arabic`),o&&d.push(`Noto Sans Thai`),s&&d.push(`Noto Sans Hebrew`,`Noto Serif Hebrew`),c&&d.push(`Noto Sans Devanagari`),d}const ae={167:`♣`,168:`♦`,169:`♥`,170:`♠`,171:`↔`,172:`←`,173:`↑`,174:`→`,175:`↓`,183:`•`,184:`÷`,185:`≠`,180:`×`,176:`°`,177:`±`,163:`≤`,179:`≥`},oe={33:`✏`,34:`✂`,36:`👓`,74:`☺`,75:`😐`,76:`☹`,118:`❖`,167:`▪`,108:`●`,110:`■`,116:`◆`,119:`◆`,251:`✗`,252:`✓`,253:`☒`,254:`☑`,223:`←`,224:`→`,225:`↑`,226:`↓`,227:`↖`,228:`↗`,229:`↙`,230:`↘`};function se(e){let t={};for(let n of Object.keys(e)){let r=Number(n);t[r]=e[r],t[61440+r]=e[r]}return t}const ce=se(ae),le=se(oe);function ue(e,t){if(!t)return e;let n=t.trim().toLowerCase(),r=n===`wingdings`?le:n===`symbol`?ce:null;return r?r[e.charCodeAt(0)]??e:e}function de(e){if(!e)return!1;let t=e.toLowerCase();return t===`symbol`||t.includes(`wingdings`)}function W(e,t){if(!de(t)||e.length===0)return[{text:e,mapped:!1}];let n=[],r=``,i=null;for(let a of e){let e=ue(a,t),o=e!==a;i===null||o===i?(i=o,r+=e):(n.push({text:r,mapped:i}),i=o,r=e)}return r.length>0&&n.push({text:r,mapped:i??!1}),n}function G(e,t,n){return e.titleFontSizeHpt?e.titleFontSizeHpt/100*n:Math.max(10,t*.085)}const fe=.62;function pe(e,t,n,r,i){if(!e.title)return{fontPx:0,topPad:0,bottomPad:0,bandH:0};let a=G(e,t,n),o=a+t*r+t*i,s=Math.min(Math.max(0,o-a),a*fe);return{fontPx:a,topPad:s,bottomPad:o-a-s,bandH:o}}function me(e,t,n,r){if(!e.showLegend)return null;let i=e.legendPos??`r`,a=i===`l`?`l`:i===`t`?`t`:i===`b`?`b`:`r`;return a===`r`||a===`l`?{side:a,reserveW:Math.max(80,t*r),reserveH:0}:{side:a,reserveW:0,reserveH:Math.max(18,n*.08)}}function he(e){return{legRightW:e?.side===`r`?e.reserveW:0,legLeftW:e?.side===`l`?e.reserveW:0,legTopH:e?.side===`t`?e.reserveH:0,legBottomH:e?.side===`b`?e.reserveH:0}}function ge(e,t,n){return e?e/100*n:Math.max(8,Math.min(10,t*.045))}function _e(e){return Math.max(8,e*.02)}function ve(e,t,n,r){let i=ge(e.catAxisTitleFontSizeHpt,n,r),a=ge(e.valAxisTitleFontSizeHpt,n,r);return{catFontPx:i,valFontPx:a,catBandH:e.catAxisTitle?i+_e(n)+4:0,valBandW:e.valAxisTitle?a+_e(t)+4:0}}function ye(e,t,n){if(!e.title)return{fontPx:0,topPad:0,bottomPad:0,bandH:0};let r=G(e,t,n),i=r*2.25,a=Math.min(Math.max(0,i-r),r*fe);return{fontPx:r,topPad:a,bottomPad:i-r-a,bandH:i}}function be(e){return e*2.75}function K(e,t,n,r,i,a,o){let s=o.titleBand??pe(e,i,a,o.titleTopPadFrac??0,o.titleBottomPadFrac??0),c=me(e,r,i,o.legendSideReserveFrac),l=he(c),u=ve(e,r,i,a),d,f,p,m;if(o.radialGapFrac!=null){let e=i*o.radialGapFrac;p=r-l.legRightW-l.legLeftW,m=i-s.bandH-l.legTopH-l.legBottomH-e,d=t+l.legLeftW,f=n+s.bandH+l.legTopH+e}else{let a=o.pad;if(!a)throw Error(`computeChartFrame: cartesian frame requires params.pad`);let s=o.honorPlotAreaManualLayout?e.plotAreaManualLayout:null;if(s&&s.w!=null&&s.h!=null){let e=t+s.x*r,o=n+s.y*i,c=e+s.w*r,l=o+s.h*i;if(s.layoutTarget===`inner`){d=Math.max(e,t+a.l),f=Math.max(o,n+a.t);let s=Math.min(c,t+r-a.r),u=Math.min(l,n+i-a.b);p=Math.max(0,s-d),m=Math.max(0,u-f)}else d=e,f=o,p=s.w*r,m=s.h*i}else d=t+a.l,f=n+a.t,p=r-a.l-a.r,m=i-a.t-a.b}return{title:s,legend:c,legendBands:l,axisTitles:u,plotRect:{px0:d,py0:f,pw:p,ph:m},center:{cx:d+p/2,cy:f+m/2}}}function xe(e,t=5){if(e===0)return 1;let n=e/t,r=10**Math.floor(Math.log10(n)),i=n/r;return(i<1.5?1:i<3.5?2:i<7.5?5:10)*r}function Se(e,t,n=0){if(e<=0)return t;let r=e+(e-n)/20;return Math.ceil(r/t)*t}function Ce(e,t){if(e>=0)return 0;let n=Math.floor(e/t)*t;return Math.abs(n-e)<t*1e-9?n-t:n}function we(e){return e==null||!isFinite(e)||e<=0?5:Math.min(15,Math.max(4,Math.round(e/42)))}function Te(e,t,n,r,i,a){let o=xe(t-e,we(i)),s=a!=null&&isFinite(a)&&a>0?a:o,c=n??Ce(e,o);return{min:c,max:r??Se(t,o,c),step:s}}function Ee(e,t,n,r){let i,a=r?.logBase;if(a!=null&&isFinite(a)&&a>=2&&t>0&&n>0){let r=Math.log(t),a=Math.log(n)-r;i=a===0?0:(Math.log(Math.max(e,Number.MIN_VALUE))-r)/a}else{let r=n-t;i=r===0?0:(e-t)/r}return r?.reversed?1-i:i}function De(e,t,n,r,i){let a=isFinite(n)&&n>=2?n:10,o=e=>Math.log(e)/Math.log(a),s=t>0?t:1,c=Math.floor(o(e>0?e:s)),l=Math.ceil(o(s)),u=r??a**+c,d=i??a**+Math.max(l,c+1),f=[],p=Math.ceil(o(u)-1e-9),m=Math.floor(o(d)+1e-9);for(let e=p;e<=m;e++)f.push(a**+e);return{min:u,max:d,lines:f}}function Oe(e,t,n,r){let i=Math.min(e.length,t.length);if(i<2)return{xs:[],ys:[]};if(n===`linear`){let n=r?.intercept,a=0,o=0,s=0,c=0;for(let n=0;n<i;n++)a+=e[n],o+=t[n],s+=e[n]*e[n],c+=e[n]*t[n];let l,u;if(n!=null&&isFinite(n)){let e=s,t=c-n*a;l=e===0?0:t/e,u=n}else{let e=i*s-a*a;l=e===0?0:(i*c-a*o)/e,u=(o-l*a)/i}let d=e[0],f=e[i-1];return{xs:[d,f],ys:[l*d+u,l*f+u]}}if(n===`movingAvg`){let n=Math.max(2,Math.round(r?.period??2));if(i<n)return{xs:[],ys:[]};let a=[],o=[];for(let r=n-1;r<i;r++){let i=0;for(let e=0;e<n;e++)i+=t[r-e];a.push(e[r]),o.push(i/n)}return{xs:a,ys:o}}return{xs:[],ys:[]}}const ke=12700;function Ae(e,t){return e?Math.max(.5,e/ke)*t:1}function je(e,t,n){return{color:e?`#${e}`:`#aaa`,width:Ae(t,n)}}function Me(e,t,n){return{color:e?`#${e}`:`#e0e0e0`,width:t?Ae(t,n):.5}}function Ne(e){return e.catAxisCrossBetween!==`midCat`}const Pe=864e5,Fe=Date.UTC(1899,11,30),Ie=Date.UTC(1904,0,1);function Le(e,t=!1){if(t)return new Date(Ie+e*Pe);let n=e<60?e+1:e;return new Date(Fe+n*Pe)}function Re(e,t){if(!Number.isFinite(e))return String(e);let n=Math.max(0,Math.trunc(t)),r=e<0,[i,a=``]=ze(Math.abs(e).toString()).split(`.`),o=a.padEnd(n+1,`0`),s=o.slice(0,n),c=o.charCodeAt(n)-48,l=(i+s).split(``).map(e=>e.charCodeAt(0)-48);if(c>=5){let e=l.length-1;for(;e>=0;e--)if(l[e]===9)l[e]=0;else{l[e]+=1;break}e<0&&l.unshift(1)}let u=l.map(e=>String(e)).join(``),d=n,f=(d>0?u.slice(0,u.length-d):u)||`0`,p=d>0?u.slice(u.length-d):``,m=f.replace(/^0+(?=\\d)/,``),h=p.length>0?`${m}.${p}`:m,g=/^[0.]*$/.test(h)&&!/[1-9]/.test(h);return r&&!g?`-${h}`:h}function ze(e){let t=/^(\\d+)(?:\\.(\\d+))?[eE]([+-]?\\d+)$/.exec(e);if(!t)return e;let[,n,r=``,i]=t,a=parseInt(i,10),o=n+r,s=n.length+a;return s<=0?`0.`+`0`.repeat(-s)+o:s>=o.length?o+`0`.repeat(s-o.length):o.slice(0,s)+`.`+o.slice(s)}function Be(e){return Number.isInteger(e)?String(e):Re(e,6).replace(/\\.?0+$/,``)}function Ve(e,t,n=!1){if(!t||t.trim().toLowerCase()===`general`)return Be(e);if(Ue(t))return We(e,t,n);let r=Ge(t),i;return i=e>0?r[0]??t:e<0?r[1]??r[0]??t:r[2]??r[0]??t,i===``?``:(e<0&&r.length<2?`-`:``)+Ke(Math.abs(e),i)}function He(e,t,n=!1){if(!t||e.trim()===``)return e;let r=Number(e);return Number.isFinite(r)?Ve(r,t,n):e}function Ue(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`\"`){t=!t;continue}if(!t){if(r===`\\\\`){n++;continue}if(r===`[`){for(;n<e.length&&e[n]!==`]`;)n++;continue}if(r===`y`||r===`Y`||r===`d`||r===`D`||r===`m`||r===`M`||r===`h`||r===`H`||r===`s`||r===`S`)return!0}}return!1}function We(e,t,n=!1){let r=Le(Math.floor(e),n),i=r.getUTCFullYear(),a=r.getUTCMonth()+1,o=r.getUTCDate(),s=(e-Math.floor(e))*86400,c=Math.floor(s/3600),l=Math.floor(s%3600/60),u=Math.floor(s%60),d=``,f=!1,p=0;for(;p<t.length;){let e=t[p];if(e===`\"`){f=!f,p++;continue}if(f){d+=e,p++;continue}if(e===`\\\\`&&p+1<t.length){d+=t[p+1],p+=2;continue}if(e===`[`){for(;p<t.length&&t[p]!==`]`;)p++;p<t.length&&p++;continue}if(e===`y`||e===`Y`){let e=0;for(;p<t.length&&(t[p]===`y`||t[p]===`Y`);)e++,p++;d+=e>=3?String(i):String(i%100).padStart(2,`0`);continue}if(e===`m`||e===`M`){let e=0;for(;p<t.length&&(t[p]===`m`||t[p]===`M`);)e++,p++;d.match(/[Hh]+\\W*$/)?d+=e>=2?String(l).padStart(2,`0`):String(l):d+=e>=2?String(a).padStart(2,`0`):String(a);continue}if(e===`d`||e===`D`){let e=0;for(;p<t.length&&(t[p]===`d`||t[p]===`D`);)e++,p++;d+=e>=2?String(o).padStart(2,`0`):String(o);continue}if(e===`h`||e===`H`){let e=0;for(;p<t.length&&(t[p]===`h`||t[p]===`H`);)e++,p++;d+=e>=2?String(c).padStart(2,`0`):String(c);continue}if(e===`s`||e===`S`){let e=0;for(;p<t.length&&(t[p]===`s`||t[p]===`S`);)e++,p++;d+=e>=2?String(u).padStart(2,`0`):String(u);continue}d+=e,p++}return d}function Ge(e){let t=[],n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\\\`&&r+1<e.length){n+=i+e[r+1],r++;continue}if(i===`\"`){for(n+=i,r++;r<e.length&&e[r]!==`\"`;)n+=e[r],r++;r<e.length&&(n+=e[r]);continue}if(i===`[`){for(n+=i,r++;r<e.length&&e[r]!==`]`;)n+=e[r],r++;r<e.length&&(n+=e[r]);continue}if(i===`;`){t.push(n),n=``;continue}n+=i}return t.push(n),t}function Ke(e,t){let n=[],r=0,i=!1,a=!1;for(;r<t.length;){let e=t[r];if(e===`\"`){r++;let e=``;for(;r<t.length&&t[r]!==`\"`;)e+=t[r],r++;r<t.length&&r++,n.push({kind:`lit`,text:e});continue}if(e===`\\\\`&&r+1<t.length){n.push({kind:`lit`,text:t[r+1]}),r+=2;continue}if(e===`_`&&r+1<t.length){n.push({kind:`lit`,text:` `}),r+=2;continue}if(e===`*`&&r+1<t.length){r+=2;continue}if(e===`[`){for(r++;r<t.length&&t[r]!==`]`;)r++;r<t.length&&r++;continue}if(e===`%`){a=!0,n.push({kind:`lit`,text:`%`}),r++;continue}if(e===`#`||e===`0`||e===`.`||e===`,`||e===`?`){let e=``;for(;r<t.length&&(t[r]===`#`||t[r]===`0`||t[r]===`.`||t[r]===`,`||t[r]===`?`);)e+=t[r],r++;n.push({kind:`num`,text:e}),i=!0;continue}n.push({kind:`lit`,text:e}),r++}if(!i)return n.map(e=>e.text).join(``);let o=a?e*100:e,s=``;for(let e of n)e.kind===`num`&&(s+=e.text);let c=qe(o,s),l=!1;return n.map(e=>e.kind===`lit`?e.text:l?``:(l=!0,c)).join(``)}function qe(e,t){let n=t.indexOf(`.`),r=n>=0?t.slice(0,n):t,i=n>=0?t.slice(n+1):``,a=/,/.test(r),o=(i.match(/[#0?]/g)??[]).length,s=(r.replace(/,/g,``).match(/0/g)??[]).length,[c,l=``]=Re(e,o).split(`.`),u=c.padStart(s,`0`),d=a?u.replace(/\\B(?=(\\d{3})+(?!\\d))/g,`,`):u;return o===0?d:`${d}.${l.padEnd(o,`0`)}`}function Je(e,t,n){if(t===``||n<=0)return``;if(e.measureText(t).width<=n)return t;if(e.measureText(`…`).width>n)return``;let r=0,i=t.length-1,a=0;for(;r<=i;){let o=r+i>>1;e.measureText(t.slice(0,o)+`…`).width<=n?(a=o,r=o+1):i=o-1}let o=a>0?t.charCodeAt(a-1):0;return o>=55296&&o<=56319&&a--,t.slice(0,a)+`…`}function Ye(e,t){return[Math.max(1,Math.ceil(e)),Math.max(1,Math.ceil(t))]}function Xe(e,t){let[n,r]=Ye(e,t);if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(n,r);if(typeof document<`u`){let e=document.createElement(`canvas`);return e.width=n,e.height=r,e}return null}const Ze={pct5:[0,16,0,0,0,1,0,0],pct10:[136,0,34,0,136,0,34,0],pct20:[136,34,136,34,136,34,136,34],pct25:[136,85,34,85,136,85,34,85],pct30:[170,85,170,85,170,85,170,85],pct40:[170,119,170,221,170,119,170,221],pct50:[170,85,170,85,170,85,170,85],pct60:[221,85,119,85,221,85,119,85],pct70:[238,85,187,85,238,85,187,85],pct75:[238,170,187,170,238,170,187,170],pct80:[254,239,251,191,254,239,251,191],pct90:[255,239,255,251,255,239,255,251],horz:[255,0,0,0,255,0,0,0],vert:[136,136,136,136,136,136,136,136],ltHorz:[0,255,0,0,0,0,0,0],ltVert:[32,32,32,32,32,32,32,32],dkHorz:[255,255,0,0,255,255,0,0],dkVert:[204,204,204,204,204,204,204,204],narHorz:[255,0,255,0,255,0,255,0],narVert:[170,170,170,170,170,170,170,170],cross:[255,136,136,136,255,136,136,136],lgGrid:[255,128,128,128,128,128,128,128],smGrid:[255,136,136,136,255,136,136,136],dotGrid:[136,0,0,0,136,0,0,0],dnDiag:[128,64,32,16,8,4,2,1],upDiag:[1,2,4,8,16,32,64,128],ltDnDiag:[136,68,34,17,136,68,34,17],ltUpDiag:[17,34,68,136,17,34,68,136],dkDnDiag:[195,129,0,129,195,129,0,129],dkUpDiag:[195,129,0,129,195,129,0,129],wdDnDiag:[128,64,32,16,8,4,2,129],wdUpDiag:[1,2,4,8,16,32,64,129],diagCross:[129,66,36,24,24,36,66,129],horzBrick:[255,16,16,16,255,1,1,1],diagBrick:[129,66,36,24,36,66,129,0],lgCheck:[240,240,240,240,15,15,15,15],smCheck:[204,204,51,51,204,204,51,51],trellis:[165,90,165,90,165,90,165,90]};function Qe(e,t,n){let r=Ze[e];if(!r)return null;let i=Xe(8,8);if(!i)return null;let a=i.getContext(`2d`);if(!a)return null;a.fillStyle=$e(n),a.fillRect(0,0,8,8),a.fillStyle=$e(t);for(let e=0;e<8;e++){let t=r[e];for(let n=0;n<8;n++)t&1<<7-n&&a.fillRect(n,e,1,1)}return i}function $e(e){return`rgba(${parseInt(e.slice(0,2),16)},${parseInt(e.slice(2,4),16)},${parseInt(e.slice(4,6),16)},${e.length>=8?parseInt(e.slice(6,8),16)/255:1})`}function et(e,t){return e.map(e=>e*t)}const tt={dotted:[1,2],dashed:[3,2],dashSmallGap:[3,1],dotDash:[1,2,3,2],dotDotDash:[1,2,1,2,3,2],dashDotStroked:[1,2,3,2]};function nt(e,t){let n=tt[e];return n?et(n,t):[]}const rt={dash:[6,3],dot:[1.5,3],dashDot:[6,3,1.5,3],lgDash:[10,4],lgDashDot:[10,4,1.5,4],lgDashDotDot:[10,4,1.5,4,1.5,4],sysDash:[4,2],sysDot:[1,2],sysDashDot:[4,2,1,2],sysDashDotDot:[4,2,1,2,1,2]};function it(e,t){let n=rt[e];return n?et(n,t):[]}function at(e,t){let n=it(e,t);if(n.length>0)return n;let r=e.trim().split(/[\\s,]+/).map(Number);return r.length>=2&&r.every(e=>Number.isFinite(e)&&e>=0)&&r.some(e=>e>0)?(r.length%2!=0&&r.pop(),et(r,t)):[]}function ot(e,t=1){let n=e.charCodeAt(0)===35?e.slice(1):e;return`rgba(${parseInt(n.slice(0,2),16)},${parseInt(n.slice(2,4),16)},${parseInt(n.slice(4,6),16)},${n.length>=8?parseInt(n.slice(6,8),16)/255:t})`}function st(e){let t=e.charCodeAt(0)===35?e.slice(1):e,n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16);return .299*n+.587*r+.114*i}function ct(e){return e&&st(e)<128?`#FFFFFF`:`#000000`}function lt(e,t,n,r,i,a){if(!e||e.fillType===`none`)return null;if(e.fillType===`solid`)return ot(e.color);if(e.fillType===`pattern`)return dt(e,t);if(e.fillType===`gradient`){let o=e.stops;if(o.length===0)return null;if(o.length===1)return ot(o[0].color);let s;if(e.gradType===`radial`){let e=n+i/2,o=r+a/2,c=Math.sqrt(i*i+a*a)/2;s=t.createRadialGradient(e,o,0,e,o,c)}else{let o=e.angle*Math.PI/180,c=n+i/2,l=r+a/2,u=(Math.abs(Math.cos(o))*i+Math.abs(Math.sin(o))*a)/2;s=t.createLinearGradient(c-Math.cos(o)*u,l-Math.sin(o)*u,c+Math.cos(o)*u,l+Math.sin(o)*u)}for(let e of o)s.addColorStop(Math.min(1,Math.max(0,e.position)),ot(e.color));return s}return null}const ut=new WeakMap;function dt(e,t){let n=`${e.preset}|${e.fg}|${e.bg}`,r=ut.get(t);r||(r=new Map,ut.set(t,r));let i=r.get(n);if(i)return i;let a=Qe(e.preset,e.fg,e.bg);if(!a)return ot(e.fg);let o=t.createPattern(a,`repeat`);return o?(r.set(n,o),o):ot(e.fg)}function ft(e,t,n){if(!t){e.strokeStyle=`transparent`,e.lineWidth=0,e.setLineDash([]),e.lineCap=`butt`;return}e.strokeStyle=ot(t.color);let r=Math.max(.5,t.width*n);e.lineWidth=r;let i=t.dashStyle?at(t.dashStyle,r):[],a=t.lineCap??`butt`,o=i.some((e,t)=>t%2==0&&e===0);e.lineCap=a===`butt`&&o?`square`:a,e.setLineDash(i)}const pt=[`4472C4`,`ED7D31`,`A9D18E`,`FF0000`,`70AD47`,`4BACC6`,`FFC000`,`9E480E`,`843C0C`,`636363`,`255E91`,`967300`];function mt(e,t){return t?.color?`#${t.color}`:`#${pt[e%pt.length]}`}function ht(e,t){let n=t.dataPointColors?.[e];return n?`#${n}`:`#${pt[e%pt.length]}`}function gt(e,t){let n=e.startsWith(`#`)?e.slice(1):e;if(n.length<6)return`#${n}`;let r=Math.max(0,Math.min(1,t)),i=Math.round(parseInt(n.slice(0,2),16)*r),a=Math.round(parseInt(n.slice(2,4),16)*r),o=Math.round(parseInt(n.slice(4,6),16)*r),s=e=>e.toString(16).padStart(2,`0`);return`#${s(i)}${s(a)}${s(o)}`}function _t(e,t){return t&&(t.startsWith(`+mj`)?e.themeMajorFontLatin??null:t.startsWith(`+mn`)?e.themeMinorFontLatin??null:t)}function vt(e,t,n){let r=n===`major`?e.themeMajorFontLatin:e.themeMinorFontLatin,i=_t(e,t)??r;return i?`\"${i}\", Calibri, Arial, sans-serif`:`sans-serif`}function yt(e){return e===`pie`||e===`doughnut`}function bt(e){return!!e.varyColors&&e.series.length===1&&typeof e.chartType==`string`&&/Bar/.test(e.chartType)}function xt(e,t,n,r=!1){if(r||yt(e)){let e=t[0];return e?ht(n,e):`#${pt[n%pt.length]}`}return mt(n,t[n])}function St(e,t,n,r,i,a,o,s,c,l=`sans-serif`){e.save(),e.font=`${o?`bold `:``}${a}px ${l}`,e.fillStyle=s;let u=Je(e,t,c);i===`cat`?(e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(u,n,r)):(e.translate(n,r),e.rotate(-Math.PI/2),e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(u,0,0)),e.restore()}function Ct(e){return e?`#${e}`:`#555`}function wt(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(t.valAxisTitle){let r=n+u+_e(i)+p/2,a=s+l/2;St(e,t.valAxisTitle,r,a,`val`,p,t.valAxisTitleFontBold??!0,Ct(t.valAxisTitleFontColor),l,vt(t,t.valAxisTitleFontFace,`major`))}if(t.catAxisTitle){let n=o+c/2,i=r+a-d-_e(a)-f/2;St(e,t.catAxisTitle,n,i,`cat`,f,t.catAxisTitleFontBold??!0,Ct(t.catAxisTitleFontColor),c,vt(t,t.catAxisTitleFontFace,`major`))}}function Tt(e){return e&&(e===`line`||e===`stackedLine`||e===`stackedLinePct`||e===`radar`||e===`scatter`||e===`stock`)?`line`:`fill`}function Et(e,t,n){if(e!==`scatter`)return!1;let r=t??`marker`;return(r===`line`||r===`lineMarker`||r===`lineNoMarker`||r===`smooth`||r===`smoothMarker`||r===`smoothNoMarker`)&&n.lineHidden!==!0}function Dt(e,t,n,r){if(e!==`scatter`)return null;let i=n[r];if(!i||Et(e,t,i))return null;let a=i.markerSymbol??`circle`;if(a===`none`)return null;let o=mt(r,i);return{symbol:a,fill:i.markerFill??o.replace(/^#/,``),line:i.markerLine??null}}function Ot(e,t,n,r,i,a,o,s=null){if(s){pn(e,r+a/2,i+o/2,s.symbol,o,s.fill,s.line,1);return}if(e.fillStyle=n,t===`line`){e.strokeStyle=n;let t=e.lineWidth;e.lineWidth=Math.max(1.5,o*.15),e.beginPath();let s=i+o/2;e.moveTo(r,s),e.lineTo(r+a,s),e.stroke(),e.lineWidth=t}else e.fillRect(r,i,a,o)}function kt(e,t,n,r=!1,i=[]){if(r||yt(t)){let n=e[0],a=n?n.values.length:0,o=n?.categories??i;return Array.from({length:a},(n,i)=>({label:(o[i]??`Item ${i+1}`).toString(),color:xt(t,e,i,r),marker:null,swatchStyle:Tt(t)}))}return e.map((r,i)=>({label:r.name||`Series ${i+1}`,color:xt(t,e,i),marker:Dt(t,n,e,i),swatchStyle:Tt(r.seriesType??t)}))}const At={fontFamily:`sans-serif`,color:`#333`,bold:!1,sizePx:null};function jt(e,t,n,r,i,a,o=`vertical`,s,c=At,l,u=!1,d=[]){let f=kt(t,s,l,u,d),p=c.bold?`bold `:``;if(o===`horizontal`){let t=c.sizePx??Math.max(9,Math.min(12,a*.7));e.font=`${p}${t}px ${c.fontFamily}`,e.textBaseline=`middle`;let o=Math.max(1,f.length),s=i-10-4,l=f.map(t=>Je(e,t.label,s)),u=l.map(t=>14+e.measureText(t).width),d=n+(i-(u.reduce((e,t)=>e+t,0)+12*(o-1)))/2,m=r+a/2;for(let n=0;n<f.length;n++)Ot(e,f[n].swatchStyle,f[n].color,d,m-t/2,10,t,f[n].marker),e.fillStyle=c.color,e.textAlign=`left`,e.fillText(l[n],d+10+4,m),d+=u[n]+12;return}let m=c.sizePx??Math.max(9,Math.min(12,a/(f.length+1)));e.font=`${p}${m}px ${c.fontFamily}`,e.textBaseline=`middle`;let h=m+4,g=i-10-4,_=r+(a-h*f.length)/2;for(let t=0;t<f.length;t++)Ot(e,f[t].swatchStyle,f[t].color,n,_,10,m,f[t].marker),e.fillStyle=c.color,e.textAlign=`left`,e.fillText(Je(e,f[t].label,g),n+10+4,_+m/2),_+=h}function Mt(e){let t=_t(e,e.legendFontFace)??e.themeMinorFontLatin;return{fontFamily:t?`\"${t}\", Calibri, Arial, sans-serif`:`sans-serif`,color:e.legendFontColor?`#${e.legendFontColor}`:`#333`,bold:e.legendFontBold??!1,sizePx:e.legendFontSizeHpt==null?null:e.legendFontSizeHpt/100}}function Nt(e,t,n,r,i,a,o,s,c,l,u,d){if(!n)return;let f=Mt(t),p=bt(t),m=t.legendManualLayout;if(m&&m.xMode===`edge`&&m.yMode===`edge`&&m.w>0&&m.h>0){let n=r+m.x*a,s=i+m.y*o,c=m.w*a,l=m.h*o,u=c>=l?`horizontal`:`vertical`;jt(e,t.series,n,s,c,l,u,t.chartType,f,t.scatterStyle,p,t.categories);return}switch(n.side){case`r`:jt(e,t.series,r+a-n.reserveW+4,c,n.reserveW-8,u,`vertical`,t.chartType,f,t.scatterStyle,p,t.categories);break;case`l`:jt(e,t.series,r+4,c,n.reserveW-8,u,`vertical`,t.chartType,f,t.scatterStyle,p,t.categories);break;case`t`:jt(e,t.series,s,i+d,l,n.reserveH,`horizontal`,t.chartType,f,t.scatterStyle,p,t.categories);break;case`b`:jt(e,t.series,s,i+o-n.reserveH,l,n.reserveH,`horizontal`,t.chartType,f,t.scatterStyle,p,t.categories);break}}function Pt(e,t,n,r,i,a,o,s=!1){if(t===`none`||!t)return;let c=o?Math.max(4,o+2):4,l=e.strokeStyle,u=e.lineWidth;if(e.strokeStyle=a??`#888`,e.lineWidth=o??1,e.beginPath(),n===`val`){let n=r,a=i,o=s?1:-1,l=t===`out`||t===`cross`?o*c:0,u=t===`in`||t===`cross`?-o*c:0;e.moveTo(n+l,a),e.lineTo(n+u,a)}else{let n=r,a=i,o=t===`out`||t===`cross`?c:0,s=t===`in`||t===`cross`?-c:0;e.moveTo(a,n+o),e.lineTo(a,n+s)}e.stroke(),e.strokeStyle=l,e.lineWidth=u}function Ft(e,t,n,r,i,a){a&&a.explicit?(e.strokeStyle=a.color,e.lineWidth=a.width):(e.strokeStyle=i?`#aaa`:a?.color??`#e0e0e0`,e.lineWidth=i?1:a?.width??.5),e.beginPath(),e.moveTo(t,r),e.lineTo(t+n,r),e.stroke()}function It(e,t){let{color:n,width:r}=Me(e.valAxisGridlineColor,e.valAxisGridlineWidthEmu,t);return{color:n,width:r,explicit:e.valAxisGridlineColor!=null}}function Lt(e){return e.catAxisMajorGridlines===!0}function Rt(e,t){return Me(e.catAxisGridlineColor,e.catAxisGridlineWidthEmu,t)}function zt(e,t){if(t<=0)return[];let n=Ne(e),r=[],i=n?t:t-1;for(let e=0;e<=i;e++)r.push(n?e/t:t===1?.5:e/(t-1));return r}function Bt(e){return e.valAxisOrientation===`maxMin`}function Vt(e){return e.catAxisOrientation===`maxMin`}function Ht(e){return e.valAxisMajorGridlines!==!1}function Ut(e,t){return e==null||!t?e:e*100}function Wt(e,t,n){return Ve(n?t/100:t,n?e.valAxisFormatCode??`0%`:e.valAxisFormatCode,e.date1904)}function Gt(e,t,n,r,i=!1){let a=Bt(e),o=e.valAxisLogBase,s=Ut(e.valMin,i)??(i?t:e.valMin),c=Ut(e.valMax,i)??(i?n:e.valMax),l=Ut(e.valAxisMajorUnit,i);if(o!=null&&isFinite(o)&&o>=2){let{min:e,max:r,lines:i}=De(t,n,o,s,c);return{min:e,max:r,step:i.length>1?i[1]-i[0]:r-e,majorLines:i,minorLines:[],frac:t=>Ee(t,e,r,{logBase:o,reversed:a})}}let{min:u,max:d,step:f}=Te(t,n,s,c,r,l),p=d-u||1,m=[],h=Math.round((d-u)/f);for(let e=0;e<=h;e++)m.push(u+e*f);let g=[],_=Ut(e.valAxisMinorUnit,i);if(e.valAxisMinorGridlines&&_!=null&&isFinite(_)&&_>0&&_<f)for(let e=u+_;e<d-1e-9;e+=_)Math.abs((e-u)/f-Math.round((e-u)/f))>1e-6&&g.push(e);return{min:u,max:d,step:f,majorLines:m,minorLines:g,frac:e=>a?1-(e-u)/p:(e-u)/p}}function Kt(e,t,n,r,i,a){let o=t.trendLines;if(!o||o.length===0)return;let s=[],c=[];for(let e=0;e<t.values.length;e++){let n=t.values[e];n!=null&&(s.push(e),c.push(n))}if(s.length<2)return;let l=e.getLineDash?e.getLineDash():[];for(let t of o){let o=Oe(s,c,t.trendlineType,{period:t.period,intercept:t.intercept});if(o.xs.length<2)continue;let l=o.xs,u=o.ys;if(t.trendlineType===`linear`){let e=(o.ys[1]-o.ys[0])/(o.xs[1]-o.xs[0]||1),n=t.backward??0,r=t.forward??0;l=[o.xs[0]-n,o.xs[1]+r],u=[o.ys[0]-e*n,o.ys[1]+e*r]}e.strokeStyle=t.lineColor?`#${t.lineColor}`:n,e.lineWidth=t.lineWidthEmu?Ae(t.lineWidthEmu,a):1.5,e.setLineDash([6,4]),e.beginPath();for(let t=0;t<l.length;t++){let n=r(l[t]),a=i(u[t]);t===0?e.moveTo(n,a):e.lineTo(n,a)}e.stroke()}e.setLineDash(l)}function qt(e,t,n){return e?e/100*n:Math.max(8,t*.045)}function Jt(e){return e.catAxisTickLabelPos!==`none`}function Yt(e){let t=e.catAxisLabelRotation;return t==null||t===0||Math.abs(t)>54e5?0:t/6e4*(Math.PI/180)}function Xt(e,t,n,r,i){if(i===0){e.fillText(t,n,r);return}e.save(),e.translate(n,r),e.rotate(i),e.textAlign=`right`,e.textBaseline=`middle`,e.fillText(t,0,0),e.restore()}function Zt(e,t,n){if(!e)return null;let r=[];for(let e of t)if(e.useSecondaryAxis===!0)for(let t of e.values)t!=null&&r.push(t);let i=r.length?Math.min(...r):0,a=r.length?Math.max(...r):1,{min:o,max:s,step:c}=Te(Math.min(0,i),a,e.min,e.max,n,e.majorUnit),l=s-o||1;return{min:o,max:s,step:c,makeToY:(e,t)=>n=>e+t-(n-o)/l*t}}function Qt(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=i+o,{color:h,width:g}=je(t.lineColor,t.lineWidthEmu,l);if(t.lineHidden||(e.strokeStyle=h,e.lineWidth=g,e.beginPath(),e.moveTo(m,a),e.lineTo(m,a+s),e.stroke()),!t.hidden){e.font=`${u}px sans-serif`,e.fillStyle=t.fontColor?`#${t.fontColor}`:f,e.textAlign=`left`,e.textBaseline=`middle`;let i=n.max-n.min||1,a=Math.max(1,Math.round(i/n.step));for(let i=0;i<=a;i++){let a=n.min+i*n.step,o=r(a);Pt(e,t.majorTickMark,`val`,m,o,h,g,!0),e.fillText(Ve(a,t.formatCode??null,p),m+14,o)}}if(t.title){let n=t.titleFontSizeHpt?t.titleFontSizeHpt/100*l:Math.max(9,c*.05);e.save(),e.fillStyle=t.titleFontColor?`#${t.titleFontColor}`:t.fontColor?`#${t.fontColor}`:`#555`,e.font=`${t.titleFontBold?`bold `:``}${n}px sans-serif`,e.textAlign=`center`,e.textBaseline=`middle`,e.translate(i+o+d+n*.6,a+s/2),e.rotate(Math.PI/2),e.fillText(t.title,0,0),e.restore()}}function $t(e,t,n,r,i,a){if(!t.title)return;let o=_t(t,t.titleFontFace),s=o?`\"${o}\", Calibri, Arial, sans-serif`:`Calibri, Arial, sans-serif`;e.font=`${t.titleFontBold??!0?`bold `:``}${a}px ${s}`,e.fillStyle=t.titleFontColor?`#${t.titleFontColor}`:`#333`,e.textAlign=`center`,e.textBaseline=`top`,e.fillText(t.title,n+i/2,r)}function en(e){if(e.categories.length>0)return e.categories;let t=e.series[0];if(t?.categories&&t.categories.length>0)return t.categories;let n=0;for(let t of e.series)t.values.length>n&&(n=t.values.length);return n>0?Array.from({length:n},(e,t)=>String(t+1)):[]}function tn(e,t,n,r,i,a,o,s,c,l=!1){let u=s??`outEnd`;if(e.fillStyle=c?`#${c}`:`#333`,o===`vertical`){let o=n+a/2,s=l?r+i:r,c=l?r:r+i;u===`inBase`?(e.textAlign=`center`,e.textBaseline=l?`top`:`bottom`,e.fillText(t,o,l?c+2:c-2)):u===`inEnd`?(e.textAlign=`center`,e.textBaseline=l?`bottom`:`top`,e.fillText(t,o,l?s-2:s+2)):u===`ctr`?(e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(t,o,r+i/2)):(e.textAlign=`center`,e.textBaseline=l?`top`:`bottom`,e.fillText(t,o,l?s+1:s-1))}else{let o=r+a/2,s=l?n:n+i,c=l?n+i:n;u===`inBase`?(e.textAlign=l?`right`:`left`,e.textBaseline=`middle`,e.fillText(t,l?c-4:c+4,o)):u===`inEnd`?(e.textAlign=l?`left`:`right`,e.textBaseline=`middle`,e.fillText(t,l?s+4:s-4,o)):u===`ctr`?(e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(t,n+i/2,o)):(e.textAlign=l?`right`:`left`,e.textBaseline=`middle`,e.fillText(t,l?s-2:s+2,o))}}function nn(e,t,n,r){let{x:i,y:a,w:o,h:s}=n,c=t.chartType===`clusteredBarH`||t.chartType===`stackedBarH`||t.chartType===`stackedBarHPct`,l=t.chartType.startsWith(`stacked`),u=t.chartType===`stackedBarPct`||t.chartType===`stackedBarHPct`,d=t.series.filter(e=>e.seriesType!==`line`),f=t.series.filter(e=>e.seriesType===`line`),p=!c&&t.secondaryValAxis&&f.some(e=>e.useSecondaryAxis===!0)?t.secondaryValAxis:null,m=en(t),h=m.length;if(h===0)return;let g=bt(t),_=ye(t,s,r),v=_.fontPx,y=_.topPad,b=_.bandH,x=qt(t.catAxisFontSizeHpt,s,r),S=qt(t.valAxisFontSizeHpt,s,r),C=me(t,o,s,.22),{legRightW:w,legLeftW:T,legTopH:E,legBottomH:D}=he(C),O=ve(t,o,s,r),k=O.catFontPx,A=O.valFontPx,j=O.catBandH,M=O.valBandW,N=b+E+S/2+2,ee=c?(t.valAxisHidden?s*.02:be(S))+j+D:be(x)+j+D,te=s-N-ee,P=c?o-((t.catAxisHidden?o*.03:o*.22)+M+T)-(w+o*.03):0,ne=(c?P:te)/r,F=0,I=0;for(let e=0;e<h;e++){let t=0,n=0;for(let r of d){let i=r.values[e]??0;l?i>=0?t+=i:n+=i:(F=Math.max(F,i),I=Math.min(I,i))}l&&(F=Math.max(F,t),I=Math.min(I,n))}if(!u){for(let e of f)if(!(p&&e.useSecondaryAxis===!0))for(let t=0;t<h;t++){let n=e.values[t];n!=null&&(F=Math.max(F,n),I=Math.min(I,n))}}u&&(F=F>0?100:0,I=I<0?-100:0),t.valMax!=null&&(F=u?t.valMax*100:t.valMax),t.valMin!=null&&(I=u?t.valMin*100:t.valMin),F===0&&I===0&&(F=1);let L=Gt(t,I,F,ne,u),{min:R,max:z,step:B}=L,V=Zt(p,f,te/r),H=V?V.min:0,U=V?V.max:1,re=V?V.step:1,ie=Math.max(8,Math.min(11,s/20)),ae=t.valAxisFontSizeHpt==null?Math.max(8,Math.min(11,te/20)):S,oe=e.font,se=0;if(!c&&!t.valAxisHidden){e.font=`${ae}px ${vt(t,t.valAxisFontFace,`minor`)}`;let n=0,r=Math.round((z-R)/B);for(let i=0;i<=r;i++){let r=Wt(t,R+i*B,u);n=Math.max(n,e.measureText(r).width)}se=n+16}let ce=p?.fontSizeHpt?p.fontSizeHpt/100*r:ie,le=0;if(p&&!p.hidden){e.font=`${ce}px sans-serif`;let n=0,r=Math.round((U-H)/re);for(let i=0;i<=r;i++)n=Math.max(n,e.measureText(Ve(H+i*re,p.formatCode??null,t.date1904)).width);le=n+18}e.font=oe;let ue=p&&p.title?(p.titleFontSizeHpt?p.titleFontSizeHpt/100*r:Math.max(9,s*.05))+8:0,de={t:N,r:w+o*.03+le+ue,b:ee,l:c?(t.catAxisHidden?o*.03:o*.22)+M+T:T+M+se};$t(e,t,i,a+y,o,v);let{plotRect:{px0:W,py0:G,pw:fe,ph:pe}}=K(t,i,a,o,s,r,{titleBand:_,legendSideReserveFrac:.22,pad:de,honorPlotAreaManualLayout:!0});if(fe<=0||pe<=0)return;t.plotAreaBg&&(e.fillStyle=`#${t.plotAreaBg}`,e.fillRect(W,G,fe,pe));let ge=U-H||1,_e=z-R||1,xe=e=>G+pe-L.frac(e)*pe,Se=e=>W+L.frac(e)*fe,Ce=xe(0),we=Se(0),Te=xe,Ee=V?V.makeToY(G,pe):xe,De=It(t,r),Oe=Math.round(_e/B);e.textBaseline=`middle`,e.font=`${t.valAxisFontSizeHpt==null?Math.max(8,Math.min(11,pe/20)):S}px ${vt(t,t.valAxisFontFace,`minor`)}`;let ke=t.valAxisFontColor?`#${t.valAxisFontColor}`:`#555`;if(e.fillStyle=ke,!t.valAxisHidden){for(let t of L.minorLines)if(!c)Ft(e,W,fe,xe(t),!1,De);else{let n=Se(t);e.strokeStyle=De.color,e.lineWidth=De.width,e.beginPath(),e.moveTo(n,G),e.lineTo(n,G+pe),e.stroke()}let n=Ht(t),r=t.valAxisTickLabelPos!==`none`;for(let i of L.majorLines){let a=Math.abs(i)<B*1e-9,o=Wt(t,i,u);if(c){let t=Se(i);n&&(e.strokeStyle=De.explicit?De.color:a?`#aaa`:De.color,e.lineWidth=De.explicit?De.width:a?1:De.width,e.beginPath(),e.moveTo(t,G),e.lineTo(t,G+pe),e.stroke()),r&&(e.textAlign=`center`,e.fillText(o,t,G+pe+10))}else{let t=xe(i);n&&Ft(e,W,fe,t,a,De),r&&(e.textAlign=`right`,e.fillText(o,W-12,t))}}}if(!t.catAxisHidden&&Lt(t)){let n=Rt(t,r);e.strokeStyle=n.color,e.lineWidth=n.width;for(let n of zt(t,h)){if(e.beginPath(),c){let t=G+n*pe;e.moveTo(W,t),e.lineTo(W+fe,t)}else{let t=W+n*fe;e.moveTo(t,G),e.lineTo(t,G+pe)}e.stroke()}}let{color:Ae,width:Me}=je(t.catAxisLineColor,t.catAxisLineWidthEmu,r),{color:Pe,width:Fe}=je(t.valAxisLineColor,t.valAxisLineWidthEmu,r),Ie=(t,n,r,i,a,o)=>{e.strokeStyle=a,e.lineWidth=o,e.beginPath(),e.moveTo(t,n),e.lineTo(r,i),e.stroke()},Le=!t.catAxisHidden&&!t.catAxisLineHidden,Re=!t.valAxisHidden&&!t.valAxisLineHidden&&t.valAxisLineColor!=null,ze=()=>{if(c?(Le&&Ie(W,G,W,G+pe,Ae,Me),Re&&Ie(W,G+pe,W+fe,G+pe,Pe,Fe)):(Le&&Ie(W,G+pe,W+fe,G+pe,Ae,Me),Re&&Ie(W,G,W,G+pe,Pe,Fe)),!t.valAxisHidden&&t.valAxisMajorTickMark&&t.valAxisMajorTickMark!==`none`)for(let n=0;n<=Oe;n++){let r=R+n*B;c?Pt(e,t.valAxisMajorTickMark,`cat`,G+pe,Se(r),Pe,Fe):Pt(e,t.valAxisMajorTickMark,`val`,W,xe(r),Pe,Fe)}if(!t.catAxisHidden&&t.catAxisMajorTickMark&&t.catAxisMajorTickMark!==`none`){let n=Ne(t),r=n?h:h-1;for(let i=0;i<=r;i++){let r=n?i/h:h===1?.5:i/(h-1);c?Pt(e,t.catAxisMajorTickMark,`val`,W,G+r*pe,Ae,Me):Pt(e,t.catAxisMajorTickMark,`cat`,G+pe,W+r*fe,Ae,Me)}}},Be=c?pe/h:fe/h,Ue=l?1:Math.max(1,d.length),We=l?0:t.barOverlap??0,Ge=t.barGapWidth??150,Ke=Be/(1+(Ue-1)*(1-We/100)+Ge/100),qe=l?0:Ke*(1-We/100),Ye=(Be-(Ke+(Ue-1)*qe))/2;for(let n=0;n<h;n++){let i=0,a=0,o=0;if(u){for(let e of d)o+=Math.abs(e.values[n]??0);o===0&&(o=1)}for(let s=0;s<d.length;s++){let f=d[s],p=f.values[n]??0,m=u?p/o*100:p,_=m<0,v=g?ht(n,f):mt(s,f);if(c){let o=l?s:d.length-1-s,c=l?G+(h-1-n)*Be+Ye:G+(h-1-n)*Be+Ye+o*qe,p=l?Se(_?a:i):we,g=Se(l?(_?a:i)+m:m),y=Math.min(p,g),b=Math.abs(g-p);if(e.fillStyle=v,e.fillRect(y,c,b,Ke),t.showDataLabels&&m!==0){let n=f.seriesDataLabels,i=n?.fontSizeHpt??t.dataLabelFontSizeHpt,a=i?i/100*r:Math.max(7,Math.min(11,Ke*.6));e.font=`${n?.fontBold??!0?`bold `:``}${a}px ${vt(t,t.dataLabelFontFace,`minor`)}`,tn(e,u?`${Math.round(m)}%`:Ve(m,n?.formatCode??t.dataLabelFormatCode??f.valFormatCode??null,t.date1904),y,c,b,Ke,`horizontal`,n?.position??t.dataLabelPosition??null,n?.fontColor??f.labelColor??t.dataLabelFontColor??null,_)}}else{let o=l?W+n*Be+Ye:W+n*Be+Ye+s*qe,c=l?xe(_?a:i):Ce,d=xe(l?(_?a:i)+m:m),p=Math.min(c,d),h=Math.abs(d-c);if(e.fillStyle=v,e.fillRect(o,p,Ke,h),t.showDataLabels&&m!==0){let n=f.seriesDataLabels,i=n?.fontSizeHpt??t.dataLabelFontSizeHpt,a=i?i/100*r:Math.max(7,Math.min(11,Ke*.6));e.font=`${n?.fontBold??!0?`bold `:``}${a}px ${vt(t,t.dataLabelFontFace,`minor`)}`,tn(e,u?`${Math.round(m)}%`:Ve(m,n?.formatCode??t.dataLabelFormatCode??f.valFormatCode??null,t.date1904),o,p,h,Ke,`vertical`,n?.position??t.dataLabelPosition??null,n?.fontColor??f.labelColor??t.dataLabelFontColor??null,_)}}l&&(_?a+=m:i+=m)}}if(!t.catAxisHidden&&Jt(t)){e.fillStyle=t.catAxisFontColor?`#${t.catAxisFontColor}`:`#555`,e.font=`${Math.max(8,Math.min(11,Be*.5))}px ${vt(t,t.catAxisFontFace,`minor`)}`;let n=Be-4,r=W-4-(i+T+M),a=Yt(t);for(let i=0;i<h;i++){let o=He((m[i]??``).toString(),t.catAxisFormatCode,t.date1904);if(c){let t=G+(h-1-i)*Be+Be/2;e.textAlign=`right`,e.textBaseline=`middle`,e.fillText(Je(e,o,r),W-4,t)}else{let t=W+i*Be+Be/2;e.textAlign=`center`,e.textBaseline=`top`,Xt(e,Je(e,o,a===0?n:pe*.4),t,G+pe+3,a)}}}if(f.length>0&&!c)for(let t=0;t<f.length;t++){let n=f[t],i=mt(d.length+t,n),a=p&&n.useSecondaryAxis===!0?Ee:Te;e.strokeStyle=i,e.lineWidth=2,e.setLineDash([]),e.beginPath();let o=!1;for(let t=0;t<h;t++){let r=n.values[t];if(r==null){o=!1;continue}let i=W+t*Be+Be/2,s=a(r);o?e.lineTo(i,s):(e.moveTo(i,s),o=!0)}if(e.stroke(),n.showMarker!==!1)for(let t=0;t<h;t++){let r=n.values[t];if(r==null)continue;let o=W+t*Be+Be/2,s=a(r);e.fillStyle=i,e.beginPath(),e.arc(o,s,3,0,Math.PI*2),e.fill()}Kt(e,n,i,e=>W+e*Be+Be/2,a,r)}if(ze(),p){let n=W+fe,{color:i,width:a}=je(p.lineColor,p.lineWidthEmu,r);if(p.lineHidden||Ie(n,G,n,G+pe,i,a),!p.hidden){e.font=`${ce}px sans-serif`,e.fillStyle=p.fontColor?`#${p.fontColor}`:ke,e.textAlign=`left`,e.textBaseline=`middle`;let r=Math.max(1,Math.round(ge/re));for(let o=0;o<=r;o++){let r=H+o*re,s=Ee(r);Pt(e,p.majorTickMark,`val`,n,s,i,a,!0),e.fillText(Ve(r,p.formatCode??null,t.date1904),n+14,s)}}if(p.title){let t=p.titleFontSizeHpt?p.titleFontSizeHpt/100*r:Math.max(9,s*.05);e.save(),e.fillStyle=p.titleFontColor?`#${p.titleFontColor}`:p.fontColor?`#${p.fontColor}`:`#555`,e.font=`${p.titleFontBold?`bold `:``}${t}px sans-serif`,e.textAlign=`center`,e.textBaseline=`middle`,e.translate(W+fe+le+t*.6,G+pe/2),e.rotate(Math.PI/2),e.fillText(p.title,0,0),e.restore()}}Nt(e,c&&!l?{...t,series:[...t.series].reverse()}:t,C,i,a,o,s,W,G,fe,pe,b+2),wt(e,t,i,a,o,s,W,G,fe,pe,T,D,k,A)}function rn(e,t,n,r){let{x:i,y:a,w:o,h:s}=n,c=en(t),l=c.length;if(l===0)return;let u=t.chartType===`stackedLine`||t.chartType===`stackedLinePct`,d=t.chartType===`stackedLinePct`,f=d?c.map((e,n)=>{let r=0;for(let e of t.series)r+=Math.abs(e.values[n]??0);return r||1}):null,p=t.dispBlanksAs??`gap`,m=(e,n)=>{if(!u)return t.series[e].values[n]??0;let r=0;for(let i=0;i<=e;i++)r+=t.series[i].values[n]??0;return d&&f?r/f[n]*100:r},h=!u&&t.secondaryValAxis&&t.series.some(e=>e.useSecondaryAxis===!0)?t.secondaryValAxis:null,g=e=>h!=null&&e.useSecondaryAxis===!0,_=ye(t,s,r),v=_.fontPx,y=_.topPad,b=_.bandH,x=me(t,o,s,.22),{legRightW:S,legLeftW:C,legTopH:w,legBottomH:T}=he(x),E=qt(t.catAxisFontSizeHpt,s,r),D=qt(t.valAxisFontSizeHpt,s,r),O=ve(t,o,s,r),k=O.catFontPx,A=O.valFontPx,j=O.catBandH,M=O.valBandW,N=b+w+D/2+2,ee=be(E)+j+T,te=s-N-ee,P=Zt(h,t.series,te/r),ne=Math.max(8,Math.min(11,s/20)),F=h?.fontSizeHpt?h.fontSizeHpt/100*r:ne,I=0;if(h&&P&&!h.hidden){let n=e.font;e.font=`${F}px sans-serif`;let r=0,i=Math.round((P.max-P.min)/P.step);for(let n=0;n<=i;n++)r=Math.max(r,e.measureText(Ve(P.min+n*P.step,h.formatCode??null,t.date1904)).width);I=r+18,e.font=n}let L=h&&h.title?(h.titleFontSizeHpt?h.titleFontSizeHpt/100*r:Math.max(9,s*.05))+8:0,R={t:N,r:S+o*.05+I+L,b:ee,l:D*2.2+10+M+C};$t(e,t,i,a+y,o,v);let{plotRect:{px0:z,py0:B,pw:V,ph:H}}=K(t,i,a,o,s,r,{titleBand:_,legendSideReserveFrac:.22,pad:R});if(V<=0||H<=0)return;t.plotAreaBg&&(e.fillStyle=`#${t.plotAreaBg}`,e.fillRect(z,B,V,H));let U=1/0,re=-1/0;for(let e=0;e<l;e++)for(let n=0;n<t.series.length;n++){if(g(t.series[n])||!u&&t.series[n].values[e]==null)continue;let r=m(n,e);U=Math.min(U,r),re=Math.max(re,r)}isFinite(U)||(U=0,re=1);let ie=t.valAxisLogBase!=null&&t.valAxisLogBase>=2;t.valMin==null?U>0&&!ie&&(U=0):U=d?t.valMin*100:t.valMin,t.valMax==null?re<0&&(re=0):re=d?t.valMax*100:t.valMax,re===U&&(re=U+1);let ae=Gt(t,U,re,H/r,d);if(ae.max-ae.min===0)return;let oe=e=>B+H-ae.frac(e)*H,se=P?P.makeToY(B,H):oe,ce=e=>g(e)?se:oe,le=Ne(t),ue=Vt(t),de=le?e=>z+((ue?l-1-e:e)+.5)/l*V:e=>{let t=ue?l-1-e:e;return z+(l===1?V/2:t/(l-1)*V)};if(!t.valAxisHidden){e.font=`${D}px ${vt(t,t.valAxisFontFace,`minor`)}`,e.textBaseline=`middle`;let n=It(t,r);for(let t of ae.minorLines)Ft(e,z,V,oe(t),!1,n);let i=Ht(t),a=t.valAxisTickLabelPos!==`none`;for(let r of ae.majorLines){let o=oe(r);i&&Ft(e,z,V,o,r===0,n),Pt(e,t.valAxisMajorTickMark,`val`,z,o),a&&(e.fillStyle=t.valAxisFontColor?`#${t.valAxisFontColor}`:`#555`,e.textAlign=`right`,e.fillText(Wt(t,r,d),z-6,o))}}if(!t.catAxisHidden&&Lt(t)){let n=Rt(t,r);e.strokeStyle=n.color,e.lineWidth=n.width;for(let n of zt(t,l)){let t=z+n*V;e.beginPath(),e.moveTo(t,B),e.lineTo(t,B+H),e.stroke()}}e.strokeStyle=`#aaa`,e.lineWidth=1,!t.catAxisHidden&&!t.catAxisLineHidden&&(e.beginPath(),e.moveTo(z,B+H),e.lineTo(z+V,B+H),e.stroke()),!t.valAxisHidden&&!t.valAxisLineHidden&&(e.beginPath(),e.moveTo(z,B),e.lineTo(z,B+H),e.stroke());let W=Math.max(1,2.25*r),G=Math.max(2,2.5*r),fe=qt(t.dataLabelFontSizeHpt,s,r);for(let n=0;n<t.series.length;n++){let i=t.series[n],a=mt(n,i),o=ce(i);e.strokeStyle=a,e.lineWidth=W,e.setLineDash([]),e.beginPath();let s=i.smooth===!0,d=[],f=()=>{d.length!==0&&(e.moveTo(d[0].x,d[0].y),vn(e,d,s),d=[])};for(let e=0;e<l;e++){if(!u&&i.values[e]==null){if(p===`gap`){f();continue}if(p===`span`)continue}d.push({x:de(e),y:o(m(n,e))})}f(),e.stroke();let h=e=>m(n,e);for(let t of i.errBars??[])xn(e,i,t,l,de,o,h,a);e.fillStyle=a;let g=i.showMarker!==!1,_=bn(i),v=Sn(e,i,c,l,de,o,h,H,r,t.date1904??!1,u||p===`zero`,vt(t,t.dataLabelFontFace,`minor`),t.dataLabelPosition??`r`);v&&(e.fillStyle=a);for(let s=0;s<l;s++){if(!u&&i.values[s]==null&&p!==`zero`)continue;let c=m(n,s);if(g)if(_){let t=(i.dataPointOverrides??[]).find(e=>e.idx===s),n=t?.markerSymbol??i.markerSymbol??`circle`;if(n!==`none`){let l=t?.markerSize??i.markerSize??5,u=t?.markerFill??t?.color??i.markerFill??a,d=t?.markerLine??i.markerLine??null;pn(e,de(s),o(c),n,l,u,d,r)}}else e.beginPath(),e.arc(de(s),o(c),G,0,Math.PI*2),e.fill();t.showDataLabels&&!v&&(gn(e,de(s),o(c),Be(c),t.dataLabelPosition??`r`,fe,void 0,!1,vt(t,t.dataLabelFontFace,`minor`),g?G+1:2),e.fillStyle=a)}Kt(e,i,a,de,o,r)}if(!t.catAxisHidden){let n=Math.max(1,Math.ceil(l/8)),r=t.catAxisFontColor?`#${t.catAxisFontColor}`:`#555`;e.fillStyle=r,e.textAlign=`center`,e.textBaseline=`top`,e.font=`${E}px ${vt(t,t.catAxisFontFace,`minor`)}`;let i=V/l*n-4,a=Jt(t),o=Yt(t);for(let s=0;s<l;s+=n){let n=de(s);Pt(e,t.catAxisMajorTickMark,`cat`,B+H,n),a&&(e.fillStyle=r,Xt(e,Je(e,He((c[s]??``).toString(),t.catAxisFormatCode,t.date1904),o===0?i:H*.4),n,B+H+5,o))}}if(h&&P){let n=t.valAxisFontColor?`#${t.valAxisFontColor}`:`#555`;Qt(e,h,P,se,z,B,V,H,s,r,F,I,n,t.date1904)}Nt(e,t,x,i,a,o,s,z,B,V,H,b+2),wt(e,t,i,a,o,s,z,B,V,H,C,T,k,A)}function an(e,t,n,r){let{x:i,y:a,w:o,h:s}=n,c=en(t),l=c.length;if(l===0)return;let u=t.series,d=u.length>=4,f=d?0:-1,p=+!!d,m=d?2:1,h=d?3:2,g=u[p],_=u[m],v=u[h],y=f>=0?u[f]:void 0,b=ye(t,s,r),x=b.fontPx,S=b.topPad,C=b.bandH,w=me(t,o,s,.22),{legRightW:T,legLeftW:E,legBottomH:D,legTopH:O}=he(w),k=qt(t.catAxisFontSizeHpt,s,r),A=qt(t.valAxisFontSizeHpt,s,r),j=ve(t,o,s,r),M=j.catFontPx,N=j.valFontPx,ee=j.catBandH,te=j.valBandW,P=C+O+A/2+2,ne=be(k)+ee+D,F={t:P,r:T+o*.05,b:ne,l:A*2.2+10+te+E};$t(e,t,i,a+S,o,x);let{plotRect:{px0:I,py0:L,pw:R,ph:z}}=K(t,i,a,o,s,r,{titleBand:b,legendSideReserveFrac:.22,pad:F});if(R<=0||z<=0)return;t.plotAreaBg&&(e.fillStyle=`#${t.plotAreaBg}`,e.fillRect(I,L,R,z));let B=1/0,V=-1/0;for(let e of u)for(let t=0;t<l;t++){let n=e.values[t];n!=null&&(B=Math.min(B,n),V=Math.max(V,n))}isFinite(B)||(B=0,V=1),t.valMin==null?B>0&&(B=0):B=t.valMin,t.valMax==null?V<0&&(V=0):V=t.valMax,V===B&&(V=B+1);let H=Gt(t,B,V,z/r);if(H.max-H.min===0)return;let U=e=>L+z-H.frac(e)*z,re=Ne(t),ie=Vt(t),ae=re?e=>I+((ie?l-1-e:e)+.5)/l*R:e=>{let t=ie?l-1-e:e;return I+(l===1?R/2:t/(l-1)*R)};if(!t.valAxisHidden){e.font=`${A}px ${vt(t,t.valAxisFontFace,`minor`)}`,e.textBaseline=`middle`;let n=It(t,r);for(let t of H.minorLines)Ft(e,I,R,U(t),!1,n);let i=Ht(t),a=t.valAxisTickLabelPos!==`none`;for(let r of H.majorLines){let o=U(r);i&&Ft(e,I,R,o,r===0,n),Pt(e,t.valAxisMajorTickMark,`val`,I,o),a&&(e.fillStyle=t.valAxisFontColor?`#${t.valAxisFontColor}`:`#555`,e.textAlign=`right`,e.fillText(Ve(r,t.valAxisFormatCode,t.date1904),I-6,o))}}if(e.strokeStyle=`#aaa`,e.lineWidth=1,!t.catAxisHidden&&!t.catAxisLineHidden&&(e.beginPath(),e.moveTo(I,L+z),e.lineTo(I+R,L+z),e.stroke()),!t.valAxisHidden&&!t.valAxisLineHidden&&(e.beginPath(),e.moveTo(I,L),e.lineTo(I,L+z),e.stroke()),(t.stockHiLowLines??!0)&&g!=null&&_!=null&&g&&_){e.strokeStyle=t.stockHiLowLineColor?`#${t.stockHiLowLineColor}`:`#595959`,e.lineWidth=Math.max(1,.75*r),e.setLineDash([]);for(let t=0;t<l;t++){let n=g.values[t],r=_.values[t];if(n==null||r==null)continue;let i=ae(t);e.beginPath(),e.moveTo(i,U(n)),e.lineTo(i,U(r)),e.stroke()}}let oe=(t,n,i)=>{if(!t)return;let a=mt(n,t),o=t.markerSymbol??null,s=o!=null&&o!==`none`&&bn(t),c=Math.max(3,R/l*.22);for(let n=0;n<l;n++){let l=t.values[n];if(l==null)continue;let u=ae(n),d=U(l);if(s){pn(e,u,d,o,t.markerSize??3,t.markerFill??a,t.markerLine??null,r);continue}e.strokeStyle=a,e.lineWidth=Math.max(1,.75*r),e.beginPath();let f=i===`right`?u:i===`left`?u-c:u-c/2,p=i===`right`?u+c:i===`left`?u:u+c/2;e.moveTo(f,d),e.lineTo(p,d),e.stroke()}};if(oe(y,f,`left`),oe(v,h,`right`),u.length<3)for(let e=0;e<u.length;e++)oe(u[e],e,`both`);if(!t.catAxisHidden){let n=Math.max(1,Math.ceil(l/8)),r=t.catAxisFontColor?`#${t.catAxisFontColor}`:`#555`;e.fillStyle=r,e.textAlign=`center`,e.textBaseline=`top`,e.font=`${k}px ${vt(t,t.catAxisFontFace,`minor`)}`;let i=R/l*n-4,a=Jt(t),o=Yt(t);for(let s=0;s<l;s+=n){let n=ae(s);Pt(e,t.catAxisMajorTickMark,`cat`,L+z,n),a&&(e.fillStyle=r,Xt(e,Je(e,He((c[s]??``).toString(),t.catAxisFormatCode,t.date1904),o===0?i:z*.4),n,L+z+5,o))}}Nt(e,t,w,i,a,o,s,I,L,R,z,C+2),wt(e,t,i,a,o,s,I,L,R,z,E,D,M,N)}function on(e,t,n,r){let{x:i,y:a,w:o,h:s}=n,c=en(t),l=c.length;if(l===0)return;let u=t.chartType===`stackedArea`||t.chartType===`stackedAreaPct`,d=t.chartType===`stackedAreaPct`,f=d?c.map((e,n)=>{let r=0;for(let e of t.series)r+=Math.abs(e.values[n]??0);return r||1}):null,p=(e,n)=>{let r=t.series[e].values[n]??0;return d&&f?r/f[n]*100:r},m=!u&&t.secondaryValAxis&&t.series.some(e=>e.useSecondaryAxis===!0)?t.secondaryValAxis:null,h=e=>m!=null&&e.useSecondaryAxis===!0,g=ye(t,s,r),_=g.fontPx,v=g.topPad,y=g.bandH,b=qt(t.catAxisFontSizeHpt,s,r),x=qt(t.valAxisFontSizeHpt,s,r),S=me(t,o,s,.22),{legRightW:C,legLeftW:w,legTopH:T,legBottomH:E}=he(S),D=ve(t,o,s,r),O=D.catFontPx,k=D.valFontPx,A=D.catBandH,j=D.valBandW,M=y+T+x/2+2,N=be(b)+A+E,ee=s-M-N,te=Zt(m,t.series,ee/r),P=Math.max(8,Math.min(11,s/20)),ne=m?.fontSizeHpt?m.fontSizeHpt/100*r:P,F=0;if(m&&te&&!m.hidden){let n=e.font;e.font=`${ne}px sans-serif`;let r=0,i=Math.round((te.max-te.min)/te.step);for(let n=0;n<=i;n++)r=Math.max(r,e.measureText(Ve(te.min+n*te.step,m.formatCode??null,t.date1904)).width);F=r+18,e.font=n}let I=m&&m.title?(m.titleFontSizeHpt?m.titleFontSizeHpt/100*r:Math.max(9,s*.05))+8:0,L={t:M,r:C+o*.05+F+I,b:N,l:o*.12+j+w};$t(e,t,i,a+v,o,_);let{plotRect:{px0:R,py0:z,pw:B,ph:V}}=K(t,i,a,o,s,r,{titleBand:g,legendSideReserveFrac:.22,pad:L});if(B<=0||V<=0)return;t.plotAreaBg&&(e.fillStyle=`#${t.plotAreaBg}`,e.fillRect(R,z,B,V));let H=0;for(let e=0;e<l;e++)if(u){let n=0;for(let r=0;r<t.series.length;r++)n+=p(r,e);H=Math.max(H,n)}else for(let n of t.series)h(n)||(H=Math.max(H,n.values[e]??0));d&&(H=H>0?100:0),t.valMax!=null&&(H=d?t.valMax*100:t.valMax),H===0&&(H=1);let U=d?H:t.valMax,re=Ut(t.valAxisMajorUnit,d),{max:ie,step:ae}=Te(0,H,void 0,U,V/r,re),oe=Ne(t),se=oe?e=>R+(e+.5)/l*B:e=>R+(l===1?B/2:e/(l-1)*B),ce=e=>z+V-e/ie*V,le=te?te.makeToY(z,V):ce,ue=e=>h(e)?le:ce,{color:de,width:W}=je(t.catAxisLineColor,t.catAxisLineWidthEmu,r),{color:G,width:fe}=je(t.valAxisLineColor,t.valAxisLineWidthEmu,r);if(!t.valAxisHidden){let n=It(t,r),i=Ut(t.valAxisMinorUnit,d);if(t.valAxisMinorGridlines&&i!=null&&isFinite(i)&&i>0&&i<ae)for(let t=i;t<ie-1e-9;t+=i)Math.abs(t/ae-Math.round(t/ae))>1e-6&&Ft(e,R,B,ce(t),!1,n);if(Ht(t)){let t=Math.round(ie/ae);for(let r=0;r<=t;r++)Ft(e,R,B,ce(r*ae),r===0,n)}}if(!t.catAxisHidden&&Lt(t)){let n=Rt(t,r);e.strokeStyle=n.color,e.lineWidth=n.width;for(let n of zt(t,l)){let t=R+n*B;e.beginPath(),e.moveTo(t,z),e.lineTo(t,z+V),e.stroke()}}let pe=u?Array(l).fill(0):null;for(let n=t.series.length-1;n>=0;n--){let r=t.series[n],i=mt(n,r),a=z+V,o=ue(r),s=r.smooth===!0;if(e.beginPath(),u&&pe){let t=[];for(let e=0;e<l;e++)t.push({x:se(e),y:ce(p(n,e)+pe[e])});e.moveTo(t[0].x,t[0].y),vn(e,t,s);for(let t=l-1;t>=0;t--)e.lineTo(se(t),ce(pe[t]));for(let e=0;e<l;e++)pe[e]+=p(n,e)}else{let t=[];for(let e=0;e<l;e++)t.push({x:se(e),y:o(r.values[e]??0)});e.moveTo(se(0),a),e.lineTo(t[0].x,t[0].y),vn(e,t,s),e.lineTo(se(l-1),a)}e.closePath(),e.fillStyle=ot(i,.6),e.fill(),e.strokeStyle=i,e.lineWidth=1.5,e.setLineDash([]),e.stroke()}{let n=Math.max(2,2.5*r),i=(e,n)=>{if(u){let r=0;for(let i=e;i<t.series.length;i++)r+=p(i,n);return r}return t.series[e].values[n]??0};for(let a=0;a<t.series.length;a++){let o=t.series[a],s=mt(a,o),u=ue(o),d=e=>i(a,e);for(let t of o.errBars??[])xn(e,o,t,l,se,u,d,s);if(o.showMarker===!0||bn(o))for(let t=0;t<l;t++){if(o.values[t]==null)continue;let i=(o.dataPointOverrides??[]).find(e=>e.idx===t),a=i?.markerSymbol??o.markerSymbol??`circle`;if(a===`none`)continue;let c=se(t),l=u(d(t));bn(o)?pn(e,c,l,a,i?.markerSize??o.markerSize??5,i?.markerFill??i?.color??o.markerFill??s,i?.markerLine??o.markerLine??null,r):(e.fillStyle=s,e.beginPath(),e.arc(c,l,n,0,Math.PI*2),e.fill())}Sn(e,o,c,l,se,u,d,V,r,t.date1904??!1,!0,vt(t,t.dataLabelFontFace,`minor`),t.dataLabelPosition??`ctr`)}}if(!t.valAxisHidden){e.font=`${Math.max(8,Math.min(11,V/20))}px ${vt(t,t.valAxisFontFace,`minor`)}`,e.textBaseline=`middle`;let n=Math.round(ie/ae);for(let r=0;r<=n;r++){let n=r*ae,i=ce(n);Pt(e,t.valAxisMajorTickMark,`val`,R,i,G,fe),e.fillStyle=t.valAxisFontColor?`#${t.valAxisFontColor}`:`#555`,e.textAlign=`right`,e.fillText(Wt(t,n,d),R-6,i)}}if(!t.catAxisHidden&&!t.catAxisLineHidden&&(e.strokeStyle=de,e.lineWidth=W,e.beginPath(),e.moveTo(R,z+V),e.lineTo(R+B,z+V),e.stroke()),!t.valAxisHidden&&!t.valAxisLineHidden&&t.valAxisLineColor!=null&&(e.strokeStyle=G,e.lineWidth=fe,e.beginPath(),e.moveTo(R,z),e.lineTo(R,z+V),e.stroke()),!t.catAxisHidden&&t.catAxisMajorTickMark&&t.catAxisMajorTickMark!==`none`)if(oe)for(let n=0;n<=l;n++)Pt(e,t.catAxisMajorTickMark,`cat`,z+V,R+n/l*B,de,W);else for(let n=0;n<l;n++)Pt(e,t.catAxisMajorTickMark,`cat`,z+V,se(n),de,W);if(!t.catAxisHidden){e.fillStyle=t.catAxisFontColor?`#${t.catAxisFontColor}`:`#555`,e.textAlign=`center`,e.textBaseline=`top`,e.font=`${Math.max(8,Math.min(11,B/l*.8))}px ${vt(t,t.catAxisFontFace,`minor`)}`;let n=c.map(e=>He((e??``).toString(),t.catAxisFormatCode,t.date1904)),r=0;for(let t=0;t<l;t++)r=Math.max(r,e.measureText(n[t]??``).width);let i=Math.max(1,Math.ceil((r+6)/(B/l))),a=B/l*i-4;for(let t=0;t<l;t+=i)e.fillText(Je(e,n[t]??``,a),se(t),z+V+3)}if(m&&te){let n=t.valAxisFontColor?`#${t.valAxisFontColor}`:`#555`;Qt(e,m,te,le,R,z,B,V,s,r,ne,F,n,t.date1904)}Nt(e,t,S,i,a,o,s,R,z,B,V,y+2),wt(e,t,i,a,o,s,R,z,B,V,w,E,O,k)}function sn(e,t,n,r,i){let{x:a,y:o,w:s,h:c}=n,l=t.series[0];if(!l)return;let u=l.categories&&l.categories.length>0?l.categories:t.categories,d=l.values.map(e=>Math.abs(e??0)),f=d.reduce((e,t)=>e+t,0);if(f===0)return;let p=K(t,a,o,s,c,i,{titleTopPadFrac:.035,titleBottomPadFrac:.035,legendSideReserveFrac:.28,radialGapFrac:.02}),m=p.title.fontPx,h=p.title.bandH;$t(e,t,a,o+p.title.topPad,s,m);let g=p.legend,{px0:_,py0:v,pw:y,ph:b}=p.plotRect,x=p.center.cx,S=p.center.cy,C=Math.min(y,b)*.42,w=-Math.PI/2+(t.firstSliceAngle??0)*Math.PI/180,T=r?Math.max(1,Math.min(90,t.holeSize??50)):0,E=r?t.series:[l],D=T/100*C,O=(C-D)/E.length,k=(e,t)=>{let n=(e.dataPointOverrides??[]).find(e=>e.idx===t)?.explosion??0;return n>0?n/100*C:0},A=l.seriesDataLabels,j=A!=null&&(A.showVal||A.showCatName||A.showSerName||A.showPercent),M=t.showDataLabels&&!j,N=vt(t,t.dataLabelFontFace,`minor`);for(let t=0;t<E.length;t++){let n=E[t],i=n.values.map(e=>Math.abs(e??0)),a=i.reduce((e,t)=>e+t,0);if(a===0)continue;let o=C-t*O,s=o-O,c=w;for(let l=0;l<i.length;l++){let u=i[l]/a*Math.PI*2,d=ht(l,n),f=c+u/2,p=k(n,l),m=p>0?Math.cos(f)*p:0,h=p>0?Math.sin(f)*p:0;if(e.beginPath(),s>.01?(e.arc(x+m,S+h,o,c,c+u),e.arc(x+m,S+h,s,c+u,c,!0)):(e.moveTo(x+m,S+h),e.arc(x+m,S+h,o,c,c+u)),e.closePath(),e.fillStyle=d,e.fill(),e.strokeStyle=`#fff`,e.lineWidth=1,e.stroke(),M&&t===0&&u>.15){let t=C*(r?.75:.6),n=x+m+Math.cos(f)*t,o=S+h+Math.sin(f)*t,s=Math.round(i[l]/a*100);e.font=`bold ${Math.max(8,C*.1)}px ${N}`,e.fillStyle=`#fff`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(`${s}%`,n,o)}c+=u}}if(j&&cn(e,t,A,l,u,d,f,x,S,C,D,w,N,i,_,v,y,b),g){let n=[{...l,categories:u}];Nt(e,{...t,series:n},g,a,o,s,c,_,v,y,b,h+2)}}function cn(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){if(n.labelBox){ln(e,t,n,r,i,a,o,s,c,l,d,f,p,m,g,h,_);return}let v=r.dataLabelOverrides??[],y=d;for(let d=0;d<a.length;d++){let p=a[d]/o*Math.PI*2,m=y+p/2;y+=p;let h=v.find(e=>e.idx===d);if(h?.deleted)continue;let g=h?.showCatName??n.showCatName,_=h?.showSerName??n.showSerName,b=h?.showVal??n.showVal,x=h?.showPercent??n.showPercent,S;if(h&&h.text)S=h.text;else{let e=[];g&&e.push((i[d]??``).toString()),_&&e.push(r.name),b&&e.push(Ve(a[d],n.formatCode??null,t.date1904??!1)),x&&e.push(`${Math.round(a[d]/o*100)}%`),S=e.filter(Boolean).join(` `)}if(!S)continue;let C=(h?.position??n.position??`bestFit`)===`outEnd`,w=C?l+Math.max(10,l*.12):u>.01?(u+l)/2:l*.88,T=s+Math.cos(m)*w,E=c+Math.sin(m)*w,D=h?.fontSizeHpt??n.fontSizeHpt,O=D?D/100:Math.max(8,l*.1),k=h?.fontBold??n.fontBold,A=h?.fontColor??n.fontColor;e.font=`${k?`bold `:``}${O}px ${f}`,e.fillStyle=A?`#${A}`:C?`#333`:`#fff`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(S,T,E)}}function ln(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){let _=r.dataLabelOverrides??[],v=e=>_.find(t=>t.idx===e),y=n.fontSizeHpt?n.fontSizeHpt/100:Math.max(9,l*.09),b=Math.max(4,y*.45),x=Math.max(2,y*.28),S=y*.22,C=n.labelBox,w=[],T=u;for(let u=0;u<a.length;u++){let p=a[u]/o*Math.PI*2,m=T+p/2;if(T+=p,p<=0)continue;let h=v(u);if(h?.deleted)continue;let g=h?.showCatName??n.showCatName,_=h?.showSerName??n.showSerName,E=h?.showVal??n.showVal,D=h?.showPercent??n.showPercent,O=[];if(h&&h.text)O.push(h.text);else{if(g){let e=(i[u]??``).toString();e&&O.push(e)}_&&r.name&&O.push(r.name),E&&O.push(Ve(a[u],n.formatCode??null,t.date1904??!1)),D&&O.push(`${Math.round(a[u]/o*100)}%`)}if(O.length===0)continue;let k=h?.fontSizeHpt?h.fontSizeHpt/100:y,A=h?.fontBold??n.fontBold??!1,j=h?.fontColor?`#${h.fontColor}`:n.fontColor?`#${n.fontColor}`:`#000`,M=h?.labelBox??C,N=M?.fill?`#${M.fill}`:null,ee=M?.borderColor?`#${M.borderColor}`:null,te=M?.borderWidthEmu?Math.max(.75,M.borderWidthEmu/ke*f):1;e.font=`${A?`bold `:``}${k}px ${d}`;let P=0;for(let t of O)P=Math.max(P,e.measureText(t).width);let ne=k+S,F=P+b*2,I=O.length*ne-S+x*2,L=s+Math.cos(m)*l,R=c+Math.sin(m)*l,z=Math.cos(m)<0,B=Math.max(F,I)*.55+l*.06,V=L+Math.cos(m)*B,H=R+Math.sin(m)*B;w.push({lines:O,midAngle:m,rimX:L,rimY:R,boxW:F,boxH:I,cxBox:V,cyBox:H,leftSide:z,fontColor:j,boxFill:N,boxBorder:ee,boxBorderPx:te,fontPx:k,bold:A})}let E=h+2,D=h+g-2,O=D-E,k=e=>{if(e.length===0)return;e.sort((e,t)=>e.cyBox-t.cyBox);let t=0;for(let n of e)t+=n.boxH;if(t+=(e.length-1)*3,t>O){let t=e.reduce((e,t)=>e+t.boxH,0),n=e.length;if(n===1){e[0].cyBox=Math.min(Math.max(e[0].cyBox,E+e[0].boxH/2),D-e[0].boxH/2);return}let r=(O-t)/(n-1),i=E;for(let t of e)t.cyBox=i+t.boxH/2,i+=t.boxH+r;return}for(let t=1;t<e.length;t++){let n=e[t-1],r=e[t],i=(n.boxH+r.boxH)/2+3;r.cyBox-n.cyBox<i&&(r.cyBox=n.cyBox+i)}let n=e[e.length-1].cyBox+e[e.length-1].boxH/2-D;if(n>0)for(let t of e)t.cyBox-=n;let r=E-(e[0].cyBox-e[0].boxH/2);if(r>0)for(let t of e)t.cyBox+=r};k(w.filter(e=>!e.leftSide)),k(w.filter(e=>e.leftSide));for(let e of w)e.cyBox=Math.max(E+e.boxH/2,e.cyBox),e.cyBox=Math.min(D-e.boxH/2,e.cyBox);let A=p+2,j=p+m-2;for(let e of w){let t=e.boxW/2;e.cxBox-t<A&&(e.cxBox=A+t),e.cxBox+t>j&&(e.cxBox=j-t)}let M=n.leaderLineColor?`#${n.leaderLineColor}`:`#a6a6a6`,N=n.leaderLineWidthEmu?Math.max(.5,n.leaderLineWidthEmu/ke*f):1;for(let t of w){let r=t.cxBox+(t.leftSide?t.boxW/2:-t.boxW/2),i=t.cyBox,a=r-t.rimX,o=i-t.rimY,s=Math.hypot(a,o);n.showLeaderLines&&s>t.fontPx*.9&&(e.beginPath(),e.moveTo(t.rimX,t.rimY),e.lineTo(r,i),e.strokeStyle=M,e.lineWidth=N,e.stroke())}for(let t of w){let n=t.cxBox-t.boxW/2,r=t.cyBox-t.boxH/2;t.boxFill&&(e.fillStyle=t.boxFill,e.fillRect(n,r,t.boxW,t.boxH)),t.boxBorder&&(e.strokeStyle=t.boxBorder,e.lineWidth=t.boxBorderPx,e.strokeRect(n,r,t.boxW,t.boxH)),e.font=`${t.bold?`bold `:``}${t.fontPx}px ${d}`,e.fillStyle=t.fontColor,e.textAlign=`center`,e.textBaseline=`middle`;let i=t.fontPx+S,a=t.cyBox-(t.lines.length*i-S)/2+t.fontPx/2;for(let n=0;n<t.lines.length;n++)e.fillText(t.lines[n],t.cxBox,a+n*i)}}function un(e,t,n,r){let{x:i,y:a,w:o,h:s}=n,c=en(t),l=c.length;if(l<3)return;let u=K(t,i,a,o,s,r,{titleTopPadFrac:.035,titleBottomPadFrac:.035,legendSideReserveFrac:.22,radialGapFrac:.02}),d=u.legend,f=u.title.fontPx;$t(e,t,i,a+u.title.topPad,o,f);let{px0:p,py0:m,pw:h,ph:g}=u.plotRect,_=u.center.cx,v=u.center.cy,y=Math.min(h,g)*.38,b=0;for(let e of t.series)for(let t of e.values)b=Math.max(b,t??0);t.valMax!=null&&(b=t.valMax),b===0&&(b=1);let{max:x,step:S}=Te(0,b,void 0,t.valMax,void 0,t.valAxisMajorUnit),C=-Math.PI/2,w=e=>C+e/l*Math.PI*2,T=Math.round(x/S),E=e=>Math.min(e*S,x);e.strokeStyle=`#ddd`,e.lineWidth=.5;for(let t=1;t<=T;t++){let n=E(t)/x*y;e.beginPath();for(let t=0;t<l;t++){let r=w(t),i=_+Math.cos(r)*n,a=v+Math.sin(r)*n;t===0?e.moveTo(i,a):e.lineTo(i,a)}e.closePath(),e.stroke()}e.strokeStyle=`#bbb`,e.lineWidth=.5;for(let t=0;t<l;t++){let n=w(t);e.beginPath(),e.moveTo(_,v),e.lineTo(_+Math.cos(n)*y,v+Math.sin(n)*y),e.stroke()}if(!t.valAxisHidden){e.font=`${qt(t.valAxisFontSizeHpt,s,r)}px ${vt(t,t.valAxisFontFace,`minor`)}`,e.fillStyle=`#555`,e.textAlign=`right`,e.textBaseline=`middle`;for(let t=1;t<=T;t++){let n=E(t),r=n/x*y;e.fillText(Be(n),_-3,v-r)}}e.font=`${Math.max(8,Math.min(11,y*.2))}px ${vt(t,t.catAxisFontFace,`minor`)}`,e.fillStyle=`#444`,e.textBaseline=`middle`;let D=_-h/2,O=_+h/2;for(let n=0;n<l;n++){let r=w(n),i=_+Math.cos(r)*(y+12),a=v+Math.sin(r)*(y+12),o=Math.cos(r)<-.1?`right`:Math.cos(r)>.1?`left`:`center`;e.textAlign=o;let s=o===`right`?i-D:o===`left`?O-i:2*Math.min(O-i,i-D),l=He((c[n]??``).toString(),t.catAxisFormatCode,t.date1904);e.fillText(Je(e,l,s),i,a)}let k=t.radarStyle===`filled`,A=Math.max(2,y*.025);for(let n=0;n<t.series.length;n++){let r=t.series[n],i=mt(n,r),a=[];for(let e=0;e<l;e++){let t=r.values[e];if(t==null){a.push(null);continue}let n=t/x,i=w(e);a.push([_+Math.cos(i)*y*n,v+Math.sin(i)*y*n])}e.beginPath();let o=!1;for(let t of a){if(t==null){o=!1;continue}o?e.lineTo(t[0],t[1]):(e.moveTo(t[0],t[1]),o=!0)}let s=a.every(e=>e!=null);if(k&&s?(e.closePath(),e.fillStyle=ot(i,.25),e.fill()):s&&e.closePath(),e.strokeStyle=i,e.lineWidth=2,e.stroke(),!k&&r.showMarker!==!1){e.fillStyle=i;for(let t of a)t!=null&&(e.beginPath(),e.arc(t[0],t[1],A,0,Math.PI*2),e.fill())}}Nt(e,t,d,i,a,o,s,p,m,h,g,u.title.bandH+2)}function dn(e,t,n){if(n)return t;let r=e[t];if(r==null)return null;let i=parseFloat(r);return Number.isNaN(i)?null:i}function fn(e,t,n,r){let{x:i,y:a,w:o,h:s}=n,c=ye(t,s,r),l=c.fontPx,u=c.topPad,d=qt(t.catAxisFontSizeHpt,s,r),f=qt(t.valAxisFontSizeHpt,s,r),p=me(t,o,s,.22),{legRightW:m,legLeftW:h,legTopH:g,legBottomH:_}=he(p),v=ve(t,o,s,r),y=v.catFontPx,b=v.valFontPx,x=v.catBandH,S=v.valBandW;if(t.title){let n=t.titleManualLayout;n&&(n.x!==void 0||n.y!==void 0)?$t(e,t,i+n.x*o,a+n.y*s,(n.w??.5)*o,l):$t(e,t,i,a+u,o,l)}let{plotRect:{px0:C,py0:w,pw:T,ph:E}}=K(t,i,a,o,s,r,{titleBand:c,legendSideReserveFrac:.22,pad:{t:c.bandH+g+f/2+2,r:m+o*.05,b:(t.catAxisHidden?s*.04:be(d))+x+_,l:(t.valAxisHidden?o*.04:o*.12)+S+h},honorPlotAreaManualLayout:!0});if(T<=0||E<=0)return;t.plotAreaBg&&(e.fillStyle=`#${t.plotAreaBg}`,e.fillRect(C,w,T,E));let D=[],O=[];for(let e of t.series){let n=e.categories??t.categories;for(let e of n){let t=parseFloat(e);isNaN(t)||D.push(t)}}let k=D.length===0;if(k){let e=Math.max(...t.series.map(e=>e.values.length));for(let t=0;t<e;t++)D.push(t);for(let e of t.series)for(let t of e.values)t!=null&&O.push(t)}else{D.length=0;for(let e of t.series){let n=e.categories??t.categories;for(let t=0;t<e.values.length;t++){let r=e.values[t];if(r==null)continue;let i=dn(n,t,!1);i!=null&&(D.push(i),O.push(r))}}}let A=Math.min(...D),j=Math.max(...D),M=Math.min(...O),N=Math.max(...O);A===j&&(--A,j+=1),M===N&&(--M,N+=1),t.valMin==null?M>0&&(M=0):M=t.valMin,t.valMax!=null&&(N=t.valMax);let{min:ee,max:te,step:P}=Te(M,N,t.valMin,t.valMax,void 0,t.valAxisMajorUnit);if(M=ee,N=te,t.catAxisMin!=null&&(A=t.catAxisMin),t.catAxisMax!=null&&(j=t.catAxisMax),t.catAxisMin==null||t.catAxisMax==null){let e=xe(j-A);e>0&&(t.catAxisMin??(A=Math.floor(A/e)*e),t.catAxisMax??(j=Math.ceil(j/e)*e))}let ne=e=>C+(e-A)/(j-A)*T,F=e=>w+E-(e-M)/(N-M)*E,I=It(t,r);if(!t.valAxisHidden){let n=Math.max(8,Math.min(11,E/20));e.font=`${t.valAxisFontBold?`bold `:``}${n}px ${vt(t,t.valAxisFontFace,`minor`)}`;let i=Math.round((N-M)/P)+1;for(let n=0;n<i;n++){let i=M+n*P;if(i>N+P*.01)break;let a=F(i);e.strokeStyle=I.color,e.lineWidth=I.width,e.beginPath(),e.moveTo(C,a),e.lineTo(C+T,a),e.stroke(),e.fillStyle=`#555`,e.textAlign=`right`,e.textBaseline=`middle`,e.fillText(Ve(i,t.valAxisFormatCode,t.date1904),C-4,a);let o=t.valAxisLineColor?`#${t.valAxisLineColor}`:void 0;Pt(e,t.valAxisMajorTickMark,`val`,C,a,o,Ae(t.valAxisLineWidthEmu,r))}}let L=w+E;if(t.catAxisCrossesAt!=null)L=_n(F(t.catAxisCrossesAt),w,w+E);else{let e=t.catAxisCrosses??`autoZero`;e===`autoZero`&&M<0&&N>0?L=_n(F(0),w,w+E):e===`min`?L=w+E:e===`max`&&(L=w)}if(!t.catAxisHidden&&!t.catAxisLineHidden&&(e.save(),e.strokeStyle=t.catAxisLineColor?`#${t.catAxisLineColor}`:`#888`,e.lineWidth=Ae(t.catAxisLineWidthEmu,r),e.lineCap=`butt`,e.beginPath(),e.moveTo(C,L),e.lineTo(C+T,L),e.stroke(),e.restore()),!t.valAxisHidden&&!t.valAxisLineHidden&&(e.save(),e.strokeStyle=t.valAxisLineColor?`#${t.valAxisLineColor}`:`#888`,e.lineWidth=Ae(t.valAxisLineWidthEmu,r),e.beginPath(),e.moveTo(C,w),e.lineTo(C,w+E),e.stroke(),e.restore()),!t.catAxisHidden){let n=Math.max(8,Math.min(11,E/20));e.font=`${t.catAxisFontBold?`bold `:``}${n}px ${vt(t,t.catAxisFontFace,`minor`)}`;let i=xe(j-A),a=Math.round((j-A)/i)+1;e.fillStyle=`#555`,e.textAlign=`center`,e.textBaseline=`top`;for(let n=0;n<a;n++){let a=A+n*i;if(a>j+i*.01)break;let o=ne(a);e.fillText(Ve(a,t.catAxisFormatCode,t.date1904),o,L+4);let s=t.catAxisLineColor?`#${t.catAxisLineColor}`:void 0;Pt(e,t.catAxisMajorTickMark,`cat`,L,o,s,Ae(t.catAxisLineWidthEmu,r))}}let R=t.chartType===`bubble`,z=R?`marker`:t.scatterStyle??`marker`,B=z===`line`||z===`lineMarker`||z===`lineNoMarker`,V=z===`smooth`||z===`smoothMarker`||z===`smoothNoMarker`,H=z===`lineNoMarker`||z===`smoothNoMarker`;for(let n=0;n<t.series.length;n++){let i=t.series[n],a=mt(n,i),o=i.categories??t.categories;for(let t of i.errBars??[])mn(e,i,t,o,k,ne,F,a);if((B||V)&&i.lineHidden!==!0){let t=[];for(let e=0;e<i.values.length;e++){let n=i.values[e];if(n==null)continue;let r=dn(o,e,k);r!=null&&t.push({x:ne(r),y:F(n)})}if(t.length>=2){if(e.save(),e.strokeStyle=i.color?`#${i.color}`:a,e.lineWidth=1.5,e.beginPath(),e.moveTo(t[0].x,t[0].y),V&&t.length>=3)for(let n=0;n<t.length-1;n++){let r=t[n-1]??t[n],i=t[n],a=t[n+1],o=t[n+2]??a,s=i.x+(a.x-r.x)/6,c=i.y+(a.y-r.y)/6,l=a.x-(o.x-i.x)/6,u=a.y-(o.y-i.y)/6;e.bezierCurveTo(s,c,l,u,a.x,a.y)}else for(let n=1;n<t.length;n++)e.lineTo(t[n].x,t[n].y);e.stroke(),e.restore()}}if(!(H||i.showMarker===!1||typeof i.markerSymbol==`string`&&i.markerSymbol===`none`)){let t=0;if(R&&i.bubbleSizes&&i.bubbleSizes.length>0){let e=Math.max(0,...i.bubbleSizes.filter(e=>e!=null));e>0&&(t=Math.min(T,E)/Math.max(8,i.values.length*1.6)/Math.sqrt(e))}for(let n=0;n<i.values.length;n++){let s=i.values[n];if(s==null)continue;let c=dn(o,n,k);if(c==null)continue;let l=(i.dataPointOverrides??[]).find(e=>e.idx===n),u=l?.markerSymbol??i.markerSymbol??`circle`,d=l?.markerSize??i.markerSize??5;if(R&&t>0){let e=i.bubbleSizes?.[n];e!=null&&e>0&&(d=Math.sqrt(e)*t*2/r)}let f=l?.markerFill??l?.color??i.markerFill??a,p=l?.markerLine??i.markerLine??null;pn(e,ne(c),F(s),u,d,f,p,r)}}hn(e,i,o,k,ne,F,E,r,t.date1904,vt(t,t.dataLabelFontFace,`minor`),t.dataLabelPosition??`r`)}Nt(e,t,p,i,a,o,s,C,w,T,E,c.bandH+2),wt(e,t,i,a,o,s,C,w,T,E,h,_,y,b)}function pn(e,t,n,r,i,a,o,s){let c=Math.max(2,i*s),l=c/2,u=a.startsWith(`#`)?a:`#${a}`,d=o?o.startsWith(`#`)?o:`#${o}`:null;switch(e.save(),e.fillStyle=u,d&&(e.strokeStyle=d,e.lineWidth=1),r){case`square`:e.fillRect(t-l,n-l,c,c),o&&e.strokeRect(t-l,n-l,c,c);break;case`diamond`:e.beginPath(),e.moveTo(t,n-l),e.lineTo(t+l,n),e.lineTo(t,n+l),e.lineTo(t-l,n),e.closePath(),e.fill(),o&&e.stroke();break;case`triangle`:e.beginPath(),e.moveTo(t,n-l),e.lineTo(t+l,n+l),e.lineTo(t-l,n+l),e.closePath(),e.fill(),o&&e.stroke();break;case`x`:e.strokeStyle=u,e.lineWidth=Math.max(1,c*.18),e.beginPath(),e.moveTo(t-l,n-l),e.lineTo(t+l,n+l),e.moveTo(t-l,n+l),e.lineTo(t+l,n-l),e.stroke();break;case`plus`:e.strokeStyle=u,e.lineWidth=Math.max(1,c*.18),e.beginPath(),e.moveTo(t-l,n),e.lineTo(t+l,n),e.moveTo(t,n-l),e.lineTo(t,n+l),e.stroke();break;case`star`:e.beginPath();for(let r=0;r<10;r++){let i=r%2==0?l:l*.45,a=-Math.PI/2+r*Math.PI/5,o=t+Math.cos(a)*i,s=n+Math.sin(a)*i;r===0?e.moveTo(o,s):e.lineTo(o,s)}e.closePath(),e.fill(),o&&e.stroke();break;case`dot`:e.beginPath(),e.arc(t,n,Math.max(1,c*.25),0,Math.PI*2),e.fill();break;case`dash`:{let r=Math.max(1,c*.25);e.fillRect(t-l,n-r/2,c,r);break}default:e.beginPath(),e.arc(t,n,l,0,Math.PI*2),e.fill(),o&&e.stroke();break}e.restore()}function mn(e,t,n,r,i,a,o,s){e.save(),e.strokeStyle=n.color?`#${n.color}`:s,e.lineWidth=n.lineWidthEmu?Math.max(.5,n.lineWidthEmu/ke):1,e.setLineDash(yn(n.dash));let c=n.barType===`plus`||n.barType===`both`,l=n.barType===`minus`||n.barType===`both`,u=n.dir===`x`,d=e.lineWidth*1.5;for(let s=0;s<t.values.length;s++){let f=t.values[s];if(f==null)continue;let p=dn(r,s,i);if(p==null)continue;let m=a(p),h=o(f),g=t=>{let r=m,i=h;u?r=a(p+t):i=o(f+t),e.beginPath(),e.moveTo(m,h),e.lineTo(r,i),e.stroke(),n.noEndCap||(e.save(),e.setLineDash([]),e.beginPath(),u?(e.moveTo(r,i-d),e.lineTo(r,i+d)):(e.moveTo(r-d,i),e.lineTo(r+d,i)),e.stroke(),e.restore())};if(c){let e=n.plus[s];e!=null&&g(e)}if(l){let e=n.minus[s];e!=null&&g(-e)}}e.restore()}function hn(e,t,n,r,i,a,o,s,c=!1,l=`sans-serif`,u=`r`){let d=t.dataLabelOverrides??[];if(d.length===0&&!t.seriesDataLabels)return;let f=t.seriesDataLabels;for(let p=0;p<t.values.length;p++){let m=t.values[p];if(m==null)continue;let h=dn(n,p,r);if(h==null)continue;let g=d.find(e=>e.idx===p);if(g?.deleted)continue;let _=g?.showCatName??f?.showCatName,v=g?.showSerName??f?.showSerName,y=g?.showVal??f?.showVal,b;if(g?.text)b=g.text;else if(y||v||_){let e=[];if(_&&!r&&e.push(n[p]??``),v&&e.push(t.name),y&&e.push(Ve(m,f?.formatCode??null,c)),b=e.filter(Boolean).join(` `),!b)continue}else continue;let x=g?.position??f?.position??u,S=g?.fontSizeHpt??f?.fontSizeHpt,C=S?S/100*s:Math.max(9,Math.min(11,o/25)),w=g?.fontColor??f?.fontColor,T=g?.fontBold??f?.fontBold??!1;gn(e,i(h),a(m),b,x,C,w,T,l)}}function gn(e,t,n,r,i,a,o,s,c=`sans-serif`,l=0){e.save(),e.font=`${s?`bold `:``}${a}px ${c}`,e.fillStyle=o?`#${o}`:`#333`;let u=a*.6+l,d=t,f=n;switch(i){case`l`:e.textAlign=`right`,e.textBaseline=`middle`,d=t-u;break;case`r`:e.textAlign=`left`,e.textBaseline=`middle`,d=t+u;break;case`t`:e.textAlign=`center`,e.textBaseline=`bottom`,f=n-u;break;case`b`:e.textAlign=`center`,e.textBaseline=`top`,f=n+u;break;case`ctr`:e.textAlign=`center`,e.textBaseline=`middle`;break;default:e.textAlign=`left`,e.textBaseline=`middle`,d=t+u;break}let p=r.split(/\\r?\\n/),m=a*1.15,h=m*p.length,g=f;e.textBaseline===`middle`?g=f-(h-m)/2:e.textBaseline===`bottom`&&(g=f-(h-m));for(let t of p)e.fillText(t,d,g),g+=m;e.restore()}function _n(e,t,n){return e<t?t:e>n?n:e}function vn(e,t,n){if(t.length!==0)if(n&&t.length>=3)for(let n=0;n<t.length-1;n++){let r=t[n-1]??t[n],i=t[n],a=t[n+1],o=t[n+2]??a,s=i.x+(a.x-r.x)/6,c=i.y+(a.y-r.y)/6,l=a.x-(o.x-i.x)/6,u=a.y-(o.y-i.y)/6;e.bezierCurveTo(s,c,l,u,a.x,a.y)}else for(let n=1;n<t.length;n++)e.lineTo(t[n].x,t[n].y)}function yn(e){if(!e)return[];switch(e){case`solid`:return[];case`dot`:case`sysDot`:return[1,2];case`dash`:case`sysDash`:return[4,2];case`lgDash`:return[8,3];case`dashDot`:case`sysDashDot`:return[4,2,1,2];case`lgDashDot`:return[8,3,1,3];case`dashDotDot`:case`sysDashDotDot`:case`lgDashDotDot`:return[4,2,1,2,1,2];default:return[]}}function bn(e){return e.markerSymbol!=null||e.markerSize!=null||e.markerFill!=null||e.markerLine!=null||e.dataPointOverrides!=null&&e.dataPointOverrides.length>0}function xn(e,t,n,r,i,a,o,s){if(n.dir===`x`)return;let c=n.barType===`plus`||n.barType===`both`,l=n.barType===`minus`||n.barType===`both`;e.save(),e.strokeStyle=n.color?`#${n.color}`:s,e.lineWidth=n.lineWidthEmu?Math.max(.5,n.lineWidthEmu/ke):1,e.setLineDash(yn(n.dash));let u=e.lineWidth*1.5;for(let s=0;s<r;s++){if(t.values[s]==null)continue;let r=o(s),d=i(s),f=a(r),p=t=>{let i=a(r+t);e.beginPath(),e.moveTo(d,f),e.lineTo(d,i),e.stroke(),n.noEndCap||(e.save(),e.setLineDash([]),e.beginPath(),e.moveTo(d-u,i),e.lineTo(d+u,i),e.stroke(),e.restore())};if(c){let e=n.plus[s];e!=null&&p(e)}if(l){let e=n.minus[s];e!=null&&p(-e)}}e.restore()}function Sn(e,t,n,r,i,a,o,s,c,l,u,d=`sans-serif`,f=`t`){let p=t.dataLabelOverrides??[],m=t.seriesDataLabels;if(p.length===0&&!m)return!1;for(let h=0;h<r;h++){if(t.values[h]==null&&!u)continue;let r=o(h),g=p.find(e=>e.idx===h);if(g?.deleted)continue;let _=g?.showCatName??m?.showCatName,v=g?.showSerName??m?.showSerName,y=g?.showVal??m?.showVal,b;if(g?.text)b=g.text;else if(y||v||_){let e=[];if(_&&e.push(n[h]??``),v&&e.push(t.name),y&&e.push(Ve(r,m?.formatCode??null,l)),b=e.filter(Boolean).join(` `),!b)continue}else continue;let x=g?.position??m?.position??f,S=g?.fontSizeHpt??m?.fontSizeHpt,C=S?S/100*c:Math.max(9,Math.min(11,s/25)),w=g?.fontColor??m?.fontColor,T=g?.fontBold??m?.fontBold??!1;gn(e,i(h),a(r),b,x,C,w,T,d)}return!0}function Cn(e,t,n){let{x:r,y:i,w:a,h:o}=n,s=t.plotAreaManualLayout,c,l,u,d;if(s&&s.w!=null&&s.h!=null)c=r+s.x*a,l=i+s.y*o,u=s.w*a,d=s.h*o;else{let e=t.valAxisHidden?a*.01:a*.11,n=a*.01,s=o*.12,f=o*.14;c=r+e,l=i+s,u=a-e-n,d=o-s-f}let f=t.series[0]?.values??[],p=t.categories,m=p.length;if(m===0)return;let h=new Set(t.subtotalIndices),g=0,_=[];for(let e=0;e<m;e++){let t=f[e]??0;if(e===0||h.has(e))_.push({start:0,end:t,isSub:!0,isPos:!0}),g=t;else{let e=t>=0?g:g+t,n=t>=0?g+t:g;_.push({start:e,end:n,isSub:!1,isPos:t>=0}),g+=t}}let v=_.map(e=>e.end),y=_.map(e=>e.start),b=Math.max(...v,...y),x=Math.min(...y,0),S=b-x;if(S<=0)return;let C=x<0?x-S*.05:0,w=(b-C)*1.1,T=C+w,E=xe(w);e.save();let D=Math.round(o*.042);if(e.font=`${D}px ${vt(t,t.valAxisFontFace,`minor`)}`,!t.valAxisHidden){e.strokeStyle=`#e8e8e8`,e.lineWidth=.7,e.fillStyle=`#666`,e.textAlign=`right`,e.textBaseline=`middle`;for(let n=Math.ceil(C/E)*E;n<=T;n+=E){let r=l+d*(1-(n-C)/w);e.beginPath(),e.moveTo(c,r),e.lineTo(c+u,r),e.stroke(),e.fillText(Ve(n,t.valAxisFormatCode,t.date1904),c-4,r)}}let O=!t.valAxisHidden&&!t.valAxisLineHidden,k=!t.catAxisHidden&&!t.catAxisLineHidden;(O||k)&&(e.strokeStyle=`#bbb`,e.lineWidth=1,e.beginPath(),O?(e.moveTo(c,l),e.lineTo(c,l+d),k&&e.lineTo(c+u,l+d)):k&&(e.moveTo(c,l+d),e.lineTo(c+u,l+d)),e.stroke());let A=u/m,j=A/(1+(t.barGapWidth??150)/100);_.forEach((n,r)=>{let i=c+A*r+(A-j)/2,a=l+d*(1-(n.end-C)/w),s=l+d*(1-(n.start-C)/w),u=Math.max(1,s-a);if(n.isSub?(e.fillStyle=`#196ECA`,e.fillRect(i,a,j,u)):(e.strokeStyle=n.isPos?`#5BA4E6`:`#E46970`,e.lineWidth=1.5,e.strokeRect(i+.75,a+.75,j-1.5,u-1.5)),r<m-1){let t=c+A*(r+1)+(A-j)/2,o=n.isPos?a:s;e.strokeStyle=`#ccc`,e.lineWidth=.8,e.setLineDash([3,3]),e.beginPath(),e.moveTo(i+j,o),e.lineTo(t,o),e.stroke(),e.setLineDash([])}let p=f[r]??0,h=t.dataLabelFormatCode??t.series[0]?.valFormatCode??null,g=p<0?`△ ${Ve(Math.abs(p),h,t.date1904)}`:Ve(p,h,t.date1904),_=t.series[0]?.dataLabelColors?.[r]??null;e.fillStyle=_?`#${_}`:t.dataLabelFontColor?`#${t.dataLabelFontColor}`:`#595959`,e.font=`bold ${Math.round(o*.044)}px ${vt(t,t.dataLabelFontFace,`minor`)}`,e.textAlign=`center`,p<0?(e.textBaseline=`top`,e.fillText(g,i+j/2,s+3)):(e.textBaseline=`bottom`,e.fillText(g,i+j/2,a-3))}),e.textAlign=`center`,e.textBaseline=`top`,e.fillStyle=`#666`,e.font=`${Math.round(o*.038)}px ${vt(t,t.catAxisFontFace,`minor`)}`;let M=l+d+4;for(let n=0;n<m;n++){let r=c+A*n+A/2;He(p[n],t.catAxisFormatCode,t.date1904).split(/\\s+/).forEach((t,n)=>e.fillText(t,r,M+n*(D+2)))}e.restore()}function wn(e,t,n){let r=e.length;if(r===0)return 0;if(r===1)return e[0];let i;n===`inclusive`?i=t*(r-1)+1:(i=t*(r+1),i<1&&(i=1),i>r&&(i=r));let a=Math.floor(i),o=i-a;return a>=r?e[r-1]:e[a-1]+o*(e[a]-e[a-1])}function Tn(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>e-t),r=wn(n,.25,t),i=wn(n,.5,t),a=wn(n,.75,t),o=a-r,s=r-1.5*o,c=a+1.5*o,l=[],u=[];for(let e of n)e<s||e>c?u.push(e):l.push(e);return{q1:r,median:i,q3:a,whiskerLo:l.length?l[0]:n[0],whiskerHi:l.length?l[l.length-1]:n[n.length-1],mean:e.reduce((e,t)=>e+t,0)/e.length,outliers:u,inner:l}}function En(e,t,n,r){let i=t.chartexBox;if(!i||i.categories.length===0||i.series.length===0)return;let{x:a,y:o,w:s,h:c}=n,l=ye(t,c,r),u=qt(t.catAxisFontSizeHpt,c,r),d=qt(t.valAxisFontSizeHpt,c,r),f=K(t,a,o,s,c,r,{titleBand:l,legendSideReserveFrac:0,pad:{t:l.bandH+d/2+2,r:s*.02,b:t.catAxisHidden?c*.02:be(u),l:t.valAxisHidden?s*.02:s*.1}});$t(e,t,a,o+f.title.topPad,s,f.title.fontPx);let{px0:p,py0:m,pw:h,ph:g}=f.plotRect,_=i.categories,v=_.length,y=i.series.length,b=1/0,x=-1/0;for(let e of i.series)for(let t of e.valuesByCategory)for(let e of t)e<b&&(b=e),e>x&&(x=e);if(!isFinite(b)||!isFinite(x))return;let{min:S,max:C,step:w}=Te(b,x,t.valMin,t.valMax,g/r,t.valAxisMajorUnit),T=C-S||1,E=e=>m+g*(1-(e-S)/T),D=vt(t,t.valAxisFontFace,`minor`),O=qt(t.valAxisFontSizeHpt,c,r);if(e.save(),!t.valAxisHidden){e.font=`${O}px ${D}`,e.textAlign=`right`,e.textBaseline=`middle`;for(let n=S;n<=C+1e-6;n+=w){let r=E(n);e.strokeStyle=`#e6e6e6`,e.lineWidth=1,e.beginPath(),e.moveTo(p,r),e.lineTo(p+h,r),e.stroke(),e.fillStyle=t.valAxisFontColor?`#${t.valAxisFontColor}`:`#595959`,e.fillText(Ve(n,t.valAxisFormatCode,t.date1904),p-4,r)}}!t.catAxisHidden&&!t.catAxisLineHidden&&(e.strokeStyle=`#bfbfbf`,e.lineWidth=1,e.beginPath(),e.moveTo(p,m+g),e.lineTo(p+h,m+g),e.stroke());let k=h/v,A=k/(1+(t.barGapWidth??150)/100),j=A*.06,M=(A-j*(y-1))/y,N=e=>{let n=t.chartexAccents?.[e%(t.chartexAccents?.length??1)];return`#${i.series[e].color??n??pt[e%pt.length]}`},ee=qt(t.catAxisFontSizeHpt,c,r);for(let n=0;n<v;n++){let r=p+k*n+(k-A)/2;for(let t=0;t<y;t++){let a=i.series[t],o=Tn(a.valuesByCategory[n]??[],a.quartileMethod);if(!o)continue;let s=r+t*(M+j),c=s+M/2,l=N(t),u=gt(l,.8),d=E(o.q1),f=E(o.q3),p=Math.min(d,f),m=Math.max(1,Math.abs(d-f)),h=M*.4;e.strokeStyle=u,e.lineWidth=1,e.beginPath(),e.moveTo(c,E(o.whiskerHi)),e.lineTo(c,f),e.moveTo(c,d),e.lineTo(c,E(o.whiskerLo)),e.moveTo(c-h/2,E(o.whiskerHi)),e.lineTo(c+h/2,E(o.whiskerHi)),e.moveTo(c-h/2,E(o.whiskerLo)),e.lineTo(c+h/2,E(o.whiskerLo)),e.stroke(),e.fillStyle=l,e.fillRect(s,p,M,m),e.strokeStyle=u,e.lineWidth=.75,e.strokeRect(s+.375,p+.375,M-.75,m-.75);let g=E(o.median);if(e.strokeStyle=u,e.lineWidth=1,e.beginPath(),e.moveTo(s,g),e.lineTo(s+M,g),e.stroke(),a.meanMarker){let t=E(o.mean),n=Math.max(2,M*.14);e.strokeStyle=u,e.lineWidth=1,e.beginPath(),e.moveTo(c-n,t-n),e.lineTo(c+n,t+n),e.moveTo(c+n,t-n),e.lineTo(c-n,t+n),e.stroke()}if(a.showOutliers){e.fillStyle=l;let t=Math.max(1.5,M*.06);for(let n of o.outliers)e.beginPath(),e.arc(c,E(n),t,0,Math.PI*2),e.fill()}}if(!t.catAxisHidden){e.font=`${ee}px ${vt(t,t.catAxisFontFace,`minor`)}`,e.fillStyle=t.catAxisFontColor?`#${t.catAxisFontColor}`:`#595959`,e.textAlign=`center`,e.textBaseline=`top`;let r=_[n],i=p+k*n+k/2;e.fillText(r,i,m+g+4)}}e.restore()}function Dn(e){let t={label:``,value:0,depth:-1,children:[],branchIndex:-1,a0:0,a1:0};for(let n of e){let e=t;for(let t=0;t<n.path.length;t++){let r=n.path[t],i=e.children.find(e=>e.label===r);i||(i={label:r,value:0,depth:t,children:[],branchIndex:t===0?e.children.length:e.branchIndex,a0:0,a1:0},e.children.push(i)),i.value+=n.size,e=i}}return t.value=t.children.reduce((e,t)=>e+t.value,0),t}function On(e){let t=e.children.reduce((e,t)=>e+t.value,0);if(t<=0)return;let n=e.a0;for(let r of e.children){let i=(e.a1-e.a0)*r.value/t;r.a0=n,r.a1=n+i,n=r.a1,On(r)}}function kn(e){return e.children.length===0?e.depth:Math.max(...e.children.map(kn))}function An(e,t,n,r){let i=t.chartexSunburst;if(!i||i.rows.length===0)return;let{x:a,y:o,w:s,h:c}=n,l=K(t,a,o,s,c,r,{titleTopPadFrac:.035,titleBottomPadFrac:.035,legendSideReserveFrac:0,radialGapFrac:.02});$t(e,t,a,o+l.title.topPad,s,l.title.fontPx);let{px0:u,py0:d,pw:f,ph:p}=l.plotRect,m=u+f/2,h=d+p/2,g=Math.min(f,p)*.46,_=Dn(i.rows);if(_.value<=0||_.children.length===0)return;_.a0=-Math.PI/2,_.a1=-Math.PI/2+Math.PI*2,On(_);let v=kn(_)+1,y=g*.18,b=(g-y)/v,x=t.chartexAccents,S=e=>`#${x?.[e%x.length]??pt[e%pt.length]}`,C=vt(t,t.dataLabelFontFace,`minor`),w=Math.max(7,Math.min(13,g*.075)),T=Array.from({length:v},()=>[]),E=e=>{e.depth>=0&&T[e.depth].push(e),e.children.forEach(E)};E(_),e.save();for(let t=0;t<v;t++){let n=y+t*b,r=n+b;for(let i of T[t]){let t=i.a1-i.a0;if(t<=1e-4)continue;e.beginPath(),e.arc(m,h,r,i.a0,i.a1),e.arc(m,h,n,i.a1,i.a0,!0),e.closePath(),e.fillStyle=S(i.branchIndex),e.fill(),e.strokeStyle=`#ffffff`,e.lineWidth=1,e.stroke();let a=(i.a0+i.a1)/2,o=(n+r)/2,s=b-4,c=t*o;if(s<w*.9&&c<w*.9)continue;e.save(),e.translate(m+Math.cos(a)*o,h+Math.sin(a)*o);let l=a+Math.PI/2,u=l*180/Math.PI%360;u>90&&u<270&&(l+=Math.PI),e.rotate(l),e.font=`${w}px ${C}`,e.fillStyle=`#ffffff`,e.textAlign=`center`,e.textBaseline=`middle`;let d=i.label.split(/\\s+/).filter(Boolean),f=c-2,p=[],g=``;for(let t of d){let n=g?`${g} ${t}`:t;e.measureText(n).width<=f||!g?g=n:(p.push(g),g=t)}g&&p.push(g);let _=w*1.05,v=Math.max(1,Math.floor(s/_)),y=p.slice(0,v).map(t=>Je(e,t,f)),x=y.length*_;y.forEach((t,n)=>{t!==``&&e.fillText(t,0,-x/2+_/2+n*_)}),e.restore()}}e.restore()}function jn(e,t,n,r=1.3333333333333333){e.save();try{let{x:i,y:a,w:o,h:s}=n;if(t.chartBg&&(e.fillStyle=`#${t.chartBg}`,e.fillRect(i,a,o,s)),t.chartBorderColor){e.save(),e.strokeStyle=`#${t.chartBorderColor}`,e.lineWidth=t.chartBorderWidthEmu?Math.max(.5,t.chartBorderWidthEmu/ke)*r:1;let n=e.lineWidth;e.strokeRect(i+n/2,a+n/2,o-n,s-n),e.restore()}let c=t.chartexBox!=null||t.chartexSunburst!=null;if(t.series.length===0&&!c){e.fillStyle=`#888`,e.font=`12px sans-serif`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(`(no data)`,i+o/2,a+s/2);return}switch(t.chartType){case`clusteredBar`:case`clusteredBarH`:case`stackedBar`:case`stackedBarH`:case`stackedBarPct`:case`stackedBarHPct`:nn(e,t,n,r);break;case`line`:case`stackedLine`:case`stackedLinePct`:rn(e,t,n,r);break;case`area`:case`stackedArea`:case`stackedAreaPct`:on(e,t,n,r);break;case`pie`:sn(e,t,n,!1,r);break;case`doughnut`:sn(e,t,n,!0,r);break;case`radar`:un(e,t,n,r);break;case`scatter`:case`bubble`:fn(e,t,n,r);break;case`waterfall`:Cn(e,t,n);break;case`stock`:an(e,t,n,r);break;case`boxWhisker`:En(e,t,n,r);break;case`sunburst`:An(e,t,n,r);break;default:e.fillStyle=`#888`,e.font=`11px sans-serif`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(`Chart: ${t.chartType}`,i+o/2,a+s/2)}}finally{e.restore()}}function Mn(e,t,n,r,i,a){for(let o of t){let t=0,s=0;for(let c of o)switch(c.cmd){case`moveTo`:e.moveTo(n+c.x*i,r+c.y*a),t=c.x,s=c.y;break;case`lineTo`:e.lineTo(n+c.x*i,r+c.y*a),t=c.x,s=c.y;break;case`cubicBezTo`:e.bezierCurveTo(n+c.x1*i,r+c.y1*a,n+c.x2*i,r+c.y2*a,n+c.x*i,r+c.y*a),t=c.x,s=c.y;break;case`arcTo`:{let o=c.wr*i,l=c.hr*a;if(o<=0||l<=0)break;let u=c.stAng*Math.PI/180,d=c.swAng*Math.PI/180,f=n+t*i,p=r+s*a,m=f-o*Math.cos(u),h=p-l*Math.sin(u),g=u+d;e.ellipse(m,h,o,l,0,u,g,d<0),t=(m+o*Math.cos(g)-n)/i,s=(h+l*Math.sin(g)-r)/a;break}case`close`:e.closePath();break}}}const Nn=1e-9;function Pn(e){return e.cmd===`lineTo`||e.cmd===`cubicBezTo`||e.cmd===`arcTo`}function Fn(e,t,n,r){let i=n===0?0:n,a=r===0?0:r;return{x:e,y:t,dx:i,dy:a,angle:Math.atan2(a,i)}}function In(e,t,n){switch(n.cmd){case`lineTo`:return{dx:n.x-e,dy:n.y-t};case`cubicBezTo`:{let r=n.x1-e,i=n.y1-t;return Math.abs(r)<Nn&&Math.abs(i)<Nn&&(r=n.x2-e,i=n.y2-t),Math.abs(r)<Nn&&Math.abs(i)<Nn&&(r=n.x-e,i=n.y-t),{dx:r,dy:i}}case`arcTo`:{let e=n.stAng*Math.PI/180,t=n.swAng<0?-1:1;return{dx:-n.wr*Math.sin(e)*t,dy:n.hr*Math.cos(e)*t}}default:return{dx:0,dy:0}}}function Ln(e,t,n){switch(n.cmd){case`moveTo`:case`lineTo`:case`cubicBezTo`:return{x:n.x,y:n.y};case`arcTo`:{if(n.wr<=0||n.hr<=0)return{x:e,y:t};let r=n.stAng*Math.PI/180,i=r+n.swAng*Math.PI/180,a=e-n.wr*Math.cos(r),o=t-n.hr*Math.sin(r);return{x:a+n.wr*Math.cos(i),y:o+n.hr*Math.sin(i)}}default:return{x:e,y:t}}}function Rn(e,t,n){let{x:r,y:i}=Ln(e,t,n);switch(n.cmd){case`lineTo`:return{dx:n.x-e,dy:n.y-t,x:r,y:i};case`cubicBezTo`:{let a=n.x-n.x2,o=n.y-n.y2;return Math.abs(a)<Nn&&Math.abs(o)<Nn&&(a=n.x-n.x1,o=n.y-n.y1),Math.abs(a)<Nn&&Math.abs(o)<Nn&&(a=n.x-e,o=n.y-t),{dx:a,dy:o,x:r,y:i}}case`arcTo`:{if(n.wr<=0||n.hr<=0)return{dx:0,dy:0,x:r,y:i};let e=n.stAng*Math.PI/180+n.swAng*Math.PI/180,t=n.swAng<0?-1:1;return{dx:-n.wr*Math.sin(e)*t,dy:n.hr*Math.cos(e)*t,x:r,y:i}}default:return{dx:0,dy:0,x:r,y:i}}}function zn(e){let t=0,n=0,r=!1;for(let i of e)i.cmd===`moveTo`&&(r=!0),{x:t,y:n}=Ln(t,n,i);return r?{x:t,y:n}:null}function Bn(e){if(e.some(e=>e.cmd===`close`))return!0;let t=e.find(e=>e.cmd===`moveTo`);if(!t)return!1;let n=zn(e);return!n||!e.some(Pn)?!1:Math.abs(n.x-t.x)<Nn&&Math.abs(n.y-t.y)<Nn}function Vn(e){let t={start:null,end:null};if(!e||e.length===0)return t;let n=e[0];if(n&&n.length>0&&!Bn(n)){let e=n.find(e=>e.cmd===`moveTo`),r=n.find(Pn);if(e&&r){let n=In(e.x,e.y,r);(Math.abs(n.dx)>Nn||Math.abs(n.dy)>Nn)&&(t.start=Fn(e.x,e.y,-n.dx,-n.dy))}}let r=e[e.length-1];if(r&&r.length>0&&!Bn(r)){let e=0,n=0,i=-1;for(let e=0;e<r.length;e++)Pn(r[e])&&(i=e);if(i>=0){for(let t=0;t<i;t++)({x:e,y:n}=Ln(e,n,r[t]));let a=Rn(e,n,r[i]);(Math.abs(a.dx)>Nn||Math.abs(a.dy)>Nn)&&(t.end=Fn(a.x,a.y,a.dx,a.dy))}}return t}var Hn={accentbordercallout1:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 112500`],[`adj4`,`val -38333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`t`],[`c`],[`l`,`x1`,`b`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`]]}]},accentbordercallout2:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 112500`],[`adj6`,`val -46667`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`t`],[`c`],[`l`,`x1`,`b`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`]]}]},accentbordercallout3:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 100000`],[`adj6`,`val -16667`],[`adj7`,`val 112963`],[`adj8`,`val -8333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`],[`y4`,`*/ h adj7 100000`],[`x4`,`*/ w adj8 100000`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`t`],[`c`],[`l`,`x1`,`b`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`],[`l`,`x4`,`y4`]]}]},accentcallout1:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 112500`],[`adj4`,`val -38333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`t`],[`c`],[`l`,`x1`,`b`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`]]}]},accentcallout2:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 112500`],[`adj6`,`val -46667`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`t`],[`c`],[`l`,`x1`,`b`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`]]}]},accentcallout3:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 100000`],[`adj6`,`val -16667`],[`adj7`,`val 112963`],[`adj8`,`val -8333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`],[`y4`,`*/ h adj7 100000`],[`x4`,`*/ w adj8 100000`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`t`],[`c`],[`l`,`x1`,`b`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`],[`l`,`x4`,`y4`]]}]},actionbuttonbackprevious:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g11`,`vc`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g11`,`vc`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g11`,`vc`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonbeginning:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 1 8`],[`g15`,`*/ g13 1 4`],[`g16`,`+- g11 g14 0`],[`g17`,`+- g11 g15 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g17`,`vc`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`c`],[`m`,`g16`,`g9`],[`l`,`g11`,`g9`],[`l`,`g11`,`g10`],[`l`,`g16`,`g10`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g17`,`vc`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`c`],[`m`,`g16`,`g9`],[`l`,`g11`,`g9`],[`l`,`g11`,`g10`],[`l`,`g16`,`g10`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g17`,`vc`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`c`],[`m`,`g16`,`g9`],[`l`,`g16`,`g10`],[`l`,`g11`,`g10`],[`l`,`g11`,`g9`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonblank:{adj:[],gd:[],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttondocument:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`dx1`,`*/ ss 9 32`],[`g11`,`+- hc 0 dx1`],[`g12`,`+- hc dx1 0`],[`g13`,`*/ ss 3 16`],[`g14`,`+- g12 0 g13`],[`g15`,`+- g9 g13 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g11`,`g9`],[`l`,`g14`,`g9`],[`l`,`g12`,`g15`],[`l`,`g12`,`g10`],[`l`,`g11`,`g10`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g11`,`g9`],[`l`,`g14`,`g9`],[`l`,`g14`,`g15`],[`l`,`g12`,`g15`],[`l`,`g12`,`g10`],[`l`,`g11`,`g10`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g14`,`g9`],[`l`,`g14`,`g15`],[`l`,`g12`,`g15`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g11`,`g9`],[`l`,`g14`,`g9`],[`l`,`g12`,`g15`],[`l`,`g12`,`g10`],[`l`,`g11`,`g10`],[`c`],[`m`,`g12`,`g15`],[`l`,`g14`,`g15`],[`l`,`g14`,`g9`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonend:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 3 4`],[`g15`,`*/ g13 7 8`],[`g16`,`+- g11 g14 0`],[`g17`,`+- g11 g15 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g16`,`vc`],[`l`,`g11`,`g9`],[`l`,`g11`,`g10`],[`c`],[`m`,`g17`,`g9`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`l`,`g17`,`g10`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g16`,`vc`],[`l`,`g11`,`g9`],[`l`,`g11`,`g10`],[`c`],[`m`,`g17`,`g9`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`l`,`g17`,`g10`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g16`,`vc`],[`l`,`g11`,`g10`],[`l`,`g11`,`g9`],[`c`],[`m`,`g17`,`g9`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`l`,`g17`,`g10`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonforwardnext:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g12`,`vc`],[`l`,`g11`,`g9`],[`l`,`g11`,`g10`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g12`,`vc`],[`l`,`g11`,`g9`],[`l`,`g11`,`g10`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g12`,`vc`],[`l`,`g11`,`g10`],[`l`,`g11`,`g9`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonhelp:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g11`,`+- hc 0 dx2`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 1 7`],[`g15`,`*/ g13 3 14`],[`g16`,`*/ g13 2 7`],[`g19`,`*/ g13 3 7`],[`g20`,`*/ g13 4 7`],[`g21`,`*/ g13 17 28`],[`g23`,`*/ g13 21 28`],[`g24`,`*/ g13 11 14`],[`g27`,`+- g9 g16 0`],[`g29`,`+- g9 g21 0`],[`g30`,`+- g9 g23 0`],[`g31`,`+- g9 g24 0`],[`g33`,`+- g11 g15 0`],[`g36`,`+- g11 g19 0`],[`g37`,`+- g11 g20 0`],[`g41`,`*/ g13 1 14`],[`g42`,`*/ g13 3 28`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g33`,`g27`],[`a`,`g16`,`g16`,`cd2`,`cd2`],[`a`,`g14`,`g15`,`0`,`cd4`],[`a`,`g41`,`g42`,`3cd4`,`-5400000`],[`l`,`g37`,`g30`],[`l`,`g36`,`g30`],[`l`,`g36`,`g29`],[`a`,`g14`,`g15`,`cd2`,`cd4`],[`a`,`g41`,`g42`,`cd4`,`-5400000`],[`a`,`g14`,`g14`,`0`,`-10800000`],[`c`],[`m`,`hc`,`g31`],[`a`,`g42`,`g42`,`3cd4`,`21600000`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g33`,`g27`],[`a`,`g16`,`g16`,`cd2`,`cd2`],[`a`,`g14`,`g15`,`0`,`cd4`],[`a`,`g41`,`g42`,`3cd4`,`-5400000`],[`l`,`g37`,`g30`],[`l`,`g36`,`g30`],[`l`,`g36`,`g29`],[`a`,`g14`,`g15`,`cd2`,`cd4`],[`a`,`g41`,`g42`,`cd4`,`-5400000`],[`a`,`g14`,`g14`,`0`,`-10800000`],[`c`],[`m`,`hc`,`g31`],[`a`,`g42`,`g42`,`3cd4`,`21600000`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g33`,`g27`],[`a`,`g16`,`g16`,`cd2`,`cd2`],[`a`,`g14`,`g15`,`0`,`cd4`],[`a`,`g41`,`g42`,`3cd4`,`-5400000`],[`l`,`g37`,`g30`],[`l`,`g36`,`g30`],[`l`,`g36`,`g29`],[`a`,`g14`,`g15`,`cd2`,`cd4`],[`a`,`g41`,`g42`,`cd4`,`-5400000`],[`a`,`g14`,`g14`,`0`,`-10800000`],[`c`],[`m`,`hc`,`g31`],[`a`,`g42`,`g42`,`3cd4`,`21600000`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonhome:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 1 16`],[`g15`,`*/ g13 1 8`],[`g16`,`*/ g13 3 16`],[`g17`,`*/ g13 5 16`],[`g18`,`*/ g13 7 16`],[`g19`,`*/ g13 9 16`],[`g20`,`*/ g13 11 16`],[`g21`,`*/ g13 3 4`],[`g22`,`*/ g13 13 16`],[`g23`,`*/ g13 7 8`],[`g24`,`+- g9 g14 0`],[`g25`,`+- g9 g16 0`],[`g26`,`+- g9 g17 0`],[`g27`,`+- g9 g21 0`],[`g28`,`+- g11 g15 0`],[`g29`,`+- g11 g18 0`],[`g30`,`+- g11 g19 0`],[`g31`,`+- g11 g20 0`],[`g32`,`+- g11 g22 0`],[`g33`,`+- g11 g23 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`hc`,`g9`],[`l`,`g11`,`vc`],[`l`,`g28`,`vc`],[`l`,`g28`,`g10`],[`l`,`g33`,`g10`],[`l`,`g33`,`vc`],[`l`,`g12`,`vc`],[`l`,`g32`,`g26`],[`l`,`g32`,`g24`],[`l`,`g31`,`g24`],[`l`,`g31`,`g25`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g32`,`g26`],[`l`,`g32`,`g24`],[`l`,`g31`,`g24`],[`l`,`g31`,`g25`],[`c`],[`m`,`g28`,`vc`],[`l`,`g28`,`g10`],[`l`,`g29`,`g10`],[`l`,`g29`,`g27`],[`l`,`g30`,`g27`],[`l`,`g30`,`g10`],[`l`,`g33`,`g10`],[`l`,`g33`,`vc`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`hc`,`g9`],[`l`,`g11`,`vc`],[`l`,`g12`,`vc`],[`c`],[`m`,`g29`,`g27`],[`l`,`g30`,`g27`],[`l`,`g30`,`g10`],[`l`,`g29`,`g10`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`hc`,`g9`],[`l`,`g31`,`g25`],[`l`,`g31`,`g24`],[`l`,`g32`,`g24`],[`l`,`g32`,`g26`],[`l`,`g12`,`vc`],[`l`,`g33`,`vc`],[`l`,`g33`,`g10`],[`l`,`g28`,`g10`],[`l`,`g28`,`vc`],[`l`,`g11`,`vc`],[`c`],[`m`,`g31`,`g25`],[`l`,`g32`,`g26`],[`m`,`g33`,`vc`],[`l`,`g28`,`vc`],[`m`,`g29`,`g10`],[`l`,`g29`,`g27`],[`l`,`g30`,`g27`],[`l`,`g30`,`g10`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttoninformation:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g11`,`+- hc 0 dx2`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 1 32`],[`g17`,`*/ g13 5 16`],[`g18`,`*/ g13 3 8`],[`g19`,`*/ g13 13 32`],[`g20`,`*/ g13 19 32`],[`g22`,`*/ g13 11 16`],[`g23`,`*/ g13 13 16`],[`g24`,`*/ g13 7 8`],[`g25`,`+- g9 g14 0`],[`g28`,`+- g9 g17 0`],[`g29`,`+- g9 g18 0`],[`g30`,`+- g9 g23 0`],[`g31`,`+- g9 g24 0`],[`g32`,`+- g11 g17 0`],[`g34`,`+- g11 g19 0`],[`g35`,`+- g11 g20 0`],[`g37`,`+- g11 g22 0`],[`g38`,`*/ g13 3 32`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`hc`,`g9`],[`a`,`dx2`,`dx2`,`3cd4`,`21600000`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`hc`,`g9`],[`a`,`dx2`,`dx2`,`3cd4`,`21600000`],[`c`],[`m`,`hc`,`g25`],[`a`,`g38`,`g38`,`3cd4`,`21600000`],[`m`,`g32`,`g28`],[`l`,`g32`,`g29`],[`l`,`g34`,`g29`],[`l`,`g34`,`g30`],[`l`,`g32`,`g30`],[`l`,`g32`,`g31`],[`l`,`g37`,`g31`],[`l`,`g37`,`g30`],[`l`,`g35`,`g30`],[`l`,`g35`,`g28`],[`c`]]},{w:null,h:null,fill:`lighten`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`hc`,`g25`],[`a`,`g38`,`g38`,`3cd4`,`21600000`],[`m`,`g32`,`g28`],[`l`,`g35`,`g28`],[`l`,`g35`,`g30`],[`l`,`g37`,`g30`],[`l`,`g37`,`g31`],[`l`,`g32`,`g31`],[`l`,`g32`,`g30`],[`l`,`g34`,`g30`],[`l`,`g34`,`g29`],[`l`,`g32`,`g29`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`hc`,`g9`],[`a`,`dx2`,`dx2`,`3cd4`,`21600000`],[`c`],[`m`,`hc`,`g25`],[`a`,`g38`,`g38`,`3cd4`,`21600000`],[`m`,`g32`,`g28`],[`l`,`g35`,`g28`],[`l`,`g35`,`g30`],[`l`,`g37`,`g30`],[`l`,`g37`,`g31`],[`l`,`g32`,`g31`],[`l`,`g32`,`g30`],[`l`,`g34`,`g30`],[`l`,`g34`,`g29`],[`l`,`g32`,`g29`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonmovie:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 1455 21600`],[`g15`,`*/ g13 1905 21600`],[`g16`,`*/ g13 2325 21600`],[`g17`,`*/ g13 16155 21600`],[`g18`,`*/ g13 17010 21600`],[`g19`,`*/ g13 19335 21600`],[`g20`,`*/ g13 19725 21600`],[`g21`,`*/ g13 20595 21600`],[`g22`,`*/ g13 5280 21600`],[`g23`,`*/ g13 5730 21600`],[`g24`,`*/ g13 6630 21600`],[`g25`,`*/ g13 7492 21600`],[`g26`,`*/ g13 9067 21600`],[`g27`,`*/ g13 9555 21600`],[`g28`,`*/ g13 13342 21600`],[`g29`,`*/ g13 14580 21600`],[`g30`,`*/ g13 15592 21600`],[`g31`,`+- g11 g14 0`],[`g32`,`+- g11 g15 0`],[`g33`,`+- g11 g16 0`],[`g34`,`+- g11 g17 0`],[`g35`,`+- g11 g18 0`],[`g36`,`+- g11 g19 0`],[`g37`,`+- g11 g20 0`],[`g38`,`+- g11 g21 0`],[`g39`,`+- g9 g22 0`],[`g40`,`+- g9 g23 0`],[`g41`,`+- g9 g24 0`],[`g42`,`+- g9 g25 0`],[`g43`,`+- g9 g26 0`],[`g44`,`+- g9 g27 0`],[`g45`,`+- g9 g28 0`],[`g46`,`+- g9 g29 0`],[`g47`,`+- g9 g30 0`],[`g48`,`+- g9 g31 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g11`,`g39`],[`l`,`g11`,`g44`],[`l`,`g31`,`g44`],[`l`,`g32`,`g43`],[`l`,`g33`,`g43`],[`l`,`g33`,`g47`],[`l`,`g35`,`g47`],[`l`,`g35`,`g45`],[`l`,`g36`,`g45`],[`l`,`g38`,`g46`],[`l`,`g12`,`g46`],[`l`,`g12`,`g41`],[`l`,`g38`,`g41`],[`l`,`g37`,`g42`],[`l`,`g35`,`g42`],[`l`,`g35`,`g41`],[`l`,`g34`,`g40`],[`l`,`g32`,`g40`],[`l`,`g31`,`g39`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g11`,`g39`],[`l`,`g11`,`g44`],[`l`,`g31`,`g44`],[`l`,`g32`,`g43`],[`l`,`g33`,`g43`],[`l`,`g33`,`g47`],[`l`,`g35`,`g47`],[`l`,`g35`,`g45`],[`l`,`g36`,`g45`],[`l`,`g38`,`g46`],[`l`,`g12`,`g46`],[`l`,`g12`,`g41`],[`l`,`g38`,`g41`],[`l`,`g37`,`g42`],[`l`,`g35`,`g42`],[`l`,`g35`,`g41`],[`l`,`g34`,`g40`],[`l`,`g32`,`g40`],[`l`,`g31`,`g39`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g11`,`g39`],[`l`,`g31`,`g39`],[`l`,`g32`,`g40`],[`l`,`g34`,`g40`],[`l`,`g35`,`g41`],[`l`,`g35`,`g42`],[`l`,`g37`,`g42`],[`l`,`g38`,`g41`],[`l`,`g12`,`g41`],[`l`,`g12`,`g46`],[`l`,`g38`,`g46`],[`l`,`g36`,`g45`],[`l`,`g35`,`g45`],[`l`,`g35`,`g47`],[`l`,`g33`,`g47`],[`l`,`g33`,`g43`],[`l`,`g32`,`g43`],[`l`,`g31`,`g44`],[`l`,`g11`,`g44`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonreturn:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 7 8`],[`g15`,`*/ g13 3 4`],[`g16`,`*/ g13 5 8`],[`g17`,`*/ g13 3 8`],[`g18`,`*/ g13 1 4`],[`g19`,`+- g9 g15 0`],[`g20`,`+- g9 g16 0`],[`g21`,`+- g9 g18 0`],[`g22`,`+- g11 g14 0`],[`g23`,`+- g11 g15 0`],[`g24`,`+- g11 g16 0`],[`g25`,`+- g11 g17 0`],[`g26`,`+- g11 g18 0`],[`g27`,`*/ g13 1 8`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g12`,`g21`],[`l`,`g23`,`g9`],[`l`,`hc`,`g21`],[`l`,`g24`,`g21`],[`l`,`g24`,`g20`],[`a`,`g27`,`g27`,`0`,`cd4`],[`l`,`g25`,`g19`],[`a`,`g27`,`g27`,`cd4`,`cd4`],[`l`,`g26`,`g21`],[`l`,`g11`,`g21`],[`l`,`g11`,`g20`],[`a`,`g17`,`g17`,`cd2`,`-5400000`],[`l`,`hc`,`g10`],[`a`,`g17`,`g17`,`cd4`,`-5400000`],[`l`,`g22`,`g21`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g12`,`g21`],[`l`,`g23`,`g9`],[`l`,`hc`,`g21`],[`l`,`g24`,`g21`],[`l`,`g24`,`g20`],[`a`,`g27`,`g27`,`0`,`cd4`],[`l`,`g25`,`g19`],[`a`,`g27`,`g27`,`cd4`,`cd4`],[`l`,`g26`,`g21`],[`l`,`g11`,`g21`],[`l`,`g11`,`g20`],[`a`,`g17`,`g17`,`cd2`,`-5400000`],[`l`,`hc`,`g10`],[`a`,`g17`,`g17`,`cd4`,`-5400000`],[`l`,`g22`,`g21`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g12`,`g21`],[`l`,`g22`,`g21`],[`l`,`g22`,`g20`],[`a`,`g17`,`g17`,`0`,`cd4`],[`l`,`g25`,`g10`],[`a`,`g17`,`g17`,`cd4`,`cd4`],[`l`,`g11`,`g21`],[`l`,`g26`,`g21`],[`l`,`g26`,`g20`],[`a`,`g27`,`g27`,`cd2`,`-5400000`],[`l`,`hc`,`g19`],[`a`,`g27`,`g27`,`cd4`,`-5400000`],[`l`,`g24`,`g21`],[`l`,`hc`,`g21`],[`l`,`g23`,`g9`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonsound:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 1 8`],[`g15`,`*/ g13 5 16`],[`g16`,`*/ g13 5 8`],[`g17`,`*/ g13 11 16`],[`g18`,`*/ g13 3 4`],[`g19`,`*/ g13 7 8`],[`g20`,`+- g9 g14 0`],[`g21`,`+- g9 g15 0`],[`g22`,`+- g9 g17 0`],[`g23`,`+- g9 g19 0`],[`g24`,`+- g11 g15 0`],[`g25`,`+- g11 g16 0`],[`g26`,`+- g11 g18 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g11`,`g21`],[`l`,`g11`,`g22`],[`l`,`g24`,`g22`],[`l`,`g25`,`g10`],[`l`,`g25`,`g9`],[`l`,`g24`,`g21`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g11`,`g21`],[`l`,`g11`,`g22`],[`l`,`g24`,`g22`],[`l`,`g25`,`g10`],[`l`,`g25`,`g9`],[`l`,`g24`,`g21`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g11`,`g21`],[`l`,`g24`,`g21`],[`l`,`g25`,`g9`],[`l`,`g25`,`g10`],[`l`,`g24`,`g22`],[`l`,`g11`,`g22`],[`c`],[`m`,`g26`,`g21`],[`l`,`g12`,`g20`],[`m`,`g26`,`vc`],[`l`,`g12`,`vc`],[`m`,`g26`,`g22`],[`l`,`g12`,`g23`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},arc:{adj:[[`adj1`,`val 16200000`],[`adj2`,`val 0`]],gd:[[`stAng`,`pin 0 adj1 21599999`],[`enAng`,`pin 0 adj2 21599999`],[`sw11`,`+- enAng 0 stAng`],[`sw12`,`+- sw11 21600000 0`],[`swAng`,`?: sw11 sw11 sw12`],[`wt1`,`sin wd2 stAng`],[`ht1`,`cos hd2 stAng`],[`dx1`,`cat2 wd2 ht1 wt1`],[`dy1`,`sat2 hd2 ht1 wt1`],[`wt2`,`sin wd2 enAng`],[`ht2`,`cos hd2 enAng`],[`dx2`,`cat2 wd2 ht2 wt2`],[`dy2`,`sat2 hd2 ht2 wt2`],[`x1`,`+- hc dx1 0`],[`y1`,`+- vc dy1 0`],[`x2`,`+- hc dx2 0`],[`y2`,`+- vc dy2 0`],[`sw0`,`+- 21600000 0 stAng`],[`da1`,`+- swAng 0 sw0`],[`g1`,`max x1 x2`],[`ir`,`?: da1 r g1`],[`sw1`,`+- cd4 0 stAng`],[`sw2`,`+- 27000000 0 stAng`],[`sw3`,`?: sw1 sw1 sw2`],[`da2`,`+- swAng 0 sw3`],[`g5`,`max y1 y2`],[`ib`,`?: da2 b g5`],[`sw4`,`+- cd2 0 stAng`],[`sw5`,`+- 32400000 0 stAng`],[`sw6`,`?: sw4 sw4 sw5`],[`da3`,`+- swAng 0 sw6`],[`g9`,`min x1 x2`],[`il`,`?: da3 l g9`],[`sw7`,`+- 3cd4 0 stAng`],[`sw8`,`+- 37800000 0 stAng`],[`sw9`,`?: sw7 sw7 sw8`],[`da4`,`+- swAng 0 sw9`],[`g13`,`min y1 y2`],[`it`,`?: da4 t g13`],[`cang1`,`+- stAng 0 cd4`],[`cang2`,`+- enAng cd4 0`],[`cang3`,`+/ cang1 cang2 2`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`a`,`wd2`,`hd2`,`stAng`,`swAng`],[`l`,`hc`,`vc`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`a`,`wd2`,`hd2`,`stAng`,`swAng`]]}]},bentarrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 43750`]],gd:[[`a2`,`pin 0 adj2 50000`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`a3`,`pin 0 adj3 50000`],[`th`,`*/ ss a1 100000`],[`aw2`,`*/ ss a2 100000`],[`th2`,`*/ th 1 2`],[`dh2`,`+- aw2 0 th2`],[`ah`,`*/ ss a3 100000`],[`bw`,`+- r 0 ah`],[`bh`,`+- b 0 dh2`],[`bs`,`min bw bh`],[`maxAdj4`,`*/ 100000 bs ss`],[`a4`,`pin 0 adj4 maxAdj4`],[`bd`,`*/ ss a4 100000`],[`bd3`,`+- bd 0 th`],[`bd2`,`max bd3 0`],[`x3`,`+- th bd2 0`],[`x4`,`+- r 0 ah`],[`y3`,`+- dh2 th 0`],[`y4`,`+- y3 dh2 0`],[`y5`,`+- dh2 bd 0`],[`y6`,`+- y3 bd2 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`l`,`y5`],[`a`,`bd`,`bd`,`cd2`,`cd4`],[`l`,`x4`,`dh2`],[`l`,`x4`,`t`],[`l`,`r`,`aw2`],[`l`,`x4`,`y4`],[`l`,`x4`,`y3`],[`l`,`x3`,`y3`],[`a`,`bd2`,`bd2`,`3cd4`,`-5400000`],[`l`,`th`,`b`],[`c`]]}]},bentconnector2:{adj:[],gd:[],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`]]}]},bentconnector3:{adj:[[`adj1`,`val 50000`]],gd:[[`x1`,`*/ w adj1 100000`]],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`l`,`x1`,`b`],[`l`,`r`,`b`]]}]},bentconnector4:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`x1`,`*/ w adj1 100000`],[`x2`,`+/ x1 r 2`],[`y2`,`*/ h adj2 100000`],[`y1`,`+/ t y2 2`]],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`l`,`x1`,`y2`],[`l`,`r`,`y2`],[`l`,`r`,`b`]]}]},bentconnector5:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`],[`adj3`,`val 50000`]],gd:[[`x1`,`*/ w adj1 100000`],[`x3`,`*/ w adj3 100000`],[`x2`,`+/ x1 x3 2`],[`y2`,`*/ h adj2 100000`],[`y1`,`+/ t y2 2`],[`y3`,`+/ b y2 2`]],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`l`,`x1`,`y2`],[`l`,`x3`,`y2`],[`l`,`x3`,`b`],[`l`,`r`,`b`]]}]},bentuparrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`]],gd:[[`a1`,`pin 0 adj1 50000`],[`a2`,`pin 0 adj2 50000`],[`a3`,`pin 0 adj3 50000`],[`y1`,`*/ ss a3 100000`],[`dx1`,`*/ ss a2 50000`],[`x1`,`+- r 0 dx1`],[`dx3`,`*/ ss a2 100000`],[`x3`,`+- r 0 dx3`],[`dx2`,`*/ ss a1 200000`],[`x2`,`+- x3 0 dx2`],[`x4`,`+- x3 dx2 0`],[`dy2`,`*/ ss a1 100000`],[`y2`,`+- b 0 dy2`],[`x0`,`*/ x4 1 2`],[`y3`,`+/ y2 b 2`],[`y15`,`+/ y1 b 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`y1`],[`l`,`x1`,`y1`],[`l`,`x3`,`t`],[`l`,`r`,`y1`],[`l`,`x4`,`y1`],[`l`,`x4`,`b`],[`l`,`l`,`b`],[`c`]]}]},bevel:{adj:[[`adj`,`val 12500`]],gd:[[`a`,`pin 0 adj 50000`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`y2`,`+- b 0 x1`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x1`,`x1`],[`l`,`x2`,`x1`],[`l`,`x2`,`y2`],[`l`,`x1`,`y2`],[`c`]]},{w:null,h:null,fill:`lightenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`x2`,`x1`],[`l`,`x1`,`x1`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`b`],[`l`,`x1`,`y2`],[`l`,`x2`,`y2`],[`l`,`r`,`b`],[`c`]]},{w:null,h:null,fill:`lighten`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`x1`],[`l`,`x1`,`y2`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`r`,`t`],[`l`,`r`,`b`],[`l`,`x2`,`y2`],[`l`,`x2`,`x1`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`x1`,`x1`],[`l`,`x2`,`x1`],[`l`,`x2`,`y2`],[`l`,`x1`,`y2`],[`c`],[`m`,`l`,`t`],[`l`,`x1`,`x1`],[`m`,`l`,`b`],[`l`,`x1`,`y2`],[`m`,`r`,`t`],[`l`,`x2`,`x1`],[`m`,`r`,`b`],[`l`,`x2`,`y2`]]}]},blockarc:{adj:[[`adj1`,`val 10800000`],[`adj2`,`val 0`],[`adj3`,`val 25000`]],gd:[[`stAng`,`pin 0 adj1 21599999`],[`istAng`,`pin 0 adj2 21599999`],[`a3`,`pin 0 adj3 50000`],[`sw11`,`+- istAng 0 stAng`],[`sw12`,`+- sw11 21600000 0`],[`swAng`,`?: sw11 sw11 sw12`],[`iswAng`,`+- 0 0 swAng`],[`wt1`,`sin wd2 stAng`],[`ht1`,`cos hd2 stAng`],[`wt3`,`sin wd2 istAng`],[`ht3`,`cos hd2 istAng`],[`dx1`,`cat2 wd2 ht1 wt1`],[`dy1`,`sat2 hd2 ht1 wt1`],[`dx3`,`cat2 wd2 ht3 wt3`],[`dy3`,`sat2 hd2 ht3 wt3`],[`x1`,`+- hc dx1 0`],[`y1`,`+- vc dy1 0`],[`x3`,`+- hc dx3 0`],[`y3`,`+- vc dy3 0`],[`dr`,`*/ ss a3 100000`],[`iwd2`,`+- wd2 0 dr`],[`ihd2`,`+- hd2 0 dr`],[`wt2`,`sin iwd2 istAng`],[`ht2`,`cos ihd2 istAng`],[`wt4`,`sin iwd2 stAng`],[`ht4`,`cos ihd2 stAng`],[`dx2`,`cat2 iwd2 ht2 wt2`],[`dy2`,`sat2 ihd2 ht2 wt2`],[`dx4`,`cat2 iwd2 ht4 wt4`],[`dy4`,`sat2 ihd2 ht4 wt4`],[`x2`,`+- hc dx2 0`],[`y2`,`+- vc dy2 0`],[`x4`,`+- hc dx4 0`],[`y4`,`+- vc dy4 0`],[`sw0`,`+- 21600000 0 stAng`],[`da1`,`+- swAng 0 sw0`],[`g1`,`max x1 x2`],[`g2`,`max x3 x4`],[`g3`,`max g1 g2`],[`ir`,`?: da1 r g3`],[`sw1`,`+- cd4 0 stAng`],[`sw2`,`+- 27000000 0 stAng`],[`sw3`,`?: sw1 sw1 sw2`],[`da2`,`+- swAng 0 sw3`],[`g5`,`max y1 y2`],[`g6`,`max y3 y4`],[`g7`,`max g5 g6`],[`ib`,`?: da2 b g7`],[`sw4`,`+- cd2 0 stAng`],[`sw5`,`+- 32400000 0 stAng`],[`sw6`,`?: sw4 sw4 sw5`],[`da3`,`+- swAng 0 sw6`],[`g9`,`min x1 x2`],[`g10`,`min x3 x4`],[`g11`,`min g9 g10`],[`il`,`?: da3 l g11`],[`sw7`,`+- 3cd4 0 stAng`],[`sw8`,`+- 37800000 0 stAng`],[`sw9`,`?: sw7 sw7 sw8`],[`da4`,`+- swAng 0 sw9`],[`g13`,`min y1 y2`],[`g14`,`min y3 y4`],[`g15`,`min g13 g14`],[`it`,`?: da4 t g15`],[`x5`,`+/ x1 x4 2`],[`y5`,`+/ y1 y4 2`],[`x6`,`+/ x3 x2 2`],[`y6`,`+/ y3 y2 2`],[`cang1`,`+- stAng 0 cd4`],[`cang2`,`+- istAng cd4 0`],[`cang3`,`+/ cang1 cang2 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`a`,`wd2`,`hd2`,`stAng`,`swAng`],[`l`,`x2`,`y2`],[`a`,`iwd2`,`ihd2`,`istAng`,`iswAng`],[`c`]]}]},bordercallout1:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 112500`],[`adj4`,`val -38333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`]]}]},bordercallout2:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 112500`],[`adj6`,`val -46667`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`]]}]},bordercallout3:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 100000`],[`adj6`,`val -16667`],[`adj7`,`val 112963`],[`adj8`,`val -8333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`],[`y4`,`*/ h adj7 100000`],[`x4`,`*/ w adj8 100000`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`],[`l`,`x4`,`y4`]]}]},bracepair:{adj:[[`adj`,`val 8333`]],gd:[[`a`,`pin 0 adj 25000`],[`x1`,`*/ ss a 100000`],[`x2`,`*/ ss a 50000`],[`x3`,`+- r 0 x2`],[`x4`,`+- r 0 x1`],[`y2`,`+- vc 0 x1`],[`y3`,`+- vc x1 0`],[`y4`,`+- b 0 x1`],[`it`,`*/ x1 29289 100000`],[`il`,`+- x1 it 0`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 it`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x2`,`b`],[`a`,`x1`,`x1`,`cd4`,`cd4`],[`l`,`x1`,`y3`],[`a`,`x1`,`x1`,`0`,`-5400000`],[`a`,`x1`,`x1`,`cd4`,`-5400000`],[`l`,`x1`,`x1`],[`a`,`x1`,`x1`,`cd2`,`cd4`],[`l`,`x3`,`t`],[`a`,`x1`,`x1`,`3cd4`,`cd4`],[`l`,`x4`,`y2`],[`a`,`x1`,`x1`,`cd2`,`-5400000`],[`a`,`x1`,`x1`,`3cd4`,`-5400000`],[`l`,`x4`,`y4`],[`a`,`x1`,`x1`,`0`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x2`,`b`],[`a`,`x1`,`x1`,`cd4`,`cd4`],[`l`,`x1`,`y3`],[`a`,`x1`,`x1`,`0`,`-5400000`],[`a`,`x1`,`x1`,`cd4`,`-5400000`],[`l`,`x1`,`x1`],[`a`,`x1`,`x1`,`cd2`,`cd4`],[`m`,`x3`,`t`],[`a`,`x1`,`x1`,`3cd4`,`cd4`],[`l`,`x4`,`y2`],[`a`,`x1`,`x1`,`cd2`,`-5400000`],[`a`,`x1`,`x1`,`3cd4`,`-5400000`],[`l`,`x4`,`y4`],[`a`,`x1`,`x1`,`0`,`cd4`]]}]},bracketpair:{adj:[[`adj`,`val 16667`]],gd:[[`a`,`pin 0 adj 50000`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`y2`,`+- b 0 x1`],[`il`,`*/ x1 29289 100000`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`x1`],[`a`,`x1`,`x1`,`cd2`,`cd4`],[`l`,`x2`,`t`],[`a`,`x1`,`x1`,`3cd4`,`cd4`],[`l`,`r`,`y2`],[`a`,`x1`,`x1`,`0`,`cd4`],[`l`,`x1`,`b`],[`a`,`x1`,`x1`,`cd4`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`b`],[`a`,`x1`,`x1`,`cd4`,`cd4`],[`l`,`l`,`x1`],[`a`,`x1`,`x1`,`cd2`,`cd4`],[`m`,`x2`,`t`],[`a`,`x1`,`x1`,`3cd4`,`cd4`],[`l`,`r`,`y2`],[`a`,`x1`,`x1`,`0`,`cd4`]]}]},callout1:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 112500`],[`adj4`,`val -38333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`]]}]},callout2:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 112500`],[`adj6`,`val -46667`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`]]}]},callout3:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 100000`],[`adj6`,`val -16667`],[`adj7`,`val 112963`],[`adj8`,`val -8333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`],[`y4`,`*/ h adj7 100000`],[`x4`,`*/ w adj8 100000`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`],[`l`,`x4`,`y4`]]}]},can:{adj:[[`adj`,`val 25000`]],gd:[[`maxAdj`,`*/ 50000 h ss`],[`a`,`pin 0 adj maxAdj`],[`y1`,`*/ ss a 200000`],[`y2`,`+- y1 y1 0`],[`y3`,`+- b 0 y1`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`y1`],[`a`,`wd2`,`y1`,`cd2`,`-10800000`],[`l`,`r`,`y3`],[`a`,`wd2`,`y1`,`0`,`cd2`],[`c`]]},{w:null,h:null,fill:`lighten`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`y1`],[`a`,`wd2`,`y1`,`cd2`,`cd2`],[`a`,`wd2`,`y1`,`0`,`cd2`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`r`,`y1`],[`a`,`wd2`,`y1`,`0`,`cd2`],[`a`,`wd2`,`y1`,`cd2`,`cd2`],[`l`,`r`,`y3`],[`a`,`wd2`,`y1`,`0`,`cd2`],[`l`,`l`,`y1`]]}]},chartplus:{adj:[],gd:[],paths:[{w:10,h:10,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`5`,`0`],[`l`,`5`,`10`],[`m`,`0`,`5`],[`l`,`10`,`5`]]},{w:10,h:10,fill:null,stroke:!1,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`0`,`10`],[`l`,`10`,`10`],[`l`,`10`,`0`],[`c`]]}]},chartstar:{adj:[],gd:[],paths:[{w:10,h:10,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`0`,`0`],[`l`,`10`,`10`],[`m`,`0`,`10`],[`l`,`10`,`0`],[`m`,`5`,`0`],[`l`,`5`,`10`]]},{w:10,h:10,fill:null,stroke:!1,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`0`,`10`],[`l`,`10`,`10`],[`l`,`10`,`0`],[`c`]]}]},chartx:{adj:[],gd:[],paths:[{w:10,h:10,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`0`,`0`],[`l`,`10`,`10`],[`m`,`0`,`10`],[`l`,`10`,`0`]]},{w:10,h:10,fill:null,stroke:!1,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`0`,`10`],[`l`,`10`,`10`],[`l`,`10`,`0`],[`c`]]}]},chevron:{adj:[[`adj`,`val 50000`]],gd:[[`maxAdj`,`*/ 100000 w ss`],[`a`,`pin 0 adj maxAdj`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`x3`,`*/ x2 1 2`],[`dx`,`+- x2 0 x1`],[`il`,`?: dx x1 l`],[`ir`,`?: dx x2 r`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x2`,`t`],[`l`,`r`,`vc`],[`l`,`x2`,`b`],[`l`,`l`,`b`],[`l`,`x1`,`vc`],[`c`]]}]},chord:{adj:[[`adj1`,`val 2700000`],[`adj2`,`val 16200000`]],gd:[[`stAng`,`pin 0 adj1 21599999`],[`enAng`,`pin 0 adj2 21599999`],[`sw1`,`+- enAng 0 stAng`],[`sw2`,`+- sw1 21600000 0`],[`swAng`,`?: sw1 sw1 sw2`],[`wt1`,`sin wd2 stAng`],[`ht1`,`cos hd2 stAng`],[`dx1`,`cat2 wd2 ht1 wt1`],[`dy1`,`sat2 hd2 ht1 wt1`],[`wt2`,`sin wd2 enAng`],[`ht2`,`cos hd2 enAng`],[`dx2`,`cat2 wd2 ht2 wt2`],[`dy2`,`sat2 hd2 ht2 wt2`],[`x1`,`+- hc dx1 0`],[`y1`,`+- vc dy1 0`],[`x2`,`+- hc dx2 0`],[`y2`,`+- vc dy2 0`],[`x3`,`+/ x1 x2 2`],[`y3`,`+/ y1 y2 2`],[`midAng0`,`*/ swAng 1 2`],[`midAng`,`+- stAng midAng0 cd2`],[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`a`,`wd2`,`hd2`,`stAng`,`swAng`],[`c`]]}]},circulararrow:{adj:[[`adj1`,`val 12500`],[`adj2`,`val 1142319`],[`adj3`,`val 20457681`],[`adj4`,`val 10800000`],[`adj5`,`val 12500`]],gd:[[`a5`,`pin 0 adj5 25000`],[`maxAdj1`,`*/ a5 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`enAng`,`pin 1 adj3 21599999`],[`stAng`,`pin 0 adj4 21599999`],[`th`,`*/ ss a1 100000`],[`thh`,`*/ ss a5 100000`],[`th2`,`*/ th 1 2`],[`rw1`,`+- wd2 th2 thh`],[`rh1`,`+- hd2 th2 thh`],[`rw2`,`+- rw1 0 th`],[`rh2`,`+- rh1 0 th`],[`rw3`,`+- rw2 th2 0`],[`rh3`,`+- rh2 th2 0`],[`wtH`,`sin rw3 enAng`],[`htH`,`cos rh3 enAng`],[`dxH`,`cat2 rw3 htH wtH`],[`dyH`,`sat2 rh3 htH wtH`],[`xH`,`+- hc dxH 0`],[`yH`,`+- vc dyH 0`],[`rI`,`min rw2 rh2`],[`u1`,`*/ dxH dxH 1`],[`u2`,`*/ dyH dyH 1`],[`u3`,`*/ rI rI 1`],[`u4`,`+- u1 0 u3`],[`u5`,`+- u2 0 u3`],[`u6`,`*/ u4 u5 u1`],[`u7`,`*/ u6 1 u2`],[`u8`,`+- 1 0 u7`],[`u9`,`sqrt u8`],[`u10`,`*/ u4 1 dxH`],[`u11`,`*/ u10 1 dyH`],[`u12`,`+/ 1 u9 u11`],[`u13`,`at2 1 u12`],[`u14`,`+- u13 21600000 0`],[`u15`,`?: u13 u13 u14`],[`u16`,`+- u15 0 enAng`],[`u17`,`+- u16 21600000 0`],[`u18`,`?: u16 u16 u17`],[`u19`,`+- u18 0 cd2`],[`u20`,`+- u18 0 21600000`],[`u21`,`?: u19 u20 u18`],[`maxAng`,`abs u21`],[`aAng`,`pin 0 adj2 maxAng`],[`ptAng`,`+- enAng aAng 0`],[`wtA`,`sin rw3 ptAng`],[`htA`,`cos rh3 ptAng`],[`dxA`,`cat2 rw3 htA wtA`],[`dyA`,`sat2 rh3 htA wtA`],[`xA`,`+- hc dxA 0`],[`yA`,`+- vc dyA 0`],[`wtE`,`sin rw1 stAng`],[`htE`,`cos rh1 stAng`],[`dxE`,`cat2 rw1 htE wtE`],[`dyE`,`sat2 rh1 htE wtE`],[`xE`,`+- hc dxE 0`],[`yE`,`+- vc dyE 0`],[`dxG`,`cos thh ptAng`],[`dyG`,`sin thh ptAng`],[`xG`,`+- xH dxG 0`],[`yG`,`+- yH dyG 0`],[`dxB`,`cos thh ptAng`],[`dyB`,`sin thh ptAng`],[`xB`,`+- xH 0 dxB 0`],[`yB`,`+- yH 0 dyB 0`],[`sx1`,`+- xB 0 hc`],[`sy1`,`+- yB 0 vc`],[`sx2`,`+- xG 0 hc`],[`sy2`,`+- yG 0 vc`],[`rO`,`min rw1 rh1`],[`x1O`,`*/ sx1 rO rw1`],[`y1O`,`*/ sy1 rO rh1`],[`x2O`,`*/ sx2 rO rw1`],[`y2O`,`*/ sy2 rO rh1`],[`dxO`,`+- x2O 0 x1O`],[`dyO`,`+- y2O 0 y1O`],[`dO`,`mod dxO dyO 0`],[`q1`,`*/ x1O y2O 1`],[`q2`,`*/ x2O y1O 1`],[`DO`,`+- q1 0 q2`],[`q3`,`*/ rO rO 1`],[`q4`,`*/ dO dO 1`],[`q5`,`*/ q3 q4 1`],[`q6`,`*/ DO DO 1`],[`q7`,`+- q5 0 q6`],[`q8`,`max q7 0`],[`sdelO`,`sqrt q8`],[`ndyO`,`*/ dyO -1 1`],[`sdyO`,`?: ndyO -1 1`],[`q9`,`*/ sdyO dxO 1`],[`q10`,`*/ q9 sdelO 1`],[`q11`,`*/ DO dyO 1`],[`dxF1`,`+/ q11 q10 q4`],[`q12`,`+- q11 0 q10`],[`dxF2`,`*/ q12 1 q4`],[`adyO`,`abs dyO`],[`q13`,`*/ adyO sdelO 1`],[`q14`,`*/ DO dxO -1`],[`dyF1`,`+/ q14 q13 q4`],[`q15`,`+- q14 0 q13`],[`dyF2`,`*/ q15 1 q4`],[`q16`,`+- x2O 0 dxF1`],[`q17`,`+- x2O 0 dxF2`],[`q18`,`+- y2O 0 dyF1`],[`q19`,`+- y2O 0 dyF2`],[`q20`,`mod q16 q18 0`],[`q21`,`mod q17 q19 0`],[`q22`,`+- q21 0 q20`],[`dxF`,`?: q22 dxF1 dxF2`],[`dyF`,`?: q22 dyF1 dyF2`],[`sdxF`,`*/ dxF rw1 rO`],[`sdyF`,`*/ dyF rh1 rO`],[`xF`,`+- hc sdxF 0`],[`yF`,`+- vc sdyF 0`],[`x1I`,`*/ sx1 rI rw2`],[`y1I`,`*/ sy1 rI rh2`],[`x2I`,`*/ sx2 rI rw2`],[`y2I`,`*/ sy2 rI rh2`],[`dxI`,`+- x2I 0 x1I`],[`dyI`,`+- y2I 0 y1I`],[`dI`,`mod dxI dyI 0`],[`v1`,`*/ x1I y2I 1`],[`v2`,`*/ x2I y1I 1`],[`DI`,`+- v1 0 v2`],[`v3`,`*/ rI rI 1`],[`v4`,`*/ dI dI 1`],[`v5`,`*/ v3 v4 1`],[`v6`,`*/ DI DI 1`],[`v7`,`+- v5 0 v6`],[`v8`,`max v7 0`],[`sdelI`,`sqrt v8`],[`v9`,`*/ sdyO dxI 1`],[`v10`,`*/ v9 sdelI 1`],[`v11`,`*/ DI dyI 1`],[`dxC1`,`+/ v11 v10 v4`],[`v12`,`+- v11 0 v10`],[`dxC2`,`*/ v12 1 v4`],[`adyI`,`abs dyI`],[`v13`,`*/ adyI sdelI 1`],[`v14`,`*/ DI dxI -1`],[`dyC1`,`+/ v14 v13 v4`],[`v15`,`+- v14 0 v13`],[`dyC2`,`*/ v15 1 v4`],[`v16`,`+- x1I 0 dxC1`],[`v17`,`+- x1I 0 dxC2`],[`v18`,`+- y1I 0 dyC1`],[`v19`,`+- y1I 0 dyC2`],[`v20`,`mod v16 v18 0`],[`v21`,`mod v17 v19 0`],[`v22`,`+- v21 0 v20`],[`dxC`,`?: v22 dxC1 dxC2`],[`dyC`,`?: v22 dyC1 dyC2`],[`sdxC`,`*/ dxC rw2 rI`],[`sdyC`,`*/ dyC rh2 rI`],[`xC`,`+- hc sdxC 0`],[`yC`,`+- vc sdyC 0`],[`ist0`,`at2 sdxC sdyC`],[`ist1`,`+- ist0 21600000 0`],[`istAng`,`?: ist0 ist0 ist1`],[`isw1`,`+- stAng 0 istAng`],[`isw2`,`+- isw1 0 21600000`],[`iswAng`,`?: isw1 isw2 isw1`],[`p1`,`+- xF 0 xC`],[`p2`,`+- yF 0 yC`],[`p3`,`mod p1 p2 0`],[`p4`,`*/ p3 1 2`],[`p5`,`+- p4 0 thh`],[`xGp`,`?: p5 xF xG`],[`yGp`,`?: p5 yF yG`],[`xBp`,`?: p5 xC xB`],[`yBp`,`?: p5 yC yB`],[`en0`,`at2 sdxF sdyF`],[`en1`,`+- en0 21600000 0`],[`en2`,`?: en0 en0 en1`],[`sw0`,`+- en2 0 stAng`],[`sw1`,`+- sw0 21600000 0`],[`swAng`,`?: sw0 sw0 sw1`],[`wtI`,`sin rw3 stAng`],[`htI`,`cos rh3 stAng`],[`dxI`,`cat2 rw3 htI wtI`],[`dyI`,`sat2 rh3 htI wtI`],[`xI`,`+- hc dxI 0`],[`yI`,`+- vc dyI 0`],[`aI`,`+- stAng 0 cd4`],[`aA`,`+- ptAng cd4 0`],[`aB`,`+- ptAng cd2 0`],[`idx`,`cos rw1 2700000`],[`idy`,`sin rh1 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`xE`,`yE`],[`a`,`rw1`,`rh1`,`stAng`,`swAng`],[`l`,`xGp`,`yGp`],[`l`,`xA`,`yA`],[`l`,`xBp`,`yBp`],[`l`,`xC`,`yC`],[`a`,`rw2`,`rh2`,`istAng`,`iswAng`],[`c`]]}]},cloud:{adj:[],gd:[[`il`,`*/ w 2977 21600`],[`it`,`*/ h 3262 21600`],[`ir`,`*/ w 17087 21600`],[`ib`,`*/ h 17337 21600`],[`g27`,`*/ w 67 21600`],[`g28`,`*/ h 21577 21600`],[`g29`,`*/ w 21582 21600`],[`g30`,`*/ h 1235 21600`]],paths:[{w:43200,h:43200,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`3900`,`14370`],[`a`,`6753`,`9190`,`-11429249`,`7426832`],[`a`,`5333`,`7267`,`-8646143`,`5396714`],[`a`,`4365`,`5945`,`-8748475`,`5983381`],[`a`,`4857`,`6595`,`-7859164`,`7034504`],[`a`,`5333`,`7273`,`-4722533`,`6541615`],[`a`,`6775`,`9220`,`-2776035`,`7816140`],[`a`,`5785`,`7867`,`37501`,`6842000`],[`a`,`6752`,`9215`,`1347096`,`6910353`],[`a`,`7720`,`10543`,`3974558`,`4542661`],[`a`,`4360`,`5918`,`-16496525`,`8804134`],[`a`,`4345`,`5945`,`-14809710`,`9151131`],[`c`]]},{w:43200,h:43200,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`4693`,`26177`],[`a`,`4345`,`5945`,`5204520`,`1585770`],[`m`,`6928`,`34899`],[`a`,`4360`,`5918`,`4416628`,`686848`],[`m`,`16478`,`39090`],[`a`,`6752`,`9215`,`8257449`,`844866`],[`m`,`28827`,`34751`],[`a`,`6752`,`9215`,`387196`,`959901`],[`m`,`34129`,`22954`],[`a`,`5785`,`7867`,`-4217541`,`4255042`],[`m`,`41798`,`15354`],[`a`,`5333`,`7273`,`1819082`,`1665090`],[`m`,`38324`,`5426`],[`a`,`4857`,`6595`,`-824660`,`891534`],[`m`,`29078`,`3952`],[`a`,`4857`,`6595`,`-8950887`,`1091722`],[`m`,`22141`,`4720`],[`a`,`4365`,`5945`,`-9809656`,`1061181`],[`m`,`14000`,`5192`],[`a`,`6753`,`9190`,`-4002417`,`739161`],[`m`,`4127`,`15789`],[`a`,`6753`,`9190`,`9459261`,`711490`]]}]},cloudcallout:{adj:[[`adj1`,`val -20833`],[`adj2`,`val 62500`]],gd:[[`dxPos`,`*/ w adj1 100000`],[`dyPos`,`*/ h adj2 100000`],[`xPos`,`+- hc dxPos 0`],[`yPos`,`+- vc dyPos 0`],[`ht`,`cat2 hd2 dxPos dyPos`],[`wt`,`sat2 wd2 dxPos dyPos`],[`g2`,`cat2 wd2 ht wt`],[`g3`,`sat2 hd2 ht wt`],[`g4`,`+- hc g2 0`],[`g5`,`+- vc g3 0`],[`g6`,`+- g4 0 xPos`],[`g7`,`+- g5 0 yPos`],[`g8`,`mod g6 g7 0`],[`g9`,`*/ ss 6600 21600`],[`g10`,`+- g8 0 g9`],[`g11`,`*/ g10 1 3`],[`g12`,`*/ ss 1800 21600`],[`g13`,`+- g11 g12 0`],[`g14`,`*/ g13 g6 g8`],[`g15`,`*/ g13 g7 g8`],[`g16`,`+- g14 xPos 0`],[`g17`,`+- g15 yPos 0`],[`g18`,`*/ ss 4800 21600`],[`g19`,`*/ g11 2 1`],[`g20`,`+- g18 g19 0`],[`g21`,`*/ g20 g6 g8`],[`g22`,`*/ g20 g7 g8`],[`g23`,`+- g21 xPos 0`],[`g24`,`+- g22 yPos 0`],[`g25`,`*/ ss 1200 21600`],[`g26`,`*/ ss 600 21600`],[`x23`,`+- xPos g26 0`],[`x24`,`+- g16 g25 0`],[`x25`,`+- g23 g12 0`],[`il`,`*/ w 2977 21600`],[`it`,`*/ h 3262 21600`],[`ir`,`*/ w 17087 21600`],[`ib`,`*/ h 17337 21600`],[`g27`,`*/ w 67 21600`],[`g28`,`*/ h 21577 21600`],[`g29`,`*/ w 21582 21600`],[`g30`,`*/ h 1235 21600`],[`pang`,`at2 dxPos dyPos`]],paths:[{w:43200,h:43200,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`3900`,`14370`],[`a`,`6753`,`9190`,`-11429249`,`7426832`],[`a`,`5333`,`7267`,`-8646143`,`5396714`],[`a`,`4365`,`5945`,`-8748475`,`5983381`],[`a`,`4857`,`6595`,`-7859164`,`7034504`],[`a`,`5333`,`7273`,`-4722533`,`6541615`],[`a`,`6775`,`9220`,`-2776035`,`7816140`],[`a`,`5785`,`7867`,`37501`,`6842000`],[`a`,`6752`,`9215`,`1347096`,`6910353`],[`a`,`7720`,`10543`,`3974558`,`4542661`],[`a`,`4360`,`5918`,`-16496525`,`8804134`],[`a`,`4345`,`5945`,`-14809710`,`9151131`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x23`,`yPos`],[`a`,`g26`,`g26`,`0`,`21600000`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x24`,`g17`],[`a`,`g25`,`g25`,`0`,`21600000`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x25`,`g24`],[`a`,`g12`,`g12`,`0`,`21600000`],[`c`]]},{w:43200,h:43200,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`4693`,`26177`],[`a`,`4345`,`5945`,`5204520`,`1585770`],[`m`,`6928`,`34899`],[`a`,`4360`,`5918`,`4416628`,`686848`],[`m`,`16478`,`39090`],[`a`,`6752`,`9215`,`8257449`,`844866`],[`m`,`28827`,`34751`],[`a`,`6752`,`9215`,`387196`,`959901`],[`m`,`34129`,`22954`],[`a`,`5785`,`7867`,`-4217541`,`4255042`],[`m`,`41798`,`15354`],[`a`,`5333`,`7273`,`1819082`,`1665090`],[`m`,`38324`,`5426`],[`a`,`4857`,`6595`,`-824660`,`891534`],[`m`,`29078`,`3952`],[`a`,`4857`,`6595`,`-8950887`,`1091722`],[`m`,`22141`,`4720`],[`a`,`4365`,`5945`,`-9809656`,`1061181`],[`m`,`14000`,`5192`],[`a`,`6753`,`9190`,`-4002417`,`739161`],[`m`,`4127`,`15789`],[`a`,`6753`,`9190`,`9459261`,`711490`]]}]},corner:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj1`,`*/ 100000 h ss`],[`maxAdj2`,`*/ 100000 w ss`],[`a1`,`pin 0 adj1 maxAdj1`],[`a2`,`pin 0 adj2 maxAdj2`],[`x1`,`*/ ss a2 100000`],[`dy1`,`*/ ss a1 100000`],[`y1`,`+- b 0 dy1`],[`cx1`,`*/ x1 1 2`],[`cy1`,`+/ y1 b 2`],[`d`,`+- w 0 h`],[`it`,`?: d y1 t`],[`ir`,`?: d r x1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`l`,`x1`,`y1`],[`l`,`r`,`y1`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},cornertabs:{adj:[],gd:[[`md`,`mod w h 0`],[`dx`,`*/ 1 md 20`],[`y1`,`+- 0 b dx`],[`x1`,`+- 0 r dx`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`dx`,`t`],[`l`,`l`,`dx`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y1`],[`l`,`dx`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`t`],[`l`,`r`,`t`],[`l`,`r`,`dx`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`r`,`y1`],[`l`,`r`,`b`],[`l`,`x1`,`b`],[`c`]]}]},cube:{adj:[[`adj`,`val 25000`]],gd:[[`a`,`pin 0 adj 100000`],[`y1`,`*/ ss a 100000`],[`y4`,`+- b 0 y1`],[`y2`,`*/ y4 1 2`],[`y3`,`+/ y1 b 2`],[`x4`,`+- r 0 y1`],[`x2`,`*/ x4 1 2`],[`x3`,`+/ y1 r 2`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`y1`],[`l`,`x4`,`y1`],[`l`,`x4`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x4`,`y1`],[`l`,`r`,`t`],[`l`,`r`,`y4`],[`l`,`x4`,`b`],[`c`]]},{w:null,h:null,fill:`lightenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`y1`],[`l`,`y1`,`t`],[`l`,`r`,`t`],[`l`,`x4`,`y1`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`y1`],[`l`,`y1`,`t`],[`l`,`r`,`t`],[`l`,`r`,`y4`],[`l`,`x4`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`l`,`y1`],[`l`,`x4`,`y1`],[`l`,`r`,`t`],[`m`,`x4`,`y1`],[`l`,`x4`,`b`]]}]},curvedconnector2:{adj:[],gd:[],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`C`,`wd2`,`t`,`r`,`hd2`,`r`,`b`]]}]},curvedconnector3:{adj:[[`adj1`,`val 50000`]],gd:[[`x2`,`*/ w adj1 100000`],[`x1`,`+/ l x2 2`],[`x3`,`+/ r x2 2`],[`y3`,`*/ h 3 4`]],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`C`,`x1`,`t`,`x2`,`hd4`,`x2`,`vc`],[`C`,`x2`,`y3`,`x3`,`b`,`r`,`b`]]}]},curvedconnector4:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`x2`,`*/ w adj1 100000`],[`x1`,`+/ l x2 2`],[`x3`,`+/ r x2 2`],[`x4`,`+/ x2 x3 2`],[`x5`,`+/ x3 r 2`],[`y4`,`*/ h adj2 100000`],[`y1`,`+/ t y4 2`],[`y2`,`+/ t y1 2`],[`y3`,`+/ y1 y4 2`],[`y5`,`+/ b y4 2`]],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`C`,`x1`,`t`,`x2`,`y2`,`x2`,`y1`],[`C`,`x2`,`y3`,`x4`,`y4`,`x3`,`y4`],[`C`,`x5`,`y4`,`r`,`y5`,`r`,`b`]]}]},curvedconnector5:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`],[`adj3`,`val 50000`]],gd:[[`x3`,`*/ w adj1 100000`],[`x6`,`*/ w adj3 100000`],[`x1`,`+/ x3 x6 2`],[`x2`,`+/ l x3 2`],[`x4`,`+/ x3 x1 2`],[`x5`,`+/ x6 x1 2`],[`x7`,`+/ x6 r 2`],[`y4`,`*/ h adj2 100000`],[`y1`,`+/ t y4 2`],[`y2`,`+/ t y1 2`],[`y3`,`+/ y1 y4 2`],[`y5`,`+/ b y4 2`],[`y6`,`+/ y5 y4 2`],[`y7`,`+/ y5 b 2`]],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`C`,`x2`,`t`,`x3`,`y2`,`x3`,`y1`],[`C`,`x3`,`y3`,`x4`,`y4`,`x1`,`y4`],[`C`,`x5`,`y4`,`x6`,`y6`,`x6`,`y5`],[`C`,`x6`,`y7`,`x7`,`b`,`r`,`b`]]}]},curveddownarrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 50000`],[`adj3`,`val 25000`]],gd:[[`maxAdj2`,`*/ 50000 w ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`a1`,`pin 0 adj1 100000`],[`th`,`*/ ss a1 100000`],[`aw`,`*/ ss a2 100000`],[`q1`,`+/ th aw 4`],[`wR`,`+- wd2 0 q1`],[`q7`,`*/ wR 2 1`],[`q8`,`*/ q7 q7 1`],[`q9`,`*/ th th 1`],[`q10`,`+- q8 0 q9`],[`q11`,`sqrt q10`],[`idy`,`*/ q11 h q7`],[`maxAdj3`,`*/ 100000 idy ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`ah`,`*/ ss adj3 100000`],[`x3`,`+- wR th 0`],[`q2`,`*/ h h 1`],[`q3`,`*/ ah ah 1`],[`q4`,`+- q2 0 q3`],[`q5`,`sqrt q4`],[`dx`,`*/ q5 wR h`],[`x5`,`+- wR dx 0`],[`x7`,`+- x3 dx 0`],[`q6`,`+- aw 0 th`],[`dh`,`*/ q6 1 2`],[`x4`,`+- x5 0 dh`],[`x8`,`+- x7 dh 0`],[`aw2`,`*/ aw 1 2`],[`x6`,`+- r 0 aw2`],[`y1`,`+- b 0 ah`],[`swAng`,`at2 ah dx`],[`mswAng`,`+- 0 0 swAng`],[`iy`,`+- b 0 idy`],[`ix`,`+/ wR x3 2`],[`q12`,`*/ th 1 2`],[`dang2`,`at2 idy q12`],[`stAng`,`+- 3cd4 swAng 0`],[`stAng2`,`+- 3cd4 0 dang2`],[`swAng2`,`+- dang2 0 cd4`],[`swAng3`,`+- cd4 dang2 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x6`,`b`],[`l`,`x4`,`y1`],[`l`,`x5`,`y1`],[`a`,`wR`,`h`,`stAng`,`mswAng`],[`l`,`x3`,`t`],[`a`,`wR`,`h`,`3cd4`,`swAng`],[`l`,`x8`,`y1`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`ix`,`iy`],[`a`,`wR`,`h`,`stAng2`,`swAng2`],[`l`,`l`,`b`],[`a`,`wR`,`h`,`cd2`,`swAng3`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`ix`,`iy`],[`a`,`wR`,`h`,`stAng2`,`swAng2`],[`l`,`l`,`b`],[`a`,`wR`,`h`,`cd2`,`cd4`],[`l`,`x3`,`t`],[`a`,`wR`,`h`,`3cd4`,`swAng`],[`l`,`x8`,`y1`],[`l`,`x6`,`b`],[`l`,`x4`,`y1`],[`l`,`x5`,`y1`],[`a`,`wR`,`h`,`stAng`,`mswAng`]]}]},curvedleftarrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 50000`],[`adj3`,`val 25000`]],gd:[[`maxAdj2`,`*/ 50000 h ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`a1`,`pin 0 adj1 a2`],[`th`,`*/ ss a1 100000`],[`aw`,`*/ ss a2 100000`],[`q1`,`+/ th aw 4`],[`hR`,`+- hd2 0 q1`],[`q7`,`*/ hR 2 1`],[`q8`,`*/ q7 q7 1`],[`q9`,`*/ th th 1`],[`q10`,`+- q8 0 q9`],[`q11`,`sqrt q10`],[`idx`,`*/ q11 w q7`],[`maxAdj3`,`*/ 100000 idx ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`ah`,`*/ ss a3 100000`],[`y3`,`+- hR th 0`],[`q2`,`*/ w w 1`],[`q3`,`*/ ah ah 1`],[`q4`,`+- q2 0 q3`],[`q5`,`sqrt q4`],[`dy`,`*/ q5 hR w`],[`y5`,`+- hR dy 0`],[`y7`,`+- y3 dy 0`],[`q6`,`+- aw 0 th`],[`dh`,`*/ q6 1 2`],[`y4`,`+- y5 0 dh`],[`y8`,`+- y7 dh 0`],[`aw2`,`*/ aw 1 2`],[`y6`,`+- b 0 aw2`],[`x1`,`+- l ah 0`],[`swAng`,`at2 ah dy`],[`mswAng`,`+- 0 0 swAng`],[`ix`,`+- l idx 0`],[`iy`,`+/ hR y3 2`],[`q12`,`*/ th 1 2`],[`dang2`,`at2 idx q12`],[`swAng2`,`+- dang2 0 swAng`],[`swAng3`,`+- swAng dang2 0`],[`stAng3`,`+- 0 0 dang2`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`y6`],[`l`,`x1`,`y4`],[`l`,`x1`,`y5`],[`a`,`w`,`hR`,`swAng`,`swAng2`],[`a`,`w`,`hR`,`stAng3`,`swAng3`],[`l`,`x1`,`y8`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`r`,`y3`],[`a`,`w`,`hR`,`0`,`-5400000`],[`l`,`l`,`t`],[`a`,`w`,`hR`,`3cd4`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`r`,`y3`],[`a`,`w`,`hR`,`0`,`-5400000`],[`l`,`l`,`t`],[`a`,`w`,`hR`,`3cd4`,`cd4`],[`l`,`r`,`y3`],[`a`,`w`,`hR`,`0`,`swAng`],[`l`,`x1`,`y8`],[`l`,`l`,`y6`],[`l`,`x1`,`y4`],[`l`,`x1`,`y5`],[`a`,`w`,`hR`,`swAng`,`swAng2`]]}]},curvedrightarrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 50000`],[`adj3`,`val 25000`]],gd:[[`maxAdj2`,`*/ 50000 h ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`a1`,`pin 0 adj1 a2`],[`th`,`*/ ss a1 100000`],[`aw`,`*/ ss a2 100000`],[`q1`,`+/ th aw 4`],[`hR`,`+- hd2 0 q1`],[`q7`,`*/ hR 2 1`],[`q8`,`*/ q7 q7 1`],[`q9`,`*/ th th 1`],[`q10`,`+- q8 0 q9`],[`q11`,`sqrt q10`],[`idx`,`*/ q11 w q7`],[`maxAdj3`,`*/ 100000 idx ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`ah`,`*/ ss a3 100000`],[`y3`,`+- hR th 0`],[`q2`,`*/ w w 1`],[`q3`,`*/ ah ah 1`],[`q4`,`+- q2 0 q3`],[`q5`,`sqrt q4`],[`dy`,`*/ q5 hR w`],[`y5`,`+- hR dy 0`],[`y7`,`+- y3 dy 0`],[`q6`,`+- aw 0 th`],[`dh`,`*/ q6 1 2`],[`y4`,`+- y5 0 dh`],[`y8`,`+- y7 dh 0`],[`aw2`,`*/ aw 1 2`],[`y6`,`+- b 0 aw2`],[`x1`,`+- r 0 ah`],[`swAng`,`at2 ah dy`],[`stAng`,`+- cd2 0 swAng`],[`mswAng`,`+- 0 0 swAng`],[`ix`,`+- r 0 idx`],[`iy`,`+/ hR y3 2`],[`q12`,`*/ th 1 2`],[`dang2`,`at2 idx q12`],[`swAng2`,`+- dang2 0 cd4`],[`swAng3`,`+- cd4 dang2 0`],[`stAng3`,`+- cd2 0 dang2`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`hR`],[`a`,`w`,`hR`,`cd2`,`mswAng`],[`l`,`x1`,`y4`],[`l`,`r`,`y6`],[`l`,`x1`,`y8`],[`l`,`x1`,`y7`],[`a`,`w`,`hR`,`stAng`,`swAng`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`r`,`th`],[`a`,`w`,`hR`,`3cd4`,`swAng2`],[`a`,`w`,`hR`,`stAng3`,`swAng3`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`hR`],[`a`,`w`,`hR`,`cd2`,`mswAng`],[`l`,`x1`,`y4`],[`l`,`r`,`y6`],[`l`,`x1`,`y8`],[`l`,`x1`,`y7`],[`a`,`w`,`hR`,`stAng`,`swAng`],[`l`,`l`,`hR`],[`a`,`w`,`hR`,`cd2`,`cd4`],[`l`,`r`,`th`],[`a`,`w`,`hR`,`3cd4`,`swAng2`]]}]},curveduparrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 50000`],[`adj3`,`val 25000`]],gd:[[`maxAdj2`,`*/ 50000 w ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`a1`,`pin 0 adj1 100000`],[`th`,`*/ ss a1 100000`],[`aw`,`*/ ss a2 100000`],[`q1`,`+/ th aw 4`],[`wR`,`+- wd2 0 q1`],[`q7`,`*/ wR 2 1`],[`q8`,`*/ q7 q7 1`],[`q9`,`*/ th th 1`],[`q10`,`+- q8 0 q9`],[`q11`,`sqrt q10`],[`idy`,`*/ q11 h q7`],[`maxAdj3`,`*/ 100000 idy ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`ah`,`*/ ss adj3 100000`],[`x3`,`+- wR th 0`],[`q2`,`*/ h h 1`],[`q3`,`*/ ah ah 1`],[`q4`,`+- q2 0 q3`],[`q5`,`sqrt q4`],[`dx`,`*/ q5 wR h`],[`x5`,`+- wR dx 0`],[`x7`,`+- x3 dx 0`],[`q6`,`+- aw 0 th`],[`dh`,`*/ q6 1 2`],[`x4`,`+- x5 0 dh`],[`x8`,`+- x7 dh 0`],[`aw2`,`*/ aw 1 2`],[`x6`,`+- r 0 aw2`],[`y1`,`+- t ah 0`],[`swAng`,`at2 ah dx`],[`mswAng`,`+- 0 0 swAng`],[`iy`,`+- t idy 0`],[`ix`,`+/ wR x3 2`],[`q12`,`*/ th 1 2`],[`dang2`,`at2 idy q12`],[`swAng2`,`+- dang2 0 swAng`],[`mswAng2`,`+- 0 0 swAng2`],[`stAng3`,`+- cd4 0 swAng`],[`swAng3`,`+- swAng dang2 0`],[`stAng2`,`+- cd4 0 dang2`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x6`,`t`],[`l`,`x8`,`y1`],[`l`,`x7`,`y1`],[`a`,`wR`,`h`,`stAng3`,`swAng3`],[`a`,`wR`,`h`,`stAng2`,`swAng2`],[`l`,`x4`,`y1`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`wR`,`b`],[`a`,`wR`,`h`,`cd4`,`cd4`],[`l`,`th`,`t`],[`a`,`wR`,`h`,`cd2`,`-5400000`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`ix`,`iy`],[`a`,`wR`,`h`,`stAng2`,`swAng2`],[`l`,`x4`,`y1`],[`l`,`x6`,`t`],[`l`,`x8`,`y1`],[`l`,`x7`,`y1`],[`a`,`wR`,`h`,`stAng3`,`swAng`],[`l`,`wR`,`b`],[`a`,`wR`,`h`,`cd4`,`cd4`],[`l`,`th`,`t`],[`a`,`wR`,`h`,`cd2`,`-5400000`]]}]},decagon:{adj:[[`vf`,`val 105146`]],gd:[[`shd2`,`*/ hd2 vf 100000`],[`dx1`,`cos wd2 2160000`],[`dx2`,`cos wd2 4320000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`dy1`,`sin shd2 4320000`],[`dy2`,`sin shd2 2160000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`],[`y4`,`+- vc dy1 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`x1`,`y2`],[`l`,`x2`,`y1`],[`l`,`x3`,`y1`],[`l`,`x4`,`y2`],[`l`,`r`,`vc`],[`l`,`x4`,`y3`],[`l`,`x3`,`y4`],[`l`,`x2`,`y4`],[`l`,`x1`,`y3`],[`c`]]}]},diagstripe:{adj:[[`adj`,`val 50000`]],gd:[[`a`,`pin 0 adj 100000`],[`x2`,`*/ w a 100000`],[`x1`,`*/ x2 1 2`],[`x3`,`+/ x2 r 2`],[`y2`,`*/ h a 100000`],[`y1`,`*/ y2 1 2`],[`y3`,`+/ y2 b 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y2`],[`l`,`x2`,`t`],[`l`,`r`,`t`],[`l`,`l`,`b`],[`c`]]}]},diamond:{adj:[],gd:[[`ir`,`*/ w 3 4`],[`ib`,`*/ h 3 4`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`hc`,`t`],[`l`,`r`,`vc`],[`l`,`hc`,`b`],[`c`]]}]},dodecagon:{adj:[],gd:[[`x1`,`*/ w 2894 21600`],[`x2`,`*/ w 7906 21600`],[`x3`,`*/ w 13694 21600`],[`x4`,`*/ w 18706 21600`],[`y1`,`*/ h 2894 21600`],[`y2`,`*/ h 7906 21600`],[`y3`,`*/ h 13694 21600`],[`y4`,`*/ h 18706 21600`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y2`],[`l`,`x1`,`y1`],[`l`,`x2`,`t`],[`l`,`x3`,`t`],[`l`,`x4`,`y1`],[`l`,`r`,`y2`],[`l`,`r`,`y3`],[`l`,`x4`,`y4`],[`l`,`x3`,`b`],[`l`,`x2`,`b`],[`l`,`x1`,`y4`],[`l`,`l`,`y3`],[`c`]]}]},donut:{adj:[[`adj`,`val 25000`]],gd:[[`a`,`pin 0 adj 50000`],[`dr`,`*/ ss a 100000`],[`iwd2`,`+- wd2 0 dr`],[`ihd2`,`+- hd2 0 dr`],[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`],[`m`,`dr`,`vc`],[`a`,`iwd2`,`ihd2`,`cd2`,`-5400000`],[`a`,`iwd2`,`ihd2`,`cd4`,`-5400000`],[`a`,`iwd2`,`ihd2`,`0`,`-5400000`],[`a`,`iwd2`,`ihd2`,`3cd4`,`-5400000`],[`c`]]}]},doublewave:{adj:[[`adj1`,`val 6250`],[`adj2`,`val 0`]],gd:[[`a1`,`pin 0 adj1 12500`],[`a2`,`pin -10000 adj2 10000`],[`y1`,`*/ h a1 100000`],[`dy2`,`*/ y1 10 3`],[`y2`,`+- y1 0 dy2`],[`y3`,`+- y1 dy2 0`],[`y4`,`+- b 0 y1`],[`y5`,`+- y4 0 dy2`],[`y6`,`+- y4 dy2 0`],[`dx1`,`*/ w a2 100000`],[`of2`,`*/ w a2 50000`],[`x1`,`abs dx1`],[`dx2`,`?: of2 0 of2`],[`x2`,`+- l 0 dx2`],[`dx8`,`?: of2 of2 0`],[`x8`,`+- r 0 dx8`],[`dx3`,`+/ dx2 x8 6`],[`x3`,`+- x2 dx3 0`],[`dx4`,`+/ dx2 x8 3`],[`x4`,`+- x2 dx4 0`],[`x5`,`+/ x2 x8 2`],[`x6`,`+- x5 dx3 0`],[`x7`,`+/ x6 x8 2`],[`x9`,`+- l dx8 0`],[`x15`,`+- r dx2 0`],[`x10`,`+- x9 dx3 0`],[`x11`,`+- x9 dx4 0`],[`x12`,`+/ x9 x15 2`],[`x13`,`+- x12 dx3 0`],[`x14`,`+/ x13 x15 2`],[`x16`,`+- r 0 x1`],[`xAdj`,`+- hc dx1 0`],[`il`,`max x2 x9`],[`ir`,`min x8 x15`],[`it`,`*/ h a1 50000`],[`ib`,`+- b 0 it`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x2`,`y1`],[`C`,`x3`,`y2`,`x4`,`y3`,`x5`,`y1`],[`C`,`x6`,`y2`,`x7`,`y3`,`x8`,`y1`],[`l`,`x15`,`y4`],[`C`,`x14`,`y6`,`x13`,`y5`,`x12`,`y4`],[`C`,`x11`,`y6`,`x10`,`y5`,`x9`,`y4`],[`c`]]}]},downarrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 100000 h ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`dy1`,`*/ ss a2 100000`],[`y1`,`+- b 0 dy1`],[`dx1`,`*/ w a1 200000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc dx1 0`],[`dy2`,`*/ x1 dy1 wd2`],[`y2`,`+- y1 dy2 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y1`],[`l`,`x1`,`y1`],[`l`,`x1`,`t`],[`l`,`x2`,`t`],[`l`,`x2`,`y1`],[`l`,`r`,`y1`],[`l`,`hc`,`b`],[`c`]]}]},downarrowcallout:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 64977`]],gd:[[`maxAdj2`,`*/ 50000 w ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`*/ 100000 h ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`q2`,`*/ a3 ss h`],[`maxAdj4`,`+- 100000 0 q2`],[`a4`,`pin 0 adj4 maxAdj4`],[`dx1`,`*/ ss a2 100000`],[`dx2`,`*/ ss a1 200000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`dy3`,`*/ ss a3 100000`],[`y3`,`+- b 0 dy3`],[`y2`,`*/ h a4 100000`],[`y1`,`*/ y2 1 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`y2`],[`l`,`x3`,`y2`],[`l`,`x3`,`y3`],[`l`,`x4`,`y3`],[`l`,`hc`,`b`],[`l`,`x1`,`y3`],[`l`,`x2`,`y3`],[`l`,`x2`,`y2`],[`l`,`l`,`y2`],[`c`]]}]},ellipse:{adj:[],gd:[[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`]]}]},ellipseribbon:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 50000`],[`adj3`,`val 12500`]],gd:[[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 25000 adj2 75000`],[`q10`,`+- 100000 0 a1`],[`q11`,`*/ q10 1 2`],[`q12`,`+- a1 0 q11`],[`minAdj3`,`max 0 q12`],[`a3`,`pin minAdj3 adj3 a1`],[`dx2`,`*/ w a2 200000`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- x2 wd8 0`],[`x4`,`+- r 0 x3`],[`x5`,`+- r 0 x2`],[`x6`,`+- r 0 wd8`],[`dy1`,`*/ h a3 100000`],[`f1`,`*/ 4 dy1 w`],[`q1`,`*/ x3 x3 w`],[`q2`,`+- x3 0 q1`],[`y1`,`*/ f1 q2 1`],[`cx1`,`*/ x3 1 2`],[`cy1`,`*/ f1 cx1 1`],[`cx2`,`+- r 0 cx1`],[`q1`,`*/ h a1 100000`],[`dy3`,`+- q1 0 dy1`],[`q3`,`*/ x2 x2 w`],[`q4`,`+- x2 0 q3`],[`q5`,`*/ f1 q4 1`],[`y3`,`+- q5 dy3 0`],[`q6`,`+- dy1 dy3 y3`],[`q7`,`+- q6 dy1 0`],[`cy3`,`+- q7 dy3 0`],[`rh`,`+- b 0 q1`],[`q8`,`*/ dy1 14 16`],[`y2`,`+/ q8 rh 2`],[`y5`,`+- q5 rh 0`],[`y6`,`+- y3 rh 0`],[`cx4`,`*/ x2 1 2`],[`q9`,`*/ f1 cx4 1`],[`cy4`,`+- q9 rh 0`],[`cx5`,`+- r 0 cx4`],[`cy6`,`+- cy3 rh 0`],[`y7`,`+- y1 dy3 0`],[`cy7`,`+- q1 q1 y7`],[`y8`,`+- b 0 dy1`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`Q`,`cx1`,`cy1`,`x3`,`y1`],[`l`,`x2`,`y3`],[`Q`,`hc`,`cy3`,`x5`,`y3`],[`l`,`x4`,`y1`],[`Q`,`cx2`,`cy1`,`r`,`t`],[`l`,`x6`,`y2`],[`l`,`r`,`rh`],[`Q`,`cx5`,`cy4`,`x5`,`y5`],[`l`,`x5`,`y6`],[`Q`,`hc`,`cy6`,`x2`,`y6`],[`l`,`x2`,`y5`],[`Q`,`cx4`,`cy4`,`l`,`rh`],[`l`,`wd8`,`y2`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x3`,`y7`],[`l`,`x3`,`y1`],[`l`,`x2`,`y3`],[`Q`,`hc`,`cy3`,`x5`,`y3`],[`l`,`x4`,`y1`],[`l`,`x4`,`y7`],[`Q`,`hc`,`cy7`,`x3`,`y7`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`Q`,`cx1`,`cy1`,`x3`,`y1`],[`l`,`x2`,`y3`],[`Q`,`hc`,`cy3`,`x5`,`y3`],[`l`,`x4`,`y1`],[`Q`,`cx2`,`cy1`,`r`,`t`],[`l`,`x6`,`y2`],[`l`,`r`,`rh`],[`Q`,`cx5`,`cy4`,`x5`,`y5`],[`l`,`x5`,`y6`],[`Q`,`hc`,`cy6`,`x2`,`y6`],[`l`,`x2`,`y5`],[`Q`,`cx4`,`cy4`,`l`,`rh`],[`l`,`wd8`,`y2`],[`c`],[`m`,`x2`,`y5`],[`l`,`x2`,`y3`],[`m`,`x5`,`y3`],[`l`,`x5`,`y5`],[`m`,`x3`,`y1`],[`l`,`x3`,`y7`],[`m`,`x4`,`y7`],[`l`,`x4`,`y1`]]}]},ellipseribbon2:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 50000`],[`adj3`,`val 12500`]],gd:[[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 25000 adj2 75000`],[`q10`,`+- 100000 0 a1`],[`q11`,`*/ q10 1 2`],[`q12`,`+- a1 0 q11`],[`minAdj3`,`max 0 q12`],[`a3`,`pin minAdj3 adj3 a1`],[`dx2`,`*/ w a2 200000`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- x2 wd8 0`],[`x4`,`+- r 0 x3`],[`x5`,`+- r 0 x2`],[`x6`,`+- r 0 wd8`],[`dy1`,`*/ h a3 100000`],[`f1`,`*/ 4 dy1 w`],[`q1`,`*/ x3 x3 w`],[`q2`,`+- x3 0 q1`],[`u1`,`*/ f1 q2 1`],[`y1`,`+- b 0 u1`],[`cx1`,`*/ x3 1 2`],[`cu1`,`*/ f1 cx1 1`],[`cy1`,`+- b 0 cu1`],[`cx2`,`+- r 0 cx1`],[`q1`,`*/ h a1 100000`],[`dy3`,`+- q1 0 dy1`],[`q3`,`*/ x2 x2 w`],[`q4`,`+- x2 0 q3`],[`q5`,`*/ f1 q4 1`],[`u3`,`+- q5 dy3 0`],[`y3`,`+- b 0 u3`],[`q6`,`+- dy1 dy3 u3`],[`q7`,`+- q6 dy1 0`],[`cu3`,`+- q7 dy3 0`],[`cy3`,`+- b 0 cu3`],[`rh`,`+- b 0 q1`],[`q8`,`*/ dy1 14 16`],[`u2`,`+/ q8 rh 2`],[`y2`,`+- b 0 u2`],[`u5`,`+- q5 rh 0`],[`y5`,`+- b 0 u5`],[`u6`,`+- u3 rh 0`],[`y6`,`+- b 0 u6`],[`cx4`,`*/ x2 1 2`],[`q9`,`*/ f1 cx4 1`],[`cu4`,`+- q9 rh 0`],[`cy4`,`+- b 0 cu4`],[`cx5`,`+- r 0 cx4`],[`cu6`,`+- cu3 rh 0`],[`cy6`,`+- b 0 cu6`],[`u7`,`+- u1 dy3 0`],[`y7`,`+- b 0 u7`],[`cu7`,`+- q1 q1 u7`],[`cy7`,`+- b 0 cu7`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`b`],[`Q`,`cx1`,`cy1`,`x3`,`y1`],[`l`,`x2`,`y3`],[`Q`,`hc`,`cy3`,`x5`,`y3`],[`l`,`x4`,`y1`],[`Q`,`cx2`,`cy1`,`r`,`b`],[`l`,`x6`,`y2`],[`l`,`r`,`q1`],[`Q`,`cx5`,`cy4`,`x5`,`y5`],[`l`,`x5`,`y6`],[`Q`,`hc`,`cy6`,`x2`,`y6`],[`l`,`x2`,`y5`],[`Q`,`cx4`,`cy4`,`l`,`q1`],[`l`,`wd8`,`y2`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x3`,`y7`],[`l`,`x3`,`y1`],[`l`,`x2`,`y3`],[`Q`,`hc`,`cy3`,`x5`,`y3`],[`l`,`x4`,`y1`],[`l`,`x4`,`y7`],[`Q`,`hc`,`cy7`,`x3`,`y7`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`b`],[`l`,`wd8`,`y2`],[`l`,`l`,`q1`],[`Q`,`cx4`,`cy4`,`x2`,`y5`],[`l`,`x2`,`y6`],[`Q`,`hc`,`cy6`,`x5`,`y6`],[`l`,`x5`,`y5`],[`Q`,`cx5`,`cy4`,`r`,`q1`],[`l`,`x6`,`y2`],[`l`,`r`,`b`],[`Q`,`cx2`,`cy1`,`x4`,`y1`],[`l`,`x5`,`y3`],[`Q`,`hc`,`cy3`,`x2`,`y3`],[`l`,`x3`,`y1`],[`Q`,`cx1`,`cy1`,`l`,`b`],[`c`],[`m`,`x2`,`y3`],[`l`,`x2`,`y5`],[`m`,`x5`,`y5`],[`l`,`x5`,`y3`],[`m`,`x3`,`y7`],[`l`,`x3`,`y1`],[`m`,`x4`,`y1`],[`l`,`x4`,`y7`]]}]},flowchartalternateprocess:{adj:[],gd:[[`x2`,`+- r 0 ssd6`],[`y2`,`+- b 0 ssd6`],[`il`,`*/ ssd6 29289 100000`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`ssd6`],[`a`,`ssd6`,`ssd6`,`cd2`,`cd4`],[`l`,`x2`,`t`],[`a`,`ssd6`,`ssd6`,`3cd4`,`cd4`],[`l`,`r`,`y2`],[`a`,`ssd6`,`ssd6`,`0`,`cd4`],[`l`,`ssd6`,`b`],[`a`,`ssd6`,`ssd6`,`cd4`,`cd4`],[`c`]]}]},flowchartcollate:{adj:[],gd:[[`ir`,`*/ w 3 4`],[`ib`,`*/ h 3 4`]],paths:[{w:2,h:2,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`2`,`0`],[`l`,`1`,`1`],[`l`,`2`,`2`],[`l`,`0`,`2`],[`l`,`1`,`1`],[`c`]]}]},flowchartconnector:{adj:[],gd:[[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`]]}]},flowchartdecision:{adj:[],gd:[[`ir`,`*/ w 3 4`],[`ib`,`*/ h 3 4`]],paths:[{w:2,h:2,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`1`],[`l`,`1`,`0`],[`l`,`2`,`1`],[`l`,`1`,`2`],[`c`]]}]},flowchartdelay:{adj:[],gd:[[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`hc`,`t`],[`a`,`wd2`,`hd2`,`3cd4`,`cd2`],[`l`,`l`,`b`],[`c`]]}]},flowchartdisplay:{adj:[],gd:[[`x2`,`*/ w 5 6`]],paths:[{w:6,h:6,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`3`],[`l`,`1`,`0`],[`l`,`5`,`0`],[`a`,`1`,`3`,`3cd4`,`cd2`],[`l`,`1`,`6`],[`c`]]}]},flowchartdocument:{adj:[],gd:[[`y1`,`*/ h 17322 21600`],[`y2`,`*/ h 20172 21600`]],paths:[{w:21600,h:21600,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`21600`,`0`],[`l`,`21600`,`17322`],[`C`,`10800`,`17322`,`10800`,`23922`,`0`,`20172`],[`c`]]}]},flowchartextract:{adj:[],gd:[[`x2`,`*/ w 3 4`]],paths:[{w:2,h:2,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`2`],[`l`,`1`,`0`],[`l`,`2`,`2`],[`c`]]}]},flowchartinputoutput:{adj:[],gd:[[`x3`,`*/ w 2 5`],[`x4`,`*/ w 3 5`],[`x5`,`*/ w 4 5`],[`x6`,`*/ w 9 10`]],paths:[{w:5,h:5,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`5`],[`l`,`1`,`0`],[`l`,`5`,`0`],[`l`,`4`,`5`],[`c`]]}]},flowchartinternalstorage:{adj:[],gd:[],paths:[{w:1,h:1,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`0`,`0`],[`l`,`1`,`0`],[`l`,`1`,`1`],[`l`,`0`,`1`],[`c`]]},{w:8,h:8,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`1`,`0`],[`l`,`1`,`8`],[`m`,`0`,`1`],[`l`,`8`,`1`]]},{w:1,h:1,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`1`,`0`],[`l`,`1`,`1`],[`l`,`0`,`1`],[`c`]]}]},flowchartmagneticdisk:{adj:[],gd:[[`y3`,`*/ h 5 6`]],paths:[{w:6,h:6,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`0`,`1`],[`a`,`3`,`1`,`cd2`,`cd2`],[`l`,`6`,`5`],[`a`,`3`,`1`,`0`,`cd2`],[`c`]]},{w:6,h:6,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`6`,`1`],[`a`,`3`,`1`,`0`,`cd2`]]},{w:6,h:6,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`1`],[`a`,`3`,`1`,`cd2`,`cd2`],[`l`,`6`,`5`],[`a`,`3`,`1`,`0`,`cd2`],[`c`]]}]},flowchartmagneticdrum:{adj:[],gd:[[`x2`,`*/ w 2 3`]],paths:[{w:6,h:6,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`1`,`0`],[`l`,`5`,`0`],[`a`,`1`,`3`,`3cd4`,`cd2`],[`l`,`1`,`6`],[`a`,`1`,`3`,`cd4`,`cd2`],[`c`]]},{w:6,h:6,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`5`,`6`],[`a`,`1`,`3`,`cd4`,`cd2`]]},{w:6,h:6,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`1`,`0`],[`l`,`5`,`0`],[`a`,`1`,`3`,`3cd4`,`cd2`],[`l`,`1`,`6`],[`a`,`1`,`3`,`cd4`,`cd2`],[`c`]]}]},flowchartmagnetictape:{adj:[],gd:[[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`],[`ang1`,`at2 w h`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`hc`,`b`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`ang1`],[`l`,`r`,`ib`],[`l`,`r`,`b`],[`c`]]}]},flowchartmanualinput:{adj:[],gd:[],paths:[{w:5,h:5,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`1`],[`l`,`5`,`0`],[`l`,`5`,`5`],[`l`,`0`,`5`],[`c`]]}]},flowchartmanualoperation:{adj:[],gd:[[`x3`,`*/ w 4 5`],[`x4`,`*/ w 9 10`]],paths:[{w:5,h:5,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`5`,`0`],[`l`,`4`,`5`],[`l`,`1`,`5`],[`c`]]}]},flowchartmerge:{adj:[],gd:[[`x2`,`*/ w 3 4`]],paths:[{w:2,h:2,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`2`,`0`],[`l`,`1`,`2`],[`c`]]}]},flowchartmultidocument:{adj:[],gd:[[`y2`,`*/ h 3675 21600`],[`y8`,`*/ h 20782 21600`],[`x3`,`*/ w 9298 21600`],[`x4`,`*/ w 12286 21600`],[`x5`,`*/ w 18595 21600`]],paths:[{w:21600,h:21600,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`0`,`20782`],[`C`,`9298`,`23542`,`9298`,`18022`,`18595`,`18022`],[`l`,`18595`,`3675`],[`l`,`0`,`3675`],[`c`],[`m`,`1532`,`3675`],[`l`,`1532`,`1815`],[`l`,`20000`,`1815`],[`l`,`20000`,`16252`],[`C`,`19298`,`16252`,`18595`,`16352`,`18595`,`16352`],[`l`,`18595`,`3675`],[`c`],[`m`,`2972`,`1815`],[`l`,`2972`,`0`],[`l`,`21600`,`0`],[`l`,`21600`,`14392`],[`C`,`20800`,`14392`,`20000`,`14467`,`20000`,`14467`],[`l`,`20000`,`1815`],[`c`]]},{w:21600,h:21600,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`0`,`3675`],[`l`,`18595`,`3675`],[`l`,`18595`,`18022`],[`C`,`9298`,`18022`,`9298`,`23542`,`0`,`20782`],[`c`],[`m`,`1532`,`3675`],[`l`,`1532`,`1815`],[`l`,`20000`,`1815`],[`l`,`20000`,`16252`],[`C`,`19298`,`16252`,`18595`,`16352`,`18595`,`16352`],[`m`,`2972`,`1815`],[`l`,`2972`,`0`],[`l`,`21600`,`0`],[`l`,`21600`,`14392`],[`C`,`20800`,`14392`,`20000`,`14467`,`20000`,`14467`]]},{w:21600,h:21600,fill:`none`,stroke:!1,extrusionOk:!0,cmds:[[`m`,`0`,`20782`],[`C`,`9298`,`23542`,`9298`,`18022`,`18595`,`18022`],[`l`,`18595`,`16352`],[`C`,`18595`,`16352`,`19298`,`16252`,`20000`,`16252`],[`l`,`20000`,`14467`],[`C`,`20000`,`14467`,`20800`,`14392`,`21600`,`14392`],[`l`,`21600`,`0`],[`l`,`2972`,`0`],[`l`,`2972`,`1815`],[`l`,`1532`,`1815`],[`l`,`1532`,`3675`],[`l`,`0`,`3675`],[`c`]]}]},flowchartofflinestorage:{adj:[],gd:[[`x4`,`*/ w 3 4`]],paths:[{w:2,h:2,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`0`,`0`],[`l`,`2`,`0`],[`l`,`1`,`2`],[`c`]]},{w:5,h:5,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`2`,`4`],[`l`,`3`,`4`]]},{w:2,h:2,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`2`,`0`],[`l`,`1`,`2`],[`c`]]}]},flowchartoffpageconnector:{adj:[],gd:[[`y1`,`*/ h 4 5`]],paths:[{w:10,h:10,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`10`,`0`],[`l`,`10`,`8`],[`l`,`5`,`10`],[`l`,`0`,`8`],[`c`]]}]},flowchartonlinestorage:{adj:[],gd:[[`x2`,`*/ w 5 6`]],paths:[{w:6,h:6,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`1`,`0`],[`l`,`6`,`0`],[`a`,`1`,`3`,`3cd4`,`-10800000`],[`l`,`1`,`6`],[`a`,`1`,`3`,`cd4`,`cd2`],[`c`]]}]},flowchartor:{adj:[],gd:[[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`hc`,`t`],[`l`,`hc`,`b`],[`m`,`l`,`vc`],[`l`,`r`,`vc`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`]]}]},flowchartpredefinedprocess:{adj:[],gd:[[`x2`,`*/ w 7 8`]],paths:[{w:1,h:1,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`0`,`0`],[`l`,`1`,`0`],[`l`,`1`,`1`],[`l`,`0`,`1`],[`c`]]},{w:8,h:8,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`1`,`0`],[`l`,`1`,`8`],[`m`,`7`,`0`],[`l`,`7`,`8`]]},{w:1,h:1,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`1`,`0`],[`l`,`1`,`1`],[`l`,`0`,`1`],[`c`]]}]},flowchartpreparation:{adj:[],gd:[[`x2`,`*/ w 4 5`]],paths:[{w:10,h:10,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`5`],[`l`,`2`,`0`],[`l`,`8`,`0`],[`l`,`10`,`5`],[`l`,`8`,`10`],[`l`,`2`,`10`],[`c`]]}]},flowchartprocess:{adj:[],gd:[],paths:[{w:1,h:1,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`1`,`0`],[`l`,`1`,`1`],[`l`,`0`,`1`],[`c`]]}]},flowchartpunchedcard:{adj:[],gd:[],paths:[{w:5,h:5,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`1`],[`l`,`1`,`0`],[`l`,`5`,`0`],[`l`,`5`,`5`],[`l`,`0`,`5`],[`c`]]}]},flowchartpunchedtape:{adj:[],gd:[[`y2`,`*/ h 9 10`],[`ib`,`*/ h 4 5`]],paths:[{w:20,h:20,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`2`],[`a`,`5`,`2`,`cd2`,`-10800000`],[`a`,`5`,`2`,`cd2`,`cd2`],[`l`,`20`,`18`],[`a`,`5`,`2`,`0`,`-10800000`],[`a`,`5`,`2`,`0`,`cd2`],[`c`]]}]},flowchartsort:{adj:[],gd:[[`ir`,`*/ w 3 4`],[`ib`,`*/ h 3 4`]],paths:[{w:2,h:2,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`0`,`1`],[`l`,`1`,`0`],[`l`,`2`,`1`],[`l`,`1`,`2`],[`c`]]},{w:2,h:2,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`0`,`1`],[`l`,`2`,`1`]]},{w:2,h:2,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`1`],[`l`,`1`,`0`],[`l`,`2`,`1`],[`l`,`1`,`2`],[`c`]]}]},flowchartsummingjunction:{adj:[],gd:[[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`il`,`it`],[`l`,`ir`,`ib`],[`m`,`ir`,`it`],[`l`,`il`,`ib`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`]]}]},flowchartterminator:{adj:[],gd:[[`il`,`*/ w 1018 21600`],[`ir`,`*/ w 20582 21600`],[`it`,`*/ h 3163 21600`],[`ib`,`*/ h 18437 21600`]],paths:[{w:21600,h:21600,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`3475`,`0`],[`l`,`18125`,`0`],[`a`,`3475`,`10800`,`3cd4`,`cd2`],[`l`,`3475`,`21600`],[`a`,`3475`,`10800`,`cd4`,`cd2`],[`c`]]}]},foldedcorner:{adj:[[`adj`,`val 16667`]],gd:[[`a`,`pin 0 adj 50000`],[`dy2`,`*/ ss a 100000`],[`dy1`,`*/ dy2 1 5`],[`x1`,`+- r 0 dy2`],[`x2`,`+- x1 dy1 0`],[`y2`,`+- b 0 dy2`],[`y1`,`+- y2 dy1 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`y2`],[`l`,`x1`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x1`,`b`],[`l`,`x2`,`y1`],[`l`,`r`,`y2`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`b`],[`l`,`x2`,`y1`],[`l`,`r`,`y2`],[`l`,`x1`,`b`],[`l`,`l`,`b`],[`l`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`y2`]]}]},frame:{adj:[[`adj1`,`val 12500`]],gd:[[`a1`,`pin 0 adj1 50000`],[`x1`,`*/ ss a1 100000`],[`x4`,`+- r 0 x1`],[`y4`,`+- b 0 x1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`x1`,`x1`],[`l`,`x1`,`y4`],[`l`,`x4`,`y4`],[`l`,`x4`,`x1`],[`c`]]}]},funnel:{adj:[],gd:[[`d`,`*/ ss 1 20`],[`rw2`,`+- wd2 0 d`],[`rh2`,`+- hd4 0 d`],[`t1`,`cos wd2 480000`],[`t2`,`sin hd4 480000`],[`da`,`at2 t1 t2`],[`2da`,`*/ da 2 1`],[`stAng1`,`+- cd2 0 da`],[`swAng1`,`+- cd2 2da 0`],[`swAng3`,`+- cd2 0 2da`],[`rw3`,`*/ wd2 1 4`],[`rh3`,`*/ hd4 1 4`],[`ct1`,`cos hd4 stAng1`],[`st1`,`sin wd2 stAng1`],[`m1`,`mod ct1 st1 0`],[`n1`,`*/ wd2 hd4 m1`],[`dx1`,`cos n1 stAng1`],[`dy1`,`sin n1 stAng1`],[`x1`,`+- hc dx1 0`],[`y1`,`+- hd4 dy1 0`],[`ct3`,`cos rh3 da`],[`st3`,`sin rw3 da`],[`m3`,`mod ct3 st3 0`],[`n3`,`*/ rw3 rh3 m3`],[`dx3`,`cos n3 da`],[`dy3`,`sin n3 da`],[`x3`,`+- hc dx3 0`],[`vc3`,`+- b 0 rh3`],[`y2`,`+- vc3 dy3 0`],[`x2`,`+- wd2 0 rw2`],[`cd`,`*/ cd2 2 1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`a`,`wd2`,`hd4`,`stAng1`,`swAng1`],[`l`,`x3`,`y2`],[`a`,`rw3`,`rh3`,`da`,`swAng3`],[`c`],[`m`,`x2`,`hd4`],[`a`,`rw2`,`rh2`,`cd2`,`-21600000`],[`c`]]}]},gear6:{adj:[[`adj1`,`val 15000`],[`adj2`,`val 3526`]],gd:[[`a1`,`pin 0 adj1 20000`],[`a2`,`pin 0 adj2 5358`],[`th`,`*/ ss a1 100000`],[`lFD`,`*/ ss a2 100000`],[`th2`,`*/ th 1 2`],[`l2`,`*/ lFD 1 2`],[`l3`,`+- th2 l2 0`],[`rh`,`+- hd2 0 th`],[`rw`,`+- wd2 0 th`],[`dr`,`+- rw 0 rh`],[`maxr`,`?: dr rh rw`],[`ha`,`at2 maxr l3`],[`aA1`,`+- 19800000 0 ha`],[`aD1`,`+- 19800000 ha 0`],[`ta11`,`cos rw aA1`],[`ta12`,`sin rh aA1`],[`bA1`,`at2 ta11 ta12`],[`cta1`,`cos rh bA1`],[`sta1`,`sin rw bA1`],[`ma1`,`mod cta1 sta1 0`],[`na1`,`*/ rw rh ma1`],[`dxa1`,`cos na1 bA1`],[`dya1`,`sin na1 bA1`],[`xA1`,`+- hc dxa1 0`],[`yA1`,`+- vc dya1 0`],[`td11`,`cos rw aD1`],[`td12`,`sin rh aD1`],[`bD1`,`at2 td11 td12`],[`ctd1`,`cos rh bD1`],[`std1`,`sin rw bD1`],[`md1`,`mod ctd1 std1 0`],[`nd1`,`*/ rw rh md1`],[`dxd1`,`cos nd1 bD1`],[`dyd1`,`sin nd1 bD1`],[`xD1`,`+- hc dxd1 0`],[`yD1`,`+- vc dyd1 0`],[`xAD1`,`+- xA1 0 xD1`],[`yAD1`,`+- yA1 0 yD1`],[`lAD1`,`mod xAD1 yAD1 0`],[`a1`,`at2 yAD1 xAD1`],[`dxF1`,`sin lFD a1`],[`dyF1`,`cos lFD a1`],[`xF1`,`+- xD1 dxF1 0`],[`yF1`,`+- yD1 dyF1 0`],[`xE1`,`+- xA1 0 dxF1`],[`yE1`,`+- yA1 0 dyF1`],[`yC1t`,`sin th a1`],[`xC1t`,`cos th a1`],[`yC1`,`+- yF1 yC1t 0`],[`xC1`,`+- xF1 0 xC1t`],[`yB1`,`+- yE1 yC1t 0`],[`xB1`,`+- xE1 0 xC1t`],[`aD6`,`+- 3cd4 ha 0`],[`td61`,`cos rw aD6`],[`td62`,`sin rh aD6`],[`bD6`,`at2 td61 td62`],[`ctd6`,`cos rh bD6`],[`std6`,`sin rw bD6`],[`md6`,`mod ctd6 std6 0`],[`nd6`,`*/ rw rh md6`],[`dxd6`,`cos nd6 bD6`],[`dyd6`,`sin nd6 bD6`],[`xD6`,`+- hc dxd6 0`],[`yD6`,`+- vc dyd6 0`],[`xA6`,`+- hc 0 dxd6`],[`xF6`,`+- xD6 0 lFD`],[`xE6`,`+- xA6 lFD 0`],[`yC6`,`+- yD6 0 th`],[`swAng1`,`+- bA1 0 bD6`],[`aA2`,`+- 1800000 0 ha`],[`aD2`,`+- 1800000 ha 0`],[`ta21`,`cos rw aA2`],[`ta22`,`sin rh aA2`],[`bA2`,`at2 ta21 ta22`],[`yA2`,`+- h 0 yD1`],[`td21`,`cos rw aD2`],[`td22`,`sin rh aD2`],[`bD2`,`at2 td21 td22`],[`yD2`,`+- h 0 yA1`],[`yC2`,`+- h 0 yB1`],[`yB2`,`+- h 0 yC1`],[`xB2`,`val xC1`],[`swAng2`,`+- bA2 0 bD1`],[`aD3`,`+- cd4 ha 0`],[`td31`,`cos rw aD3`],[`td32`,`sin rh aD3`],[`bD3`,`at2 td31 td32`],[`yD3`,`+- h 0 yD6`],[`yB3`,`+- h 0 yC6`],[`aD4`,`+- 9000000 ha 0`],[`td41`,`cos rw aD4`],[`td42`,`sin rh aD4`],[`bD4`,`at2 td41 td42`],[`xD4`,`+- w 0 xD1`],[`xC4`,`+- w 0 xC1`],[`xB4`,`+- w 0 xB1`],[`aD5`,`+- 12600000 ha 0`],[`td51`,`cos rw aD5`],[`td52`,`sin rh aD5`],[`bD5`,`at2 td51 td52`],[`xD5`,`+- w 0 xA1`],[`xC5`,`+- w 0 xB1`],[`xB5`,`+- w 0 xC1`],[`xCxn1`,`+/ xB1 xC1 2`],[`yCxn1`,`+/ yB1 yC1 2`],[`yCxn2`,`+- b 0 yCxn1`],[`xCxn4`,`+/ r 0 xCxn1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`xA1`,`yA1`],[`l`,`xB1`,`yB1`],[`l`,`xC1`,`yC1`],[`l`,`xD1`,`yD1`],[`a`,`rw`,`rh`,`bD1`,`swAng2`],[`l`,`xC1`,`yB2`],[`l`,`xB1`,`yC2`],[`l`,`xA1`,`yD2`],[`a`,`rw`,`rh`,`bD2`,`swAng1`],[`l`,`xF6`,`yB3`],[`l`,`xE6`,`yB3`],[`l`,`xA6`,`yD3`],[`a`,`rw`,`rh`,`bD3`,`swAng1`],[`l`,`xB4`,`yC2`],[`l`,`xC4`,`yB2`],[`l`,`xD4`,`yA2`],[`a`,`rw`,`rh`,`bD4`,`swAng2`],[`l`,`xB5`,`yC1`],[`l`,`xC5`,`yB1`],[`l`,`xD5`,`yA1`],[`a`,`rw`,`rh`,`bD5`,`swAng1`],[`l`,`xE6`,`yC6`],[`l`,`xF6`,`yC6`],[`l`,`xD6`,`yD6`],[`a`,`rw`,`rh`,`bD6`,`swAng1`],[`c`]]}]},gear9:{adj:[[`adj1`,`val 10000`],[`adj2`,`val 1763`]],gd:[[`a1`,`pin 0 adj1 20000`],[`a2`,`pin 0 adj2 2679`],[`th`,`*/ ss a1 100000`],[`lFD`,`*/ ss a2 100000`],[`th2`,`*/ th 1 2`],[`l2`,`*/ lFD 1 2`],[`l3`,`+- th2 l2 0`],[`rh`,`+- hd2 0 th`],[`rw`,`+- wd2 0 th`],[`dr`,`+- rw 0 rh`],[`maxr`,`?: dr rh rw`],[`ha`,`at2 maxr l3`],[`aA1`,`+- 18600000 0 ha`],[`aD1`,`+- 18600000 ha 0`],[`ta11`,`cos rw aA1`],[`ta12`,`sin rh aA1`],[`bA1`,`at2 ta11 ta12`],[`cta1`,`cos rh bA1`],[`sta1`,`sin rw bA1`],[`ma1`,`mod cta1 sta1 0`],[`na1`,`*/ rw rh ma1`],[`dxa1`,`cos na1 bA1`],[`dya1`,`sin na1 bA1`],[`xA1`,`+- hc dxa1 0`],[`yA1`,`+- vc dya1 0`],[`td11`,`cos rw aD1`],[`td12`,`sin rh aD1`],[`bD1`,`at2 td11 td12`],[`ctd1`,`cos rh bD1`],[`std1`,`sin rw bD1`],[`md1`,`mod ctd1 std1 0`],[`nd1`,`*/ rw rh md1`],[`dxd1`,`cos nd1 bD1`],[`dyd1`,`sin nd1 bD1`],[`xD1`,`+- hc dxd1 0`],[`yD1`,`+- vc dyd1 0`],[`xAD1`,`+- xA1 0 xD1`],[`yAD1`,`+- yA1 0 yD1`],[`lAD1`,`mod xAD1 yAD1 0`],[`a1`,`at2 yAD1 xAD1`],[`dxF1`,`sin lFD a1`],[`dyF1`,`cos lFD a1`],[`xF1`,`+- xD1 dxF1 0`],[`yF1`,`+- yD1 dyF1 0`],[`xE1`,`+- xA1 0 dxF1`],[`yE1`,`+- yA1 0 dyF1`],[`yC1t`,`sin th a1`],[`xC1t`,`cos th a1`],[`yC1`,`+- yF1 yC1t 0`],[`xC1`,`+- xF1 0 xC1t`],[`yB1`,`+- yE1 yC1t 0`],[`xB1`,`+- xE1 0 xC1t`],[`aA2`,`+- 21000000 0 ha`],[`aD2`,`+- 21000000 ha 0`],[`ta21`,`cos rw aA2`],[`ta22`,`sin rh aA2`],[`bA2`,`at2 ta21 ta22`],[`cta2`,`cos rh bA2`],[`sta2`,`sin rw bA2`],[`ma2`,`mod cta2 sta2 0`],[`na2`,`*/ rw rh ma2`],[`dxa2`,`cos na2 bA2`],[`dya2`,`sin na2 bA2`],[`xA2`,`+- hc dxa2 0`],[`yA2`,`+- vc dya2 0`],[`td21`,`cos rw aD2`],[`td22`,`sin rh aD2`],[`bD2`,`at2 td21 td22`],[`ctd2`,`cos rh bD2`],[`std2`,`sin rw bD2`],[`md2`,`mod ctd2 std2 0`],[`nd2`,`*/ rw rh md2`],[`dxd2`,`cos nd2 bD2`],[`dyd2`,`sin nd2 bD2`],[`xD2`,`+- hc dxd2 0`],[`yD2`,`+- vc dyd2 0`],[`xAD2`,`+- xA2 0 xD2`],[`yAD2`,`+- yA2 0 yD2`],[`lAD2`,`mod xAD2 yAD2 0`],[`a2`,`at2 yAD2 xAD2`],[`dxF2`,`sin lFD a2`],[`dyF2`,`cos lFD a2`],[`xF2`,`+- xD2 dxF2 0`],[`yF2`,`+- yD2 dyF2 0`],[`xE2`,`+- xA2 0 dxF2`],[`yE2`,`+- yA2 0 dyF2`],[`yC2t`,`sin th a2`],[`xC2t`,`cos th a2`],[`yC2`,`+- yF2 yC2t 0`],[`xC2`,`+- xF2 0 xC2t`],[`yB2`,`+- yE2 yC2t 0`],[`xB2`,`+- xE2 0 xC2t`],[`swAng1`,`+- bA2 0 bD1`],[`aA3`,`+- 1800000 0 ha`],[`aD3`,`+- 1800000 ha 0`],[`ta31`,`cos rw aA3`],[`ta32`,`sin rh aA3`],[`bA3`,`at2 ta31 ta32`],[`cta3`,`cos rh bA3`],[`sta3`,`sin rw bA3`],[`ma3`,`mod cta3 sta3 0`],[`na3`,`*/ rw rh ma3`],[`dxa3`,`cos na3 bA3`],[`dya3`,`sin na3 bA3`],[`xA3`,`+- hc dxa3 0`],[`yA3`,`+- vc dya3 0`],[`td31`,`cos rw aD3`],[`td32`,`sin rh aD3`],[`bD3`,`at2 td31 td32`],[`ctd3`,`cos rh bD3`],[`std3`,`sin rw bD3`],[`md3`,`mod ctd3 std3 0`],[`nd3`,`*/ rw rh md3`],[`dxd3`,`cos nd3 bD3`],[`dyd3`,`sin nd3 bD3`],[`xD3`,`+- hc dxd3 0`],[`yD3`,`+- vc dyd3 0`],[`xAD3`,`+- xA3 0 xD3`],[`yAD3`,`+- yA3 0 yD3`],[`lAD3`,`mod xAD3 yAD3 0`],[`a3`,`at2 yAD3 xAD3`],[`dxF3`,`sin lFD a3`],[`dyF3`,`cos lFD a3`],[`xF3`,`+- xD3 dxF3 0`],[`yF3`,`+- yD3 dyF3 0`],[`xE3`,`+- xA3 0 dxF3`],[`yE3`,`+- yA3 0 dyF3`],[`yC3t`,`sin th a3`],[`xC3t`,`cos th a3`],[`yC3`,`+- yF3 yC3t 0`],[`xC3`,`+- xF3 0 xC3t`],[`yB3`,`+- yE3 yC3t 0`],[`xB3`,`+- xE3 0 xC3t`],[`swAng2`,`+- bA3 0 bD2`],[`aA4`,`+- 4200000 0 ha`],[`aD4`,`+- 4200000 ha 0`],[`ta41`,`cos rw aA4`],[`ta42`,`sin rh aA4`],[`bA4`,`at2 ta41 ta42`],[`cta4`,`cos rh bA4`],[`sta4`,`sin rw bA4`],[`ma4`,`mod cta4 sta4 0`],[`na4`,`*/ rw rh ma4`],[`dxa4`,`cos na4 bA4`],[`dya4`,`sin na4 bA4`],[`xA4`,`+- hc dxa4 0`],[`yA4`,`+- vc dya4 0`],[`td41`,`cos rw aD4`],[`td42`,`sin rh aD4`],[`bD4`,`at2 td41 td42`],[`ctd4`,`cos rh bD4`],[`std4`,`sin rw bD4`],[`md4`,`mod ctd4 std4 0`],[`nd4`,`*/ rw rh md4`],[`dxd4`,`cos nd4 bD4`],[`dyd4`,`sin nd4 bD4`],[`xD4`,`+- hc dxd4 0`],[`yD4`,`+- vc dyd4 0`],[`xAD4`,`+- xA4 0 xD4`],[`yAD4`,`+- yA4 0 yD4`],[`lAD4`,`mod xAD4 yAD4 0`],[`a4`,`at2 yAD4 xAD4`],[`dxF4`,`sin lFD a4`],[`dyF4`,`cos lFD a4`],[`xF4`,`+- xD4 dxF4 0`],[`yF4`,`+- yD4 dyF4 0`],[`xE4`,`+- xA4 0 dxF4`],[`yE4`,`+- yA4 0 dyF4`],[`yC4t`,`sin th a4`],[`xC4t`,`cos th a4`],[`yC4`,`+- yF4 yC4t 0`],[`xC4`,`+- xF4 0 xC4t`],[`yB4`,`+- yE4 yC4t 0`],[`xB4`,`+- xE4 0 xC4t`],[`swAng3`,`+- bA4 0 bD3`],[`aA5`,`+- 6600000 0 ha`],[`aD5`,`+- 6600000 ha 0`],[`ta51`,`cos rw aA5`],[`ta52`,`sin rh aA5`],[`bA5`,`at2 ta51 ta52`],[`td51`,`cos rw aD5`],[`td52`,`sin rh aD5`],[`bD5`,`at2 td51 td52`],[`xD5`,`+- w 0 xA4`],[`xC5`,`+- w 0 xB4`],[`xB5`,`+- w 0 xC4`],[`swAng4`,`+- bA5 0 bD4`],[`aD6`,`+- 9000000 ha 0`],[`td61`,`cos rw aD6`],[`td62`,`sin rh aD6`],[`bD6`,`at2 td61 td62`],[`xD6`,`+- w 0 xA3`],[`xC6`,`+- w 0 xB3`],[`xB6`,`+- w 0 xC3`],[`aD7`,`+- 11400000 ha 0`],[`td71`,`cos rw aD7`],[`td72`,`sin rh aD7`],[`bD7`,`at2 td71 td72`],[`xD7`,`+- w 0 xA2`],[`xC7`,`+- w 0 xB2`],[`xB7`,`+- w 0 xC2`],[`aD8`,`+- 13800000 ha 0`],[`td81`,`cos rw aD8`],[`td82`,`sin rh aD8`],[`bD8`,`at2 td81 td82`],[`xA8`,`+- w 0 xD1`],[`xD8`,`+- w 0 xA1`],[`xC8`,`+- w 0 xB1`],[`xB8`,`+- w 0 xC1`],[`aA9`,`+- 3cd4 0 ha`],[`aD9`,`+- 3cd4 ha 0`],[`td91`,`cos rw aD9`],[`td92`,`sin rh aD9`],[`bD9`,`at2 td91 td92`],[`ctd9`,`cos rh bD9`],[`std9`,`sin rw bD9`],[`md9`,`mod ctd9 std9 0`],[`nd9`,`*/ rw rh md9`],[`dxd9`,`cos nd9 bD9`],[`dyd9`,`sin nd9 bD9`],[`xD9`,`+- hc dxd9 0`],[`yD9`,`+- vc dyd9 0`],[`ta91`,`cos rw aA9`],[`ta92`,`sin rh aA9`],[`bA9`,`at2 ta91 ta92`],[`xA9`,`+- hc 0 dxd9`],[`xF9`,`+- xD9 0 lFD`],[`xE9`,`+- xA9 lFD 0`],[`yC9`,`+- yD9 0 th`],[`swAng5`,`+- bA9 0 bD8`],[`xCxn1`,`+/ xB1 xC1 2`],[`yCxn1`,`+/ yB1 yC1 2`],[`xCxn2`,`+/ xB2 xC2 2`],[`yCxn2`,`+/ yB2 yC2 2`],[`xCxn3`,`+/ xB3 xC3 2`],[`yCxn3`,`+/ yB3 yC3 2`],[`xCxn4`,`+/ xB4 xC4 2`],[`yCxn4`,`+/ yB4 yC4 2`],[`xCxn5`,`+/ r 0 xCxn4`],[`xCxn6`,`+/ r 0 xCxn3`],[`xCxn7`,`+/ r 0 xCxn2`],[`xCxn8`,`+/ r 0 xCxn1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`xA1`,`yA1`],[`l`,`xB1`,`yB1`],[`l`,`xC1`,`yC1`],[`l`,`xD1`,`yD1`],[`a`,`rw`,`rh`,`bD1`,`swAng1`],[`l`,`xB2`,`yB2`],[`l`,`xC2`,`yC2`],[`l`,`xD2`,`yD2`],[`a`,`rw`,`rh`,`bD2`,`swAng2`],[`l`,`xB3`,`yB3`],[`l`,`xC3`,`yC3`],[`l`,`xD3`,`yD3`],[`a`,`rw`,`rh`,`bD3`,`swAng3`],[`l`,`xB4`,`yB4`],[`l`,`xC4`,`yC4`],[`l`,`xD4`,`yD4`],[`a`,`rw`,`rh`,`bD4`,`swAng4`],[`l`,`xB5`,`yC4`],[`l`,`xC5`,`yB4`],[`l`,`xD5`,`yA4`],[`a`,`rw`,`rh`,`bD5`,`swAng3`],[`l`,`xB6`,`yC3`],[`l`,`xC6`,`yB3`],[`l`,`xD6`,`yA3`],[`a`,`rw`,`rh`,`bD6`,`swAng2`],[`l`,`xB7`,`yC2`],[`l`,`xC7`,`yB2`],[`l`,`xD7`,`yA2`],[`a`,`rw`,`rh`,`bD7`,`swAng1`],[`l`,`xB8`,`yC1`],[`l`,`xC8`,`yB1`],[`l`,`xD8`,`yA1`],[`a`,`rw`,`rh`,`bD8`,`swAng5`],[`l`,`xE9`,`yC9`],[`l`,`xF9`,`yC9`],[`l`,`xD9`,`yD9`],[`a`,`rw`,`rh`,`bD9`,`swAng5`],[`c`]]}]},halfframe:{adj:[[`adj1`,`val 33333`],[`adj2`,`val 33333`]],gd:[[`maxAdj2`,`*/ 100000 w ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`x1`,`*/ ss a2 100000`],[`g1`,`*/ h x1 w`],[`g2`,`+- h 0 g1`],[`maxAdj1`,`*/ 100000 g2 ss`],[`a1`,`pin 0 adj1 maxAdj1`],[`y1`,`*/ ss a1 100000`],[`dx2`,`*/ y1 w h`],[`x2`,`+- r 0 dx2`],[`dy2`,`*/ x1 h w`],[`y2`,`+- b 0 dy2`],[`cx1`,`*/ x1 1 2`],[`cy1`,`+/ y2 b 2`],[`cx2`,`+/ x2 r 2`],[`cy2`,`*/ y1 1 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`x2`,`y1`],[`l`,`x1`,`y1`],[`l`,`x1`,`y2`],[`l`,`l`,`b`],[`c`]]}]},heart:{adj:[],gd:[[`dx1`,`*/ w 49 48`],[`dx2`,`*/ w 10 48`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`y1`,`+- t 0 hd3`],[`il`,`*/ w 1 6`],[`ir`,`*/ w 5 6`],[`ib`,`*/ h 2 3`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`hc`,`hd4`],[`C`,`x3`,`y1`,`x4`,`hd4`,`hc`,`b`],[`C`,`x1`,`hd4`,`x2`,`y1`,`hc`,`hd4`],[`c`]]}]},heptagon:{adj:[[`hf`,`val 102572`],[`vf`,`val 105210`]],gd:[[`swd2`,`*/ wd2 hf 100000`],[`shd2`,`*/ hd2 vf 100000`],[`svc`,`*/ vc vf 100000`],[`dx1`,`*/ swd2 97493 100000`],[`dx2`,`*/ swd2 78183 100000`],[`dx3`,`*/ swd2 43388 100000`],[`dy1`,`*/ shd2 62349 100000`],[`dy2`,`*/ shd2 22252 100000`],[`dy3`,`*/ shd2 90097 100000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc 0 dx3`],[`x4`,`+- hc dx3 0`],[`x5`,`+- hc dx2 0`],[`x6`,`+- hc dx1 0`],[`y1`,`+- svc 0 dy1`],[`y2`,`+- svc dy2 0`],[`y3`,`+- svc dy3 0`],[`ib`,`+- b 0 y1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y2`],[`l`,`x2`,`y1`],[`l`,`hc`,`t`],[`l`,`x5`,`y1`],[`l`,`x6`,`y2`],[`l`,`x4`,`y3`],[`l`,`x3`,`y3`],[`c`]]}]},hexagon:{adj:[[`adj`,`val 25000`],[`vf`,`val 115470`]],gd:[[`maxAdj`,`*/ 50000 w ss`],[`a`,`pin 0 adj maxAdj`],[`shd2`,`*/ hd2 vf 100000`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`dy1`,`sin shd2 3600000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc dy1 0`],[`q1`,`*/ maxAdj -1 2`],[`q2`,`+- a q1 0`],[`q3`,`?: q2 4 2`],[`q4`,`?: q2 3 2`],[`q5`,`?: q2 q1 0`],[`q6`,`+/ a q5 q1`],[`q7`,`*/ q6 q4 -1`],[`q8`,`+- q3 q7 0`],[`il`,`*/ w q8 24`],[`it`,`*/ h q8 24`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 it`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`x1`,`y1`],[`l`,`x2`,`y1`],[`l`,`r`,`vc`],[`l`,`x2`,`y2`],[`l`,`x1`,`y2`],[`c`]]}]},homeplate:{adj:[[`adj`,`val 50000`]],gd:[[`maxAdj`,`*/ 100000 w ss`],[`a`,`pin 0 adj maxAdj`],[`dx1`,`*/ ss a 100000`],[`x1`,`+- r 0 dx1`],[`ir`,`+/ x1 r 2`],[`x2`,`*/ x1 1 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`l`,`r`,`vc`],[`l`,`x1`,`b`],[`l`,`l`,`b`],[`c`]]}]},horizontalscroll:{adj:[[`adj`,`val 12500`]],gd:[[`a`,`pin 0 adj 25000`],[`ch`,`*/ ss a 100000`],[`ch2`,`*/ ch 1 2`],[`ch4`,`*/ ch 1 4`],[`y3`,`+- ch ch2 0`],[`y4`,`+- ch ch 0`],[`y6`,`+- b 0 ch`],[`y7`,`+- b 0 ch2`],[`y5`,`+- y6 0 ch2`],[`x3`,`+- r 0 ch`],[`x4`,`+- r 0 ch2`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`r`,`ch2`],[`a`,`ch2`,`ch2`,`0`,`cd4`],[`l`,`x4`,`ch2`],[`a`,`ch4`,`ch4`,`0`,`cd2`],[`l`,`x3`,`ch`],[`l`,`ch2`,`ch`],[`a`,`ch2`,`ch2`,`3cd4`,`-5400000`],[`l`,`l`,`y7`],[`a`,`ch2`,`ch2`,`cd2`,`-10800000`],[`l`,`ch`,`y6`],[`l`,`x4`,`y6`],[`a`,`ch2`,`ch2`,`cd4`,`-5400000`],[`c`],[`m`,`ch2`,`y4`],[`a`,`ch2`,`ch2`,`cd4`,`-5400000`],[`a`,`ch4`,`ch4`,`0`,`-10800000`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`ch2`,`y4`],[`a`,`ch2`,`ch2`,`cd4`,`-5400000`],[`a`,`ch4`,`ch4`,`0`,`-10800000`],[`c`],[`m`,`x4`,`ch`],[`a`,`ch2`,`ch2`,`cd4`,`-16200000`],[`a`,`ch4`,`ch4`,`cd2`,`-10800000`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`y3`],[`a`,`ch2`,`ch2`,`cd2`,`cd4`],[`l`,`x3`,`ch`],[`l`,`x3`,`ch2`],[`a`,`ch2`,`ch2`,`cd2`,`cd2`],[`l`,`r`,`y5`],[`a`,`ch2`,`ch2`,`0`,`cd4`],[`l`,`ch`,`y6`],[`l`,`ch`,`y7`],[`a`,`ch2`,`ch2`,`0`,`cd2`],[`c`],[`m`,`x3`,`ch`],[`l`,`x4`,`ch`],[`a`,`ch2`,`ch2`,`cd4`,`-5400000`],[`m`,`x4`,`ch`],[`l`,`x4`,`ch2`],[`a`,`ch4`,`ch4`,`0`,`cd2`],[`m`,`ch2`,`y4`],[`l`,`ch2`,`y3`],[`a`,`ch4`,`ch4`,`cd2`,`cd2`],[`a`,`ch2`,`ch2`,`0`,`cd2`],[`m`,`ch`,`y3`],[`l`,`ch`,`y6`]]}]},irregularseal1:{adj:[],gd:[[`x5`,`*/ w 4627 21600`],[`x12`,`*/ w 8485 21600`],[`x21`,`*/ w 16702 21600`],[`x24`,`*/ w 14522 21600`],[`y3`,`*/ h 6320 21600`],[`y6`,`*/ h 8615 21600`],[`y9`,`*/ h 13937 21600`],[`y18`,`*/ h 13290 21600`]],paths:[{w:21600,h:21600,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`10800`,`5800`],[`l`,`14522`,`0`],[`l`,`14155`,`5325`],[`l`,`18380`,`4457`],[`l`,`16702`,`7315`],[`l`,`21097`,`8137`],[`l`,`17607`,`10475`],[`l`,`21600`,`13290`],[`l`,`16837`,`12942`],[`l`,`18145`,`18095`],[`l`,`14020`,`14457`],[`l`,`13247`,`19737`],[`l`,`10532`,`14935`],[`l`,`8485`,`21600`],[`l`,`7715`,`15627`],[`l`,`4762`,`17617`],[`l`,`5667`,`13937`],[`l`,`135`,`14587`],[`l`,`3722`,`11775`],[`l`,`0`,`8615`],[`l`,`4627`,`7617`],[`l`,`370`,`2295`],[`l`,`7312`,`6320`],[`l`,`8352`,`2295`],[`c`]]}]},irregularseal2:{adj:[],gd:[[`x2`,`*/ w 9722 21600`],[`x5`,`*/ w 5372 21600`],[`x16`,`*/ w 11612 21600`],[`x19`,`*/ w 14640 21600`],[`y2`,`*/ h 1887 21600`],[`y3`,`*/ h 6382 21600`],[`y8`,`*/ h 12877 21600`],[`y14`,`*/ h 19712 21600`],[`y16`,`*/ h 18842 21600`],[`y17`,`*/ h 15935 21600`],[`y24`,`*/ h 6645 21600`]],paths:[{w:21600,h:21600,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`11462`,`4342`],[`l`,`14790`,`0`],[`l`,`14525`,`5777`],[`l`,`18007`,`3172`],[`l`,`16380`,`6532`],[`l`,`21600`,`6645`],[`l`,`16985`,`9402`],[`l`,`18270`,`11290`],[`l`,`16380`,`12310`],[`l`,`18877`,`15632`],[`l`,`14640`,`14350`],[`l`,`14942`,`17370`],[`l`,`12180`,`15935`],[`l`,`11612`,`18842`],[`l`,`9872`,`17370`],[`l`,`8700`,`19712`],[`l`,`7527`,`18125`],[`l`,`4917`,`21600`],[`l`,`4805`,`18240`],[`l`,`1285`,`17825`],[`l`,`3330`,`15370`],[`l`,`0`,`12877`],[`l`,`3935`,`11592`],[`l`,`1172`,`8270`],[`l`,`5372`,`7817`],[`l`,`4502`,`3625`],[`l`,`8550`,`6382`],[`l`,`9722`,`1887`],[`c`]]}]},leftarrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 100000 w ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`dx2`,`*/ ss a2 100000`],[`x2`,`+- l dx2 0`],[`dy1`,`*/ h a1 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc dy1 0`],[`dx1`,`*/ y1 dx2 hd2`],[`x1`,`+- x2 0 dx1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`x2`,`t`],[`l`,`x2`,`y1`],[`l`,`r`,`y1`],[`l`,`r`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`b`],[`c`]]}]},leftarrowcallout:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 64977`]],gd:[[`maxAdj2`,`*/ 50000 h ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`*/ 100000 w ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`q2`,`*/ a3 ss w`],[`maxAdj4`,`+- 100000 0 q2`],[`a4`,`pin 0 adj4 maxAdj4`],[`dy1`,`*/ ss a2 100000`],[`dy2`,`*/ ss a1 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`],[`y4`,`+- vc dy1 0`],[`x1`,`*/ ss a3 100000`],[`dx2`,`*/ w a4 100000`],[`x2`,`+- r 0 dx2`],[`x3`,`+/ x2 r 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`x1`,`y1`],[`l`,`x1`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`x2`,`b`],[`l`,`x2`,`y3`],[`l`,`x1`,`y3`],[`l`,`x1`,`y4`],[`c`]]}]},leftbrace:{adj:[[`adj1`,`val 8333`],[`adj2`,`val 50000`]],gd:[[`a2`,`pin 0 adj2 100000`],[`q1`,`+- 100000 0 a2`],[`q2`,`min q1 a2`],[`q3`,`*/ q2 1 2`],[`maxAdj1`,`*/ q3 h ss`],[`a1`,`pin 0 adj1 maxAdj1`],[`y1`,`*/ ss a1 100000`],[`y3`,`*/ h a2 100000`],[`y4`,`+- y3 y1 0`],[`dx1`,`cos wd2 2700000`],[`dy1`,`sin y1 2700000`],[`il`,`+- r 0 dx1`],[`it`,`+- y1 0 dy1`],[`ib`,`+- b dy1 y1`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`r`,`b`],[`a`,`wd2`,`y1`,`cd4`,`cd4`],[`l`,`hc`,`y4`],[`a`,`wd2`,`y1`,`0`,`-5400000`],[`a`,`wd2`,`y1`,`cd4`,`-5400000`],[`l`,`hc`,`y1`],[`a`,`wd2`,`y1`,`cd2`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`r`,`b`],[`a`,`wd2`,`y1`,`cd4`,`cd4`],[`l`,`hc`,`y4`],[`a`,`wd2`,`y1`,`0`,`-5400000`],[`a`,`wd2`,`y1`,`cd4`,`-5400000`],[`l`,`hc`,`y1`],[`a`,`wd2`,`y1`,`cd2`,`cd4`]]}]},leftbracket:{adj:[[`adj`,`val 8333`]],gd:[[`maxAdj`,`*/ 50000 h ss`],[`a`,`pin 0 adj maxAdj`],[`y1`,`*/ ss a 100000`],[`y2`,`+- b 0 y1`],[`dx1`,`cos w 2700000`],[`dy1`,`sin y1 2700000`],[`il`,`+- r 0 dx1`],[`it`,`+- y1 0 dy1`],[`ib`,`+- b dy1 y1`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`r`,`b`],[`a`,`w`,`y1`,`cd4`,`cd4`],[`l`,`l`,`y1`],[`a`,`w`,`y1`,`cd2`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`r`,`b`],[`a`,`w`,`y1`,`cd4`,`cd4`],[`l`,`l`,`y1`],[`a`,`w`,`y1`,`cd2`,`cd4`]]}]},leftcirculararrow:{adj:[[`adj1`,`val 12500`],[`adj2`,`val -1142319`],[`adj3`,`val 1142319`],[`adj4`,`val 10800000`],[`adj5`,`val 12500`]],gd:[[`a5`,`pin 0 adj5 25000`],[`maxAdj1`,`*/ a5 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`enAng`,`pin 1 adj3 21599999`],[`stAng`,`pin 0 adj4 21599999`],[`th`,`*/ ss a1 100000`],[`thh`,`*/ ss a5 100000`],[`th2`,`*/ th 1 2`],[`rw1`,`+- wd2 th2 thh`],[`rh1`,`+- hd2 th2 thh`],[`rw2`,`+- rw1 0 th`],[`rh2`,`+- rh1 0 th`],[`rw3`,`+- rw2 th2 0`],[`rh3`,`+- rh2 th2 0`],[`wtH`,`sin rw3 enAng`],[`htH`,`cos rh3 enAng`],[`dxH`,`cat2 rw3 htH wtH`],[`dyH`,`sat2 rh3 htH wtH`],[`xH`,`+- hc dxH 0`],[`yH`,`+- vc dyH 0`],[`rI`,`min rw2 rh2`],[`u1`,`*/ dxH dxH 1`],[`u2`,`*/ dyH dyH 1`],[`u3`,`*/ rI rI 1`],[`u4`,`+- u1 0 u3`],[`u5`,`+- u2 0 u3`],[`u6`,`*/ u4 u5 u1`],[`u7`,`*/ u6 1 u2`],[`u8`,`+- 1 0 u7`],[`u9`,`sqrt u8`],[`u10`,`*/ u4 1 dxH`],[`u11`,`*/ u10 1 dyH`],[`u12`,`+/ 1 u9 u11`],[`u13`,`at2 1 u12`],[`u14`,`+- u13 21600000 0`],[`u15`,`?: u13 u13 u14`],[`u16`,`+- u15 0 enAng`],[`u17`,`+- u16 21600000 0`],[`u18`,`?: u16 u16 u17`],[`u19`,`+- u18 0 cd2`],[`u20`,`+- u18 0 21600000`],[`u21`,`?: u19 u20 u18`],[`u22`,`abs u21`],[`minAng`,`*/ u22 -1 1`],[`u23`,`abs adj2`],[`a2`,`*/ u23 -1 1`],[`aAng`,`pin minAng a2 0`],[`ptAng`,`+- enAng aAng 0`],[`wtA`,`sin rw3 ptAng`],[`htA`,`cos rh3 ptAng`],[`dxA`,`cat2 rw3 htA wtA`],[`dyA`,`sat2 rh3 htA wtA`],[`xA`,`+- hc dxA 0`],[`yA`,`+- vc dyA 0`],[`wtE`,`sin rw1 stAng`],[`htE`,`cos rh1 stAng`],[`dxE`,`cat2 rw1 htE wtE`],[`dyE`,`sat2 rh1 htE wtE`],[`xE`,`+- hc dxE 0`],[`yE`,`+- vc dyE 0`],[`wtD`,`sin rw2 stAng`],[`htD`,`cos rh2 stAng`],[`dxD`,`cat2 rw2 htD wtD`],[`dyD`,`sat2 rh2 htD wtD`],[`xD`,`+- hc dxD 0`],[`yD`,`+- vc dyD 0`],[`dxG`,`cos thh ptAng`],[`dyG`,`sin thh ptAng`],[`xG`,`+- xH dxG 0`],[`yG`,`+- yH dyG 0`],[`dxB`,`cos thh ptAng`],[`dyB`,`sin thh ptAng`],[`xB`,`+- xH 0 dxB 0`],[`yB`,`+- yH 0 dyB 0`],[`sx1`,`+- xB 0 hc`],[`sy1`,`+- yB 0 vc`],[`sx2`,`+- xG 0 hc`],[`sy2`,`+- yG 0 vc`],[`rO`,`min rw1 rh1`],[`x1O`,`*/ sx1 rO rw1`],[`y1O`,`*/ sy1 rO rh1`],[`x2O`,`*/ sx2 rO rw1`],[`y2O`,`*/ sy2 rO rh1`],[`dxO`,`+- x2O 0 x1O`],[`dyO`,`+- y2O 0 y1O`],[`dO`,`mod dxO dyO 0`],[`q1`,`*/ x1O y2O 1`],[`q2`,`*/ x2O y1O 1`],[`DO`,`+- q1 0 q2`],[`q3`,`*/ rO rO 1`],[`q4`,`*/ dO dO 1`],[`q5`,`*/ q3 q4 1`],[`q6`,`*/ DO DO 1`],[`q7`,`+- q5 0 q6`],[`q8`,`max q7 0`],[`sdelO`,`sqrt q8`],[`ndyO`,`*/ dyO -1 1`],[`sdyO`,`?: ndyO -1 1`],[`q9`,`*/ sdyO dxO 1`],[`q10`,`*/ q9 sdelO 1`],[`q11`,`*/ DO dyO 1`],[`dxF1`,`+/ q11 q10 q4`],[`q12`,`+- q11 0 q10`],[`dxF2`,`*/ q12 1 q4`],[`adyO`,`abs dyO`],[`q13`,`*/ adyO sdelO 1`],[`q14`,`*/ DO dxO -1`],[`dyF1`,`+/ q14 q13 q4`],[`q15`,`+- q14 0 q13`],[`dyF2`,`*/ q15 1 q4`],[`q16`,`+- x2O 0 dxF1`],[`q17`,`+- x2O 0 dxF2`],[`q18`,`+- y2O 0 dyF1`],[`q19`,`+- y2O 0 dyF2`],[`q20`,`mod q16 q18 0`],[`q21`,`mod q17 q19 0`],[`q22`,`+- q21 0 q20`],[`dxF`,`?: q22 dxF1 dxF2`],[`dyF`,`?: q22 dyF1 dyF2`],[`sdxF`,`*/ dxF rw1 rO`],[`sdyF`,`*/ dyF rh1 rO`],[`xF`,`+- hc sdxF 0`],[`yF`,`+- vc sdyF 0`],[`x1I`,`*/ sx1 rI rw2`],[`y1I`,`*/ sy1 rI rh2`],[`x2I`,`*/ sx2 rI rw2`],[`y2I`,`*/ sy2 rI rh2`],[`dxI`,`+- x2I 0 x1I`],[`dyI`,`+- y2I 0 y1I`],[`dI`,`mod dxI dyI 0`],[`v1`,`*/ x1I y2I 1`],[`v2`,`*/ x2I y1I 1`],[`DI`,`+- v1 0 v2`],[`v3`,`*/ rI rI 1`],[`v4`,`*/ dI dI 1`],[`v5`,`*/ v3 v4 1`],[`v6`,`*/ DI DI 1`],[`v7`,`+- v5 0 v6`],[`v8`,`max v7 0`],[`sdelI`,`sqrt v8`],[`v9`,`*/ sdyO dxI 1`],[`v10`,`*/ v9 sdelI 1`],[`v11`,`*/ DI dyI 1`],[`dxC1`,`+/ v11 v10 v4`],[`v12`,`+- v11 0 v10`],[`dxC2`,`*/ v12 1 v4`],[`adyI`,`abs dyI`],[`v13`,`*/ adyI sdelI 1`],[`v14`,`*/ DI dxI -1`],[`dyC1`,`+/ v14 v13 v4`],[`v15`,`+- v14 0 v13`],[`dyC2`,`*/ v15 1 v4`],[`v16`,`+- x1I 0 dxC1`],[`v17`,`+- x1I 0 dxC2`],[`v18`,`+- y1I 0 dyC1`],[`v19`,`+- y1I 0 dyC2`],[`v20`,`mod v16 v18 0`],[`v21`,`mod v17 v19 0`],[`v22`,`+- v21 0 v20`],[`dxC`,`?: v22 dxC1 dxC2`],[`dyC`,`?: v22 dyC1 dyC2`],[`sdxC`,`*/ dxC rw2 rI`],[`sdyC`,`*/ dyC rh2 rI`],[`xC`,`+- hc sdxC 0`],[`yC`,`+- vc sdyC 0`],[`ist0`,`at2 sdxC sdyC`],[`ist1`,`+- ist0 21600000 0`],[`istAng0`,`?: ist0 ist0 ist1`],[`isw1`,`+- stAng 0 istAng0`],[`isw2`,`+- isw1 21600000 0`],[`iswAng0`,`?: isw1 isw1 isw2`],[`istAng`,`+- istAng0 iswAng0 0`],[`iswAng`,`+- 0 0 iswAng0`],[`p1`,`+- xF 0 xC`],[`p2`,`+- yF 0 yC`],[`p3`,`mod p1 p2 0`],[`p4`,`*/ p3 1 2`],[`p5`,`+- p4 0 thh`],[`xGp`,`?: p5 xF xG`],[`yGp`,`?: p5 yF yG`],[`xBp`,`?: p5 xC xB`],[`yBp`,`?: p5 yC yB`],[`en0`,`at2 sdxF sdyF`],[`en1`,`+- en0 21600000 0`],[`en2`,`?: en0 en0 en1`],[`sw0`,`+- en2 0 stAng`],[`sw1`,`+- sw0 0 21600000`],[`swAng`,`?: sw0 sw1 sw0`],[`stAng0`,`+- stAng swAng 0`],[`swAng0`,`+- 0 0 swAng`],[`wtI`,`sin rw3 stAng`],[`htI`,`cos rh3 stAng`],[`dxI`,`cat2 rw3 htI wtI`],[`dyI`,`sat2 rh3 htI wtI`],[`xI`,`+- hc dxI 0`],[`yI`,`+- vc dyI 0`],[`aI`,`+- stAng cd4 0`],[`aA`,`+- ptAng 0 cd4`],[`aB`,`+- ptAng cd2 0`],[`idx`,`cos rw1 2700000`],[`idy`,`sin rh1 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`xE`,`yE`],[`l`,`xD`,`yD`],[`a`,`rw2`,`rh2`,`istAng`,`iswAng`],[`l`,`xBp`,`yBp`],[`l`,`xA`,`yA`],[`l`,`xGp`,`yGp`],[`l`,`xF`,`yF`],[`a`,`rw1`,`rh1`,`stAng0`,`swAng0`],[`c`]]}]},leftrightarrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 50000 w ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`x2`,`*/ ss a2 100000`],[`x3`,`+- r 0 x2`],[`dy`,`*/ h a1 200000`],[`y1`,`+- vc 0 dy`],[`y2`,`+- vc dy 0`],[`dx1`,`*/ y1 x2 hd2`],[`x1`,`+- x2 0 dx1`],[`x4`,`+- x3 dx1 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`x2`,`t`],[`l`,`x2`,`y1`],[`l`,`x3`,`y1`],[`l`,`x3`,`t`],[`l`,`r`,`vc`],[`l`,`x3`,`b`],[`l`,`x3`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`b`],[`c`]]}]},leftrightarrowcallout:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 48123`]],gd:[[`maxAdj2`,`*/ 50000 h ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`*/ 50000 w ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`q2`,`*/ a3 ss wd2`],[`maxAdj4`,`+- 100000 0 q2`],[`a4`,`pin 0 adj4 maxAdj4`],[`dy1`,`*/ ss a2 100000`],[`dy2`,`*/ ss a1 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`],[`y4`,`+- vc dy1 0`],[`x1`,`*/ ss a3 100000`],[`x4`,`+- r 0 x1`],[`dx2`,`*/ w a4 200000`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`x1`,`y1`],[`l`,`x1`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`t`],[`l`,`x3`,`t`],[`l`,`x3`,`y2`],[`l`,`x4`,`y2`],[`l`,`x4`,`y1`],[`l`,`r`,`vc`],[`l`,`x4`,`y4`],[`l`,`x4`,`y3`],[`l`,`x3`,`y3`],[`l`,`x3`,`b`],[`l`,`x2`,`b`],[`l`,`x2`,`y3`],[`l`,`x1`,`y3`],[`l`,`x1`,`y4`],[`c`]]}]},leftrightcirculararrow:{adj:[[`adj1`,`val 12500`],[`adj2`,`val 1142319`],[`adj3`,`val 20457681`],[`adj4`,`val 11942319`],[`adj5`,`val 12500`]],gd:[[`a5`,`pin 0 adj5 25000`],[`maxAdj1`,`*/ a5 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`enAng`,`pin 1 adj3 21599999`],[`stAng`,`pin 0 adj4 21599999`],[`th`,`*/ ss a1 100000`],[`thh`,`*/ ss a5 100000`],[`th2`,`*/ th 1 2`],[`rw1`,`+- wd2 th2 thh`],[`rh1`,`+- hd2 th2 thh`],[`rw2`,`+- rw1 0 th`],[`rh2`,`+- rh1 0 th`],[`rw3`,`+- rw2 th2 0`],[`rh3`,`+- rh2 th2 0`],[`wtH`,`sin rw3 enAng`],[`htH`,`cos rh3 enAng`],[`dxH`,`cat2 rw3 htH wtH`],[`dyH`,`sat2 rh3 htH wtH`],[`xH`,`+- hc dxH 0`],[`yH`,`+- vc dyH 0`],[`rI`,`min rw2 rh2`],[`u1`,`*/ dxH dxH 1`],[`u2`,`*/ dyH dyH 1`],[`u3`,`*/ rI rI 1`],[`u4`,`+- u1 0 u3`],[`u5`,`+- u2 0 u3`],[`u6`,`*/ u4 u5 u1`],[`u7`,`*/ u6 1 u2`],[`u8`,`+- 1 0 u7`],[`u9`,`sqrt u8`],[`u10`,`*/ u4 1 dxH`],[`u11`,`*/ u10 1 dyH`],[`u12`,`+/ 1 u9 u11`],[`u13`,`at2 1 u12`],[`u14`,`+- u13 21600000 0`],[`u15`,`?: u13 u13 u14`],[`u16`,`+- u15 0 enAng`],[`u17`,`+- u16 21600000 0`],[`u18`,`?: u16 u16 u17`],[`u19`,`+- u18 0 cd2`],[`u20`,`+- u18 0 21600000`],[`u21`,`?: u19 u20 u18`],[`maxAng`,`abs u21`],[`aAng`,`pin 0 adj2 maxAng`],[`ptAng`,`+- enAng aAng 0`],[`wtA`,`sin rw3 ptAng`],[`htA`,`cos rh3 ptAng`],[`dxA`,`cat2 rw3 htA wtA`],[`dyA`,`sat2 rh3 htA wtA`],[`xA`,`+- hc dxA 0`],[`yA`,`+- vc dyA 0`],[`dxG`,`cos thh ptAng`],[`dyG`,`sin thh ptAng`],[`xG`,`+- xH dxG 0`],[`yG`,`+- yH dyG 0`],[`dxB`,`cos thh ptAng`],[`dyB`,`sin thh ptAng`],[`xB`,`+- xH 0 dxB 0`],[`yB`,`+- yH 0 dyB 0`],[`sx1`,`+- xB 0 hc`],[`sy1`,`+- yB 0 vc`],[`sx2`,`+- xG 0 hc`],[`sy2`,`+- yG 0 vc`],[`rO`,`min rw1 rh1`],[`x1O`,`*/ sx1 rO rw1`],[`y1O`,`*/ sy1 rO rh1`],[`x2O`,`*/ sx2 rO rw1`],[`y2O`,`*/ sy2 rO rh1`],[`dxO`,`+- x2O 0 x1O`],[`dyO`,`+- y2O 0 y1O`],[`dO`,`mod dxO dyO 0`],[`q1`,`*/ x1O y2O 1`],[`q2`,`*/ x2O y1O 1`],[`DO`,`+- q1 0 q2`],[`q3`,`*/ rO rO 1`],[`q4`,`*/ dO dO 1`],[`q5`,`*/ q3 q4 1`],[`q6`,`*/ DO DO 1`],[`q7`,`+- q5 0 q6`],[`q8`,`max q7 0`],[`sdelO`,`sqrt q8`],[`ndyO`,`*/ dyO -1 1`],[`sdyO`,`?: ndyO -1 1`],[`q9`,`*/ sdyO dxO 1`],[`q10`,`*/ q9 sdelO 1`],[`q11`,`*/ DO dyO 1`],[`dxF1`,`+/ q11 q10 q4`],[`q12`,`+- q11 0 q10`],[`dxF2`,`*/ q12 1 q4`],[`adyO`,`abs dyO`],[`q13`,`*/ adyO sdelO 1`],[`q14`,`*/ DO dxO -1`],[`dyF1`,`+/ q14 q13 q4`],[`q15`,`+- q14 0 q13`],[`dyF2`,`*/ q15 1 q4`],[`q16`,`+- x2O 0 dxF1`],[`q17`,`+- x2O 0 dxF2`],[`q18`,`+- y2O 0 dyF1`],[`q19`,`+- y2O 0 dyF2`],[`q20`,`mod q16 q18 0`],[`q21`,`mod q17 q19 0`],[`q22`,`+- q21 0 q20`],[`dxF`,`?: q22 dxF1 dxF2`],[`dyF`,`?: q22 dyF1 dyF2`],[`sdxF`,`*/ dxF rw1 rO`],[`sdyF`,`*/ dyF rh1 rO`],[`xF`,`+- hc sdxF 0`],[`yF`,`+- vc sdyF 0`],[`x1I`,`*/ sx1 rI rw2`],[`y1I`,`*/ sy1 rI rh2`],[`x2I`,`*/ sx2 rI rw2`],[`y2I`,`*/ sy2 rI rh2`],[`dxI`,`+- x2I 0 x1I`],[`dyI`,`+- y2I 0 y1I`],[`dI`,`mod dxI dyI 0`],[`v1`,`*/ x1I y2I 1`],[`v2`,`*/ x2I y1I 1`],[`DI`,`+- v1 0 v2`],[`v3`,`*/ rI rI 1`],[`v4`,`*/ dI dI 1`],[`v5`,`*/ v3 v4 1`],[`v6`,`*/ DI DI 1`],[`v7`,`+- v5 0 v6`],[`v8`,`max v7 0`],[`sdelI`,`sqrt v8`],[`v9`,`*/ sdyO dxI 1`],[`v10`,`*/ v9 sdelI 1`],[`v11`,`*/ DI dyI 1`],[`dxC1`,`+/ v11 v10 v4`],[`v12`,`+- v11 0 v10`],[`dxC2`,`*/ v12 1 v4`],[`adyI`,`abs dyI`],[`v13`,`*/ adyI sdelI 1`],[`v14`,`*/ DI dxI -1`],[`dyC1`,`+/ v14 v13 v4`],[`v15`,`+- v14 0 v13`],[`dyC2`,`*/ v15 1 v4`],[`v16`,`+- x1I 0 dxC1`],[`v17`,`+- x1I 0 dxC2`],[`v18`,`+- y1I 0 dyC1`],[`v19`,`+- y1I 0 dyC2`],[`v20`,`mod v16 v18 0`],[`v21`,`mod v17 v19 0`],[`v22`,`+- v21 0 v20`],[`dxC`,`?: v22 dxC1 dxC2`],[`dyC`,`?: v22 dyC1 dyC2`],[`sdxC`,`*/ dxC rw2 rI`],[`sdyC`,`*/ dyC rh2 rI`],[`xC`,`+- hc sdxC 0`],[`yC`,`+- vc sdyC 0`],[`wtI`,`sin rw3 stAng`],[`htI`,`cos rh3 stAng`],[`dxI`,`cat2 rw3 htI wtI`],[`dyI`,`sat2 rh3 htI wtI`],[`xI`,`+- hc dxI 0`],[`yI`,`+- vc dyI 0`],[`lptAng`,`+- stAng 0 aAng`],[`wtL`,`sin rw3 lptAng`],[`htL`,`cos rh3 lptAng`],[`dxL`,`cat2 rw3 htL wtL`],[`dyL`,`sat2 rh3 htL wtL`],[`xL`,`+- hc dxL 0`],[`yL`,`+- vc dyL 0`],[`dxK`,`cos thh lptAng`],[`dyK`,`sin thh lptAng`],[`xK`,`+- xI dxK 0`],[`yK`,`+- yI dyK 0`],[`dxJ`,`cos thh lptAng`],[`dyJ`,`sin thh lptAng`],[`xJ`,`+- xI 0 dxJ 0`],[`yJ`,`+- yI 0 dyJ 0`],[`p1`,`+- xF 0 xC`],[`p2`,`+- yF 0 yC`],[`p3`,`mod p1 p2 0`],[`p4`,`*/ p3 1 2`],[`p5`,`+- p4 0 thh`],[`xGp`,`?: p5 xF xG`],[`yGp`,`?: p5 yF yG`],[`xBp`,`?: p5 xC xB`],[`yBp`,`?: p5 yC yB`],[`en0`,`at2 sdxF sdyF`],[`en1`,`+- en0 21600000 0`],[`en2`,`?: en0 en0 en1`],[`od0`,`+- en2 0 enAng`],[`od1`,`+- od0 21600000 0`],[`od2`,`?: od0 od0 od1`],[`st0`,`+- stAng 0 od2`],[`st1`,`+- st0 21600000 0`],[`st2`,`?: st0 st0 st1`],[`sw0`,`+- en2 0 st2`],[`sw1`,`+- sw0 21600000 0`],[`swAng`,`?: sw0 sw0 sw1`],[`ist0`,`at2 sdxC sdyC`],[`ist1`,`+- ist0 21600000 0`],[`istAng`,`?: ist0 ist0 ist1`],[`id0`,`+- istAng 0 enAng`],[`id1`,`+- id0 0 21600000`],[`id2`,`?: id0 id1 id0`],[`ien0`,`+- stAng 0 id2`],[`ien1`,`+- ien0 0 21600000`],[`ien2`,`?: ien1 ien1 ien0`],[`isw1`,`+- ien2 0 istAng`],[`isw2`,`+- isw1 0 21600000`],[`iswAng`,`?: isw1 isw2 isw1`],[`wtE`,`sin rw1 st2`],[`htE`,`cos rh1 st2`],[`dxE`,`cat2 rw1 htE wtE`],[`dyE`,`sat2 rh1 htE wtE`],[`xE`,`+- hc dxE 0`],[`yE`,`+- vc dyE 0`],[`wtD`,`sin rw2 ien2`],[`htD`,`cos rh2 ien2`],[`dxD`,`cat2 rw2 htD wtD`],[`dyD`,`sat2 rh2 htD wtD`],[`xD`,`+- hc dxD 0`],[`yD`,`+- vc dyD 0`],[`xKp`,`?: p5 xE xK`],[`yKp`,`?: p5 yE yK`],[`xJp`,`?: p5 xD xJ`],[`yJp`,`?: p5 yD yJ`],[`aL`,`+- lptAng 0 cd4`],[`aA`,`+- ptAng cd4 0`],[`aB`,`+- ptAng cd2 0`],[`aJ`,`+- lptAng cd2 0`],[`idx`,`cos rw1 2700000`],[`idy`,`sin rh1 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`xL`,`yL`],[`l`,`xKp`,`yKp`],[`l`,`xE`,`yE`],[`a`,`rw1`,`rh1`,`st2`,`swAng`],[`l`,`xGp`,`yGp`],[`l`,`xA`,`yA`],[`l`,`xBp`,`yBp`],[`l`,`xC`,`yC`],[`a`,`rw2`,`rh2`,`istAng`,`iswAng`],[`l`,`xJp`,`yJp`],[`c`]]}]},leftrightribbon:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`],[`adj3`,`val 16667`]],gd:[[`a3`,`pin 0 adj3 33333`],[`maxAdj1`,`+- 100000 0 a3`],[`a1`,`pin 0 adj1 maxAdj1`],[`w1`,`+- wd2 0 wd32`],[`maxAdj2`,`*/ 100000 w1 ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`x1`,`*/ ss a2 100000`],[`x4`,`+- r 0 x1`],[`dy1`,`*/ h a1 200000`],[`dy2`,`*/ h a3 -200000`],[`ly1`,`+- vc dy2 dy1`],[`ry4`,`+- vc dy1 dy2`],[`ly2`,`+- ly1 dy1 0`],[`ry3`,`+- b 0 ly2`],[`ly4`,`*/ ly2 2 1`],[`ry1`,`+- b 0 ly4`],[`ly3`,`+- ly4 0 ly1`],[`ry2`,`+- b 0 ly3`],[`hR`,`*/ a3 ss 400000`],[`x2`,`+- hc 0 wd32`],[`x3`,`+- hc wd32 0`],[`y1`,`+- ly1 hR 0`],[`y2`,`+- ry2 0 hR`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`ly2`],[`l`,`x1`,`t`],[`l`,`x1`,`ly1`],[`l`,`hc`,`ly1`],[`a`,`wd32`,`hR`,`3cd4`,`cd2`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`x4`,`ry2`],[`l`,`x4`,`ry1`],[`l`,`r`,`ry3`],[`l`,`x4`,`b`],[`l`,`x4`,`ry4`],[`l`,`hc`,`ry4`],[`a`,`wd32`,`hR`,`cd4`,`cd4`],[`l`,`x2`,`ly3`],[`l`,`x1`,`ly3`],[`l`,`x1`,`ly4`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x3`,`y1`],[`a`,`wd32`,`hR`,`0`,`cd4`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`x3`,`ry2`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`ly2`],[`l`,`x1`,`t`],[`l`,`x1`,`ly1`],[`l`,`hc`,`ly1`],[`a`,`wd32`,`hR`,`3cd4`,`cd2`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`x4`,`ry2`],[`l`,`x4`,`ry1`],[`l`,`r`,`ry3`],[`l`,`x4`,`b`],[`l`,`x4`,`ry4`],[`l`,`hc`,`ry4`],[`a`,`wd32`,`hR`,`cd4`,`cd4`],[`l`,`x2`,`ly3`],[`l`,`x1`,`ly3`],[`l`,`x1`,`ly4`],[`c`],[`m`,`x3`,`y1`],[`l`,`x3`,`ry2`],[`m`,`x2`,`y2`],[`l`,`x2`,`ly3`]]}]},leftrightuparrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`]],gd:[[`a2`,`pin 0 adj2 50000`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`q1`,`+- 100000 0 maxAdj1`],[`maxAdj3`,`*/ q1 1 2`],[`a3`,`pin 0 adj3 maxAdj3`],[`x1`,`*/ ss a3 100000`],[`dx2`,`*/ ss a2 100000`],[`x2`,`+- hc 0 dx2`],[`x5`,`+- hc dx2 0`],[`dx3`,`*/ ss a1 200000`],[`x3`,`+- hc 0 dx3`],[`x4`,`+- hc dx3 0`],[`x6`,`+- r 0 x1`],[`dy2`,`*/ ss a2 50000`],[`y2`,`+- b 0 dy2`],[`y4`,`+- b 0 dx2`],[`y3`,`+- y4 0 dx3`],[`y5`,`+- y4 dx3 0`],[`il`,`*/ dx3 x1 dx2`],[`ir`,`+- r 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y4`],[`l`,`x1`,`y2`],[`l`,`x1`,`y3`],[`l`,`x3`,`y3`],[`l`,`x3`,`x1`],[`l`,`x2`,`x1`],[`l`,`hc`,`t`],[`l`,`x5`,`x1`],[`l`,`x4`,`x1`],[`l`,`x4`,`y3`],[`l`,`x6`,`y3`],[`l`,`x6`,`y2`],[`l`,`r`,`y4`],[`l`,`x6`,`b`],[`l`,`x6`,`y5`],[`l`,`x1`,`y5`],[`l`,`x1`,`b`],[`c`]]}]},leftuparrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`]],gd:[[`a2`,`pin 0 adj2 50000`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`+- 100000 0 maxAdj1`],[`a3`,`pin 0 adj3 maxAdj3`],[`x1`,`*/ ss a3 100000`],[`dx2`,`*/ ss a2 50000`],[`x2`,`+- r 0 dx2`],[`y2`,`+- b 0 dx2`],[`dx4`,`*/ ss a2 100000`],[`x4`,`+- r 0 dx4`],[`y4`,`+- b 0 dx4`],[`dx3`,`*/ ss a1 200000`],[`x3`,`+- x4 0 dx3`],[`x5`,`+- x4 dx3 0`],[`y3`,`+- y4 0 dx3`],[`y5`,`+- y4 dx3 0`],[`il`,`*/ dx3 x1 dx4`],[`cx1`,`+/ x1 x5 2`],[`cy1`,`+/ x1 y5 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y4`],[`l`,`x1`,`y2`],[`l`,`x1`,`y3`],[`l`,`x3`,`y3`],[`l`,`x3`,`x1`],[`l`,`x2`,`x1`],[`l`,`x4`,`t`],[`l`,`r`,`x1`],[`l`,`x5`,`x1`],[`l`,`x5`,`y5`],[`l`,`x1`,`y5`],[`l`,`x1`,`b`],[`c`]]}]},lightningbolt:{adj:[],gd:[[`x1`,`*/ w 5022 21600`],[`x3`,`*/ w 8472 21600`],[`x4`,`*/ w 8757 21600`],[`x5`,`*/ w 10012 21600`],[`x8`,`*/ w 12860 21600`],[`x9`,`*/ w 13917 21600`],[`x11`,`*/ w 16577 21600`],[`y1`,`*/ h 3890 21600`],[`y2`,`*/ h 6080 21600`],[`y4`,`*/ h 7437 21600`],[`y6`,`*/ h 9705 21600`],[`y7`,`*/ h 12007 21600`],[`y10`,`*/ h 14277 21600`],[`y11`,`*/ h 14915 21600`]],paths:[{w:21600,h:21600,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`8472`,`0`],[`l`,`12860`,`6080`],[`l`,`11050`,`6797`],[`l`,`16577`,`12007`],[`l`,`14767`,`12877`],[`l`,`21600`,`21600`],[`l`,`10012`,`14915`],[`l`,`12222`,`13987`],[`l`,`5022`,`9705`],[`l`,`7602`,`8382`],[`l`,`0`,`3890`],[`c`]]}]},line:{adj:[],gd:[],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`b`]]}]},lineinv:{adj:[],gd:[],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`r`,`t`]]}]},mathdivide:{adj:[[`adj1`,`val 23520`],[`adj2`,`val 5880`],[`adj3`,`val 11760`]],gd:[[`a1`,`pin 1000 adj1 36745`],[`ma1`,`+- 0 0 a1`],[`ma3h`,`+/ 73490 ma1 4`],[`ma3w`,`*/ 36745 w h`],[`maxAdj3`,`min ma3h ma3w`],[`a3`,`pin 1000 adj3 maxAdj3`],[`m4a3`,`*/ -4 a3 1`],[`maxAdj2`,`+- 73490 m4a3 a1`],[`a2`,`pin 0 adj2 maxAdj2`],[`dy1`,`*/ h a1 200000`],[`yg`,`*/ h a2 100000`],[`rad`,`*/ h a3 100000`],[`dx1`,`*/ w 73490 200000`],[`y3`,`+- vc 0 dy1`],[`y4`,`+- vc dy1 0`],[`a`,`+- yg rad 0`],[`y2`,`+- y3 0 a`],[`y1`,`+- y2 0 rad`],[`y5`,`+- b 0 y1`],[`x1`,`+- hc 0 dx1`],[`x3`,`+- hc dx1 0`],[`x2`,`+- hc 0 rad`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`hc`,`y1`],[`a`,`rad`,`rad`,`3cd4`,`21600000`],[`c`],[`m`,`hc`,`y5`],[`a`,`rad`,`rad`,`cd4`,`21600000`],[`c`],[`m`,`x1`,`y3`],[`l`,`x3`,`y3`],[`l`,`x3`,`y4`],[`l`,`x1`,`y4`],[`c`]]}]},mathequal:{adj:[[`adj1`,`val 23520`],[`adj2`,`val 11760`]],gd:[[`a1`,`pin 0 adj1 36745`],[`2a1`,`*/ a1 2 1`],[`mAdj2`,`+- 100000 0 2a1`],[`a2`,`pin 0 adj2 mAdj2`],[`dy1`,`*/ h a1 100000`],[`dy2`,`*/ h a2 200000`],[`dx1`,`*/ w 73490 200000`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`],[`y1`,`+- y2 0 dy1`],[`y4`,`+- y3 dy1 0`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc dx1 0`],[`yC1`,`+/ y1 y2 2`],[`yC2`,`+/ y3 y4 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y1`],[`l`,`x2`,`y2`],[`l`,`x1`,`y2`],[`c`],[`m`,`x1`,`y3`],[`l`,`x2`,`y3`],[`l`,`x2`,`y4`],[`l`,`x1`,`y4`],[`c`]]}]},mathminus:{adj:[[`adj1`,`val 23520`]],gd:[[`a1`,`pin 0 adj1 100000`],[`dy1`,`*/ h a1 200000`],[`dx1`,`*/ w 73490 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc dy1 0`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc dx1 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y1`],[`l`,`x2`,`y2`],[`l`,`x1`,`y2`],[`c`]]}]},mathmultiply:{adj:[[`adj1`,`val 23520`]],gd:[[`a1`,`pin 0 adj1 51965`],[`th`,`*/ ss a1 100000`],[`a`,`at2 w h`],[`sa`,`sin 1 a`],[`ca`,`cos 1 a`],[`ta`,`tan 1 a`],[`dl`,`mod w h 0`],[`rw`,`*/ dl 51965 100000`],[`lM`,`+- dl 0 rw`],[`xM`,`*/ ca lM 2`],[`yM`,`*/ sa lM 2`],[`dxAM`,`*/ sa th 2`],[`dyAM`,`*/ ca th 2`],[`xA`,`+- xM 0 dxAM`],[`yA`,`+- yM dyAM 0`],[`xB`,`+- xM dxAM 0`],[`yB`,`+- yM 0 dyAM`],[`xBC`,`+- hc 0 xB`],[`yBC`,`*/ xBC ta 1`],[`yC`,`+- yBC yB 0`],[`xD`,`+- r 0 xB`],[`xE`,`+- r 0 xA`],[`yFE`,`+- vc 0 yA`],[`xFE`,`*/ yFE 1 ta`],[`xF`,`+- xE 0 xFE`],[`xL`,`+- xA xFE 0`],[`yG`,`+- b 0 yA`],[`yH`,`+- b 0 yB`],[`yI`,`+- b 0 yC`],[`xC2`,`+- r 0 xM`],[`yC3`,`+- b 0 yM`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`xA`,`yA`],[`l`,`xB`,`yB`],[`l`,`hc`,`yC`],[`l`,`xD`,`yB`],[`l`,`xE`,`yA`],[`l`,`xF`,`vc`],[`l`,`xE`,`yG`],[`l`,`xD`,`yH`],[`l`,`hc`,`yI`],[`l`,`xB`,`yH`],[`l`,`xA`,`yG`],[`l`,`xL`,`vc`],[`c`]]}]},mathnotequal:{adj:[[`adj1`,`val 23520`],[`adj2`,`val 6600000`],[`adj3`,`val 11760`]],gd:[[`a1`,`pin 0 adj1 50000`],[`crAng`,`pin 4200000 adj2 6600000`],[`2a1`,`*/ a1 2 1`],[`maxAdj3`,`+- 100000 0 2a1`],[`a3`,`pin 0 adj3 maxAdj3`],[`dy1`,`*/ h a1 100000`],[`dy2`,`*/ h a3 200000`],[`dx1`,`*/ w 73490 200000`],[`x1`,`+- hc 0 dx1`],[`x8`,`+- hc dx1 0`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`],[`y1`,`+- y2 0 dy1`],[`y4`,`+- y3 dy1 0`],[`cadj2`,`+- crAng 0 cd4`],[`xadj2`,`tan hd2 cadj2`],[`len`,`mod xadj2 hd2 0`],[`bhw`,`*/ len dy1 hd2`],[`bhw2`,`*/ bhw 1 2`],[`x7`,`+- hc xadj2 bhw2`],[`dx67`,`*/ xadj2 y1 hd2`],[`x6`,`+- x7 0 dx67`],[`dx57`,`*/ xadj2 y2 hd2`],[`x5`,`+- x7 0 dx57`],[`dx47`,`*/ xadj2 y3 hd2`],[`x4`,`+- x7 0 dx47`],[`dx37`,`*/ xadj2 y4 hd2`],[`x3`,`+- x7 0 dx37`],[`dx27`,`*/ xadj2 2 1`],[`x2`,`+- x7 0 dx27`],[`rx7`,`+- x7 bhw 0`],[`rx6`,`+- x6 bhw 0`],[`rx5`,`+- x5 bhw 0`],[`rx4`,`+- x4 bhw 0`],[`rx3`,`+- x3 bhw 0`],[`rx2`,`+- x2 bhw 0`],[`dx7`,`*/ dy1 hd2 len`],[`rxt`,`+- x7 dx7 0`],[`lxt`,`+- rx7 0 dx7`],[`rx`,`?: cadj2 rxt rx7`],[`lx`,`?: cadj2 x7 lxt`],[`dy3`,`*/ dy1 xadj2 len`],[`dy4`,`+- 0 0 dy3`],[`ry`,`?: cadj2 dy3 t`],[`ly`,`?: cadj2 t dy4`],[`dlx`,`+- w 0 rx`],[`drx`,`+- w 0 lx`],[`dly`,`+- h 0 ry`],[`dry`,`+- h 0 ly`],[`xC1`,`+/ rx lx 2`],[`xC2`,`+/ drx dlx 2`],[`yC1`,`+/ ry ly 2`],[`yC2`,`+/ y1 y2 2`],[`yC3`,`+/ y3 y4 2`],[`yC4`,`+/ dry dly 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`l`,`x6`,`y1`],[`l`,`lx`,`ly`],[`l`,`rx`,`ry`],[`l`,`rx6`,`y1`],[`l`,`x8`,`y1`],[`l`,`x8`,`y2`],[`l`,`rx5`,`y2`],[`l`,`rx4`,`y3`],[`l`,`x8`,`y3`],[`l`,`x8`,`y4`],[`l`,`rx3`,`y4`],[`l`,`drx`,`dry`],[`l`,`dlx`,`dly`],[`l`,`x3`,`y4`],[`l`,`x1`,`y4`],[`l`,`x1`,`y3`],[`l`,`x4`,`y3`],[`l`,`x5`,`y2`],[`l`,`x1`,`y2`],[`c`]]}]},mathplus:{adj:[[`adj1`,`val 23520`]],gd:[[`a1`,`pin 0 adj1 73490`],[`dx1`,`*/ w 73490 200000`],[`dy1`,`*/ h 73490 200000`],[`dx2`,`*/ ss a1 200000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dx2`],[`y3`,`+- vc dx2 0`],[`y4`,`+- vc dy1 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`y1`],[`l`,`x3`,`y1`],[`l`,`x3`,`y2`],[`l`,`x4`,`y2`],[`l`,`x4`,`y3`],[`l`,`x3`,`y3`],[`l`,`x3`,`y4`],[`l`,`x2`,`y4`],[`l`,`x2`,`y3`],[`l`,`x1`,`y3`],[`c`]]}]},moon:{adj:[[`adj`,`val 50000`]],gd:[[`a`,`pin 0 adj 87500`],[`g0`,`*/ ss a 100000`],[`g0w`,`*/ g0 w ss`],[`g1`,`+- ss 0 g0`],[`g2`,`*/ g0 g0 g1`],[`g3`,`*/ ss ss g1`],[`g4`,`*/ g3 2 1`],[`g5`,`+- g4 0 g2`],[`g6`,`+- g5 0 g0`],[`g6w`,`*/ g6 w ss`],[`g7`,`*/ g5 1 2`],[`g8`,`+- g7 0 g0`],[`dy1`,`*/ g8 hd2 ss`],[`g10h`,`+- vc 0 dy1`],[`g11h`,`+- vc dy1 0`],[`g12`,`*/ g0 9598 32768`],[`g12w`,`*/ g12 w ss`],[`g13`,`+- ss 0 g12`],[`q1`,`*/ ss ss 1`],[`q2`,`*/ g13 g13 1`],[`q3`,`+- q1 0 q2`],[`q4`,`sqrt q3`],[`dy4`,`*/ q4 hd2 ss`],[`g15h`,`+- vc 0 dy4`],[`g16h`,`+- vc dy4 0`],[`g17w`,`+- g6w 0 g0w`],[`g18w`,`*/ g17w 1 2`],[`dx2p`,`+- g0w g18w w`],[`dx2`,`*/ dx2p -1 1`],[`dy2`,`*/ hd2 -1 1`],[`stAng1`,`at2 dx2 dy2`],[`enAngp1`,`at2 dx2 hd2`],[`enAng1`,`+- enAngp1 0 21600000`],[`swAng1`,`+- enAng1 0 stAng1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`r`,`b`],[`a`,`w`,`hd2`,`cd4`,`cd2`],[`a`,`g18w`,`dy1`,`stAng1`,`swAng1`],[`c`]]}]},nonisoscelestrapezoid:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`]],gd:[[`maxAdj`,`*/ 50000 w ss`],[`a1`,`pin 0 adj1 maxAdj`],[`a2`,`pin 0 adj2 maxAdj`],[`x1`,`*/ ss a1 200000`],[`x2`,`*/ ss a1 100000`],[`dx3`,`*/ ss a2 100000`],[`x3`,`+- r 0 dx3`],[`x4`,`+/ r x3 2`],[`il`,`*/ wd3 a1 maxAdj`],[`adjm`,`max a1 a2`],[`it`,`*/ hd3 adjm maxAdj`],[`irt`,`*/ wd3 a2 maxAdj`],[`ir`,`+- r 0 irt`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`x2`,`t`],[`l`,`x3`,`t`],[`l`,`r`,`b`],[`c`]]}]},nosmoking:{adj:[[`adj`,`val 18750`]],gd:[[`a`,`pin 0 adj 50000`],[`dr`,`*/ ss a 100000`],[`iwd2`,`+- wd2 0 dr`],[`ihd2`,`+- hd2 0 dr`],[`ang`,`at2 w h`],[`ct`,`cos ihd2 ang`],[`st`,`sin iwd2 ang`],[`m`,`mod ct st 0`],[`n`,`*/ iwd2 ihd2 m`],[`drd2`,`*/ dr 1 2`],[`dang`,`at2 n drd2`],[`dang2`,`*/ dang 2 1`],[`swAng`,`+- -10800000 dang2 0`],[`t3`,`at2 w h`],[`stAng1`,`+- t3 0 dang`],[`stAng2`,`+- stAng1 0 cd2`],[`ct1`,`cos ihd2 stAng1`],[`st1`,`sin iwd2 stAng1`],[`m1`,`mod ct1 st1 0`],[`n1`,`*/ iwd2 ihd2 m1`],[`dx1`,`cos n1 stAng1`],[`dy1`,`sin n1 stAng1`],[`x1`,`+- hc dx1 0`],[`y1`,`+- vc dy1 0`],[`x2`,`+- hc 0 dx1`],[`y2`,`+- vc 0 dy1`],[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`],[`m`,`x1`,`y1`],[`a`,`iwd2`,`ihd2`,`stAng1`,`swAng`],[`c`],[`m`,`x2`,`y2`],[`a`,`iwd2`,`ihd2`,`stAng2`,`swAng`],[`c`]]}]},notchedrightarrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 100000 w ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`dx2`,`*/ ss a2 100000`],[`x2`,`+- r 0 dx2`],[`dy1`,`*/ h a1 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc dy1 0`],[`x1`,`*/ dy1 dx2 hd2`],[`x3`,`+- r 0 x1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y1`],[`l`,`x2`,`y1`],[`l`,`x2`,`t`],[`l`,`r`,`vc`],[`l`,`x2`,`b`],[`l`,`x2`,`y2`],[`l`,`l`,`y2`],[`l`,`x1`,`vc`],[`c`]]}]},octagon:{adj:[[`adj`,`val 29289`]],gd:[[`a`,`pin 0 adj 50000`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`y2`,`+- b 0 x1`],[`il`,`*/ x1 1 2`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`x1`],[`l`,`x1`,`t`],[`l`,`x2`,`t`],[`l`,`r`,`x1`],[`l`,`r`,`y2`],[`l`,`x2`,`b`],[`l`,`x1`,`b`],[`l`,`l`,`y2`],[`c`]]}]},parallelogram:{adj:[[`adj`,`val 25000`]],gd:[[`maxAdj`,`*/ 100000 w ss`],[`a`,`pin 0 adj maxAdj`],[`x1`,`*/ ss a 200000`],[`x2`,`*/ ss a 100000`],[`x6`,`+- r 0 x1`],[`x5`,`+- r 0 x2`],[`x3`,`*/ x5 1 2`],[`x4`,`+- r 0 x3`],[`il`,`*/ wd2 a maxAdj`],[`q1`,`*/ 5 a maxAdj`],[`q2`,`+/ 1 q1 12`],[`il`,`*/ q2 w 1`],[`it`,`*/ q2 h 1`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 it`],[`q3`,`*/ h hc x2`],[`y1`,`pin 0 q3 h`],[`y2`,`+- b 0 y1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`x2`,`t`],[`l`,`r`,`t`],[`l`,`x5`,`b`],[`c`]]}]},pentagon:{adj:[[`hf`,`val 105146`],[`vf`,`val 110557`]],gd:[[`swd2`,`*/ wd2 hf 100000`],[`shd2`,`*/ hd2 vf 100000`],[`svc`,`*/ vc vf 100000`],[`dx1`,`cos swd2 1080000`],[`dx2`,`cos swd2 18360000`],[`dy1`,`sin shd2 1080000`],[`dy2`,`sin shd2 18360000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`y1`,`+- svc 0 dy1`],[`y2`,`+- svc 0 dy2`],[`it`,`*/ y1 dx2 dx1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`l`,`hc`,`t`],[`l`,`x4`,`y1`],[`l`,`x3`,`y2`],[`l`,`x2`,`y2`],[`c`]]}]},pie:{adj:[[`adj1`,`val 0`],[`adj2`,`val 16200000`]],gd:[[`stAng`,`pin 0 adj1 21599999`],[`enAng`,`pin 0 adj2 21599999`],[`sw1`,`+- enAng 0 stAng`],[`sw2`,`+- sw1 21600000 0`],[`swAng`,`?: sw1 sw1 sw2`],[`wt1`,`sin wd2 stAng`],[`ht1`,`cos hd2 stAng`],[`dx1`,`cat2 wd2 ht1 wt1`],[`dy1`,`sat2 hd2 ht1 wt1`],[`x1`,`+- hc dx1 0`],[`y1`,`+- vc dy1 0`],[`wt2`,`sin wd2 enAng`],[`ht2`,`cos hd2 enAng`],[`dx2`,`cat2 wd2 ht2 wt2`],[`dy2`,`sat2 hd2 ht2 wt2`],[`x2`,`+- hc dx2 0`],[`y2`,`+- vc dy2 0`],[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`a`,`wd2`,`hd2`,`stAng`,`swAng`],[`l`,`hc`,`vc`],[`c`]]}]},piewedge:{adj:[],gd:[[`g1`,`cos w 13500000`],[`g2`,`sin h 13500000`],[`x1`,`+- r g1 0`],[`y1`,`+- b g2 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`a`,`w`,`h`,`cd2`,`cd4`],[`l`,`r`,`b`],[`c`]]}]},plaque:{adj:[[`adj`,`val 16667`]],gd:[[`a`,`pin 0 adj 50000`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`y2`,`+- b 0 x1`],[`il`,`*/ x1 70711 100000`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`x1`],[`a`,`x1`,`x1`,`cd4`,`-5400000`],[`l`,`x2`,`t`],[`a`,`x1`,`x1`,`cd2`,`-5400000`],[`l`,`r`,`y2`],[`a`,`x1`,`x1`,`3cd4`,`-5400000`],[`l`,`x1`,`b`],[`a`,`x1`,`x1`,`0`,`-5400000`],[`c`]]}]},plaquetabs:{adj:[],gd:[[`md`,`mod w h 0`],[`dx`,`*/ 1 md 20`],[`y1`,`+- 0 b dx`],[`x1`,`+- 0 r dx`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`dx`,`t`],[`a`,`dx`,`dx`,`0`,`cd4`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y1`],[`a`,`dx`,`dx`,`3cd4`,`cd4`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`r`,`t`],[`l`,`r`,`dx`],[`a`,`dx`,`dx`,`cd4`,`cd4`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`b`],[`a`,`dx`,`dx`,`cd2`,`cd4`],[`l`,`r`,`b`],[`c`]]}]},plus:{adj:[[`adj`,`val 25000`]],gd:[[`a`,`pin 0 adj 50000`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`y2`,`+- b 0 x1`],[`d`,`+- w 0 h`],[`il`,`?: d l x1`],[`ir`,`?: d r x2`],[`it`,`?: d x1 t`],[`ib`,`?: d y2 b`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`x1`],[`l`,`x1`,`x1`],[`l`,`x1`,`t`],[`l`,`x2`,`t`],[`l`,`x2`,`x1`],[`l`,`r`,`x1`],[`l`,`r`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`b`],[`l`,`x1`,`b`],[`l`,`x1`,`y2`],[`l`,`l`,`y2`],[`c`]]}]},quadarrow:{adj:[[`adj1`,`val 22500`],[`adj2`,`val 22500`],[`adj3`,`val 22500`]],gd:[[`a2`,`pin 0 adj2 50000`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`q1`,`+- 100000 0 maxAdj1`],[`maxAdj3`,`*/ q1 1 2`],[`a3`,`pin 0 adj3 maxAdj3`],[`x1`,`*/ ss a3 100000`],[`dx2`,`*/ ss a2 100000`],[`x2`,`+- hc 0 dx2`],[`x5`,`+- hc dx2 0`],[`dx3`,`*/ ss a1 200000`],[`x3`,`+- hc 0 dx3`],[`x4`,`+- hc dx3 0`],[`x6`,`+- r 0 x1`],[`y2`,`+- vc 0 dx2`],[`y5`,`+- vc dx2 0`],[`y3`,`+- vc 0 dx3`],[`y4`,`+- vc dx3 0`],[`y6`,`+- b 0 x1`],[`il`,`*/ dx3 x1 dx2`],[`ir`,`+- r 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`x1`,`y2`],[`l`,`x1`,`y3`],[`l`,`x3`,`y3`],[`l`,`x3`,`x1`],[`l`,`x2`,`x1`],[`l`,`hc`,`t`],[`l`,`x5`,`x1`],[`l`,`x4`,`x1`],[`l`,`x4`,`y3`],[`l`,`x6`,`y3`],[`l`,`x6`,`y2`],[`l`,`r`,`vc`],[`l`,`x6`,`y5`],[`l`,`x6`,`y4`],[`l`,`x4`,`y4`],[`l`,`x4`,`y6`],[`l`,`x5`,`y6`],[`l`,`hc`,`b`],[`l`,`x2`,`y6`],[`l`,`x3`,`y6`],[`l`,`x3`,`y4`],[`l`,`x1`,`y4`],[`l`,`x1`,`y5`],[`c`]]}]},quadarrowcallout:{adj:[[`adj1`,`val 18515`],[`adj2`,`val 18515`],[`adj3`,`val 18515`],[`adj4`,`val 48123`]],gd:[[`a2`,`pin 0 adj2 50000`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`+- 50000 0 a2`],[`a3`,`pin 0 adj3 maxAdj3`],[`q2`,`*/ a3 2 1`],[`maxAdj4`,`+- 100000 0 q2`],[`a4`,`pin a1 adj4 maxAdj4`],[`dx2`,`*/ ss a2 100000`],[`dx3`,`*/ ss a1 200000`],[`ah`,`*/ ss a3 100000`],[`dx1`,`*/ w a4 200000`],[`dy1`,`*/ h a4 200000`],[`x8`,`+- r 0 ah`],[`x2`,`+- hc 0 dx1`],[`x7`,`+- hc dx1 0`],[`x3`,`+- hc 0 dx2`],[`x6`,`+- hc dx2 0`],[`x4`,`+- hc 0 dx3`],[`x5`,`+- hc dx3 0`],[`y8`,`+- b 0 ah`],[`y2`,`+- vc 0 dy1`],[`y7`,`+- vc dy1 0`],[`y3`,`+- vc 0 dx2`],[`y6`,`+- vc dx2 0`],[`y4`,`+- vc 0 dx3`],[`y5`,`+- vc dx3 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`ah`,`y3`],[`l`,`ah`,`y4`],[`l`,`x2`,`y4`],[`l`,`x2`,`y2`],[`l`,`x4`,`y2`],[`l`,`x4`,`ah`],[`l`,`x3`,`ah`],[`l`,`hc`,`t`],[`l`,`x6`,`ah`],[`l`,`x5`,`ah`],[`l`,`x5`,`y2`],[`l`,`x7`,`y2`],[`l`,`x7`,`y4`],[`l`,`x8`,`y4`],[`l`,`x8`,`y3`],[`l`,`r`,`vc`],[`l`,`x8`,`y6`],[`l`,`x8`,`y5`],[`l`,`x7`,`y5`],[`l`,`x7`,`y7`],[`l`,`x5`,`y7`],[`l`,`x5`,`y8`],[`l`,`x6`,`y8`],[`l`,`hc`,`b`],[`l`,`x3`,`y8`],[`l`,`x4`,`y8`],[`l`,`x4`,`y7`],[`l`,`x2`,`y7`],[`l`,`x2`,`y5`],[`l`,`ah`,`y5`],[`l`,`ah`,`y6`],[`c`]]}]},ribbon:{adj:[[`adj1`,`val 16667`],[`adj2`,`val 50000`]],gd:[[`a1`,`pin 0 adj1 33333`],[`a2`,`pin 25000 adj2 75000`],[`x10`,`+- r 0 wd8`],[`dx2`,`*/ w a2 200000`],[`x2`,`+- hc 0 dx2`],[`x9`,`+- hc dx2 0`],[`x3`,`+- x2 wd32 0`],[`x8`,`+- x9 0 wd32`],[`x5`,`+- x2 wd8 0`],[`x6`,`+- x9 0 wd8`],[`x4`,`+- x5 0 wd32`],[`x7`,`+- x6 wd32 0`],[`y1`,`*/ h a1 200000`],[`y2`,`*/ h a1 100000`],[`y4`,`+- b 0 y2`],[`y3`,`*/ y4 1 2`],[`hR`,`*/ h a1 400000`],[`y5`,`+- b 0 hR`],[`y6`,`+- y2 0 hR`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`x4`,`t`],[`a`,`wd32`,`hR`,`3cd4`,`cd2`],[`l`,`x3`,`y1`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`x8`,`y2`],[`a`,`wd32`,`hR`,`cd4`,`-10800000`],[`l`,`x7`,`y1`],[`a`,`wd32`,`hR`,`cd4`,`cd2`],[`l`,`r`,`t`],[`l`,`x10`,`y3`],[`l`,`r`,`y4`],[`l`,`x9`,`y4`],[`l`,`x9`,`y5`],[`a`,`wd32`,`hR`,`0`,`cd4`],[`l`,`x3`,`b`],[`a`,`wd32`,`hR`,`cd4`,`cd4`],[`l`,`x2`,`y4`],[`l`,`l`,`y4`],[`l`,`wd8`,`y3`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x5`,`hR`],[`a`,`wd32`,`hR`,`0`,`cd4`],[`l`,`x3`,`y1`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`x5`,`y2`],[`c`],[`m`,`x6`,`hR`],[`a`,`wd32`,`hR`,`cd2`,`-5400000`],[`l`,`x8`,`y1`],[`a`,`wd32`,`hR`,`3cd4`,`cd2`],[`l`,`x6`,`y2`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`x4`,`t`],[`a`,`wd32`,`hR`,`3cd4`,`cd2`],[`l`,`x3`,`y1`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`x8`,`y2`],[`a`,`wd32`,`hR`,`cd4`,`-10800000`],[`l`,`x7`,`y1`],[`a`,`wd32`,`hR`,`cd4`,`cd2`],[`l`,`r`,`t`],[`l`,`x10`,`y3`],[`l`,`r`,`y4`],[`l`,`x9`,`y4`],[`l`,`x9`,`y5`],[`a`,`wd32`,`hR`,`0`,`cd4`],[`l`,`x3`,`b`],[`a`,`wd32`,`hR`,`cd4`,`cd4`],[`l`,`x2`,`y4`],[`l`,`l`,`y4`],[`l`,`wd8`,`y3`],[`c`],[`m`,`x5`,`hR`],[`l`,`x5`,`y2`],[`m`,`x6`,`y2`],[`l`,`x6`,`hR`],[`m`,`x2`,`y4`],[`l`,`x2`,`y6`],[`m`,`x9`,`y6`],[`l`,`x9`,`y4`]]}]},ribbon2:{adj:[[`adj1`,`val 16667`],[`adj2`,`val 50000`]],gd:[[`a1`,`pin 0 adj1 33333`],[`a2`,`pin 25000 adj2 75000`],[`x10`,`+- r 0 wd8`],[`dx2`,`*/ w a2 200000`],[`x2`,`+- hc 0 dx2`],[`x9`,`+- hc dx2 0`],[`x3`,`+- x2 wd32 0`],[`x8`,`+- x9 0 wd32`],[`x5`,`+- x2 wd8 0`],[`x6`,`+- x9 0 wd8`],[`x4`,`+- x5 0 wd32`],[`x7`,`+- x6 wd32 0`],[`dy1`,`*/ h a1 200000`],[`y1`,`+- b 0 dy1`],[`dy2`,`*/ h a1 100000`],[`y2`,`+- b 0 dy2`],[`y4`,`+- t dy2 0`],[`y3`,`+/ y4 b 2`],[`hR`,`*/ h a1 400000`],[`y6`,`+- b 0 hR`],[`y7`,`+- y1 0 hR`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`b`],[`l`,`x4`,`b`],[`a`,`wd32`,`hR`,`cd4`,`-10800000`],[`l`,`x3`,`y1`],[`a`,`wd32`,`hR`,`cd4`,`cd2`],[`l`,`x8`,`y2`],[`a`,`wd32`,`hR`,`3cd4`,`cd2`],[`l`,`x7`,`y1`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`r`,`b`],[`l`,`x10`,`y3`],[`l`,`r`,`y4`],[`l`,`x9`,`y4`],[`l`,`x9`,`hR`],[`a`,`wd32`,`hR`,`0`,`-5400000`],[`l`,`x3`,`t`],[`a`,`wd32`,`hR`,`3cd4`,`-5400000`],[`l`,`x2`,`y4`],[`l`,`l`,`y4`],[`l`,`wd8`,`y3`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x5`,`y6`],[`a`,`wd32`,`hR`,`0`,`-5400000`],[`l`,`x3`,`y1`],[`a`,`wd32`,`hR`,`cd4`,`cd2`],[`l`,`x5`,`y2`],[`c`],[`m`,`x6`,`y6`],[`a`,`wd32`,`hR`,`cd2`,`cd4`],[`l`,`x8`,`y1`],[`a`,`wd32`,`hR`,`cd4`,`-10800000`],[`l`,`x6`,`y2`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`b`],[`l`,`wd8`,`y3`],[`l`,`l`,`y4`],[`l`,`x2`,`y4`],[`l`,`x2`,`hR`],[`a`,`wd32`,`hR`,`cd2`,`cd4`],[`l`,`x8`,`t`],[`a`,`wd32`,`hR`,`3cd4`,`cd4`],[`l`,`x9`,`y4`],[`l`,`x9`,`y4`],[`l`,`r`,`y4`],[`l`,`x10`,`y3`],[`l`,`r`,`b`],[`l`,`x7`,`b`],[`a`,`wd32`,`hR`,`cd4`,`cd2`],[`l`,`x8`,`y1`],[`a`,`wd32`,`hR`,`cd4`,`-10800000`],[`l`,`x3`,`y2`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`x4`,`y1`],[`a`,`wd32`,`hR`,`3cd4`,`cd2`],[`c`],[`m`,`x5`,`y2`],[`l`,`x5`,`y6`],[`m`,`x6`,`y6`],[`l`,`x6`,`y2`],[`m`,`x2`,`y7`],[`l`,`x2`,`y4`],[`m`,`x9`,`y4`],[`l`,`x9`,`y7`]]}]},rightarrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 100000 w ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`dx1`,`*/ ss a2 100000`],[`x1`,`+- r 0 dx1`],[`dy1`,`*/ h a1 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc dy1 0`],[`dx2`,`*/ y1 dx1 hd2`],[`x2`,`+- x1 dx2 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y1`],[`l`,`x1`,`y1`],[`l`,`x1`,`t`],[`l`,`r`,`vc`],[`l`,`x1`,`b`],[`l`,`x1`,`y2`],[`l`,`l`,`y2`],[`c`]]}]},rightarrowcallout:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 64977`]],gd:[[`maxAdj2`,`*/ 50000 h ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`*/ 100000 w ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`q2`,`*/ a3 ss w`],[`maxAdj4`,`+- 100000 0 q2`],[`a4`,`pin 0 adj4 maxAdj4`],[`dy1`,`*/ ss a2 100000`],[`dy2`,`*/ ss a1 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`],[`y4`,`+- vc dy1 0`],[`dx3`,`*/ ss a3 100000`],[`x3`,`+- r 0 dx3`],[`x2`,`*/ w a4 100000`],[`x1`,`*/ x2 1 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x2`,`t`],[`l`,`x2`,`y2`],[`l`,`x3`,`y2`],[`l`,`x3`,`y1`],[`l`,`r`,`vc`],[`l`,`x3`,`y4`],[`l`,`x3`,`y3`],[`l`,`x2`,`y3`],[`l`,`x2`,`b`],[`l`,`l`,`b`],[`c`]]}]},rightbrace:{adj:[[`adj1`,`val 8333`],[`adj2`,`val 50000`]],gd:[[`a2`,`pin 0 adj2 100000`],[`q1`,`+- 100000 0 a2`],[`q2`,`min q1 a2`],[`q3`,`*/ q2 1 2`],[`maxAdj1`,`*/ q3 h ss`],[`a1`,`pin 0 adj1 maxAdj1`],[`y1`,`*/ ss a1 100000`],[`y3`,`*/ h a2 100000`],[`y2`,`+- y3 0 y1`],[`y4`,`+- b 0 y1`],[`dx1`,`cos wd2 2700000`],[`dy1`,`sin y1 2700000`],[`ir`,`+- l dx1 0`],[`it`,`+- y1 0 dy1`],[`ib`,`+- b dy1 y1`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`a`,`wd2`,`y1`,`3cd4`,`cd4`],[`l`,`hc`,`y2`],[`a`,`wd2`,`y1`,`cd2`,`-5400000`],[`a`,`wd2`,`y1`,`3cd4`,`-5400000`],[`l`,`hc`,`y4`],[`a`,`wd2`,`y1`,`0`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`a`,`wd2`,`y1`,`3cd4`,`cd4`],[`l`,`hc`,`y2`],[`a`,`wd2`,`y1`,`cd2`,`-5400000`],[`a`,`wd2`,`y1`,`3cd4`,`-5400000`],[`l`,`hc`,`y4`],[`a`,`wd2`,`y1`,`0`,`cd4`]]}]},rightbracket:{adj:[[`adj`,`val 8333`]],gd:[[`maxAdj`,`*/ 50000 h ss`],[`a`,`pin 0 adj maxAdj`],[`y1`,`*/ ss a 100000`],[`y2`,`+- b 0 y1`],[`dx1`,`cos w 2700000`],[`dy1`,`sin y1 2700000`],[`ir`,`+- l dx1 0`],[`it`,`+- y1 0 dy1`],[`ib`,`+- b dy1 y1`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`a`,`w`,`y1`,`3cd4`,`cd4`],[`l`,`r`,`y2`],[`a`,`w`,`y1`,`0`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`a`,`w`,`y1`,`3cd4`,`cd4`],[`l`,`r`,`y2`],[`a`,`w`,`y1`,`0`,`cd4`]]}]},round1rect:{adj:[[`adj`,`val 16667`]],gd:[[`a`,`pin 0 adj 50000`],[`dx1`,`*/ ss a 100000`],[`x1`,`+- r 0 dx1`],[`idx`,`*/ dx1 29289 100000`],[`ir`,`+- r 0 idx`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`a`,`dx1`,`dx1`,`3cd4`,`cd4`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},round2diagrect:{adj:[[`adj1`,`val 16667`],[`adj2`,`val 0`]],gd:[[`a1`,`pin 0 adj1 50000`],[`a2`,`pin 0 adj2 50000`],[`x1`,`*/ ss a1 100000`],[`y1`,`+- b 0 x1`],[`a`,`*/ ss a2 100000`],[`x2`,`+- r 0 a`],[`y2`,`+- b 0 a`],[`dx1`,`*/ x1 29289 100000`],[`dx2`,`*/ a 29289 100000`],[`d`,`+- dx1 0 dx2`],[`dx`,`?: d dx1 dx2`],[`ir`,`+- r 0 dx`],[`ib`,`+- b 0 dx`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`t`],[`l`,`x2`,`t`],[`a`,`a`,`a`,`3cd4`,`cd4`],[`l`,`r`,`y1`],[`a`,`x1`,`x1`,`0`,`cd4`],[`l`,`a`,`b`],[`a`,`a`,`a`,`cd4`,`cd4`],[`l`,`l`,`x1`],[`a`,`x1`,`x1`,`cd2`,`cd4`],[`c`]]}]},round2samerect:{adj:[[`adj1`,`val 16667`],[`adj2`,`val 0`]],gd:[[`a1`,`pin 0 adj1 50000`],[`a2`,`pin 0 adj2 50000`],[`tx1`,`*/ ss a1 100000`],[`tx2`,`+- r 0 tx1`],[`bx1`,`*/ ss a2 100000`],[`bx2`,`+- r 0 bx1`],[`by1`,`+- b 0 bx1`],[`d`,`+- tx1 0 bx1`],[`tdx`,`*/ tx1 29289 100000`],[`bdx`,`*/ bx1 29289 100000`],[`il`,`?: d tdx bdx`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 bdx`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`tx1`,`t`],[`l`,`tx2`,`t`],[`a`,`tx1`,`tx1`,`3cd4`,`cd4`],[`l`,`r`,`by1`],[`a`,`bx1`,`bx1`,`0`,`cd4`],[`l`,`bx1`,`b`],[`a`,`bx1`,`bx1`,`cd4`,`cd4`],[`l`,`l`,`tx1`],[`a`,`tx1`,`tx1`,`cd2`,`cd4`],[`c`]]}]},roundrect:{adj:[[`adj`,`val 16667`]],gd:[[`a`,`pin 0 adj 50000`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`y2`,`+- b 0 x1`],[`il`,`*/ x1 29289 100000`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`x1`],[`a`,`x1`,`x1`,`cd2`,`cd4`],[`l`,`x2`,`t`],[`a`,`x1`,`x1`,`3cd4`,`cd4`],[`l`,`r`,`y2`],[`a`,`x1`,`x1`,`0`,`cd4`],[`l`,`x1`,`b`],[`a`,`x1`,`x1`,`cd4`,`cd4`],[`c`]]}]},rttriangle:{adj:[],gd:[[`it`,`*/ h 7 12`],[`ir`,`*/ w 7 12`],[`ib`,`*/ h 11 12`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`l`,`t`],[`l`,`r`,`b`],[`c`]]}]},smileyface:{adj:[[`adj`,`val 4653`]],gd:[[`a`,`pin -4653 adj 4653`],[`x1`,`*/ w 4969 21699`],[`x2`,`*/ w 6215 21600`],[`x3`,`*/ w 13135 21600`],[`x4`,`*/ w 16640 21600`],[`y1`,`*/ h 7570 21600`],[`y3`,`*/ h 16515 21600`],[`dy2`,`*/ h a 100000`],[`y2`,`+- y3 0 dy2`],[`y4`,`+- y3 dy2 0`],[`dy3`,`*/ h a 50000`],[`y5`,`+- y4 dy3 0`],[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`],[`wR`,`*/ w 1125 21600`],[`hR`,`*/ h 1125 21600`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`21600000`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x2`,`y1`],[`a`,`wR`,`hR`,`cd2`,`21600000`],[`m`,`x3`,`y1`],[`a`,`wR`,`hR`,`cd2`,`21600000`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y2`],[`Q`,`hc`,`y5`,`x4`,`y2`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`21600000`],[`c`]]}]},snip1rect:{adj:[[`adj`,`val 16667`]],gd:[[`a`,`pin 0 adj 50000`],[`dx1`,`*/ ss a 100000`],[`x1`,`+- r 0 dx1`],[`it`,`*/ dx1 1 2`],[`ir`,`+/ x1 r 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`l`,`r`,`dx1`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},snip2diagrect:{adj:[[`adj1`,`val 0`],[`adj2`,`val 16667`]],gd:[[`a1`,`pin 0 adj1 50000`],[`a2`,`pin 0 adj2 50000`],[`lx1`,`*/ ss a1 100000`],[`lx2`,`+- r 0 lx1`],[`ly1`,`+- b 0 lx1`],[`rx1`,`*/ ss a2 100000`],[`rx2`,`+- r 0 rx1`],[`ry1`,`+- b 0 rx1`],[`d`,`+- lx1 0 rx1`],[`dx`,`?: d lx1 rx1`],[`il`,`*/ dx 1 2`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`lx1`,`t`],[`l`,`rx2`,`t`],[`l`,`r`,`rx1`],[`l`,`r`,`ly1`],[`l`,`lx2`,`b`],[`l`,`rx1`,`b`],[`l`,`l`,`ry1`],[`l`,`l`,`lx1`],[`c`]]}]},snip2samerect:{adj:[[`adj1`,`val 16667`],[`adj2`,`val 0`]],gd:[[`a1`,`pin 0 adj1 50000`],[`a2`,`pin 0 adj2 50000`],[`tx1`,`*/ ss a1 100000`],[`tx2`,`+- r 0 tx1`],[`bx1`,`*/ ss a2 100000`],[`bx2`,`+- r 0 bx1`],[`by1`,`+- b 0 bx1`],[`d`,`+- tx1 0 bx1`],[`dx`,`?: d tx1 bx1`],[`il`,`*/ dx 1 2`],[`ir`,`+- r 0 il`],[`it`,`*/ tx1 1 2`],[`ib`,`+/ by1 b 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`tx1`,`t`],[`l`,`tx2`,`t`],[`l`,`r`,`tx1`],[`l`,`r`,`by1`],[`l`,`bx2`,`b`],[`l`,`bx1`,`b`],[`l`,`l`,`by1`],[`l`,`l`,`tx1`],[`c`]]}]},sniproundrect:{adj:[[`adj1`,`val 16667`],[`adj2`,`val 16667`]],gd:[[`a1`,`pin 0 adj1 50000`],[`a2`,`pin 0 adj2 50000`],[`x1`,`*/ ss a1 100000`],[`dx2`,`*/ ss a2 100000`],[`x2`,`+- r 0 dx2`],[`il`,`*/ x1 29289 100000`],[`ir`,`+/ x2 r 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`t`],[`l`,`x2`,`t`],[`l`,`r`,`dx2`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`l`,`l`,`x1`],[`a`,`x1`,`x1`,`cd2`,`cd4`],[`c`]]}]},squaretabs:{adj:[],gd:[[`md`,`mod w h 0`],[`dx`,`*/ 1 md 20`],[`y1`,`+- 0 b dx`],[`x1`,`+- 0 r dx`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`dx`,`t`],[`l`,`dx`,`dx`],[`l`,`l`,`dx`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y1`],[`l`,`dx`,`y1`],[`l`,`dx`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`t`],[`l`,`r`,`t`],[`l`,`r`,`dx`],[`l`,`x1`,`dx`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`l`,`r`,`y1`],[`l`,`r`,`b`],[`l`,`x1`,`b`],[`c`]]}]},star10:{adj:[[`adj`,`val 42533`],[`hf`,`val 105146`]],gd:[[`a`,`pin 0 adj 50000`],[`swd2`,`*/ wd2 hf 100000`],[`dx1`,`*/ swd2 95106 100000`],[`dx2`,`*/ swd2 58779 100000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`dy1`,`*/ hd2 80902 100000`],[`dy2`,`*/ hd2 30902 100000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`],[`y4`,`+- vc dy1 0`],[`iwd2`,`*/ swd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx1`,`*/ iwd2 80902 100000`],[`sdx2`,`*/ iwd2 30902 100000`],[`sdy1`,`*/ ihd2 95106 100000`],[`sdy2`,`*/ ihd2 58779 100000`],[`sx1`,`+- hc 0 iwd2`],[`sx2`,`+- hc 0 sdx1`],[`sx3`,`+- hc 0 sdx2`],[`sx4`,`+- hc sdx2 0`],[`sx5`,`+- hc sdx1 0`],[`sx6`,`+- hc iwd2 0`],[`sy1`,`+- vc 0 sdy1`],[`sy2`,`+- vc 0 sdy2`],[`sy3`,`+- vc sdy2 0`],[`sy4`,`+- vc sdy1 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y2`],[`l`,`sx2`,`sy2`],[`l`,`x2`,`y1`],[`l`,`sx3`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx4`,`sy1`],[`l`,`x3`,`y1`],[`l`,`sx5`,`sy2`],[`l`,`x4`,`y2`],[`l`,`sx6`,`vc`],[`l`,`x4`,`y3`],[`l`,`sx5`,`sy3`],[`l`,`x3`,`y4`],[`l`,`sx4`,`sy4`],[`l`,`hc`,`b`],[`l`,`sx3`,`sy4`],[`l`,`x2`,`y4`],[`l`,`sx2`,`sy3`],[`l`,`x1`,`y3`],[`l`,`sx1`,`vc`],[`c`]]}]},star12:{adj:[[`adj`,`val 37500`]],gd:[[`a`,`pin 0 adj 50000`],[`dx1`,`cos wd2 1800000`],[`dy1`,`sin hd2 3600000`],[`x1`,`+- hc 0 dx1`],[`x3`,`*/ w 3 4`],[`x4`,`+- hc dx1 0`],[`y1`,`+- vc 0 dy1`],[`y3`,`*/ h 3 4`],[`y4`,`+- vc dy1 0`],[`iwd2`,`*/ wd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx1`,`cos iwd2 900000`],[`sdx2`,`cos iwd2 2700000`],[`sdx3`,`cos iwd2 4500000`],[`sdy1`,`sin ihd2 4500000`],[`sdy2`,`sin ihd2 2700000`],[`sdy3`,`sin ihd2 900000`],[`sx1`,`+- hc 0 sdx1`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc 0 sdx3`],[`sx4`,`+- hc sdx3 0`],[`sx5`,`+- hc sdx2 0`],[`sx6`,`+- hc sdx1 0`],[`sy1`,`+- vc 0 sdy1`],[`sy2`,`+- vc 0 sdy2`],[`sy3`,`+- vc 0 sdy3`],[`sy4`,`+- vc sdy3 0`],[`sy5`,`+- vc sdy2 0`],[`sy6`,`+- vc sdy1 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`sx1`,`sy3`],[`l`,`x1`,`hd4`],[`l`,`sx2`,`sy2`],[`l`,`wd4`,`y1`],[`l`,`sx3`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx4`,`sy1`],[`l`,`x3`,`y1`],[`l`,`sx5`,`sy2`],[`l`,`x4`,`hd4`],[`l`,`sx6`,`sy3`],[`l`,`r`,`vc`],[`l`,`sx6`,`sy4`],[`l`,`x4`,`y3`],[`l`,`sx5`,`sy5`],[`l`,`x3`,`y4`],[`l`,`sx4`,`sy6`],[`l`,`hc`,`b`],[`l`,`sx3`,`sy6`],[`l`,`wd4`,`y4`],[`l`,`sx2`,`sy5`],[`l`,`x1`,`y3`],[`l`,`sx1`,`sy4`],[`c`]]}]},star16:{adj:[[`adj`,`val 37500`]],gd:[[`a`,`pin 0 adj 50000`],[`dx1`,`*/ wd2 92388 100000`],[`dx2`,`*/ wd2 70711 100000`],[`dx3`,`*/ wd2 38268 100000`],[`dy1`,`*/ hd2 92388 100000`],[`dy2`,`*/ hd2 70711 100000`],[`dy3`,`*/ hd2 38268 100000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc 0 dx3`],[`x4`,`+- hc dx3 0`],[`x5`,`+- hc dx2 0`],[`x6`,`+- hc dx1 0`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc 0 dy3`],[`y4`,`+- vc dy3 0`],[`y5`,`+- vc dy2 0`],[`y6`,`+- vc dy1 0`],[`iwd2`,`*/ wd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx1`,`*/ iwd2 98079 100000`],[`sdx2`,`*/ iwd2 83147 100000`],[`sdx3`,`*/ iwd2 55557 100000`],[`sdx4`,`*/ iwd2 19509 100000`],[`sdy1`,`*/ ihd2 98079 100000`],[`sdy2`,`*/ ihd2 83147 100000`],[`sdy3`,`*/ ihd2 55557 100000`],[`sdy4`,`*/ ihd2 19509 100000`],[`sx1`,`+- hc 0 sdx1`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc 0 sdx3`],[`sx4`,`+- hc 0 sdx4`],[`sx5`,`+- hc sdx4 0`],[`sx6`,`+- hc sdx3 0`],[`sx7`,`+- hc sdx2 0`],[`sx8`,`+- hc sdx1 0`],[`sy1`,`+- vc 0 sdy1`],[`sy2`,`+- vc 0 sdy2`],[`sy3`,`+- vc 0 sdy3`],[`sy4`,`+- vc 0 sdy4`],[`sy5`,`+- vc sdy4 0`],[`sy6`,`+- vc sdy3 0`],[`sy7`,`+- vc sdy2 0`],[`sy8`,`+- vc sdy1 0`],[`idx`,`cos iwd2 2700000`],[`idy`,`sin ihd2 2700000`],[`il`,`+- hc 0 idx`],[`it`,`+- vc 0 idy`],[`ir`,`+- hc idx 0`],[`ib`,`+- vc idy 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`sx1`,`sy4`],[`l`,`x1`,`y3`],[`l`,`sx2`,`sy3`],[`l`,`x2`,`y2`],[`l`,`sx3`,`sy2`],[`l`,`x3`,`y1`],[`l`,`sx4`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx5`,`sy1`],[`l`,`x4`,`y1`],[`l`,`sx6`,`sy2`],[`l`,`x5`,`y2`],[`l`,`sx7`,`sy3`],[`l`,`x6`,`y3`],[`l`,`sx8`,`sy4`],[`l`,`r`,`vc`],[`l`,`sx8`,`sy5`],[`l`,`x6`,`y4`],[`l`,`sx7`,`sy6`],[`l`,`x5`,`y5`],[`l`,`sx6`,`sy7`],[`l`,`x4`,`y6`],[`l`,`sx5`,`sy8`],[`l`,`hc`,`b`],[`l`,`sx4`,`sy8`],[`l`,`x3`,`y6`],[`l`,`sx3`,`sy7`],[`l`,`x2`,`y5`],[`l`,`sx2`,`sy6`],[`l`,`x1`,`y4`],[`l`,`sx1`,`sy5`],[`c`]]}]},star24:{adj:[[`adj`,`val 37500`]],gd:[[`a`,`pin 0 adj 50000`],[`dx1`,`cos wd2 900000`],[`dx2`,`cos wd2 1800000`],[`dx3`,`cos wd2 2700000`],[`dx4`,`val wd4`],[`dx5`,`cos wd2 4500000`],[`dy1`,`sin hd2 4500000`],[`dy2`,`sin hd2 3600000`],[`dy3`,`sin hd2 2700000`],[`dy4`,`val hd4`],[`dy5`,`sin hd2 900000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc 0 dx3`],[`x4`,`+- hc 0 dx4`],[`x5`,`+- hc 0 dx5`],[`x6`,`+- hc dx5 0`],[`x7`,`+- hc dx4 0`],[`x8`,`+- hc dx3 0`],[`x9`,`+- hc dx2 0`],[`x10`,`+- hc dx1 0`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc 0 dy3`],[`y4`,`+- vc 0 dy4`],[`y5`,`+- vc 0 dy5`],[`y6`,`+- vc dy5 0`],[`y7`,`+- vc dy4 0`],[`y8`,`+- vc dy3 0`],[`y9`,`+- vc dy2 0`],[`y10`,`+- vc dy1 0`],[`iwd2`,`*/ wd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx1`,`*/ iwd2 99144 100000`],[`sdx2`,`*/ iwd2 92388 100000`],[`sdx3`,`*/ iwd2 79335 100000`],[`sdx4`,`*/ iwd2 60876 100000`],[`sdx5`,`*/ iwd2 38268 100000`],[`sdx6`,`*/ iwd2 13053 100000`],[`sdy1`,`*/ ihd2 99144 100000`],[`sdy2`,`*/ ihd2 92388 100000`],[`sdy3`,`*/ ihd2 79335 100000`],[`sdy4`,`*/ ihd2 60876 100000`],[`sdy5`,`*/ ihd2 38268 100000`],[`sdy6`,`*/ ihd2 13053 100000`],[`sx1`,`+- hc 0 sdx1`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc 0 sdx3`],[`sx4`,`+- hc 0 sdx4`],[`sx5`,`+- hc 0 sdx5`],[`sx6`,`+- hc 0 sdx6`],[`sx7`,`+- hc sdx6 0`],[`sx8`,`+- hc sdx5 0`],[`sx9`,`+- hc sdx4 0`],[`sx10`,`+- hc sdx3 0`],[`sx11`,`+- hc sdx2 0`],[`sx12`,`+- hc sdx1 0`],[`sy1`,`+- vc 0 sdy1`],[`sy2`,`+- vc 0 sdy2`],[`sy3`,`+- vc 0 sdy3`],[`sy4`,`+- vc 0 sdy4`],[`sy5`,`+- vc 0 sdy5`],[`sy6`,`+- vc 0 sdy6`],[`sy7`,`+- vc sdy6 0`],[`sy8`,`+- vc sdy5 0`],[`sy9`,`+- vc sdy4 0`],[`sy10`,`+- vc sdy3 0`],[`sy11`,`+- vc sdy2 0`],[`sy12`,`+- vc sdy1 0`],[`idx`,`cos iwd2 2700000`],[`idy`,`sin ihd2 2700000`],[`il`,`+- hc 0 idx`],[`it`,`+- vc 0 idy`],[`ir`,`+- hc idx 0`],[`ib`,`+- vc idy 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`sx1`,`sy6`],[`l`,`x1`,`y5`],[`l`,`sx2`,`sy5`],[`l`,`x2`,`y4`],[`l`,`sx3`,`sy4`],[`l`,`x3`,`y3`],[`l`,`sx4`,`sy3`],[`l`,`x4`,`y2`],[`l`,`sx5`,`sy2`],[`l`,`x5`,`y1`],[`l`,`sx6`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx7`,`sy1`],[`l`,`x6`,`y1`],[`l`,`sx8`,`sy2`],[`l`,`x7`,`y2`],[`l`,`sx9`,`sy3`],[`l`,`x8`,`y3`],[`l`,`sx10`,`sy4`],[`l`,`x9`,`y4`],[`l`,`sx11`,`sy5`],[`l`,`x10`,`y5`],[`l`,`sx12`,`sy6`],[`l`,`r`,`vc`],[`l`,`sx12`,`sy7`],[`l`,`x10`,`y6`],[`l`,`sx11`,`sy8`],[`l`,`x9`,`y7`],[`l`,`sx10`,`sy9`],[`l`,`x8`,`y8`],[`l`,`sx9`,`sy10`],[`l`,`x7`,`y9`],[`l`,`sx8`,`sy11`],[`l`,`x6`,`y10`],[`l`,`sx7`,`sy12`],[`l`,`hc`,`b`],[`l`,`sx6`,`sy12`],[`l`,`x5`,`y10`],[`l`,`sx5`,`sy11`],[`l`,`x4`,`y9`],[`l`,`sx4`,`sy10`],[`l`,`x3`,`y8`],[`l`,`sx3`,`sy9`],[`l`,`x2`,`y7`],[`l`,`sx2`,`sy8`],[`l`,`x1`,`y6`],[`l`,`sx1`,`sy7`],[`c`]]}]},star32:{adj:[[`adj`,`val 37500`]],gd:[[`a`,`pin 0 adj 50000`],[`dx1`,`*/ wd2 98079 100000`],[`dx2`,`*/ wd2 92388 100000`],[`dx3`,`*/ wd2 83147 100000`],[`dx4`,`cos wd2 2700000`],[`dx5`,`*/ wd2 55557 100000`],[`dx6`,`*/ wd2 38268 100000`],[`dx7`,`*/ wd2 19509 100000`],[`dy1`,`*/ hd2 98079 100000`],[`dy2`,`*/ hd2 92388 100000`],[`dy3`,`*/ hd2 83147 100000`],[`dy4`,`sin hd2 2700000`],[`dy5`,`*/ hd2 55557 100000`],[`dy6`,`*/ hd2 38268 100000`],[`dy7`,`*/ hd2 19509 100000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc 0 dx3`],[`x4`,`+- hc 0 dx4`],[`x5`,`+- hc 0 dx5`],[`x6`,`+- hc 0 dx6`],[`x7`,`+- hc 0 dx7`],[`x8`,`+- hc dx7 0`],[`x9`,`+- hc dx6 0`],[`x10`,`+- hc dx5 0`],[`x11`,`+- hc dx4 0`],[`x12`,`+- hc dx3 0`],[`x13`,`+- hc dx2 0`],[`x14`,`+- hc dx1 0`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc 0 dy3`],[`y4`,`+- vc 0 dy4`],[`y5`,`+- vc 0 dy5`],[`y6`,`+- vc 0 dy6`],[`y7`,`+- vc 0 dy7`],[`y8`,`+- vc dy7 0`],[`y9`,`+- vc dy6 0`],[`y10`,`+- vc dy5 0`],[`y11`,`+- vc dy4 0`],[`y12`,`+- vc dy3 0`],[`y13`,`+- vc dy2 0`],[`y14`,`+- vc dy1 0`],[`iwd2`,`*/ wd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx1`,`*/ iwd2 99518 100000`],[`sdx2`,`*/ iwd2 95694 100000`],[`sdx3`,`*/ iwd2 88192 100000`],[`sdx4`,`*/ iwd2 77301 100000`],[`sdx5`,`*/ iwd2 63439 100000`],[`sdx6`,`*/ iwd2 47140 100000`],[`sdx7`,`*/ iwd2 29028 100000`],[`sdx8`,`*/ iwd2 9802 100000`],[`sdy1`,`*/ ihd2 99518 100000`],[`sdy2`,`*/ ihd2 95694 100000`],[`sdy3`,`*/ ihd2 88192 100000`],[`sdy4`,`*/ ihd2 77301 100000`],[`sdy5`,`*/ ihd2 63439 100000`],[`sdy6`,`*/ ihd2 47140 100000`],[`sdy7`,`*/ ihd2 29028 100000`],[`sdy8`,`*/ ihd2 9802 100000`],[`sx1`,`+- hc 0 sdx1`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc 0 sdx3`],[`sx4`,`+- hc 0 sdx4`],[`sx5`,`+- hc 0 sdx5`],[`sx6`,`+- hc 0 sdx6`],[`sx7`,`+- hc 0 sdx7`],[`sx8`,`+- hc 0 sdx8`],[`sx9`,`+- hc sdx8 0`],[`sx10`,`+- hc sdx7 0`],[`sx11`,`+- hc sdx6 0`],[`sx12`,`+- hc sdx5 0`],[`sx13`,`+- hc sdx4 0`],[`sx14`,`+- hc sdx3 0`],[`sx15`,`+- hc sdx2 0`],[`sx16`,`+- hc sdx1 0`],[`sy1`,`+- vc 0 sdy1`],[`sy2`,`+- vc 0 sdy2`],[`sy3`,`+- vc 0 sdy3`],[`sy4`,`+- vc 0 sdy4`],[`sy5`,`+- vc 0 sdy5`],[`sy6`,`+- vc 0 sdy6`],[`sy7`,`+- vc 0 sdy7`],[`sy8`,`+- vc 0 sdy8`],[`sy9`,`+- vc sdy8 0`],[`sy10`,`+- vc sdy7 0`],[`sy11`,`+- vc sdy6 0`],[`sy12`,`+- vc sdy5 0`],[`sy13`,`+- vc sdy4 0`],[`sy14`,`+- vc sdy3 0`],[`sy15`,`+- vc sdy2 0`],[`sy16`,`+- vc sdy1 0`],[`idx`,`cos iwd2 2700000`],[`idy`,`sin ihd2 2700000`],[`il`,`+- hc 0 idx`],[`it`,`+- vc 0 idy`],[`ir`,`+- hc idx 0`],[`ib`,`+- vc idy 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`sx1`,`sy8`],[`l`,`x1`,`y7`],[`l`,`sx2`,`sy7`],[`l`,`x2`,`y6`],[`l`,`sx3`,`sy6`],[`l`,`x3`,`y5`],[`l`,`sx4`,`sy5`],[`l`,`x4`,`y4`],[`l`,`sx5`,`sy4`],[`l`,`x5`,`y3`],[`l`,`sx6`,`sy3`],[`l`,`x6`,`y2`],[`l`,`sx7`,`sy2`],[`l`,`x7`,`y1`],[`l`,`sx8`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx9`,`sy1`],[`l`,`x8`,`y1`],[`l`,`sx10`,`sy2`],[`l`,`x9`,`y2`],[`l`,`sx11`,`sy3`],[`l`,`x10`,`y3`],[`l`,`sx12`,`sy4`],[`l`,`x11`,`y4`],[`l`,`sx13`,`sy5`],[`l`,`x12`,`y5`],[`l`,`sx14`,`sy6`],[`l`,`x13`,`y6`],[`l`,`sx15`,`sy7`],[`l`,`x14`,`y7`],[`l`,`sx16`,`sy8`],[`l`,`r`,`vc`],[`l`,`sx16`,`sy9`],[`l`,`x14`,`y8`],[`l`,`sx15`,`sy10`],[`l`,`x13`,`y9`],[`l`,`sx14`,`sy11`],[`l`,`x12`,`y10`],[`l`,`sx13`,`sy12`],[`l`,`x11`,`y11`],[`l`,`sx12`,`sy13`],[`l`,`x10`,`y12`],[`l`,`sx11`,`sy14`],[`l`,`x9`,`y13`],[`l`,`sx10`,`sy15`],[`l`,`x8`,`y14`],[`l`,`sx9`,`sy16`],[`l`,`hc`,`b`],[`l`,`sx8`,`sy16`],[`l`,`x7`,`y14`],[`l`,`sx7`,`sy15`],[`l`,`x6`,`y13`],[`l`,`sx6`,`sy14`],[`l`,`x5`,`y12`],[`l`,`sx5`,`sy13`],[`l`,`x4`,`y11`],[`l`,`sx4`,`sy12`],[`l`,`x3`,`y10`],[`l`,`sx3`,`sy11`],[`l`,`x2`,`y9`],[`l`,`sx2`,`sy10`],[`l`,`x1`,`y8`],[`l`,`sx1`,`sy9`],[`c`]]}]},star4:{adj:[[`adj`,`val 12500`]],gd:[[`a`,`pin 0 adj 50000`],[`iwd2`,`*/ wd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx`,`cos iwd2 2700000`],[`sdy`,`sin ihd2 2700000`],[`sx1`,`+- hc 0 sdx`],[`sx2`,`+- hc sdx 0`],[`sy1`,`+- vc 0 sdy`],[`sy2`,`+- vc sdy 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`sx1`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx2`,`sy1`],[`l`,`r`,`vc`],[`l`,`sx2`,`sy2`],[`l`,`hc`,`b`],[`l`,`sx1`,`sy2`],[`c`]]}]},star5:{adj:[[`adj`,`val 19098`],[`hf`,`val 105146`],[`vf`,`val 110557`]],gd:[[`a`,`pin 0 adj 50000`],[`swd2`,`*/ wd2 hf 100000`],[`shd2`,`*/ hd2 vf 100000`],[`svc`,`*/ vc vf 100000`],[`dx1`,`cos swd2 1080000`],[`dx2`,`cos swd2 18360000`],[`dy1`,`sin shd2 1080000`],[`dy2`,`sin shd2 18360000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`y1`,`+- svc 0 dy1`],[`y2`,`+- svc 0 dy2`],[`iwd2`,`*/ swd2 a 50000`],[`ihd2`,`*/ shd2 a 50000`],[`sdx1`,`cos iwd2 20520000`],[`sdx2`,`cos iwd2 3240000`],[`sdy1`,`sin ihd2 3240000`],[`sdy2`,`sin ihd2 20520000`],[`sx1`,`+- hc 0 sdx1`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc sdx2 0`],[`sx4`,`+- hc sdx1 0`],[`sy1`,`+- svc 0 sdy1`],[`sy2`,`+- svc 0 sdy2`],[`sy3`,`+- svc ihd2 0`],[`yAdj`,`+- svc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`l`,`sx2`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx3`,`sy1`],[`l`,`x4`,`y1`],[`l`,`sx4`,`sy2`],[`l`,`x3`,`y2`],[`l`,`hc`,`sy3`],[`l`,`x2`,`y2`],[`l`,`sx1`,`sy2`],[`c`]]}]},star6:{adj:[[`adj`,`val 28868`],[`hf`,`val 115470`]],gd:[[`a`,`pin 0 adj 50000`],[`swd2`,`*/ wd2 hf 100000`],[`dx1`,`cos swd2 1800000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc dx1 0`],[`y2`,`+- vc hd4 0`],[`iwd2`,`*/ swd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx2`,`*/ iwd2 1 2`],[`sx1`,`+- hc 0 iwd2`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc sdx2 0`],[`sx4`,`+- hc iwd2 0`],[`sdy1`,`sin ihd2 3600000`],[`sy1`,`+- vc 0 sdy1`],[`sy2`,`+- vc sdy1 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`hd4`],[`l`,`sx2`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx3`,`sy1`],[`l`,`x2`,`hd4`],[`l`,`sx4`,`vc`],[`l`,`x2`,`y2`],[`l`,`sx3`,`sy2`],[`l`,`hc`,`b`],[`l`,`sx2`,`sy2`],[`l`,`x1`,`y2`],[`l`,`sx1`,`vc`],[`c`]]}]},star7:{adj:[[`adj`,`val 34601`],[`hf`,`val 102572`],[`vf`,`val 105210`]],gd:[[`a`,`pin 0 adj 50000`],[`swd2`,`*/ wd2 hf 100000`],[`shd2`,`*/ hd2 vf 100000`],[`svc`,`*/ vc vf 100000`],[`dx1`,`*/ swd2 97493 100000`],[`dx2`,`*/ swd2 78183 100000`],[`dx3`,`*/ swd2 43388 100000`],[`dy1`,`*/ shd2 62349 100000`],[`dy2`,`*/ shd2 22252 100000`],[`dy3`,`*/ shd2 90097 100000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc 0 dx3`],[`x4`,`+- hc dx3 0`],[`x5`,`+- hc dx2 0`],[`x6`,`+- hc dx1 0`],[`y1`,`+- svc 0 dy1`],[`y2`,`+- svc dy2 0`],[`y3`,`+- svc dy3 0`],[`iwd2`,`*/ swd2 a 50000`],[`ihd2`,`*/ shd2 a 50000`],[`sdx1`,`*/ iwd2 97493 100000`],[`sdx2`,`*/ iwd2 78183 100000`],[`sdx3`,`*/ iwd2 43388 100000`],[`sx1`,`+- hc 0 sdx1`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc 0 sdx3`],[`sx4`,`+- hc sdx3 0`],[`sx5`,`+- hc sdx2 0`],[`sx6`,`+- hc sdx1 0`],[`sdy1`,`*/ ihd2 90097 100000`],[`sdy2`,`*/ ihd2 22252 100000`],[`sdy3`,`*/ ihd2 62349 100000`],[`sy1`,`+- svc 0 sdy1`],[`sy2`,`+- svc 0 sdy2`],[`sy3`,`+- svc sdy3 0`],[`sy4`,`+- svc ihd2 0`],[`yAdj`,`+- svc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y2`],[`l`,`sx1`,`sy2`],[`l`,`x2`,`y1`],[`l`,`sx3`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx4`,`sy1`],[`l`,`x5`,`y1`],[`l`,`sx6`,`sy2`],[`l`,`x6`,`y2`],[`l`,`sx5`,`sy3`],[`l`,`x4`,`y3`],[`l`,`hc`,`sy4`],[`l`,`x3`,`y3`],[`l`,`sx2`,`sy3`],[`c`]]}]},star8:{adj:[[`adj`,`val 37500`]],gd:[[`a`,`pin 0 adj 50000`],[`dx1`,`cos wd2 2700000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc dx1 0`],[`dy1`,`sin hd2 2700000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc dy1 0`],[`iwd2`,`*/ wd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx1`,`*/ iwd2 92388 100000`],[`sdx2`,`*/ iwd2 38268 100000`],[`sdy1`,`*/ ihd2 92388 100000`],[`sdy2`,`*/ ihd2 38268 100000`],[`sx1`,`+- hc 0 sdx1`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc sdx2 0`],[`sx4`,`+- hc sdx1 0`],[`sy1`,`+- vc 0 sdy1`],[`sy2`,`+- vc 0 sdy2`],[`sy3`,`+- vc sdy2 0`],[`sy4`,`+- vc sdy1 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`sx1`,`sy2`],[`l`,`x1`,`y1`],[`l`,`sx2`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx3`,`sy1`],[`l`,`x2`,`y1`],[`l`,`sx4`,`sy2`],[`l`,`r`,`vc`],[`l`,`sx4`,`sy3`],[`l`,`x2`,`y2`],[`l`,`sx3`,`sy4`],[`l`,`hc`,`b`],[`l`,`sx2`,`sy4`],[`l`,`x1`,`y2`],[`l`,`sx1`,`sy3`],[`c`]]}]},straightconnector1:{adj:[],gd:[],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`b`]]}]},stripedrightarrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 84375 w ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`x4`,`*/ ss 5 32`],[`dx5`,`*/ ss a2 100000`],[`x5`,`+- r 0 dx5`],[`dy1`,`*/ h a1 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc dy1 0`],[`dx6`,`*/ dy1 dx5 hd2`],[`x6`,`+- r 0 dx6`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y1`],[`l`,`ssd32`,`y1`],[`l`,`ssd32`,`y2`],[`l`,`l`,`y2`],[`c`],[`m`,`ssd16`,`y1`],[`l`,`ssd8`,`y1`],[`l`,`ssd8`,`y2`],[`l`,`ssd16`,`y2`],[`c`],[`m`,`x4`,`y1`],[`l`,`x5`,`y1`],[`l`,`x5`,`t`],[`l`,`r`,`vc`],[`l`,`x5`,`b`],[`l`,`x5`,`y2`],[`l`,`x4`,`y2`],[`c`]]}]},sun:{adj:[[`adj`,`val 25000`]],gd:[[`a`,`pin 12500 adj 46875`],[`g0`,`+- 50000 0 a`],[`g1`,`*/ g0 30274 32768`],[`g2`,`*/ g0 12540 32768`],[`g3`,`+- g1 50000 0`],[`g4`,`+- g2 50000 0`],[`g5`,`+- 50000 0 g1`],[`g6`,`+- 50000 0 g2`],[`g7`,`*/ g0 23170 32768`],[`g8`,`+- 50000 g7 0`],[`g9`,`+- 50000 0 g7`],[`g10`,`*/ g5 3 4`],[`g11`,`*/ g6 3 4`],[`g12`,`+- g10 3662 0`],[`g13`,`+- g11 3662 0`],[`g14`,`+- g11 12500 0`],[`g15`,`+- 100000 0 g10`],[`g16`,`+- 100000 0 g12`],[`g17`,`+- 100000 0 g13`],[`g18`,`+- 100000 0 g14`],[`ox1`,`*/ w 18436 21600`],[`oy1`,`*/ h 3163 21600`],[`ox2`,`*/ w 3163 21600`],[`oy2`,`*/ h 18436 21600`],[`x8`,`*/ w g8 100000`],[`x9`,`*/ w g9 100000`],[`x10`,`*/ w g10 100000`],[`x12`,`*/ w g12 100000`],[`x13`,`*/ w g13 100000`],[`x14`,`*/ w g14 100000`],[`x15`,`*/ w g15 100000`],[`x16`,`*/ w g16 100000`],[`x17`,`*/ w g17 100000`],[`x18`,`*/ w g18 100000`],[`x19`,`*/ w a 100000`],[`wR`,`*/ w g0 100000`],[`hR`,`*/ h g0 100000`],[`y8`,`*/ h g8 100000`],[`y9`,`*/ h g9 100000`],[`y10`,`*/ h g10 100000`],[`y12`,`*/ h g12 100000`],[`y13`,`*/ h g13 100000`],[`y14`,`*/ h g14 100000`],[`y15`,`*/ h g15 100000`],[`y16`,`*/ h g16 100000`],[`y17`,`*/ h g17 100000`],[`y18`,`*/ h g18 100000`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`r`,`vc`],[`l`,`x15`,`y18`],[`l`,`x15`,`y14`],[`c`],[`m`,`ox1`,`oy1`],[`l`,`x16`,`y13`],[`l`,`x17`,`y12`],[`c`],[`m`,`hc`,`t`],[`l`,`x18`,`y10`],[`l`,`x14`,`y10`],[`c`],[`m`,`ox2`,`oy1`],[`l`,`x13`,`y12`],[`l`,`x12`,`y13`],[`c`],[`m`,`l`,`vc`],[`l`,`x10`,`y14`],[`l`,`x10`,`y18`],[`c`],[`m`,`ox2`,`oy2`],[`l`,`x12`,`y17`],[`l`,`x13`,`y16`],[`c`],[`m`,`hc`,`b`],[`l`,`x14`,`y15`],[`l`,`x18`,`y15`],[`c`],[`m`,`ox1`,`oy2`],[`l`,`x17`,`y16`],[`l`,`x16`,`y17`],[`c`],[`m`,`x19`,`vc`],[`a`,`wR`,`hR`,`cd2`,`21600000`],[`c`]]}]},swoosharrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 16667`]],gd:[[`a1`,`pin 1 adj1 75000`],[`maxAdj2`,`*/ 70000 w ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`ad1`,`*/ h a1 100000`],[`ad2`,`*/ ss a2 100000`],[`xB`,`+- r 0 ad2`],[`yB`,`+- t ssd8 0`],[`alfa`,`*/ cd4 1 14`],[`dx0`,`tan ssd8 alfa`],[`xC`,`+- xB 0 dx0`],[`dx1`,`tan ad1 alfa`],[`yF`,`+- yB ad1 0`],[`xF`,`+- xB dx1 0`],[`xE`,`+- xF dx0 0`],[`yE`,`+- yF ssd8 0`],[`dy2`,`+- yE 0 t`],[`dy22`,`*/ dy2 1 2`],[`dy3`,`*/ h 1 20`],[`yD`,`+- t dy22 dy3`],[`dy4`,`*/ hd6 1 1`],[`yP1`,`+- hd6 dy4 0`],[`xP1`,`val wd6`],[`dy5`,`*/ hd6 1 2`],[`yP2`,`+- yF dy5 0`],[`xP2`,`val wd4`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`Q`,`xP1`,`yP1`,`xB`,`yB`],[`l`,`xC`,`t`],[`l`,`r`,`yD`],[`l`,`xE`,`yE`],[`l`,`xF`,`yF`],[`Q`,`xP2`,`yP2`,`l`,`b`],[`c`]]}]},teardrop:{adj:[[`adj`,`val 100000`]],gd:[[`a`,`pin 0 adj 200000`],[`r2`,`sqrt 2`],[`tw`,`*/ wd2 r2 1`],[`th`,`*/ hd2 r2 1`],[`sw`,`*/ tw a 100000`],[`sh`,`*/ th a 100000`],[`dx1`,`cos sw 2700000`],[`dy1`,`sin sh 2700000`],[`x1`,`+- hc dx1 0`],[`y1`,`+- vc 0 dy1`],[`x2`,`+/ hc x1 2`],[`y2`,`+/ vc y1 2`],[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`Q`,`x2`,`t`,`x1`,`y1`],[`Q`,`r`,`y2`,`r`,`vc`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`]]}]},trapezoid:{adj:[[`adj`,`val 25000`]],gd:[[`maxAdj`,`*/ 50000 w ss`],[`a`,`pin 0 adj maxAdj`],[`x1`,`*/ ss a 200000`],[`x2`,`*/ ss a 100000`],[`x3`,`+- r 0 x2`],[`x4`,`+- r 0 x1`],[`il`,`*/ wd3 a maxAdj`],[`it`,`*/ hd3 a maxAdj`],[`ir`,`+- r 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`x2`,`t`],[`l`,`x3`,`t`],[`l`,`r`,`b`],[`c`]]}]},triangle:{adj:[[`adj`,`val 50000`]],gd:[[`a`,`pin 0 adj 100000`],[`x1`,`*/ w a 200000`],[`x2`,`*/ w a 100000`],[`x3`,`+- x1 wd2 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`x2`,`t`],[`l`,`r`,`b`],[`c`]]}]},uparrowcallout:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 64977`]],gd:[[`maxAdj2`,`*/ 50000 w ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`*/ 100000 h ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`q2`,`*/ a3 ss h`],[`maxAdj4`,`+- 100000 0 q2`],[`a4`,`pin 0 adj4 maxAdj4`],[`dx1`,`*/ ss a2 100000`],[`dx2`,`*/ ss a1 200000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`y1`,`*/ ss a3 100000`],[`dy2`,`*/ h a4 100000`],[`y2`,`+- b 0 dy2`],[`y3`,`+/ y2 b 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`y1`],[`l`,`x1`,`y1`],[`l`,`hc`,`t`],[`l`,`x4`,`y1`],[`l`,`x3`,`y1`],[`l`,`x3`,`y2`],[`l`,`r`,`y2`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},updownarrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 50000 h ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`y2`,`*/ ss a2 100000`],[`y3`,`+- b 0 y2`],[`dx1`,`*/ w a1 200000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc dx1 0`],[`dy1`,`*/ x1 y2 wd2`],[`y1`,`+- y2 0 dy1`],[`y4`,`+- y3 dy1 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y2`],[`l`,`hc`,`t`],[`l`,`r`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`y3`],[`l`,`r`,`y3`],[`l`,`hc`,`b`],[`l`,`l`,`y3`],[`l`,`x1`,`y3`],[`l`,`x1`,`y2`],[`c`]]}]},uparrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 100000 h ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`dy2`,`*/ ss a2 100000`],[`y2`,`+- t dy2 0`],[`dx1`,`*/ w a1 200000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc dx1 0`],[`dy1`,`*/ x1 dy2 wd2`],[`y1`,`+- y2 0 dy1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y2`],[`l`,`hc`,`t`],[`l`,`r`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`b`],[`l`,`x1`,`b`],[`l`,`x1`,`y2`],[`c`]]}]},updownarrowcallout:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 48123`]],gd:[[`maxAdj2`,`*/ 50000 w ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`*/ 50000 h ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`q2`,`*/ a3 ss hd2`],[`maxAdj4`,`+- 100000 0 q2`],[`a4`,`pin 0 adj4 maxAdj4`],[`dx1`,`*/ ss a2 100000`],[`dx2`,`*/ ss a1 200000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`y1`,`*/ ss a3 100000`],[`y4`,`+- b 0 y1`],[`dy2`,`*/ h a4 200000`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`y1`],[`l`,`x1`,`y1`],[`l`,`hc`,`t`],[`l`,`x4`,`y1`],[`l`,`x3`,`y1`],[`l`,`x3`,`y2`],[`l`,`r`,`y2`],[`l`,`r`,`y3`],[`l`,`x3`,`y3`],[`l`,`x3`,`y4`],[`l`,`x4`,`y4`],[`l`,`hc`,`b`],[`l`,`x1`,`y4`],[`l`,`x2`,`y4`],[`l`,`x2`,`y3`],[`l`,`l`,`y3`],[`c`]]}]},uturnarrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 43750`],[`adj5`,`val 75000`]],gd:[[`a2`,`pin 0 adj2 25000`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`q2`,`*/ a1 ss h`],[`q3`,`+- 100000 0 q2`],[`maxAdj3`,`*/ q3 h ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`q1`,`+- a3 a1 0`],[`minAdj5`,`*/ q1 ss h`],[`a5`,`pin minAdj5 adj5 100000`],[`th`,`*/ ss a1 100000`],[`aw2`,`*/ ss a2 100000`],[`th2`,`*/ th 1 2`],[`dh2`,`+- aw2 0 th2`],[`y5`,`*/ h a5 100000`],[`ah`,`*/ ss a3 100000`],[`y4`,`+- y5 0 ah`],[`x9`,`+- r 0 dh2`],[`bw`,`*/ x9 1 2`],[`bs`,`min bw y4`],[`maxAdj4`,`*/ bs 100000 ss`],[`a4`,`pin 0 adj4 maxAdj4`],[`bd`,`*/ ss a4 100000`],[`bd3`,`+- bd 0 th`],[`bd2`,`max bd3 0`],[`x3`,`+- th bd2 0`],[`x8`,`+- r 0 aw2`],[`x6`,`+- x8 0 aw2`],[`x7`,`+- x6 dh2 0`],[`x4`,`+- x9 0 bd`],[`x5`,`+- x7 0 bd2`],[`cx`,`+/ th x7 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`l`,`bd`],[`a`,`bd`,`bd`,`cd2`,`cd4`],[`l`,`x4`,`t`],[`a`,`bd`,`bd`,`3cd4`,`cd4`],[`l`,`x9`,`y4`],[`l`,`r`,`y4`],[`l`,`x8`,`y5`],[`l`,`x6`,`y4`],[`l`,`x7`,`y4`],[`l`,`x7`,`x3`],[`a`,`bd2`,`bd2`,`0`,`-5400000`],[`l`,`x3`,`th`],[`a`,`bd2`,`bd2`,`3cd4`,`-5400000`],[`l`,`th`,`b`],[`c`]]}]},verticalscroll:{adj:[[`adj`,`val 12500`]],gd:[[`a`,`pin 0 adj 25000`],[`ch`,`*/ ss a 100000`],[`ch2`,`*/ ch 1 2`],[`ch4`,`*/ ch 1 4`],[`x3`,`+- ch ch2 0`],[`x4`,`+- ch ch 0`],[`x6`,`+- r 0 ch`],[`x7`,`+- r 0 ch2`],[`x5`,`+- x6 0 ch2`],[`y3`,`+- b 0 ch`],[`y4`,`+- b 0 ch2`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`ch2`,`b`],[`a`,`ch2`,`ch2`,`cd4`,`-5400000`],[`l`,`ch2`,`y4`],[`a`,`ch4`,`ch4`,`cd4`,`-10800000`],[`l`,`ch`,`y3`],[`l`,`ch`,`ch2`],[`a`,`ch2`,`ch2`,`cd2`,`cd4`],[`l`,`x7`,`t`],[`a`,`ch2`,`ch2`,`3cd4`,`cd2`],[`l`,`x6`,`ch`],[`l`,`x6`,`y4`],[`a`,`ch2`,`ch2`,`0`,`cd4`],[`c`],[`m`,`x4`,`ch2`],[`a`,`ch2`,`ch2`,`0`,`cd4`],[`a`,`ch4`,`ch4`,`cd4`,`cd2`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x4`,`ch2`],[`a`,`ch2`,`ch2`,`0`,`cd4`],[`a`,`ch4`,`ch4`,`cd4`,`cd2`],[`c`],[`m`,`ch`,`y4`],[`a`,`ch2`,`ch2`,`0`,`3cd4`],[`a`,`ch4`,`ch4`,`3cd4`,`cd2`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`ch`,`y3`],[`l`,`ch`,`ch2`],[`a`,`ch2`,`ch2`,`cd2`,`cd4`],[`l`,`x7`,`t`],[`a`,`ch2`,`ch2`,`3cd4`,`cd2`],[`l`,`x6`,`ch`],[`l`,`x6`,`y4`],[`a`,`ch2`,`ch2`,`0`,`cd4`],[`l`,`ch2`,`b`],[`a`,`ch2`,`ch2`,`cd4`,`cd2`],[`c`],[`m`,`x3`,`t`],[`a`,`ch2`,`ch2`,`3cd4`,`cd2`],[`a`,`ch4`,`ch4`,`cd4`,`cd2`],[`l`,`x4`,`ch2`],[`m`,`x6`,`ch`],[`l`,`x3`,`ch`],[`m`,`ch2`,`y3`],[`a`,`ch4`,`ch4`,`3cd4`,`cd2`],[`l`,`ch`,`y4`],[`m`,`ch2`,`b`],[`a`,`ch2`,`ch2`,`cd4`,`-5400000`],[`l`,`ch`,`y3`]]}]},wave:{adj:[[`adj1`,`val 12500`],[`adj2`,`val 0`]],gd:[[`a1`,`pin 0 adj1 20000`],[`a2`,`pin -10000 adj2 10000`],[`y1`,`*/ h a1 100000`],[`dy2`,`*/ y1 10 3`],[`y2`,`+- y1 0 dy2`],[`y3`,`+- y1 dy2 0`],[`y4`,`+- b 0 y1`],[`y5`,`+- y4 0 dy2`],[`y6`,`+- y4 dy2 0`],[`dx1`,`*/ w a2 100000`],[`of2`,`*/ w a2 50000`],[`x1`,`abs dx1`],[`dx2`,`?: of2 0 of2`],[`x2`,`+- l 0 dx2`],[`dx5`,`?: of2 of2 0`],[`x5`,`+- r 0 dx5`],[`dx3`,`+/ dx2 x5 3`],[`x3`,`+- x2 dx3 0`],[`x4`,`+/ x3 x5 2`],[`x6`,`+- l dx5 0`],[`x10`,`+- r dx2 0`],[`x7`,`+- x6 dx3 0`],[`x8`,`+/ x7 x10 2`],[`x9`,`+- r 0 x1`],[`xAdj`,`+- hc dx1 0`],[`xAdj2`,`+- hc 0 dx1`],[`il`,`max x2 x6`],[`ir`,`min x5 x10`],[`it`,`*/ h a1 50000`],[`ib`,`+- b 0 it`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x2`,`y1`],[`C`,`x3`,`y2`,`x4`,`y3`,`x5`,`y1`],[`l`,`x10`,`y4`],[`C`,`x8`,`y6`,`x7`,`y5`,`x6`,`y4`],[`c`]]}]},wedgeellipsecallout:{adj:[[`adj1`,`val -20833`],[`adj2`,`val 62500`]],gd:[[`dxPos`,`*/ w adj1 100000`],[`dyPos`,`*/ h adj2 100000`],[`xPos`,`+- hc dxPos 0`],[`yPos`,`+- vc dyPos 0`],[`sdx`,`*/ dxPos h 1`],[`sdy`,`*/ dyPos w 1`],[`pang`,`at2 sdx sdy`],[`stAng`,`+- pang 660000 0`],[`enAng`,`+- pang 0 660000`],[`dx1`,`cos wd2 stAng`],[`dy1`,`sin hd2 stAng`],[`x1`,`+- hc dx1 0`],[`y1`,`+- vc dy1 0`],[`dx2`,`cos wd2 enAng`],[`dy2`,`sin hd2 enAng`],[`x2`,`+- hc dx2 0`],[`y2`,`+- vc dy2 0`],[`stAng1`,`at2 dx1 dy1`],[`enAng1`,`at2 dx2 dy2`],[`swAng1`,`+- enAng1 0 stAng1`],[`swAng2`,`+- swAng1 21600000 0`],[`swAng`,`?: swAng1 swAng1 swAng2`],[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`xPos`,`yPos`],[`l`,`x1`,`y1`],[`a`,`wd2`,`hd2`,`stAng1`,`swAng`],[`c`]]}]},wedgerectcallout:{adj:[[`adj1`,`val -20833`],[`adj2`,`val 62500`]],gd:[[`dxPos`,`*/ w adj1 100000`],[`dyPos`,`*/ h adj2 100000`],[`xPos`,`+- hc dxPos 0`],[`yPos`,`+- vc dyPos 0`],[`dx`,`+- xPos 0 hc`],[`dy`,`+- yPos 0 vc`],[`dq`,`*/ dxPos h w`],[`ady`,`abs dyPos`],[`adq`,`abs dq`],[`dz`,`+- ady 0 adq`],[`xg1`,`?: dxPos 7 2`],[`xg2`,`?: dxPos 10 5`],[`x1`,`*/ w xg1 12`],[`x2`,`*/ w xg2 12`],[`yg1`,`?: dyPos 7 2`],[`yg2`,`?: dyPos 10 5`],[`y1`,`*/ h yg1 12`],[`y2`,`*/ h yg2 12`],[`t1`,`?: dxPos l xPos`],[`xl`,`?: dz l t1`],[`t2`,`?: dyPos x1 xPos`],[`xt`,`?: dz t2 x1`],[`t3`,`?: dxPos xPos r`],[`xr`,`?: dz r t3`],[`t4`,`?: dyPos xPos x1`],[`xb`,`?: dz t4 x1`],[`t5`,`?: dxPos y1 yPos`],[`yl`,`?: dz y1 t5`],[`t6`,`?: dyPos t yPos`],[`yt`,`?: dz t6 t`],[`t7`,`?: dxPos yPos y1`],[`yr`,`?: dz y1 t7`],[`t8`,`?: dyPos yPos b`],[`yb`,`?: dz t8 b`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`l`,`xt`,`yt`],[`l`,`x2`,`t`],[`l`,`r`,`t`],[`l`,`r`,`y1`],[`l`,`xr`,`yr`],[`l`,`r`,`y2`],[`l`,`r`,`b`],[`l`,`x2`,`b`],[`l`,`xb`,`yb`],[`l`,`x1`,`b`],[`l`,`l`,`b`],[`l`,`l`,`y2`],[`l`,`xl`,`yl`],[`l`,`l`,`y1`],[`c`]]}]},wedgeroundrectcallout:{adj:[[`adj1`,`val -20833`],[`adj2`,`val 62500`],[`adj3`,`val 16667`]],gd:[[`dxPos`,`*/ w adj1 100000`],[`dyPos`,`*/ h adj2 100000`],[`xPos`,`+- hc dxPos 0`],[`yPos`,`+- vc dyPos 0`],[`dq`,`*/ dxPos h w`],[`ady`,`abs dyPos`],[`adq`,`abs dq`],[`dz`,`+- ady 0 adq`],[`xg1`,`?: dxPos 7 2`],[`xg2`,`?: dxPos 10 5`],[`x1`,`*/ w xg1 12`],[`x2`,`*/ w xg2 12`],[`yg1`,`?: dyPos 7 2`],[`yg2`,`?: dyPos 10 5`],[`y1`,`*/ h yg1 12`],[`y2`,`*/ h yg2 12`],[`t1`,`?: dxPos l xPos`],[`xl`,`?: dz l t1`],[`t2`,`?: dyPos x1 xPos`],[`xt`,`?: dz t2 x1`],[`t3`,`?: dxPos xPos r`],[`xr`,`?: dz r t3`],[`t4`,`?: dyPos xPos x1`],[`xb`,`?: dz t4 x1`],[`t5`,`?: dxPos y1 yPos`],[`yl`,`?: dz y1 t5`],[`t6`,`?: dyPos t yPos`],[`yt`,`?: dz t6 t`],[`t7`,`?: dxPos yPos y1`],[`yr`,`?: dz y1 t7`],[`t8`,`?: dyPos yPos b`],[`yb`,`?: dz t8 b`],[`u1`,`*/ ss adj3 100000`],[`u2`,`+- r 0 u1`],[`v2`,`+- b 0 u1`],[`il`,`*/ u1 29289 100000`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`u1`],[`a`,`u1`,`u1`,`cd2`,`cd4`],[`l`,`x1`,`t`],[`l`,`xt`,`yt`],[`l`,`x2`,`t`],[`l`,`u2`,`t`],[`a`,`u1`,`u1`,`3cd4`,`cd4`],[`l`,`r`,`y1`],[`l`,`xr`,`yr`],[`l`,`r`,`y2`],[`l`,`r`,`v2`],[`a`,`u1`,`u1`,`0`,`cd4`],[`l`,`x2`,`b`],[`l`,`xb`,`yb`],[`l`,`x1`,`b`],[`l`,`u1`,`b`],[`a`,`u1`,`u1`,`cd4`,`cd4`],[`l`,`l`,`y2`],[`l`,`xl`,`yl`],[`l`,`l`,`y1`],[`c`]]}]}};const Un=216e5,Wn=Math.PI*2/Un;function Gn(e){let t=e.trim().split(/\\s+/);return{op:t[0],argTokens:t.slice(1)}}function Kn(e,t,n){let{w:r,h:i,adj:a}=e,o=Math.min(r,i),s=Math.max(r,i),c=Object.create(null);Object.assign(c,{w:r,h:i,l:0,t:0,r,b:i,hc:r/2,vc:i/2,wd2:r/2,wd3:r/3,wd4:r/4,wd5:r/5,wd6:r/6,wd8:r/8,wd10:r/10,wd12:r/12,wd16:r/16,wd32:r/32,hd2:i/2,hd3:i/3,hd4:i/4,hd5:i/5,hd6:i/6,hd8:i/8,hd10:i/10,hd12:i/12,hd16:i/16,hd32:i/32,ss:o,ssd2:o/2,ssd4:o/4,ssd6:o/6,ssd8:o/8,ssd16:o/16,ssd32:o/32,ls:s,lsd2:s/2,lsd4:s/4,lsd6:s/6,lsd8:s/8,lsd16:s/16,lsd32:s/32,cd:Un,cd2:Un/2,cd4:Un/4,cd8:Un/8,\"3cd4\":3*Un/4,\"3cd8\":3*Un/8,\"5cd8\":5*Un/8,\"7cd8\":7*Un/8}),t.forEach(([e,t],n)=>{let r=a[n];c[e]=typeof r==`number`?r:u(t),e===`adj`&&(c.adj1=c.adj),e===`adj1`&&(c.adj=c.adj1)});for(let[e,t]of n)c[e]=u(t);return{v:e=>{if(e in c)return c[e];throw Error(`preset-shape: unknown name \"${e}\"`)},fmla:u,resolve:l};function l(e){if(e in c)return c[e];let t=Number(e);if(Number.isFinite(t))return t;throw Error(`preset-shape: cannot resolve \"${e}\"`)}function u(e){let t=e.argTokens.map(l);return d(e.op,t,e)}function d(e,t,n){switch(e){case`val`:return t[0];case`*/`:return t[0]*t[1]/t[2];case`+-`:return t[0]+t[1]-t[2];case`+/`:return(t[0]+t[1])/t[2];case`?:`:return t[0]>0?t[1]:t[2];case`abs`:return Math.abs(t[0]);case`min`:return Math.min(t[0],t[1]);case`max`:return Math.max(t[0],t[1]);case`pin`:return t[1]<t[0]?t[0]:t[1]>t[2]?t[2]:t[1];case`sqrt`:return Math.sqrt(Math.max(0,t[0]));case`mod`:return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);case`sin`:return t[0]*Math.sin(t[1]*Wn);case`cos`:return t[0]*Math.cos(t[1]*Wn);case`tan`:return t[0]*Math.tan(t[1]*Wn);case`at2`:return Math.atan2(t[1],t[0])/Wn;case`cat2`:return t[0]*Math.cos(Math.atan2(t[2],t[1]));case`sat2`:return t[0]*Math.sin(Math.atan2(t[2],t[1]));default:throw Error(`preset-shape: unknown operator \"${e}\" in \"${[n.op,...n.argTokens].join(` `)}\"`)}}}const qn=Math.PI*2/216e5;function Jn(e,t,n,r,i,a,o){let s=t.w==null?1:a/t.w,c=t.h==null?1:o/t.h,l=e=>r+e*s,u=e=>i+e*c,d=0,f=0;for(let r of t.cmds)switch(r[0]){case`m`:{let t=l(n.resolve(r[1])),i=u(n.resolve(r[2]));e.moveTo(t,i),d=t,f=i;break}case`l`:{let t=l(n.resolve(r[1])),i=u(n.resolve(r[2]));e.lineTo(t,i),d=t,f=i;break}case`C`:{let t=l(n.resolve(r[1])),i=u(n.resolve(r[2])),a=l(n.resolve(r[3])),o=u(n.resolve(r[4])),s=l(n.resolve(r[5])),c=u(n.resolve(r[6]));e.bezierCurveTo(t,i,a,o,s,c),d=s,f=c;break}case`Q`:{let t=l(n.resolve(r[1])),i=u(n.resolve(r[2])),a=l(n.resolve(r[3])),o=u(n.resolve(r[4]));e.quadraticCurveTo(t,i,a,o),d=a,f=o;break}case`a`:{let t=n.resolve(r[1]),i=n.resolve(r[2]),a=t*s,o=i*c,l=n.resolve(r[3])*qn,u=n.resolve(r[4])*qn,p=Math.PI*2,m=e=>Math.atan2(t*Math.sin(e),i*Math.cos(e)),h=m(l),g=Math.trunc(u/p),_=u-g*p,v=m(l+_)-h;_>0&&v<0?v+=p:_<0&&v>0&&(v-=p);let y=h+v+g*p,b=d-a*Math.cos(h),x=f-o*Math.sin(h);Math.abs(a)>1e-6&&Math.abs(o)>1e-6&&(e.ellipse(b,x,Math.abs(a),Math.abs(o),0,h,y,u<0),d=b+a*Math.cos(y),f=x+o*Math.sin(y));break}case`c`:e.closePath();break}}const Yn=Hn,Xn=new WeakMap;function Zn(e){let t=Xn.get(e);return t||(t={adj:e.adj.map(([e,t])=>[e,Gn(t)]),gd:e.gd.map(([e,t])=>[e,Gn(t)])},Xn.set(e,t)),t}function Qn(e,t,n,r){let i=Zn(e);return Kn({w:t,h:n,adj:r},i.adj,i.gd)}function $n(e){return e.toLowerCase()in Yn}function er(e,t,n,r,i,a,o=[]){let s=Yn[t.toLowerCase()];if(!s)return!1;let c=Qn(s,i,a,o);for(let t of s.paths)Jn(e,t,c,n,r,i,a);return!0}const tr={wedgeroundrectcallout:`roundrect`,wedgeellipsecallout:`ellipse`,wedgerectcallout:null},nr={adj:[],gd:[],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]};function rr(e,t,n){let r=e[n];if(typeof r==`number`)return r;let i=t.adj[n];return i&&Number(i[1].replace(/^val\\s+/,``))||0}function ir(e,t,n,r,i,a,o,s,c,l,u){let d=t.toLowerCase(),f=Yn[d];if(!f)return!1;if(d in tr){let e=rr(o,f,0),t=rr(o,f,1),n=i/2+i*e/1e5,r=a/2+a*t/1e5;if(n>=0&&n<=i&&r>=0&&r<=a){let e=tr[d];e===`roundrect`?(f=Yn.roundrect,o=[rr(o,Yn[d],2)]):e&&Yn[e]?(f=Yn[e],o=[]):(f=nr,o=[])}}let p=Qn(f,i,a,o),m=!1,h=f.paths.length-1;for(let t=0;t<f.paths.length;t++){let o=f.paths[t];e.beginPath(),Jn(e,o,p,n,r,i,a);let d=o.fill;if(d!==`none`&&s!=null){e.save(),e.fillStyle=s,e.fill();let t=or(d);t&&(e.fillStyle=t,e.fill()),e.restore(),m||=(l(),!0)}if(o.stroke&&c){let e=t===h&&(o.fill===`none`||o.fill==null);u?.skipTrailingStroke&&e||c()}}return!0}function ar(e,t,n,r,i,a){let o=Yn[e.toLowerCase()];if(!o||o.paths.length===0)return null;let s=o.paths[o.paths.length-1],c=Qn(o,r,i,a),l=s.w==null?1:r/s.w,u=s.h==null?1:i/s.h,d=e=>t+e*l,f=e=>n+e*u,p=0,m=0,h=0,g=0,_=0,v=0,y=!1,b=0,x=0,S=[];for(let e of s.cmds)switch(e[0]){case`m`:h=d(c.resolve(e[1])),g=f(c.resolve(e[2])),p=h,m=g,S.push({x:h,y:g});break;case`l`:{let t=d(c.resolve(e[1])),n=f(c.resolve(e[2]));y||=(_=t-h,v=n-g,!0),b=t-h,x=n-g,h=t,g=n,S.push({x:h,y:g});break}case`C`:{let t=d(c.resolve(e[1])),n=f(c.resolve(e[2])),r=d(c.resolve(e[3])),i=f(c.resolve(e[4])),a=d(c.resolve(e[5])),o=f(c.resolve(e[6]));y||=(_=t-h,v=n-g,!0),b=a-r,x=o-i,h=a,g=o,S.push({x:h,y:g});break}}let C=Math.atan2(v,_)+Math.PI;return{start:{x:p,y:m,angle:C},end:{x:h,y:g,angle:Math.atan2(x,b)},vertices:S}}function or(e){switch(e){case`lighten`:return`rgba(255,255,255,0.30)`;case`lightenLess`:return`rgba(255,255,255,0.15)`;case`darken`:return`rgba(0,0,0,0.30)`;case`darkenLess`:return`rgba(0,0,0,0.15)`;default:return null}}function sr(e,t,n,r,i,a,o,s=-Math.PI/2){let c=a*2;for(let l=0;l<c;l++){let c=s+l*Math.PI/a,u=l%2==0?1:o,d=t+r*u*Math.cos(c),f=n+i*u*Math.sin(c);l===0?e.moveTo(d,f):e.lineTo(d,f)}e.closePath()}function cr(e,t,n,r,i,a,o=-Math.PI/2){for(let s=0;s<a;s++){let c=o+s*2*Math.PI/a,l=t+r*Math.cos(c),u=n+i*Math.sin(c);s===0?e.moveTo(l,u):e.lineTo(l,u)}e.closePath()}function lr(e,t,n,r,i,a,o){let s=e=>Math.atan2(r*Math.sin(e),i*Math.cos(e)),c=s(a),l=s(a+o),u=t-r*Math.cos(c),d=n-i*Math.sin(c);return e.ellipse(u,d,Math.abs(r),Math.abs(i),0,c,l,o<0),{x:u+r*Math.cos(l),y:d+i*Math.sin(l)}}const ur={oval:`ellipse`,rtriangle:`rttriangle`,roundrectangle:`roundrect`,flowchartsumingjunction:`flowchartsummingjunction`},dr=new Set(`ellipse.rttriangle.triangle.diamond.trapezoid.roundrect.snip1rect.frame.irregularseal1.irregularseal2.star4.star8.star12.star16.star24.star32.line.straightconnector1.callout1.bordercallout1.leftuparrow.quadarrowcallout.mathequal.mathplus.mathminus.flowchartdecision.flowchartmanualinput.flowchartconnector.flowchartinputoutput.flowchartmerge.flowchartextract.flowchartpreparation.flowchartcollate`.split(`.`)),fr=new Set([`accentcallout1`,`accentbordercallout1`,`flowchartpredefinedprocess`,`flowchartsort`,`flowchartinternalstorage`,`flowchartsummingjunction`]),pr=new Set([`round2samerect`,`round2diagrect`,`dodecagon`,`star10`]);function mr(e,t,n,r,i,a,o=null,s=null,c=null,l=null){let u=n+i/2,d=r+a/2;{let u=t.toLowerCase(),d=ur[u]??u;if((dr.has(d)||fr.has(d)||pr.has(d))&&er(e,d,n,r,i,a,[o,s,c,l]))return}switch(t.toLowerCase()){case`parallelogram`:{let t=i*Math.min(.5,(o??25e3)/1e5);e.moveTo(n+t,r),e.lineTo(n+i,r),e.lineTo(n+i-t,r+a),e.lineTo(n,r+a),e.closePath();break}case`pentagon`:cr(e,u,d,i/2,a/2,5);break;case`hexagon`:cr(e,u,d,i/2,a/2,6,0);break;case`heptagon`:cr(e,u,d,i/2,a/2,7);break;case`octagon`:cr(e,u,d,i/2,a/2,8,-Math.PI/8);break;case`decagon`:cr(e,u,d,i/2,a/2,10);break;case`star5`:case`star`:sr(e,u,d,i/2,a/2,5,(o??19098)/5e4);break;case`star6`:sr(e,u,d,i/2,a/2,6,(o??28868)/5e4,0);break;case`star7`:sr(e,u,d,i/2,a/2,7,(o??34142)/5e4);break;case`rightarrow`:{let t=a*Math.min(1,(o??5e4)/1e5),c=i*Math.min(1,(s??5e4)/1e5),l=r+(a-t)/2;e.moveTo(n,l),e.lineTo(n+i-c,l),e.lineTo(n+i-c,r),e.lineTo(n+i,d),e.lineTo(n+i-c,r+a),e.lineTo(n+i-c,l+t),e.lineTo(n,l+t),e.closePath();break}case`leftarrow`:{let t=a*Math.min(1,(o??5e4)/1e5),c=i*Math.min(1,(s??5e4)/1e5),l=r+(a-t)/2;e.moveTo(n+i,l),e.lineTo(n+c,l),e.lineTo(n+c,r),e.lineTo(n,d),e.lineTo(n+c,r+a),e.lineTo(n+c,l+t),e.lineTo(n+i,l+t),e.closePath();break}case`uparrow`:{let t=i*Math.min(1,(o??5e4)/1e5),c=a*Math.min(1,(s??5e4)/1e5),l=n+(i-t)/2;e.moveTo(u,r),e.lineTo(n+i,r+c),e.lineTo(l+t,r+c),e.lineTo(l+t,r+a),e.lineTo(l,r+a),e.lineTo(l,r+c),e.lineTo(n,r+c),e.closePath();break}case`downarrow`:{let t=i*Math.min(1,(o??5e4)/1e5),c=a*Math.min(1,(s??5e4)/1e5),l=n+(i-t)/2;e.moveTo(u,r+a),e.lineTo(n+i,r+a-c),e.lineTo(l+t,r+a-c),e.lineTo(l+t,r),e.lineTo(l,r),e.lineTo(l,r+a-c),e.lineTo(n,r+a-c),e.closePath();break}case`leftrightarrow`:{let t=a*Math.min(1,(o??5e4)/1e5),c=i*Math.min(.5,(s??25e3)/1e5),l=r+(a-t)/2;e.moveTo(n,d),e.lineTo(n+c,r),e.lineTo(n+c,l),e.lineTo(n+i-c,l),e.lineTo(n+i-c,r),e.lineTo(n+i,d),e.lineTo(n+i-c,r+a),e.lineTo(n+i-c,l+t),e.lineTo(n+c,l+t),e.lineTo(n+c,r+a),e.closePath();break}case`updownarrow`:{let t=i*Math.min(1,(o??5e4)/1e5),c=a*Math.min(.5,(s??25e3)/1e5),l=n+(i-t)/2;e.moveTo(u,r),e.lineTo(n+i,r+c),e.lineTo(l+t,r+c),e.lineTo(l+t,r+a-c),e.lineTo(n+i,r+a-c),e.lineTo(u,r+a),e.lineTo(n,r+a-c),e.lineTo(l,r+a-c),e.lineTo(l,r+c),e.lineTo(n,r+c),e.closePath();break}case`notchedrightarrow`:{let t=a*Math.min(1,(o??5e4)/1e5),c=i*Math.min(1,(s??35e3)/1e5),l=r+(a-t)/2,u=c*.43;e.moveTo(n,l),e.lineTo(n+i-c,l),e.lineTo(n+i-c,r),e.lineTo(n+i,d),e.lineTo(n+i-c,r+a),e.lineTo(n+i-c,l+t),e.lineTo(n,l+t),e.lineTo(n+u,d),e.closePath();break}case`chevron`:{let t=i*Math.min(1,Math.max(0,(o??5e4)/1e5));e.moveTo(n,r),e.lineTo(n+t,r),e.lineTo(n+i,d),e.lineTo(n+t,r+a),e.lineTo(n,r+a),t>0&&e.lineTo(n+t,d),e.closePath();break}case`homeplate`:{let t=a*.4;e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a-t),e.lineTo(u,r+a),e.lineTo(n,r+a-t),e.closePath();break}case`leftbracket`:{let t=Math.min(a*Math.min(5e4,Math.max(0,o??8333))/1e5,a/2);e.moveTo(n+i,r),e.quadraticCurveTo(n,r,n,r+t),a-2*t>.5&&e.lineTo(n,r+a-t),e.quadraticCurveTo(n,r+a,n+i,r+a);break}case`rightbracket`:{let t=Math.min(a*Math.min(5e4,Math.max(0,o??8333))/1e5,a/2);e.moveTo(n,r),e.quadraticCurveTo(n+i,r,n+i,r+t),a-2*t>.5&&e.lineTo(n+i,r+a-t),e.quadraticCurveTo(n+i,r+a,n,r+a);break}case`leftbrace`:{let t=d,o=i*.45;e.moveTo(n+i,r),e.bezierCurveTo(n+i-o,r,n+i-o,t-a*.08,n,t),e.bezierCurveTo(n+i-o,t+a*.08,n+i-o,r+a,n+i,r+a);break}case`rightbrace`:{let t=d,o=i*.45;e.moveTo(n,r),e.bezierCurveTo(n+o,r,n+o,t-a*.08,n+i,t),e.bezierCurveTo(n+o,t+a*.08,n+o,r+a,n,r+a);break}case`wedgerectcallout`:{e.rect(n,r,i,a*.8);let t=n+i*.2,o=r+a;e.moveTo(n+i*.1,r+a*.8),e.lineTo(t,o),e.lineTo(n+i*.3,r+a*.8),e.closePath();break}case`wedgeellipsecallout`:{let t=(o??-2e4)/1e5*i,n=(s??12e4)/1e5*a,r=u+t,c=d+n;e.ellipse(u,d,i/2,a/2,0,0,Math.PI*2);let l=Math.atan2(n,t),f=Math.PI/10,p=i/2,m=a/2,h=u+p*Math.cos(l-f),g=d+m*Math.sin(l-f),_=u+p*Math.cos(l+f),v=d+m*Math.sin(l+f);e.moveTo(h,g),e.lineTo(r,c),e.lineTo(_,v),e.closePath();break}case`cloudcallout`:{let t=Math.min(i,a)*.22,n=[[u-i*.25,r+a*.35],[u-i*.1,r+a*.15],[u+i*.1,r+a*.1],[u+i*.28,r+a*.2],[u+i*.35,r+a*.4]];e.moveTo(n[0][0]-t,n[0][1]);for(let[r,i]of n)e.arc(r,i,t,Math.PI,0);e.arc(u,r+a*.65,i*.45,0,Math.PI),e.closePath();let c=u+(o??-2e4)/1e5*i,l=d+(s??12e4)/1e5*a;e.moveTo(u+i*.05,r+a*.8),e.arc(c,l,Math.min(i,a)*.07,0,Math.PI*2);break}case`bentconnector2`:case`bentconnector3`:case`bentconnector4`:case`bentconnector5`:case`curvedconnector2`:case`curvedconnector3`:case`curvedconnector4`:case`curvedconnector5`:e.moveTo(n,r),e.lineTo(n+i,r+a);break;case`heart`:e.moveTo(u,r+a*.32),e.bezierCurveTo(u,r,n+i*.05,r,n,r+a*.3),e.bezierCurveTo(n,r+a*.68,u-i*.05,r+a*.78,u,r+a),e.bezierCurveTo(u+i*.05,r+a*.78,n+i,r+a*.68,n+i,r+a*.3),e.bezierCurveTo(n+i-i*.05,r,u,r,u,r+a*.32);break;case`donut`:{let t=i/2,n=a/2,r=Math.min(t,n)*(o??25e3)/1e5,s=t-r,c=n-r;e.ellipse(u,d,t,n,0,0,Math.PI*2,!1),e.moveTo(u+s,d),e.ellipse(u,d,s,c,0,0,Math.PI*2,!0);break}case`nosmoking`:case`nosmokingsign`:{let t=(o??18750)/1e5,n=i/2,r=a/2,s=n*(1-2*t),c=r*(1-2*t);e.ellipse(u,d,n,r,0,0,Math.PI*2,!1),e.moveTo(u+s,d),e.ellipse(u,d,s,c,0,0,Math.PI*2,!0),e.moveTo(u+s,d),e.ellipse(u,d,s,c,0,0,Math.PI/2,!1),e.lineTo(u-s,d),e.ellipse(u,d,s,c,0,Math.PI,3*Math.PI/2,!1),e.closePath();break}case`pie`:{let t=(o??0)/216e5*Math.PI*2,n=(s??162e5)/216e5*Math.PI*2;e.moveTo(u,d),e.arc(u,d,Math.min(i,a)/2,t,n),e.closePath();break}case`cloud`:{let t=a*.28;e.arc(n+i*.25,r+a*.55,t,Math.PI,Math.PI*1.8),e.arc(n+i*.45,r+a*.35,t*1.1,Math.PI*1.3,Math.PI*1.9),e.arc(n+i*.65,r+a*.4,t,Math.PI*1.5,Math.PI*2),e.arc(n+i*.8,r+a*.6,t*.9,Math.PI*1.6,Math.PI*.1),e.arc(n+i*.55,r+a*.75,t,0,Math.PI*.7),e.arc(n+i*.25,r+a*.7,t*.9,0,Math.PI),e.closePath();break}case`funnel`:e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(u+i*.15,r+a),e.lineTo(u-i*.15,r+a),e.closePath();break;case`smileyface`:{e.ellipse(u,d,i/2,a/2,0,0,Math.PI*2),e.closePath();let t=i*.05,n=a*.05,r=d-a*.12;e.moveTo(u-i*.2+t,r),e.ellipse(u-i*.2,r,t,n,0,0,Math.PI*2),e.moveTo(u+i*.2+t,r),e.ellipse(u+i*.2,r,t,n,0,0,Math.PI*2),e.moveTo(u-i*.25,d+a*.05),e.quadraticCurveTo(u,d+a*.3,u+i*.25,d+a*.05);break}case`document`:case`foldedcorner`:{let t=Math.min(i,a)*.15;e.moveTo(n,r),e.lineTo(n+i-t,r),e.lineTo(n+i,r+t),e.lineTo(n+i,r+a),e.lineTo(n,r+a),e.closePath(),e.moveTo(n+i-t,r),e.lineTo(n+i-t,r+t),e.lineTo(n+i,r+t);break}case`snip2samerect`:{let t=Math.min(i,a)*Math.min(5e4,Math.max(0,o??16667))/1e5;e.moveTo(n,r),e.lineTo(n+i-t,r),e.lineTo(n+i,r+t),e.lineTo(n+i,r+a),e.lineTo(n+t,r+a),e.lineTo(n,r+a-t),e.closePath();break}case`snip2diagrect`:{let t=Math.min(i,a)*Math.min(5e4,Math.max(0,o??16667))/1e5;e.moveTo(n+t,r),e.lineTo(n+i-t,r),e.lineTo(n+i,r+t),e.lineTo(n+i,r+a-t),e.lineTo(n+i-t,r+a),e.lineTo(n+t,r+a),e.lineTo(n,r+a-t),e.lineTo(n,r+t),e.closePath();break}case`sniproundrect`:{let t=Math.min(i,a)*Math.min(5e4,Math.max(0,o??16667))/1e5;e.moveTo(n+t,r),e.lineTo(n+i-t,r),e.lineTo(n+i,r+t),e.lineTo(n+i,r+a),e.lineTo(n,r+a),e.quadraticCurveTo(n,r,n+t,r),e.closePath();break}case`round1rect`:{let t=Math.min(i,a)*Math.min(5e4,Math.max(0,o??16667))/1e5;e.moveTo(n+t,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a),e.lineTo(n,r+a),e.lineTo(n,r+t),e.quadraticCurveTo(n,r,n+t,r),e.closePath();break}case`plaque`:{let t=Math.min(i,a)*.25;e.moveTo(n+t,r),e.lineTo(n+i-t,r),e.quadraticCurveTo(n+i,r,n+i,r+t),e.lineTo(n+i,r+a-t),e.quadraticCurveTo(n+i,r+a,n+i-t,r+a),e.lineTo(n+t,r+a),e.quadraticCurveTo(n,r+a,n,r+a-t),e.lineTo(n,r+t),e.quadraticCurveTo(n,r,n+t,r),e.closePath();break}case`can`:{let t=a*.1;e.ellipse(u,r+t,i/2,t,0,0,Math.PI*2),e.moveTo(n,r+t),e.lineTo(n,r+a-t),e.ellipse(u,r+a-t,i/2,t,0,Math.PI,2*Math.PI),e.lineTo(n+i,r+t);break}case`cube`:{let t=Math.min(i,a)*.2;e.moveTo(n+t,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a-t),e.lineTo(n+i-t,r+a),e.lineTo(n,r+a),e.lineTo(n,r+t),e.closePath(),e.moveTo(n+t,r),e.lineTo(n+t,r+t),e.lineTo(n+i-t,r+t),e.moveTo(n+t,r+t),e.lineTo(n,r+t);break}case`bevel`:{let t=Math.min(i,a)*.1;e.rect(n,r,i,a),e.moveTo(n,r),e.lineTo(n+t,r+t),e.lineTo(n+i-t,r+t),e.lineTo(n+i,r),e.moveTo(n+i-t,r+t),e.lineTo(n+i-t,r+a-t),e.lineTo(n+i,r+a),e.moveTo(n+i-t,r+a-t),e.lineTo(n+t,r+a-t),e.lineTo(n,r+a),e.moveTo(n+t,r+a-t),e.lineTo(n+t,r+t);break}case`halfframe`:{let t=Math.min(i,a)*.25;e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(n+i,r+t),e.lineTo(n+t,r+t),e.lineTo(n+t,r+a),e.lineTo(n,r+a),e.closePath();break}case`corner`:{let t=Math.min(i,a)*.25;e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(n+i,r+t),e.lineTo(n+t,r+t),e.lineTo(n+t,r+a),e.lineTo(n,r+a),e.closePath();break}case`flowchartalternateprocess`:case`flowchartprocess`:{let t=Math.min(i,a)*Math.min(5e4,Math.max(0,o??16667))/1e5;e.roundRect(n,r,i,a,[{x:t,y:t}]);break}case`flowchartterminator`:{let t=Math.min(i,a)/2;e.roundRect(n,r,i,a,[{x:t,y:t}]);break}case`flowchartdocument`:{let t=a*.1;e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a-t),e.bezierCurveTo(n+i*.75,r+a,n+i*.25,r+a-t*2,n,r+a-t),e.closePath();break}case`moon`:e.arc(u,d,Math.min(i,a)/2,-Math.PI/2,Math.PI/2),e.arc(u-i*.2,d,Math.min(i,a)/2,Math.PI/2,-Math.PI/2,!0),e.closePath();break;case`arc`:{let t=216e5,n=(o??162e5)/t*Math.PI*2,r=(s??54e5)/t*Math.PI*2;e.ellipse(u,d,i/2,a/2,0,n,n+r,r<0);break}case`mathmultiply`:{let t=Math.min(i,a)*Math.min(51965,Math.max(0,o??23520))/1e5,s=Math.atan2(a,i),c=Math.sin(s),l=Math.cos(s),u=t/2*c,d=t/2*l;e.moveTo(n+u,r-d),e.lineTo(n-u,r+d),e.lineTo(n+i-u,r+a+d),e.lineTo(n+i+u,r+a-d),e.closePath(),e.moveTo(n+i-u,r-d),e.lineTo(n+i+u,r+d),e.lineTo(n+u,r+a+d),e.lineTo(n-u,r+a-d),e.closePath();break}case`mathdivide`:{let t=Math.min(36745,Math.max(1e3,o??23520)),n=(73490+-t)/4,l=36745*i/a,f=Math.min(Math.min(n,l),Math.max(1e3,c??11760)),p=73490+4*f-t,m=Math.min(p,Math.max(0,s??5880)),h=a*t/2e5,g=a*m/1e5,_=a*f/1e5,v=i*73490/2e5,y=d-h,b=d+h,x=y-(g+_)-_,S=r+a-x,C=u-v,w=u+v;e.rect(C,y,w-C,b-y),e.moveTo(u+_,x+_),e.arc(u,x+_,_,0,Math.PI*2),e.moveTo(u+_,S-_),e.arc(u,S-_,_,0,Math.PI*2);break}case`quadarrow`:{let t=i*(o??23e3)/1e5,c=i*(s??3e4)/1e5,l=n+(i-t)/2,f=r+(a-t)/2;e.moveTo(u,r),e.lineTo(n+i-c,r+c),e.lineTo(n+i-c,f),e.lineTo(l+t,f),e.lineTo(l+t,r+c),e.lineTo(n+c,r+c),e.lineTo(n+i,d),e.lineTo(n+i-c,r+a-c),e.lineTo(l+t,r+a-c),e.lineTo(l+t,f+t),e.lineTo(n+i-c,f+t),e.lineTo(n+i-c,r+a-c),e.lineTo(u,r+a),e.lineTo(n+c,r+a-c),e.lineTo(n+c,f+t),e.lineTo(l,f+t),e.lineTo(l,r+a-c),e.lineTo(n,d),e.lineTo(n+c,r+c),e.lineTo(l,r+c),e.lineTo(l,f),e.lineTo(n+c,f),e.closePath();break}case`wave`:{let t=a*(o??12500)/1e5,s=r+t,c=r+a-t;e.moveTo(n,s),e.bezierCurveTo(n+i*.25,r,n+i*.25,r+t*2,n+i*.5,s),e.bezierCurveTo(n+i*.75,r+t*2,n+i*.75,r,n+i,s),e.lineTo(n+i,c),e.bezierCurveTo(n+i*.75,r+a,n+i*.75,r+a-t*2,n+i*.5,c),e.bezierCurveTo(n+i*.25,r+a-t*2,n+i*.25,r+a,n,c),e.closePath();break}case`doublewave`:{let t=a*(o??6250)/1e5,s=r+t,c=r+a-t;e.moveTo(n,s),e.bezierCurveTo(n+i*.25,r,n+i*.25,r+t*2,n+i*.5,s),e.bezierCurveTo(n+i*.75,r+t*2,n+i*.75,r,n+i,s),e.lineTo(n+i,c),e.bezierCurveTo(n+i*.75,r+a,n+i*.75,r+a-t*2,n+i*.5,c),e.bezierCurveTo(n+i*.25,r+a-t*2,n+i*.25,r+a,n,c),e.closePath();break}case`sun`:{let t=Math.min(i,a)/2,n=t*((o??25e3)/1e5+.5),r=Math.min(n,t*.9),s=Math.PI/16;for(let n=0;n<8;n++){let i=n/8*Math.PI*2;e.moveTo(u+r*Math.cos(i-s),d+r*Math.sin(i-s)),e.lineTo(u+t*Math.cos(i),d+t*Math.sin(i)),e.lineTo(u+r*Math.cos(i+s),d+r*Math.sin(i+s)),e.closePath()}e.moveTo(u+r,d),e.arc(u,d,r,0,Math.PI*2);break}case`lightningbolt`:e.moveTo(u+i*.1,r),e.lineTo(n,d-a*.05),e.lineTo(u+i*.05,d-a*.05),e.lineTo(u-i*.1,r+a),e.lineTo(n+i,d+a*.05),e.lineTo(u-i*.05,d+a*.05),e.closePath();break;case`bracketpair`:{let t=a*Math.min(5e4,Math.max(0,o??8333))/1e5;e.moveTo(n+i*.4,r),e.quadraticCurveTo(n,r,n,r+t),a-2*t>0&&e.lineTo(n,r+a-t),e.quadraticCurveTo(n,r+a,n+i*.4,r+a),e.moveTo(n+i*.6,r),e.quadraticCurveTo(n+i,r,n+i,r+t),a-2*t>0&&e.lineTo(n+i,r+a-t),e.quadraticCurveTo(n+i,r+a,n+i*.6,r+a);break}case`bracepair`:{let t=i*.2;e.moveTo(n+i*.4,r),e.bezierCurveTo(n+i*.4-t,r,n+i*.4-t,d-a*.08,n,d),e.bezierCurveTo(n+i*.4-t,d+a*.08,n+i*.4-t,r+a,n+i*.4,r+a),e.moveTo(n+i*.6,r),e.bezierCurveTo(n+i*.6+t,r,n+i*.6+t,d-a*.08,n+i,d),e.bezierCurveTo(n+i*.6+t,d+a*.08,n+i*.6+t,r+a,n+i*.6,r+a);break}case`chord`:{let t=(o??27e5)/216e5*Math.PI*2,n=(s??162e5)/216e5*Math.PI*2;e.ellipse(u,d,i/2,a/2,0,t,n),e.closePath();break}case`blockarc`:{let t=Math.min(i,a)/2,n=o??108e5,r=s??0,l=t*(1-(c??25e3)/1e5),f=n/216e5*Math.PI*2,p=r/216e5*Math.PI*2;e.arc(u,d,t,f,p,!1),e.arc(u,d,l,p,f,!0),e.closePath();break}case`teardrop`:{let t=Math.min(i,a)*.4,o=n+t,s=r+a-t;e.arc(o,s,t,0,Math.PI*2*.75),e.bezierCurveTo(o-t*.1,s-t,n+i-t,r+t,n+i,r),e.bezierCurveTo(n+i-t*.2,r+t*.5,o+t,s-t*1.1,o+t,s),e.closePath();break}case`diagstripe`:{let t=a*(o??5e4)/1e5*i/a;e.moveTo(n+t,r),e.lineTo(n+i,r),e.lineTo(n+i-t,r+a),e.lineTo(n,r+a),e.closePath();break}case`wedgeroundrectcallout`:{let t=Math.min(i,a)*.1;e.roundRect(n,r,i,a*.85,t),e.moveTo(n+i*.1,r+a*.85),e.lineTo(n+i*.2,r+a),e.lineTo(n+i*.3,r+a*.85),e.closePath();break}case`rightarrowcallout`:{let t=a*(o??5e4)/1e5,c=i*(s??5e4)/1e5,l=r+(a-t)/2;e.rect(n,l,c,t),e.moveTo(n+c,r),e.lineTo(n+i,d),e.lineTo(n+c,r+a),e.closePath();break}case`leftarrowcallout`:{let t=a*(o??5e4)/1e5,c=i*(s??5e4)/1e5,l=r+(a-t)/2;e.rect(n+i-c,l,c,t),e.moveTo(n+i-c,r),e.lineTo(n,d),e.lineTo(n+i-c,r+a),e.closePath();break}case`uparrowcallout`:{let t=i*(o??5e4)/1e5,c=a*(s??5e4)/1e5,l=n+(i-t)/2;e.rect(l,r+c,t,a-c),e.moveTo(n,r+c),e.lineTo(u,r),e.lineTo(n+i,r+c),e.closePath();break}case`downarrowcallout`:{let t=i*(o??5e4)/1e5,c=a*(s??5e4)/1e5,l=n+(i-t)/2;e.rect(l,r,t,a-c),e.moveTo(n,r+a-c),e.lineTo(u,r+a),e.lineTo(n+i,r+a-c),e.closePath();break}case`leftrightarrowcallout`:{let t=a*(o??5e4)/1e5,c=i*(s??25e3)/1e5,l=r+(a-t)/2;e.rect(n+c,l,i-2*c,t),e.moveTo(n+c,r),e.lineTo(n,d),e.lineTo(n+c,r+a),e.closePath(),e.moveTo(n+i-c,r),e.lineTo(n+i,d),e.lineTo(n+i-c,r+a),e.closePath();break}case`leftrightuparrow`:{let t=i*(o??25e3)/1e5,c=a*(s??3e4)/1e5,l=n+(i-t)/2;e.moveTo(u,r),e.lineTo(n+i,r+c),e.lineTo(l+t,r+c),e.lineTo(l+t,r+a),e.lineTo(l,r+a),e.lineTo(l,r+c),e.lineTo(n,r+c),e.closePath();break}case`uturnarrow`:{let t=i*(o??25e3)/1e5,s=(i-t)/2,c=Math.max(0,s-t),l=n+t+s,u=r+t+s,d=t*2,f=r+a-t*2.5;e.moveTo(n,r+a),e.lineTo(n,u),e.arc(l,u,s,Math.PI,0),e.lineTo(n+i,f),e.lineTo(n+i+(d-t)/2,f),e.lineTo(l+t/2,r+a),e.lineTo(n+i-(d-t)/2-t,f),e.lineTo(n+i-t,f),e.lineTo(n+i-t,u),e.arc(l,u,c,0,Math.PI,!0),e.lineTo(n+t,r+a),e.closePath();break}case`bentarrow`:case`bentuparrow`:{let t=Math.min(i,a)*.25;e.moveTo(n,d-t/2),e.lineTo(n+i-t*2,d-t/2),e.lineTo(n+i-t*2,r+t),e.lineTo(n+i,d),e.lineTo(n+i-t*2,r+a-t),e.lineTo(n+i-t*2,d+t/2),e.lineTo(n,d+t/2),e.closePath();break}case`plus`:{let t=Math.min(i,a)*(o??25e3)/1e5;e.rect(u-t,r,2*t,a),e.rect(n,d-t,i,2*t);break}case`mathnotequal`:{let t=Math.min(5e4,Math.max(0,o??23520)),n=Math.min(66e5,Math.max(42e5,s??66e5)),l=Math.min(1e5-2*t,Math.max(0,c??11760)),f=a*t/1e5,p=a*l/2e5,m=i*73490/2e5,h=a/2,g=(n/6e4-90)*Math.PI/180,_=h*Math.tan(g),v=Math.hypot(_,h)*f/h;e.rect(u-m,d-p-f,2*m,f),e.rect(u-m,d+p,2*m,f),e.moveTo(u+_-v/2,r),e.lineTo(u+_+v/2,r),e.lineTo(u-_+v/2,r+a),e.lineTo(u-_-v/2,r+a),e.closePath();break}case`flowchartdelay`:{let t=a/2;e.moveTo(n,r),e.lineTo(n+i-t,r),e.arc(n+i-t,d,t,-Math.PI/2,Math.PI/2),e.lineTo(n,r+a),e.closePath();break}case`flowchartdisplay`:{let t=i*.2,o=i*.15;e.moveTo(n+t,r),e.lineTo(n+i-o,r),e.arc(n+i-o,d,a/2,-Math.PI/2,Math.PI/2),e.lineTo(n+t,r+a),e.lineTo(n,d),e.closePath();break}case`flowchartpunchedcard`:{let t=i*.2;e.moveTo(n+t,r),e.lineTo(n+i,r),e.lineTo(n+i-t,r+a),e.lineTo(n,r+a),e.closePath();break}case`flowchartoffpageconnector`:{let t=a*.3;e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a-t),e.lineTo(u,r+a),e.lineTo(n,r+a-t),e.closePath();break}case`flowchartonlinestorage`:case`flowchartmanuallabel`:case`flowchartpuncheddisk`:e.rect(n,r,i,a);break;case`horizontalscroll`:{let t=Math.min(i,a)*.15;e.roundRect(n+t,r,i-t,a,t),e.moveTo(n+t,r+t*2),e.arc(n+t,r+t,t,Math.PI/2,Math.PI*2.5);break}case`verticalscroll`:{let t=Math.min(i,a)*.15;e.roundRect(n,r+t,i,a-t,t),e.moveTo(n+t*2,r+t),e.arc(n+t,r+t,t,0,Math.PI*2);break}case`ribbon`:{let t=Math.min(33333,Math.max(0,o??16667)),c=i*Math.min(75e3,Math.max(25e3,s??5e4))/2e5,l=i/8,u=i/32,d=i/2-c,f=i/2+c,p=d+u,m=f-u,h=d+l,g=f-l,_=h-u,v=g+u,y=i-l,b=a*t/2e5,x=a*t/1e5,S=a-x,C=S/2;e.moveTo(n,r),e.lineTo(n+_,r),e.lineTo(n+p,r+b),e.lineTo(n+m,r+x),e.lineTo(n+v,r+b),e.lineTo(n+i,r),e.lineTo(n+y,r+C),e.lineTo(n+i,r+S),e.lineTo(n+f,r+S),e.lineTo(n+f,r+a),e.lineTo(n+p,r+a),e.lineTo(n+d,r+S),e.lineTo(n,r+S),e.lineTo(n+l,r+C),e.closePath();break}case`ribbon2`:{let t=Math.min(33333,Math.max(0,o??16667)),c=i*Math.min(75e3,Math.max(25e3,s??5e4))/2e5,l=i/8,u=i/32,d=i/2-c,f=i/2+c,p=d+u,m=f-u,h=d+l,g=f-l,_=h-u,v=g+u,y=i-l,b=a*t/2e5,x=a*t/1e5,S=a-b,C=a-x,w=x,T=(w+a)/2;e.moveTo(n,r+a),e.lineTo(n+_,r+a),e.lineTo(n+p,r+S),e.lineTo(n+m,r+C),e.lineTo(n+v,r+S),e.lineTo(n+i,r+a),e.lineTo(n+y,r+T),e.lineTo(n+i,r+w),e.lineTo(n+f,r+w),e.lineTo(n+f,r),e.lineTo(n+p,r),e.lineTo(n+d,r+w),e.lineTo(n,r+w),e.lineTo(n+l,r+T),e.closePath();break}case`ellipseribbon`:{let t=Math.min(1e5,Math.max(0,o??25e3)),l=Math.min(75e3,Math.max(25e3,s??5e4)),u=Math.max(0,t-(1e5-t)/2),d=Math.min(t,Math.max(u,c??12500)),f=i/8,p=i*l/2e5,m=i/2-p,h=m+f,g=i-h,_=i-m,v=i-f,y=a*d/1e5,b=4*y/i,x=b*(h-h*h/i),S=h/2,C=b*S,w=i-S,T=a*t/1e5,E=T-y,D=b*(m-m*m/i),O=D+E,k=y+E-O+y+E,A=a-T,j=(y*14/16+A)/2,M=D+A,N=O+A,ee=m/2,te=b*ee+A,P=i-ee,ne=k+A;e.moveTo(n,r),e.quadraticCurveTo(n+S,r+C,n+h,r+x),e.lineTo(n+m,r+O),e.quadraticCurveTo(n+i/2,r+k,n+_,r+O),e.lineTo(n+g,r+x),e.quadraticCurveTo(n+w,r+C,n+i,r),e.lineTo(n+v,r+j),e.lineTo(n+i,r+A),e.quadraticCurveTo(n+P,r+te,n+_,r+M),e.lineTo(n+_,r+N),e.quadraticCurveTo(n+i/2,r+ne,n+m,r+N),e.lineTo(n+m,r+M),e.quadraticCurveTo(n+ee,r+te,n,r+A),e.lineTo(n+f,r+j),e.closePath();break}case`ellipseribbon2`:{let t=Math.min(1e5,Math.max(0,o??25e3)),l=Math.min(75e3,Math.max(25e3,s??5e4)),u=Math.max(0,t-(1e5-t)/2),d=Math.min(t,Math.max(u,c??12500)),f=i/8,p=i*l/2e5,m=i/2-p,h=m+f,g=i-h,_=i-m,v=i-f,y=a*d/1e5,b=4*y/i,x=a-b*(h-h*h/i),S=h/2,C=a-b*S,w=i-S,T=a*t/1e5,E=T-y,D=b*(m-m*m/i),O=D+E,k=a-O,A=y+E-O+y+E,j=a-A,M=a-T,N=a-(y*14/16+M)/2,ee=a-(D+M),te=a-(O+M),P=m/2,ne=a-(b*P+M),F=i-P,I=a-(A+M);e.moveTo(n,r+a),e.quadraticCurveTo(n+S,r+C,n+h,r+x),e.lineTo(n+m,r+k),e.quadraticCurveTo(n+i/2,r+j,n+_,r+k),e.lineTo(n+g,r+x),e.quadraticCurveTo(n+w,r+C,n+i,r+a),e.lineTo(n+v,r+N),e.lineTo(n+i,r+T),e.quadraticCurveTo(n+F,r+ne,n+_,r+ee),e.lineTo(n+_,r+te),e.quadraticCurveTo(n+i/2,r+I,n+m,r+te),e.lineTo(n+m,r+ee),e.quadraticCurveTo(n+P,r+ne,n,r+T),e.lineTo(n+f,r+N),e.closePath();break}case`circulararrow`:{let t=(s??0)/6e4*Math.PI/180,n=(o??162e5)/6e4*Math.PI/180,r=(c??5e4)/1e5,l=Math.min(i,a)/2,f=l*(1-r),p=(l+f)/2,m=l-f,h=t+n;e.arc(u,d,l,t,h,!1),e.arc(u,d,f,h,t,!0),e.closePath();let g=Math.sin(h),_=-Math.cos(h),v=m*1.5,y=u+p*Math.cos(h)+v*g,b=d+p*Math.sin(h)+v*_;e.moveTo(y,b),e.lineTo(u+l*Math.cos(h),d+l*Math.sin(h)),e.lineTo(u+f*Math.cos(h),d+f*Math.sin(h)),e.closePath();break}case`curvedrightarrow`:{let t=Math.min(i,a),l=a/2,u=5e4*a/t,d=Math.min(u,Math.max(0,s??5e4)),f=t*Math.min(d,Math.max(0,o??25e3))/1e5,p=t*d/1e5,m=l-(f+p)/4,h=(2*m)**2-f**2,g=1e5*(Math.sqrt(Math.max(0,h))*i/(2*m))/t,_=t*Math.min(g,Math.max(0,c??25e3))/1e5,v=Math.sqrt(Math.max(0,i*i-_*_))*m/i,y=m+f,b=m+v,x=y+v,S=(p-f)/2,C=b-S,w=x+S,T=a-p/2,E=i-_,D=Math.atan2(_,v),O=-D,k=Math.PI-D;e.moveTo(n,r+m),lr(e,n,r+m,i,m,Math.PI,O),e.lineTo(n+E,r+C),e.lineTo(n+i,r+T),e.lineTo(n+E,r+w),e.lineTo(n+E,r+x),lr(e,n+E,r+x,i,m,k,D),e.closePath();break}case`curvedleftarrow`:{let t=Math.min(i,a),l=a/2,u=5e4*a/t,d=Math.min(u,Math.max(0,s??5e4)),f=t*Math.min(d,Math.max(0,o??25e3))/1e5,p=t*d/1e5,m=l-(f+p)/4,h=(2*m)**2-f**2,g=Math.sqrt(Math.max(0,h))*i/(2*m),_=1e5*g/t,v=t*Math.min(_,Math.max(0,c??25e3))/1e5,y=Math.sqrt(Math.max(0,i*i-v*v))*m/i,b=m+f,x=m+y,S=b+y,C=(p-f)/2,w=x-C,T=S+C,E=a-p/2,D=v,O=Math.atan2(v,y),k=f/2,A=Math.atan2(k,g),j=A-O,M=O-A,N=-A;e.moveTo(n,r+E),e.lineTo(n+D,r+w),e.lineTo(n+D,r+x);let ee=lr(e,n+D,r+x,i,m,O,j);lr(e,ee.x,ee.y,i,m,N,M),e.lineTo(n+D,r+T),e.closePath();break}case`curveduparrow`:{let t=Math.min(i,a),l=i/2,u=5e4*i/t,d=Math.min(u,Math.max(0,s??5e4)),f=t*Math.min(1e5,Math.max(0,o??25e3))/1e5,p=t*d/1e5,m=l-(f+p)/4,h=(2*m)**2-f**2,g=Math.sqrt(Math.max(0,h))*a/(2*m),_=1e5*g/t,v=t*Math.min(_,Math.max(0,c??25e3))/1e5,y=Math.sqrt(Math.max(0,a*a-v*v))*m/a,b=m+f,x=m+y,S=b+y,C=(p-f)/2,w=x-C,T=S+C,E=i-p/2,D=v,O=Math.atan2(v,y),k=f/2,A=Math.atan2(k,g),j=A-O,M=O-A,N=Math.PI/2-O,ee=Math.PI/2-A;e.moveTo(n+E,r),e.lineTo(n+T,r+D),e.lineTo(n+S,r+D);let te=lr(e,n+S,r+D,m,a,N,M);lr(e,te.x,te.y,m,a,ee,j),e.lineTo(n+w,r+D),e.closePath();break}case`curveddownarrow`:{let t=Math.min(i,a),l=i/2,u=5e4*i/t,d=Math.min(u,Math.max(0,s??5e4)),f=t*Math.min(1e5,Math.max(0,o??25e3))/1e5,p=t*d/1e5,m=l-(f+p)/4,h=(2*m)**2-f**2,g=Math.sqrt(Math.max(0,h))*a/(2*m),_=1e5*g/t,v=t*Math.min(_,Math.max(0,c??25e3))/1e5,y=Math.sqrt(Math.max(0,a*a-v*v))*m/a,b=m+f,x=m+y,S=b+y,C=(p-f)/2,w=x-C,T=S+C,E=i-p/2,D=a-v,O=Math.atan2(v,y),k=f/2,A=Math.atan2(k,g),j=3*Math.PI/2+O;3*Math.PI/2-A,A-Math.PI/2,Math.PI/2-A,e.moveTo(n+E,r+a),e.lineTo(n+w,r+D),e.lineTo(n+x,r+D),lr(e,n+x,r+D,m,a,j,-O),e.lineTo(n+b,r),lr(e,n+b,r,m,a,3*Math.PI/2,O),e.lineTo(n+T,r+D),e.closePath();break}case`stripedrightarrow`:{let t=Math.min(i,a),c=t/32,l=t/16,u=t/8,f=t*(o??5e4)/1e5,p=i*(s??5e4)/1e5,m=d-f/2,h=d+f/2,g=n+i-p;e.rect(n,m,c,f),e.rect(n+l,m,l,f),e.rect(n+u,m,u,f),e.moveTo(g,m),e.lineTo(g,r),e.lineTo(n+i,d),e.lineTo(g,r+a),e.lineTo(g,h),e.lineTo(n+u*2,h),e.lineTo(n+u*2,m),e.closePath();break}case`flowchartmagneticdisk`:{let t=a*.15;e.moveTo(n,r+t),e.ellipse(u,r+t,i/2,t,0,Math.PI,0),e.lineTo(n+i,r+a-t),e.ellipse(u,r+a-t,i/2,t,0,0,Math.PI),e.lineTo(n,r+t),e.closePath(),e.moveTo(n+i,r+t),e.ellipse(u,r+t,i/2,t,0,0,Math.PI);break}case`flowchartmagneticdrum`:{let t=i*.15;e.moveTo(n+t,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a),e.lineTo(n+t,r+a),e.ellipse(n+t,d,t,a/2,0,Math.PI/2,-Math.PI/2,!0),e.closePath(),e.moveTo(n+i,r),e.ellipse(n+i,d,t,a/2,0,-Math.PI/2,Math.PI/2);break}case`flowchartmagnetictape`:{let t=Math.min(i,a)/2,n=u+t*.5;e.moveTo(u,r+a),e.arc(u,d,t,Math.PI/2,Math.PI/2+Math.PI*2*.875),e.lineTo(n,d+t*.5),e.lineTo(n,r+a),e.closePath();break}case`flowchartpunchedtape`:{let t=a*.12;e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a-t),e.bezierCurveTo(n+i*.75,r+a,n+i*.25,r+a-t*2,n,r+a-t),e.closePath(),e.moveTo(n,r+t),e.bezierCurveTo(n+i*.25,r,n+i*.75,r+t*2,n+i,r+t);break}case`flowchartmanualoperation`:{let t=i*.15;e.moveTo(n+t,r),e.lineTo(n+i-t,r),e.lineTo(n+i,r+a),e.lineTo(n,r+a),e.closePath();break}case`flowchartmultidocument`:{let t=a*.1,o=i*.04;e.rect(n+o*2,r-a*.08,i-o*2,a*.1),e.rect(n+o,r-a*.04,i-o,a*.06),e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a-t),e.bezierCurveTo(n+i*.75,r+a,n+i*.25,r+a-t*2,n,r+a-t),e.closePath();break}case`rttriangle`:e.moveTo(n,r),e.lineTo(n,r+a),e.lineTo(n+i,r+a),e.closePath();break;default:e.rect(n,r,i,a);break}}function hr(e,t,n){let r=Math.max(.5,t.width*n),i=e.w===`sm`?4:e.w===`lg`?8:6,a=e.len===`sm`?4:e.len===`lg`?8:6;return{lw:r,halfW:r*i/2,len:r*a}}const gr=new Set([`triangle`,`stealth`,`diamond`,`oval`]);function _r(e,t,n){return gr.has(e.type)?hr(e,t,n).len:0}function vr(e,t,n){if(n<=0)return{x:e.x,y:e.y};let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i);if(a<1e-9)return{x:e.x,y:e.y};let o=Math.min(n,a)/a;return{x:e.x+r*o,y:e.y+i*o}}function yr(e,t,n,r,i,a,o){if(i.type===`none`)return;let{lw:s,halfW:c,len:l}=hr(i,a,o),u=ot(a.color);switch(e.save(),e.translate(t,n),e.rotate(r),e.fillStyle=u,e.strokeStyle=u,e.lineWidth=s,e.setLineDash([]),e.beginPath(),i.type){case`triangle`:case`stealth`:e.moveTo(0,0),e.lineTo(-l,-c),e.lineTo(-l,c),e.closePath(),e.fill();break;case`arrow`:e.moveTo(0,0),e.lineTo(-l,-c),e.moveTo(0,0),e.lineTo(-l,c),e.stroke();break;case`diamond`:e.moveTo(0,0),e.lineTo(-l/2,-c),e.lineTo(-l,0),e.lineTo(-l/2,c),e.closePath(),e.fill();break;case`oval`:e.ellipse(-l/2,0,l/2,c,0,0,Math.PI*2),e.fill();break}e.restore()}const br=new Set([`line`,`straightconnector1`,`bentconnector2`,`bentconnector3`,`bentconnector4`,`bentconnector5`,`curvedconnector2`,`curvedconnector3`,`curvedconnector4`,`curvedconnector5`]),xr=new Set([`callout1`,`callout2`,`callout3`,`bordercallout1`,`bordercallout2`,`bordercallout3`,`accentcallout1`,`accentcallout2`,`accentcallout3`,`accentbordercallout1`,`accentbordercallout2`,`accentbordercallout3`]);function Sr(e){return xr.has(e)||e===`line`||e===`straightconnector1`||e.startsWith(`bentconnector`)}function Cr(e,t,n,r){if(ft(e,t,n),t.fill){let n=lt(t.fill,e,r.x,r.y,r.w,r.h);n&&(e.strokeStyle=n)}}function wr(e,t,n,r){let i=t.stroke;if(!i||!br.has(n)&&!xr.has(n))return;let{x:a,y:o,w:s,h:c}=t.rect,l=ar(n,a,o,s,c,[...t.geometry.kind===`preset`?t.geometry.adjustments:[]]);if(l){if(Sr(n)&&l.vertices.length>=2&&(i.headEnd||i.tailEnd)){let n=l.vertices.map(e=>({x:e.x,y:e.y}));i.tailEnd&&(n[n.length-1]=vr(n[n.length-1],n[n.length-2],_r(i.tailEnd,i,r))),i.headEnd&&(n[0]=vr(n[0],n[1],_r(i.headEnd,i,r))),Cr(e,i,r,t.rect),e.beginPath(),e.moveTo(n[0].x,n[0].y);for(let t=1;t<n.length;t++)e.lineTo(n[t].x,n[t].y);e.stroke()}i.tailEnd&&yr(e,l.end.x,l.end.y,l.end.angle,i.tailEnd,i,r),i.headEnd&&yr(e,l.start.x,l.start.y,l.start.angle,i.headEnd,i,r)}}function Tr(e,t,n){if(t.geometry.kind!==`custom`)return;let r=t.stroke;if(!r||!r.headEnd&&!r.tailEnd)return;let i=Vn(t.geometry.subpaths),{x:a,y:o,w:s,h:c}=t.rect;i.start&&r.headEnd&&yr(e,a+i.start.x*s,o+i.start.y*c,Math.atan2(i.start.dy*c,i.start.dx*s),r.headEnd,r,n),i.end&&r.tailEnd&&yr(e,a+i.end.x*s,o+i.end.y*c,Math.atan2(i.end.dy*c,i.end.dx*s),r.tailEnd,r,n)}function Er(e,t,n){let{x:r,y:i,w:a,h:o}=t.rect,{rotationDeg:s,flipH:c,flipV:l}=t.transform;e.save();try{(s!==0||c||l)&&(e.translate(r+a/2,i+o/2),s!==0&&e.rotate(s*Math.PI/180),e.scale(c?-1:1,l?-1:1),e.translate(-(r+a/2),-(i+o/2)));let u=lt(t.fill,e,r,i,a,o),d=t.stroke,f=d?()=>{Cr(e,d,n,t.rect),e.stroke()}:null;if(t.geometry.kind===`preset`){let s=t.geometry.name.toLowerCase(),c=[...t.geometry.adjustments],l=Sr(s)&&!!(d?.headEnd||d?.tailEnd);$n(s)&&ir(e,s,r,i,a,o,c,u,f,()=>{},l?{skipTrailingStroke:!0}:void 0)||(e.beginPath(),mr(e,s,r,i,a,o,c[0],c[1],c[2],c[3]),u&&s!==`arc`&&(e.fillStyle=u,s===`donut`||s===`smileyface`||s===`frame`?e.fill(`evenodd`):e.fill()),f&&f()),wr(e,t,s,n)}else e.beginPath(),Mn(e,t.geometry.subpaths,r,i,a,o),u&&(e.fillStyle=u,e.fill()),f&&f(),Tr(e,t,n)}finally{e.restore()}}const Dr=new WeakMap;function Or(e){let t=Dr.get(e);return t||(t={imgs:new Map,urls:new Map},Dr.set(e,t)),t}function kr(e,t){e.imgs.delete(t);let n=e.urls.get(t);n&&(URL.revokeObjectURL(n),e.urls.delete(t))}function Ar(e,t){let n=Or(t),r=n.imgs.get(e);if(r)return n.imgs.delete(e),n.imgs.set(e,r),r;let i=(async()=>{let r=await t(e,`image/svg+xml`),i=URL.createObjectURL(r);n.urls.set(e,i);let a=new Image;return await new Promise((t,n)=>{a.onload=()=>{typeof a.decode==`function`?a.decode().then(()=>t()).catch(()=>t()):t()},a.onerror=()=>n(Error(`svg load failed: ${e}`)),a.src=i}),a})();if(i.catch(()=>kr(n,e)),n.imgs.set(e,i),n.imgs.size>256){let e=n.imgs.keys().next().value;kr(n,e)}return i}function jr(e){let t=Dr.get(e);if(t){for(let e of t.urls.values())URL.revokeObjectURL(e);t.urls.clear(),t.imgs.clear(),Dr.delete(e)}}const Mr=32767;function Nr(e,t,n,r,i){if(n<40||t+40>e.byteLength)return null;let a=e.getUint32(t,!0);if(a<40)return null;let o=e.getInt32(t+4,!0),s=e.getInt32(t+8,!0),c=e.getUint16(t+14,!0);if(e.getUint32(t+16,!0)!==0)return null;let l=s<0,u=Math.abs(o),d=Math.abs(s);if(u<=0||d<=0||u>Mr||d>Mr||u*d>67108864)return null;let f=new Uint8ClampedArray(u*d*4),p=u*c+31>>5<<2>>>0;if(r+p*d>r+i+p&&r+p*d>e.byteLength)return null;let m=null;if(c<=8){let n=e.getUint32(t+32,!0);n===0&&(n=1<<c);let r=t+a;m=[];for(let t=0;t<n;t++){let n=r+t*4;if(n+4>e.byteLength)break;let i=e.getUint8(n),a=e.getUint8(n+1),o=e.getUint8(n+2);m.push(o<<16|a<<8|i)}}let h=(e,t,n,r,i,a)=>{let o=(e*u+t)*4;f[o]=n,f[o+1]=r,f[o+2]=i,f[o+3]=a},g=!1;for(let t=0;t<d;t++){let n=l?t:d-1-t,i=t,a=r+n*p;if(a+p>e.byteLength)break;if(c===32)for(let t=0;t<u;t++){let n=a+t*4,r=e.getUint8(n),o=e.getUint8(n+1),s=e.getUint8(n+2),c=e.getUint8(n+3);c!==0&&(g=!0),h(i,t,s,o,r,c)}else if(c===24){for(let t=0;t<u;t++){let n=a+t*3;h(i,t,e.getUint8(n+2),e.getUint8(n+1),e.getUint8(n),255)}g=!0}else if(c===8&&m){for(let t=0;t<u;t++){let n=e.getUint8(a+t),r=m[n]??0;h(i,t,r>>16&255,r>>8&255,r&255,255)}g=!0}else if(c===4&&m){for(let t=0;t<u;t++){let n=e.getUint8(a+(t>>1)),r=t&1?n&15:n>>4&15,o=m[r]??0;h(i,t,o>>16&255,o>>8&255,o&255,255)}g=!0}else if(c===1&&m){for(let t=0;t<u;t++){let n=e.getUint8(a+(t>>3))>>7-(t&7)&1,r=m[n]??0;h(i,t,r>>16&255,r>>8&255,r&255,255)}g=!0}else return null}if(c===32&&!g)for(let e=3;e<f.length;e+=4)f[e]=255;return{width:u,height:d,data:f}}function Pr(e,t,n){if(n<40||t+40>e.byteLength)return null;let r=e.getUint32(t,!0);if(r<40)return null;let i=e.getUint16(t+14,!0),a=0;if(i<=8){let n=e.getUint32(t+32,!0);n===0&&(n=1<<i),a=n}else a=e.getUint32(t+32,!0);let o=r+a*4,s=t+o,c=n-o;return c<=0?null:Nr(e,t,o,s,c)}function Fr(e,t,n,r,i,a){try{let o=Xe(t.width,t.height);if(!o)return!1;let s=o.getContext(`2d`);if(!s)return!1;let c=s.createImageData(t.width,t.height);c.data.set(t.data),s.putImageData(c,0,0);let l=Math.min(n,i),u=Math.min(r,a),d=Math.abs(i-n),f=Math.abs(a-r);return e.drawImage(o,l,u,d,f),!0}catch{return!1}}const q={HEADER:1,POLYBEZIER:2,POLYGON:3,POLYLINE:4,POLYBEZIERTO:5,POLYLINETO:6,POLYPOLYLINE:7,POLYPOLYGON:8,SETWINDOWEXTEX:9,SETWINDOWORGEX:10,SETVIEWPORTEXTEX:11,SETVIEWPORTORGEX:12,EOF:14,SETMAPMODE:17,SETPOLYFILLMODE:19,SETBKMODE:18,SETTEXTALIGN:22,SETTEXTCOLOR:24,MOVETOEX:27,SCALEVIEWPORTEXTEX:31,SCALEWINDOWEXTEX:32,SAVEDC:33,RESTOREDC:34,SETWORLDTRANSFORM:35,MODIFYWORLDTRANSFORM:36,SELECTOBJECT:37,CREATEPEN:38,CREATEBRUSHINDIRECT:39,DELETEOBJECT:40,ELLIPSE:42,RECTANGLE:43,LINETO:54,BEGINPATH:59,ENDPATH:60,CLOSEFIGURE:61,SELECTCLIPPATH:67,EXTCREATEFONTINDIRECTW:82,EXTTEXTOUTW:84,POLYBEZIER16:85,POLYGON16:86,POLYLINE16:87,POLYBEZIERTO16:88,POLYLINETO16:89,POLYPOLYLINE16:90,POLYPOLYGON16:91,CREATEMONOBRUSH:93,CREATEDIBPATTERNBRUSHPT:94,EXTCREATEPEN:95,BITBLT:76,STRETCHDIBITS:81},Ir={WHITE_BRUSH:2147483648,LTGRAY_BRUSH:2147483649,GRAY_BRUSH:2147483650,DKGRAY_BRUSH:2147483651,BLACK_BRUSH:2147483652,NULL_BRUSH:2147483653,WHITE_PEN:2147483654,BLACK_PEN:2147483655,NULL_PEN:2147483656,DC_BRUSH:2147483666,DC_PEN:2147483662},Lr={TEXT:1,LOMETRIC:2,HIMETRIC:3,LOENGLISH:4,HIENGLISH:5,TWIPS:6,ISOTROPIC:7,ANISOTROPIC:8},Rr=()=>({m11:1,m12:0,m21:0,m22:1,dx:0,dy:0});function zr(e,t){return{m11:e.m11*t.m11+e.m21*t.m12,m12:e.m12*t.m11+e.m22*t.m12,m21:e.m11*t.m21+e.m21*t.m22,m22:e.m12*t.m21+e.m22*t.m22,dx:e.m11*t.dx+e.m21*t.dy+e.dx,dy:e.m12*t.dx+e.m22*t.dy+e.dy}}var Br=class{p;constructor(e,t,n){this.dv=e,this.end=n,this.p=t}get pos(){return this.p}set pos(e){this.p=e}get remaining(){return this.end-this.p}i16(){let e=this.dv.getInt16(this.p,!0);return this.p+=2,e}i32(){let e=this.dv.getInt32(this.p,!0);return this.p+=4,e}u32(){let e=this.dv.getUint32(this.p,!0);return this.p+=4,e}f32(){let e=this.dv.getFloat32(this.p,!0);return this.p+=4,e}xform(){return{m11:this.f32(),m12:this.f32(),m21:this.f32(),m22:this.f32(),dx:this.f32(),dy:this.f32()}}skip(e){this.p+=e}};function Vr(e,t,n){return e.wt.m11*t+e.wt.m21*n+e.wt.dx}function Hr(e,t,n){return e.wt.m12*t+e.wt.m22*n+e.wt.dy}function Ur(e){return e.winExtX===0?1:e.vpExtX/e.winExtX}function Wr(e){return e.winExtY===0?1:e.vpExtY/e.winExtY}function Gr(e){return Math.min(Math.abs(Ur(e)),Math.abs(Wr(e)))}function Kr(e){return e.mapMode===Lr.ISOTROPIC?Ur(e)<0?-Gr(e):Gr(e):Ur(e)}function qr(e){return e.mapMode===Lr.ISOTROPIC?Wr(e)<0?-Gr(e):Gr(e):Wr(e)}function Jr(e,t){return(t-e.winOrgX)*Kr(e)+e.vpOrgX}function Yr(e,t){return(t-e.winOrgY)*qr(e)+e.vpOrgY}function Xr(e,t,n){let r=Jr(e,Vr(e,t,n)),i=Yr(e,Hr(e,t,n));return[(r-e.left)*e.W/e.boundsW,(i-e.top)*e.H/e.boundsH]}function Zr(e){return(Math.hypot(e.wt.m11,e.wt.m12)+Math.hypot(e.wt.m21,e.wt.m22))/2}function Qr(e){return(Math.abs(Kr(e))+Math.abs(qr(e)))/2}function $r(e){return(e.W/e.boundsW+e.H/e.boundsH)/2}function ei(e){return Math.hypot(e.wt.m21,e.wt.m22)}function ti(e){return e.H/e.boundsH}function ni(e,t){let n=t*Zr(e)*Qr(e)*$r(e);return Math.max(.75,n)}function ri(e,t){if(e.mapMode=t,t===Lr.TEXT){e.winOrgX=0,e.winOrgY=0,e.vpOrgX=0,e.vpOrgY=0,e.winExtX=1,e.winExtY=1,e.vpExtX=1,e.vpExtY=1;return}if(t===Lr.ANISOTROPIC||t===Lr.ISOTROPIC||e.devPxPerMmX<=0||e.devPxPerMmY<=0)return;let n=25.4,r=t===Lr.LOMETRIC?.1:t===Lr.HIMETRIC?.01:t===Lr.LOENGLISH?.01*n:t===Lr.HIENGLISH?.001*n:t===Lr.TWIPS?n/1440:0;r<=0||(e.winOrgX=0,e.winOrgY=0,e.vpOrgX=0,e.vpOrgY=0,e.winExtX=1,e.winExtY=1,e.vpExtX=r*e.devPxPerMmX,e.vpExtY=-(r*e.devPxPerMmY))}const ii={[Ir.WHITE_BRUSH]:{kind:`brush`,fill:`#ffffff`},[Ir.LTGRAY_BRUSH]:{kind:`brush`,fill:`#c0c0c0`},[Ir.GRAY_BRUSH]:{kind:`brush`,fill:`#808080`},[Ir.DKGRAY_BRUSH]:{kind:`brush`,fill:`#404040`},[Ir.BLACK_BRUSH]:{kind:`brush`,fill:`#000000`},[Ir.NULL_BRUSH]:{kind:`brush`,fill:null}},ai={[Ir.WHITE_PEN]:{kind:`pen`,stroke:`#ffffff`,width:1},[Ir.BLACK_PEN]:{kind:`pen`,stroke:`#000000`,width:1},[Ir.NULL_PEN]:{kind:`pen`,stroke:null,width:1},[Ir.DC_PEN]:{kind:`pen`,stroke:`#000000`,width:1}};function oi(e,t){let n=ii[t];if(n){e.curBrush=n;return}let r=ai[t];if(r){e.curPen=r;return}t===Ir.DC_BRUSH&&(e.curBrush=e.curBrush??{kind:`brush`,fill:`#000000`})}function si(e){let t=0,n=0,r=0,i=0;for(let a=0;a<e.data.length;a+=4)e.data[a+3]!==0&&(t+=e.data[a],n+=e.data[a+1],r+=e.data[a+2],i++);if(i===0)return`#808080`;let a=e=>Math.round(e/i).toString(16).padStart(2,`0`);return`#${a(t)}${a(n)}${a(r)}`}const ci=e=>[e.i16(),e.i16()],li=e=>[e.i32(),e.i32()];function ui(e,t,n){t.skip(16);let r=t.u32();if(r<2||r>1048576||!e.curPen||e.curPen.stroke==null)return;let{ctx:i}=e;i.beginPath();let a=0,o=0;for(let s=0;s<r&&!(t.remaining<4);s++){let[r,c]=n(t),[l,u]=Xr(e,r,c);s===0?i.moveTo(l,u):i.lineTo(l,u),a=r,o=c}i.strokeStyle=e.curPen.stroke,i.lineWidth=ni(e,e.curPen.width),i.stroke(),e.drew=!0,e.curX=a,e.curY=o}function di(e,t,n){t.skip(16);let r=t.u32();if(r<1||r>1048576)return;let{ctx:i}=e,a=e.curPen!=null&&e.curPen.stroke!=null;if(a){i.beginPath();let[t,n]=Xr(e,e.curX,e.curY);i.moveTo(t,n)}for(let o=0;o<r&&!(t.remaining<4);o++){let[r,o]=n(t);if(a){let[t,n]=Xr(e,r,o);i.lineTo(t,n)}e.curX=r,e.curY=o}a&&e.curPen&&(i.strokeStyle=e.curPen.stroke,i.lineWidth=ni(e,e.curPen.width),i.stroke(),e.drew=!0)}function fi(e,t,n){t.skip(16);let r=t.u32();if(r<2||r>1048576)return;let{ctx:i}=e;e.inPath||i.beginPath();let a=!1;for(let o=0;o<r&&!(t.remaining<4);o++){let[r,o]=n(t),[s,c]=Xr(e,r,o);a?i.lineTo(s,c):(i.moveTo(s,c),a=!0)}a&&(i.closePath(),!e.inPath&&(e.curBrush&&e.curBrush.fill!=null&&(i.fillStyle=e.curBrush.fill,i.fill(e.fillRule),e.drew=!0),e.curPen&&e.curPen.stroke!=null&&(i.strokeStyle=e.curPen.stroke,i.lineWidth=ni(e,e.curPen.width),i.stroke(),e.drew=!0)))}function pi(e,t,n,r){t.skip(16);let i=t.u32();if(i<1||i>1048576)return;let a=[];for(let e=0;e<i&&!(t.remaining<4);e++)a.push(n(t));if(a.length<(r?3:4)){a.length&&(e.curX=a[a.length-1][0],e.curY=a[a.length-1][1]);return}let o=e.curPen!=null&&e.curPen.stroke!=null,{ctx:s}=e;if(o){s.beginPath();let t=r?Xr(e,e.curX,e.curY):Xr(e,a[0][0],a[0][1]);s.moveTo(t[0],t[1])}let c=+!r;for(;c+2<a.length+ +!!r;c+=3){let t=a[c],n=a[c+1],r=a[c+2];if(!t||!n||!r)break;if(o){let i=Xr(e,t[0],t[1]),a=Xr(e,n[0],n[1]),o=Xr(e,r[0],r[1]);s.bezierCurveTo(i[0],i[1],a[0],a[1],o[0],o[1])}e.curX=r[0],e.curY=r[1]}o&&e.curPen&&(s.strokeStyle=e.curPen.stroke,s.lineWidth=ni(e,e.curPen.width),s.stroke(),e.drew=!0)}function mi(e,t,n,r){t.skip(16);let i=t.u32(),a=t.u32();if(i<=0||i>65536||a<=0||a>2097152)return;let o=[];for(let e=0;e<i;e++){if(t.remaining<4)return;o.push(t.u32())}let{ctx:s}=e;e.inPath||s.beginPath();let c=!1;for(let i of o){if(i<2){for(let e=0;e<i&&t.remaining>=4;e++)n(t);continue}for(let r=0;r<i&&!(t.remaining<4);r++){let[i,a]=n(t),[o,c]=Xr(e,i,a);r===0?s.moveTo(o,c):s.lineTo(o,c)}r&&s.closePath(),c=!0}!c||e.inPath||(r&&e.curBrush&&e.curBrush.fill!=null&&(s.fillStyle=e.curBrush.fill,s.fill(e.fillRule),e.drew=!0),e.curPen&&e.curPen.stroke!=null&&(s.strokeStyle=e.curPen.stroke,s.lineWidth=ni(e,e.curPen.width),s.stroke(),e.drew=!0))}function hi(e,t,n,r,i){let{ctx:a}=e,o=Xr(e,t,n),s=Xr(e,r,n),c=Xr(e,r,i),l=Xr(e,t,i);e.inPath||a.beginPath(),a.moveTo(o[0],o[1]),a.lineTo(s[0],s[1]),a.lineTo(c[0],c[1]),a.lineTo(l[0],l[1]),a.closePath(),!e.inPath&&(e.curBrush&&e.curBrush.fill!=null&&(a.fillStyle=e.curBrush.fill,a.fill(e.fillRule),e.drew=!0),e.curPen&&e.curPen.stroke!=null&&(a.strokeStyle=e.curPen.stroke,a.lineWidth=ni(e,e.curPen.width),a.stroke(),e.drew=!0))}function gi(e){let t=e.u32(),n=e.u32(),r=e.i32();e.i32();let i=e.u32();return[t,{kind:`pen`,stroke:(n&255)==5?null:Ui(i),width:Math.abs(r)}]}function _i(e){let t=e.u32();e.skip(16);let n=e.u32(),r=e.u32();e.u32();let i=e.u32();return[t,{kind:`pen`,stroke:(n&255)==5?null:Ui(i),width:Math.abs(r)}]}function vi(e){let t=e.u32(),n=e.u32(),r=e.u32();return e.u32(),[t,{kind:`brush`,fill:n===1?null:Ui(r)}]}function yi(e,t,n){let r=e.u32();e.u32();let i=e.u32(),a=e.u32(),o=e.u32(),s=e.u32(),c=`#808080`;try{let e=Nr(t,n+i,a,n+o,s);e&&(c=si(e))}catch{}return[r,{kind:`brush`,fill:c}]}function bi(e,t,n){let r=e.u32(),i=n+12,a=t.getInt32(i,!0),o=t.getInt32(i+8,!0),s=t.getInt32(i+16,!0),c=t.getUint8(i+20),l=``;for(let e=0;e<32;e++){let n=i+28+e*2;if(n+2>t.byteLength)break;let r=t.getUint16(n,!0);if(r===0)break;l+=String.fromCharCode(r)}return[r,{kind:`font`,height:Math.abs(a),weight:s,italic:c!==0,face:l,escapement:o}]}function xi(e,t,n,r){t.skip(16),t.u32(),t.f32(),t.f32();let i=t.i32(),a=t.i32(),o=t.u32(),s=t.u32();if(t.u32(),o<=0||o>65536)return;let c=``;for(let e=0;e<o;e++){let t=r+s+e*2;if(t+2>n.byteLength)break;c+=String.fromCharCode(n.getUint16(t,!0))}if(c.length===0)return;let l=e.curFont,u=Math.abs(l?.height??0)*ei(e)*Math.abs(qr(e))*ti(e);if(!Number.isFinite(u)||u<1)return;let{ctx:d}=e,[f,p]=Xr(e,i,a);d.fillStyle=e.textColor;let m=l&&l.weight>=700?`bold `:``;d.font=`${l?.italic?`italic `:``}${m}${u}px ${l?.face||`sans-serif`}`;let h=e.textAlign&6;d.textAlign=h===2?`right`:h===6?`center`:`left`,d.textBaseline=(e.textAlign&24)==24?`alphabetic`:`top`;let g=l?.escapement??0;try{if(g!==0){d.save();try{d.translate(f,p),d.rotate(-g/10*(Math.PI/180)),d.fillText(c,0,0)}finally{d.restore()}}else d.fillText(c,f,p);e.drew=!0}catch{}}function Si(e,t,n,r,i,a,o,s,c,l,u){if(i===0||o===0)return;let d=Nr(t,n+r,i,n+a,o);if(!d)return;let[f,p]=Xr(e,s,c),[m,h]=Xr(e,l,u);Fr(e.ctx,d,f,p,m,h)&&(e.drew=!0)}function Ci(e,t,n,r){t.skip(16);let i=t.i32(),a=t.i32(),o=t.i32(),s=t.i32();t.u32(),t.i32(),t.i32(),t.skip(24),t.u32(),t.u32(),Si(e,n,r,t.u32(),t.u32(),t.u32(),t.u32(),i,a,i+o,a+s)}function wi(e,t,n,r){t.skip(16);let i=t.i32(),a=t.i32();t.i32(),t.i32(),t.i32(),t.i32();let o=t.u32(),s=t.u32(),c=t.u32(),l=t.u32();t.u32(),t.u32();let u=t.i32(),d=t.i32();Si(e,n,r,o,s,c,l,i,a,i+u,a+d)}function Ti(e,t,n,r){if(!Vi(e)||n<=0||r<=0)return!1;let i=new DataView(e.buffer,e.byteOffset,e.byteLength),a={ctx:t,W:n,H:r,left:0,top:0,boundsW:n,boundsH:r,wt:Rr(),mapMode:Lr.TEXT,winOrgX:0,winOrgY:0,winExtX:1,winExtY:1,vpOrgX:0,vpOrgY:0,vpExtX:1,vpExtY:1,devPxPerMmX:0,devPxPerMmY:0,objects:new Map,curPen:null,curBrush:null,curFont:null,textColor:`#000000`,bkMode:1,textAlign:0,fillRule:`nonzero`,curX:0,curY:0,stack:[],drew:!1,inPath:!1},o=0;for(;o+8<=e.length;){let n=i.getUint32(o,!0),r=i.getUint32(o+4,!0);if(r<8||r&3)break;let s=o+r;if(s>e.length||n===q.EOF)break;let c=new Br(i,o+8,s);try{switch(n){case q.HEADER:{let e=i.getInt32(o+8,!0),t=i.getInt32(o+12,!0),n=i.getInt32(o+16,!0),r=i.getInt32(o+20,!0);if(a.left=e,a.top=t,a.boundsW=Math.max(1,n-e),a.boundsH=Math.max(1,r-t),s>=o+88){let e=i.getInt32(o+24,!0),t=i.getInt32(o+28,!0),n=i.getInt32(o+32,!0),r=i.getInt32(o+36,!0),s=i.getInt32(o+72,!0),c=i.getInt32(o+76,!0),l=i.getInt32(o+80,!0),u=i.getInt32(o+84,!0),d=n-e,f=r-t;if(d>0&&f>0&&s>0&&c>0&&l>0&&u>0){let n=s/(l*100),r=c/(u*100);a.left=e*n,a.top=t*r,a.boundsW=Math.max(1,d*n),a.boundsH=Math.max(1,f*r),a.devPxPerMmX=s/l,a.devPxPerMmY=c/u}}break}case q.SETWORLDTRANSFORM:a.wt=c.xform();break;case q.MODIFYWORLDTRANSFORM:{let e=c.xform(),t=c.u32();t===1?a.wt=Rr():t===2?a.wt=zr(e,a.wt):t===3?a.wt=zr(a.wt,e):t===4&&(a.wt=e);break}case q.SETMAPMODE:ri(a,c.u32());break;case q.SETWINDOWORGEX:a.winOrgX=c.i32(),a.winOrgY=c.i32();break;case q.SETWINDOWEXTEX:{let e=c.i32(),t=c.i32();e!==0&&(a.winExtX=e),t!==0&&(a.winExtY=t);break}case q.SETVIEWPORTORGEX:a.vpOrgX=c.i32(),a.vpOrgY=c.i32();break;case q.SETVIEWPORTEXTEX:{let e=c.i32(),t=c.i32();e!==0&&(a.vpExtX=e),t!==0&&(a.vpExtY=t);break}case q.SCALEWINDOWEXTEX:{let e=c.i32(),t=c.i32(),n=c.i32(),r=c.i32();t!==0&&(a.winExtX=a.winExtX*e/t),r!==0&&(a.winExtY=a.winExtY*n/r);break}case q.SCALEVIEWPORTEXTEX:{let e=c.i32(),t=c.i32(),n=c.i32(),r=c.i32();t!==0&&(a.vpExtX=a.vpExtX*e/t),r!==0&&(a.vpExtY=a.vpExtY*n/r);break}case q.SAVEDC:a.ctx.save(),a.stack.push({wt:{...a.wt},mapMode:a.mapMode,winOrgX:a.winOrgX,winOrgY:a.winOrgY,winExtX:a.winExtX,winExtY:a.winExtY,vpOrgX:a.vpOrgX,vpOrgY:a.vpOrgY,vpExtX:a.vpExtX,vpExtY:a.vpExtY,curPen:a.curPen,curBrush:a.curBrush,curFont:a.curFont,textColor:a.textColor,bkMode:a.bkMode,textAlign:a.textAlign,fillRule:a.fillRule,curX:a.curX,curY:a.curY});break;case q.RESTOREDC:{let e=c.i32(),t=Math.min(Math.abs(e)||1,a.stack.length),n;for(let e=0;e<t;e++)n=a.stack.pop(),a.ctx.restore();n&&(a.wt=n.wt,a.mapMode=n.mapMode,a.winOrgX=n.winOrgX,a.winOrgY=n.winOrgY,a.winExtX=n.winExtX,a.winExtY=n.winExtY,a.vpOrgX=n.vpOrgX,a.vpOrgY=n.vpOrgY,a.vpExtX=n.vpExtX,a.vpExtY=n.vpExtY,a.curPen=n.curPen,a.curBrush=n.curBrush,a.curFont=n.curFont,a.textColor=n.textColor,a.bkMode=n.bkMode,a.textAlign=n.textAlign,a.fillRule=n.fillRule,a.curX=n.curX,a.curY=n.curY);break}case q.BEGINPATH:a.ctx.beginPath(),a.inPath=!0;break;case q.CLOSEFIGURE:a.inPath&&a.ctx.closePath();break;case q.ENDPATH:a.inPath=!1;break;case q.SELECTCLIPPATH:try{a.ctx.clip(a.fillRule)}catch{}break;case q.SELECTOBJECT:{let e=c.u32();if(e&2147483648)oi(a,e>>>0);else{let t=a.objects.get(e);t?.kind===`pen`?a.curPen=t:t?.kind===`brush`?a.curBrush=t:t?.kind===`font`&&(a.curFont=t)}break}case q.DELETEOBJECT:{let e=c.u32(),t=a.objects.get(e);t&&(t===a.curPen&&(a.curPen=null),t===a.curBrush&&(a.curBrush=null),t===a.curFont&&(a.curFont=null),a.objects.delete(e));break}case q.CREATEPEN:{let[e,t]=gi(c);a.objects.set(e,t);break}case q.EXTCREATEPEN:{let[e,t]=_i(c);a.objects.set(e,t);break}case q.CREATEBRUSHINDIRECT:{let[e,t]=vi(c);a.objects.set(e,t);break}case q.CREATEMONOBRUSH:case q.CREATEDIBPATTERNBRUSHPT:{let[e,t]=yi(c,i,o);a.objects.set(e,t);break}case q.EXTCREATEFONTINDIRECTW:{let[e,t]=bi(c,i,o);a.objects.set(e,t);break}case q.POLYLINE16:ui(a,c,ci);break;case q.POLYLINE:ui(a,c,li);break;case q.POLYLINETO16:di(a,c,ci);break;case q.POLYLINETO:di(a,c,li);break;case q.POLYGON16:fi(a,c,ci);break;case q.POLYGON:fi(a,c,li);break;case q.POLYBEZIER16:pi(a,c,ci,!1);break;case q.POLYBEZIER:pi(a,c,li,!1);break;case q.POLYBEZIERTO16:pi(a,c,ci,!0);break;case q.POLYBEZIERTO:pi(a,c,li,!0);break;case q.POLYPOLYGON16:mi(a,c,ci,!0);break;case q.POLYPOLYGON:mi(a,c,li,!0);break;case q.POLYPOLYLINE16:mi(a,c,ci,!1);break;case q.POLYPOLYLINE:mi(a,c,li,!1);break;case q.MOVETOEX:a.curX=c.i32(),a.curY=c.i32();break;case q.LINETO:{let e=c.i32(),n=c.i32();if(a.curPen&&a.curPen.stroke!=null){let[r,i]=Xr(a,a.curX,a.curY),[o,s]=Xr(a,e,n);t.beginPath(),t.moveTo(r,i),t.lineTo(o,s),t.strokeStyle=a.curPen.stroke,t.lineWidth=ni(a,a.curPen.width),t.stroke(),a.drew=!0}a.curX=e,a.curY=n;break}case q.RECTANGLE:hi(a,c.i32(),c.i32(),c.i32(),c.i32());break;case q.ELLIPSE:{let e=c.i32(),n=c.i32(),r=c.i32(),i=c.i32(),[o,s]=[(e+r)/2,(n+i)/2],[l,u]=Xr(a,o,s),[d]=Xr(a,r,s),[,f]=Xr(a,o,i),p=Math.abs(d-l),m=Math.abs(f-u);t.beginPath(),t.ellipse(l,u,p,m,0,0,Math.PI*2),a.curBrush&&a.curBrush.fill!=null&&(t.fillStyle=a.curBrush.fill,t.fill(a.fillRule),a.drew=!0),a.curPen&&a.curPen.stroke!=null&&(t.strokeStyle=a.curPen.stroke,t.lineWidth=ni(a,a.curPen.width),t.stroke(),a.drew=!0);break}case q.SETPOLYFILLMODE:a.fillRule=c.u32()===1?`evenodd`:`nonzero`;break;case q.SETTEXTCOLOR:a.textColor=Ui(c.u32());break;case q.SETTEXTALIGN:a.textAlign=c.u32();break;case q.SETBKMODE:a.bkMode=c.u32();break;case q.EXTTEXTOUTW:xi(a,c,i,o);break;case q.BITBLT:Ci(a,c,i,o);break;case q.STRETCHDIBITS:wi(a,c,i,o);break;default:break}}catch{}o=s}return a.drew}async function Ei(e,t,n){if(!Vi(e)||t<=0||n<=0)return null;let r=Xe(t,n);if(!r)return null;let i=r.getContext(`2d`);return!i||(i.lineJoin=`round`,i.lineCap=`round`,!Ti(e,i,t,n))?null:createImageBitmap(r)}function Di(e,t){return e[t]<<8|e[t+1]}function Oi(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function ki(e,t){return e[t]|e[t+1]<<8}function Ai(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24|0}function ji(e){let t=e.length;return t>=24&&e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71&&e[4]===13&&e[5]===10&&e[6]===26&&e[7]===10?e[12]===73&&e[13]===72&&e[14]===68&&e[15]===82?{width:Oi(e,16),height:Oi(e,20)}:null:t>=10&&e[0]===71&&e[1]===73&&e[2]===70&&e[3]===56&&(e[4]===55||e[4]===57)&&e[5]===97?{width:ki(e,6),height:ki(e,8)}:t>=26&&e[0]===66&&e[1]===77?Mi(e,14)===12?{width:ki(e,18),height:ki(e,20)}:{width:Math.abs(Ai(e,18)),height:Math.abs(Ai(e,22))}:t>=16&&e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80?Ni(e):t>=4&&e[0]===255&&e[1]===216?Pi(e):null}function Mi(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function Ni(e){let t=e.length,n=e[12],r=e[13],i=e[14],a=e[15];if(n===86&&r===80&&i===56&&a===32)return t<30?null:{width:ki(e,26)&16383,height:ki(e,28)&16383};if(n===86&&r===80&&i===56&&a===76){if(t<25||e[20]!==47)return null;let n=Mi(e,21);return{width:(n&16383)+1,height:(n>>>14&16383)+1}}return n===86&&r===80&&i===56&&a===88?t<30?null:{width:(e[24]|e[25]<<8|e[26]<<16)+1,height:(e[27]|e[28]<<8|e[29]<<16)+1}:null}function Pi(e){let t=e.length,n=2;for(;n+1<t;){if(e[n]!==255){n+=1;continue}let r=e[n+1];if(r===255){n+=1;continue}if(r===216||r===1||r>=208&&r<=215){n+=2;continue}if(r===217||n+3>=t)return null;let i=Di(e,n+2);if(r>=192&&r<=207&&r!==196&&r!==200&&r!==204){if(n+8>=t)return null;let r=Di(e,n+5);return{width:Di(e,n+7),height:r}}if(i<2)return null;n+=2+i}return null}function Fi(e){let{width:t,height:n}=e;return!Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0||t>32767||n>32767?!0:t*n>67108864}function Ii(e){let t=ji(e);return t!==null&&Fi(t)}const Li={EOF:0,SETBKMODE:258,SETTEXTALIGN:302,SETTEXTCOLOR:521,SETPOLYFILLMODE:262,SETWINDOWORG:523,SETWINDOWEXT:524,SELECTOBJECT:301,DELETEOBJECT:496,TEXTOUT:1313,POLYGON:804,POLYLINE:805,POLYPOLYGON:1336,RECTANGLE:1051,CREATEPENINDIRECT:762,CREATEFONTINDIRECT:763,CREATEBRUSHINDIRECT:764,DIBBITBLT:2368,DIBSTRETCHBLT:2881,STRETCHDIBITS:3907},Ri=2596720087;function zi(e,t){if(e.length<t+18)return!1;let n=e[t]|e[t+1]<<8,r=e[t+2]|e[t+3]<<8;return(n===1||n===2)&&r===9}function Bi(e){return e.length<4?!1:(e[0]|e[1]<<8|e[2]<<16|e[3]<<24)>>>0===Ri?!0:zi(e,0)}function Vi(e){if(e.length<44)return!1;let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return t.getUint32(0,!0)===1&&t.getUint32(40,!0)===1179469088}function Hi(e){return e===`image/wmf`||e===`image/emf`}function Ui(e){let t=e&255,n=e>>>8&255,r=e>>>16&255,i=e=>e.toString(16).padStart(2,`0`);return`#${i(t)}${i(n)}${i(r)}`}function Wi(e,t){for(let n=0;n<e.length;n++)if(e[n]==null){e[n]=t;return}e.push(t)}var Gi=class{p=0;constructor(e,t,n){this.b=e,this.end=n,this.p=t}get remaining(){return this.end-this.p}i16(){let e=this.u16();return e>=32768?e-65536:e}u16(){let e=this.b[this.p]|this.b[this.p+1]<<8;return this.p+=2,e}u8(){return this.b[this.p++]}u32(){let e=(this.b[this.p]|this.b[this.p+1]<<8|this.b[this.p+2]<<16|this.b[this.p+3]<<24)>>>0;return this.p+=4,e}bytes(e){let t=Math.min(this.p+Math.max(0,e),this.end),n=this.b.subarray(this.p,t);return this.p=t,n}skip(e){this.p=Math.min(this.p+Math.max(0,e),this.end)}};function Ki(e,t){return(t-e.orgX)*(e.W/e.extX)}function qi(e,t){return(t-e.orgY)*(e.H/e.extY)}function Ji(e,t){let n=t*Math.abs(e.W/e.extX);return n>=1?n:1}const Yi=.001;function Xi(e,t,n){return Math.abs(e-t)<=Yi||Math.abs(e-n)<=Yi}function Zi(e,t,n){let r=[],i=n?t.length:t.length-1;for(let n=0;n<i;n++){let i=t[n],a=t[(n+1)%t.length],o=Math.abs(i[0]-a[0])<=Yi&&Xi(i[0],0,e.W)&&Xi(a[0],0,e.W),s=Math.abs(i[1]-a[1])<=Yi&&Xi(i[1],0,e.H)&&Xi(a[1],0,e.H);o||s||r.push([i,a])}return r}function Qi(e,t,n){if(!e.curPen||e.curPen.stroke==null||t.length<2)return;let{ctx:r}=e;if(r.strokeStyle=e.curPen.stroke,r.lineWidth=Ji(e,e.curPen.width),!e.suppressBoundaryFrame){r.beginPath(),r.moveTo(t[0][0],t[0][1]);for(let e=1;e<t.length;e++)r.lineTo(t[e][0],t[e][1]);n&&r.closePath(),r.stroke(),e.drew=!0;return}let i=Zi(e,t,n);if(i.length===0)return;r.beginPath();let a=null;for(let[e,t]of i)(!a||a[0]!==e[0]||a[1]!==e[1])&&r.moveTo(e[0],e[1]),r.lineTo(t[0],t[1]),a=t;r.stroke(),e.drew=!0}function $i(e,t,n){let r=[];for(let i=0;i<n&&!(t.remaining<4);i++){let n=t.i16(),i=t.i16();r.push([Ki(e,n),qi(e,i)])}return r}function ea(e,t){t.length<2||!e.curPen||e.curPen.stroke==null||Qi(e,t,!1)}function ta(e,t){if(t.length<2)return;let{ctx:n}=e;if(e.curBrush&&e.curBrush.fill!=null){n.beginPath(),n.moveTo(t[0][0],t[0][1]);for(let e=1;e<t.length;e++)n.lineTo(t[e][0],t[e][1]);n.closePath(),n.fillStyle=e.curBrush.fill,n.fill(e.fillRule),e.drew=!0}Qi(e,t,!0)}function na(e,t){let n=t.u16();if(n<=0||n>65536)return;let r=[];for(let e=0;e<n;e++){if(t.remaining<2)return;r.push(t.u16())}let{ctx:i}=e;i.beginPath();let a=!1;for(let n of r){if(n<2){for(let e=0;e<n&&t.remaining>=4;e++)t.i16(),t.i16();continue}let r=$i(e,t,n);if(!(r.length<2)){i.moveTo(r[0][0],r[0][1]);for(let e=1;e<r.length;e++)i.lineTo(r[e][0],r[e][1]);i.closePath(),a=!0}}a&&(e.curBrush&&e.curBrush.fill!=null&&(i.fillStyle=e.curBrush.fill,i.fill(e.fillRule),e.drew=!0),e.curPen&&e.curPen.stroke!=null&&(i.strokeStyle=e.curPen.stroke,i.lineWidth=Ji(e,e.curPen.width),i.stroke(),e.drew=!0))}function ra(e){let t=e.u16(),n=e.i16();e.i16();let r=e.u32();return{kind:`pen`,stroke:(t&255)==5?null:Ui(r),width:Math.abs(n)}}function ia(e){let t=e.u16(),n=e.u32();return e.u16(),{kind:`brush`,fill:t===1?null:Ui(n)}}function aa(e){let t=e.indexOf(0),n=t>=0?e.subarray(0,t):e;if(n.length===0)return``;try{return new TextDecoder(`shift_jis`).decode(n)}catch{return String.fromCharCode(...n)}}function oa(e){let t=Math.abs(e.i16());e.i16(),e.i16(),e.i16();let n=e.i16(),r=e.u8()!==0;return e.u8(),e.u8(),e.u8(),e.u8(),e.u8(),e.u8(),e.u8(),{kind:`font`,height:t,weight:n,italic:r,face:aa(e.bytes(Math.min(32,e.remaining)))}}function sa(e,t,n,r){if(t.length===0)return;let i=e.curFont,a=i?.height||12,o=Math.abs(qi(e,e.orgY+a)-qi(e,e.orgY));if(!Number.isFinite(o)||o<1)return;let{ctx:s}=e;try{s.fillStyle=e.textColor;let a=i&&i.weight>=700?`bold `:``;s.font=`${i?.italic?`italic `:``}${a}${o}px ${i?.face||`sans-serif`}`;let c=e.textAlign&6;s.textAlign=c===2?`right`:c===6?`center`:`left`,s.textBaseline=(e.textAlign&24)==24?`alphabetic`:`top`,s.fillText(t,Ki(e,n),qi(e,r)),e.drew=!0}catch{}}function ca(e,t,n,r,i=!1){if(!Bi(e))return!1;let a=0;(e.length>=4?(e[0]|e[1]<<8|e[2]<<16|e[3]<<24)>>>0:0)===Ri&&(a=22);let o=a+18;if(o>e.length)return!1;let s={ctx:t,W:n,H:r,orgX:0,orgY:0,extX:n||1,extY:r||1,haveExt:!1,objects:[],curPen:null,curBrush:null,curFont:null,textColor:`#000000`,textAlign:0,fillRule:`nonzero`,drew:!1,suppressBoundaryFrame:i},c=new DataView(e.buffer,e.byteOffset,e.byteLength);for(;o+6<=e.length;){let t=c.getUint32(o,!0),n=c.getUint16(o+4,!0);if(t<3)break;let r=t*2,i=o+r;if(i>e.length||n===Li.EOF)break;let a=o+6,l=new Gi(e,a,i);switch(n){case Li.SETWINDOWORG:s.orgY=l.i16(),s.orgX=l.i16();break;case Li.SETWINDOWEXT:{let e=l.i16(),t=l.i16();s.extY=e||1,s.extX=t||1,s.haveExt=!0;break}case Li.SETPOLYFILLMODE:s.fillRule=l.u16()===1?`evenodd`:`nonzero`;break;case Li.SETTEXTCOLOR:s.textColor=Ui(l.u32());break;case Li.SETTEXTALIGN:s.textAlign=l.u16();break;case Li.CREATEPENINDIRECT:Wi(s.objects,ra(l));break;case Li.CREATEBRUSHINDIRECT:Wi(s.objects,ia(l));break;case Li.CREATEFONTINDIRECT:Wi(s.objects,oa(l));break;case Li.SELECTOBJECT:{let e=l.u16(),t=s.objects[e];t?.kind===`pen`?s.curPen=t:t?.kind===`brush`?s.curBrush=t:t?.kind===`font`&&(s.curFont=t);break}case Li.DELETEOBJECT:{let e=l.u16(),t=s.objects[e];t&&(t===s.curPen&&(s.curPen=null),t===s.curBrush&&(s.curBrush=null),t===s.curFont&&(s.curFont=null),s.objects[e]=null);break}case Li.POLYLINE:ea(s,$i(s,l,l.i16()));break;case Li.POLYGON:ta(s,$i(s,l,l.i16()));break;case Li.POLYPOLYGON:na(s,l);break;case Li.RECTANGLE:{let e=l.i16(),t=l.i16(),n=l.i16(),r=l.i16();ta(s,[[Ki(s,r),qi(s,n)],[Ki(s,t),qi(s,n)],[Ki(s,t),qi(s,e)],[Ki(s,r),qi(s,e)]]);break}case Li.TEXTOUT:{let e=l.u16(),t=aa(l.bytes(e));e%2!=0&&l.skip(1);let n=l.i16();sa(s,t,l.i16(),n);break}case Li.STRETCHDIBITS:{l.u32(),l.i16(),l.i16(),l.i16(),l.i16(),l.u16();let e=l.i16(),t=l.i16(),n=l.i16(),r=l.i16(),o=a+22,u=Pr(c,o,i-o);if(u){let i=Ki(s,r),a=qi(s,n),o=Ki(s,r+t),c=qi(s,n+e);Fr(s.ctx,u,i,a,o,c)&&(s.drew=!0)}break}case Li.DIBSTRETCHBLT:case Li.DIBBITBLT:case Li.SETBKMODE:break;default:break}o=i}return s.drew}function la(e,t){let n=e>0?e:300,r=t>0?t:300,i=e=>Math.max(1,Math.min(2e3,Math.round(e)));return{w:i(n*2),h:i(r*2)}}async function ua(e,t,n,r=!1){if(!Bi(e)||t<=0||n<=0)return null;let i=Xe(t,n);if(!i)return null;let a=i.getContext(`2d`);return!a||(a.lineJoin=`round`,a.lineCap=`round`,!ca(e,a,t,n,r))?null:createImageBitmap(i)}async function da(e,t={}){let{widthPt:n=0,heightPt:r=0,suppressBoundaryFrame:i=!1}=t,a=new Uint8Array(await e.slice(0,64*1024).arrayBuffer());if(Bi(a)){let{w:t,h:a}=la(n,r);return ua(new Uint8Array(await e.arrayBuffer()),t,a,i)}if(Vi(a)){let{w:t,h:i}=la(n,r);return Ei(new Uint8Array(await e.arrayBuffer()),t,i)}return Ii(a)?null:createImageBitmap(e)}const fa=new WeakMap;function pa(e){let t=fa.get(e);return t||(t=new Map,fa.set(e,t)),t}const ma=new WeakMap,ha=new WeakSet;function ga(e){!e||ha.has(e)||(ha.add(e),e.close())}function _a(e){let t=ma.get(e);t||(t={count:0,deferred:[]},ma.set(e,t));let n=t;n.count++;let r=!1;return()=>{if(!r&&(r=!0,n.count--,!(n.count>0))){for(let e of n.deferred)e.then(e=>ga(e)).catch(()=>{});n.deferred=[],ma.delete(e)}}}function va(e,t){let n=ma.get(e);if(n&&n.count>0){n.deferred.push(t);return}t.then(e=>ga(e)).catch(()=>{})}function ya(e,t,n,r={}){let{widthPt:i=0,heightPt:a=0,suppressBoundaryFrame:o=!1}=r,s=pa(n),c=s.get(e);if(c)return s.delete(e),s.set(e,c),c.promise;let l=n(e,t).then(e=>da(e,{widthPt:i,heightPt:a,suppressBoundaryFrame:o})),u={promise:l};if(l.then(e=>{u.bitmap=e}).catch(()=>{}),l.catch(()=>s.delete(e)),s.set(e,u),s.size>256){let e=s.keys().next().value,t=s.get(e);s.delete(e),t&&va(n,t.promise)}return l}function ba(e){let t=fa.get(e);if(t){for(let n of t.values())va(e,n.promise);t.clear(),fa.delete(e)}}function xa(e){let t=e;return{w:t.naturalWidth||(typeof t.width==`number`?t.width:0)||0,h:t.naturalHeight||(typeof t.height==`number`?t.height:0)||0}}function Sa(e,t){if(!t||!(t.l||t.t||t.r||t.b))return null;let{w:n,h:r}=xa(e);if(n<=0||r<=0)return null;let i=e=>Math.max(0,Math.min(1,e)),a=i(t.l)*n,o=i(t.t)*r;return{sx:a,sy:o,sw:Math.max(1,n-a-i(t.r)*n),sh:Math.max(1,r-o-i(t.b)*r)}}function Ca(e,t,n,r,i,a,o){let s=Sa(t,n);s?e.drawImage(t,s.sx,s.sy,s.sw,s.sh,r,i,a,o):e.drawImage(t,r,i,a,o)}function wa(e,t,n,r){if(!t||!Hi(e))return{widthPt:n,heightPt:r};let i=Math.max(.01,1-t.l-t.r),a=Math.max(.01,1-t.t-t.b);return{widthPt:n/i,heightPt:r/a}}function Ta(e){return/^[0-9a-fA-F]{6}$/.test(e)?[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]:null}function Ea(e,t,n){return(.299*e+.587*t+.114*n)/255}function Da(e,t,n){let r=Ta(t),i=Ta(n);if(!r||!i)return e;let[a,o,s]=r,[c,l,u]=i,d=e.data;for(let e=0;e<d.length;e+=4){if(d[e+3]===0)continue;let t=Ea(d[e],d[e+1],d[e+2]);d[e]=Math.round(a+(c-a)*t),d[e+1]=Math.round(o+(l-o)*t),d[e+2]=Math.round(s+(u-s)*t)}return e}const Oa=(e,t)=>typeof OffscreenCanvas>`u`?null:new OffscreenCanvas(e,t);async function ka(e,t,n){let{width:r,height:i}=n;if(r<=0||i<=0||typeof createImageBitmap>`u`)return e;let a=(n.offscreenFactory??Oa)(r,i);if(!a)return e;let o=a.getContext(`2d`);if(!o)return e;o.drawImage(e,0,0);let s;try{s=o.getImageData(0,0,r,i)}catch{return e}return Da(s,t.clr1,t.clr2),o.putImageData(s,0,0),createImageBitmap(a)}function Aa(e){return e.svgImagePath!=null&&e.srcRect==null}function ja(e){return typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement}function Ma(e=1){return typeof window<`u`&&window.devicePixelRatio||e}function Na(e,t,n){let r=Math.round(t*n)%2==1?.5:0,i=e*n;return(Math.round(i-r)+r)/n-e}const Pa=32767;function Fa(e,t){let n=Number.isFinite(e)&&e>0?Math.max(1,Math.round(e)):1,r=Number.isFinite(t)&&t>0?Math.max(1,Math.round(t)):1,i=Math.min(1,Pa/n,Pa/r),a=n*r,o=a>16777216?Math.sqrt(16777216/a):1,s=Math.min(i,o);return s>=1?{width:n,height:r,scale:1,clamped:!1}:{width:Math.max(1,Math.floor(n*s)),height:Math.max(1,Math.floor(r*s)),scale:s,clamped:!0}}function Ia(e,t){let n=Math.max(1,Math.round(e*t/3)),r=Math.max(1,Math.round(e*t/3));return{railDev:n,gapDev:r,spanDev:2*n+r}}function La(e){if(!e.startsWith(`data:`))return null;let t=e.indexOf(`,`);if(t===-1)return null;let n=atob(e.slice(t+1)),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}var Ra=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function za(e){let t=globalThis.WebAssembly?.RuntimeError;if(t&&e instanceof t||e instanceof RangeError)return!0;if(e instanceof Error){let t=e.name;if(t===`RuntimeError`||t===`CompileError`||t===`LinkError`)return!0}return!1}var Ba=class{_init;_opts;_wasmInput=null;_initPromise=null;_poisoned=!1;_archive=null;constructor(e,t={}){this._init=e,this._opts=t}setWasmUrl(e){this._wasmInput=e,this._poisoned=!1,this._initPromise=this._init(e)}get archive(){return this._archive}setArchive(e){this._freeArchive(),this._archive=e}disposeArchive(){this._freeArchive()}_freeArchive(){this._archive!=null&&this._opts.freeArchive&&this._opts.freeArchive(this._archive),this._archive=null}get poisoned(){return this._poisoned}async ensureReady(){if(this._poisoned){if(this._wasmInput===null)throw Error(`WasmParserHost: setWasmUrl was never called`);let e=(this._opts.reinit??this._init)(this._wasmInput);this._initPromise=e,await e,this._poisoned=!1;return}if(this._initPromise===null)throw Error(`WasmParserHost: setWasmUrl was never called`);await this._initPromise}run(e){try{return e()}catch(e){throw za(e)?(this._poison(),new Ra(`WASM parser trapped and was recycled: ${e instanceof Error?e.message:String(e)}`)):e}}poison(){this._poison()}_poison(){if(this._poisoned=!0,this._initPromise=null,this._archive!=null&&this._opts.freeArchive)try{this._opts.freeArchive(this._archive)}catch{}this._archive=null}};const Va=[`L`,`R`,`AL`,`EN`,`ES`,`ET`,`AN`,`CS`,`NSM`,`BN`,`B`,`S`,`WS`,`ON`,`LRE`,`LRO`,`RLE`,`RLO`,`PDF`,`LRI`,`RLI`,`FSI`,`PDI`],Ha=[0,9,10,11,12,13,14,28,31,32,33,35,38,43,44,45,46,48,58,59,65,91,97,123,127,133,134,160,161,162,166,170,171,173,174,176,178,180,181,182,185,186,187,192,215,216,247,248,697,699,706,720,722,736,741,750,751,768,880,884,886,894,895,900,902,903,904,1014,1015,1155,1162,1418,1419,1421,1423,1424,1425,1470,1471,1472,1473,1475,1476,1478,1479,1480,1536,1542,1544,1545,1547,1548,1549,1550,1552,1563,1611,1632,1642,1643,1645,1648,1649,1750,1757,1758,1759,1765,1767,1769,1770,1774,1776,1786,1809,1810,1840,1867,1958,1969,1984,2027,2036,2038,2042,2045,2046,2070,2074,2075,2084,2085,2088,2089,2094,2137,2140,2144,2192,2194,2199,2208,2250,2274,2275,2307,2362,2363,2364,2365,2369,2377,2381,2382,2385,2392,2402,2404,2433,2434,2492,2493,2497,2501,2509,2510,2530,2532,2546,2548,2555,2556,2558,2559,2561,2563,2620,2621,2625,2627,2631,2633,2635,2638,2641,2642,2672,2674,2677,2678,2689,2691,2748,2749,2753,2758,2759,2761,2765,2766,2786,2788,2801,2802,2810,2816,2817,2818,2876,2877,2879,2880,2881,2885,2893,2894,2901,2903,2914,2916,2946,2947,3008,3009,3021,3022,3059,3065,3066,3067,3072,3073,3076,3077,3132,3133,3134,3137,3142,3145,3146,3150,3157,3159,3170,3172,3192,3199,3201,3202,3260,3261,3276,3278,3298,3300,3328,3330,3387,3389,3393,3397,3405,3406,3426,3428,3457,3458,3530,3531,3538,3541,3542,3543,3633,3634,3636,3643,3647,3648,3655,3663,3761,3762,3764,3773,3784,3791,3864,3866,3893,3894,3895,3896,3897,3898,3902,3953,3967,3968,3973,3974,3976,3981,3992,3993,4029,4038,4039,4141,4145,4146,4152,4153,4155,4157,4159,4184,4186,4190,4193,4209,4213,4226,4227,4229,4231,4237,4238,4253,4254,4957,4960,5008,5018,5120,5121,5760,5761,5787,5789,5906,5909,5938,5940,5970,5972,6002,6004,6068,6070,6071,6078,6086,6087,6089,6100,6107,6108,6109,6110,6128,6138,6144,6155,6158,6159,6160,6277,6279,6313,6314,6432,6435,6439,6441,6450,6451,6457,6460,6464,6465,6468,6470,6622,6656,6679,6681,6683,6684,6742,6743,6744,6751,6752,6753,6754,6755,6757,6765,6771,6781,6783,6784,6832,6878,6880,6892,6912,6916,6964,6965,6966,6971,6972,6973,6978,6979,7019,7028,7040,7042,7074,7078,7080,7082,7083,7086,7142,7143,7144,7146,7149,7150,7151,7154,7212,7220,7222,7224,7376,7379,7380,7393,7394,7401,7405,7406,7412,7413,7416,7418,7616,7680,8125,8126,8127,8130,8141,8144,8157,8160,8173,8176,8189,8191,8192,8203,8206,8207,8208,8232,8233,8234,8235,8236,8237,8238,8239,8240,8245,8260,8261,8287,8288,8294,8295,8296,8297,8298,8304,8305,8308,8314,8316,8319,8320,8330,8332,8335,8352,8400,8433,8448,8450,8451,8455,8456,8458,8468,8469,8470,8473,8478,8484,8485,8486,8487,8488,8489,8490,8494,8495,8506,8508,8512,8517,8522,8526,8528,8544,8585,8588,8592,8722,8723,8724,9014,9083,9109,9110,9258,9280,9291,9312,9352,9372,9450,9900,9901,10240,10496,11124,11126,11264,11493,11499,11503,11506,11513,11520,11647,11648,11744,11776,11870,11904,11930,11931,12020,12032,12246,12272,12288,12289,12293,12296,12321,12330,12334,12336,12337,12342,12344,12349,12352,12441,12443,12445,12448,12449,12539,12540,12736,12774,12783,12784,12829,12831,12880,12896,12924,12927,12977,12992,13004,13008,13175,13179,13278,13280,13311,13312,19904,19968,42128,42183,42509,42512,42607,42611,42612,42622,42624,42654,42656,42736,42738,42752,42786,42888,42889,43010,43011,43014,43015,43019,43020,43045,43047,43048,43052,43053,43064,43066,43124,43128,43204,43206,43232,43250,43263,43264,43302,43310,43335,43346,43392,43395,43443,43444,43446,43450,43452,43454,43493,43494,43561,43567,43569,43571,43573,43575,43587,43588,43596,43597,43644,43645,43696,43697,43698,43701,43703,43705,43710,43712,43713,43714,43756,43758,43766,43767,43882,43884,44005,44006,44008,44009,44013,44014,64285,64286,64287,64297,64298,64336,64451,64467,64830,64848,64912,64914,64968,64976,65008,65021,65024,65040,65050,65056,65072,65104,65105,65106,65107,65108,65109,65110,65119,65120,65122,65124,65127,65128,65129,65131,65132,65136,65279,65280,65281,65283,65286,65291,65292,65293,65294,65296,65306,65307,65313,65339,65345,65371,65382,65504,65506,65509,65511,65512,65519,65520,65529,65534,65536,65793,65794,65856,65933,65936,65949,65952,65953,66045,66046,66272,66273,66300,66422,66427,67584,67871,67872,68097,68100,68101,68103,68108,68112,68152,68155,68159,68160,68325,68327,68409,68416,68864,68900,68904,68912,68922,68928,68938,68969,68974,68975,69216,69247,69291,69293,69312,69328,69337,69370,69376,69424,69446,69457,69488,69506,69510,69632,69633,69634,69688,69703,69714,69734,69744,69745,69747,69749,69759,69762,69811,69815,69817,69819,69826,69827,69888,69891,69927,69932,69933,69941,70003,70004,70016,70018,70070,70079,70089,70093,70095,70096,70191,70194,70196,70197,70198,70200,70206,70207,70209,70210,70367,70368,70371,70379,70400,70402,70459,70461,70464,70465,70502,70509,70512,70517,70587,70593,70606,70607,70608,70609,70610,70611,70625,70627,70712,70720,70722,70725,70726,70727,70750,70751,70835,70841,70842,70843,70847,70849,70850,70852,71090,71094,71100,71102,71103,71105,71132,71134,71219,71227,71229,71230,71231,71233,71264,71277,71339,71340,71341,71342,71344,71350,71351,71352,71453,71454,71455,71456,71458,71462,71463,71468,71727,71736,71737,71739,71995,71997,71998,71999,72003,72004,72148,72152,72154,72156,72160,72161,72193,72199,72201,72203,72243,72249,72251,72255,72263,72264,72273,72279,72281,72284,72330,72343,72344,72346,72544,72545,72546,72549,72550,72551,72752,72759,72760,72766,72850,72872,72874,72881,72882,72884,72885,72887,73009,73015,73018,73019,73020,73022,73023,73030,73031,73032,73104,73106,73109,73110,73111,73112,73459,73461,73472,73474,73526,73531,73536,73537,73538,73539,73562,73563,73685,73693,73697,73714,78912,78913,78919,78934,90398,90410,90413,90416,92912,92917,92976,92983,94031,94032,94095,94099,94178,94179,94180,94181,113821,113823,113824,113828,117760,117974,118e3,118010,118013,118016,118452,118458,118481,118496,118513,118528,118574,118576,118599,119143,119146,119155,119163,119171,119173,119180,119210,119214,119273,119275,119296,119362,119365,119366,119552,119639,120513,120514,120539,120540,120571,120572,120597,120598,120629,120630,120655,120656,120687,120688,120713,120714,120745,120746,120771,120772,120782,120832,121344,121399,121403,121453,121461,121462,121476,121477,121499,121504,121505,121520,122880,122887,122888,122905,122907,122914,122915,122917,122918,122923,123023,123024,123184,123191,123566,123567,123628,123632,123647,123648,124140,124144,124398,124400,124643,124644,124646,124647,124654,124656,124661,124662,124928,125136,125143,125252,125259,126064,126144,126208,126288,126464,126704,126706,126720,126976,127020,127024,127124,127136,127151,127153,127168,127169,127184,127185,127222,127232,127243,127248,127279,127280,127338,127344,127405,127406,127584,127590,127744,128729,128732,128749,128752,128765,128768,128986,128992,129004,129008,129009,129024,129036,129040,129096,129104,129114,129120,129160,129168,129198,129200,129212,129216,129218,129232,129241,129280,129624,129632,129646,129648,129661,129664,129675,129678,129735,129736,129737,129741,129757,129759,129771,129775,129785,129792,129939,129940,130032,130042,130043,131070,131072,196606,196608,262142,262144,327678,327680,393214,393216,458750,458752,524286,524288,589822,589824,655358,655360,720894,720896,786430,786432,851966,851968,917502,917760,918e3,921600,983038,983040,1048574,1048576,1114110],Ua=[9,11,10,11,12,10,9,10,11,12,13,5,13,4,7,4,7,3,7,13,0,13,0,13,9,10,9,7,13,5,13,0,13,9,13,5,3,13,0,13,3,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,8,0,13,0,13,0,13,0,13,0,13,0,8,0,13,0,13,5,1,8,1,8,1,8,1,8,1,8,1,6,13,2,5,2,7,2,13,8,2,8,6,5,6,2,8,2,8,6,13,8,2,8,13,8,2,3,2,8,2,8,2,8,2,1,8,1,13,1,8,1,8,1,8,1,8,1,8,1,8,1,2,6,2,8,2,8,6,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,5,0,5,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,5,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,5,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,5,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,0,13,0,12,0,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,5,0,8,0,13,0,13,8,9,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,0,13,0,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,0,13,0,13,0,13,0,13,0,13,0,12,9,0,1,13,12,10,14,16,18,15,17,7,5,13,7,13,12,9,19,20,21,22,9,3,0,3,4,13,0,3,4,13,0,5,8,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,5,0,13,0,13,0,13,0,13,0,13,0,13,4,5,13,0,13,0,13,0,13,0,13,3,0,13,0,13,0,13,0,13,0,13,0,8,0,13,0,8,0,8,13,0,13,0,13,0,13,0,13,12,13,0,13,0,8,0,13,0,13,0,13,0,8,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,8,13,8,13,0,8,0,8,0,13,0,13,0,8,0,8,0,8,0,8,0,13,8,0,5,0,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,0,8,0,8,0,8,0,1,8,1,4,1,2,13,2,13,2,13,2,13,9,2,13,8,13,0,8,13,7,13,7,0,13,7,13,5,13,4,13,0,13,5,13,0,2,9,0,13,5,13,4,7,4,7,3,7,13,0,13,0,13,0,5,13,5,0,13,0,9,13,9,0,13,0,13,0,13,0,13,0,8,0,8,3,0,8,0,1,13,1,8,1,8,1,8,1,8,1,8,1,8,1,13,1,2,8,2,6,2,6,1,8,13,1,6,1,8,1,2,13,2,8,1,2,8,2,1,8,1,0,8,0,8,0,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,5,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,0,8,0,8,0,9,0,13,0,3,13,0,13,0,13,0,13,0,8,0,8,0,8,0,9,8,0,8,0,8,0,13,0,13,8,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,3,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,5,0,8,0,8,0,8,0,8,0,8,0,8,0,1,8,1,8,1,2,1,2,1,2,13,2,1,13,0,13,0,13,0,13,0,13,0,13,0,3,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,3,13,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,8,9,0,9,0,9,0,9],Wa=[40,41,41,40,60,62,62,60,91,93,93,91,123,125,125,123,171,187,187,171,3898,3899,3899,3898,3900,3901,3901,3900,5787,5788,5788,5787,8249,8250,8250,8249,8261,8262,8262,8261,8317,8318,8318,8317,8333,8334,8334,8333,8712,8715,8713,8716,8714,8717,8715,8712,8716,8713,8717,8714,8725,10741,8735,11262,8736,10659,8737,10651,8738,10656,8740,10990,8764,8765,8765,8764,8771,8909,8773,8780,8780,8773,8786,8787,8787,8786,8788,8789,8789,8788,8804,8805,8805,8804,8806,8807,8807,8806,8808,8809,8809,8808,8810,8811,8811,8810,8814,8815,8815,8814,8816,8817,8817,8816,8818,8819,8819,8818,8820,8821,8821,8820,8822,8823,8823,8822,8824,8825,8825,8824,8826,8827,8827,8826,8828,8829,8829,8828,8830,8831,8831,8830,8832,8833,8833,8832,8834,8835,8835,8834,8836,8837,8837,8836,8838,8839,8839,8838,8840,8841,8841,8840,8842,8843,8843,8842,8847,8848,8848,8847,8849,8850,8850,8849,8856,10680,8866,8867,8867,8866,8870,10974,8872,10980,8873,10979,8875,10981,8880,8881,8881,8880,8882,8883,8883,8882,8884,8885,8885,8884,8886,8887,8887,8886,8888,10204,8905,8906,8906,8905,8907,8908,8908,8907,8909,8771,8912,8913,8913,8912,8918,8919,8919,8918,8920,8921,8921,8920,8922,8923,8923,8922,8924,8925,8925,8924,8926,8927,8927,8926,8928,8929,8929,8928,8930,8931,8931,8930,8932,8933,8933,8932,8934,8935,8935,8934,8936,8937,8937,8936,8938,8939,8939,8938,8940,8941,8941,8940,8944,8945,8945,8944,8946,8954,8947,8955,8948,8956,8950,8957,8951,8958,8954,8946,8955,8947,8956,8948,8957,8950,8958,8951,8968,8969,8969,8968,8970,8971,8971,8970,9001,9002,9002,9001,10088,10089,10089,10088,10090,10091,10091,10090,10092,10093,10093,10092,10094,10095,10095,10094,10096,10097,10097,10096,10098,10099,10099,10098,10100,10101,10101,10100,10179,10180,10180,10179,10181,10182,10182,10181,10184,10185,10185,10184,10187,10189,10189,10187,10197,10198,10198,10197,10204,8888,10205,10206,10206,10205,10210,10211,10211,10210,10212,10213,10213,10212,10214,10215,10215,10214,10216,10217,10217,10216,10218,10219,10219,10218,10220,10221,10221,10220,10222,10223,10223,10222,10627,10628,10628,10627,10629,10630,10630,10629,10631,10632,10632,10631,10633,10634,10634,10633,10635,10636,10636,10635,10637,10640,10638,10639,10639,10638,10640,10637,10641,10642,10642,10641,10643,10644,10644,10643,10645,10646,10646,10645,10647,10648,10648,10647,10651,8737,10656,8738,10659,8736,10660,10661,10661,10660,10664,10665,10665,10664,10666,10667,10667,10666,10668,10669,10669,10668,10670,10671,10671,10670,10680,8856,10688,10689,10689,10688,10692,10693,10693,10692,10703,10704,10704,10703,10705,10706,10706,10705,10708,10709,10709,10708,10712,10713,10713,10712,10714,10715,10715,10714,10728,10729,10729,10728,10741,8725,10744,10745,10745,10744,10748,10749,10749,10748,10795,10796,10796,10795,10797,10798,10798,10797,10804,10805,10805,10804,10812,10813,10813,10812,10852,10853,10853,10852,10873,10874,10874,10873,10875,10876,10876,10875,10877,10878,10878,10877,10879,10880,10880,10879,10881,10882,10882,10881,10883,10884,10884,10883,10885,10886,10886,10885,10887,10888,10888,10887,10889,10890,10890,10889,10891,10892,10892,10891,10893,10894,10894,10893,10895,10896,10896,10895,10897,10898,10898,10897,10899,10900,10900,10899,10901,10902,10902,10901,10903,10904,10904,10903,10905,10906,10906,10905,10907,10908,10908,10907,10909,10910,10910,10909,10911,10912,10912,10911,10913,10914,10914,10913,10918,10919,10919,10918,10920,10921,10921,10920,10922,10923,10923,10922,10924,10925,10925,10924,10927,10928,10928,10927,10929,10930,10930,10929,10931,10932,10932,10931,10933,10934,10934,10933,10935,10936,10936,10935,10937,10938,10938,10937,10939,10940,10940,10939,10941,10942,10942,10941,10943,10944,10944,10943,10945,10946,10946,10945,10947,10948,10948,10947,10949,10950,10950,10949,10951,10952,10952,10951,10953,10954,10954,10953,10955,10956,10956,10955,10957,10958,10958,10957,10959,10960,10960,10959,10961,10962,10962,10961,10963,10964,10964,10963,10965,10966,10966,10965,10974,8870,10979,8873,10980,8872,10981,8875,10988,10989,10989,10988,10990,8740,10999,11e3,11e3,10999,11001,11002,11002,11001,11262,8735,11778,11779,11779,11778,11780,11781,11781,11780,11785,11786,11786,11785,11788,11789,11789,11788,11804,11805,11805,11804,11808,11809,11809,11808,11810,11811,11811,11810,11812,11813,11813,11812,11814,11815,11815,11814,11816,11817,11817,11816,11861,11862,11862,11861,11863,11864,11864,11863,11865,11866,11866,11865,11867,11868,11868,11867,12296,12297,12297,12296,12298,12299,12299,12298,12300,12301,12301,12300,12302,12303,12303,12302,12304,12305,12305,12304,12308,12309,12309,12308,12310,12311,12311,12310,12312,12313,12313,12312,12314,12315,12315,12314,65113,65114,65114,65113,65115,65116,65116,65115,65117,65118,65118,65117,65124,65125,65125,65124,65288,65289,65289,65288,65308,65310,65310,65308,65339,65341,65341,65339,65371,65373,65373,65371,65375,65376,65376,65375,65378,65379,65379,65378],Ga=[40,41,0,41,40,1,91,93,0,93,91,1,123,125,0,125,123,1,3898,3899,0,3899,3898,1,3900,3901,0,3901,3900,1,5787,5788,0,5788,5787,1,8261,8262,0,8262,8261,1,8317,8318,0,8318,8317,1,8333,8334,0,8334,8333,1,8968,8969,0,8969,8968,1,8970,8971,0,8971,8970,1,9001,9002,0,9002,9001,1,10088,10089,0,10089,10088,1,10090,10091,0,10091,10090,1,10092,10093,0,10093,10092,1,10094,10095,0,10095,10094,1,10096,10097,0,10097,10096,1,10098,10099,0,10099,10098,1,10100,10101,0,10101,10100,1,10181,10182,0,10182,10181,1,10214,10215,0,10215,10214,1,10216,10217,0,10217,10216,1,10218,10219,0,10219,10218,1,10220,10221,0,10221,10220,1,10222,10223,0,10223,10222,1,10627,10628,0,10628,10627,1,10629,10630,0,10630,10629,1,10631,10632,0,10632,10631,1,10633,10634,0,10634,10633,1,10635,10636,0,10636,10635,1,10637,10640,0,10638,10639,1,10639,10638,0,10640,10637,1,10641,10642,0,10642,10641,1,10643,10644,0,10644,10643,1,10645,10646,0,10646,10645,1,10647,10648,0,10648,10647,1,10712,10713,0,10713,10712,1,10714,10715,0,10715,10714,1,10748,10749,0,10749,10748,1,11810,11811,0,11811,11810,1,11812,11813,0,11813,11812,1,11814,11815,0,11815,11814,1,11816,11817,0,11817,11816,1,11861,11862,0,11862,11861,1,11863,11864,0,11864,11863,1,11865,11866,0,11866,11865,1,11867,11868,0,11868,11867,1,12296,12297,0,12297,12296,1,12298,12299,0,12299,12298,1,12300,12301,0,12301,12300,1,12302,12303,0,12303,12302,1,12304,12305,0,12305,12304,1,12308,12309,0,12309,12308,1,12310,12311,0,12311,12310,1,12312,12313,0,12313,12312,1,12314,12315,0,12315,12314,1,65113,65114,0,65114,65113,1,65115,65116,0,65116,65115,1,65117,65118,0,65118,65117,1,65288,65289,0,65289,65288,1,65339,65341,0,65341,65339,1,65371,65373,0,65373,65371,1,65375,65376,0,65376,65375,1,65378,65379,0,65379,65378,1];function Ka(e){let t=0,n=Ha.length-1;for(;t<n;){let r=t+n+1>>1;Ha[r]<=e?t=r:n=r-1}return Ua[t]}function qa(e){return Va[Ka(e)]}const Ja=(()=>{let e=new Map;for(let t=0;t<Wa.length;t+=2)e.set(Wa[t],Wa[t+1]);return e})();function Ya(e){return Ja.get(e)??null}const Xa=(()=>{let e=new Map;for(let t=0;t<Ga.length;t+=3)e.set(Ga[t],{pair:Ga[t+1],type:Ga[t+2]===0?`o`:`c`});return e})();function Za(e){return Xa.get(e)??null}const Qa=e=>e===`RLE`||e===`LRE`||e===`RLO`||e===`LRO`||e===`PDF`||e===`BN`,$a=e=>e===`LRI`||e===`RLI`||e===`FSI`,eo=e=>e===`B`||e===`S`||e===`WS`||e===`ON`||e===`FSI`||e===`LRI`||e===`RLI`||e===`PDI`,to=e=>e&1?e+2:e+1,no=e=>e&1?e+1:e+2;function ro(e,t,n){let r=0;for(let i=t;i<n;i++){let t=e[i];if($a(t))r++;else if(t===`PDI`)r>0&&r--;else if(r===0){if(t===`L`)return 0;if(t===`R`||t===`AL`)return 1}}return 0}function io(e){let t=e.length,n=new Int32Array(t).fill(t),r=new Int32Array(t).fill(-1),i=[];for(let a=0;a<t;a++){let t=e[a];if($a(t))i.push(a);else if(t===`PDI`&&i.length){let e=i.pop();n[e]=a,r[a]=e}}return{pdiOf:n,initOf:r}}function ao(e,t,n){let r=e.length,i=Array(r).fill(t),a=e.slice(),o=[{level:t,override:`neutral`,isolate:!1}],s=0,c=0,l=0,u=()=>o[o.length-1];for(let d=0;d<r;d++){let r=e[d];switch(r){case`RLE`:case`LRE`:case`RLO`:case`LRO`:{i[d]=u().level;let e=r===`RLE`||r===`RLO`?to(u().level):no(u().level);e<=125&&s===0&&c===0?o.push({level:e,override:r===`RLO`?`R`:r===`LRO`?`L`:`neutral`,isolate:!1}):s===0&&c++;break}case`RLI`:case`LRI`:case`FSI`:{i[d]=u().level;let t=u().override;t!==`neutral`&&(a[d]=t);let f;f=r===`RLI`?`R`:r===`LRI`?`L`:ro(e,d+1,n[d])===1?`R`:`L`;let p=f===`R`?to(u().level):no(u().level);p<=125&&s===0&&c===0?(l++,o.push({level:p,override:`neutral`,isolate:!0})):s++;break}case`PDI`:if(s>0)s--;else if(l>0){for(c=0;!u().isolate;)o.pop();o.pop(),l--}{i[d]=u().level;let e=u().override;e!==`neutral`&&(a[d]=e)}break;case`PDF`:i[d]=u().level,s>0||(c>0?c--:!u().isolate&&o.length>=2&&o.pop());break;case`B`:o.length=1,s=0,c=0,l=0,i[d]=t;break;case`BN`:i[d]=u().level;break;default:{i[d]=u().level;let e=u().override;e!==`neutral`&&(a[d]=e);break}}}return{levels:i,types:a}}function oo(e){return e===9001?12296:e===9002?12297:e}function so(e,t,n,r,i,a){let o=e.length,s=[];for(let e=0;e<o;e++)n[e]||s.push(e);let c=[];for(let e=0;e<s.length;e++){let n=s[e];e===0||t[n]!==t[s[e-1]]?c.push([n]):c[c.length-1].push(n)}let l=new Map;for(let e of c)l.set(e[0],e);let u=e=>e&1?`R`:`L`,d=[];for(let s of c){let c=s[0];if(e[c]===`PDI`&&a[c]!==-1)continue;let f=[],p=s;for(;;){for(let e of p)f.push(e);let t=p[p.length-1];if($a(e[t])&&i[t]!==o){let e=l.get(i[t]);if(e){p=e;continue}}break}let m=t[f[0]],h=r;for(let e=f[0]-1;e>=0;e--)if(!n[e]){h=t[e];break}let g=u(Math.max(m,h)),_=f[f.length-1],v=r;if(!($a(e[_])&&i[_]===o)){for(let e=_+1;e<o;e++)if(!n[e]){v=t[e];break}}let y=u(Math.max(m,v));d.push({indices:f,level:m,sos:g,eos:y})}return d}const co=e=>e===`L`?`L`:e===`R`||e===`EN`||e===`AN`?`R`:null;function lo(e,t,n,r,i){let a=e.indices,o=a.length,{sos:s,eos:c,level:l}=e;for(let e=0;e<o;e++){let t=a[e];if(r[t]===`NSM`)if(e===0)r[t]=s;else{let n=r[a[e-1]];r[t]=n===`LRI`||n===`RLI`||n===`FSI`||n===`PDI`?`ON`:n}}{let e=s;for(let t=0;t<o;t++){let n=r[a[t]];n===`R`||n===`L`||n===`AL`?e=n:n===`EN`&&e===`AL`&&(r[a[t]]=`AN`)}}for(let e=0;e<o;e++)r[a[e]]===`AL`&&(r[a[e]]=`R`);for(let e=1;e<o-1;e++){let t=r[a[e]],n=r[a[e-1]],i=r[a[e+1]];t===`ES`&&n===`EN`&&i===`EN`||t===`CS`&&n===`EN`&&i===`EN`?r[a[e]]=`EN`:t===`CS`&&n===`AN`&&i===`AN`&&(r[a[e]]=`AN`)}for(let e=0;e<o;e++){if(r[a[e]]!==`ET`)continue;let t=e;for(;t<o&&r[a[t]]===`ET`;)t++;let n=e>0?r[a[e-1]]:s,i=t<o?r[a[t]]:c;if(n===`EN`||i===`EN`)for(let n=e;n<t;n++)r[a[n]]=`EN`;e=t-1}for(let e=0;e<o;e++){let t=r[a[e]];(t===`ES`||t===`ET`||t===`CS`)&&(r[a[e]]=`ON`)}{let e=s;for(let t=0;t<o;t++){let n=r[a[t]];n===`R`||n===`L`?e=n:n===`EN`&&e===`L`&&(r[a[t]]=`L`)}}let u=l&1?`R`:`L`,d=u===`R`?`L`:`R`,f=[];{let e=[];outer:for(let n=0;n<o;n++){let i=a[n];if(r[i]!==`ON`)continue;let o=Za(t[i]);if(o)if(o.type===`o`){if(e.length===63)break outer;e.push({expect:oo(o.pair),pos:n})}else{let r=oo(t[i]);for(let t=e.length-1;t>=0;t--)if(e[t].expect===r){f.push({open:e[t].pos,close:n}),e.length=t;break}}}f.sort((e,t)=>e.open-t.open)}let p=(e,t)=>{for(let i=e+1;i<o&&n[a[i]]===`NSM`;i++)r[a[i]]=t};for(let{open:e,close:t}of f){let n=!1,i=!1;for(let o=e+1;o<t;o++){let e=co(r[a[o]]);e===u?n=!0:e===d&&(i=!0)}let o=null;if(n)o=u;else if(i){let t=s;for(let n=e-1;n>=0;n--){let e=co(r[a[n]]);if(e){t=e;break}}o=t===d?d:u}o&&(r[a[e]]=o,r[a[t]]=o,p(e,o),p(t,o))}for(let e=0;e<o;e++){if(!eo(r[a[e]]))continue;let t=e;for(;t<o&&eo(r[a[t]]);)t++;let n=e>0?co(r[a[e-1]]):s,i=t<o?co(r[a[t]]):c;if(n&&i&&n===i)for(let i=e;i<t;i++)r[a[i]]=n;e=t-1}for(let e=0;e<o;e++)eo(r[a[e]])&&(r[a[e]]=u);for(let e=0;e<o;e++){let t=a[e],n=r[t];l&1?(n===`L`||n===`EN`||n===`AN`)&&(i[t]+=1):n===`R`?i[t]+=1:(n===`AN`||n===`EN`)&&(i[t]+=2)}}function uo(e,t,n){let r=e.length,i=Array(r);for(let t=0;t<r;t++)i[t]=n?.[t]??qa(e[t]);let a=t===`rtl`?1:t===`ltr`?0:ro(i,0,r),{pdiOf:o,initOf:s}=io(i),{levels:c,types:l}=ao(i,a,o),u=Array(r);for(let e=0;e<r;e++)u[e]=Qa(i[e]);let d=so(i,c,u,a,o,s),f=l.slice();for(let t of d)lo(t,e,i,f,c);let p=e=>{let t=i[e];return t===`WS`||$a(t)||t===`PDI`||u[e]};for(let e=0;e<r;e++){let t=i[e];if(t===`B`||t===`S`){c[e]=a;for(let t=e-1;t>=0&&p(t);t--)u[t]||(c[t]=a)}}for(let e=r-1;e>=0&&p(e);e--)u[e]||(c[e]=a);for(let e=0;e<r;e++)u[e]&&(c[e]=-1);return{levels:c,paragraphLevel:a}}function fo(e,t,n){let r=[];for(let i=t;i<n;i++){let t=e[i];t>=0&&t<=126&&r.push(i)}if(r.length===0)return r;let i=0,a=127;for(let t of r){let n=e[t];n>i&&(i=n),n&1&&n<a&&(a=n)}for(let t=i;t>=a;t--){let n=0;for(;n<r.length;)if(e[r[n]]>=t){let i=n+1;for(;i<r.length&&e[r[i]]>=t;)i++;for(let e=n,t=i-1;e<t;e++,t--){let n=r[e];r[e]=r[t],r[t]=n}n=i}else n++}return r}function po(e){let t=[],n=[],r=[];for(let i=0;i<e.length;){let a=e.codePointAt(i),o=a>65535?2:1;t.push(a),n.push(o),r.push(i),i+=o}return{cps:t,units:n,starts:r}}var mo=class{computeLevels(e,t,n){let{cps:r,units:i,starts:a}=po(e),{levels:o,paragraphLevel:s}=uo(r,t,n?r.map((e,t)=>n[a[t]]??null):void 0),c=new Uint8Array(e.length),l=0;for(let e=0;e<o.length;e++){let t=o[e]===-1?255:o[e];for(let n=0;n<i[e];n++)c[l++]=t}return{levels:c,paragraphLevel:s}}reorderVisual(e,t,n){return fo(e,t,n)}getMirror(e){return Ya(e)}};function ho(){return new mo}let go=null;function _o(){return go===null&&(go=ho()),go}const vo=/[\\u0590-\\u08FF\\uFB1D-\\uFDFF\\uFE70-\\uFEFF\\u200F\\u202B\\u202E\\u2067]|[\\u{10800}-\\u{10FFF}\\u{1E800}-\\u{1EFFF}]/u;function yo(e){return vo.test(e)}function bo(e,t,n){let r=n.length,i=new Uint8Array(r);for(let a=0;a<r;a++){let r=e[n[a]];i[a]=r===255?t:r}return{order:_o().reorderVisual(i,0,r),segLevels:i}}function xo(e){let t=new Set;for(let n of e)t.add(n.codePointAt(0));return t}function So(e){return{enabled:e?.kinsoku!==!1,lineStartForbidden:xo(e?.noLineBreaksBefore??`”’)〕]}〉》」』】〙〗〟⦆»、。,.・:;/?!‐ー゠–〜~ぁぃぅぇぉっゃゅょゎゕゖァィゥェォッャュョヮヵヶㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ゝゞヽヾ゛゜%‰℃°′″。」、・ー゙゚!),.:;?]}⦆`),lineEndForbidden:xo(e?.noLineBreaksAfter??`“‘(〔[{〈《「『【〘〖〝⦅«$¥#£¢([{⦅`)}}const Co=So();function wo(e,t,n,r=1){if(!n.enabled||t<=0||t>=e.length)return t;let i=t=>t<e.length&&n.lineStartForbidden.has(e[t].codePointAt(0)),a=t=>t>=0&&n.lineEndForbidden.has(e[t].codePointAt(0)),o=t;for(;o>r&&(i(o)||a(o-1));)o--;return o<=r&&(i(o)||a(o-1))?t:o}function To(e,t,n){if(!t.enabled)return 0;let r=e.length-n;for(let n=1;n<=r;n++){let r=e[e.length-n];if(/\\s/.test(r)||t.lineStartForbidden.has(r.codePointAt(0)))continue;let i=e[e.length-n-1];if(!(i&&t.lineEndForbidden.has(i.codePointAt(0))))return n}return 0}function Eo(e){return e>=12288&&e<=40959||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65280&&e<=65519}const Do=`BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB.CL.CP.EB.EM.EX.H2.H3.HL.HH.HY.ID.IN.IS.JL.JT.JV.NS.NU.OP.PO.PR.QU.RI.SY.VF.VI`.split(`.`),Oo=[0,9,10,11,13,14,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,58,60,63,64,91,92,93,94,123,124,125,126,127,133,134,160,161,162,163,166,171,172,173,174,176,177,178,180,181,187,188,191,192,712,713,716,717,735,736,768,860,867,880,894,895,1155,1162,1417,1418,1419,1423,1424,1425,1470,1471,1472,1473,1475,1476,1478,1479,1480,1488,1515,1519,1523,1536,1542,1545,1548,1550,1552,1563,1564,1565,1568,1611,1632,1642,1643,1645,1648,1649,1748,1749,1750,1757,1758,1759,1765,1767,1769,1770,1774,1776,1786,1809,1810,1840,1867,1958,1969,1984,1994,2027,2036,2040,2041,2042,2045,2046,2048,2070,2074,2075,2084,2085,2088,2089,2094,2137,2140,2192,2194,2199,2208,2250,2274,2275,2308,2362,2365,2366,2384,2385,2392,2402,2404,2406,2416,2433,2436,2492,2493,2494,2501,2503,2505,2507,2510,2519,2520,2530,2532,2534,2544,2546,2548,2553,2554,2555,2556,2558,2559,2561,2564,2620,2621,2622,2627,2631,2633,2635,2638,2641,2642,2662,2672,2674,2677,2678,2689,2692,2748,2749,2750,2758,2759,2762,2763,2766,2786,2788,2790,2800,2801,2802,2810,2816,2817,2820,2876,2877,2878,2885,2887,2889,2891,2894,2901,2904,2914,2916,2918,2928,2946,2947,3006,3011,3014,3017,3018,3022,3031,3032,3046,3056,3065,3066,3072,3077,3132,3133,3134,3141,3142,3145,3146,3150,3157,3159,3170,3172,3174,3184,3191,3192,3201,3204,3205,3260,3261,3262,3269,3270,3273,3274,3278,3285,3287,3298,3300,3302,3312,3315,3316,3328,3332,3387,3389,3390,3397,3398,3401,3402,3406,3415,3416,3426,3428,3430,3440,3449,3450,3457,3460,3530,3531,3535,3541,3542,3543,3544,3552,3558,3568,3570,3572,3633,3634,3636,3643,3647,3648,3655,3663,3664,3674,3676,3761,3762,3764,3773,3784,3791,3792,3802,3841,3845,3846,3848,3849,3851,3852,3853,3858,3859,3860,3861,3864,3866,3872,3882,3892,3893,3894,3895,3896,3897,3898,3899,3900,3901,3902,3904,3953,3967,3968,3973,3974,3976,3981,3992,3993,4029,4030,4032,4038,4039,4048,4050,4051,4052,4057,4059,4139,4159,4160,4170,4172,4182,4186,4190,4193,4194,4197,4199,4206,4209,4213,4226,4238,4239,4240,4250,4254,4352,4448,4520,4608,4957,4960,4961,4962,5120,5121,5760,5761,5787,5788,5789,5867,5870,5906,5910,5938,5941,5943,5970,5972,6002,6004,6068,6100,6102,6103,6104,6105,6106,6107,6108,6109,6110,6112,6122,6146,6148,6150,6151,6152,6154,6155,6158,6159,6160,6170,6277,6279,6313,6314,6432,6444,6448,6460,6468,6470,6480,6608,6619,6679,6684,6741,6751,6752,6781,6783,6784,6794,6800,6810,6832,6878,6880,6891,6892,6912,6917,6964,6980,6981,6989,6990,6992,7002,7004,7005,7009,7019,7028,7037,7040,7043,7073,7086,7088,7098,7104,7142,7154,7156,7204,7224,7227,7232,7242,7248,7258,7294,7296,7376,7379,7380,7401,7405,7406,7412,7413,7415,7418,7616,7629,7630,7676,7677,7680,8189,8190,8192,8199,8200,8203,8204,8205,8206,8208,8209,8210,8212,8213,8216,8218,8219,8222,8223,8224,8228,8231,8232,8234,8239,8240,8248,8249,8251,8252,8254,8260,8261,8262,8263,8266,8278,8279,8280,8284,8285,8288,8289,8294,8304,8317,8318,8319,8333,8334,8335,8352,8359,8360,8374,8375,8379,8380,8382,8383,8384,8385,8400,8433,8451,8452,8457,8458,8470,8471,8722,8724,8943,8944,8968,8969,8970,8971,8972,8986,8988,9001,9002,9003,9200,9204,9728,9732,9748,9750,9752,9753,9754,9757,9758,9760,9785,9788,9832,9833,9855,9856,9917,9929,9933,9934,9935,9938,9939,9941,9944,9946,9948,9949,9951,9954,9962,9963,9969,9974,9975,9977,9978,9979,9981,9989,9992,9994,9998,10075,10081,10082,10084,10085,10088,10089,10090,10091,10092,10093,10094,10095,10096,10097,10098,10099,10100,10101,10102,10181,10182,10183,10214,10215,10216,10217,10218,10219,10220,10221,10222,10223,10224,10240,10241,10627,10628,10629,10630,10631,10632,10633,10634,10635,10636,10637,10638,10639,10640,10641,10642,10643,10644,10645,10646,10647,10648,10649,10712,10713,10714,10715,10716,10748,10749,10750,11503,11506,11513,11514,11517,11518,11519,11520,11632,11633,11647,11648,11744,11776,11790,11798,11799,11800,11801,11802,11804,11806,11808,11810,11811,11812,11813,11814,11815,11816,11817,11818,11822,11823,11824,11826,11827,11829,11834,11836,11839,11840,11841,11842,11843,11851,11852,11853,11854,11856,11859,11861,11862,11863,11864,11865,11866,11867,11868,11869,11870,11904,11930,11931,12020,12032,12246,12272,12288,12289,12291,12293,12294,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,12306,12308,12309,12310,12311,12312,12313,12314,12315,12316,12317,12318,12320,12330,12336,12341,12342,12347,12349,12352,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12387,12388,12419,12420,12421,12422,12423,12424,12430,12431,12437,12439,12441,12443,12447,12448,12450,12451,12452,12453,12454,12455,12456,12457,12458,12483,12484,12515,12516,12517,12518,12519,12520,12526,12527,12533,12535,12539,12543,12544,12549,12592,12593,12687,12688,12774,12783,12784,12800,12831,12832,12872,12880,19904,19968,40981,40982,42125,42128,42183,42238,42240,42509,42510,42511,42512,42528,42538,42607,42611,42612,42622,42654,42656,42736,42738,42739,42744,43010,43011,43014,43015,43019,43020,43043,43048,43052,43053,43064,43065,43124,43126,43128,43136,43138,43188,43206,43214,43216,43226,43232,43250,43260,43261,43263,43264,43274,43302,43310,43312,43335,43348,43360,43389,43392,43396,43443,43456,43457,43463,43466,43470,43471,43472,43482,43486,43488,43493,43494,43504,43514,43520,43561,43575,43584,43587,43588,43596,43598,43600,43610,43612,43613,43616,43643,43646,43696,43697,43698,43701,43703,43705,43710,43712,43713,43714,43755,43760,43762,43765,43767,44003,44011,44012,44014,44016,44026,44032,44033,44060,44061,44088,44089,44116,44117,44144,44145,44172,44173,44200,44201,44228,44229,44256,44257,44284,44285,44312,44313,44340,44341,44368,44369,44396,44397,44424,44425,44452,44453,44480,44481,44508,44509,44536,44537,44564,44565,44592,44593,44620,44621,44648,44649,44676,44677,44704,44705,44732,44733,44760,44761,44788,44789,44816,44817,44844,44845,44872,44873,44900,44901,44928,44929,44956,44957,44984,44985,45012,45013,45040,45041,45068,45069,45096,45097,45124,45125,45152,45153,45180,45181,45208,45209,45236,45237,45264,45265,45292,45293,45320,45321,45348,45349,45376,45377,45404,45405,45432,45433,45460,45461,45488,45489,45516,45517,45544,45545,45572,45573,45600,45601,45628,45629,45656,45657,45684,45685,45712,45713,45740,45741,45768,45769,45796,45797,45824,45825,45852,45853,45880,45881,45908,45909,45936,45937,45964,45965,45992,45993,46020,46021,46048,46049,46076,46077,46104,46105,46132,46133,46160,46161,46188,46189,46216,46217,46244,46245,46272,46273,46300,46301,46328,46329,46356,46357,46384,46385,46412,46413,46440,46441,46468,46469,46496,46497,46524,46525,46552,46553,46580,46581,46608,46609,46636,46637,46664,46665,46692,46693,46720,46721,46748,46749,46776,46777,46804,46805,46832,46833,46860,46861,46888,46889,46916,46917,46944,46945,46972,46973,47e3,47001,47028,47029,47056,47057,47084,47085,47112,47113,47140,47141,47168,47169,47196,47197,47224,47225,47252,47253,47280,47281,47308,47309,47336,47337,47364,47365,47392,47393,47420,47421,47448,47449,47476,47477,47504,47505,47532,47533,47560,47561,47588,47589,47616,47617,47644,47645,47672,47673,47700,47701,47728,47729,47756,47757,47784,47785,47812,47813,47840,47841,47868,47869,47896,47897,47924,47925,47952,47953,47980,47981,48008,48009,48036,48037,48064,48065,48092,48093,48120,48121,48148,48149,48176,48177,48204,48205,48232,48233,48260,48261,48288,48289,48316,48317,48344,48345,48372,48373,48400,48401,48428,48429,48456,48457,48484,48485,48512,48513,48540,48541,48568,48569,48596,48597,48624,48625,48652,48653,48680,48681,48708,48709,48736,48737,48764,48765,48792,48793,48820,48821,48848,48849,48876,48877,48904,48905,48932,48933,48960,48961,48988,48989,49016,49017,49044,49045,49072,49073,49100,49101,49128,49129,49156,49157,49184,49185,49212,49213,49240,49241,49268,49269,49296,49297,49324,49325,49352,49353,49380,49381,49408,49409,49436,49437,49464,49465,49492,49493,49520,49521,49548,49549,49576,49577,49604,49605,49632,49633,49660,49661,49688,49689,49716,49717,49744,49745,49772,49773,49800,49801,49828,49829,49856,49857,49884,49885,49912,49913,49940,49941,49968,49969,49996,49997,50024,50025,50052,50053,50080,50081,50108,50109,50136,50137,50164,50165,50192,50193,50220,50221,50248,50249,50276,50277,50304,50305,50332,50333,50360,50361,50388,50389,50416,50417,50444,50445,50472,50473,50500,50501,50528,50529,50556,50557,50584,50585,50612,50613,50640,50641,50668,50669,50696,50697,50724,50725,50752,50753,50780,50781,50808,50809,50836,50837,50864,50865,50892,50893,50920,50921,50948,50949,50976,50977,51004,51005,51032,51033,51060,51061,51088,51089,51116,51117,51144,51145,51172,51173,51200,51201,51228,51229,51256,51257,51284,51285,51312,51313,51340,51341,51368,51369,51396,51397,51424,51425,51452,51453,51480,51481,51508,51509,51536,51537,51564,51565,51592,51593,51620,51621,51648,51649,51676,51677,51704,51705,51732,51733,51760,51761,51788,51789,51816,51817,51844,51845,51872,51873,51900,51901,51928,51929,51956,51957,51984,51985,52012,52013,52040,52041,52068,52069,52096,52097,52124,52125,52152,52153,52180,52181,52208,52209,52236,52237,52264,52265,52292,52293,52320,52321,52348,52349,52376,52377,52404,52405,52432,52433,52460,52461,52488,52489,52516,52517,52544,52545,52572,52573,52600,52601,52628,52629,52656,52657,52684,52685,52712,52713,52740,52741,52768,52769,52796,52797,52824,52825,52852,52853,52880,52881,52908,52909,52936,52937,52964,52965,52992,52993,53020,53021,53048,53049,53076,53077,53104,53105,53132,53133,53160,53161,53188,53189,53216,53217,53244,53245,53272,53273,53300,53301,53328,53329,53356,53357,53384,53385,53412,53413,53440,53441,53468,53469,53496,53497,53524,53525,53552,53553,53580,53581,53608,53609,53636,53637,53664,53665,53692,53693,53720,53721,53748,53749,53776,53777,53804,53805,53832,53833,53860,53861,53888,53889,53916,53917,53944,53945,53972,53973,54e3,54001,54028,54029,54056,54057,54084,54085,54112,54113,54140,54141,54168,54169,54196,54197,54224,54225,54252,54253,54280,54281,54308,54309,54336,54337,54364,54365,54392,54393,54420,54421,54448,54449,54476,54477,54504,54505,54532,54533,54560,54561,54588,54589,54616,54617,54644,54645,54672,54673,54700,54701,54728,54729,54756,54757,54784,54785,54812,54813,54840,54841,54868,54869,54896,54897,54924,54925,54952,54953,54980,54981,55008,55009,55036,55037,55064,55065,55092,55093,55120,55121,55148,55149,55176,55177,55204,55216,55239,55243,55292,63744,64256,64285,64286,64287,64297,64298,64311,64312,64317,64318,64319,64320,64322,64323,64325,64326,64336,64830,64831,64832,65020,65021,65024,65040,65043,65045,65047,65048,65049,65050,65056,65057,65058,65059,65060,65061,65062,65064,65065,65066,65067,65068,65069,65071,65072,65077,65078,65079,65080,65081,65082,65083,65084,65085,65086,65087,65088,65089,65090,65091,65092,65093,65095,65096,65097,65104,65105,65106,65107,65108,65110,65112,65113,65114,65115,65116,65117,65118,65119,65127,65128,65129,65130,65131,65132,65279,65280,65281,65282,65284,65285,65286,65288,65289,65290,65292,65293,65294,65295,65306,65308,65311,65312,65339,65340,65341,65342,65371,65372,65373,65374,65375,65376,65378,65379,65381,65382,65383,65393,65438,65440,65471,65474,65480,65482,65488,65490,65496,65498,65501,65504,65505,65506,65509,65511,65529,65532,65533,65792,65795,66045,66046,66272,66273,66422,66427,66463,66464,66512,66513,66720,66730,67671,67672,67871,67872,68097,68100,68101,68103,68108,68112,68152,68155,68159,68160,68176,68184,68325,68327,68336,68342,68343,68409,68416,68900,68904,68912,68922,68928,68938,68969,68974,68975,69291,69293,69294,69328,69329,69370,69376,69446,69457,69506,69510,69632,69635,69637,69688,69702,69703,69705,69710,69714,69734,69744,69745,69747,69749,69750,69759,69760,69763,69808,69819,69821,69822,69826,69827,69837,69838,69872,69882,69888,69891,69927,69941,69942,69952,69956,69957,69959,70003,70004,70005,70006,70016,70019,70067,70081,70085,70087,70088,70089,70093,70094,70096,70106,70107,70108,70109,70112,70188,70200,70202,70203,70205,70206,70207,70209,70210,70313,70314,70367,70379,70384,70394,70400,70404,70405,70413,70415,70417,70419,70441,70442,70449,70450,70452,70453,70458,70459,70461,70462,70469,70471,70473,70475,70477,70478,70480,70481,70487,70488,70493,70494,70496,70498,70500,70502,70509,70512,70517,70528,70538,70539,70540,70542,70543,70544,70546,70582,70583,70584,70593,70594,70595,70597,70598,70599,70603,70604,70608,70609,70610,70611,70614,70615,70617,70625,70627,70709,70727,70731,70735,70736,70746,70748,70750,70751,70832,70852,70864,70874,71087,71094,71096,71105,71106,71108,71110,71113,71128,71132,71134,71216,71233,71235,71248,71258,71264,71277,71339,71352,71360,71370,71376,71396,71453,71468,71472,71482,71484,71487,71724,71739,71904,71914,71936,71943,71945,71946,71948,71956,71957,71959,71960,71984,71990,71991,71993,71995,71998,71999,72e3,72001,72002,72004,72007,72016,72026,72145,72152,72154,72161,72162,72163,72164,72165,72193,72203,72243,72250,72251,72255,72256,72257,72261,72262,72263,72264,72273,72284,72330,72346,72349,72350,72353,72355,72448,72458,72544,72552,72688,72698,72751,72759,72760,72768,72769,72774,72784,72794,72816,72817,72818,72850,72872,72873,72887,73009,73015,73018,73019,73020,73022,73023,73030,73031,73032,73040,73050,73098,73103,73104,73106,73107,73112,73120,73130,73184,73194,73440,73458,73459,73463,73465,73472,73474,73475,73476,73489,73490,73524,73531,73534,73538,73539,73541,73552,73562,73563,73693,73697,73727,73728,74864,74869,78424,78427,78430,78466,78467,78470,78471,78472,78473,78474,78713,78714,78716,78895,78896,78903,78904,78905,78908,78909,78910,78911,78912,78913,78919,78934,83406,83407,83408,90368,90398,90416,90426,92768,92778,92782,92784,92864,92874,92912,92917,92918,92976,92983,92986,92996,92997,93008,93018,93550,93552,93562,93847,93849,94031,94032,94033,94088,94095,94099,94176,94180,94181,94192,94194,94196,94199,94208,101120,101632,101663,101760,101875,110592,110883,110898,110899,110928,110931,110933,110934,110948,110952,110960,111356,113821,113823,113824,113828,118e3,118010,118528,118574,118576,118599,119141,119146,119149,119171,119173,119180,119210,119214,119362,119365,120782,120832,121344,121399,121403,121453,121461,121462,121476,121477,121479,121483,121499,121504,121505,121520,122880,122887,122888,122905,122907,122914,122915,122917,122918,122923,123023,123024,123184,123191,123200,123210,123566,123567,123628,123632,123642,123647,123648,124140,124144,124154,124398,124400,124401,124411,124643,124644,124646,124647,124654,124656,124661,124662,125136,125143,125252,125259,125264,125274,125278,125280,126124,126125,126128,126129,126976,127232,127406,127462,127488,127877,127878,127900,127902,127925,127927,127932,127933,127938,127941,127943,127944,127946,127949,127995,128e3,128066,128068,128070,128081,128102,128121,128124,128125,128129,128132,128133,128136,128143,128144,128145,128146,128160,128161,128162,128163,128164,128165,128170,128171,128175,128176,128177,128179,128256,128263,128279,128293,128306,128330,128372,128374,128378,128379,128400,128401,128405,128407,128468,128476,128500,128506,128581,128584,128587,128592,128630,128633,128636,128640,128675,128676,128692,128695,128704,128705,128716,128717,128768,128884,128887,128891,128896,128981,129024,129292,129293,129295,129296,129304,129312,129318,129319,129328,129338,129340,129343,129399,129400,129461,129463,129464,129466,129467,129468,129485,129488,129489,129502,129536,129624,129731,129734,129776,129785,129792,130032,130042,130048,131070,131072,196606,196608,262142,917505,917506,917536,917632,917760,918e3],ko=[1,15,4,0,2,1,6,22,39,11,38,37,11,39,36,19,11,38,30,27,30,41,35,30,11,22,11,36,38,19,11,36,15,18,11,1,5,1,3,36,37,38,11,39,11,15,11,37,38,11,16,11,39,11,36,11,16,11,16,11,16,11,1,3,1,11,30,11,1,11,30,26,11,38,11,1,26,1,11,1,11,1,22,1,11,25,11,25,11,35,11,37,30,11,1,22,1,22,11,1,35,37,35,11,1,11,22,11,1,35,11,1,11,1,11,1,11,35,11,1,11,1,11,1,11,35,11,1,11,30,22,11,1,38,11,1,11,1,11,1,11,1,11,1,11,35,11,1,11,1,35,1,11,1,11,1,11,1,11,1,15,35,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,37,11,37,11,38,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,38,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,1,11,1,11,1,11,1,11,1,11,35,11,38,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,16,11,1,16,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,37,11,1,11,1,11,1,11,1,11,1,11,35,11,1,11,1,11,1,11,38,11,1,11,35,15,11,1,11,1,11,1,11,35,11,16,11,16,3,16,15,3,22,3,11,22,11,1,11,35,11,15,1,11,1,11,1,36,18,36,18,1,11,1,15,1,15,1,11,1,11,1,11,15,11,1,11,16,15,16,11,3,11,1,11,35,15,11,1,11,1,11,1,11,1,11,1,11,1,11,1,35,1,11,31,33,32,11,1,11,15,11,26,11,15,11,36,18,11,15,11,1,11,1,15,11,1,11,1,11,1,15,34,11,15,11,15,38,11,1,11,35,11,22,15,16,11,22,11,1,3,1,35,11,1,11,1,11,1,11,1,11,22,35,11,35,11,1,11,1,11,1,11,1,35,11,35,11,1,11,1,3,11,1,10,1,43,10,11,15,13,15,28,15,28,1,28,15,1,11,1,11,35,11,13,1,42,11,1,11,15,35,11,35,11,15,11,1,11,1,11,1,11,1,11,1,11,1,3,1,3,1,11,16,11,15,3,15,8,1,9,1,26,3,26,14,11,39,36,39,36,39,11,29,15,0,1,3,37,11,39,11,34,11,30,36,18,34,11,15,37,15,11,15,7,11,1,11,36,18,11,36,18,11,38,37,38,37,38,37,38,37,38,37,38,1,11,37,11,37,11,38,11,38,11,29,11,36,18,36,18,11,28,11,36,18,11,28,11,28,11,28,11,28,11,28,20,28,11,28,11,28,11,28,11,28,11,28,11,28,11,28,11,28,11,28,11,28,11,28,11,28,11,28,20,28,11,28,11,28,20,11,39,11,22,28,11,36,18,36,18,36,18,36,18,36,18,36,18,36,18,11,36,18,11,36,18,36,18,36,18,36,18,36,18,11,15,11,36,18,36,18,36,18,36,18,36,18,36,18,36,18,36,18,36,18,36,18,36,18,11,36,18,36,18,11,36,18,11,1,11,22,15,11,22,15,11,15,11,1,11,1,39,15,11,26,36,15,11,39,11,39,36,18,36,18,36,18,36,18,15,22,11,15,11,15,11,14,15,11,26,15,36,15,11,15,11,15,11,22,36,19,36,19,36,19,36,19,26,11,28,11,28,11,28,11,28,15,18,28,34,28,36,18,36,18,36,18,36,18,36,18,28,36,18,36,18,36,18,36,18,34,36,18,28,1,28,1,28,34,28,11,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,11,1,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,11,28,11,28,11,28,11,28,34,28,11,28,11,28,11,28,34,28,11,28,11,15,11,15,22,15,11,35,11,1,11,1,11,1,11,1,11,15,11,1,11,1,11,1,11,1,11,1,11,37,11,16,22,11,1,11,1,11,15,35,11,1,11,16,11,1,35,11,1,15,11,1,11,31,11,1,10,1,43,28,15,28,11,15,13,11,28,11,1,11,35,11,13,1,11,15,1,15,1,11,13,11,28,15,11,1,11,1,11,1,11,1,11,1,11,1,11,1,15,11,1,11,1,15,1,11,35,11,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,11,33,11,32,11,28,11,25,1,25,11,25,11,25,11,25,11,25,11,25,11,25,11,18,36,11,37,11,1,18,34,22,36,18,29,11,3,1,3,1,3,1,3,1,3,1,3,1,3,1,28,36,18,36,18,36,18,36,18,36,18,36,18,36,18,36,18,28,36,18,28,18,28,18,11,34,22,28,36,18,36,18,36,18,28,11,28,38,37,28,11,7,11,22,28,38,37,28,36,18,28,18,28,18,28,34,28,22,28,36,28,18,28,36,28,18,28,36,18,36,18,34,28,34,28,34,28,11,28,11,28,11,28,11,28,11,37,38,28,38,11,1,17,11,15,11,1,11,1,11,1,11,15,11,15,11,35,11,15,11,15,11,1,11,1,11,1,11,1,11,1,11,15,11,1,11,15,29,11,15,11,1,11,35,11,35,11,1,26,11,1,26,11,15,11,1,11,1,11,1,11,1,12,10,1,43,15,28,11,28,13,1,10,1,10,11,3,1,11,1,11,35,15,1,11,35,11,35,11,1,11,1,11,35,15,11,1,11,1,11,16,11,1,11,1,11,15,11,15,1,11,1,35,11,16,11,15,11,1,15,11,15,11,1,11,1,11,15,11,1,11,35,11,1,11,10,11,10,11,10,11,10,11,10,11,10,11,1,15,1,11,1,11,1,43,11,13,11,1,11,15,13,10,1,11,1,11,1,11,13,11,13,11,13,11,13,10,11,28,1,11,1,11,1,11,1,11,1,43,12,1,28,11,28,11,1,11,1,11,15,11,35,15,11,1,11,1,11,35,11,1,11,1,16,15,22,11,15,11,1,11,1,15,11,35,11,16,11,1,11,35,11,35,11,1,11,35,11,15,11,1,11,35,11,10,11,10,11,10,11,10,11,10,1,11,1,11,1,43,12,1,12,1,15,11,13,11,1,11,1,11,16,11,1,11,1,11,1,11,1,16,11,15,16,11,1,11,1,11,1,15,11,16,15,11,16,11,1,11,35,11,1,11,1,11,15,11,35,11,16,22,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,1,11,1,11,1,11,35,11,35,11,13,15,1,15,11,1,12,1,10,11,10,1,11,1,43,15,28,13,1,11,37,11,15,11,15,11,36,18,11,18,11,36,18,36,18,11,36,18,11,36,3,36,18,3,36,18,36,18,1,11,1,11,36,18,11,13,1,13,11,35,11,15,11,35,11,1,15,11,1,15,11,15,11,35,11,15,35,11,15,11,1,11,1,11,1,11,34,3,11,1,34,28,11,28,11,28,11,28,11,28,11,34,11,34,11,34,11,34,11,28,11,1,15,1,11,35,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,1,11,1,11,1,11,1,11,15,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,1,11,1,35,11,38,11,1,35,11,1,11,35,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,36,11,37,11,37,11,28,11,28,40,28,20,28,11,28,11,28,11,28,20,28,20,28,20,28,21,28,20,28,20,28,20,28,20,28,20,28,20,28,20,28,20,28,11,28,11,28,11,28,20,28,11,28,11,28,11,28,11,28,11,28,20,28,20,28,20,28,20,28,11,28,11,28,20,28,20,11,39,34,11,28,20,28,20,28,20,28,20,28,11,28,11,28,11,28,11,20,28,20,28,20,28,20,28,20,28,20,28,20,28,20,28,20,28,20,28,20,28,20,28,11,28,20,28,20,28,11,35,11,28,11,28,11,28,11,1,11,1,11,1,11],Ao=[4352,8361,8986,9001,9193,9200,9203,9725,9748,9776,9800,9855,9866,9875,9889,9898,9917,9924,9934,9940,9962,9970,9973,9978,9981,9989,9994,10024,10060,10062,10067,10071,10133,10160,10175,11035,11088,11093,11904,11931,12032,12272,12353,12441,12549,12593,12688,12783,12832,12880,42128,43360,44032,63744,65040,65072,65108,65128,65281,65474,65482,65490,65498,65504,65512,94176,94192,94208,101631,101760,110576,110581,110589,110592,110898,110928,110933,110948,110960,119552,119648,126980,127183,127374,127377,127488,127504,127552,127568,127584,127744,127789,127799,127870,127904,127951,127968,127988,127992,128064,128066,128255,128331,128336,128378,128405,128420,128507,128640,128716,128720,128725,128732,128747,128756,128992,129008,129292,129340,129351,129648,129664,129678,129736,129741,129759,129775,131072,196608],jo=[4448,8362,8988,9003,9197,9201,9204,9727,9750,9784,9812,9856,9872,9876,9890,9900,9919,9926,9935,9941,9963,9972,9974,9979,9982,9990,9996,10025,10061,10063,10070,10072,10136,10161,10176,11037,11089,11094,11930,12020,12246,12351,12439,12544,12592,12687,12774,12831,12872,42125,42183,43389,55204,64256,65050,65107,65127,65132,65471,65480,65488,65496,65501,65511,65519,94181,94199,101590,101663,101875,110580,110588,110591,110883,110899,110931,110934,110952,111356,119639,119671,126981,127184,127375,127387,127491,127548,127561,127570,127590,127777,127798,127869,127892,127947,127956,127985,127989,128063,128065,128253,128318,128335,128360,128379,128407,128421,128592,128710,128717,128723,128729,128736,128749,128765,129004,129009,129339,129350,129536,129661,129675,129735,129737,129757,129771,129785,196606,262142];function Mo(e){let t=0,n=Oo.length-1;for(;t<n;){let r=t+n+1>>1;Oo[r]<=e?t=r:n=r-1}return Do[ko[t]]}function No(e){let t=0,n=Ao.length-1;if(n<0||e<Ao[0])return!1;for(;t<n;){let r=t+n+1>>1;Ao[r]<=e?t=r:n=r-1}return e<jo[t]}function Po(e,t){let n=Mo(e);if(n===`OP`)return!0;let r=Mo(t),i=n===`AL`||n===`HL`,a=r===`AL`||r===`HL`;return!!(i&&(a||r===`NU`||r===`PR`||r===`PO`)||a&&(n===`NU`||n===`PR`||n===`PO`)||n===`PR`&&(r===`ID`||r===`EB`||r===`EM`)||(n===`ID`||n===`EB`||n===`EM`)&&r===`PO`||n===`NU`&&(r===`NU`||r===`PO`||r===`PR`)||r===`NU`&&(n===`PO`||n===`PR`||n===`HY`||n===`IS`)||(i||n===`NU`)&&r===`OP`&&!No(t)||n===`CP`&&!No(e)&&(a||r===`NU`))}function Fo(e){return e===`my`||e===`bo`}function Io(e){return e>=3584&&e<=3711||e>=3712&&e<=3839||e>=6016&&e<=6143||e>=4096&&e<=4255||e>=43616&&e<=43647||e>=43488&&e<=43519||e>=3840&&e<=4095}function Lo(e){return e===3633||e>=3635&&e<=3642||e>=3655&&e<=3662||e===3761||e>=3763&&e<=3772||e>=3784&&e<=3790||e>=6068&&e<=6099||e===6109}function Ro(e){return e<=3711?`th`:e<=3839?`lo`:e<=4095?`bo`:e<=4255?`my`:e<=6143?`km`:`my`}function zo(e){for(let t of e)if(Io(t.codePointAt(0)))return!0;return!1}function Bo(e){for(let t of e){let e=t.codePointAt(0);if(Io(e))return Fo(Ro(e))}return!1}function Vo(e){let t=!1;for(let n of e){let e=n.codePointAt(0);if(Io(e)){if(Fo(Ro(e)))return!1;t=!0}}return t}const Ho=new Map;function Uo(e){let t=Ho.get(e);if(t!==void 0)return t;let n=null;try{typeof Intl<`u`&&typeof Intl.Segmenter==`function`&&(n=new Intl.Segmenter(e,{granularity:`word`}))}catch{n=null}return Ho.set(e,n),n}function Wo(e){let t=Uo(e);return t?e=>t.segment(e):null}function Go(e){if(!zo(e))return[];let t=[],n=e.length,r=0;for(;r<n;){let i=e.codePointAt(r),a=i>65535?2:1;if(!Io(i)){r+=a;continue}let o=Ro(i),s=Fo(o),c=r+a;for(;c<n;){let t=e.codePointAt(c);if(!Io(t)||Fo(Ro(t))!==s)break;c+=t>65535?2:1}let l=e.slice(r,c);if(s)for(let e of $o(l))t.push(r+e);else{let e=Wo(o);if(e){let n=[];try{for(let t of e(l))t.index>0&&(t.isWordLike??!0)&&n.push(r+t.index);for(let e of n)t.push(e)}catch{}}}r=c}return t}function Ko(e){if(!zo(e))return[];let t=[],n=e.length,r=e.codePointAt(0),i=r>65535?2:1;for(;i<n;){let n=e.codePointAt(i),a=n>65535?2:1;Io(r)!==Io(n)&&!qo(r)&&!qo(n)&&t.push(i),r=n,i+=a}return t}function qo(e){return e===32||e===9||e===10||e===13||e===12288||e===160||e===8199||e===8239||e===8288||e===65279}function Jo(e,t){if(!zo(e))return[];let n=e.length,r=new Set(Go(e)),i=new Set($o(e)),a=e=>{i.has(e)&&r.add(e)};for(let t of Ko(e))a(t);if(t?.cjk){let t=e.codePointAt(0),r=t>65535?2:1;for(;r<n;){let n=e.codePointAt(r);(Eo(n)||Eo(t))&&a(r),t=n,r+=n>65535?2:1}}let o=t?.kinsoku,s=o!=null&&o.enabled!==!1,c=[];for(let t of r)if(!(t<=0||t>=n)){if(s){let n=e.codePointAt(t),r=Yo(e,t);if(r!==void 0&&o.lineEndForbidden.has(r)||o.lineStartForbidden.has(n))continue}c.push(t)}return c.sort((e,t)=>e-t),c}function Yo(e,t){if(t<=0)return;let n=e.charCodeAt(t-1);if(n>=56320&&n<=57343&&t>=2){let n=e.charCodeAt(t-2);if(n>=55296&&n<=56319)return e.codePointAt(t-2)}return n}function Xo(e,t,n,r,i,a=!1){let o=e.length;if(n>=o)return n;if(a){if(i(e.slice(n,o))<=r)return o;let a=0,s=t.length-1,c=n;for(;a<=s;){let l=a+s>>1,u=t[l];u<=n?a=l+1:u>=o?s=l-1:i(e.slice(n,u))<=r?(c=u,a=l+1):s=l-1}return c}let s=n;for(let a of t)a<=n||a>=o||i(e.slice(n,a))<=r&&(s=a);return i(e.slice(n,o))<=r&&(s=o),s}let Zo;function Qo(){if(Zo!==void 0)return Zo;let e=null;try{typeof Intl<`u`&&typeof Intl.Segmenter==`function`&&(e=new Intl.Segmenter(void 0,{granularity:`grapheme`}))}catch{e=null}return Zo=e,e}function $o(e){let t=Qo();if(t)try{let n=[];for(let r of t.segment(e))r.index>0&&n.push(r.index);return n}catch{}let n=[];for(let t=0;t<e.length;){let r=e.codePointAt(t);t+=r>65535?2:1,t<e.length&&n.push(t)}return n}const es=[`U`,`R`,`Tu`,`Tr`],ts=[0,167,168,169,170,174,175,177,178,188,191,215,216,247,248,746,748,4352,4608,5121,5760,6320,6400,8214,8215,8216,8218,8220,8222,8224,8226,8240,8242,8251,8253,8258,8259,8263,8266,8273,8274,8293,8294,8413,8417,8418,8421,8448,8450,8451,8458,8463,8464,8467,8469,8470,8472,8478,8484,8485,8486,8487,8488,8489,8490,8494,8495,8501,8512,8517,8523,8524,8526,8527,8586,8588,8592,8734,8735,8756,8758,8960,8968,8972,8992,8996,9001,9003,9004,9085,9115,9150,9166,9167,9168,9169,9180,9186,9251,9252,9472,9632,9754,9760,10088,10102,10132,11026,11056,11088,11098,11159,11160,11192,11218,11219,11244,11248,11264,11856,11858,11904,12289,12291,12296,12306,12308,12320,12336,12337,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12387,12388,12419,12420,12421,12422,12423,12424,12430,12431,12437,12439,12443,12445,12448,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12483,12484,12515,12516,12517,12518,12519,12520,12526,12527,12533,12535,12540,12541,12583,12584,12724,12728,12731,12732,12784,12800,13055,13144,13179,13184,42192,43360,43392,44032,55296,57344,64256,65040,65056,65072,65097,65104,65107,65112,65113,65119,65123,65127,65136,65281,65282,65288,65290,65292,65293,65294,65295,65306,65308,65311,65312,65339,65340,65341,65342,65343,65344,65371,65377,65504,65507,65508,65512,65520,65529,65532,65534,67968,68e3,71040,71168,72192,72384,77824,83584,94176,101888,110576,110898,110899,110928,110931,110933,110934,110948,110952,111360,118464,118736,118784,119296,119520,119680,120832,121520,126976,127488,127490,129024,129280,129792,131072,196606,196608,262142,983040,1048574,1048576,1114110],ns=[1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,3,1,3,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,3,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,2,0,3,0,3,0,3,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,3,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,3,0,2,0,2,0,2,0,2,0,2,0,2,0,1,0,1,0,1,0,1,0,1,0,1,2,0,1,3,0,1,0,1,2,0,3,0,2,1,2,0,3,1,2,0,3,0,3,0,3,0,3,1,0,3,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,2,0,2,0,2,0,2,0,1,0,1,0,1,0,1,0,1,0,2,0,1,0,1,0,1,0,1,0,1,0,1];function rs(e){let t=0,n=ts.length-1;for(;t<n;){let r=t+n+1>>1;ts[r]<=e?t=r:n=r-1}return ns[t]}function is(e){return es[rs(e)]}function as(e){return os.get(e)??null}const os=new Map([[65292,65040],[12289,65041],[12290,65042]]);function ss(e){return cs.get(e)??null}const cs=new Map([[65288,65077],[65289,65078],[65371,65079],[65373,65080],[12308,65081],[12309,65082],[12304,65083],[12305,65084],[12298,65085],[12299,65086],[12296,65087],[12297,65088],[12300,65089],[12301,65090],[12302,65091],[12303,65092],[12310,65047],[12311,65048]]),ls=new Set([65307]);function us(e){return ls.has(e)}const ds=new WeakMap;function fs(e){let t=e.canvas,n=t?.ownerDocument?.defaultView?.HTMLCanvasElement;return typeof n==`function`&&t instanceof n||typeof HTMLCanvasElement<`u`&&t instanceof HTMLCanvasElement?t:null}function ps(e,t){return e.replace(/(^|\\s)\\d*\\.?\\d+(?:px|pt|pc|in|cm|mm|q|em|rem|%)(?:\\/[^\\s]+)?(?=\\s)/i,`$1${t}`)}function ms(e,t=!0){let n=e.trim();return[...n===``||n.toLowerCase()===`normal`?[]:n.split(`,`).map(e=>e.trim()).filter(e=>!/^([\"'])vert\\1(?:\\s+(?:on|off|\\d+))?$/i.test(e)),`\"vert\" ${+!!t}`].join(`, `)}function hs(e){try{let t=e.ownerDocument?.defaultView,n=t?.getComputedStyle?t.getComputedStyle(e):typeof getComputedStyle==`function`?getComputedStyle(e):null;if(n?.fontFeatureSettings)return n.fontFeatureSettings}catch{}return e.style.fontFeatureSettings}function gs(e,t){if(e.isConnected)return t();let n=e.ownerDocument??(typeof document>`u`?null:document),r=n?.body??n?.documentElement;if(!r)return t();let i=e.parentNode,a=e.nextSibling,o=e.style,s={position:o.position,left:o.left,top:o.top,opacity:o.opacity,pointerEvents:o.pointerEvents};Object.assign(o,{position:`fixed`,left:`-99999px`,top:`0`,opacity:`0`,pointerEvents:`none`}),r.appendChild(e);let c=!1;try{return t()}catch(e){throw c=!0,e}finally{let t;try{if(i){let t=a?.parentNode===i?a:null;i.insertBefore(e,t)}else e.remove()}catch(n){t=n;try{e.remove()}catch{}}finally{Object.assign(o,s)}if(t!==void 0&&!c)throw t}}function _s(e,t){let n=fs(e);return n===null?t():gs(n,t)}function vs(e){let t=ds.get(e);if(t)return t;let n=e.createElement(`canvas`);n.width=256,n.height=256,n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,{position:`fixed`,left:`-99999px`,top:`0`,opacity:`0`,pointerEvents:`none`});let r={canvas:n,cache:new Map,epoch:0},i=()=>{r.epoch+=1,r.cache.clear()};return e.fonts?.addEventListener?.(`loadingdone`,i),e.fonts?.addEventListener?.(`loadingerror`,i),ds.set(e,r),r}function ys(e,t){let{width:n,height:r}=e.canvas,i=e.getImageData(0,0,n,r).data,a=new Uint8ClampedArray(n*r),o=n,s=r,c=-1,l=-1,u=0,d=0,f=0;for(let e=0;e<r;e+=1)for(let t=0;t<n;t+=1){let r=i[(e*n+t)*4+3];a[e*n+t]=r,r!==0&&(o=Math.min(o,t),s=Math.min(s,e),c=Math.max(c,t),l=Math.max(l,e),u+=r,d+=t*r,f+=e*r)}if(c<o||l<s||u===0)return null;let p=e.measureText(t),m=e=>typeof e==`number`&&Number.isFinite(e)?e:0;return{alpha:a,geometry:[o,s,c,l,d/u,f/u],metrics:[m(p.width),m(p.actualBoundingBoxLeft),m(p.actualBoundingBoxRight),m(p.actualBoundingBoxAscent),m(p.actualBoundingBoxDescent)]}}function bs(e,t,n){let r=e.canvas;r.style.fontFeatureSettings=n,e.font=e.font,e.clearRect(0,0,r.width,r.height);let i=String.fromCodePoint(t);return e.fillText(i,r.width/2,r.height/2),ys(e,i)}function xs(e,t){let n=0,r=Math.min(e.length,t.length);for(let i=0;i<r;i+=1)n+=Math.abs(e[i]-t[i]);return n}function Ss(e,t,n,r){let i=(e,t,n,r)=>{let i=Math.max(xs(e,t),xs(n,r));return Math.min(xs(e,n),xs(e,r),xs(t,n),xs(t,r))>i};return i(e.alpha,t.alpha,n.alpha,r.alpha)||i(e.geometry,t.geometry,n.geometry,r.geometry)||i(e.metrics,t.metrics,n.metrics,r.metrics)}function Cs(e,t){let n=fs(e);if(n===null||typeof document>`u`)return!1;let r=n.ownerDocument??document,i=vs(r),a=hs(n),o=`${i.epoch}:${ps(e.font,`<size>`)}:${a}:${t}`,s=i.cache.get(o);if(s!==void 0)return s;let c=!1,l=r.body??r.documentElement;if(!l)return!1;let u=i.canvas.isConnected;u||l.appendChild(i.canvas);let d=i.canvas.getContext(`2d`,{willReadFrequently:!0});if(d!==null){let n=i.canvas.style.fontFeatureSettings;try{d.font=ps(e.font,`200px`),d.fillStyle=`#000`,d.textAlign=`center`,d.textBaseline=`middle`;let n=ms(a,!1),r=ms(a,!0),i=bs(d,t,n),o=bs(d,t,n),s=bs(d,t,r),l=bs(d,t,r);c=i!==null&&o!==null&&s!==null&&l!==null&&Ss(i,o,s,l)}catch{c=!1}finally{i.canvas.style.fontFeatureSettings=n,d.font=d.font,d.clearRect(0,0,i.canvas.width,i.canvas.height),u||i.canvas.remove()}}return i.cache.set(o,c),c}function ws(e,t){let n=e.canvas;return n?.style?_s(e,()=>{let r=n.style,i=r.fontFeatureSettings;r.fontFeatureSettings=ms(hs(n)),e.font=e.font;try{return t()}finally{r.fontFeatureSettings=i,e.font=e.font}}):t()}function Ts(e,t){return ws(e,()=>{let n=e.textAlign,r=e.textBaseline;e.textAlign=`center`,e.textBaseline=`middle`;try{let n=e.measureText(t),r=Number.isFinite(n.width)?Math.max(0,n.width):0,i=typeof n.actualBoundingBoxAscent==`number`&&Number.isFinite(n.actualBoundingBoxAscent)&&typeof n.actualBoundingBoxDescent==`number`&&Number.isFinite(n.actualBoundingBoxDescent);return{advancePx:r,inkBeforePx:i?n.actualBoundingBoxAscent:0,inkAfterPx:i?n.actualBoundingBoxDescent:0,cellAdvancePx:r,originInCellPx:r/2}}finally{e.textAlign=n,e.textBaseline=r}})}const Es=e=>e===32||e===12288;function Ds(e,t,n={}){if(Math.abs(t)<=.5)return null;let r=n.firstContentSi??0,i=n.lastDrawnSi??e.length-1,a=n.minPerGap??-1/0,o=n.isGapChar??Eo,s=n.isWhitespace??Es,c=n.seaClusterGaps??!1,l=[];for(let t=r;t<e.length;t++){let n=e[t];if(n===void 0)continue;if(n.text===void 0){l.push({si:t,off:0,ws:!1});continue}let r=0;for(let e of n.text){let n=e.codePointAt(0);l.push({si:t,off:r,cp:n,ws:s(n)}),r++}}let u=-1,d=-1;for(let e=0;e<l.length;e++)l[e].ws||(u===-1&&(u=e),d=e);if(u===-1||u===d)return null;let f=Array(l.length).fill(!1),p=0;for(let e=u;e<d;e++){let t=l[e];if(t.si===i)continue;if(t.ws){f[e]=!0,p++;continue}let n=l[e+1];if(n.ws)continue;let r=t.cp,a=n.cp;(r!==void 0&&o(r)||a!==void 0&&o(a)||c&&r!==void 0&&a!==void 0&&Io(r)&&Io(a)&&!Lo(a))&&(f[e]=!0,p++)}if(p===0)return null;let m=t/p;t<0&&m<a&&(m=a);let h=new Map;for(let e of l)e.cp!==void 0&&h.set(e.si,(h.get(e.si)??0)+1);let g=new Map;for(let e=0;e<l.length;e++){if(!f[e])continue;let t=l[e],n=g.get(t.si);n||(n={splitBefore:[],trailingGap:!1,internalStretch:0},g.set(t.si,n));let r=h.get(t.si)??0;t.cp===void 0||t.off===r-1?n.trailingGap=!0:(n.splitBefore.push(t.off+1),n.internalStretch+=m)}return{perGap:m,perSeg:g}}const Os=[[1e3,`M`],[900,`CM`],[500,`D`],[400,`CD`],[100,`C`],[90,`XC`],[50,`L`],[40,`XL`],[10,`X`],[9,`IX`],[5,`V`],[4,`IV`],[1,`I`]];function ks(e){let t=``,n=e;for(let[e,r]of Os)for(;n>=e;)t+=r,n-=e;return t}function As(e,t){let n=t.length,r=Math.floor((e-1)/n)+1;return t[(e-1)%n].repeat(r)}const js=Array.from({length:26},(e,t)=>String.fromCharCode(65+t)),Ms=`أ.ب.ت.ث.ج.ح.خ.د.ذ.ر.ز.س.ش.ص.ض.ط.ظ.ع.غ.ف.ق.ك.ل.م.ن.ه.و.ي`.split(`.`),Ns=`أ.ب.ج.د.ه.و.ز.ح.ط.ي.ك.ل.م.ن.س.ع.ف.ص.ق.ر.ش.ت.ث.خ.ذ.ض.غ.ظ`.split(`.`),Ps=[`א`,`ב`,`ג`,`ד`,`ה`,`ו`,`ז`,`ח`,`ט`,`י`,`כ`,`ל`,`מ`,`נ`,`ס`,`ע`,`פ`,`צ`,`ק`,`ר`,`ש`,`ת`],Fs=[...Hs(1072,1080),...Hs(1082,1087),...Hs(1088,1097),`ы`,`э`,`ю`,`я`],Is=[...Hs(1040,1048),...Hs(1050,1055),...Hs(1056,1065),`Ы`,`Э`,`Ю`,`Я`],Ls=[`ก`,`ข`,`ค`,...Hs(3591,3619),`ล`,...Hs(3623,3630)],Rs=[`ㄱ`,`ㄴ`,`ㄷ`,`ㄹ`,`ㅁ`,`ㅂ`,`ㅅ`,`ㅇ`,`ㅈ`,`ㅊ`,`ㅋ`,`ㅌ`,`ㅍ`,`ㅎ`],zs=[`가`,`나`,`다`,`라`,`마`,`바`,`사`,`아`,`자`,`차`,`카`,`타`,`파`,`하`],Bs=Hs(2325,2361),Vs=[...Hs(2309,2324),`अं`,`अः`];function Hs(e,t){let n=[];for(let r=e;r<=t;r++)n.push(String.fromCodePoint(r));return n}const Us=`ア.イ.ウ.エ.オ.カ.キ.ク.ケ.コ.サ.シ.ス.セ.ソ.タ.チ.ツ.テ.ト.ナ.ニ.ヌ.ネ.ノ.ハ.ヒ.フ.ヘ.ホ.マ.ミ.ム.メ.モ.ヤ.ユ.ヨ.ラ.リ.ル.レ.ロ.ワ.ヰ.ヱ.ヲ.ン`.split(`.`),Ws=[...Hs(65393,65436),`ヲ`,`ン`];function Gs(e){return e<=20?String.fromCodePoint(9312+(e-1)):String(e)}function Ks(e,t){return String(e).split(``).map(e=>t[e.charCodeAt(0)-48]).join(``)}const qs=Hs(65296,65305),Js=Hs(3664,3673),Ys=Hs(2406,2415),Xs=[`〇`,`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`],Zs=[`영`,`일`,`이`,`삼`,`사`,`오`,`육`,`칠`,`팔`,`구`],Qs=[`零`,`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`],$s=[`○`,`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`];function ec(e,t){if(e<10)return t[e];if(e<100){let n=Math.floor(e/10),r=e%10,i=n===1?`十`:t[n]+`十`;return r===0?i:i+t[r]}return Ks(e,t)}function tc(e,t){switch(t){case`upperRoman`:return e>=1?ks(e):String(e);case`lowerRoman`:return e>=1?ks(e).toLowerCase():String(e);case`upperLetter`:return e>=1?As(e,js):String(e);case`lowerLetter`:return e>=1?As(e,js).toLowerCase():String(e);case`arabicAlpha`:return e>=1?As(e,Ms):String(e);case`arabicAbjad`:return e>=1?As(e,Ns):String(e);case`russianLower`:return e>=1?As(e,Fs):String(e);case`russianUpper`:return e>=1?As(e,Is):String(e);case`thaiLetters`:return e>=1?As(e,Ls):String(e);case`chosung`:return e>=1?As(e,Rs):String(e);case`ganada`:return e>=1?As(e,zs):String(e);case`hindiVowels`:return e>=1?As(e,Bs):String(e);case`hindiConsonants`:return e>=1?As(e,Vs):String(e);case`aiueoFullWidth`:return e>=1?As(e,Us):String(e);case`aiueo`:return e>=1?As(e,Ws):String(e);case`decimalEnclosedCircle`:return e>=1?Gs(e):String(e);case`hebrew1`:return e>=1?ac(e):String(e);case`hebrew2`:return e>=1?oc(e):String(e);case`hex`:return e>=1?e.toString(16).toUpperCase():String(e);case`numberInDash`:return e>=1?`- ${e} -`:String(e);case`decimalZero`:return e>=1&&e<=9?`0${e}`:String(e);case`decimalFullWidth`:return e>=1?Ks(e,qs):String(e);case`decimalHalfWidth`:return String(e);case`thaiNumbers`:return e>=1?Ks(e,Js):String(e);case`hindiNumbers`:return e>=1?Ks(e,Ys):String(e);case`ideographDigital`:case`japaneseDigitalTenThousand`:return e>=1?Ks(e,Xs):String(e);case`koreanDigital`:return e>=1?Ks(e,Zs):String(e);case`koreanDigital2`:return e>=1?Ks(e,Qs):String(e);case`taiwaneseDigital`:return e>=1?Ks(e,$s):String(e);case`chineseCounting`:return e>=1?ec(e,Xs):String(e);case`taiwaneseCounting`:return e>=1?ec(e,$s):String(e);case`chineseCountingThousand`:return e>=1?hc(e,cc):String(e);case`taiwaneseCountingThousand`:return e>=1?hc(e,lc):String(e);case`chineseLegalSimplified`:return e>=1?hc(e,dc):String(e);case`ideographLegalTraditional`:return e>=1?hc(e,pc):String(e);case`japaneseCounting`:return e>=1?hc(e,sc):String(e);case`japaneseLegal`:return e>=1?hc(e,fc):String(e);case`koreanCounting`:return e>=1?hc(e,uc):String(e);case`koreanLegal`:return e>=1?vc(e):String(e);default:return String(e)}}const nc=[``,`א`,`ב`,`ג`,`ד`,`ה`,`ו`,`ז`,`ח`,`ט`],rc=[``,`י`,`כ`,`ל`,`מ`,`נ`,`ס`,`ע`,`פ`,`צ`],ic=[``,`ק`,`ר`,`ש`,`ת`,`ך`,`ם`,`ן`,`ף`,`ץ`];function ac(e){let t=``,n=e,r=Math.floor(n/1e3);n%=1e3;let i=Math.floor(n/100);if(n%=100,r>0&&(t+=nc[r%10]),t+=ic[i],n===15)return t+`טו`;if(n===16)return t+`טז`;let a=Math.floor(n/10),o=n%10;return t+=rc[a],t+=nc[o],t}function oc(e){let t=Ps.length,n=Math.floor((e-1)/t);return Ps[e-t*n-1]+`ת`.repeat(n)}const sc={digits:Qs,ten:`十`,hundred:`百`,thousand:`千`,myriad:`万`,elideOne:!0,insertZero:!1},cc={...sc,elideOne:!1,insertZero:!0},lc={...cc},uc={digits:[`영`,`일`,`이`,`삼`,`사`,`오`,`육`,`칠`,`팔`,`구`],ten:`십`,hundred:`백`,thousand:`천`,myriad:`만`,elideOne:!0,insertZero:!1},dc={digits:[`零`,`壹`,`贰`,`叁`,`肆`,`伍`,`陆`,`柒`,`捌`,`玖`],ten:`拾`,hundred:`佰`,thousand:`仟`,myriad:`万`,elideOne:!1,insertZero:!0},fc={digits:[`零`,`壱`,`弐`,`参`,`四`,`伍`,`六`,`七`,`八`,`九`],ten:`拾`,hundred:`百`,thousand:`阡`,myriad:`萬`,elideOne:!1,insertZero:!1},pc={digits:[`零`,`壹`,`貳`,`參`,`肆`,`伍`,`陸`,`柒`,`捌`,`玖`],ten:`拾`,hundred:`佰`,thousand:`仟`,myriad:`萬`,elideOne:!1,insertZero:!1};function mc(e,t,n){let r=Math.floor(e/1e3)%10,i=Math.floor(e/100)%10,a=Math.floor(e/10)%10,o=e%10,s=[{digit:r,unit:t.thousand},{digit:i,unit:t.hundred},{digit:a,unit:t.ten},{digit:o,unit:``}],c=``,l=!1,u=!1;for(let{digit:e,unit:r}of s){if(e===0){l&&(u=!0);continue}u&&=(t.insertZero&&(c+=t.digits[0]),!1),n&&e===1&&r?c+=r:c+=t.digits[e]+r,l=!0}return c}function hc(e,t){if(e>=1e8){let n=Math.floor(e/1e8),r=e%1e8,i=hc(n,t)+`億`;return r===0?i:i+(t.insertZero&&r<1e7?t.digits[0]:``)+hc(r,t)}let n=Math.floor(e/1e4),r=e%1e4,i=``;return n>0&&(i+=mc(n,t,t.elideOne)+t.myriad),r>0&&(t.insertZero&&n>0&&r<1e3&&(i+=t.digits[0]),i+=mc(r,t,t.elideOne)),i}const gc=[``,`하나`,`둘`,`셋`,`넷`,`다섯`,`여섯`,`일곱`,`여덟`,`아홉`],_c=[``,`열`,`스물`,`서른`,`마흔`,`쉰`,`예순`,`일흔`,`여든`,`아흔`];function vc(e){if(e>=100)return String(e);let t=Math.floor(e/10),n=e%10;return _c[t]+gc[n]}const yc={Arabic:`decimal`,ArabicDash:`numberInDash`,Hex:`hex`,Roman:`upperRoman`,roman:`lowerRoman`,ALPHABETIC:`upperLetter`,alphabetic:`lowerLetter`,ARABICABJAD:`arabicAbjad`,ARABICALPHA:`arabicAlpha`,HEBREW1:`hebrew1`,HEBREW2:`hebrew2`,HINDIARABIC:`hindiNumbers`,HINDILETTER1:`hindiVowels`,HINDILETTER2:`hindiConsonants`,THAIARABIC:`thaiNumbers`,THAILETTER:`thaiLetters`,CHOSUNG:`chosung`,GANADA:`ganada`,DBCHAR:`decimalFullWidth`,SBCHAR:`decimalHalfWidth`};function bc(e){let t=/\\\\\\*\\s+(\\S+)/g,n;for(;(n=t.exec(e))!==null;){let e=yc[n[1]];if(e)return e}return null}const xc=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],Sc=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Cc=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],wc=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],Tc=e=>e<10?`0${e}`:`${e}`;function Ec(e){let t=/\\\\@\\s*\"([^\"]*)\"/.exec(e);if(t)return t[1];let n=/\\\\@\\s*(\\S+)/.exec(e);return n?n[1]:null}function Dc(e,t){let n=t.getFullYear(),r=t.getMonth(),i=t.getDate(),a=t.getDay(),o=t.getHours(),s=o%12==0?12:o%12,c=t.getMinutes(),l=t.getSeconds(),u=o>=12,d=``,f=0,p=e.length;for(;f<p;){let t=e[f];if(t===`'`){f++;let t=``;for(;f<p;){if(e[f]===`'`){if(e[f+1]===`'`){t+=`'`,f+=2;continue}f++;break}t+=e[f++]}d+=t;continue}if(/[A-Za-z]/.test(t)){let u=f;for(;u<p&&e[u]===t;)u++;let m=e.slice(f,u).length,h=t.toLowerCase(),g=null;if(t===`y`||t===`Y`?g=m>=4?String(n).padStart(4,`0`):Tc(n%100):t===`M`?g=m>=4?xc[r]:m===3?Sc[r]:m===2?Tc(r+1):String(r+1):h===`d`?g=m>=4?Cc[a]:m===3?wc[a]:m===2?Tc(i):String(i):t===`H`?g=m>=2?Tc(o):String(o):t===`h`?g=m>=2?Tc(s):String(s):t===`m`?g=m>=2?Tc(c):String(c):t===`s`?g=m>=2?Tc(l):String(l):(h===`a`||h===`p`)&&(g=null),g!==null){d+=g,f=u;continue}if(!(h===`a`||h===`p`))return null}let m=/^([AaPp])([Mm])?\\/([AaPp])([Mm])?/.exec(e.slice(f));if(m){let e=m[2]!==void 0;d+=e?u?`PM`:`AM`:u?`P`:`A`,f+=m[0].length;continue}d+=t,f++}return d}const Oc=[[e=>e.includes(`meiryo`)||e.includes(`メイリオ`),{asc:2210/2048,desc:1059/2048}],[e=>!e.includes(`ui`)&&(e.includes(`yu mincho`)||e.includes(`yumincho`)||e.includes(`游明朝`)||e.includes(`yu gothic`)||e.includes(`yugothic`)||e.includes(`游ゴシック`)),{asc:1802*1.3/2048,desc:455*1.3/2048,eaOnly:!0}],[e=>e.includes(`sakkal majalla`)||e.includes(`majalla`),{asc:1810/2048,desc:1050/2048}],[e=>e===`times new roman`,{asc:1825/2048,desc:530/2048}],[e=>e===`arial`,{asc:1854/2048,desc:501/2048}]];function kc(e,t){if(!e)return null;let n=e.toLowerCase();for(let[e,r]of Oc)if(e(n)&&(t||!r.eaOnly))return r;return null}function Ac(e,t=!1){let n=kc(e,t);return n===null?null:n.asc+n.desc}function jc(e,t,n=!1){let r=Ac(e,n);return r===null?0:r*t}function Mc(e,t,n,r,i=!1){let a=kc(e,i);if(a===null)return{ascent:n,descent:r};let o=(a.asc+a.desc)*t;return n+r<=o?{ascent:n,descent:r}:{ascent:a.asc*t,descent:a.desc*t}}function Nc(e){return e.trim().toLowerCase()}function Pc(e){return`local(\"${e.replaceAll(`\\\\`,`\\\\\\\\`).replaceAll(`\"`,`\\\\\"`)}\")`}function Fc(e){return`__ooxml_local_${[...e].map(e=>(e.codePointAt(0)??0).toString(16).padStart(6,`0`)).join(``)}`}function Ic(){return typeof OffscreenCanvas<`u`?new OffscreenCanvas(1,1).getContext(`2d`):typeof document<`u`&&document?.createElement?document.createElement(`canvas`).getContext(`2d`):null}async function Lc(e){let t=k();if(!t||typeof FontFace>`u`)return{faces:[],metrics:{}};let n=[],r={},i=new Map;for(let t of e){let e=t.family.trim(),n=t.localNames.map(e=>e.trim()).filter(Boolean);if(!e||n.length===0||t.lineHeightMultiplier!=null&&!(t.lineHeightMultiplier>0))continue;let r=t.weight??400,a=t.style??`normal`;if(!(r>=100&&r<=900)||a!==`normal`&&a!==`italic`)continue;let o=n.map(Pc).join(`, `),s=Nc(e),c=`local-face:${o}:${r}:${a}`,l=i.get(c)??{source:o,requests:[]};l.requests.push({...t,family:e,normalizedFamily:s,source:o,weight:r,style:a}),i.set(c,l)}for(let[e,a]of i){let i=Fc(e),{face:o}=w(e,t,()=>{let e=a.requests[0],n=new FontFace(i,a.source,{weight:String(e.weight),style:e.style});return t.add(n),n});try{if(!await E(o.load())||o.status!==`loaded`)throw Error(`local font load timed out`);let e=!1;for(let t of a.requests){let n;if(t.lineHeightMultiplier!=null){let e=Ic();if(!e)continue;e.font=`${t.style} ${t.weight} 100px \"${i}\"`;let r=e.measureText(`Hg国`),a=r.fontBoundingBoxAscent,o=r.fontBoundingBoxDescent;if(!(Number.isFinite(a)&&Number.isFinite(o)&&a+o>0))continue;n=(a+o)/100*t.lineHeightMultiplier}let a=t.weight===400&&t.style===`normal`?t.normalizedFamily:`${t.normalizedFamily}:${t.weight}:${t.style}`;r[a]={family:i,...n==null?{}:{lineHeightRatio:n},requestedFamily:t.family,weight:t.weight,style:t.style,sourceIdentity:t.source,synthesized:!1},e=!0}if(!e)throw Error(`exact local font route unavailable`);n.push(o)}catch{T([o])}}return{faces:n,metrics:r}}function Rc(e){T(e)}const zc=[{test:e=>e===`georgia`,biasEm:.0105}];function Bc(e){return(e??``).trim().replace(/^[\"']|[\"']$/g,``).replace(/\\s+/g,` `).toLowerCase()}function Vc(e){let t=Bc(e);for(let e of zc)if(e.test(t))return e.biasEm;return 0}function Hc(e){if(e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(Hc).join(`,`)}]`;if(typeof e==`object`){let t=e;return`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${Hc(t[e])}`).join(`,`)}}`}throw TypeError(`Cannot fingerprint ${typeof e}`)}function Uc(e,t){let n=Hc(t);return`${e}:${encodeURIComponent(n)}`}function Wc(e){return`${e.story}:${encodeURIComponent(e.storyInstance)}:${e.path.join(`.`)}`}function Gc(e,t,n){if(t.length===0||n.length===0)throw RangeError(`Body occurrence identity requires a flow domain and fragment start`);return[`body-occurrence`,encodeURIComponent(Wc(e)),encodeURIComponent(t),encodeURIComponent(n)].join(`/`)}function Kc(e,t){return`image:${Wc(e)}:${encodeURIComponent(t)}`}function qc(e,t){return`math:${Wc(e)}:${encodeURIComponent(t)}`}function Jc(e,t){return`anchor:${Wc(e)}:${encodeURIComponent(t)}`}function Yc(e,t,n=new WeakSet,r=new WeakSet){if(e==null||typeof e==`string`||typeof e==`boolean`)return;if(typeof e==`number`){if(!Number.isFinite(e))throw TypeError(`${t} must contain finite numbers`);return}if(typeof e!=`object`||n.has(e))throw TypeError(`${t} must be structured-clone-safe plain data`);if(r.has(e))return;let i=Object.getPrototypeOf(e);if(!Array.isArray(e)&&i!==Object.prototype&&i!==null)throw TypeError(`${t} must be structured-clone-safe plain data`);n.add(e);try{for(let[i,a]of Object.entries(e))Yc(a,`${t}.${i}`,n,r)}finally{n.delete(e)}r.add(e)}function Xc(e,t=new WeakSet){if(typeof e!=`object`||!e||t.has(e))return e;t.add(e);for(let n of Object.values(e))Xc(n,t);return Object.freeze(e)}function Zc(e,t){Yc(e,t);try{return Xc(structuredClone(e))}catch{throw TypeError(`${t} must be structured-clone-safe plain data`)}}function Qc(e){let t=e.__typographyAcquisition;if(t!==void 0)return Zc({sourceText:`text`in e?e.text:e.fallbackText,...t},`DOCX run typography acquisition input`)}function $c(e){let t=e.__paragraphTypographyAcquisition;if(t!==void 0)return Zc(t,`DOCX paragraph typography acquisition input`)}function el(e,t){let n=e.fontFamily??null;return{fontSizePt:t,fonts:{ascii:n,highAnsi:n,eastAsia:e.fontFamilyEastAsia??n,complexScript:n},weight:400,style:`normal`,complexScript:!1}}function tl(e,t={story:`textbox`,storyInstance:`shape`,path:[]},n=el){return Zc((e.textBlocks??[]).map((e,r)=>{let i={story:`textbox`,storyInstance:t.storyInstance,path:[...t.path,r]},a=e.runs?.length?e.runs:[{text:e.text,fontSizePt:e.fontSizePt,color:e.color,fontFamily:e.fontFamily,bold:e.bold,italic:e.italic}],o=e.color??a[0]?.color,s=e.numbering?{...e.numbering,...e.numbering.color==null&&!e.numbering.colorAuto&&o?{color:o}:{}}:null;return{source:i,spacing:{beforePt:e.spaceBefore??0,afterPt:e.spaceAfter??0},runs:a.map(t=>({text:t.text,fontSizePt:t.fontSizePt,...t.color??e.color?{color:`#${t.color??e.color}`}:{},...t.fontFamily||e.fontFamily?{fontFamily:t.fontFamily??e.fontFamily??void 0}:{},...t.fontFamilyEastAsia?{fontFamilyEastAsia:t.fontFamilyEastAsia}:{},bold:t.bold??e.bold??!1,italic:t.italic??e.italic??!1,...t.ruby?{ruby:t.ruby}:{}})),alignment:e.alignment??`left`,indentLeftPt:e.indentLeft??0,indentRightPt:e.indentRight??0,indentFirstPt:e.indentFirst??0,lineSpacing:e.lineSpacingVal==null?null:{value:e.lineSpacingVal,rule:e.lineSpacingRule===`exact`||e.lineSpacingRule===`atLeast`?e.lineSpacingRule:`auto`,explicit:!0},tabStops:(e.tabStops??[]).map(e=>({...e})),...e.bidi===void 0?{}:{bidi:e.bidi},contextualSpacing:e.contextualSpacing??!1,...e.styleId===void 0?{}:{styleId:e.styleId},...s?{numbering:s,numberingMarkerShapeInput:n(s,e.fontSizePt)}:{},...e.imagePath?{image:{imagePath:e.imagePath,mimeType:e.mimeType??`application/octet-stream`,...e.svgImagePath?{svgImagePath:e.svgImagePath}:{},widthPt:e.imageWidthPt??0,heightPt:e.imageHeightPt??0}}:{}}}),`DOCX text box acquisition input`)}function nl(e,t){let n=e<0n?-e:e,r=t<0n?-t:t;for(;r!==0n;)[n,r]=[r,n%r];return n===0n?1n:n}function rl(e,t){if(t===0n)throw RangeError(`Exact length denominator must not be zero`);let n=t<0n?-1n:1n,r=nl(e,t);return Object.freeze({numerator:n*e/r,denominator:n*t/r})}function il(e){let t=/^([+-]?)(?:(\\d+)(?:\\.(\\d*))?|\\.(\\d+))(?:[eE]([+-]?\\d+))?$/.exec(e);if(!t)return null;let n=t[1]===`-`,r=t[2]??``,i=t[3]??t[4]??``,a=Number(t[5]??`0`);if(!Number.isSafeInteger(a))return null;let o=`${r}${i}`,s=0;for(;s<o.length&&o.charCodeAt(s)===48;)s+=1;if(s===o.length)return rl(0n,1n);let c=o.length-1;for(;c>s&&o.charCodeAt(c)===48;)--c;let l=o.slice(s,c+1),u=o.length-1-c,d=a-i.length+u,f=d+l.length-1;if(l.length>768||Math.abs(f)>1100)return null;let p=BigInt(l),m=1n;return d>=0?p*=10n**BigInt(d):m=10n**BigInt(-d),n&&(p=-p),rl(p,m)}function al(e){let t=/^(-?\\d+)\\/([1-9]\\d*)$/.exec(e);if(!t)throw RangeError(`Invalid exact length key: ${e}`);return rl(BigInt(t[1]),BigInt(t[2]))}function ol(e){let t=rl(e.numerator,e.denominator);return`${t.numerator}/${t.denominator}`}function sl(e){let t=il(e);return t?ol(t):null}function cl(e){if(!Number.isFinite(e)||e<0)return null;let t=il(e.toString());return t?ol(t):null}function ll(e,t){let n=e.toString(2).length-t.toString(2).length;return(n>=0?e<t<<BigInt(n):e<<BigInt(-n)<t)&&--n,n}function ul(e,t,n){let r=n>=0?e<<BigInt(n):e,i=n<0?t<<BigInt(-n):t,a=r/i,o=r%i*2n-i;return o>0n||o===0n&&a%2n!=0n?a+1n:a}function dl(e){let t=al(e);if(t.numerator===0n)return 0;let n=t.numerator<0n,r=n?-t.numerator:t.numerator,i=ll(r,t.denominator),a;if(i<-1022){let e=ul(r,t.denominator,1074);a=Number(e)*Number.MIN_VALUE}else{let e=ul(r,t.denominator,52-i);e===1n<<53n&&(e>>=1n,i+=1),a=i>1023?1/0:Number(e)*2**(i-52)}return n?-a:a}function fl(e,t){let n=al(e),r=al(t);return ol(rl(n.numerator*r.denominator+r.numerator*n.denominator,n.denominator*r.denominator))}function pl(e,t){let n=al(e),r=al(t);return ol(rl(n.numerator*r.numerator,n.denominator*r.denominator))}function ml(e,t){let n=al(e),r=al(t);return ol(rl(n.numerator*r.denominator-r.numerator*n.denominator,n.denominator*r.denominator))}function hl(e,t){if(t===0n)throw RangeError(`Exact length divisor must not be zero`);let n=al(e);return ol(rl(n.numerator,n.denominator*t))}function gl(e,t){let n=al(e),r=al(t),i=n.numerator*r.denominator-r.numerator*n.denominator;return i<0n?-1:+(i>0n)}const _l=1e-9;function vl(e,t,n,r){let i=Number.isFinite(e)?Math.max(0,e):0,a=Math.max(0,t),o=a+Math.max(1,n);return{startPt:a===0?i:i/2,endPt:o>=Math.max(0,r)?i:i/2}}function yl(e){return Number.isFinite(e)?Math.max(0,e):0}function bl(e){return e.map(e=>Math.abs(e)<=_l?0:e)}function xl(e){let t=e.gridWidthsPt.length;for(let n of e.rows){for(let e of n.cells)t=Math.max(t,e.columnStart+Math.max(1,e.columnSpan));let e=n.cells.reduce((e,t)=>Math.max(e,t.columnStart+Math.max(1,t.columnSpan)),n.before?.columnSpan??0);t=Math.max(t,e+(n.after?.columnSpan??0))}return t}function Sl(e,t,n){let r=0,i=Math.min(e.length,t+Math.max(1,n));for(let n=Math.max(0,t);n<i;n+=1)r+=e[n]??0;return r}function Cl(e,t){return e?e.kind===`pct`?yl(e.value)*t:yl(e.value):null}function wl(e,t,n,r){let i=Math.max(0,t),a=Math.max(1,Math.min(n,e.length-i));if(a<=0)return;let o=Sl(e,i,a);if(o<=_l){e[i+a-1]=r;return}let s=r/o;for(let t=i;t<i+a;t+=1)e[t]=(e[t]??0)*s}function Tl(e,t,n,r){let i=Math.max(0,t),a=Math.max(1,Math.min(n,e.length-i));if(a<=0)return;let o=Sl(e,i,a);r<=o+_l||(e[i+a-1]+=r-o)}function El(e,t){let n=[];e.before&&e.before.columnSpan>0&&n.push({start:0,span:e.before.columnSpan,preferred:e.before.preferredWidth});for(let t of e.cells)n.push({start:t.columnStart,span:t.columnSpan,preferred:t.preferredWidth});return e.after&&e.after.columnSpan>0&&n.push({start:Math.max(0,t-e.after.columnSpan),span:e.after.columnSpan,preferred:e.after.preferredWidth}),n}function Dl(e,t){let n=Array.from({length:t},(t,n)=>yl(e.gridWidthsPt[n]??0)),r=n.reduce((e,t)=>e+t,0),i=e.tablePreferredWidthPt??(r>0?r:yl(e.availableWidthPt));e.rows.forEach((e,r)=>{for(let a of El(e,t)){let e=Cl(a.preferred,i);e!==null&&(r===0?wl(n,a.start,a.span,e):Tl(n,a.start,a.span,e))}}),e.tablePreferredWidthPt===null&&Ol(n,e.rows);let a=e.tablePreferredWidthPt,o=n.reduce((e,t)=>e+t,0);if(a!==null&&a>=0&&o<=_l&&n.length>0)return n.map(()=>a/n.length);if(a!==null&&a>=0&&o>_l){let e=a/o;return n.map(t=>t*e)}return n}function Ol(e,t){let n=Array(e.length).fill(0);for(let r of t)for(let t of r.cells){if(t.columnSpan!==1||t.preferredWidth?.kind!==`pct`)continue;let r=t.columnStart;r<0||r>=e.length||(n[r]=Math.max(n[r]??0,yl(t.preferredWidth.value)))}let r=e.reduce((e,t)=>e+t,0),i=n.map((t,n)=>t*r>e[n]+_l),a=new Set;for(;i.some(Boolean);){let t=i.map(e=>e?`1`:`0`).join(``);if(a.has(t))return;a.add(t);let o=0,s=0;for(let t=0;t<e.length;t+=1)i[t]?s+=n[t]??0:o+=e[t]??0;if(s>=1-_l)return;r=o/(1-s);let c=n.map((t,n)=>t*r>e[n]+_l);if(c.every((e,t)=>e===i[t])){for(let t=0;t<e.length;t+=1)i[t]&&(e[t]=n[t]*r);return}i=c}}function kl(e,t,n){let r=Array(t).fill(0),i=Array(t).fill(0);for(let n of e)for(let e of n.cells)e.columnSpan!==1||e.columnStart<0||e.columnStart>=t||(r[e.columnStart]=Math.max(r[e.columnStart]??0,yl(e.minContentWidthPt)),i[e.columnStart]=Math.max(i[e.columnStart]??0,yl(e.maxContentWidthPt)));let a=Array(t).fill(!1);for(let o of e)for(let e of o.cells){let o=e.columnStart;if(e.columnSpan!==1||o<0||o>=t||a[o]||e.preferredWidth===null)continue;let s=Cl(e.preferredWidth,n);s!==null&&(i[o]=Math.max(r[o]??0,s),a[o]=!0)}for(let e=0;e<t;e+=1)i[e]=Math.max(r[e]??0,i[e]??0);return{minimums:r,maximums:i}}function Al(e,t,n,r,i){let a=Math.min(e.length,n+r),o=e.map((e,t)=>t).filter(e=>e<n||e>=a),s=o.map(n=>Math.max(0,e[n]-(t[n]??0))),c=s.reduce((e,t)=>e+t,0),l=Math.min(i,c);return l<=_l||c<=_l?0:(o.forEach((t,n)=>{e[t]-=l*((s[n]??0)/c)}),l)}function jl(e,t,n,r){if(r<=_l||n<=0)return;let i=Sl(e,t,n);for(let a=0;a<n;a+=1){let o=t+a,s=i>_l?(e[o]??0)/i:1/n;e[o]+=r*s}}function Ml(e,t,n,r){let i=Math.max(0,r.columnStart),a=Math.max(1,Math.min(r.columnSpan,e.length-i));if(a<=0)return;let o=yl(r.minContentWidthPt),s=Sl(e,i,a);if(o<=s+_l)return;let c=a===1?n[i]??o:Math.max(o,yl(r.maxContentWidthPt));jl(e,i,a,Al(e,t,i,a,Math.max(0,c-s)));let l=Sl(e,i,a);l<o-_l&&jl(e,i,a,o-l)}function Nl(e,t,n,r){let i=e.reduce((e,t)=>e+t,0);if(i<=r+_l||i<=_l)return e;let a=[...e],o=a.map((e,n)=>Math.max(0,e-(t[n]??0))),s=o.reduce((e,t)=>e+t,0),c=Math.min(i-r,s);c>_l&&s>_l&&a.forEach((e,t)=>{a[t]-=c*((o[t]??0)/s)});for(let e of n){if(e.columnSpan<=1)continue;let n=Math.max(0,e.columnStart),r=Math.max(1,Math.min(e.columnSpan,a.length-n)),i=yl(e.minContentWidthPt)-Sl(a,n,r);if(i<=_l)continue;let o=Al(a,t,n,r,i);jl(a,n,r,o),o<i-_l&&jl(a,n,r,i-o)}let l=a.reduce((e,t)=>e+t,0);if(l<=r+_l||l<=_l)return bl(a);let u=Math.max(0,r)/l;return bl(a.map(e=>e*u))}function Pl(e){let t=xl(e);if(t===0)return Object.freeze([]);let n=Dl(e,t);if(e.layout===`fixed`){let t=n.reduce((e,t)=>e+t,0),r=yl(e.availableWidthPt);if(t<=r+_l||t<=_l)return Object.freeze(n);let i=r/t;return Object.freeze(bl(n.map(e=>e*i)))}let r=n.reduce((e,t)=>e+t,0),{minimums:i,maximums:a}=kl(e.rows,t,r),o=e.rows.flatMap(e=>e.cells);o.sort((e,t)=>e.columnSpan-t.columnSpan);for(let e of o)Ml(n,i,a,e);return Object.freeze(Nl(n,i,o,yl(e.availableWidthPt)))}function Fl(e){let t=Pl(e),n=t.map((t,n)=>{let r=t!==e.gridWidthsPt[n];return!r&&e.gridWidthKeys?.[n]===null?null:!r&&e.gridWidthKeys?.[n]!==void 0?e.gridWidthKeys[n]:cl(t)??`0/1`});return Object.freeze({widthsPt:Object.freeze([...t]),widthKeys:Object.freeze(n)})}function Il(e){return Fl(e).widthsPt}function Ll(e,t){let n=(e.smallCaps?Math.max(e.fontSize-2,1):e.fontSize)*t;return e.vertAlign&&(n*=.65),n}const Rl=/[ᄀ-ᇿ⺀-⿟ -〿぀-ヿ㄰-㆏㐀-䶿一-鿿ꥠ-꥿가-퟿豈-﫿＀-￯]/u;function zl(e,t,n){let r=null,i=0;for(let n of t)n.pos>i&&(i=n.pos),n.pos>e&&(r===null||n.pos<r.pos)&&(r=n);let a=null;if(n>0){let t=Math.ceil((Math.max(e,i)+1e-6)/n)*n;t<=e&&(t+=n),a={pos:t,alignment:`left`}}return r&&a?r.pos<=a.pos?r:a:r??a}function Bl(e,t,n){return zl(e,t,n)}function Vl(e,t){let n=t===`vert`||t===`vert270`||t===`eaVert`||t===`mongolianVert`;return{type:`text`,text:e.text,bold:e.bold??!1,italic:e.italic??!1,underline:!1,strikethrough:!1,fontSize:e.fontSizePt,color:e.color??null,fontFamily:e.fontFamily??null,fontFamilyEastAsia:e.fontFamilyEastAsia??null,isLink:!1,background:null,vertAlign:null,hyperlink:null,ruby:e.ruby??void 0,textBoxLineFloor:!0,textBoxVertical:n}}function Hl(e,t={},n={}){if(!e)return`sans-serif`;let r=t[e];return r===`roman`?`serif`:r===`swiss`?`sans-serif`:r===`modern`&&n[e]===`fixed`?`monospace`:`sans-serif`}const Ul=Symbol(`docx.localMetricSnapshot`);function Wl(e={}){if(e[Ul])return e;let t=Object.entries(e).map(([e,t])=>{if(!t.family?.trim())throw TypeError(`Local metric ${e} requires a family`);if(t.lineHeightRatio!==void 0&&(!Number.isFinite(t.lineHeightRatio)||t.lineHeightRatio<0))throw RangeError(`Local metric ${e} lineHeightRatio must be finite and non-negative`);if(t.weight!==void 0&&(!Number.isFinite(t.weight)||t.weight<1||t.weight>1e3))throw RangeError(`Local metric ${e} weight must be finite and between 1 and 1000`);let n={family:t.family,...t.lineHeightRatio===void 0?{}:{lineHeightRatio:t.lineHeightRatio},...t.requestedFamily===void 0?{}:{requestedFamily:t.requestedFamily},...t.weight===void 0?{}:{weight:t.weight},...t.style===void 0?{}:{style:t.style},...t.sourceIdentity===void 0?{}:{sourceIdentity:t.sourceIdentity},...t.synthesized===void 0?{}:{synthesized:t.synthesized}};return[Nc(e),Object.freeze(n)]}).sort(([e],[t])=>e.localeCompare(t)),n=Object.fromEntries(t);return Object.defineProperty(n,Ul,{value:!0}),Object.freeze(n)}const Gl=new Set([161,164,167,168,170,173,175,176,177,178,179,180,182,183,184,185,186,188,189,190,191,215,247]),Kl=new Set([224,225,232,233,234,236,237,242,243,249,250,252]);function ql(e,t,n,r,i){let a=n===`eastAsia`,o=r?.split(/[-_]/,1)[0]?.toLowerCase()===`zh`,s=/^(?:86|88)$/i.test(i?.trim()??``),c=`highAnsi`;return e<=127?c=`ascii`:e<=255?c=a&&(Gl.has(e)||o&&Kl.has(e))?`eastAsia`:`highAnsi`:e>=256&&e<=687?c=a&&(o||s)?`eastAsia`:`highAnsi`:e>=688&&e<=767||e>=768&&e<=879||e>=880&&e<=975||e>=1024&&e<=1279?c=a?`eastAsia`:`highAnsi`:e>=1424&&e<=1983||e>=64285&&e<=65023||e>=65136&&e<=65278?c=`ascii`:e>=4352&&e<=4607||e>=11904&&e<=12031||e>=12032&&e<=12255||e>=12272&&e<=12687||e>=12688&&e<=12703||e>=12800&&e<=19903||e>=19968&&e<=40879||e>=40960&&e<=42127||e>=42128&&e<=42191||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65072&&e<=65103||e>=65104&&e<=65135||e>=65280&&e<=65519||e>=65536&&e<=1114111?c=`eastAsia`:e>=7680&&e<=7935?c=a&&o?`eastAsia`:`highAnsi`:(e>=8192&&e<=10175||e>=57344&&e<=63743||e>=64256&&e<=64284)&&(c=a?`eastAsia`:`highAnsi`),c===`eastAsia`&&a?c:t?`complexScript`:c}function Jl(e,t){return e.themeFontPresence?.[t]??e.themeFonts?.[t]!=null?e.themeFonts?.[t]:e.fonts[t]??(e.themeFontPresence?.ascii??e.themeFonts?.ascii!=null?e.themeFonts?.ascii:e.fonts.ascii)}function Yl(e){let t=Wl(e.localMetrics),n=Object.freeze(Object.fromEntries(Object.entries(e.genericFamilies??{}).map(([e,t])=>[e.trim().toLocaleLowerCase(`en-US`),t]).sort(([e],[t])=>e.localeCompare(t)))),r=Object.freeze(Object.fromEntries(Object.entries(e.eastAsiaFontCharsets??{}).map(([e,t])=>[e.trim().toLocaleLowerCase(`en-US`),t.trim()]).sort(([e],[t])=>e.localeCompare(t)))),i=Uc(`text`,{fonts:e.fonts.fingerprint,measurer:e.measurer.fingerprint,localMetrics:t,eastAsiaFontCharsets:r,genericFamilies:n}),a=t=>{let r=Jl(t,t.slot),i=r?n[r.trim().toLocaleLowerCase(`en-US`)]??t.genericFamily??`sans-serif`:t.genericFamily;return e.fonts.resolve({requestedFamily:r,genericFamily:i,weight:t.weight,style:t.style})},o=new Map,s=t=>{let n=JSON.stringify([t.text,t.fontRoute.familyList,t.fontRoute.scope,t.fontRoute.fingerprint,t.fontSizePt,t.weight,t.style,t.letterSpacingPt,t.kerning??null]),r=o.get(n);if(r)return r;let i=e.measurer.measure(t),a=Object.freeze({...i,...i.inkBounds?{inkBounds:Object.freeze({...i.inkBounds})}:{}});return o.set(n,a),a},c=t=>e.measurer.measure(t).advancePt,l=new Map;return Object.freeze({fingerprint:i,localMetrics:t,resolve:a,shape(e){if(!Number.isFinite(e.fontSizePt)||e.fontSizePt<0)throw RangeError(`fontSizePt must be a finite non-negative number`);let t=JSON.stringify([e.text,e.fontSizePt,[e.fonts.ascii??null,e.fonts.highAnsi??null,e.fonts.eastAsia??null,e.fonts.complexScript??null],[e.themeFonts?.ascii??null,e.themeFonts?.highAnsi??null,e.themeFonts?.eastAsia??null,e.themeFonts?.complexScript??null],[e.themeFontPresence?.ascii??null,e.themeFontPresence?.highAnsi??null,e.themeFontPresence?.eastAsia??null,e.themeFontPresence?.complexScript??null],e.weight??null,e.style??null,e.complexScript??null,e.fontHint??null,e.eastAsiaLanguage??null,e.eastAsiaFontCharset??null,e.genericFamily??null,e.letterSpacingPt??null,e.kerning??null,e.measure??null,e.clusterGeometry??null]),n=l.get(t);if(n)return n;let i=[],o=Object.freeze([...new Set([0,...$o(e.text),e.text.length])].sort((e,t)=>e-t)),u=new Set(o),d=0;for(let t of e.text){let n=d+t.length,a=Jl(e,`eastAsia`),o=e.eastAsiaFontCharset??(a?r[a.trim().toLocaleLowerCase(`en-US`)]:void 0),s=ql(t.codePointAt(0)??0,e.complexScript??!1,e.fontHint,e.eastAsiaLanguage,o),c=i.at(-1);c?.script===s?(c.text+=t,c.end=n):i.push({text:t,start:d,end:n,script:s,breakBefore:u.has(d)}),d=n}let f=i.map(t=>{let n=a({fonts:e.fonts,themeFonts:e.themeFonts,themeFontPresence:e.themeFontPresence,slot:t.script,weight:e.weight,style:e.style,genericFamily:e.genericFamily}),r=e.measure===!1?{advancePt:0,ascentPt:0,descentPt:0}:s({text:t.text,fontRoute:n.route,fontSizePt:e.fontSizePt,weight:n.weight,style:n.style,letterSpacingPt:e.letterSpacingPt??0,kerning:e.kerning});return Object.freeze({...t,...r,font:n,fontRoute:n.route})}),p=f.flatMap(e=>e.font.diagnostics),m=f.length>0&&f.every(e=>e.inkBounds!==void 0)?(()=>{let e=0,t=1/0,n=-1/0,r=0,i=0;for(let a of f){let o=a.inkBounds;t=Math.min(t,e+o.xMinPt),n=Math.max(n,e+o.xMaxPt),r=Math.max(r,o.ascentPt),i=Math.max(i,o.descentPt),e+=a.advancePt}return Object.freeze({xMinPt:t,xMaxPt:n,ascentPt:r,descentPt:i})})():void 0,h=f.reduce((e,t)=>e+t.advancePt,0),g=e.clusterGeometry===!1?void 0:(()=>{let t=new Map([[0,0],[e.text.length,h]]),n=n=>{if(e.measure===!1||n<=0)return 0;let r=t.get(n);if(r!==void 0)return r;let i=0;for(let t of f){if(n>=t.end){i+=t.advancePt;continue}if(n<=t.start)break;i+=c({text:t.text.slice(0,n-t.start),fontRoute:t.fontRoute,fontSizePt:e.fontSizePt,weight:t.font.weight,style:t.font.style,letterSpacingPt:e.letterSpacingPt??0,kerning:e.kerning});break}return t.set(n,i),i};return Object.freeze(o.slice(0,-1).map((e,t)=>{let r=o[t+1]??e,i=n(e);return Object.freeze({range:Object.freeze({start:e,end:r}),offsetPt:i,advancePt:n(r)-i})}))})(),_=Object.freeze({advancePt:h,ascentPt:Math.max(0,...f.map(e=>e.ascentPt)),descentPt:Math.max(0,...f.map(e=>e.descentPt)),...m?{inkBounds:m}:{},...m&&f.every(e=>e.horizontalInkBoundsAreTight===!0)?{horizontalInkBoundsAreTight:!0}:{},spans:Object.freeze(f),graphemeBoundaries:o,...g?{clusters:g}:{},diagnostics:Object.freeze(p)});return l.set(t,_),_}})}function Xl(e,t){let n=[];for(let r=0;r<e.length;){let i=e[r];if(i.fitTextValTwips===void 0){r+=1;continue}let a=r+1;if(i.fitTextId!==void 0)for(;a<e.length&&e[a].fitTextValTwips!==void 0&&e[a].fitTextId===i.fitTextId;)a+=1;let o=0,s=0;for(let t=r;t<a;t+=1){let n=e[t];o+=n.naturalWidthPx*(n.charScale??1),s+=n.charCount}let c=i.fitTextValTwips/20*t,l=s>1?(c-o)/(s-1):0,u=c-o-Math.max(0,s-1)*l;n.push({start:r,end:a,targetPx:c,naturalPx:o,charCount:s,perGapPx:l,trailingPadPx:u}),r=a}return n}function Zl(e){return e<0n?-e:e}function Ql(e,t){let n=Zl(e),r=Zl(t);for(;r!==0n;){let e=n%r;n=r,r=e}return n}function $l(e,t){if(t===0n)throw Error(`Exact rational denominator must be nonzero`);if(e===0n)return Object.freeze({numerator:0n,denominator:1n});let n=t<0n?-1n:1n,r=Ql(e,t);return Object.freeze({numerator:n*e/r,denominator:n*t/r})}function J(e,t){let n=e.numerator*t.denominator-t.numerator*e.denominator;return n<0n?-1:+(n>0n)}function eu(e,t){return $l(e.numerator*t.denominator-t.numerator*e.denominator,e.denominator*t.denominator)}function tu(e,t){return $l(e.numerator*t.denominator+t.numerator*e.denominator,2n*e.denominator*t.denominator)}function nu(e){return`${e.numerator}/${e.denominator}`}const ru=new DataView(new ArrayBuffer(8));function iu(e){if(!Number.isFinite(e))throw Error(`Exact geometry requires a finite binary64 value`);if(e===0)return Object.freeze({coefficient:0n,exponent:0});ru.setFloat64(0,e,!1);let t=ru.getBigUint64(0,!1),n=t>>63n!=0n,r=Number(t>>52n&2047n),i=t&(1n<<52n)-1n,a=r===0?i:1n<<52n|i,o=r===0?-1074:r-1023-52;for(;(a&1n)==0n;)a>>=1n,o+=1;return Object.freeze({coefficient:n?-a:a,exponent:o})}function au(e){return e===0n?0:e.toString(2).length}function ou(e,t,n){let r=n>=0?e:e<<BigInt(-n),i=n>=0?t<<BigInt(n):t;return r<i?-1:+(r>i)}function su(e,t,n){let r=n>=0?e<<BigInt(n):e,i=n>=0?t:t<<BigInt(-n),a=r/i,o=r%i*2n;return(o>i||o===i&&(a&1n)!=0n)&&(a+=1n),a}function cu(e){return ru.setBigUint64(0,e,!1),ru.getFloat64(0,!1)}function lu(e){if(e.numerator===0n)return 0;let t=e.numerator<0n,n=Zl(e.numerator),r=e.denominator,i=au(n)-au(r);ou(n,r,i)<0&&--i;let a=t?1n<<63n:0n;if(i<-1022){let e=su(n,r,1074);return cu(e===0n?a:e>=1n<<52n?a|1n<<52n:a|e)}let o=su(n,r,52-i);if(o===1n<<53n&&(o>>=1n,i+=1),i>1023)return t?-1/0:1/0;let s=BigInt(i+1023)<<52n,c=o-(1n<<52n);return cu(a|s|c)}function uu(e){if(e===1/0)return e;if(Object.is(e,-0)||e===0)return Number.MIN_VALUE;ru.setFloat64(0,e,!1);let t=ru.getBigUint64(0,!1);return cu(e>0?t+1n:t-1n)}function du(e){let t=lu(e);if(t===1/0)return t;if(t===-1/0)return-Number.MAX_VALUE;let n=iu(t);return J(n.exponent>=0?{numerator:n.coefficient<<BigInt(n.exponent),denominator:1n}:{numerator:n.coefficient,denominator:1n<<BigInt(-n.exponent)},e)>=0?t:uu(t)}function fu(e){return-du({numerator:-e.numerator,denominator:e.denominator})}function pu(e){if(!e.points||e.points.length<3||e.points.some(e=>!Number.isFinite(e.xPt)||!Number.isFinite(e.yPt)))throw Error(`Invalid ${e.kind} wrapPolygon for ${e.imageKey}`);if(![e.xLeftPt,e.xRightPt,e.yTopPt,e.yBottomPt].every(Number.isFinite)||e.xRightPt<e.xLeftPt||e.yBottomPt<e.yTopPt)throw Error(`Invalid finite wrap bounds for ${e.imageKey}`)}const mu=new WeakMap;function hu(e,t){return e.x===t.x&&e.y===t.y}function gu(e,t,n,r){return e*r-t*n}function _u(e,t){return t>0n?e>=0n&&e<=t:e<=0n&&e>=t}function vu(e,t){let n=hu(e.from,t.from)||hu(e.from,t.to)?e.from:hu(e.to,t.from)||hu(e.to,t.to)?e.to:null;if(n)return Object.freeze({y:$l(n.y,1n),contact:`shared-endpoint`});let r=e.to.x-e.from.x,i=e.to.y-e.from.y,a=t.to.x-t.from.x,o=t.to.y-t.from.y,s=gu(r,i,a,o);if(s===0n)return null;let c=t.from.x-e.from.x,l=t.from.y-e.from.y,u=gu(c,l,a,o),d=gu(c,l,r,i);return!_u(u,s)||!_u(d,s)?null:Object.freeze({y:$l(e.from.y*s+i*u,s),contact:i===0n||o===0n?`horizontal`:`active-crossing`})}function yu(e,t){return`${e}:${t}`}function bu(e,t,n){let r=new Set;for(let i of t){if(i<0||i>=Math.floor(e.length/2))continue;n();let t=e[i*2],a=e[i*2+1];r.add(yu(t,a))}return r}function xu(e){let t=e=>{if(e.length===0)return null;let n=e[Math.floor(e.length/2)].yTopPt,r=[],i=[],a=[];for(let t of e)t.yBottomPt<=n?r.push(t):t.yTopPt>n?i.push(t):a.push(t);return Object.freeze({centerYPt:n,crossingByTop:Object.freeze(a),crossingByBottom:Object.freeze(a.slice().sort((e,t)=>t.yBottomPt-e.yBottomPt)),below:t(r),above:t(i)})};return t(e.slice().sort((e,t)=>e.yTopPt-t.yTopPt||e.yBottomPt-t.yBottomPt))}function Su(e,t){return lu(t>=0?{numerator:e.numerator<<BigInt(t),denominator:e.denominator}:{numerator:e.numerator,denominator:e.denominator<<BigInt(-t)})}function Cu(e,t){return du(t>=0?{numerator:e.numerator<<BigInt(t),denominator:e.denominator}:{numerator:e.numerator,denominator:e.denominator<<BigInt(-t)})}function wu(e,t){let n=iu(e),r=n.exponent-t;return r>=0?{numerator:n.coefficient<<BigInt(r),denominator:1n}:{numerator:n.coefficient,denominator:1n<<BigInt(-r)}}function Tu(e,t,n){let r=e.dx*n.numerator-e.c*n.denominator,i=t.dx*n.numerator-t.c*n.denominator,a=r*t.dy-i*e.dy;return a<0n?-1:+(a>0n)}function Eu(e){let t=e=>{if(e.length===0)return null;let n=e[Math.floor(e.length/2)].yTop,r=[],i=[],a=[];for(let t of e)J(t.yBottom,n)<=0?r.push(t):J(t.yTop,n)>0?i.push(t):a.push(t);return Object.freeze({centerY:n,crossingByTop:Object.freeze(a),crossingByBottom:Object.freeze(a.slice().sort((e,t)=>J(t.yBottom,e.yBottom))),below:t(r),above:t(i)})};return t(e.slice().sort((e,t)=>J(e.yTop,t.yTop)||J(e.yBottom,t.yBottom)))}function Du(e,t,n,r){if(!(!e||J(n,t)<=0)){if(J(n,e.centerY)<=0){for(let t of e.crossingByTop){if(J(t.yTop,n)>=0)break;r.push(t)}Du(e.below,t,n,r);return}if(J(t,e.centerY)>=0){for(let n of e.crossingByBottom){if(J(n.yBottom,t)<=0)break;r.push(n)}Du(e.above,t,n,r);return}r.push(...e.crossingByTop),Du(e.below,t,n,r),Du(e.above,t,n,r)}}function Ou(e,t,n,r,i){let a=new Map,o=new Map;t.forEach((e,t)=>{if(e.minY===e.maxY)return;let n=nu($l(e.minY,1n)),r=nu($l(e.maxY,1n)),i=a.get(n);i?i.push(t):a.set(n,[t]);let s=o.get(r);s?s.push(t):o.set(r,[t])});let s=new Map;for(let e of i){if(e.contact!==`active-crossing`)continue;let t=nu(e.y),n=s.get(t);n||s.set(t,n=new Set),n.add(e.leftEdge),n.add(e.rightEdge)}let c=[],l=new Set,u=new Map,d=[],f=[],p=0,m=0,h=(t,n,i)=>{for(let a of t){if(n.has(a))continue;let t=u.get(a);if(t&&J(i,t.yTop)>0){let n=Object.freeze({yTop:t.yTop,yBottom:i,leftEdge:t.leftEdge,rightEdge:t.rightEdge});d.push(n);let a=Su(t.yTop,r),o=Su(i,r);o>a&&f.push(Object.freeze({yTopPt:a,yBottomPt:o,left:e[t.leftEdge],right:e[t.rightEdge]}))}u.delete(a)}for(let e of n){if(t.has(e))continue;let n=e.indexOf(`:`);u.set(e,{leftEdge:Number(e.slice(0,n)),rightEdge:Number(e.slice(n+1)),yTop:i})}},g=new Map,_=(e,t)=>{e.add(Math.floor((t-1)/2)),e.add(Math.floor(t/2)),e.add(Math.floor((t+1)/2))},v=e=>bu(c,e,()=>{m+=2}),y=()=>{let e=new Set;for(let t=0;t+1<c.length;t+=2)m+=2,e.add(yu(c[t],c[t+1]));return e};for(let e=0;e<n.length;e+=1){let r=n[e],i=n[e+1],u=i?tu(r,i):r,d=(e,n)=>(p+=1,Tu(t[e],t[n],u)||e-n),f=e=>{let t=0,n=c.length;for(;t<n;){let r=t+n>>>1;d(c[r],e)<=0?t=r+1:n=r}c.splice(t,0,e);for(let e=t;e<c.length;e+=1)g.set(c[e],e)},m=e=>{let t=g.get(e);if(t!==void 0){c.splice(t,1),g.delete(e);for(let e=t;e<c.length;e+=1)g.set(c[e],e)}},b=e=>{let n=[...e].filter(e=>g.has(e)&&J($l(t[e].minY,1n),r)<=0&&J(r,$l(t[e].maxY,1n))<0),i=n.map(e=>g.get(e)).sort((e,t)=>e-t);n.sort(d);for(let e=0;e<i.length;e+=1){let t=i[e],r=n[e];c[t]=r,g.set(r,t)}},x=nu(r),S=o.get(x)??[],C=a.get(x)??[],w=s.get(x)??l;if(S.length===0&&C.length===0&&(w.size===0||i===void 0))continue;let T=S.length>0||C.length>0,E=new Set;if(!T)for(let e of w){let t=g.get(e);t!==void 0&&_(E,t)}let D=T?y():v(E);for(let e of S)m(e);for(let e of C)f(e);if(w.size>0&&i!==void 0&&b(w),c.length%2!=0)throw Error(`Compiled wrapPolygon produced an odd open-slab crossing count`);if(T)h(D,y(),r);else{let e=new Set;for(let t of w){let n=g.get(t);n!==void 0&&_(e,n)}h(D,v(e),r)}}return Object.freeze({spans:Object.freeze(f),exactSpans:Object.freeze(d),orderComparisonCount:p,pairMembershipVisitCount:m})}function ku(e){pu(e);let t=e.points,n=Object.freeze(t.map(e=>Object.freeze({...e}))),r=[...n.flatMap(e=>[e.xPt,e.yPt]),e.xLeftPt,e.xRightPt,e.yTopPt,e.yBottomPt].map(iu).filter(({coefficient:e})=>e!==0n),i=r.length===0?0:Math.min(...r.map(({exponent:e})=>e)),a=e=>{let t=iu(e);return t.coefficient===0n?0n:t.coefficient<<BigInt(t.exponent-i)},o=n.map(e=>Object.freeze({x:a(e.xPt),y:a(e.yPt)})),s=n.map((e,t)=>{let r=n[(t+1)%n.length],i=r.yPt-e.yPt,a=i===0?0:(r.xPt-e.xPt)/i;return Object.freeze({from:e,to:r,minYPt:Math.min(e.yPt,r.yPt),maxYPt:Math.max(e.yPt,r.yPt),slopeXPerY:a,interceptX:i===0?e.xPt:e.xPt-a*e.yPt})}),c=o.map((e,t)=>{let n=o[(t+1)%o.length],r=e.y<=n.y?e:n,i=e.y<=n.y?n:e,a=i.x-r.x,s=i.y-r.y;return Object.freeze({index:t,from:e,to:n,minY:r.y,maxY:i.y,dx:a,dy:s,c:a*r.y-s*r.x})}),l=[];for(let e=0;e<c.length;e+=1)for(let t=e+1;t<c.length;t+=1){let n=vu(c[e],c[t]);n&&l.push(Object.freeze({y:n.y,contact:n.contact,leftEdge:e,rightEdge:t}))}let u=1/0,d=-1/0,f=1/0,p=-1/0;for(let e of n)u=Math.min(u,e.xPt),d=Math.max(d,e.xPt),f=Math.min(f,e.yPt),p=Math.max(p,e.yPt);let m=new Map;for(let e of o){let t=$l(e.y,1n);m.set(nu(t),t)}for(let e of l)m.set(nu(e.y),e.y);let h=Object.freeze([...m.values()].sort(J)),g=Object.freeze([...new Set(h.map(e=>Su(e,i)))].sort((e,t)=>e-t)),_=Ou(s,c,h,i,l),v=$l(o.reduce((e,t)=>t.x<e?t.x:e,o[0].x),1n),y=$l(o.reduce((e,t)=>t.x>e?t.x:e,o[0].x),1n),b=$l(o.reduce((e,t)=>t.y<e?t.y:e,o[0].y),1n),x=$l(o.reduce((e,t)=>t.y>e?t.y:e,o[0].y),1n),S=$l(0n,1n),C=(e,t)=>{let n=eu(e,t);return J(n,S)>0?n:S},w=Object.freeze({scaleExponent:i,edges:Object.freeze(c),eventYs:h,spans:_.exactSpans,spanIndex:Eu(_.exactSpans),polygonLeft:v,polygonRight:y,polygonTop:b,polygonBottom:x,padLeft:C(v,$l(a(e.xLeftPt),1n)),padRight:C($l(a(e.xRightPt),1n),y),padTop:C(b,$l(a(e.yTopPt),1n)),padBottom:C($l(a(e.yBottomPt),1n),x)}),T=Object.freeze({kind:e.kind,edges:Object.freeze(s),eventYPts:g,contourSpans:_.spans,contourSpanIndex:xu(_.spans),intersectionCount:l.length,compileOrderComparisonCount:_.orderComparisonCount,compilePairMembershipVisitCount:_.pairMembershipVisitCount,polygonLeftPt:u,polygonRightPt:d,polygonTopPt:f,polygonBottomPt:p,padLeftPt:Math.max(0,u-e.xLeftPt),padRightPt:Math.max(0,e.xRightPt-d),padTopPt:Math.max(0,f-e.yTopPt),padBottomPt:Math.max(0,e.yBottomPt-p)});return mu.set(T,w),T}function Au(e,t){return{numerator:e.dx*t.numerator-e.c*t.denominator,denominator:e.dy*t.denominator}}function ju(e,t){return e.dx*t.dy===t.dx*e.dy&&e.c*t.dy===t.c*e.dy}function Mu(e){let t=e.filter(e=>J(e.r,e.l)>0).slice().sort((e,t)=>J(e.l,t.l)||J(e.r,t.r)),n=[];for(let e of t){let t=n.at(-1);!t||J(e.l,t.r)>0?n.push({...e}):J(e.r,t.r)>0&&(n[n.length-1]={l:t.l,r:e.r})}return n}function Nu(e,t){return{numerator:e.numerator*t.denominator+t.numerator*e.denominator,denominator:e.denominator*t.denominator}}function Pu(e,t){return{numerator:e.numerator*t.denominator-t.numerator*e.denominator,denominator:e.denominator*t.denominator}}function Fu(e,t,n){let r=mu.get(e);if(!r)throw Error(`Compiled polygon omitted its exact geometry authority`);let i=Pu(t,r.padBottom),a=Nu(n,r.padTop),o=J(r.polygonTop,i)>=0?r.polygonTop:i,s=J(r.polygonBottom,a)<=0?r.polygonBottom:a;if(J(s,o)<=0)return[];let c=[],l=[];Du(r.spanIndex,o,s,l);for(let e of l){let t=J(o,e.yTop)>=0?o:e.yTop,n=J(s,e.yBottom)<=0?s:e.yBottom;if(J(n,t)<=0)continue;let i=r.edges[e.leftEdge],a=r.edges[e.rightEdge];if(ju(i,a))continue;let l=Au(i,t),u=Au(i,n),d=Au(a,t),f=Au(a,n);c.push({l:Pu(J(l,u)<=0?l:u,r.padLeft),r:Nu(J(d,f)>=0?d:f,r.padRight)})}let u=Mu(c);return e.kind===`through`||u.length===0?u:[{l:u[0].l,r:u.at(-1).r}]}function Iu(e,t,n){let r=mu.get(e);if(!r)throw Error(`Compiled polygon omitted its exact geometry authority`);let i=wu(t,r.scaleExponent),a=Nu(i,wu(n,r.scaleExponent)),o=e=>r.scaleExponent>=0?{numerator:e.numerator<<BigInt(r.scaleExponent),denominator:e.denominator}:{numerator:e.numerator,denominator:e.denominator<<BigInt(-r.scaleExponent)};return Object.freeze(Fu(e,i,a).map(e=>Object.freeze({l:o(e.l),r:o(e.r)})))}function Lu(e,t){let n=mu.get(e);if(!n)throw Error(`Compiled polygon omitted its exact geometry authority`);let r=wu(t,n.scaleExponent),i=new Set;for(let e of n.eventYs)i.add(Cu(Nu(e,n.padBottom),n.scaleExponent)),i.add(Cu(Pu(Pu(e,r),n.padTop),n.scaleExponent));return Object.freeze([...i].filter(Number.isFinite).sort((e,t)=>e-t))}function Ru(e,t,n,r){let i=mu.get(e);if(!i)throw Error(`Compiled polygon omitted its exact geometry authority`);let a=tu(wu(n,i.scaleExponent),wu(r,i.scaleExponent)),o=wu(t,i.scaleExponent),s=Pu(a,i.padBottom),c=Nu(o,i.padTop),l=Nu(a,c),u=J(i.polygonTop,s)>=0?i.polygonTop:s,d=J(i.polygonBottom,l)<=0?i.polygonBottom:l,f=[],p=[];Du(i.spanIndex,u,d,p);for(let e of p){let t=J(u,e.yTop)>=0?u:e.yTop;if(J(J(d,e.yBottom)<=0?d:e.yBottom,t)<=0)continue;let n=i.edges[e.leftEdge],r=i.edges[e.rightEdge];if(ju(n,r))continue;let a=J(s,e.yTop)>0,o=J(l,e.yBottom)<0,p=(e,t,n,r)=>{let a=t?n:r,o={numerator:e.dx*a.numerator-e.c*a.denominator,denominator:e.dy*a.denominator};return{slope:t?{numerator:e.dx,denominator:e.dy}:{numerator:0n,denominator:1n},intercept:i.scaleExponent>=0?{numerator:o.numerator<<BigInt(i.scaleExponent),denominator:o.denominator}:{numerator:o.numerator,denominator:o.denominator<<BigInt(-i.scaleExponent)}}},m=p(n,a,{numerator:-i.padBottom.numerator,denominator:i.padBottom.denominator},e.yTop),h=p(n,o,c,e.yBottom),g=p(r,a,{numerator:-i.padBottom.numerator,denominator:i.padBottom.denominator},e.yTop),_=p(r,o,c,e.yBottom),v=n.dx>=0n?m:h,y=r.dx>=0n?_:g,b=Object.freeze({left:Object.freeze({slope:v.slope,intercept:Pu(v.intercept,i.scaleExponent>=0?{numerator:i.padLeft.numerator<<BigInt(i.scaleExponent),denominator:i.padLeft.denominator}:{numerator:i.padLeft.numerator,denominator:i.padLeft.denominator<<BigInt(-i.scaleExponent)})}),right:Object.freeze({slope:y.slope,intercept:Nu(y.intercept,i.scaleExponent>=0?{numerator:i.padRight.numerator<<BigInt(i.scaleExponent),denominator:i.padRight.denominator}:{numerator:i.padRight.numerator,denominator:i.padRight.denominator<<BigInt(-i.scaleExponent)})})});f.push(b)}return Object.freeze(f)}function zu(e,t,n){return e.left<t.right-n&&e.right>t.left+n&&e.top<t.bottom-n&&e.bottom>t.top+n}function Bu(e,t,n){let r=e.right-e.left,i=e.bottom-e.top;if(r<0||i<0)throw RangeError(`Overlap rectangle has negative extent`);let a=e.left,o=e.top;for(let e=0;e<=t.length;e+=1){let s={left:a,right:a+r,top:o,bottom:o+i},c=t.map(e=>({left:e.left,right:e.right,top:e.top,bottom:e.bottom})).filter(e=>zu(s,e,n.overlapEpsilon));if(c.length===0)return Object.freeze({left:a,top:o});if(e===t.length)throw Error(`Axis-aligned overlap resolution did not converge`);let l=Math.max(...c.map(e=>e.right));if(l+r<=n.rightBoundary+n.rightBoundarySlack){a=l;continue}o=Math.max(...c.map(e=>e.bottom))}throw Error(`Axis-aligned overlap resolution did not converge`)}function Vu(e,t){if(e.trim()===``)throw Error(`CompatibilityRule.${t} must not be empty`)}function Y(e){if(Vu(e.id,`id`),Vu(e.description,`description`),!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e.id))throw Error(`CompatibilityRule.id must be a stable kebab-case identifier`);if(e.evidence.kind===`microsoft-note`){if(Vu(e.evidence.reference,`evidence.reference`),!/^\\[MS-[A-Z0-9]+\\] §§?\\d/.test(e.evidence.reference))throw Error(`CompatibilityRule.evidence.reference must identify a Microsoft specification section`)}else if(e.evidence.kind===`regression-test`){if(Vu(e.evidence.reference,`evidence.reference`),!/^packages\\/docx\\/src\\/.+\\.(?:test|spec)\\.tsx?#[^#]+$/.test(e.evidence.reference))throw Error(`CompatibilityRule.evidence.reference must use DOCX path#test-title`)}else if(Vu(e.evidence.syntheticFixtureId,`evidence.syntheticFixtureId`),Vu(e.evidence.application,`evidence.application`),Vu(e.evidence.version,`evidence.version`),Vu(e.evidence.platform,`evidence.platform`),!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e.evidence.syntheticFixtureId))throw Error(`CompatibilityRule.evidence.syntheticFixtureId must be kebab-case`);return Object.freeze(e.evidence),Object.freeze(e)}Y({id:`word-section-btlr-tbrl-page-frame`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/coordinate-space.test.ts#maps Transitional text direction %s to %s`},description:`Issue #988 comment 4950296007 records that, unlike the normative ECMA-376 Part 4 §14.11.7 equivalence to lr, Word uses the tbRl page frame for section-level btLr; this rule covers only the page frame, while glyph orientation is paint-owned.`}),Y({id:`word-square-line-start-one-inch`,evidence:{kind:`regression-test`,reference:`packages/docx/src/float-line-start-one-inch.test.ts#(e) the boundary is identical across scales (absolute pt width)`},description:`Issue #676 records that Word starts a content line beside a square-wrapped object only when the free side gap is at least one inch; tight and through polygon openings and empty paragraph marks are outside this rule.`});const Hu=Y({id:`word-float-different-paragraph-displacement`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/floats.test.ts#keeps observed different-paragraph displacement on exclusion bounds`},description:`Preserve the established Word-compatible policy that an overlap-permitted float is displaced by exclusion geometry from floats anchored in other paragraphs, while same-paragraph floats may overlap.`}),Uu=Y({id:`word-page-anchored-table-collision-deferral`,evidence:{kind:`regression-test`,reference:`packages/docx/src/float-table-page-fit.test.ts#(g) DEFERS a page-anchored floating table when its raw band intersects an existing table float`},description:`Preserve the established Word-compatible pagination behavior that defers an absolute page- or margin-anchored floating table when its authored object band intersects an existing floating-table text-exclusion band on the page.`});Y({id:`word-empty-mark-float-side-gap`,evidence:{kind:`regression-test`,reference:`packages/docx/src/float-line-start-one-inch.test.ts#keeps an anchor-host metric-only line on the paragraph-mark threshold`},description:`An empty or anchor-only paragraph-mark line may start beside a square-wrapped object when the available side gap can hold the paragraph mark em; the one-inch content-line threshold does not apply.`});function Wu(e){return 71.95*e}function Gu(e,t){return e*t}const Ku=.01,qu=.5;function Ju(e,t){return Object.freeze(e===`overlap`?{kind:`word-different-paragraph`,paragraphId:t}:{kind:`none`})}function Yu(e,t){return Object.freeze(e?{kind:`word-different-paragraph`,paragraphId:t}:{kind:`drawingml-normative`})}function Xu(e){let t={occurrenceId:e.occurrenceId,paragraphId:e.paragraphId,bounds:e.bounds,exclusionBounds:e.exclusionBounds};return e.kind===`table`?{...t,kind:`table`,tableOverlap:e.overlap}:{...t,kind:e.kind===`shape`?`drawingml`:`frame`}}function Zu(e,t){let n=e.imageX,r=e.imageY,i=e.imageW,a=e.imageH,o=e.xLeft,s=e.xRight,c=e.yTop,l=e.yBottom,u={occurrenceId:e.anchorOccurrenceId??e.acquisitionOccurrenceId??`display-float:${t}`,paragraphId:e.paraId,bounds:{xPt:n,yPt:r,widthPt:i,heightPt:a},exclusionBounds:{xPt:o,yPt:c,widthPt:s-o,heightPt:l-c}};return e.kind===`table`?{...u,kind:`table`,tableOverlap:e.tableOverlap}:{...u,kind:e.kind===`shape`?`drawingml`:`frame`}}function Qu(e){let t=e.xPt,n=e.yPt,r=e.widthPt,i=e.heightPt;return{left:t,right:t+r,top:n,bottom:n+i}}function $u(e,t,n){return t===0&&n===0?e:Object.freeze({xPt:e.xPt+t,yPt:e.yPt+n,widthPt:e.widthPt,heightPt:e.heightPt})}function ed(e,t,n,r){return Object.freeze({bounds:$u(e.bounds,t,n),exclusionBounds:$u(e.exclusionBounds,t,n),displacement:Object.freeze({xPt:t,yPt:n}),appliedCompatibilityRuleIds:Object.freeze([...r])})}function td(e,t){let n=e.bounds.xPt-e.exclusionBounds.xPt,r=e.bounds.yPt-e.exclusionBounds.yPt,i=e.exclusionBounds.xPt+e.exclusionBounds.widthPt-e.bounds.xPt-e.bounds.widthPt,a=e.exclusionBounds.yPt+e.exclusionBounds.heightPt-e.bounds.yPt-e.bounds.heightPt,o=Qu(t.exclusionBounds);return{left:o.left-i,right:o.right+n,top:o.top-a,bottom:o.bottom+r}}function nd(e,t,n=e.rightBoundaryPt){let r=Qu(e.moving.bounds);return t.length===0?Object.freeze({left:r.left,top:r.top}):Bu(r,t,{overlapEpsilon:e.overlapEpsilonPt??0,rightBoundary:n,rightBoundarySlack:e.rightBoundarySlackPt??0})}function rd(e){let{moving:t,avoidance:n}=e,r=e.blockers.flatMap(e=>t.kind===`table`&&e.kind===`table`&&(t.tableOverlap===`never`||e.tableOverlap===`never`)||n.kind===`drawingml-normative`&&e.kind===`drawingml`?[Qu(e.bounds)]:[]),i=n.kind===`word-different-paragraph`?e.blockers.flatMap(e=>e.paragraphId===n.paragraphId?[]:[td(t,e)]):[],a=t.exclusionBounds.xPt+t.exclusionBounds.widthPt-t.bounds.xPt-t.bounds.widthPt,o=n.kind===`word-different-paragraph`?e.rightBoundaryPt-a:e.rightBoundaryPt,s=nd(e,r,o),c=i.length===0?s:nd(e,[...r,...i],o);return ed(t,c.left-t.bounds.xPt,c.top-t.bounds.yPt,c.left!==s.left||c.top!==s.top?[Hu.id]:[])}function id(e){if(e.inlineEndPt<e.inlineStartPt||e.blockExtentPt<0)throw RangeError(`Block-flow admission received a negative extent`);let t=e.blockers.filter(t=>{let n=t.exclusionBounds;return t.kind===`table`&&e.inlineEndPt-n.xPt>e.overlapEpsilonPt&&n.xPt+n.widthPt-e.inlineStartPt>e.overlapEpsilonPt}),n=e.blockStartPt;for(let r=0;r<=t.length;r+=1){let i=t.filter(t=>{let r=t.exclusionBounds;return n+e.blockExtentPt-r.yPt>e.overlapEpsilonPt&&r.yPt+r.heightPt-n>e.overlapEpsilonPt});if(i.length===0)return Object.freeze({blockStartPt:n});if(r===t.length)throw Error(`Block-flow float admission did not converge`);n=Math.max(...i.map(e=>e.exclusionBounds.yPt+e.exclusionBounds.heightPt))}throw Error(`Block-flow float admission did not converge`)}function ad(e){let t=Qu(e.bounds),n=e.blockers.some(n=>n.kind===`table`&&zu(t,Qu(n.exclusionBounds),e.overlapEpsilonPt));return Object.freeze({defer:n,appliedCompatibilityRuleIds:Object.freeze(n?[Uu.id]:[])})}function X(e){let t=iu(e);return t.exponent>=0?{numerator:t.coefficient<<BigInt(t.exponent),denominator:1n}:{numerator:t.coefficient,denominator:1n<<BigInt(-t.exponent)}}function od(e,t){return{numerator:e.numerator*t.denominator+t.numerator*e.denominator,denominator:e.denominator*t.denominator}}function sd(e,t){return{numerator:e.numerator*t.denominator-t.numerator*e.denominator,denominator:e.denominator*t.denominator}}function cd(e,t){return{numerator:e.numerator*t.numerator,denominator:e.denominator*t.denominator}}function ld(e,t){let n=t.numerator<0n;return{numerator:(n?-e.numerator:e.numerator)*t.denominator,denominator:e.denominator*(n?-t.numerator:t.numerator)}}function ud(e,t){let n=X(e),r=X(t);return lu({numerator:n.numerator*r.denominator+r.numerator*n.denominator,denominator:2n*n.denominator*r.denominator})}function dd(e){switch(e){case`left`:case`right`:case`largest`:case`bothSides`:return e;default:return`bothSides`}}function fd(e){return e===`square`||e===`topAndBottom`||e===`tight`||e===`through`}function pd(e,t,n){return e.xRight>t+.01&&e.xLeft<n-.01}const md=new WeakMap,hd=new WeakMap;function gd(e){return Object.isFrozen(e)&&e.every(e=>Object.isFrozen(e))}function _d(e,t,n,r,i,a){return e.kind===t&&Object.is(e.xLeftPt,n)&&Object.is(e.xRightPt,r)&&Object.is(e.yTopPt,i)&&Object.is(e.yBottomPt,a)}function vd(e,t,n){let r=e.authoredWrap;if(r!==`tight`&&r!==`through`)throw Error(`Polygon compilation requires tight or through wrap`);let i={kind:r,imageKey:e.imageKey,points:e.wrapPolygon,xLeftPt:e.xLeft,xRightPt:e.xRight,yTopPt:e.yTop,yBottomPt:e.yBottom};pu(i);let a=gd(t);if(a){let i=hd.get(t)?.find(t=>_d(t,r,e.xLeft,e.xRight,e.yTop,e.yBottom));if(i)return n&&(n.polygonCacheHitCount+=1),i.compiled}n&&(n.polygonCompileCount+=1);let o=ku(i);if(a){let n=Object.freeze({kind:r,xLeftPt:e.xLeft,xRightPt:e.xRight,yTopPt:e.yTop,yBottomPt:e.yBottom,compiled:o});hd.set(t,Object.freeze([n,...(hd.get(t)??[]).slice(0,3)]))}return o}function yd(e,t){let n=e.map(e=>{let n=e.wrapPolygon;t&&n&&(t.polygonSnapshotPointCount+=n.length);let r=Object.freeze({...e,...n?{wrapPolygon:Object.freeze(n.map(e=>Object.freeze({...e})))}:{}}),i=r.authoredWrap===`tight`||r.authoredWrap===`through`?vd(r,n??[],t):null;return Object.freeze({rect:r,polygon:i,wrapMaximumLeftPt:i?Math.min(r.xLeft,i.polygonLeftPt):r.xLeft,wrapMaximumRightPt:i?Math.max(r.xRight,i.polygonRightPt):r.xRight})}),r=Object.freeze({floats:Object.freeze(n)});return md.set(r,new Map),r}function bd(e,t){let n=dd(e.rect.side);if(n!==`largest`)return n;let r=J(sd(X(e.wrapMaximumLeftPt),X(t.xLeftPt)),sd(X(t.xRightPt),X(e.wrapMaximumRightPt)));return r===0?t.readingDirection===`ltr`?`left`:`right`:r>0?`left`:`right`}function xd(e,t,n,r,i,a){let{rect:o,polygon:s}=e,c=s?Iu(s,t,n):[{l:X(o.xLeft),r:X(o.xRight)}];if(c.length===0)return[];let l=s===null,u=c.reduce((e,t)=>J(t.l,e)<0?t.l:e,c[0].l),d=c.reduce((e,t)=>J(t.r,e)>0?t.r:e,c[0].r);switch(bd(e,a)){case`left`:return[{l:u,r:X(i),leftSquareBoundary:l,rightSquareBoundary:!1}];case`right`:return[{l:X(r),r:d,leftSquareBoundary:!1,rightSquareBoundary:l}];case`bothSides`:return c.map(e=>({...e,leftSquareBoundary:l,rightSquareBoundary:l}))}}function Sd(e,t){let n=md.get(t);if(!n)throw Error(`Prepared float geometry omitted its sweep cache`);let r=n.get(e);if(r)return r;let i=new Set,a=e=>{Number.isFinite(e)&&i.add(e)};for(let{rect:n,polygon:r}of t.floats)if(a(du(sd(X(n.yTop),X(e)))),a(n.yBottom),r)for(let t of Lu(r,e))a(t);let o=Object.freeze([...i].sort((e,t)=>e-t));return n.set(e,o),o}function Cd(e){let t=e.filter(e=>J(e.r,e.l)>0).slice().sort((e,t)=>J(e.l,t.l)||J(e.r,t.r)),n=[];for(let e of t){let t=n.at(-1);if(!t||J(e.l,t.r)>0){n.push({...e});continue}J(e.l,t.l)===0&&(t.leftSquareBoundary=t.leftSquareBoundary&&e.leftSquareBoundary);let r=J(e.r,t.r);r>0?(t.r=e.r,t.rightSquareBoundary=e.rightSquareBoundary):r===0&&(t.rightSquareBoundary=t.rightSquareBoundary&&e.rightSquareBoundary)}return n}function wd(e,t,n,r,i){let a=Cd(e),o=X(t),s=X(n),c=[],l=(e,t,n)=>{let r=J(o,e)>=0?o:e,i=J(s,t)<=0?s:t;J(i,r)>0&&c.push({l:r,r:i,squareConstrained:n})},u=o,d=!1;for(let e of a){if(J(e.r,o)<=0){d=e.rightSquareBoundary;continue}if(J(e.l,s)>=0){l(u,s,d),u=s;break}J(e.l,u)>0&&l(u,e.l,d||e.leftSquareBoundary);let t=J(e.r,u);if(t>0?(u=e.r,d=e.rightSquareBoundary):t===0&&(d&&=e.rightSquareBoundary),J(u,s)>=0)break}J(u,s)<0&&l(u,s,d);let f={numerator:0n,denominator:1n};for(let e of c){let t=sd(e.r,e.l);J(t,f)>0&&(f=t)}for(let e of c){let t=sd(e.r,e.l);if(J(t,f)===0&&J(t,X(Math.max(1,e.squareConstrained?i:r)))>=0)return{l:e.l,r:e.r,squareConstrained:e.squareConstrained}}return null}function Td(e,t,n,r,i,a,o,s,c,l,u){let d=X(e),f=od(d,X(t)),p=e=>X(e);if(a.floats.some(({rect:e})=>e.mode===`topAndBottom`&&pd(e,o,s)&&J(f,p(e.yTop))>0&&J(d,p(e.yBottom))<0))return null;let m=[];for(let i of a.floats){let{rect:a}=i;if(a.mode!==`square`||J(f,p(a.yTop))<=0||J(d,p(a.yBottom))>=0||!pd(a,n,r))continue;let o=xd(i,e,t,n,r,c);o.length!==0&&m.push(...o)}if(m.length===0)return{topY:e,xOffset:0,maxWidth:i};let h=wd(m,n,r,l,u);if(!h)return null;let g={numerator:0n,denominator:1n},_=sd(h.l,X(n)),v=J(_,g)>0?_:g,y=X(n),b=du(v),x=n+b,S=X(x);if(J(S,h.l)<0&&(b=du(sd(X(du(h.l)),y)),x=n+b,S=X(x)),J(S,h.l)<0)throw Error(`Exact float window could not represent a contained start`);let C=X(r),w=J(h.r,C)<=0?h.r:C,T=sd(X(fu(w)),S),E=fu(J(T,g)>0?T:g);if(J(X(x+E),w)>0)throw Error(`Exact float window could not represent a contained end`);return{topY:e,xOffset:b,maxWidth:E}}function Ed(e,t){return od(cd(e.exact.slope,X(t)),e.exact.intercept)}function Dd(e,t){return J(e.exact.slope,t.exact.slope)===0&&J(e.exact.intercept,t.exact.intercept)===0}function Od(e,t,n){return J(Ed(e,n),Ed(t,n))||J(e.exact.slope,t.exact.slope)}function kd(e,t,n){let r=sd(e.slope,t.slope);if(r.numerator===0n)return null;let i=sd(e.intercept,t.intercept);return ld(sd(X(n),i),r)}function Ad(e,t,n,r,i){t===null||J(t,X(n))<=0||J(t,X(r))>=0||(e.push(du(t)),i&&(i.localRootCandidateCount+=1))}function jd(e,t,n,r,i,a){let o=e[0];for(let r of e.slice(1)){let e=Od(r,o,n);(t===`min`&&e<0||t===`max`&&e>0)&&(o=r)}let s=o.square;for(let c of e)if(c!==o){if(Dd(c,o)){s&&=c.square;continue}(t===`min`?J(c.exact.slope,o.exact.slope)<0:J(c.exact.slope,o.exact.slope)>0)&&Ad(i,kd(c.exact,o.exact,0),n,r,a)}return{exact:o.exact,square:s}}function Md(e,t=!1){return{exact:{slope:{numerator:0n,denominator:1n},intercept:X(e)},square:t}}function Nd(e,t,n,r,i,a,o,s,c){let{rect:l,polygon:u}=e,d=X(ud(n,r));if(J(od(d,X(t)),X(l.yTop))<=0||J(d,X(l.yBottom))>=0)return[];let f=u?Ru(u,t,n,r).map(e=>({left:{exact:e.left,square:!1},right:{exact:e.right,square:!1}})):[{left:Md(l.xLeft,!0),right:Md(l.xRight,!0)}];if(f.length===0)return[];let p=jd(f.map(e=>e.left),`min`,n,r,s,c),m=jd(f.map(e=>e.right),`max`,n,r,s,c);switch(u?.kind===`tight`&&(f=[{left:p,right:m}]),bd(e,o)){case`left`:return[{left:p,right:Md(a)}];case`right`:return[{left:Md(i),right:m}];case`bothSides`:return f}}function Pd(e,t,n,r,i){let a=e.slice().sort((e,n)=>Od(e.left,n.left,t)||Od(e.right,n.right,t));for(let e=0;e+1<a.length;e+=1)Ad(r,kd(a[e].left.exact,a[e+1].left.exact,0),t,n,i);let o=[];for(let e of a){let a=o.at(-1);if(!a){o.push(e);continue}if(Ad(r,kd(e.left.exact,a.right.exact,0),t,n,i),Od(e.left,a.right,t)>0){o.push(e);continue}let s=jd([a.right,e.right],`max`,t,n,r,i),c=Dd(a.left,e.left)?{exact:a.left.exact,square:a.left.square&&e.left.square}:a.left;o[o.length-1]={left:c,right:s}}return o}function Fd(e,t,n,r,i,a,o,s,c,l,u,d){let f=X(ud(e,t)),p=od(f,X(n));if(a.floats.some(({rect:e})=>e.mode===`topAndBottom`&&pd(e,o,s)&&J(p,X(e.yTop))>0&&J(f,X(e.yBottom))<0))return null;let m=[],h=[];for(let o of a.floats){let{rect:a}=o;a.mode===`square`&&pd(a,r,i)&&h.push(...Nd(o,n,e,t,r,i,c,m,d))}if(h.length===0)return null;let g=Pd(h,e,t,m,d),_=Md(r),v=Md(i),y=[],b=(n,r,i)=>{let a={slope:sd(r.exact.slope,n.exact.slope),intercept:sd(r.exact.intercept,n.exact.intercept)};y.push({exactWidth:a});let o=Math.max(1,i?u:l);J(od(cd(a.slope,X(e)),a.intercept),X(o))<0&&a.slope.numerator>0n&&Ad(m,kd(r.exact,n.exact,o),e,t,d)},x=_;for(let e of g)b(x,e.left,x.square||e.left.square),x=e.right;b(x,v,x.square);let S=y[0];for(let t of y.slice(1))(J(od(cd(t.exactWidth.slope,X(e)),t.exactWidth.intercept),od(cd(S.exactWidth.slope,X(e)),S.exactWidth.intercept))||J(t.exactWidth.slope,S.exactWidth.slope))>0&&(S=t);if(S)for(let n of y)n===S||J(n.exactWidth.slope,S.exactWidth.slope)<=0||Ad(m,kd(n.exactWidth,S.exactWidth,0),e,t,d);return m.length===0?null:Math.min(...m)}function Id(e,t,n,r,i,a,o=r,s=r+i,c={xLeftPt:r,xRightPt:r+i,readingDirection:`ltr`},l=t,u=null){let d=r,f=r+i,p=Sd(n,a);if(u){u.structuralEventCount=p.length;for(let{polygon:e}of a.floats)e&&(u.compiledIntersectionCount+=e.intersectionCount,u.compiledContourSpanCount+=e.contourSpans.length,u.compileOrderComparisonCount+=e.compileOrderComparisonCount,u.compilePairMembershipVisitCount+=e.compilePairMembershipVisitCount)}let m=e=>(u&&(u.evaluatedYCount+=1),Td(e,n,d,f,i,a,o,s,c,t,l)),h=m(e);if(h)return h;let g=e,_=p.findIndex(e=>e>g);for(;_>=0&&_<p.length;){let e=p[_],r=Fd(g,e,n,d,f,a,o,s,c,t,l,u);if(r!==null){u&&(u.localRootEventCount+=1);let e=m(r);if(e)return e;g=r;continue}let i=m(e);if(i)return i;g=e;do _+=1;while(_<p.length&&p[_]<=g)}throw Error(`Finite float line-window event sweep found no usable terminal Y`)}function Ld(e,t,n,r,i,a,o=r,s=r+i,c={xLeftPt:r,xRightPt:r+i,readingDirection:`ltr`},l=t){return Id(e,t,n,r,i,a,o,s,c,l)}function Rd(e,t,n,r){let i=new Set;for(;;){let a=e;for(let i of t)i.mode===`topAndBottom`&&pd(i,n,r)&&e>=i.yTop&&e<i.yBottom&&(a=Math.max(a,i.yBottom));if(a===e)return e;if(!Number.isFinite(a)||a<e||i.has(a))throw Error(`Top-and-bottom solver violated strictly increasing finite-bottom progress`);i.add(a),e=a}}const zd=Object.freeze({UNSUPPORTED_TEXT_EFFECT:Object.freeze({severity:`warning`,layoutCode:`UNSUPPORTED_FEATURE`,message:`WordprocessingML text effects are not rendered`}),INVALID_TEXT_EFFECT_VALUE:Object.freeze({severity:`warning`,layoutCode:`INVALID_VALUE`,message:`An invalid WordprocessingML text-effect value was ignored`}),MISSING_DRAWING_EXTENT:Object.freeze({severity:`error`,layoutCode:`INVALID_GEOMETRY`,message:`A drawing with a missing required extent was omitted`}),INVALID_DRAWING_EXTENT:Object.freeze({severity:`error`,layoutCode:`INVALID_GEOMETRY`,message:`A drawing with an invalid extent was omitted`}),DEGENERATE_DRAWING_EXTENT:Object.freeze({severity:`warning`,layoutCode:`INVALID_GEOMETRY`,message:`A drawing has a schema-valid zero-area extent`})}),Bd=Object.freeze({code:`INVALID_VALUE`,severity:`warning`,message:`The parser diagnostic contract did not match this renderer build`});function Vd(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Hd(e,t){if(!Array.isArray(e)||!e.every(e=>Number.isSafeInteger(e)&&e>=0))return!1;let[n]=e;return n===void 0||n<t}function Ud(e){return Object.freeze({story:`body`,storyInstance:`body`,path:Object.freeze([...e])})}function Wd(e,t){if(e===void 0)return Object.freeze([]);if(!Array.isArray(e))return Object.freeze([Bd]);let n=[],r=!1;for(let i of e){if(!Vd(i)||typeof i.code!=`string`||!Object.hasOwn(zd,i.code)||i.part!==`word/document.xml`||!Hd(i.path,t)){r=!0;continue}let e=zd[i.code];if(i.severity!==e.severity){r=!0;continue}n.push(Object.freeze({code:e.layoutCode,severity:e.severity,source:Ud(i.path),message:e.message}))}return r&&n.push(Bd),Object.freeze(n)}var Z=class extends Error{code;constructor(e,t){super(`${e}: ${t}`),this.name=`LayoutInvariantError`,this.code=e}},Gd=class extends Z{reason;states;passes;constructor(e,t,n){super(`NON_CONVERGENCE`,e===`cycle`?`repeated exact-state cycle at ${t.at(-1)??`<missing>`}`:`hard exact-state pass limit ${n} reached`),this.name=`ExactConvergenceError`,this.reason=e,this.states=Object.freeze([...t]),this.passes=n}};function Kd(e){let{seedState:t,step:n,stateOf:r,limit:i}=e,a=t===void 0?2:1;if(!Number.isInteger(i)||i<a)throw RangeError(`Exact convergence limit must be an integer >= ${a}`);let o=t===void 0?[]:[t],s=new Set(o),c=null;for(let e=1;e<=i;e+=1){let t=n(c,e),a=r(t),l=o.at(-1);if(o.push(a),l===a)return Object.freeze({value:t,passes:e});if(s.has(a))throw new Gd(`cycle`,o,e);if(s.add(a),e===i)throw new Gd(`limit`,o,e);c=t}throw new Gd(`limit`,o,i)}function qd(e,t,n){if(!Number.isInteger(n)||n<1)throw new Z(`NON_CONVERGENCE`,`limit must be a positive integer`);try{return Kd({seedState:e.fingerprint,step:n=>t(n??e),stateOf:e=>e.fingerprint,limit:n}).value}catch(e){throw e instanceof Gd?new Z(`NON_CONVERGENCE`,e.reason===`cycle`?`repeated geometry fingerprint cycle at ${e.states.at(-1)??`<missing>`}`:`hard iteration limit ${n} reached`):e}}var Jd=class extends Z{reason;states;constructor(e,t){super(`NON_CONVERGENCE`,e===`cycle`?`line wrap measure/resolve cycle did not converge (${t.length} states)`:`line wrap measure/resolve pass limit did not converge (${t.length} states)`),this.name=`LineWrapNonConvergenceError`,this.reason=e,this.states=Object.freeze([...t])}};function Yd(e){return e.map(e=>({...e}))}function Xd(e,t){return JSON.stringify(e.map((e,n)=>({end:e.consumedEnd,topY:e.topY,xOffset:e.xOffset,availableWidth:e.availWidth,probeHeight:t[n],segments:e.segments.map(e=>({source:e.src,...e.text===void 0?{}:{text:e.text}}))})))}function Zd(e,t){try{return Kd({step:n=>{let r=e(n?.probeHeights??null),i=Object.freeze(r.map(t));return Object.freeze({lines:r,probeHeights:i,state:Xd(r,i)})},stateOf:e=>e.state,limit:16}).value.lines}catch(e){throw e instanceof Gd?new Jd(e.reason,e.states):e}}Y({id:`word-east-asian-grid-line-allocation`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/compatibility.test.ts#pins East Asian grid allocation and the untabled Far East metric factor`},description:`For an East Asian single-spaced line on a document grid, preserve the measured whole-cell allocation from the intended face design height and use the established 1.3-times-em fallback only when that design height is unavailable.`}),Y({id:`word-use-fe-layout-inherited-grid-minimum`,evidence:{kind:`office-observation`,syntheticFixtureId:`far-east-hinted-latin-grid-multiple`,application:`Microsoft Word`,version:`16.111.1`,platform:`macOS 26.5.2`},description:`With useFELayout enabled, a Latin line carrying an eastAsia-hinted run participates in Far East grid metrics; inherited automatic spacing keeps the larger of its whole-cell design allocation and one grid pitch multiplied by the inherited spacing value.`}),Y({id:`word-use-fe-layout-empty-mark-grid-allocation`,evidence:{kind:`regression-test`,reference:`packages/docx/src/paragraph-measure.test.ts#applies useFELayout grid-cell allocation to an empty paragraph mark`},description:`With useFELayout enabled, a content-less paragraph mark participates in Far East whole-cell document-grid allocation even when the document contains no literal East Asian text.`}),Y({id:`word-contiguous-underline-geometry`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/paragraph.test.ts#uses one safe baseline for a solid underline spanning adjacent source runs`},description:`Adjacent compatible underlined source runs share one safe baseline and continuous authored cadence while style, color, and thickness boundaries remain distinct.`}),Y({id:`word-grid-at-least-tall-line-unsnapped`,evidence:{kind:`regression-test`,reference:`packages/docx/src/line-box-height.test.ts#does not round tall East Asian content up to an additional grid cell`},description:`An explicitly authored atLeast line on an active document grid keeps the maximum of its natural height, authored minimum, and one pitch instead of rounding tall content to another whole cell.`}),Y({id:`word-degenerate-line-spacing-single`,evidence:{kind:`microsoft-note`,reference:`[MS-DOC] §2.9.146`},description:`Preserve a non-collapsing single-line fallback for exact or automatic line spacing at or below zero, consistent with the native LSPD representation.`}),Y({id:`word-auto-multiple-baseline-pin`,evidence:{kind:`regression-test`,reference:`packages/docx/src/line-spacing-baseline.test.ts#2.0× keeps the baseline at top + ascent (extra 1.0× leading below, NOT centred)`},description:`Paint an automatic line-spacing multiplier at or above one with its glyph baseline pinned inside the single design line and place multiplier leading below it; this is draw-only and does not replace the centered trailing-mark pagination metric.`}),Y({id:`word-mixed-anchor-visible-line-metrics`,evidence:{kind:`regression-test`,reference:`packages/docx/src/anchor-host-metrics.test.ts#reserves host line height without using its zero-ink box for a visible run baseline`},description:`A zero-ink drawing anchor host reserves its line and grid height while visible neighboring glyphs retain their own ascent, descent, and design-line baseline.`}),Y({id:`word-justification-leading-indent-exclusion`,evidence:{kind:`regression-test`,reference:`packages/docx/src/text-distribute.test.ts#forwards (segs, slack, firstContentSi, lastDrawnSi) positionally`},description:`Keep leading whitespace used as a first-line text indent fixed while distributing justified-line slack across content in a left-to-right line.`}),Y({id:`word-justified-candidate-separator-fit`,evidence:{kind:`regression-test`,reference:`packages/docx/src/justify-shrink-overshoot.test.ts#counts a candidate trailing space when the prospective line will justify`},description:`On a full paragraph-width line that will be fully justified, include the candidate word separator in its wrap-fit width; lines narrowed by DrawingML wrap exclusions retain collapsible line-end separator fit behavior.`}),Y({id:`word-overflow-punctuation-language-sets`,evidence:{kind:`microsoft-note`,reference:`[MS-OE376] §2.1.56`},description:`Apply the language-specific punctuation sets documented for Word in [MS-OE376] §2.1.56, and let overflowPunct override kinsoku when both rules affect the same character.`}),Y({id:`word-full-width-character-spacing-scope`,evidence:{kind:`microsoft-note`,reference:`[MS-OE376] §2.1.562`},description:`Interpret ST_CharacterSpacing as applying whitespace compression to full-width punctuation characters. This rule establishes only which characters are eligible; it does not define a universal compression amount.`}),Y({id:`word-japanese-punctuation-compression-cell`,evidence:{kind:`office-observation`,syntheticFixtureId:`japanese-fullwidth-punctuation-compression-cell`,application:`Microsoft Word`,version:`16.111.1`,platform:`macOS 26.5.2`},description:`In the observed Japanese compatibility fixture, compressed full-width punctuation retains at least half of the ideographic cell measured through the selected font route. Tight adjacent glyph ink can require a larger retained extent to prevent collision. This is an Office-observed compression amount, not a normative interpretation of ST_CharacterSpacing.`}),Y({id:`word-ms-mincho-empty-east-asian-mark-height`,evidence:{kind:`office-observation`,syntheticFixtureId:`ms-mincho-empty-east-asian-paragraph-mark`,application:`Microsoft Word`,version:`16.111.1`,platform:`macOS 26.5.2`},description:`In the observed compatibility fixture, an empty 12-point East-Asian paragraph mark routed to MS Mincho occupies a 15.6-point single-line box. Scope this 1.3-em floor to empty East-Asian paragraph marks; ordinary MS Mincho text lines and Latin marks retain their independently measured metrics.`});function Qd(e){let t=Math.max(0,e.punctuationAdvancePt);return Math.min(t,Math.max(0,e.punctuationInkEndPt,e.ideographicCellAdvancePt/2))}const $d={ja:new Set([...`,.’”、。」』】),.]}。、`]),zhHans:new Set([...`!%),.:;>?]}¢°·ˇ’”‰′″℃∶、。〃〉》」』】〗〕〞﹚﹜﹞!"%'),.:;?]}¢`]),zhHant:new Set([...`!),.:;?]}’”′、。〉》」』】〕〞﹚﹜﹞!),.:;?]}`]),ko:new Set([...`!%),.:;?]}¢°’”′″℃〉》」』】〕!%),.:;?]}¢`])},ef=new Set([...$d.ja,...$d.zhHans,...$d.zhHant,...$d.ko]);function tf(e,t){let n=t?.toLowerCase();return n?.startsWith(`ja`)?$d.ja.has(e):n?.startsWith(`ko`)?$d.ko.has(e):n?.startsWith(`zh`)?(/(?:^|-)(?:tw|hk|mo)(?:-|$)|hant/u.test(n)?$d.zhHant:$d.zhHans).has(e):ef.has(e)}function nf(e){return e.lineWillJustify&&e.wrapNarrowed!==!0?e.widthPx:e.widthPx-e.trailingSpacePx}function rf(e){return e.resolvedMeasurementRouteCount===1?e.biasBudgetPx:0}Y({id:`word-ruby-paragraph-uniform-line-advance`,evidence:{kind:`regression-test`,reference:`packages/docx/src/paragraph-measure.test.ts#uses one uniform snapped advance for every line in a ruby paragraph`},description:`Every line in a ruby-bearing paragraph uses the paragraph-wide maximum snapped line advance so its baseline rhythm remains uniform.`}),Y({id:`word-fit-text-inter-character-expansion`,evidence:{kind:`regression-test`,reference:`packages/docx/src/fit-text.test.ts#distributes (val − Σnatural)/(n−1) as the inter-character gap, no trailing gap`},description:`Expand a multi-character fitText region to its authored width by distributing the residual evenly across interior character gaps.`}),Y({id:`word-cjk-both-inter-character-expansion`,evidence:{kind:`regression-test`,reference:`packages/docx/src/text-distribute.test.ts#§17.18.44: fills a wrapped pure-CJK line via inter-CJK pitch (expansion default)`},description:`Treat inter-CJK boundaries as eligible inter-word gaps when expanding a non-final both-justified line that contains no spaces.`}),Y({id:`word-thai-distribute-cluster-policy`,evidence:{kind:`regression-test`,reference:`packages/docx/src/thai-distribute.test.ts#fills non-final lines to the right margin under thaiDistribute`},description:`Expand non-final thaiDistribute lines at Thai grapheme-cluster boundaries while retaining a natural-width final line.`}),Y({id:`word-numeric-decimal-tab-inference`,evidence:{kind:`regression-test`,reference:`packages/docx/src/decimal-tab-autoalign.test.ts#right-aligns numbers of different digit counts at the decimal tab`},description:`Right-align an otherwise tab-less numeric paragraph at its leading decimal tab while leaving non-numeric and no-decimal-tab paragraphs unchanged.`}),Y({id:`word-numbering-marker-overflow-tab-advance`,evidence:{kind:`regression-test`,reference:`packages/docx/src/numbered-marker-tab-advance.test.ts#advances the body past the marker to the next tab stop, not onto indentLeft`},description:`When a numbering marker overruns its hanging-indent budget, advance the body to the next reachable tab stop beyond the marker edge.`}),Y({id:`word-numbering-suffix-coincident-list-tab`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/numbering-marker.test.ts#keeps a suffix tab on the list stop coincident with the marker end`},description:`For the tab synthesized by a numbering suffix, accept an authored numeric list tab coincident with the shaped marker end instead of advancing to the next automatic tab stop.`});function af(e,t){return t.alignment===`num`&&Math.abs(t.pos-e)<=1e-6}Y({id:`word-tab-stop-page-edge-clamp`,evidence:{kind:`regression-test`,reference:`packages/docx/src/rtl-tab-stops.test.ts#pins a page number to the left text margin when the stop is past it`},description:`Clamp content assigned to a tab stop beyond the trailing text edge back onto that edge instead of placing ink outside the page content band.`}),Y({id:`word-dictionary-sea-natural-fit`,evidence:{kind:`regression-test`,reference:`packages/docx/src/sea-justified-fit.test.ts#Rule 1: wraps the paragraph-final Thai word on a thaiDistribute closing line (zero space-shrink)`},description:`Do not admit a dictionary Southeast-Asian word by compressing preceding inter-word spaces when its natural advance exceeds the remaining line width.`}),Y({id:`word-dictionary-sea-atomic-chunk`,evidence:{kind:`regression-test`,reference:`packages/docx/src/sea-justified-fit.test.ts#Rule 2: a no-space chunk that fits a full line moves whole instead of splitting`},description:`Move a glued dictionary Southeast-Asian chunk to a fresh line whole when it fits that full line, using dictionary breaks only when the chunk itself is overlong.`}),Y({id:`word-overlong-token-emergency-break`,evidence:{kind:`regression-test`,reference:`packages/docx/src/run-inline-formatting.test.ts#breaks a no-space token wider than the line at the character level`},description:`Emergency-break a non-CJK token that is wider than an empty line at grapheme-safe character boundaries so it remains inside the content band.`}),Y({id:`word-run-vertical-align-baseline-shift`,evidence:{kind:`regression-test`,reference:`packages/docx/src/run-char-metrics-render.test.ts#w:vertAlign raises superscript, lowers subscript, and leaves ordinary baselines unchanged`},description:`Retain the established run-level baseline displacement for vertically aligned text: superscript rises by 0.35 of its authored font size and subscript falls by 0.15, while the separately authored w:position remains additive.`});function of(e,t){return e===`super`?t*.35:e===`sub`?-t*.15:0}const sf=1.3;function cf(e,t,n){if(!n||!e)return 0;let r=e.trim().toLowerCase();return r===`ms mincho`||r===`ms 明朝`?t*sf:0}function lf(e,t){return t>0?Math.max(1,Math.ceil(e/t)):1}function uf(e,t){return e>0?e:t*sf}function df(e,t,n){return Math.max(e,t*n)}function ff(e,t,n){return Math.max(e,t,n)}function pf(e,t){return(e===`exact`||e===`auto`)&&t<=0}Y({id:`word-neutral-script-attachment`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/compatibility.test.ts#keeps neutral characters attached to the active script slice`},description:`Weak and neutral non-letter characters stay with the active complex-script slice instead of opening additional formatting segments.`}),Y({id:`word-rtl-run-ambiguous-class-override`,evidence:{kind:`regression-test`,reference:`packages/docx/src/bidi-line.test.ts#keeps LTR word order for English text in rtl-marked runs`},description:`Model an rtl-marked run as a higher-level UAX #9 override for punctuation and symbols only, leaving whitespace and strong letters at their ordinary classes.`}),Y({id:`word-rtl-complex-script-european-digits-an`,evidence:{kind:`regression-test`,reference:`packages/docx/src/bidi-line.test.ts#orders an AN-classified date as 2026-02-28`},description:`Classify European digits as Arabic Number within an Arabic or Hebrew complex-script run so UAX #9 preserves the compatible visual ordering of digit groups and separators.`}),Y({id:`word-kashida-final-form-priority`,evidence:{kind:`regression-test`,reference:`packages/docx/src/kashida-priority.test.ts#uses the BaRa join (Beh->Yeh) over the final-letter join in بين`},description:`Apply the measured kashida final-letter priority classes only at a word-final following letter instead of copying the broader Qt final-form conditions.`}),Y({id:`word-vertical-tu-corner-placement`,evidence:{kind:`regression-test`,reference:`packages/docx/src/vertical-text.test.ts#does NOT ink-centre a substituted Tu comma even when ink metrics are present`},description:`Keep a substituted vertical Tu comma or full stop at the font-designed upper-right cell position rather than ink-centering it geometrically.`});const mf=/[\\p{P}\\p{S}]/u;function hf(e){return mf.test(e)}function gf(e,t){return e===t}function _f(e){return e!==null}function vf(e,t,n,r,i,a={}){if(t!=null)return t*n;if(!r?.ruby||!i)throw Error(`Ruby at ${e}pt without hpsRaise requires retained base and guide ink`);if(r.textLayoutService&&r.textShapeRequest){let e=r.textLayoutService.shape({...r.textShapeRequest,text:r.text,fontSizePt:Ll(r,n),measure:!0,clusterGeometry:!1}),t=r.textLayoutService.shape({...r.textShapeRequest,text:r.ruby.text,fontSizePt:r.ruby.fontSizePt*n,measure:!0,clusterGeometry:!1});if(e.inkBounds&&t.inkBounds)return e.inkBounds.ascentPt+t.inkBounds.descentPt}let o=i.font;try{i.font=jf(r.bold,r.italic,Ll(r,n),r.fontFamily,a,r.fontRoute);let t=i.measureText(r.text);i.font=jf(r.bold,r.italic,e*n,r.fontFamily,a,r.fontRoute);let o=i.measureText(r.ruby.text);if(Number.isFinite(t.actualBoundingBoxAscent)&&Number.isFinite(o.actualBoundingBoxDescent))return t.actualBoundingBoxAscent+o.actualBoundingBoxDescent}finally{i.font=o}throw Error(`Ruby without hpsRaise requires retained base and guide ink`)}const yf=new Set([`sakkal majalla`,`traditional arabic`,`simplified arabic`,`arabic typesetting`,`univers next arabic`,`noto naskh arabic`,`noto sans arabic`]),bf=new Set([`sakkal majalla`,`traditional arabic`,`simplified arabic`,`arabic typesetting`,`noto naskh arabic`]);function xf(e){return yf.has(e.toLowerCase())}function Sf(e){return e.map(e=>`\"${e}\"`).join(`, `)}const Cf=[`Noto Naskh Arabic`,`Noto Sans Arabic`];function wf(e){let t=e&&e!==`jp`?B(e,`sans`):[`Noto Sans JP`,`Hiragino Sans`,`Meiryo`,...B(`jp`,`sans`).slice(1)];return e==null?`${Sf([...V,`Arial`,`Helvetica`,`Liberation Sans`,...t,...Cf])}, sans-serif`:`${Sf([...t,...Cf,...V])}, sans-serif`}function Tf(e){let t=e&&e!==`jp`?B(e,`serif`):[`Yu Mincho`,`YuMincho`,`Hiragino Mincho ProN`,`MS Mincho`,`Noto Serif JP`,...B(`jp`,`serif`).slice(1)];return e==null?`${Sf([...H,`Times New Roman`,`Cambria`,`Liberation Serif`,...t,...Cf])}, serif`:`${Sf([...t,...Cf,...H])}, serif`}const Ef=new WeakMap,Df=new WeakMap;function Of(e,t){let n=e??{};return t&&Object.keys(t).length>0&&Df.set(n,t),n}function kf(e,t={}){let n=Ef.get(t)??(()=>{let e=new Map;return Ef.set(t,e),e})(),r=e??`\\0null`,i=n.get(r);if(i!==void 0)return i;let a=Af(e,t,Df.get(t));return n.set(r,a),a}function Af(e,t,n={}){if(!e)return wf(null);let r=`\"${(e=>e.replace(/\"/g,`\\\\\"`))(e)}\"`,i=e.toLowerCase(),a=R(e);if(xf(e))return bf.has(i)?`${r}, \"Noto Naskh Arabic\", \"Noto Sans Arabic\", \"Noto Serif\", \"Noto Sans JP\", \"Hiragino Sans\", serif`:`${r}, \"Noto Sans Arabic\", \"Noto Naskh Arabic\", \"Noto Sans JP\", \"Hiragino Sans\", sans-serif`;let o=t[e];if(o&&o!==`auto`)switch(o){case`roman`:return`${r}, ${Tf(a)}`;case`swiss`:return`${r}, ${wf(a)}`;case`modern`:if(n[e]===`fixed`)return`${r}, \"Courier New\", monospace`;break;default:break}let s=z(e);if(s===`serif`)return`${r}, ${Tf(a)}`;if(s===`mono`)return`${r}, \"Courier New\", monospace`;if(a==null||a===`jp`){if(i.includes(`meiryo`)||e.includes(`メイリオ`))return`${r}, \"Meiryo UI\", \"Meiryo\", ${wf(a)}`;if(e.includes(`游ゴシック`)||/\\byu\\s*gothic\\b/i.test(e)||i.includes(`yugothic`))return`${r}, \"Yu Gothic\", \"YuGothic\", ${wf(a)}`;if(i.includes(`ipa`))return`${r}, \"IPAexGothic\", ${wf(a)}`;if(i.includes(`segoe`))return`${r}, \"Segoe UI\", ${Sf([...Cf,...V])}, sans-serif`}return`${r}, ${wf(a)}`}function jf(e,t,n,r,i={},a){return a?L(a,n,e?700:400,t?`italic`:`normal`):`${t?`italic`:`normal`} ${e?`bold`:`normal`} ${n}px ${kf(r,i)}`}function Mf(e,t,n=!1){return Math.max(jc(e.fontFamily,t,n),(e.resolvedLineHeightRatio??0)*t)}function Nf(e,t,n=!1){return Math.max(jc(e.eaFloorFamily,t,n),(e.resolvedEaFloorLineHeightRatio??0)*t)}function Pf(e){for(let t of e.runs)if(t.type===`text`||t.type===`field`)return t.fontSize;return typeof e.defaultFontSize==`number`?e.defaultFontSize:10}function Ff(e,t=!1){for(let t of e.runs)if(t.type===`text`||t.type===`field`)return t.fontFamily;return t&&e.defaultFontFamilyEastAsia?e.defaultFontFamilyEastAsia:e.defaultFontFamily??null}function If(e,t,n){return jc(Ff(e,n),Pf(e)*t,n)}function Lf(e){let t=0;for(let n of e)Rl.test(n)&&t++;return t}function Rf(e,t){if(t===0||e.length===0)return 0;let n=[...e];return Lf(e)===n.length?n.length*t:0}function zf(e,t){return e.snapToCharacterGrid===!1?0:t}function Bf(e,t){return e.fitTextPerGapPx===void 0?Vf(e)*t:e.fitTextPerGapPx}function Vf(e){return e.charSpacing??0}function Hf(e){return e.punctuationCompressions?.reduce((e,t)=>e+t.adjustmentPt,0)??0}function Uf(e,t,n){let r=e.punctuationCompressions?.filter(e=>e.end>t&&e.end<=n).map(e=>Object.freeze({end:e.end-t,adjustmentPt:e.adjustmentPt}));return r&&r.length>0?Object.freeze(r):void 0}function Wf(e,t){if(!e.textLayoutService||!e.textShapeRequest||t.length===0)return;let n=e.textLayoutService.shape({...e.textShapeRequest,text:t,measure:!0,clusterGeometry:!1});if(n.horizontalInkBoundsAreTight!==!0||!n.inkBounds||!Number.isFinite(n.advancePt)||!Number.isFinite(n.inkBounds.xMinPt)||!Number.isFinite(n.inkBounds.xMaxPt))return;let r=e.charScale??1;return{advancePt:n.advancePt*r,xMinPt:n.inkBounds.xMinPt*r,xMaxPt:n.inkBounds.xMaxPt*r}}function Gf(e){if(!e.textLayoutService||!e.textShapeRequest||e.text.length===0)return;let t=e.textLayoutService.shape({...e.textShapeRequest,text:e.text,measure:!0,clusterGeometry:!0});if(!t.clusters?.length)return;let n=e.charScale??1,r=new Map;for(let e of t.clusters){if(!Number.isFinite(e.advancePt))return;r.set(e.range.end,e.advancePt*n)}return r}function Kf(e){let t,n=new Map;for(let r of e){if(!(`text`in r)||r.verticalRun){t=void 0;continue}let e=r,i=e.punctuationCompressions??[],a=new Map(i.map((e,t)=>[e.end,t])),o=i.length>0?Gf(e):void 0,s=[0,...$o(e.text),e.text.length];for(let r=0;r<s.length-1;r+=1){let i=s[r],c=s[r+1];if(c<=i)continue;let l=a.get(c),u=t||l!==void 0?Wf(e,e.text.slice(i,c)):void 0;if(t&&u){let e=n.get(t.segment)??t.segment.punctuationCompressions.map(e=>({...e})),r=e[t.compressionIndex],i=Math.max(0,t.ink.advancePt+r.adjustmentPt),a=Math.min(0,i-t.contextualAdvancePt),o=Math.min(0,t.ink.xMaxPt-u.xMinPt-t.contextualAdvancePt),s=Math.max(r.adjustmentPt,a,o);s!==r.adjustmentPt&&(e[t.compressionIndex]={end:r.end,adjustmentPt:s},n.set(t.segment,e))}t=l!==void 0&&u?{segment:e,compressionIndex:l,ink:u,contextualAdvancePt:o?.get(c)??u.advancePt}:void 0}}for(let[e,t]of n)e.punctuationCompressions=Object.freeze(t.map(e=>Object.freeze(e)))}function qf(e){return e.charScale??1}function Jf(e,t,n,r,i){return e*r+Rf(t,n)+[...t].length*i}function Yf(e,t,n,r){if(e.fitTextPerGapPx!==void 0){let n=[...e.text].length,r=e.fitTextRegionEnd?Math.max(0,n-1):n;return t*qf(e)+r*e.fitTextPerGapPx+(e.fitTextTrailingPadPx??0)}if(e.tateChuYoko)return e.fontSize*r;let i=zf(e,n);return Jf(t,e.text,i,qf(e),Bf(e,r))+Hf(e)*r}function Xf(e){return!e||!e.linePitchPt||e.linePitchPt<=0?!1:e.type===`lines`||e.type===`linesAndChars`||e.type===`snapToChars`}function Zf(e,t){return lf(e,t)}function Qf(e,t){return uf(e,t)}function $f(e,t,n,r,i,a,o=0,s=!1,c,l){let u=t+n,d=Math.max(u,o),f=Xf(i),p=f?i.linePitchPt*r:0,m=()=>s?a?Math.max(p,Math.ceil(u/p)*p):Zf(c??(o>0?o:l===void 0?p:Qf(0,l)),p)*p:Math.max(u,p),h=e!==null&&e.explicit!==!0;if(!e||pf(e.rule,e.value))return f?m():d;if(e.rule===`auto`){if(f){if(h){let t=m();return s?df(t,p,e.value):t}return Math.max(u,p*e.value)}return d*e.value}if(e.rule===`exact`)return e.value*r;if(e.rule===`atLeast`){let t=f?a||h?m():p:0;return ff(d,e.value*r,t)}return d}function ep(e,t){return{asc:e*t*.8,desc:e*t*.2}}function tp(e,t,n,r,i=!1){return Mc(t,r,e.fontBoundingBoxAscent??e.actualBoundingBoxAscent??n*.8,e.fontBoundingBoxDescent??e.actualBoundingBoxDescent??n*.2,i)}function np(e,t,n,r,i=!1,a,o={},s=e.lineSpacing,c={},l,u){let d=u,f=i||d?.fontHint===`eastAsia`,p=d?.complexScript===!0,m=d?.fontSizePt??Pf(e),h=Ff(e,f),g=h?c[Nc(h)]:void 0,_=g?.family??h,v,y;if(l){let n=d?d.weight>=600:!1,r=d?.style===`italic`,i=d?.fonts.ascii??e.defaultFontFamily??h,a=l.shape({text:f?`あ`:`x`,fontSizePt:m*t,fonts:d?.fonts??{ascii:i,highAnsi:i,eastAsia:e.defaultFontFamilyEastAsia??i,complexScript:i},themeFonts:d?.themeFonts,themeFontPresence:d?.themeFontPresence,weight:n?700:400,style:r?`italic`:`normal`,complexScript:p,fontHint:d?.fontHint,eastAsiaLanguage:d?.eastAsiaLanguage,kerning:d?.kerning,measure:!0}),o=a.spans[0]?.font.resolvedFamily??h;({ascent:v,descent:y}=tp({width:a.advancePt,actualBoundingBoxAscent:a.ascentPt,actualBoundingBoxDescent:a.descentPt,fontBoundingBoxAscent:a.ascentPt,fontBoundingBoxDescent:a.descentPt},o,m*t,m*t,f))}else if(a){let e=a.font;a.font=jf(!1,!1,m*t,_,o);let n=a.measureText(f?`あ`:`x`);a.font=e,{ascent:v,descent:y}=tp(n,_,m*t,m*t,f)}else ({asc:v,desc:y}=ep(m,t));let b=g?.lineHeightRatio==null?If(e,t,f):m*t*g.lineHeightRatio,x=Math.max(b,cf(h,m*t,f)),S=i?Qf(x,m*t):void 0;return{advancePx:$f(s,v,y,t,n,r,x,i,S),ascentPx:v,descentPx:y}}function rp(e,t,n,r,i=!1,a,o={},s=e.lineSpacing,c={},l,u){return np(e,t,n,r,i,a,o,s,c,l,u).advancePx}function ip(e,t,n){return Math.max(0,(e-t+n)/2)}function ap(e,t,n,r,i,a,o,s={},c,l){let u=np(e,1,t,n,r,i,a,o,s,c,l);return ip(u.advancePx,u.ascentPx,u.descentPx)}function op(e){let t=[];for(let n of e){let e=n.toLowerCase()===n&&n.toUpperCase()!==n,r=/\\s/.test(n)?t[t.length-1]?.reduced??!1:e,i=t[t.length-1];i&&i.reduced===r?i.text+=n:t.push({text:n,reduced:r})}return t.length?t:[{text:e,reduced:!1}]}function sp(e,t){for(let n=t-1;n>=0;n--){let t=e[n];if(t.type===`text`||t.type===`field`)return t.fontSize}for(let n=t+1;n<e.length;n++){let t=e[n];if(t.type===`text`||t.type===`field`)return t.fontSize}return 10}function cp(e,t){if(e.fieldType===`page`)return tc(t.displayPageNumber??t.pageIndex+1,bc(e.instruction)??t.pageNumberFormat??`decimal`);if(e.fieldType===`numPages`){let n=bc(e.instruction)??`decimal`;return tc(t.totalPages,n)}if(e.fieldType===`date`||e.fieldType===`time`){let n=Ec(e.instruction);if(n){let e=Dc(n,new Date(t.currentDateMs??Date.now()));if(e!==null)return e}return e.fallbackText}return e.fallbackText}const lp=new Set([`+`,`-`,`−`,`=`,`±`,`×`,`÷`]);function up(e){return lp.has(e)?` ${e} `:e}function dp(e){return e.map(e=>{switch(e.kind){case`run`:return up(e.text);case`fraction`:return`${dp(e.num)}/${dp(e.den)}`;case`sup`:return`${dp(e.base)}^${dp(e.sup??[])}`;case`sub`:return`${dp(e.base)}_${dp(e.sub??[])}`;case`subSup`:return`${dp(e.base)}_${dp(e.sub??[])}^${dp(e.sup??[])}`;case`nary`:return`${e.op}${dp(e.sub??[])}${dp(e.sup??[])}${dp(e.body)}`;case`delimiter`:return`${e.begChar}${e.items.map(dp).join(`,`)}${e.endChar}`;case`radical`:return`${e.index&&e.index.length>0?dp(e.index):``}√${dp(e.radicand)}`;case`limit`:return`${dp(e.base)}${dp(e.lower??[])}${dp(e.upper??[])}`;case`array`:return e.rows.map(e=>e.map(dp).join(` `)).join(` `);case`groupChr`:return`${e.char}${dp(e.base)}`;case`bar`:case`box`:case`borderBox`:return dp(e.base);case`accent`:return`${e.char}${dp(e.base)}`;case`func`:return`${dp(e.name)}(${dp(e.arg)})`;case`group`:return dp(e.items);case`phant`:return e.show?dp(e.base):``;case`sPre`:return`${dp(e.sub)}${dp(e.sup)}${dp(e.base)}`}}).join(``).replace(/[ \\t]{2,}/g,` `)}function fp(e){for(let t=0;t<e.length;){let n=e.codePointAt(t);if(Eo(n))return!0;t+=n>65535?2:1}return!1}const pp=new Set([`、`,`。`,`,`,`.`,`」`,`』`,`】`,`〗`,`)`,`]`,`}`,`!`,`?`]);function mp(e){let t=e.codePointAt(0);return t===void 0?!1:t>=12353&&t<=12438||t>=12445&&t<=12447||t>=12449&&t<=12538||t===12540||t>=12541&&t<=12543||t>=12784&&t<=12799||t>=110576&&t<=110591||t>=110592&&t<=110959}function hp(e,t){switch(t){case`compressPunctuation`:return pp.has(e);case`compressPunctuationAndJapaneseKana`:return pp.has(e)||mp(e);default:return!1}}function gp(e,t){if(e===void 0)return;let n=[];for(let r of e)r>t&&n.push(r-t);return n}function _p(e,t){if(t<=0)return t;let n=t;for(;n<e.length&&e[n]===` `;)n++;return n}function vp(e,t,n,r=0,i=1,a=0,o=!1,s,c){let l=[...t],u=t=>c?.(t)??(()=>{let n=0;if(o){if(!s)throw Error(`Vertical glyph measurement capability is required for vertical text`);n=s.measureRunInkExtra(t)}return Jf(e.measureText(t).width+n,t,r,i,a)})(),d=e=>{let t=e;for(;t>0&&l[t-1]===` `;)t--;let r=l.slice(0,t).join(``);return r.length===0?!0:u(r)<=n},f=0,p=l.length;for(;f<p;){let e=f+p+1>>1;d(e)?f=e:p=e-1}return l.slice(0,f).join(``)}const yp=new Set([`ar`,`fa`,`ur`,`he`,`iw`,`yi`,`ji`,`ps`,`sd`,`ug`,`dv`,`syr`,`ckb`]);function bp(e,t){if(e){let t=e.split(`-`)[0].toLowerCase();if(yp.has(t))return!0}return t}function xp(e){let t=[],n=null,r=``;for(let i of e){let e=Eo(i.codePointAt(0));n===null||e===n?(n=e,r+=i):(t.push({text:r,ea:n}),n=e,r=i)}return r.length>0&&t.push({text:r,ea:n??!1}),t}function Sp(e){let t=e=>e>=48&&e<=57,n=e=>e===`.`||e===`,`||e===`:`||e===`/`||e===`\\xA0`,r=[],i=``,a=null;for(let o=0;o<e.length;o++){let s=e[o],c=t(s.charCodeAt(0));!c&&a===!0&&n(s)&&t(e.charCodeAt(o+1))&&(c=!0),a===null||c===a?i+=s:(r.push(i),i=s),a=c}return i.length>0&&r.push(i),r.length?r:[e]}function Cp(e){let t=[],n=0;for(;n<e.length;){let r=n;for(;r<e.length&&e[r]!==` `;)r++;for(;r<e.length&&e[r]===` `;)r++;r>n&&t.push(e.slice(n,r)),n=r}return t.length?t:[e]}function wp(e){let t=e?.defaultTabStop;return t!=null&&t>0?t:36}function Tp(e){return e===`center`?`center`:e===`right`||e===`end`||e===`decimal`?`trailing`:`leading`}function Ep(e,t,n,r,i){let a=e.length,o=e.map(e=>e.width),s=Array(a).fill(void 0),c=t=>{let n=0;for(let r=t;r<a&&!e[r].isTab;r++)n+=o[r];return n},l=n;for(let n=0;n<a;n++){if(!e[n].isTab){l+=o[n];continue}let a=Bl(l,t,i);if(!a){o[n]=0;continue}let u=c(n+1),d,f=Tp(a.alignment);d=f===`trailing`?a.pos-u:f===`center`?a.pos-u/2:a.pos,d+u>r&&(d=r-u),d<l&&(d=l),o[n]=d-l,s[n]=a.leader,l=d}return e.map((e,t)=>({width:o[t],leader:s[t]}))}function Dp(e,t,n){let r=new Map;for(let t of e){if(t.fitTextRegionIndex===void 0)continue;let e=r.get(t.fitTextRegionIndex)??[];e.push(t),r.set(t.fitTextRegionIndex,e)}for(let e of r.values()){let r=e.find(e=>e.fitTextVal!==void 0);if(!r||r.fitTextVal===void 0)continue;let i=0,a=0;for(let t of e)i+=n(t)*qf(t),a+=[...t.text].length;let o=Xl([{fitTextValTwips:r.fitTextVal,charCount:a,naturalWidthPx:i}],t)[0];o&&e.forEach((t,n)=>{t.fitTextPerGapPx=o.perGapPx,t.fitTextTrailingPadPx=n===e.length-1?o.trailingPadPx:void 0,t.fitTextRegionStart=n===0?!0:void 0,t.fitTextRegionEnd=n===e.length-1?!0:void 0})}}function Op(e,t){let n=[],r=(e,n=400,r=`normal`)=>{if(!e)return;let i=Nc(e),a=t.resolvedLocalFonts;if(!a)return;let o=a[`${i}:${n}:${r}`];if(o)return o;let s=a[i];return n===400&&r===`normal`&&s?s:Object.values(a).find(e=>Nc(e.requestedFamily??``)===i&&(e.weight??400)===n&&(e.style??`normal`)===r)},i=new Map,a=[];for(let[t,n]of e.entries()){if(n.type!==`text`){a.push({charCount:0,naturalWidthPx:0});continue}let e=n.text.split(` `);for(let r=0;r<e.length;r+=1)i.set(`${t}:${r}`,a.length),a.push({fitTextValTwips:n.fitTextVal,fitTextId:n.fitTextId,charCount:[...e[r]].length,naturalWidthPx:0,charScale:n.charScale}),r<e.length-1&&a.push({charCount:0,naturalWidthPx:0})}let o=new Map;Xl(a,1).forEach((e,t)=>{for(let n=e.start;n<e.end;n+=1)o.set(n,t)});let s=(e,a,s,c,l)=>{let u=a,d=!1,f=u.ruby,p=f?{text:f.text,fontSizePt:f.fontSizePt,...f.hpsRaisePt==null?{}:{hpsRaisePt:f.hpsRaisePt}}:void 0,m=u.revision,h=u.rtl===!0?!0:void 0,g=l===void 0?void 0:i.get(`${c}:${l}`),_=g===void 0?void 0:o.get(g),v=u.hyperlink?{kind:`external`,url:u.hyperlink}:u.hyperlinkAnchor?{kind:`internal`,ref:u.hyperlinkAnchor}:void 0,y=u.rtl===!0||u.cs===!0,b=u.fontSizeCs??a.fontSize,x=u.fontFamilyCs??a.fontFamily,S=u.fontFamilyHighAnsi??a.fontFamily,C=u.boldCs??!1,w=u.italicCs??!1,T=u.fontFamilyEastAsia??a.fontFamily,E=(y||u.rtl===!0)&&bp(u.langBidi,u.rtl===!0),D=!0,O=!1,k=(e,i,o,c,l=!1)=>{if(!l&&_===void 0){let n=[0,...$o(e),e.length];if(n.slice(0,-1).map((t,r)=>e.slice(t,n[r+1])).some(e=>hp(e,t.characterSpacingControl))){k(e,i,o,void 0,!0);return}}let f=i?C:a.bold,y=i?w:a.italic,A=f?700:400,j=y?`italic`:`normal`,M=Object.freeze({text:e,fontSizePt:i?b:a.fontSize,fonts:u.fontSlots?.direct??{ascii:a.fontFamily,highAnsi:S,eastAsia:T,complexScript:x},themeFonts:u.fontSlots?.theme,themeFontPresence:u.fontSlots?.themePresent,weight:A,style:j,complexScript:i,fontHint:u.fontHint,eastAsiaLanguage:u.langEastAsia,kerning:u.kerning==null?void 0:(i?b:a.fontSize)>=u.kerning,measure:!1}),N=c?{spans:[c]}:t.layoutServices?.text.shape(M),ee=l?(()=>{let n=[0,...$o(e),e.length],r=[];for(let i=0;i<n.length-1;i+=1){let a=n[i],o=n[i+1],s=e.slice(a,o);if(!hp(s,t.characterSpacingControl))continue;let c=t.layoutServices?.text.shape({...M,text:s,measure:!0,clusterGeometry:!1}),l=(c?.inkBounds&&c.horizontalInkBoundsAreTight===!0?(()=>{let e=Math.max(0,Math.min(c.advancePt,c.advancePt-c.inkBounds.xMaxPt));if(!pp.has(s))return e;let n=c.spans[0]?.fontRoute.fingerprint,r=t.layoutServices?.text.shape({...M,text:` `,fontHint:`eastAsia`,measure:!0,clusterGeometry:!1}),i=r?.spans[0]?.fontRoute.fingerprint,a=r?.advancePt;if(!n||i!==n||a===void 0||!Number.isFinite(a)||a<=0)return 0;let o=Qd({punctuationAdvancePt:c.advancePt,punctuationInkEndPt:c.inkBounds.xMaxPt,ideographicCellAdvancePt:a});return Math.max(0,Math.min(e,c.advancePt-o))})():0)*(u.charScale??1);l>0&&r.push({end:o,adjustmentPt:-l})}return r.length===0?void 0:Object.freeze(r.map(e=>Object.freeze(e)))})():void 0,te=N?.spans.some(e=>e.script===`complexScript`!==i)??!1;if(N&&(N.spans.length>1||te)){for(let e=0;e<N.spans.length;e+=1){let n=N.spans[e],r=n.script===`complexScript`,i=r?x:n.script===`eastAsia`?T:n.script===`highAnsi`?S:a.fontFamily,o=l&&[...n.text].some(e=>hp(e,t.characterSpacingControl));k(n.text,r,i,n,o)}return}let P=N?.spans[0],ne=(e,n)=>{if(!e)return;let r=Object.values(t.layoutServices?.text.localMetrics??{}).filter(t=>Nc(t.family)===Nc(e)&&(t.weight??400)===A&&(t.style??`normal`)===j);return r.find(e=>n&&Nc(e.requestedFamily??``)===Nc(n))??r[0]},F=P?ne(P.font.resolvedFamily,P.font.requestedFamily):r(o,A,j),I=t.layoutServices?.text.resolve({fonts:M.fonts,themeFonts:M.themeFonts,themeFontPresence:M.themeFontPresence,slot:`eastAsia`,weight:A,style:j}),L=I?ne(I.resolvedFamily,I.requestedFamily):r(T,A,j),R=F??(o?t.resolvedLocalFonts?.[Nc(o)]:void 0),z=L??(T?t.resolvedLocalFonts?.[Nc(T)]:void 0);n.push({text:e,...t.useFeLayout&&u.fontHint===`eastAsia`?{metricEastAsian:!0}:{},bold:f,italic:y,underline:a.underline,underlineStyle:u.underlineStyle,underlineColor:u.underlineColor,strikethrough:a.strikethrough,fontSize:i?b:a.fontSize,color:a.color,fontFamily:P?.font.resolvedFamily??F?.family??o,fontRoute:P?.fontRoute,resolvedLineHeightRatio:R?.lineHeightRatio,vertAlign:s,measuredWidth:0,textLayoutService:t.layoutServices?.text,textShapeRequest:M,breakBefore:P?.breakBefore??c?.breakBefore??!0,smallCaps:d,joinPrev:O||c?.breakBefore===!1?!0:void 0,doubleStrikethrough:a.doubleStrikethrough??!1,highlight:a.highlight??null,emphasisMark:a.emphasisMark,background:a.background??null,colorAuto:u.colorAuto??!1,border:u.border??null,ruby:D?p:void 0,revision:m,rtl:h,digitsAsAN:E?!0:void 0,eaFloorFamily:I?.resolvedFamily??L?.family??T,eaFloorRoute:I?.route,resolvedEaFloorLineHeightRatio:z?.lineHeightRatio,textBoxLineFloor:u.textBoxLineFloor,textBoxVertical:u.textBoxVertical,hyperlink:v,snapToCharacterGrid:u.snapToGrid!==!1,charSpacing:u.charSpacing,punctuationCompressions:ee,eastAsiaLanguage:u.langEastAsia,charScale:u.charScale,fitTextVal:_===void 0?void 0:u.fitTextVal,fitTextId:_===void 0?void 0:u.fitTextId,fitTextRegionIndex:_,fitTextRunIndex:_===void 0?void 0:g,position:u.position,kerning:u.kerning,tateChuYoko:t.verticalCJK&&u.eastAsianVert===!0?!0:void 0,tateChuYokoCompress:t.verticalCJK&&u.eastAsianVert===!0&&u.eastAsianVertCompress===!0?!0:void 0,verticalRun:t.verticalCJK&&u.eastAsianVert!==!0?!0:void 0}),D=!1,O=!1},A=(e,t)=>{let n=t===`cs`,r=t===`cs`?x:t===`ea`?T:a.fontFamily;if(de(r)){for(let t of W(e,r))k(t.text,n,t.mapped?null:r);return}k(e,n,r)},j=e=>{if(t.layoutServices?.text){k(e,!1,a.fontFamily);return}for(let t of xp(e))A(t.text,t.ea?`ea`:`latin`)},M=a.smallCaps?op(e):[{text:e,reduced:!1}],N=``;for(let e of M){d=e.reduced,O=N.length>0&&!/\\s$/.test(N),N=e.text;let t=a.allCaps||a.smallCaps?e.text.toUpperCase():e.text;for(let e of Cp(t))if(y)if(E)for(let t of Sp(e))A(t,`cs`);else A(e,`cs`);else j(e)}};for(let[i,a]of e.entries()){let o=n.length;if(a.type===`text`){let e=a,r=e.noteRef?e.noteRef.id?t.noteNumbers?.get(`${e.noteRef.kind}:${e.noteRef.id}`):t.noteReferenceNumber:void 0;if(e.noteRef){let t=r==null?e.text||``:String(r);t.length>0&&s(t,e,e.vertAlign??`super`,i,0);for(let e=o;e<n.length;e+=1)n[e].sourceRunIndex=i;continue}let c=e.text.split(` `);for(let t=0;t<c.length;t++)c[t].length>0&&s(c[t],e,e.vertAlign,i,t),t<c.length-1&&n.push({isTab:!0,fontSize:e.fontSize,measuredWidth:0,bold:e.bold,italic:e.italic})}else if(a.type===`image`){let e=a;n.push({imagePath:e.imagePath,mimeType:e.mimeType,widthPt:e.widthPt,heightPt:e.heightPt,rotation:e.rotation,flipH:e.flipH,flipV:e.flipV,anchor:e.anchor??!1,anchorXPt:e.anchorXPt??0,anchorYPt:e.anchorYPt??0,anchorXFromMargin:e.anchorXFromMargin??!1,anchorYFromPara:e.anchorYFromPara??!1,colorReplaceFrom:e.colorReplaceFrom,duotone:e.duotone,alpha:e.alpha,srcRect:e.srcRect??void 0,measuredWidth:0})}else if(a.type===`chart`){let e=a;n.push({imagePath:``,mimeType:``,widthPt:e.widthPt,heightPt:e.heightPt,anchor:e.anchor??!1,anchorXPt:e.anchorXPt??0,anchorYPt:e.anchorYPt??0,anchorXFromMargin:e.anchorXFromMargin??!1,anchorYFromPara:e.anchorYFromPara??!1,chart:e.chart,measuredWidth:0})}else if(a.type===`unavailableDrawing`){let e=`anchorAcquisitionInput`in a?a.anchorAcquisitionInput:void 0;n.push({imagePath:``,mimeType:``,widthPt:a.widthPt,heightPt:a.heightPt,anchor:e!==void 0,anchorXPt:0,anchorYPt:0,anchorXFromMargin:!1,anchorYFromPara:!1,unavailableResourceKind:a.resourceKind,measuredWidth:0})}else if(a.type===`break`){if(a.breakType===`line`){let t=sp(e,e.indexOf(a));n.push({lineBreak:!0,fontSize:t,measuredWidth:0})}}else if(a.type===`field`){let e=a,n=cp(e,t);n&&s(n,e,e.vertAlign,i)}else if(a.type===`math`){let r=a.fontSize||sp(e,e.indexOf(a)),i=a.resourceKey;if(t.layoutServices&&!i)throw Error(`Service-backed math layout requires a normalized structural resource key`);let o=i?t.layoutServices?.math.resolve(i):void 0;n.push({mathNodes:a.nodes,mathResourceKey:i??``,mathMetadata:o,display:a.display,fontSize:r,color:null,fallbackText:dp(a.nodes),measuredWidth:0,mathAscent:0,mathDescent:0,jc:a.jc})}else if(a.type===`ptab`)n.push({isTab:!0,fontSize:a.fontSize||sp(e,e.indexOf(a)),measuredWidth:0,leader:a.leader,ptab:{alignment:a.alignment,relativeTo:a.relativeTo}});else if(a.type===`anchorHost`){let e=a.fontFamilyEastAsia!=null,i=a.bold??!1,o=a.italic??!1,s=a.fontFamilyEastAsia??a.fontFamily??null,c=i?700:400,l=o?`italic`:`normal`,u=r(s,c,l),d=r(a.fontFamilyEastAsia??null,c,l),f=u??(s?t.resolvedLocalFonts?.[Nc(s)]:void 0),p=d??(a.fontFamilyEastAsia?t.resolvedLocalFonts?.[Nc(a.fontFamilyEastAsia)]:void 0);n.push({text:``,metricOnly:!0,...e?{metricEastAsian:!0}:{},bold:i,italic:o,underline:!1,strikethrough:!1,fontSize:a.fontSize,color:null,fontFamily:u?.family??s,resolvedLineHeightRatio:f?.lineHeightRatio,vertAlign:null,measuredWidth:0,eaFloorFamily:d?.family??a.fontFamilyEastAsia??null,resolvedEaFloorLineHeightRatio:p?.lineHeightRatio,snapToCharacterGrid:!1})}for(let e=o;e<n.length;e+=1)n[e].sourceRunIndex=i}for(let e=1;e<n.length;e++){let t=n[e];if(!(`text`in t)||t.joinPrev)continue;let r=t.text.codePointAt(0);if(r===void 0||!Co.lineStartForbidden.has(r))continue;let i=n[e-1];!(`text`in i)||/\\s$/.test(i.text)||(t.joinPrev=!0)}for(let e=1;e<n.length;e++){let t=n[e];if(!(`text`in t)||t.joinPrev||t.text.length===0)continue;let r=n[e-1];if(!(`text`in r)||r.text.length===0||/\\s$/u.test(r.text)||/^\\s/u.test(t.text))continue;let i=[...r.text].at(-1),a=[...t.text][0],o=i?.codePointAt(0),s=a?.codePointAt(0);o===void 0||s===void 0||o===8203||s===8203||zo(r.text)||zo(t.text)||fp(r.text)||fp(t.text)||Po(o,s)&&(t.joinPrev=!0)}let c=new Set;for(let e of n)!(`text`in e)||e.fitTextRegionIndex===void 0||(c.has(e.fitTextRegionIndex)?e.joinPrev=!0:(e.fitTextRegionStart=!0,c.add(e.fitTextRegionIndex)));return Kf(n),n}function kp(e,t,n,r,i,a=[],o,s={},c=0,l=Co,u=0,d=36,f=n,p=!1,m=!1,h=!1,g,_=`bounded`,v,y=!1,b){if(b===void 0){let b=(b,x)=>kp(e,Yd(t),n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,{probeHeights:b,preparedFloatWrap:x});if(!o||_===`intrinsic`)return b(null);let x=o.lineWindow?void 0:yd(o.floats);return Zd(e=>b(e,x),e=>o.lineBoxH(e.ascent,e.descent,e.hasRuby,e.intendedSingle,e.eastAsian,e.gridCountSingle))}let{probeHeights:x,preparedFloatWrap:S}=b,C=[],w=[],T=0,E=0,D=0,O=new Set,k=0,A=0,j=0,M=0,N=0,ee=0,te=0,P=0,ne=!1,F=!0,I=n,L=0,R=o?.startPageY??0,z=()=>Wu(i),B=t.length>0&&t.every(e=>`text`in e&&e.metricOnly===!0||`imagePath`in e&&!!e.anchor),V=(e=0)=>{if(D=0,O.clear(),L=0,I=n,!o)return;let t=x?.[C.length];if(t===void 0)return;let r={xLeftPt:o.referenceXPt??o.paraX,xRightPt:(o.referenceXPt??o.paraX)+(o.referenceWidthPt??n),readingDirection:o.readingDirection??(p?`rtl`:`ltr`)};if(o.lineWindow){let r=o.lineWindow({topYPt:R,minimumStartWidthPt:1,squareMinimumStartWidthPt:e,probeHeightPt:t,paragraphXPt:o.paraX,maximumWidthPt:n,columnXPt:o.columnXPt,columnWidthPt:o.columnWidthPt});R=r.topYPt,L=r.xOffsetPt,I=r.maximumWidthPt}else{let i=Ld(R,1,t,o.paraX,n,S??yd(o.floats),o.columnXPt,o.columnXPt+o.columnWidthPt,r,e);R=i.topY,L=i.xOffset,I=i.maxWidth}},H=()=>_===`intrinsic`?1/0:I-(F?r:0),U=p?a.map(e=>({pos:e.pos*i,alignment:e.alignment,leader:e.leader})):[],re=d*i,ie=()=>{if(!p||!w.some(e=>`isTab`in e))return;let e=Ep(w.map(e=>({isTab:`isTab`in e,width:e.measuredWidth})),U,f-(L+I)+(F?r:0),f+c,re),t=0;for(let n=0;n<w.length;n++){let r=w[n];`isTab`in r&&(t+=e[n].width-r.measuredWidth,r.measuredWidth=e[n].width,r.leader=e[n].leader)}T+=t},ae=!1,oe=!1,se=!1,ce=(e,t=!1,n)=>{ie();let r=e===void 0?k||10:Math.max(k,e),a=A>0||j>0,s=a?A:r*i*.8,c=a?j:r*i*.2,l=ne?ee:s,u=ne?te:c,d=ne?P:M,f=N||(oe?Qf(M,r*i):s+c);C.push({segments:w,height:r,ascent:s,descent:c,visibleAscent:l,visibleDescent:u,visibleIntendedSingle:d,intendedSingle:M,gridCountSingle:f,xOffset:L,availWidth:I,topY:o?R:void 0,hasRuby:ae,eastAsian:oe,endsWithBreak:t,consumedEnd:n??K[0]?.src??ye}),o&&(R+=o.lineBoxH(s,c,ae,M,oe,f)),w=[],T=0,E=0,D=0,O.clear(),k=0,A=0,j=0,M=0,N=0,ee=0,te=0,P=0,ne=!1,ae=!1,oe=!1,se=!1,F=!1,V(z())},le=(e,t=e.text)=>Vc(e.fontFamily)*Ll(e,i)*qf(e)*[...t].length,ue=e=>{let t=e.bold?700:400,n=e.italic?`italic`:`normal`;return e.fontRoute?`${e.fontRoute.fingerprint}|${t}|${n}`:`implicit|${jf(e.bold,e.italic,1,e.fontFamily,s)}`},de=(e,t,n=t.text)=>{/\\S/.test(n)&&e.add(ue(t))},W=e=>{let t=O.size;for(let n of e)O.has(n)||(t+=1);return t},G=(e,t,n,r,a,o=0)=>{w.push(e),T+=t,E+=o,`text`in e&&(D+=le(e),de(O,e)),n>k&&(k=n),r>A&&(A=r),a>j&&(j=a);let s=!(`text`in e)||e.metricOnly!==!0;s&&(ne=!0,r>ee&&(ee=r),a>te&&(te=a));let c=0;if(!(`isTab`in e)&&!(`imagePath`in e)&&!(`mathNodes`in e)){let t=e;t.ruby&&(ae=!0),t.seaBreaks!==void 0&&Vo(t.text)&&(se=!0);let n=t.metricEastAsian===!0||Rl.test(t.text);!oe&&n&&(oe=!0);let r=t.smallCaps&&!t.vertAlign?t.fontSize*i:fe(t),a=n&&!t.ruby,o=t.textBoxLineFloor&&t.ruby?0:Math.max(Mf(t,r,a),t.textBoxLineFloor?Nf(t,r,a):0);o>M&&(M=o),s&&o>P&&(P=o),a&&(c=Qf(o,r))}else `isTab`in e||(c=r+a);c>N&&(N=c)},fe=e=>Ll(e,i),pe=null,me=t=>{t!==pe&&(e.font=t,pe=t)},he=t=>{if(t.kerning==null)return null;let n=e.fontKerning;return e.fontKerning=t.fontSize>=t.kerning?`normal`:`none`,n},ge=t=>{t!=null&&(e.fontKerning=t)},_e=(t,n=!1)=>{if(t.textLayoutService&&t.textShapeRequest){let e=t.textLayoutService.shape({...t.textShapeRequest,text:t.text,fontSizePt:fe(t),measure:!0,clusterGeometry:n});return n&&(t.shapedClusters=e.clusters,t.selectedFaceInkBounds=e.inkBounds??{xMinPt:0,xMaxPt:e.advancePt,ascentPt:e.ascentPt,descentPt:e.descentPt}),{width:e.advancePt,actualBoundingBoxAscent:e.ascentPt,actualBoundingBoxDescent:e.descentPt,fontBoundingBoxAscent:e.ascentPt,fontBoundingBoxDescent:e.descentPt}}me(jf(t.bold,t.italic,fe(t),t.fontFamily,s,t.fontRoute));let r=he(t),i=e.measureText(t.text);return ge(r),i},ve=(e,t)=>{if(!e.verticalRun)return 0;if(!v)throw Error(`Vertical glyph measurement capability is required for vertical text`);me(jf(e.bold,e.italic,fe(e),e.fontFamily,s,e.fontRoute));let n=he(e);try{return v.measureRunInkExtra(t)}finally{ge(n)}},ye={segIndex:t.length,charOffset:0},be=t.map((e,t)=>(e.src={segIndex:t,charOffset:0},`text`in e&&zo(e.text)&&(e.seaBreaks=Jo(e.text,{cjk:!0,kinsoku:l})),e)),K;if(!g)K=be;else if(g.segIndex>=be.length)K=[];else{let e=be[g.segIndex];if(g.charOffset>0)if(!(`text`in e)||g.charOffset>e.text.length)K=[];else{let t=e.text.slice(g.charOffset);K=t?[{...e,text:t,measuredWidth:0,src:{...g},punctuationCompressions:Uf(e,g.charOffset,e.text.length),seaBreaks:gp(e.seaBreaks,g.charOffset)},...be.slice(g.segIndex+1)]:be.slice(g.segIndex+1)}else K=be.slice(g.segIndex)}Dp(K.filter(e=>`text`in e),i,e=>_e(e).width+ve(e,e.text));let xe=e=>Yf(e,_e(e).width+ve(e,e.text),u,i),Se=(t,n,r=!1)=>{let a=r?t.text.length-n.length:0,o={...t,text:n,punctuationCompressions:Uf(t,Math.max(0,a),Math.max(0,a)+n.length)};if(t.textLayoutService&&t.textShapeRequest)return Yf(o,t.textLayoutService.shape({...t.textShapeRequest,text:n,fontSizePt:fe(t),measure:!0,clusterGeometry:!1}).advancePt+ve(t,n),u,i);me(jf(t.bold,t.italic,fe(t),t.fontFamily,s,t.fontRoute));let c=he(t),l=e.measureText(n).width;return ge(c),Yf(o,l+ve(t,n),u,i)},Ce=e=>`isTab`in e?e.measuredWidth||0:`imagePath`in e?e.widthPt*i:`mathNodes`in e?e.measuredWidth||0:`lineBreak`in e?0:xe(e),we=null;for(V(B?o?.paragraphMarkLineStartWidth??z():z());K.length>0;){let t=K.shift();if(`lineBreak`in t){ce(t.fontSize,!0),we=t.fontSize;continue}if(we=null,`isTab`in t){if(p&&!t.ptab){t.measuredWidth=0,G(t,0,t.fontSize,t.fontSize*i*.8,t.fontSize*i*.2);continue}let e=T+(F?r:0);if(t.ptab){t.resolvedAlignment=t.ptab.alignment;let r=t.ptab.relativeTo===`indent`?0:-c,a=t.ptab.relativeTo===`indent`?n:f,o=t.ptab.alignment===`left`?r:t.ptab.alignment===`center`?(r+a)/2:a,s=0;for(let e of K){if(`isTab`in e||`lineBreak`in e)break;s+=Ce(e)}let l=t.ptab.alignment===`center`?.5:+(t.ptab.alignment===`right`),d=o-e-s*l;if(d<=0){if(w.length>0){ce(void 0,!1,t.src),K.unshift(t);continue}d=0}if(t.measuredWidth=d,G(t,d,t.fontSize,t.fontSize*i*.8,t.fontSize*i*.2),t.ptab.alignment!==`left`)for(;K.length>0;){let e=K[0];if(`isTab`in e||`lineBreak`in e)break;if(K.shift(),`imagePath`in e){let t=e.widthPt*i;e.measuredWidth=t,G(e,t,e.heightPt,e.heightPt*i,0)}else if(`mathNodes`in e)G(e,e.measuredWidth||0,e.fontSize,e.mathAscent||0,e.mathDescent||0);else{let t=_e(e),n=Yf(e,t.width+ve(e,e.text),u,i);e.measuredWidth=n;let r=t.fontBoundingBoxAscent??t.actualBoundingBoxAscent??e.fontSize*i*.8,a=t.fontBoundingBoxDescent??t.actualBoundingBoxDescent??e.fontSize*i*.2;G(e,n,e.fontSize,r,a)}}continue}let o=zl(e+c,a.map(e=>({pos:e.pos*i,alignment:e.alignment,leader:e.leader})),d*i);t.resolvedAlignment=o?.alignment??`left`;let s=o?o.pos-c:e,l=o?Tp(o.alignment):`leading`;if(o&&l!==`leading`){let n=s;t.leader=o.leader;let r=0;for(let e of K){if(`isTab`in e||`lineBreak`in e)break;r+=Ce(e)}let a=l===`center`?.5:1,c=n-e-r*a;for(c<=0&&(c=t.fontSize*i*.25),t.measuredWidth=c,G(t,c,t.fontSize,t.fontSize*i*.8,t.fontSize*i*.2);K.length>0;){let e=K[0];if(`isTab`in e||`lineBreak`in e)break;if(K.shift(),`imagePath`in e){let t=e.widthPt*i;e.measuredWidth=t,G(e,t,e.heightPt,e.heightPt*i,0)}else if(`mathNodes`in e)G(e,e.measuredWidth||0,e.fontSize,e.mathAscent||0,e.mathDescent||0);else{let t=_e(e),n=Yf(e,t.width+ve(e,e.text),u,i);e.measuredWidth=n;let r=t.fontBoundingBoxAscent??t.actualBoundingBoxAscent??e.fontSize*i*.8,a=t.fontBoundingBoxDescent??t.actualBoundingBoxDescent??e.fontSize*i*.2;G(e,n,e.fontSize,r,a)}}continue}let m=s-e;if(o&&(t.leader=o.leader),m<=0){ce(void 0,!1,t.src),K.unshift(t);continue}if(T+m>H()&&w.length>0){ce(void 0,!1,t.src),K.unshift(t);continue}t.measuredWidth=m,G(t,m,t.fontSize,t.fontSize*i*.8,t.fontSize*i*.2);continue}if(`imagePath`in t){if(t.anchor){t.measuredWidth=0;continue}let e=t.widthPt*i,n=t.heightPt,r=t.heightPt*i;t.measuredWidth=e,w.length>0&&T+e>H()&&ce(void 0,!1,t.src),G(t,e,n,r,0);continue}if(`mathNodes`in t){let n=t.mathMetadata;if(!n||n.available===!1){let n=t.fontSize*i;me(jf(!1,!1,n,null,s));let r=e.measureText(t.fallbackText),a=r.width,o=r.fontBoundingBoxAscent??r.actualBoundingBoxAscent??n*.8,c=r.fontBoundingBoxDescent??r.actualBoundingBoxDescent??n*.2;t.measuredWidth=a,t.mathAscent=o,t.mathDescent=c,w.length>0&&T+a>H()&&ce(void 0,!1,t.src),G(t,a,t.fontSize,Math.max(o,n*.8),Math.max(c,n*.2));continue}let r=t.fontSize*i,a=n.widthEm*r,o=n.ascentEm*r,c=n.descentEm*r;t.measuredWidth=a,t.mathAscent=o,t.mathDescent=c;let l=Math.max(o,r*.8),u=Math.max(c,r*.2);w.length>0&&T+a>H()&&ce(void 0,!1,t.src),G(t,a,t.fontSize,l,u);continue}let o=t,g=_e(o),_=Yf(o,g.width+ve(o,o.text),u,i),b=o.fontSize,x=o.fontSize*i,S=g,C=fe(o);if(o.smallCaps&&!o.vertAlign&&C!==x){if(o.textLayoutService&&o.textShapeRequest){let e=o.textLayoutService.shape({...o.textShapeRequest,text:o.text||`X`,fontSizePt:x,measure:!0,clusterGeometry:!1});S={width:e.advancePt,actualBoundingBoxAscent:e.ascentPt,actualBoundingBoxDescent:e.descentPt,fontBoundingBoxAscent:e.ascentPt,fontBoundingBoxDescent:e.descentPt}}else{let t=e.font;e.font=jf(o.bold,o.italic,x,o.fontFamily,s,o.fontRoute),S=e.measureText(o.text||`X`),e.font=t}C=x}let O=tp(S,o.fontFamily,x,C,(o.metricEastAsian===!0||Rl.test(o.text))&&!o.ruby),k=O.ascent,A=O.descent;if(o.ruby&&(!o.textBoxLineFloor||o.textBoxVertical)&&(k+=vf(o.ruby.fontSizePt,o.ruby.hpsRaisePt,i,o,e,s)),o.fitTextRegionIndex!==void 0){if(o.fitTextRegionStart){let e=_;for(let t of K){if(!(`text`in t)||t.fitTextRegionIndex!==o.fitTextRegionIndex)break;e+=xe(t)}w.length>0&&T+e>H()&&ce(void 0,!1,o.src)}o.measuredWidth=_,G(o,_,b,k,A);continue}let j=o.text.replace(/ +$/,``),M=o.text.endsWith(` `)?_-Se(o,j):0,N=e=>{let t=e===void 0||`lineBreak`in e;return m&&(!t||h)},ee=(e,t,r)=>nf({widthPx:e,trailingSpacePx:t,lineWillJustify:N(r),wrapNarrowed:I!==n||L!==0}),te=ee(_,M,K[0]),P=o.seaBreaks!==void 0&&Vo(o.text),ne=new Set;de(ne,o,j);let R=(e,t,n)=>N(e)?rf({biasBudgetPx:t,resolvedMeasurementRouteCount:W(n)}):se||P?0:E*.25;if(!o.joinPrev&&w.length>0&&K[0]?.joinPrev&&!fp(o.text)&&!(o.seaBreaks&&o.seaBreaks.length>0)){let e=_,t=M,n=0,r=D,i=new Set(ne),a=o,s=o.text,c=(e,t=e.text)=>{r+=le(a,s),a=e,s=t};for(;n<K.length&&K[n].joinPrev;n++){let r=K[n];if(fp(r.text)){let n=[...r.text],a=0;for(;a<n.length&&Co.lineStartForbidden.has(n[a].codePointAt(0));)a++;if(a<n.length){let o=n.slice(0,a).join(``),s=Se(r,o);e+=s,o.length>0&&(c(r,o),de(i,r,o)),t=0;break}}let a=xe(r);e+=a,c(r),de(i,r);let o=r.text.replace(/ +$/,``);t=r.text.endsWith(` `)?a-Se(r,o):0}r+=le(a,s.replace(/ +$/,``)),T+ee(e,t,K[n])>H()+R(K[n],r,i)&&ce(void 0,!1,o.src)}if(P&&w.length>0&&(()=>{let e=w[w.length-1];return!(`text`in e)||e.text.endsWith(` `)})()){let e=_,t=M,n=0,r=D+le(o,j),i=new Set(ne);if(!o.text.endsWith(` `))for(;n<K.length;n++){let a=K[n];if(!(`text`in a)||a.seaBreaks===void 0||!Vo(a.text))break;let o=a,s=xe(o),c=o.text.replace(/ +$/,``);if(e+=s,t=o.text.endsWith(` `)?s-Se(o,c):0,r+=le(o,c),de(i,o,c),o.text.endsWith(` `)){n++;break}}let a=ee(e,t,K[n]);T+a>H()+R(K[n],r,i)&&a<=I&&ce(void 0,!1,o.src)}let z=R(K[0],D+le(o,j),ne),B=[...j],V=B.at(-1),U=B.slice(0,-1).join(``),re=y&&V!==void 0&&(w.length>0||U.length>0)&&tf(V,o.eastAsiaLanguage)&&T+Se(o,U)<=H()+z;if(T+te<=H()+z)o.measuredWidth=_,G(o,_,b,k,A,M);else if(re)o.measuredWidth=_,G(o,_,b,k,A,M);else if(fp(o.text)&&o.seaBreaks===void 0){let t=H()-T;me(jf(o.bold,o.italic,fe(o),o.fontFamily,s,o.fontRoute));let n=he(o),r=``;try{r=t>0?vp(e,o.text,t,zf(o,u),qf(o),Bf(o,i),o.verticalRun===!0,v,e=>Se(o,e)):``}finally{ge(n)}let a=[...o.text],c=[...r].length,d=w.length>0?0:1,f=_p(a,(y&&c<a.length&&(w.length>0||c>0)&&tf(a[c],o.eastAsiaLanguage)?c+1:null)??wo(a,c,l,d)),p=a.slice(0,f).join(``);if(p.length>0){let e=Se(o,p);G({...o,text:p,measuredWidth:e,punctuationCompressions:Uf(o,0,p.length)},e,b,k,A);let t=o.text.slice(p.length);t&&K.unshift({...o,text:t,punctuationCompressions:Uf(o,p.length,o.text.length),measuredWidth:0,src:{segIndex:o.src.segIndex,charOffset:o.src.charOffset+p.length}})}else if(w.length>0){let e=null,t=o.text.codePointAt(0),n=w[w.length-1];if(t!==void 0&&l.lineStartForbidden.has(t)&&`text`in n){let t=n,r=[...t.text],i=To(r,l,w.length>1?0:1);if(i>0){let n=r.slice(0,r.length-i).join(``),a=r.slice(r.length-i).join(``);if(e={...t,text:a,punctuationCompressions:Uf(t,n.length,t.text.length),measuredWidth:Se(t,a,!0),src:{segIndex:t.src.segIndex,charOffset:t.src.charOffset+n.length}},n){let e=Se(t,n);T-=t.measuredWidth-e,w[w.length-1]={...t,text:n,measuredWidth:e,punctuationCompressions:Uf(t,0,n.length)}}else T-=t.measuredWidth,w.pop()}}ce(void 0,!1,e?.src??o.src),K.unshift(o),e&&K.unshift(e)}else{let e=[...o.text],t=e.length>0?_p(e,1):0,n=e.slice(0,t).join(``);if(n){let e=Se(o,n);G({...o,text:n,measuredWidth:e,punctuationCompressions:Uf(o,0,n.length)},e,b,k,A);let t=o.text.slice(n.length);t&&K.unshift({...o,text:t,punctuationCompressions:Uf(o,n.length,o.text.length),measuredWidth:0,src:{segIndex:o.src.segIndex,charOffset:o.src.charOffset+n.length}})}}}else if(o.seaBreaks!==void 0){let e=H()-T,t=e=>Se(o,e),n=Bo(o.text),r=Xo(o.text,o.seaBreaks,0,e,t,n);if(r>0){let e=o.text.slice(0,r),t=Se(o,e);G({...o,text:e,measuredWidth:t,punctuationCompressions:Uf(o,0,e.length)},t,b,k,A);let n=o.text.slice(r);n&&K.unshift({...o,text:n,punctuationCompressions:Uf(o,r,o.text.length),measuredWidth:0,src:{segIndex:o.src.segIndex,charOffset:o.src.charOffset+r},seaBreaks:gp(o.seaBreaks,r)})}else if(w.length>0){let e=null,t=o.text.codePointAt(0),n=w[w.length-1];if(t!==void 0&&l.lineStartForbidden.has(t)&&`text`in n){let t=n,r=[...t.text],i=To(r,l,w.length>1?0:1);if(i>0){let n=r.slice(0,r.length-i).join(``),a=r.slice(r.length-i).join(``);if(e={...t,text:a,punctuationCompressions:Uf(t,n.length,t.text.length),measuredWidth:Se(t,a,!0),src:{segIndex:t.src.segIndex,charOffset:t.src.charOffset+n.length},seaBreaks:gp(t.seaBreaks,n.length)},n){let e=Se(t,n);T-=t.measuredWidth-e,w[w.length-1]={...t,text:n,measuredWidth:e,punctuationCompressions:Uf(t,0,n.length)}}else T-=t.measuredWidth,w.pop()}}ce(void 0,!1,e?.src??o.src),K.unshift(o),e&&K.unshift(e)}else{let r=o.seaBreaks[0]??o.text.length,i=o.text.slice(0,r),a=$o(i),s=Xo(i,a,0,e,t,n);s<=0&&(s=a.length>0?a[0]:i.length);let c=o.text.slice(0,s),l=Se(o,c);G({...o,text:c,measuredWidth:l,punctuationCompressions:Uf(o,0,c.length)},l,b,k,A);let u=o.text.slice(s);u&&K.unshift({...o,text:u,punctuationCompressions:Uf(o,s,o.text.length),measuredWidth:0,src:{segIndex:o.src.segIndex,charOffset:o.src.charOffset+s},seaBreaks:gp(o.seaBreaks,s)})}}else if(w.length===0){let t=H();me(jf(o.bold,o.italic,fe(o),o.fontFamily,s,o.fontRoute));let n=he(o),r=0;try{r=t>0?vp(e,o.text,t,zf(o,u),qf(o),Bf(o,i),o.verticalRun===!0,v,e=>Se(o,e)).length:0}finally{ge(n)}let a=[0,...$o(o.text),o.text.length],c=a.filter(e=>e<=r).at(-1)??0;for(c<=0&&(c=a[1]??o.text.length);o.text.startsWith(` `,c);)c+=1;if(c>=o.text.length)o.measuredWidth=_,G(o,_,b,k,A);else{let e=o.text.slice(0,c),t=Se(o,e);G({...o,text:e,measuredWidth:t,punctuationCompressions:Uf(o,0,e.length)},t,b,k,A),K.unshift({...o,text:o.text.slice(c),punctuationCompressions:Uf(o,c,o.text.length),measuredWidth:0,src:{segIndex:o.src.segIndex,charOffset:o.src.charOffset+e.length}})}}else{if(o.joinPrev){o.measuredWidth=_,G(o,_,b,k,A,M);continue}ce(void 0,!1,o.src),K.unshift(o)}}if(w.length>0?ce():we!==null&&ce(we),_===`bounded`)for(let e of C)for(let t of e.segments)!(`text`in t)||t.metricOnly||t.text.length===0||(t.shapedClusters=void 0,t.textLayoutService&&t.textShapeRequest&&_e(t,!0));return C}const Ap=e=>{let t=e.text;return typeof t==`string`?t:void 0},jp=e=>e.rtl===!0,Mp=e=>e.digitsAsAN===!0,Np=e=>`isTab`in e;function Pp(e){for(let t of e){if(jp(t))return!0;let e=Ap(t);if(e!==void 0&&yo(e))return!0}return!1}function Fp(e,t){let n=e.length;if(n===0)return{order:[],rtl:[]};let r=``,i=Array(n),a=Array(n),o,s=()=>{for(o||=[];o.length<r.length;)o.push(null);return o};for(let t=0;t<n;t++){let n=Ap(e[t])??``;if(i[t]=r.length,r+=n.length>0?n:``,a[t]=r.length,Np(e[t]))s()[i[t]]=`S`;else if(n.length>0&&(Mp(e[t])||jp(e[t]))){let n=s(),o=Mp(e[t]),c=jp(e[t]);for(let e=i[t];e<a[t];e++){let t=r.charCodeAt(e);o&&t>=48&&t<=57?n[e]=`AN`:c&&hf(r[e])&&(n[e]=`R`)}}}if(o)for(;o.length<r.length;)o.push(null);let{levels:c,paragraphLevel:l}=_o().computeLevels(r,t?`rtl`:`ltr`,o),u=Array(n),d=Array(n);for(let e=0;e<n;e++){let t=a[e];for(;t>i[e]&&r[t-1]===` `;)t--;let n=!1;for(let r=i[e];r<t;r++){let e=c[r];if(e!==255&&(e&1)==1){n=!0;break}}u[e]=n,d[e]=i[e];for(let r=i[e];r<t;r++){let t=c[r];if(t!==255&&(t&1)==1===n){d[e]=r;break}}}let{order:f}=bo(c,l,d);return{order:f,rtl:u}}function Ip(e,t){switch(e){case`center`:return`center`;case`both`:case`justify`:case`distribute`:case`lowKashida`:case`mediumKashida`:case`highKashida`:case`thaiDistribute`:return`justify`;case`end`:case`right`:return t?`left`:`right`;case`start`:case`left`:case void 0:default:return t?`right`:`left`}}function Lp(e){switch(e){case`both`:case`justify`:case`distribute`:case`lowKashida`:case`mediumKashida`:case`highKashida`:case`thaiDistribute`:return!0;default:return!1}}function Rp(e){return e===`distribute`}function zp(e){let t=e.leadingIndentPt+e.authoredFirstIndentPt+e.markerShiftPt;return{startPt:t,endPt:t+e.markerWidthPt}}function Bp(e){let t=e.authoredFirstIndentPt+e.markerShiftPt;return e.baseRtl?e.alignedLeadingEdgePt-t-e.markerWidthPt:e.alignedLeadingEdgePt+t}function Vp(e,t){let{numbering:n,markerInput:r,service:i}=t,a=n!=null&&(n.text!==``||n.picBulletImagePath!=null)&&(!e.baseRtl||(n?.suff||`tab`)===`tab`&&t.authoredFirstIndentPt<0);if(!n||!r||!i||!a)return e;let o=Wp(n,r,{authoredFirstIndentPt:t.authoredFirstIndentPt,physicalIndentLeftPt:e.physicalIndentLeftPt,tabStops:t.tabStops,defaultTabPt:t.defaultTabPt??e.defaultTabPt},i,t.clusterGeometry??!0);return{...e,firstIndentPt:o.bodyOffsetPt,numberingMarkerGeometry:o}}function Hp(e,t,n,r,i=!0){return r?{shape:r.shape({text:t,fontSizePt:e.fontSizePt*n,fonts:e.fonts,themeFonts:e.themeFonts,themeFontPresence:e.themeFontPresence,weight:e.weight,style:e.style,complexScript:e.complexScript,fontHint:e.fontHint,eastAsiaLanguage:e.eastAsiaLanguage,kerning:e.kerning,measure:!0,clusterGeometry:i}),fontSizePx:e.fontSizePt*n}:null}function Up(e,t,n){return t.find(t=>af(e,t))??zl(e,[...t],n)}function Wp(e,t,n,r,i=!0){let a=e.picBulletImagePath?``:ue(e.text,e.fontFamily??null),o=a?Hp(t,a,1,r,i)?.shape??null:null,s=e.picBulletImagePath?e.picBulletWidthPt??t.fontSizePt:o?.advancePt??0,c=e.jc===`right`?-s:e.jc===`center`?-s/2:0,l=n.authoredFirstIndentPt+c+s,u=e.suff||`tab`,d=l;if(u===`space`)d+=Hp(t,` `,1,r,i)?.shape.advancePt??0;else if(u===`tab`&&(d=0,l>0)){let e=Up(n.physicalIndentLeftPt+l,n.tabStops,n.defaultTabPt);d=e?e.pos-n.physicalIndentLeftPt:l}return{bodyOffsetPt:d,markerText:a,markerWidthPt:s,markerShiftPt:c,shape:o}}function Gp(e,t,n){let r=0,i=0;for(let t of e.content){let e=t.type===`paragraph`?n.paragraph(t):n.nestedTable(t);r=Math.max(r,e.minWidthPt),i=Math.max(i,e.maxWidthPt)}let a=Math.max(0,t.left)+Math.max(0,t.right);return{minWidthPt:r+a,maxWidthPt:Math.max(r,i)+a}}function Kp(e){let t=e.textShapeRequest,n=e=>e?[e.ascii??null,e.highAnsi??null,e.eastAsia??null,e.complexScript??null]:null;return Uc(`paragraph-intrinsic-text`,[e.textLayoutService?.fingerprint??null,t?[n(t.fonts),n(t.themeFonts),t.themeFontPresence?[t.themeFontPresence.ascii??!1,t.themeFontPresence.highAnsi??!1,t.themeFontPresence.eastAsia??!1,t.themeFontPresence.complexScript??!1]:null,t.fontHint??null,t.fontSizePt,t.weight??null,t.style??null,t.complexScript??!1,t.eastAsiaLanguage??null,t.eastAsiaFontCharset??null,t.genericFamily??null,t.letterSpacingPt??null,t.kerning??null]:null,e.bold,e.italic,Ll(e,1),e.fontFamily,e.fontRoute??null,e.charScale??1,e.charSpacing??0,e.fitTextPerGapPx??null,e.fitTextTrailingPadPx??null,e.fitTextRegionIndex??null,e.snapToCharacterGrid!==!1,e.tateChuYoko??!1,e.tateChuYoko?e.sourceRunIndex??null:null,e.ruby?[e.sourceRunIndex??null,e.ruby.text,e.ruby.fontSizePt,e.ruby.hpsRaisePt??null]:null,e.verticalRun??!1])}function qp(e){let t=[];for(let n of e){let e=t.at(-1);if(e&&`text`in e&&`text`in n&&Kp(e)===Kp(n)){let r=e.text.length,i=e.text+n.text,a=[...e.punctuationCompressions??[],...(n.punctuationCompressions??[]).map(e=>({end:r+e.end,adjustmentPt:e.adjustmentPt}))];t[t.length-1]={...e,text:i,punctuationCompressions:a.length>0?a:void 0,textShapeRequest:e.textShapeRequest?{...e.textShapeRequest,text:i}:void 0};continue}t.push({...n})}return t}function Jp(e,t,n,r,i,a){let o=0;for(let s of e){let e=Math.max(n,s.start),c=Math.min(r,s.end);if(e>=c)continue;let l=t.slice(e,c),u=e-s.start,d=c-s.start,f={...s.segment,text:l,punctuationCompressions:Uf(s.segment,u,d)};if(f.textLayoutService&&f.textShapeRequest){let e=f.textLayoutService.shape({...f.textShapeRequest,text:l,fontSizePt:Ll(f,1),measure:!0,clusterGeometry:!1});o+=Yf(f,e.advancePt,a,1);continue}i.context.font=jf(f.bold,f.italic,Ll(f,1),f.fontFamily,i.fontFamilyClasses,f.fontRoute),o+=Yf(f,i.context.measureText(l).width,a,1)}return o}function Yp(e,t,n){let r=t.characterGrid.active?t.characterGrid.deltaPt:0,i=0;for(let a=0;a<e.length;a+=1){let o=e[a];if(!(`text`in o)||o.text.length===0)continue;let s=[],c=``,l=e=>{let t=c.length;c+=e.text,s.push({segment:e,start:t,end:c.length})};for(l(o);a+1<e.length;){let t=e[a+1];if(!(`text`in t)||t.joinPrev!==!0)break;l(t),a+=1}let u=0;for(let e of Cp(c)){let a=e.replace(/\\s+$/u,``),o=u,l=u+a.length;if(u+=e.length,!a)continue;if(!fp(a)){i=Math.max(i,Jp(s,c,o,l,n,r));continue}let d=[0,...$o(a),a.length],f=[];for(let e=1;e<d.length;e+=1)f.push({text:a.slice(d[e-1],d[e]),start:o+d[e-1],end:o+d[e]});let p=[],m=f[0];for(let e=1;e<f.length;e+=1){let n=[...m.text].at(-1)?.codePointAt(0),r=f[e].text.codePointAt(0);n!==void 0&&r!==void 0&&!t.kinsoku.lineEndForbidden.has(n)&&!t.kinsoku.lineStartForbidden.has(r)?(p.push(m),m=f[e]):m={text:m.text+f[e].text,start:m.start,end:f[e].end}}m&&p.push(m);for(let e of p)i=Math.max(i,Jp(s,c,e.start,e.end,n,r))}}return i}function Xp(e,t,n){let r=(n.baseRtl?n.physicalIndentRightPt:n.physicalIndentLeftPt)+(t===0?n.firstIndentPt:0)+e.xOffset;return{startPt:r,endPt:r+e.segments.reduce((e,t)=>e+t.measuredWidth,0)}}function Zp(e,t,n,r,i,a){if(!Number.isFinite(n)||n<0)throw RangeError(`maximumWidthPt must be finite and non-negative`);if(n===0)return{minWidthPt:0,maxWidthPt:0};let o=qp(Op(e.runs,i)),s=Math.max(1,n-t.physicalIndentLeftPt-t.physicalIndentRightPt),c=o.length===0?[]:kp(r.context,o,s,t.firstIndentPt,1,[...t.tabStops],void 0,r.fontFamilyClasses,t.physicalIndentLeftPt,t.kinsoku,t.characterGrid.active?t.characterGrid.deltaPt:0,t.defaultTabPt,s+t.physicalIndentRightPt,t.baseRtl,t.isJustified,t.stretchLastLine,void 0,`intrinsic`,i.verticalGlyphMeasurement,t.overflowPunct!==!1),l=t.baseRtl?t.physicalIndentLeftPt:t.physicalIndentRightPt,u=0,d=0;c.forEach((e,n)=>{let r=Xp(e,n,t);u=Math.min(u,r.startPt),d=Math.max(d,r.endPt)});let f=a?zp({leadingIndentPt:t.baseRtl?t.physicalIndentRightPt:t.physicalIndentLeftPt,authoredFirstIndentPt:e.indentFirst,markerShiftPt:a.markerShiftPt,markerWidthPt:a.markerWidthPt}):void 0;f&&(u=Math.min(u,f.startPt),d=Math.max(d,f.endPt));let p=Math.min(n,Math.max(0,d-u+l)),m=Yp(o,t,r);for(let e of c){let t=0,n=e.segments.reduce((e,t)=>e+t.measuredWidth,0);for(let r of e.segments)t+=r.measuredWidth,`imagePath`in r&&!r.anchor||`mathNodes`in r?m=Math.max(m,r.measuredWidth):`isTab`in r&&(m=Math.max(m,r.resolvedAlignment===`left`?t:n))}let h=t.baseRtl?t.physicalIndentRightPt:t.physicalIndentLeftPt,g=h,_=Math.min(0,g),v=Math.max(0,g+m),y=h+t.firstIndentPt;return _=Math.min(_,y),v=Math.max(v,y+m),f&&(_=Math.min(_,f.startPt),v=Math.max(v,f.endPt)),{minWidthPt:Math.min(n,Math.max(0,v-_+l)),maxWidthPt:p}}function Qp(e,t){if(!e||t?.suppressBottom)return 0;let n=e.bottom;return!n||n.style===`none`?0:(n.space??0)+(n.width??0)/2}function $p(e){return e==null||e.style===`none`?null:e}function em(e,t){let n=$p(e),r=$p(t);return n==null||r==null?n==null&&r==null:n.style===r.style&&n.width===r.width&&(n.space??0)===(r.space??0)&&(n.color??null)===(r.color??null)}function tm(e,t){return!e||!t?!1:em(e.top,t.top)&&em(e.bottom,t.bottom)&&em(e.left,t.left)&&em(e.right,t.right)&&em(e.between,t.between)}function nm(e){return e?[e.top,e.right,e.bottom,e.left,e.between].some(e=>e!=null&&e.style!==`none`):!1}function rm(e,t){return!e||!t||e.framePr||t.framePr?!1:nm(e.borders)&&nm(t.borders)&&tm(e.borders,t.borders)}function im(e,t,n,r=!1){let i=(e,t)=>r?!!e&&!!t&&!!e.framePr&&!!t.framePr&&nm(e.borders)&&nm(t.borders)&&tm(e.borders,t.borders):rm(e,t),a=i(e,t),o=i(t,n),s=t.borders?.between;return Object.freeze({top:a?s&&s.style!==`none`?`between`:`none`:`top`,bottom:o?`none`:`bottom`})}function am(e,t,n,r,i,a){return Zp(e,t,n,r,i,a).maxWidthPt}function om(e){let t=e;return Uc(`w:framePr`,[t.dropCap,t.lines,t.wrap,t.hAnchor,t.vAnchor,t.hRule,t.hSpace,t.vSpace,t.w??null,t.h??null,t.x??null,t.y??null,t.xAlign??null,t.yAlign??null,t.__anchorLock===!0])}function sm(e){let t=new WeakMap;for(let n=0;n<e.length;){let r=e[n];if(r?.type!==`paragraph`||!r.framePr){n+=1;continue}let i=om(r.framePr),a=[r],o=[n],s=n+1;for(;s<e.length;){let t=e[s];if(t?.type!==`paragraph`||!t.framePr||om(t.framePr)!==i)break;a.push(t),o.push(s),s+=1}let c=Object.freeze({id:`${i}:${n}`,owner:r,members:Object.freeze(a),sourceIndices:Object.freeze(o),framePr:r.framePr});for(let e of a)t.set(e,c);n=s}return t}const cm=new WeakMap,lm=new WeakMap;function um(e){let t=sm(e);for(let n=0;n<e.length;n+=1){let r=e[n];if(r.type!==`paragraph`)continue;let i=t.get(r);i&&cm.set(r,i);let a=e[n-1],o=e[n+1],s=a?.type===`paragraph`&&t.get(a)===i?a:null,c=o?.type===`paragraph`&&t.get(o)===i?o:null;lm.set(r,im(i?s:a?.type===`paragraph`?a:null,r,i?c:o?.type===`paragraph`?o:null,i!==void 0))}}const dm=e=>cm.get(e),fm=e=>lm.get(e);function pm(e){return{story:e.story,containers:[...e.containers,{kind:`tableCell`}],lineNumberingEligible:!1}}function mm(e){return e.runs.some(e=>e.type===`text`&&!!e.ruby)}function hm(e){return e.runs.some(e=>e.type===`text`&&Rl.test(e.text))}function gm(e){for(let t of e){if(t.type===`paragraph`){if(hm(t))return!0;continue}if(t.type===`table`){for(let e of t.rows)for(let t of e.cells)if(gm(t.content))return!0}}return!1}function _m(e){return um(e.body),{kinsoku:So(e.settings),defaultTabPt:wp(e.settings),characterSpacingControl:e.settings?.characterSpacingControl,mathDefJc:e.settings?.mathDefJc,documentHasEastAsianText:gm(e.body),compat:{adjustLineHeightInTable:e.settings?.adjustLineHeightInTable??!1,useFeLayout:e.settings?.useFeLayout??!1,balanceSingleByteDoubleByteWidth:e.settings?.balanceSingleByteDoubleByteWidth??!1}}}function vm(e){let t=e.pageWidth-e.marginLeft-e.marginRight,n=e.columns;if(!n||n.count<=1)return[{xPt:e.marginLeft,wPt:Math.max(1,t)}];if(!n.equalWidth&&n.cols.length>0){let t=[],r=e.marginLeft;for(let e of n.cols)t.push({xPt:r,wPt:Math.max(1,e.widthPt)}),r+=e.widthPt+e.spacePt;return t}let r=Math.max(1,(t-(n.count-1)*n.spacePt)/n.count);return Array.from({length:n.count},(t,i)=>({xPt:e.marginLeft+i*(r+n.spacePt),wPt:r}))}function ym(e){switch(e){case`lines`:case`linesAndChars`:case`snapToChars`:return e;default:return`none`}}function bm(e){return e===`lines`||e===`linesAndChars`||e===`snapToChars`}function xm(e){return e===`linesAndChars`||e===`snapToChars`}function Sm(e,t){return{geometry:{pageWidth:t.pageWidth,pageHeight:t.pageHeight,marginTop:t.marginTop,marginRight:t.marginRight,marginBottom:t.marginBottom,marginLeft:t.marginLeft,headerDistance:t.headerDistance,footerDistance:t.footerDistance},columns:vm(t),columnSeparator:t.columns?.sep===!0,grid:{kind:ym(t.docGridType),linePitchPt:t.docGridLinePitch??null,charSpacePt:t.docGridCharSpace==null?null:t.docGridCharSpace/4096},textDirection:t.textDirection??`lrTb`,sectionBidi:!1,verticalAlignment:t.vAlign??`top`,lineNumbering:t.lineNumbering??void 0}}function Cm(e){return e.containers.some(e=>e.kind===`tableCell`)}function wm(e,t,n,r){let i=bm(t.grid.kind)&&t.grid.linePitchPt!=null&&t.grid.linePitchPt>0&&r.snapToGrid!==!1&&r.lineSpacing?.rule!==`exact`&&(!Cm(n)||e.compat.adjustLineHeightInTable),a=xm(t.grid.kind)&&t.grid.charSpacePt!=null,o=r.bidi===!0,s=r.numbering,c=s!=null&&(s.text!==``||s.picBulletImagePath!=null),l=o&&c&&(s.suff||`tab`)===`tab`&&r.indentFirst<0;return{lineGrid:{active:i,pitchPt:i?t.grid.linePitchPt:null},characterGrid:{active:a,deltaPt:a?t.grid.charSpacePt??0:0},physicalIndentLeftPt:o?r.indentRight:r.indentLeft,physicalIndentRightPt:o?r.indentLeft:r.indentRight,firstIndentPt:l?0:r.indentFirst,lineSpacing:r.lineSpacing,spaceBeforePt:r.spaceBefore,spaceAfterPt:r.spaceAfter,baseRtl:o,isJustified:Lp(r.alignment),stretchLastLine:Rp(r.alignment),tabStops:[...r.tabStops],hasRuby:mm(r),hasEastAsianText:hm(r),kinsoku:e.kinsoku,defaultTabPt:e.defaultTabPt,overflowPunct:r.overflowPunct!==!1,mathDefJc:e.mathDefJc}}Y({id:`word-default-line-number-distance`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/compatibility.test.ts#uses Word's observed 18pt line-number distance only when omitted`},description:`ECMA-376 §17.6.8 leaves an omitted line-number distance implementation-defined. Preserve Word-compatible 18pt placement only when the authored distance is absent.`}),Y({id:`word-continuous-section-page-number-restart`,evidence:{kind:`regression-test`,reference:`packages/docx/src/page-number-field-render.test.ts#restarts a spilling continuous section after its shared first page`},description:`Issue #804 records that Word anchors a continuous section page-number restart to the section first appearance on the shared physical page, so its next owned page advances from that appearance.`}),Y({id:`word-trailing-empty-mark-baseline-admission`,evidence:{kind:`regression-test`,reference:`packages/docx/src/paginate-trailing-empty-mark-fit.test.ts#KEEPS an inkless empty paragraph on the page when ink-bearing content follows and only its below-baseline whitespace overflows`},description:`At the unreserved physical body edge, Word admits an undecorated non-terminal empty paragraph mark by its baseline when later ink follows in the same flow.`}),Y({id:`word-book-fold-gutter-right-edge`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §§2.1.389, 2.1.391`},description:`For book-fold printing Word places the automatic gutter at the right-margin bisector edge, including reverse book-fold mode.`});function Tm(e){return e??18}function Em(e,t,n){return e+t-n}function Dm(e){return!e.hasContinuationBoundary&&e.inkless&&e.undecorated&&!e.keepNext&&e.markReservePt===0&&e.pageBottomIsUnreserved&&e.physicalRegionBottomIsActive&&e.hasFollowingInk?e.markBelowBaselinePt:0}function Om(){return`right`}function km(e){if(e.sectionOccurrenceId.length===0)throw RangeError(`Section occurrence id must not be empty`);if(e.columns.length===0)throw RangeError(`A page-flow section requires at least one column`);return Object.freeze({sectionOccurrenceId:e.sectionOccurrenceId,geometry:Object.freeze({...e.geometry}),columns:Object.freeze(e.columns.map(e=>Object.freeze({...e}))),textDirection:e.textDirection,sectionBidi:e.sectionBidi??!1,grid:Object.freeze(e.grid??{kind:`none`,linePitchPt:null,charSpacePt:null})})}function Am(e){return Mm(e.geometry.marginTop)}function jm(e){return e.geometry.pageHeight-Mm(e.geometry.marginBottom)}function Mm(e){return Math.abs(e)}function Nm(e){return{pageWidth:e.pageHeight,pageHeight:e.pageWidth,marginLeft:e.marginTop,marginTop:e.marginRight,marginRight:e.marginBottom,marginBottom:e.marginLeft,headerDistance:e.headerDistance,footerDistance:e.footerDistance}}function Pm(e){return{pageWidth:e.pageHeight,pageHeight:e.pageWidth,marginTop:e.marginLeft,marginRight:e.marginTop,marginBottom:e.marginRight,marginLeft:e.marginBottom,headerDistance:e.headerDistance,footerDistance:e.footerDistance}}function Fm(e){return e===`tbRl`||e===`tbRlV`||e===`tbLrV`||e===`btLr`}function Im(e,t){if(!Number.isInteger(t)||t<0)throw RangeError(`Physical page index must be a non-negative integer`);let{pageWidth:n,pageHeight:r}=e.physicalGeometry,{marginTop:i,marginRight:a,marginBottom:o,marginLeft:s}=e.physicalGeometry,c=e.bookFoldPrinting||e.bookFoldRevPrinting;return c?(n/=2,Om()===`right`&&(a+=e.gutterPt)):e.printTwoOnOne?(r/=2,i+=e.gutterPt):e.gutterAtTop&&!e.mirrorMargins?i+=e.gutterPt:e.rtlGutter?a+=e.gutterPt:s+=e.gutterPt,!c&&!e.printTwoOnOne&&e.mirrorMargins&&t%2==1&&([s,a]=[a,s]),{...e.physicalGeometry,pageWidth:n,pageHeight:r,marginTop:i,marginRight:a,marginBottom:o,marginLeft:s}}function Lm(e,t,n){let r=Im(t,n),i=Fm(t.textDirection)?Nm(r):r;return Object.freeze({...e,geometry:Object.freeze(i),columns:Object.freeze(vm({...i,titlePage:!1,evenAndOddHeaders:!1,columns:t.columns}).map(e=>Object.freeze(e)))})}function Rm(e){return{pageWidth:e.pageWidth,pageHeight:e.pageHeight,marginTop:e.marginTop,marginRight:e.marginRight,marginBottom:e.marginBottom,marginLeft:e.marginLeft,headerDistance:e.headerDistance,footerDistance:e.footerDistance}}function zm(e,t=!1){let n=e.docGridType===`lines`||e.docGridType===`linesAndChars`||e.docGridType===`snapToChars`?e.docGridType:`none`;return Object.freeze({geometry:Object.freeze(Rm(e)),columns:Object.freeze(vm(e).map(e=>Object.freeze(e))),columnSeparator:e.columns?.sep===!0,grid:Object.freeze({kind:n,linePitchPt:e.docGridLinePitch??null,charSpacePt:e.docGridCharSpace==null?null:e.docGridCharSpace/4096}),textDirection:e.textDirection??`lrTb`,sectionBidi:t,verticalAlignment:e.vAlign??`top`,...e.lineNumbering===null||e.lineNumbering===void 0?{}:{lineNumbering:Object.freeze({...e.lineNumbering})}})}function Bm(e){if(!Number.isInteger(e.bodyLength)||e.bodyLength<0||e.occurrences.length===0)throw RangeError(`A body section index requires a non-negative length and occurrences`);let t=Array(e.bodyLength+1),n=0;e.occurrences.forEach((r,i)=>{let a=i===e.occurrences.length-1;if(r.ordinal!==i||r.startBodyIndex!==n||r.endBodyIndex!==(a?e.bodyLength-1:r.markerBodyIndex)||r.final!==a||(a?r.markerBodyIndex!==null:r.markerBodyIndex===null))throw RangeError(`Invalid section occurrence ${i}`);for(let e=r.startBodyIndex;e<=r.endBodyIndex;e+=1)t[e]=i;n=r.endBodyIndex+1});let r=e.occurrences.length-1;t[e.bodyLength]=r;let i=Object.freeze([...e.occurrences]),a=Object.freeze(t);return Object.freeze({occurrences:i,sectionAtBodyIndex(e){if(!Number.isInteger(e)||e<0||e>=a.length)throw RangeError(`Body index ${e} is outside the retained section index`);return i[a[e]]}})}function Vm(e,t){let n=t[0].logicalTotalRows,r=0;for(let i of t){if(i.logicalTotalRows!==n||!Number.isInteger(i.rowCount)||i.rowCount<0||i.logicalRowOffset!==r)throw Error(`Parser-owned adjacent table sequence ${e} is inconsistent`);r+=i.rowCount}if(r!==n)throw Error(`Parser-owned adjacent table sequence ${e} is incomplete`)}function Hm(e){let t=[],n=null,r=[],i=()=>{r.length>0&&Vm(n,r),r.length===1?t.push(Object.freeze({kind:`body-element`,element:r[0].element})):r.length>1&&t.push(Object.freeze({kind:`adjacent-table-group`,logicalSequenceId:n,tables:Object.freeze(r.map(e=>e.element))})),n=null,r=[]};for(let{element:a,table:o}of e){if(a.type===`table`&&o!==null){r.length>0&&n!==o.logicalSequenceId&&i(),n=o.logicalSequenceId,r.push(Object.freeze({element:a,logicalRowOffset:o.logicalRowOffset,logicalTotalRows:o.logicalTotalRows,rowCount:o.rowCount}));continue}i(),t.push(Object.freeze({kind:`body-element`,element:a}))}return i(),Object.freeze(t)}Y({id:`word-terminal-column-break`,evidence:{kind:`regression-test`,reference:`packages/docx/src/pagination.test.ts#ignores a terminal last-column break before a hard page boundary`},description:`The established pagination regression contract does not materialize a column transition when no body flow content occurs before the next forced page or non-continuous section boundary.`}),Y({id:`word-pre-break-anchor-paragraph`,evidence:{kind:`regression-test`,reference:`packages/docx/src/pagination.test.ts#does not push an anchor-only pre-break paragraph to a new page just for its empty mark`},description:`The established pagination regression contract keeps an anchor-only paragraph immediately before an authored page break in the pre-break flow region without charging its otherwise visible paragraph mark.`}),Y({id:`word-pre-break-inline-drawing-group`,evidence:{kind:`regression-test`,reference:`packages/docx/src/pagination.test.ts#moves a preceding image with its pre-break callout when the pair only fits fresh`},description:`The established pagination regression contract relocates a preceding inline DrawingML resource with an immediately following host-owned anchor paragraph before an authored page break when the pair fits only in a fresh flow region.`}),Y({id:`word-continuous-section-mark-spacing`,evidence:{kind:`regression-test`,reference:`packages/docx/src/body-layout-input.test.ts#projects mutually exclusive collapsed-mark and drop-previous-after roles`},description:`The retained body input projects the established continuous-section empty-mark spacing behavior into one mutually exclusive role before pagination.`}),Y({id:`word-contextual-spacing-per-side`,evidence:{kind:`regression-test`,reference:`packages/docx/src/contextual-spacing-body-paint.test.ts#paints the adjudicated six-case gap table`},description:`For same-style adjacent paragraphs, contextualSpacing removes only the contribution owned by each toggling side; a current-only toggle preserves the previous paragraph spaceAfter contribution.`}),Y({id:`word-empty-keep-next-bridge`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/body-paginator-production.test.ts#bridges an undecorated empty keepNext mark through the following paragraph`},description:`Word print pagination treats an undecorated empty keep-with-next paragraph as a bridge: the following paragraph is admitted completely with the first indivisible content of its successor.`}),Y({id:`word-automatic-keep-next-start-spacing`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/body-paginator-production.test.ts#suppresses leading spacing when a keepNext unit moves to an automatic page`},description:`When automatic overflow relocates a keep-with-next unit to a fresh physical page, suppress the leading paragraph space-before for that grouped relocation without changing ordinary overflow or authored-break spacing.`}),Y({id:`word-trailing-space-after-fit-admission`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/paragraph-pagination.test.ts#admits final visible content when only authored spaceAfter crosses the region edge`},description:`Admit the final visible paragraph content at a flow-region edge when only its authored trailing space crosses the edge, while retaining that space for placement and paint.`}),Y({id:`word-vertical-rl-final-line-baseline-admission`,evidence:{kind:`office-observation`,syntheticFixtureId:`vertical-rl-final-line-baseline-admission`,application:`Microsoft Word`,version:`16.111.1`,platform:`macOS 26.5.2`},description:`In a vertical-rl section, Word admits the final visible text column when its transformed baseline and retained visible ink remain inside the block-end edge even if the complete logical line box crosses that edge. The complete retained advance remains authoritative after admission.`});function Um(e){return Math.max(0,e.advancePt-Math.min(e.authoredSpaceAfterPt,e.retainedSpaceAfterPt))}function Wm(e){return e.origin.yPt+(e.inkBounds?.descentPt??0)}function Gm(e){if(e.kind===`resource`||e.kind===`drawing`)return e.bounds.yPt+e.bounds.heightPt;if(e.kind===`anchor-host`)return null;if(e.kind===`tab`){let t=e.leaderGlyphs??[];return t.length>0?Math.max(...t.map(Wm)):null}let t=e.paintOps??[],n=t.length>0?t.map(t=>e.origin.yPt+t.offset.yPt+(t.blockAxisInkBounds?.endPt??t.inkBounds?.descentPt??0)):[e.origin.yPt];for(let t of e.decorations){let e=t.widthPt/2;n.push(t.from.yPt+e,t.to.yPt+e);for(let r of t.path??[])n.push(r.yPt+e)}for(let t of e.highlightFragments??[])n.push(t.rect.yPt+t.rect.heightPt);for(let t of e.runBorderFragments??[]){let e=t.widthPt/2;n.push(t.from.yPt+e,t.to.yPt+e)}for(let t of e.emphasis?.glyphs??[])n.push(Wm(t));for(let t of e.ruby?.paintOps??[])n.push(Wm(t));for(let t of e.emphasis?.paths??[]){let e=t.stroke===null?0:t.strokeWidthPt/2;for(let r of t.points)n.push(r.yPt+e)}return Math.max(...n)}function Km(e){if(e.writingMode!==`vertical-rl`||e.logicalLineBoxExtentPt<=e.availableBlockExtentPt)return e.logicalLineBoxExtentPt;let t=e.paragraph.lines.at(-1);if(!t||t.placements.some(e=>e.kind===`text`&&(e.paintOps??[]).some(e=>e.glyphOrientation!==void 0&&e.blockAxisInkBounds===void 0)))return e.logicalLineBoxExtentPt;let n=t.placements.flatMap(e=>{let t=Gm(e);return t===null?[]:[t]});if(n.length===0||e.paragraph.shading)return e.logicalLineBoxExtentPt;for(let t of e.paragraph.borders){let e=t.widthPt/2;n.push(t.from.yPt+e,t.to.yPt+e)}if(e.paragraph.paragraphMark&&!e.paragraph.paragraphMark.hidden){let t=e.paragraph.paragraphMark.bounds;n.push(t.yPt+t.heightPt)}return Math.max(0,Math.max(...n)-e.paragraph.flowBounds.yPt)}function qm(e){return e.keepNext&&e.inkless&&e.undecoratedMark}function Jm(e,t){let n=e[t];if(n?.kind!==`body-block`||n.block.kind!==`paragraph`)return;let r=e[t+1],i=e[t+2],a=n.block.inkless===!0&&r?.kind===`begin-section`&&r.section.startType===`continuous`;return a&&n.block.spaceBeforePt===0?`collapse-mark`:a?`suppress-before`:n.block.inkless===!0&&r?.kind===`body-block`&&r.block.kind===`paragraph`&&r.block.inkless===!0&&r.block.spaceBeforePt===0&&i?.kind===`begin-section`&&i.section.startType===`continuous`?`drop-previous-after`:void 0}function Ym(e){return e.drawings.length>0&&e.lines.every(e=>e.placements.every(e=>e.kind===`drawing`||e.kind===`anchor-host`))}function Xm(e){return e.lines.some(e=>e.placements.some(e=>e.kind===`resource`&&(e.resourceKind===`image`||e.resourceKind===`chart`)&&e.bounds!==void 0&&e.bounds.widthPt>0&&e.bounds.heightPt>0))}function Zm(e,t){if(!Ym(e))return null;let n=e.drawings.filter(e=>e.anchorLayer?.verticalOwnership===`host`&&Number.isFinite(e.flowBounds.xPt)&&Number.isFinite(e.flowBounds.yPt)&&Number.isFinite(e.flowBounds.widthPt)&&Number.isFinite(e.flowBounds.heightPt)&&e.flowBounds.widthPt>0&&e.flowBounds.heightPt>0);if(n.length!==e.drawings.length)return null;let r=Math.max(...n.map(e=>e.flowBounds.yPt+e.flowBounds.heightPt));return Math.max(0,r-t)}function Qm(e){if(!Ym(e))return null;let{paragraphMark:t,...n}=e;return Object.freeze({...n,advancePt:0,flowBounds:Object.freeze({...e.flowBounds,heightPt:0})})}function $m(e){let t=new Set,n=!1;for(let r=e.length-1;r>=0;--r){let i=e[r];if(i.kind===`body-block`){n=i.block.kind!==`paragraph`||!i.block.pageBreakBefore;continue}if(i.kind===`adjacent-table-group`){n=!0;continue}if(i.kind===`authored-break`){i.break===`column`?n&&t.add(r):n=!1;continue}i.kind===`begin-section`&&i.section.startType!==`continuous`&&(n=!1)}return t}function eh(e){switch(e){case`continuous`:case`nextColumn`:case`nextPage`:case`oddPage`:case`evenPage`:return e;default:return`nextPage`}}function th(e,t,n){let r=n===null?null:`section:${n}`,i=n=>e[n]===null?null:{story:t,storyInstance:r===null?n:`${r}:${n}`,path:[]};return Object.freeze({default:i(`default`),first:i(`first`),even:i(`even`)})}function nh(e){return{...e.geometry,titlePage:e.titlePage,evenAndOddHeaders:!1,sectionStart:e.startType,columns:e.columns,textDirection:e.textDirection,docGridType:e.docGridType,docGridLinePitch:e.docGridLinePitch,docGridCharSpace:e.docGridCharSpace,pageNumType:e.pageNumType,vAlign:e.vAlign,lineNumbering:e.lineNumbering}}function rh(e,t){let n=e.markerBodyIndex;return Object.freeze({sectionOccurrenceId:e.sectionOccurrenceId,source:Object.freeze(n===null?{story:`body`,storyInstance:`body`,path:Object.freeze([])}:{story:`body`,storyInstance:`body`,path:Object.freeze([n])}),startType:eh(e.startType),context:Object.freeze(zm(nh(e),e.sectionBidi)),pageNumbering:Object.freeze({start:e.pageNumType?.start??null,format:e.pageNumType?.fmt??null}),titlePage:e.titlePage,evenAndOddHeaders:t.evenAndOddHeaders,headers:th(e.headers,`header`,n),footers:th(e.footers,`footer`,n),pageBordersAuthored:e.pageBordersAuthored,pageBorders:e.pageBorders,pageLayout:Object.freeze({physicalGeometry:Object.freeze({...e.geometry}),columns:e.columns,textDirection:e.textDirection??`lrTb`,gutterPt:e.gutterPt,rtlGutter:e.rtlGutter,...t.pageLayoutSettings})})}function ih(e){let t=new Map(e.sectionIndex.occurrences.map(t=>[t.sectionOccurrenceId,rh(t,e)])),n=e.sectionIndex.occurrences[0];if(!n)throw Error(`DOCX body requires a final section owner`);let r=t.get(n.sectionOccurrenceId),i=e.sequence.map(e=>{if(e.kind!==`begin-section`)return e;let n=t.get(e.section.sectionOccurrenceId);if(!n)throw Error(`Missing body section owner: ${e.section.sectionOccurrenceId}`);return Object.freeze({...e,section:n})});return Zc({source:{story:`body`,storyInstance:`body`,path:[]},initialSection:r,sequence:i.map((e,t)=>{if(e.kind!==`body-block`||e.block.kind!==`paragraph`)return e;let n=Jm(i,t);return n===void 0?e:Object.freeze({...e,block:Object.freeze({...e.block,continuousSectionRole:n})})}),parserDiagnostics:e.parserDiagnostics??[],endnoteIds:e.endnoteIds??[],noteLayoutSettings:e.noteLayoutSettings},`DOCX body layout input`)}function ah(e){return!(e.runs??[]).some(e=>e.type===`text`?e.text.length>0:!0)}Y({id:`word-exact-row-height-bottom-padding`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.180(d)`},description:`Word adds the largest bottom cell margin to an exact trHeight instead of treating that margin as part of the authored height.`}),Y({id:`word-nil-table-border-suppression`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.169`},description:`Word treats a table border value of none as omission while nil remains authored and suppresses the complete shared edge.`}),Y({id:`word-spaced-cell-inside-border-conflict`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §§2.1.136, 2.1.138`},description:`With non-zero cell spacing, Word retains the narrow conditional tcBorders insideH/insideV conflict against the corresponding table inside border.`}),Y({id:`word-table-indent-all-alignments`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.155`},description:`Word applies tblInd as a signed leading-edge translation for every table alignment, reversing the translation for bidi visual order.`}),Y({id:`word-exact-row-vertical-clip-only`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/table.test.ts#clips an overflowing merged owner when every row in its span is exact`},description:`Preserve the established exact-row overflow behavior that clips the owned vertical interval without clipping nested table ink horizontally to the cell box.`}),Y({id:`word-over-page-cant-split-clip`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.120`},description:`Word starts an over-page cantSplit row on a fresh page and clips its overflow instead of synthesizing a row continuation.`}),Y({id:`word-positioned-table-adjacency-exclusion`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.149(a)`},description:`Word excludes effectively positioned tables from the logical adjacent-table sequence before retained layout consumes the parser-owned sequence identity.`}),Y({id:`word-table-border-weight-precedence`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.169`},description:`Use the documented Word border numbers for shared-cell conflict weight and force dotted and dashed borders to a complete weight of one.`}),Y({id:`word-omitted-row-height-rule-at-least`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.180`},description:`Treat an omitted trHeight hRule as atLeast while retaining an explicitly authored auto rule as authored input.`}),Y({id:`word-authored-auto-row-height-floor`,evidence:{kind:`regression-test`,reference:`packages/docx/src/table-row-height.test.ts#auto with @val — @val is honored as a lower bound`},description:`Preserve the established legacy-model behavior that an auto row with an authored height value uses that value as a lower bound.`}),Y({id:`word-effective-floating-table-positioning`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.162`},description:`Use parser-retained effective positioning status rather than lexical tblpPr presence to decide whether a table leaves ordinary flow.`}),Y({id:`word-table-cell-spacing-scope-shadow`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §§2.1.152, 2.1.153, 2.1.154`},description:`At each table-cell-spacing precedence scope, pct, auto, and nil resolve to zero and shadow lower scopes instead of being treated as absent.`}),Y({id:`word-table-margin-scope-shadow`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §§2.1.116, 2.1.125, 2.1.146, 2.1.177`},description:`Preserve the documented scope-specific treatment of non-dxa table cell margins: leading/trailing defaults may resolve to zero while cell/exception and nil top/bottom values remain ignored.`}),Y({id:`word-first-row-table-exception-scope`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §§2.1.156, 2.1.158, 2.1.167`},description:`Apply the supported first-row table-property exception facts at table scope, including authored preferred-width shadowing.`}),Y({id:`word-trailing-structural-cell-marker`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/compatibility.test.ts#drops only an empty trailing paragraph after a non-paragraph cell block`},description:`Exclude the required empty trailing cell paragraph from row-height and vertical-alignment measurements when it follows a visible non-paragraph block.`}),Y({id:`word-cell-vertical-alignment-ink-block`,evidence:{kind:`regression-test`,reference:`packages/docx/src/cell-valign-leading-spacing.test.ts#inked block is vertically centred in the cell (midpoint = cell midpoint)`},description:`Center or bottom-align the visible cell ink block without charging the first paragraph spaceBefore or final paragraph spaceAfter at the cell edges.`}),Y({id:`word-vertical-merge-terminal-border`,evidence:{kind:`regression-test`,reference:`packages/docx/src/cell-border-conflict-render.test.ts#uses the final continuation cell border at the bottom of a vertical merge`},description:`Resolve the bottom edge of a vertically merged cell from its terminal continuation cell before applying shared-edge conflict rules.`}),Y({id:`word-vertical-section-upright-block-table`,evidence:{kind:`regression-test`,reference:`packages/docx/src/vertical-table-upright.test.ts#the table advances the flow by its PHYSICAL WIDTH; body text stays vertical`},description:`Paint a block table in an upright physical frame within a vertical section and charge its physical width as the body-flow advance.`});function oh(e,t){return Math.max(0,e??0)+Math.max(0,...t)}function sh(e){return e!=null&&e!==`none`}function ch(e,t,n){return n?e-t:e+t}function lh(e){return e.spacingPt>0&&!sh(e.directStyle)&&sh(e.conditionalInsideStyle)}function uh(e,t){return Object.freeze({xPt:t.xPt,yPt:e.yPt,widthPt:t.widthPt,heightPt:e.heightPt})}function dh(e){return e.compatibility===`word`&&e.availableHeightPt+e.epsilonPt>=e.freshPageHeightPt}const fh=Object.freeze([`single`,`thick`,`double`,`dotted`,`dashed`,`dotDash`,`dotDotDash`,`triple`,`thinThickSmallGap`,`thickThinSmallGap`,`thinThickThinSmallGap`,`thinThickMediumGap`,`thickThinMediumGap`,`thinThickThinMediumGap`,`thinThickLargeGap`,`thickThinLargeGap`,`thinThickThinLargeGap`,`wave`,`doubleWave`,`dashSmallGap`,`dashDotStroked`,`threeDEmboss`,`threeDEngrave`,`outset`,`inset`]),ph=Object.freeze({single:1,thick:2,double:3,dotDash:8,dotDotDash:9,triple:10,thinThickSmallGap:11,thickThinSmallGap:12,thinThickThinSmallGap:13,thinThickMediumGap:14,thickThinMediumGap:15,thinThickThinMediumGap:16,thinThickLargeGap:17,thickThinLargeGap:18,thinThickThinLargeGap:19,wave:20,doubleWave:21,dashSmallGap:22,dashDotStroked:23,threeDEmboss:24,threeDEngrave:25,outset:26,inset:27});function mh(e,t){return e===`dotted`||e===`dashed`?1:Math.max(0,t)*8*(ph[e]??0)}function hh(e,t){return e===`nil`||t===`nil`}function gh(e,t){return t?e:`atLeast`}function _h(e,t){return e===`pct`||e===`auto`||e===`nil`?0:t}function vh(e){return e.kind===`dxa`?e.dxaValuePt:e.scope===`cell`||e.scope===`exception`?null:(e.edge===`start`||e.edge===`end`)&&(e.kind===`pct`||e.kind===`auto`||e.kind===`nil`)?0:null}const yh=new WeakMap;function bh(e){return yh.get(e)??[]}function xh(e){let t=bh(e);if(t.length===0)return e.runs;let n=[],r=0;for(let i=0;i<=e.runs.length;i+=1){for(;t[r]?.publicRunIndex===i;)n.push(t[r].run),r+=1;i<e.runs.length&&n.push(e.runs[i])}return n}function Sh(e){return bh(e).length>0}function Ch(e){let t=e.__pageLayoutSettings;return Zc({mirrorMargins:t?.mirrorMargins===!0,gutterAtTop:t?.gutterAtTop===!0,bookFoldPrinting:t?.bookFoldPrinting===!0,bookFoldRevPrinting:t?.bookFoldRevPrinting===!0,printTwoOnOne:t?.printTwoOnOne===!0},`DOCX page layout settings input`)}function wh(e){let t=e.__noteLayoutSettings;return Zc({footnotePosition:t?.footnotePosition??`pageBottom`,endnotePosition:t?.endnotePosition??`docEnd`},`DOCX note layout settings input`)}function Th(e){return Object.freeze(e?Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`number`)):{})}function Eh(e){return Object.freeze({...e,pageGeometry:Th(e.pageGeometry)})}const Dh=new WeakMap,Oh=new WeakMap,kh=new WeakMap,Ah=new WeakMap;function jh(e){let t=kh.get(e);if(t)return t;let n=Zc({table:e.__tableLayout??null,rows:e.rows.map(e=>({row:e.__tableRowLayout??null,cells:e.cells.map(e=>e.__tableCellLayout??null)}))},`DOCX table acquisition input`);return kh.set(e,n),n}function Mh(e){return qh(e).ordinaryFlow}function Nh(e){return qh(e).positioning===null?null:e.tblpPr??null}function Ph(e){return{leftFromTextPt:e.leftFromText,rightFromTextPt:e.rightFromText,topFromTextPt:e.topFromText,bottomFromTextPt:e.bottomFromText,horzAnchor:e.horzAnchor,horzSpecified:e.horzSpecified,vertAnchor:e.vertAnchor,xPt:e.tblpX,yPt:e.tblpY,...e.tblpXSpec==null?{}:{xAlign:e.tblpXSpec},...e.tblpYSpec==null?{}:{yAlign:e.tblpYSpec}}}function Fh(e,t){if(e===null)return null;let n=e.trim(),r=t&&n.endsWith(`%`)?n.slice(0,-1):n;if(r.length===0)return null;let i=Number(r);return Number.isFinite(i)?i:null}function Ih(e){return e.value?.trim().endsWith(`%`)?`pct`:e.kind??`dxa`}function Lh(e){if(!e)return null;let t=e.value?.trim()??``,n=Ih(e);if(n===`dxa`){let t=Fh(e.value??`0`,!1);return t===null?null:{kind:`dxa`,value:t/20}}if(n!==`pct`)return null;let r=Fh(e.value??`0`,!0);return r===null?null:{kind:`pct`,value:t.endsWith(`%`)?r/100:r/5e3}}function Rh(e){let t=Lh(e);return t?.kind===`dxa`?t.value:null}function zh(e){let t=Fh(e??null,!1);return t===null?null:t/20}function Bh(e){return e===`exact`||e===`atLeast`?e:`auto`}function Vh(e){return{rule:gh(Bh(e.rule),e.ruleAuthored),valuePt:zh(e.value)}}function Hh(e){if(e.rowHeight===null||!Number.isFinite(e.rowHeight))return null;let t=Bh(e.rowHeightRule);return{rule:t===`auto`?`atLeast`:t,valuePt:e.rowHeight}}function Uh(...e){for(let t of e){if(!t)continue;let e=_h(Ih(t),Rh(t));if(e!==null)return e}return null}function Wh(e,t,n){if(!e)return null;let r=Ih(e);return vh({kind:r,dxaValuePt:r===`dxa`?zh(e.value??`0`):null,scope:t,edge:n})}function Gh(e,t,n,r,i,a,o){let s=e.bidiVisual===!0,c=(e,t)=>{let n=t===`left`?s?`end`:`start`:s?`start`:`end`;return{width:e?.[t]??e?.[n],edge:n}},l=(e,...t)=>{for(let n of t){let t=Wh(n.width,n.scope,n.edge??e);if(t!==null)return t}return null},u=c(r,`left`),d=c(i,`left`),f=c(a,`left`),p=c(o,`left`),m=c(r,`right`),h=c(i,`right`),g=c(a,`right`),_=c(o,`right`),v=e=>!n&&e!=null&&Number.isFinite(e)?e:null;return{top:l(`top`,{width:r?.top,scope:`cell`})??v(t.marginTop)??l(`top`,{width:i?.top,scope:`exception`},{width:a?.top,scope:`table`},{width:o?.top,scope:`style`})??e.cellMarginTop,bottom:l(`bottom`,{width:r?.bottom,scope:`cell`})??v(t.marginBottom)??l(`bottom`,{width:i?.bottom,scope:`exception`},{width:a?.bottom,scope:`table`},{width:o?.bottom,scope:`style`})??e.cellMarginBottom,left:l(u.edge,{...u,scope:`cell`})??v(t.marginLeft)??l(d.edge,{...d,scope:`exception`},{...f,scope:`table`},{...p,scope:`style`})??e.cellMarginLeft,right:l(m.edge,{...m,scope:`cell`})??v(t.marginRight)??l(h.edge,{...h,scope:`exception`},{...g,scope:`table`},{..._,scope:`style`})??e.cellMarginRight}}function Kh(e){if(!e)return null;let t=e.indent?Ih(e.indent):null;return{preferredWidthAuthored:e.preferredWidth!=null,preferredWidth:Lh(e.preferredWidth),layout:e.layout?.kind===`fixed`||e.layout?.kind===`autofit`?e.layout.kind:null,justification:e.justification,indentAuthored:e.indent!=null&&(t===`dxa`||t===`nil`),indentPt:t===`nil`?0:Rh(e.indent),borders:e.borders}}function qh(e){let t=Ah.get(e);if(t)return t;let n=jh(e),r=n.table?.ordinaryFlow??e.tblpPr==null,i=e.rows.map((t,r)=>{let i=n.rows[r]?.row??null,a=i?.exception??null;return{height:i?.height?Vh(i.height):Hh(t),cantSplit:t.cantSplit===!0,repeatedHeader:t.isHeader===!0,cellSpacingPt:Uh(i?.cellSpacing,a?.cellSpacing,n.table?.cellSpacing,i?.styleCellSpacing)??0,justification:i?.justification??a?.justification??null,exception:Kh(a),cells:t.cells.map((t,o)=>({marginsPt:Gh(e,t,n.rows[r]?.cells[o]!==null&&n.rows[r]?.cells[o]!==void 0,n.rows[r]?.cells[o]?.margins,a?.cellMargins,n.table?.cellMargins,i?.styleCellMargins)}))}}),a=Zc({effectiveStyleId:n.table?.effectiveStyleId??null,ordinaryFlow:r,logicalSequenceId:n.table?.logicalSequenceId??null,logicalRowOffset:n.table?.logicalRowOffset??0,logicalTotalRows:n.table?.logicalTotalRows??0,positioning:r||e.tblpPr==null?null:Ph(e.tblpPr),rows:i,firstRowException:i[0]?.exception??null},`DOCX table format input`);return Ah.set(e,a),a}function Jh(e){return Object.freeze(e.map(e=>{if(e.type!==`table`)return Object.freeze({element:e,table:null});let t=qh(e);return t.logicalSequenceId==null?Object.freeze({element:e,table:null}):Object.freeze({element:e,table:Object.freeze({logicalSequenceId:t.logicalSequenceId,logicalRowOffset:t.logicalRowOffset??0,logicalTotalRows:t.logicalTotalRows??0,rowCount:e.rows.length})})}))}const Yh=e=>Object.freeze({story:`body`,storyInstance:`body`,path:Object.freeze([e])}),Xh=new Set([`paragraph`,`line`,`character`]);function Zh(e,t,n){if(e.type!==`shape`&&e.type!==`image`&&e.type!==`chart`||yg(e)!==void 0||!fd(e.wrapMode)||e.type!==`shape`&&!e.anchor||e.widthPt<=0||e.heightPt<=0)return null;let r=e.anchorXRelativeFrom??(e.anchorXFromMargin?`margin`:`page`),i=e.anchorYRelativeFrom??(e.anchorYFromPara?`paragraph`:`page`),a=`${t.story}:${t.storyInstance}:${t.path.join(`.`)}`;return Object.freeze({occurrenceId:e.type===`shape`?`public-shape:${a}:${n}`:`public-anchor:${a}:${n}`,pageOwned:!Xh.has(r)&&!Xh.has(i)})}function Qh(e,t){let n=new Set([`paragraph`,`line`,`character`]),r=Object.freeze([...new Set(xh(e).flatMap((e,r)=>{let i=e;if(e.type!==`shape`&&e.type!==`image`&&e.type!==`chart`&&i.type!==`unavailableDrawing`)return[];let a=yg(i);if(!a){let e=i.type===`unavailableDrawing`?null:Zh(i,t,r);return e?.pageOwned?[e.occurrenceId]:[]}return a.horizontal.relativeFromStatus!==`valid`||a.vertical.relativeFromStatus!==`valid`||a.horizontal.relativeFrom===null||a.vertical.relativeFrom===null||a.wrap.kind===`none`||n.has(a.horizontal.relativeFrom)||n.has(a.vertical.relativeFrom)?[]:[Jc(t,a.occurrenceId)]}))]);return Object.freeze({kind:`paragraph`,source:t,pageBreakBefore:e.pageBreakBefore===!0,keepLines:e.keepLines===!0,keepNext:e.keepNext===!0,widowControl:e.widowControl!==!1,spaceBeforePt:e.spaceBefore??0,spaceAfterPt:e.spaceAfter??0,contextualSpacing:e.contextualSpacing===!0,styleId:e.styleId??null,inkless:!Sh(e)&&ah(e),...r.length===0?{}:{pageOwnedAnchorOccurrenceIds:r}})}function $h(e){return Object.freeze({kind:`table`,source:e})}function eg(e,t){let n=0;return Object.freeze(Hm(Jh(e)).map(e=>{if(e.kind===`adjacent-table-group`){let t=n;return n+=e.tables.length,Object.freeze({kind:`adjacent-table-group`,logicalSequenceId:e.logicalSequenceId,source:Yh(t),tables:Object.freeze(e.tables.map((e,n)=>Object.freeze({...$h(Yh(t+n)),rowCount:e.rows.length})))})}let r=e.element,i=n,a=Yh(i);if(n+=1,r.type===`paragraph`)return r.markVanish===!0&&!Sh(r)&&ah(r)?Object.freeze({kind:`consume-source`,source:a,reason:`hidden-paragraph`}):Object.freeze({kind:`body-block`,block:Qh(r,a)});if(r.type===`table`)return Object.freeze({kind:`body-block`,block:$h(a)});if(r.type===`pageBreak`||r.type===`columnBreak`)return Object.freeze({kind:`authored-break`,source:a,break:r.type===`pageBreak`?`page`:`column`,...r.type===`pageBreak`&&r.parity!==void 0?{parity:r.parity}:{},...r.type===`pageBreak`&&r.sameParagraphAsPrevious===!0?{sameSourceParagraphAsPrevious:!0}:{}});if(r.type===`sectionBreak`)return Object.freeze({kind:`begin-section`,source:a,section:t(i)});throw Error(`Unsupported body layout source at ${i}`)}))}function tg(e){return e.widthPt==null?e.widthPct==null?null:{kind:`pct`,value:e.widthPct/5e3}:{kind:`dxa`,value:e.widthPt}}function ng(e,t,n,r){let i=r?.preferredWidth??null;if(r?.preferredWidthAuthored)return i?.kind===`dxa`?i.value>0?i.value:null:i?.kind===`pct`&&i.value>0?i.value*n:null;let a=Lh(t.table?.preferredWidth);return a?.kind===`dxa`?a.value>0?a.value:null:a?.kind===`pct`?a.value>0?a.value*n:null:e.widthPt!=null&&e.widthPt>0?e.widthPt:e.widthPct!=null&&e.widthPct>0?e.widthPct/5e3*n:null}const rg=Object.freeze({pt:`1/1`,in:`72/1`,cm:`3600/127`,mm:`360/127`,pc:`12/1`,pi:`12/1`});function ig(e){let t=e.replace(/[\\u0009\\u000a\\u000d\\u0020]+/g,` `).replace(/^ | $/g,``),n=/^([+-]?)([0-9]+)$/.exec(t);if(!n)return null;let[,r,i]=n;if(r===`-`&&/[1-9]/.test(i))return null;let a=i.replace(/^0+/,``)||`0`;return a.length>20||a.length===20&&a>`18446744073709551615`?null:t}function ag(e){let t=dl(e);return Number.isFinite(t)?{key:e,widthPt:t}:sg}function og(e,t){let n=Number(e);if(!Number.isFinite(n))return sg;let r=cl(n),i=r===null?0:dl(pl(r,t));return Number.isFinite(i)?{key:null,widthPt:i}:sg}const sg={key:`0/1`,widthPt:0};function cg(e){if(e==null)return sg;let t=ig(e);if(t!==null){let e=sl(t);return e===null?sg:ag(hl(e,20n))}let n=/^([0-9]+(?:\\.[0-9]+)?)(mm|cm|in|pt|pc|pi)$/.exec(e);if(!n)return sg;let r=rg[n[2]],i=sl(n[1]);return i===null?og(n[1],r):ag(pl(i,r))}function lg(e,t){let n=t.table?.grid;if(!n){let t=e.colWidths.map(e=>Number.isFinite(e)&&e>=0?{widthPt:e,key:cl(e)??`0/1`}:sg);return{widthsPt:t.map(e=>e.widthPt),widthKeys:t.map(e=>e.key)}}let r=Math.max(n.requiredColumnCount,n.columns.length),i=Array.from({length:r},(e,t)=>cg(n.columns[t]?.width??null));return{widthsPt:i.map(e=>e.widthPt),widthKeys:i.map(e=>e.key)}}function ug(e,t){let n=Lh(e);return n?.kind===`pct`?{kind:`dxa`,value:Math.max(0,n.value)*Math.max(0,t)}:n}function dg(e,t,n,r=t){let i=jh(e),a=qh(e),{widthsPt:o,widthKeys:s}=lg(e,i),c=a.firstRowException?.layout===`fixed`?`fixed`:i.table?.layout?.kind??e.layout,l=i.table?.grid.authored?i.table.grid.columns.length:null,u=e.rows.map(e=>{let t=Math.max(0,e.gridBefore??0);return l!==null&&t>l?0:t}),d=Math.max(l??0,i.table?.grid.requiredColumnCount??0,...e.rows.map((e,t)=>(u[t]??0)+e.cells.reduce((e,t)=>e+Math.max(1,t.colSpan),0)));return{layout:c===`fixed`?`fixed`:`autofit`,availableWidthPt:Math.max(0,r),gridWidthsPt:o,gridWidthKeys:s,tablePreferredWidthPt:ng(e,i,t,a.firstRowException),rows:e.rows.map((e,r)=>{let s=i.rows[r],f=u[r]??0,p=Math.max(0,e.gridAfter??0),m=f+e.cells.reduce((e,t)=>e+Math.max(1,t.colSpan),0),h=l!==null&&m+p>d?0:p,g=f;return{before:f>0?{columnSpan:f,preferredWidth:ug(s?.row?.beforeWidth,t)}:null,after:h>0?{columnSpan:h,preferredWidth:ug(s?.row?.afterWidth,t)}:null,cells:e.cells.map((e,t)=>{let i=s?.cells[t]??null,l=Math.max(1,e.colSpan),u=c===`fixed`?{minWidthPt:0,maxWidthPt:0}:n(e),d=vl(a.rows[r]?.cellSpacingPt??0,g,l,o.length),f=d.startPt+d.endPt,p={columnStart:g,columnSpan:l,preferredWidth:Lh(i?.preferredWidth)??tg(e),minContentWidthPt:Math.max(0,u.minWidthPt)+f,maxContentWidthPt:Math.max(u.minWidthPt,u.maxWidthPt)+f};return g+=l,p})}})}}function fg(e,t,n){if(!t||typeof t!=`object`)return;let r=Oh.get(e);r||(r=new WeakMap,Oh.set(e,r)),r.set(t,n)}function pg(e){let t=new Map,n=0;e.body.forEach((e,r)=>{if(e.type!==`sectionBreak`)return;let i=e.__sectionPlacement;t.set(r,Zc({sectionId:i?.sectionId??`section:${n}`,sectionBidi:i?.sectionBidi===!0,vAlign:i?.vAlign??null,lineNumbering:i?.lineNumbering??null,docGridType:i?.docGridType??null,docGridLinePitch:i?.docGridLinePitch??null,docGridCharSpace:i?.docGridCharSpace??null,gutterPt:i?.gutterPt??null,rtlGutter:i?.rtlGutter??null,pageBordersAuthored:i?.pageBordersAuthored??!1,pageBorders:i?.pageBorders??null,pageGeometry:i?.pageGeometry??e.geom??{}},`DOCX ending-section placement input`)),n+=1});let r=e.section?.__sectionPlacement;return Object.freeze({endingSections:t,finalSection:Zc({sectionId:r?.sectionId??`section:${n}`,sectionBidi:r?.sectionBidi===!0,vAlign:r?.vAlign??e.section?.vAlign??null,lineNumbering:r?.lineNumbering??e.section?.lineNumbering??null,docGridType:r?.docGridType??e.section?.docGridType??null,docGridLinePitch:r?.docGridLinePitch??e.section?.docGridLinePitch??null,docGridCharSpace:r?.docGridCharSpace??e.section?.docGridCharSpace??null,gutterPt:r?.gutterPt??null,rtlGutter:r?.rtlGutter??null,pageBordersAuthored:r?.pageBordersAuthored??e.section?.pageBorders!=null,pageBorders:r?.pageBorders??e.section?.pageBorders??null,pageGeometry:r?.pageGeometry??(e.section?Rm(e.section):{})},`DOCX final-section placement input`)})}const mg=Object.freeze({default:null,first:null,even:null});function hg(e){let t=[],n=pg(e),r=0;e.body.forEach((e,i)=>{if(e.type!==`sectionBreak`)return;let a=n.endingSections.get(i)??n.finalSection,o=t.length;t.push({sectionOccurrenceId:a.sectionId,ordinal:o,startBodyIndex:r,endBodyIndex:i,markerBodyIndex:i,final:!1,startType:e.kind??`nextPage`,columns:e.columns??null,authoredGeometry:Th(a.pageGeometry),textDirection:e.textDirection??null,pageNumType:e.pageNumType??null,headers:e.headers??mg,footers:e.footers??mg,titlePage:e.titlePage??!1,sectionBidi:a.sectionBidi,vAlign:a.vAlign,lineNumbering:a.lineNumbering,docGridType:a.docGridType,docGridLinePitch:a.docGridLinePitch,docGridCharSpace:a.docGridCharSpace,authoredGutterPt:a.gutterPt,rtlGutter:a.rtlGutter===!0,pageBordersAuthored:a.pageBordersAuthored,pageBorders:a.pageBorders,placement:Eh(a)}),r=i+1});let i=n.finalSection;t.push({sectionOccurrenceId:i.sectionId,ordinal:t.length,startBodyIndex:r,endBodyIndex:e.body.length-1,markerBodyIndex:null,final:!0,startType:e.section.sectionStart??`nextPage`,columns:e.section.columns??null,authoredGeometry:i.pageGeometry==null?Rm(e.section):Th(i.pageGeometry),textDirection:e.section.textDirection??null,pageNumType:e.section.pageNumType??null,headers:e.headers??mg,footers:e.footers??mg,titlePage:e.section.titlePage,sectionBidi:i.sectionBidi,vAlign:i.vAlign,lineNumbering:i.lineNumbering,docGridType:i.docGridType,docGridLinePitch:i.docGridLinePitch,docGridCharSpace:i.docGridCharSpace,authoredGutterPt:i.gutterPt,rtlGutter:i.rtlGutter===!0,pageBordersAuthored:i.pageBordersAuthored,pageBorders:i.pageBorders,placement:Eh(i)});let a=Array(t.length),o=Rm(e.section),s=null,c=null;for(let e=t.length-1;e>=0;--e){let n=t[e],r=n.startType===`continuous`&&s!==null?s:o,i=n.authoredGeometry,l={pageWidth:i.pageWidth??r.pageWidth,pageHeight:i.pageHeight??r.pageHeight,marginTop:i.marginTop??r.marginTop,marginRight:i.marginRight??r.marginRight,marginBottom:i.marginBottom??r.marginBottom,marginLeft:i.marginLeft??r.marginLeft,headerDistance:i.headerDistance??r.headerDistance,footerDistance:i.footerDistance??r.footerDistance},u=n.authoredGutterPt??(n.startType===`continuous`?c:null)??0,{authoredGeometry:d,authoredGutterPt:f,...p}=n;a[e]={...p,geometry:l,gutterPt:u},s=l,c=u}return Zc({bodyLength:e.body.length,occurrences:a},`DOCX body section index input`)}function gg(e){let t=hg(e),n=new Map;for(let e of t.occurrences)e.startBodyIndex!==0&&n.set(e.startBodyIndex-1,e);let r=eg(e.body,e=>{let t=n.get(e);if(!t)throw Error(`Missing incoming body section at ${e}`);return Object.freeze({sectionOccurrenceId:t.sectionOccurrenceId,startType:t.startType})});return Zc({sectionIndex:t,evenAndOddHeaders:e.section.evenAndOddHeaders,endnoteIds:(e.endnotes??[]).map(e=>e.id),noteLayoutSettings:wh(e),pageLayoutSettings:Ch(e),parserDiagnostics:Wd(e.diagnostics,e.body.length),sequence:r},`DOCX body layout acquisition input`)}function _g(e){let t=e.textPath;if(t)return Zc({string:t.string,...t.fontFamily===void 0?{}:{fontFamily:t.fontFamily},bold:t.bold??!1,italic:t.italic??!1,...t.textPathOk===void 0?{}:{textPathOk:t.textPathOk},...t.on===void 0?{}:{on:t.on},...t.fitShape===void 0?{}:{fitShape:t.fitShape},...t.fitPath===void 0?{}:{fitPath:t.fitPath},...t.trim===void 0?{}:{trim:t.trim},...t.xScale===void 0?{}:{xScale:t.xScale},...t.fontSizePt===void 0?{}:{fontSizePt:t.fontSizePt}},`DOCX VML text path acquisition input`)}function vg(e){let t=e.textBoxContent;if(t!==void 0)return Zc(t,`DOCX text box content acquisition input`)}function yg(e){let t=e.__anchorAcquisition;if(t!==void 0)return Zc(t,`DOCX anchor acquisition input`)}function bg(e,t){let n=Tg(e).fontFacts,r=n?.rtl===!0||n?.cs===!0,i=r?n?.fontSizeCs??n?.fontSize??t:n?.fontSize??t,a=n?.fontFamily??e.fontFamily??null,o={ascii:a,highAnsi:n?.fontFamilyHighAnsi??a,eastAsia:n?.fontFamilyEastAsia??e.fontFamilyEastAsia??a,complexScript:n?.fontFamilyCs??a},s=n?.fontSlots;return Object.freeze({fontSizePt:i,fonts:Object.freeze({...s?.direct??o}),themeFonts:s?.theme?Object.freeze({...s.theme}):void 0,themeFontPresence:s?.themePresent?Object.freeze({...s.themePresent}):void 0,weight:(r?n?.boldCs??!1:n?.bold??!1)?700:400,style:(r?n?.italicCs??!1:n?.italic??!1)?`italic`:`normal`,complexScript:r,fontHint:n?.fontHint,eastAsiaLanguage:n?.langEastAsia,kerning:n?.kerning==null?void 0:i>=n.kerning})}function xg(e,t){let n=vg(e);return n===void 0?Zc({kind:`compatibility`,source:t,paragraphs:tl(e,t,bg)},`DOCX public text box acquisition input`):Zc({kind:`complete`,source:t,blocks:n},`DOCX complete text box acquisition input`)}function Sg(e){let t=Eg(e).paragraphMarkFontFacts;if(!t)return;let n=t.rtl===!0||t.cs===!0,r=e.runs.find(e=>e.type===`text`||e.type===`field`)?.fontSize??e.defaultFontSize??10,i=n?t.fontSizeCs??t.fontSize??r:t.fontSize??r,a=t.fontFamily??e.defaultFontFamily??null,o={ascii:a,highAnsi:t.fontFamilyHighAnsi??a,eastAsia:t.fontFamilyEastAsia??e.defaultFontFamilyEastAsia??a,complexScript:t.fontFamilyCs??a};return Object.freeze({fontSizePt:i,fonts:Object.freeze({...t.fontSlots?.direct??o}),themeFonts:t.fontSlots?.theme?Object.freeze({...t.fontSlots.theme}):void 0,themeFontPresence:t.fontSlots?.themePresent?Object.freeze({...t.fontSlots.themePresent}):void 0,weight:(n?t.boldCs??!1:t.bold??!1)?700:400,style:(n?t.italicCs??!1:t.italic??!1)?`italic`:`normal`,complexScript:n,fontHint:t.fontHint,eastAsiaLanguage:t.langEastAsia,kerning:t.kerning==null?void 0:i>=t.kerning})}function Cg(e,t){let{layoutLines:n,lineSlice:r,__paragraphTypographyAcquisition:i,__complexFieldBoundaries:a,...o}=e,s=$c(e),c=e.__complexFieldBoundaries?.map(e=>({occurrenceKey:[`complex-field`,t.story,t.storyInstance,t.path.slice(0,-1).join(`.`),String(e.occurrenceId)].join(`:`),boundary:e.boundary,runIndex:e.runIndex,fieldType:e.fieldType,instruction:e.instruction,...e.hyperlinkAnchor===void 0?{}:{hyperlinkAnchor:e.hyperlinkAnchor}})),l=structuredClone(o),u=bh(e),d=[];if(u.length===0)l.runs.forEach((t,n)=>{d.push({run:t,originalRun:e.runs[n]})});else{let t=0;for(let n=0;n<=l.runs.length;n+=1){for(;u[t]?.publicRunIndex===n;){let e=u[t].run;d.push({run:structuredClone(e),originalRun:e}),t+=1}n<l.runs.length&&d.push({run:l.runs[n],originalRun:e.runs[n]})}}let f=d.map(({run:e,originalRun:n},r)=>{let i=e;if(i.type===`unavailableDrawing`){let e=yg(n),r=e===void 0?void 0:Zc({...e,occurrenceId:Jc(t,e.occurrenceId)},`DOCX scoped unavailable drawing anchor acquisition input`),{__anchorAcquisition:a,...o}=i;return Object.freeze({...o,...r===void 0?{}:{anchorAcquisitionInput:r}})}if(e.type===`math`){let n=Object.freeze({...t,path:Object.freeze([...t.path,r])}),i=e;return Object.freeze({...e,source:i.source??n,resourceKey:i.resourceKey??qc(n,e.display?`display`:`inline`)})}if(e.type===`anchorHost`){let{__anchorOccurrenceId:n,...r}=e;return Object.freeze({...r,...n===void 0?{}:{anchorOccurrenceId:Jc(t,n)}})}if(e.type===`shape`||e.type===`image`||e.type===`chart`){let i=yg(n),a=i===void 0?void 0:Zc({...i,occurrenceId:Jc(t,i.occurrenceId)},`DOCX scoped anchor acquisition input`),{__anchorAcquisition:o,...s}=e;if(e.type!==`shape`)return Object.freeze({...s,...a===void 0?{}:{anchorAcquisitionInput:a}});let c=n,l=_g(c),u=Object.freeze({...t,path:Object.freeze([...t.path,r])}),d=xg(c,{story:`textbox`,storyInstance:`${u.story}:${u.storyInstance}:${u.path.join(`.`)}`,path:[]});return Object.freeze({...s,...l===void 0?{}:{vmlTextPathInput:l},...(d.kind===`complete`?d.blocks.length:d.paragraphs.length)===0?{}:{textBoxInput:d},...a===void 0?{}:{anchorAcquisitionInput:a}})}if(e.type===`text`||e.type===`field`){let t=Qc(n),{__typographyAcquisition:r,...i}=e;return Object.freeze({...i,...t===void 0?{}:{typographyInput:t}})}return Object.freeze({...e})});return Xc({...l,runs:f,...c?.length?{complexFieldBoundaries:c}:{},numberingMarkerShapeInput:e.numbering?bg(e.numbering,e.runs.find(e=>e.type===`text`||e.type===`field`)?.fontSize??e.defaultFontSize??10):void 0,paragraphMarkShapeInput:Sg(e),...s===void 0?{}:{typographyInput:s}})}function wg(e){let t=[],n=(e,i,a,o)=>{if(e.type===`paragraph`){let r=!1,s=[],c=[],l=e.runs.some(e=>e.type===`unavailableDrawing`);xh(e).forEach((e,u)=>{if(e.type===`unavailableDrawing`){c.push(Object.freeze({publicRunIndex:s.length,run:Zc(e,`DOCX unavailable drawing parser sidecar`)})),l&&(r=!0);return}if(e.type===`math`){r=!0;let n=Object.freeze({story:i,storyInstance:a,path:Object.freeze([...o,u])}),c=qc(n,e.display?`display`:`inline`);t.push(Object.freeze({nodes:e.nodes,display:e.display,source:n,resourceKey:c})),s.push(Object.freeze({...e,source:n,resourceKey:c}));return}if(e.type!==`shape`){s.push(e);return}let d=e.textBoxContent;if(d===void 0){s.push(e);return}let f={story:i,storyInstance:a,path:[...o,u]},p=`${f.story}:${f.storyInstance}:${f.path.join(`.`)}`,m=!1,h=d.map((e,t)=>{if(e.type===`unsupportedTextBoxBlock`)return e;let r=n(e,`textbox`,p,[t]);return r!==e&&(m=!0),r});if(!m){s.push(e);return}r=!0,s.push({...e,textBoxContent:h})});let u=r?{...e,runs:s}:e;return c.length>0&&yh.set(u,Object.freeze(c)),u}if(e.type===`table`){let t=!1,n=e.rows.map((e,n)=>{let s=!1,c=e.cells.map((e,t)=>{let c=r(e.content,i,a,[...o,n,t]);return c===e.content?e:(s=!0,{...e,content:c})});return s?(t=!0,{...e,cells:c}):e});return t?{...e,rows:n}:e}if(e.type!==`sectionBreak`)return e;let s=o.at(-1)??0,c=!1,l=(e,t)=>{if(!e)return e;let n=e;for(let i of[`default`,`first`,`even`]){let a=e[i];if(!a)continue;let o=r(a.body,t,`section:${s}:${i}`);o!==a.body&&(n===e&&(n={...e}),n[i]={...a,body:o},c=!0)}return n},u=l(e.headers,`header`),d=l(e.footers,`footer`);return c?{...e,headers:u,footers:d}:e},r=(e,t,r,i=[])=>{let a=!1,o=e.map((e,o)=>{let s=n(e,t,r,[...i,o]);return s!==e&&(a=!0),s});return a?o:e},i=(e,t)=>{let n=e;for(let i of[`default`,`first`,`even`]){let a=e[i];if(!a)continue;let o=r(a.body,t,i);o!==a.body&&(n===e&&(n={...e}),n[i]={...a,body:o})}return n},a=r(e.body,`body`,`body`),o=i(e.headers,`header`),s=i(e.footers,`footer`),c=(e,t)=>{if(!e)return e;let n=!1,i=e.map(e=>{let i=r(e.content,t,e.id);return i===e.content?e:(n=!0,{...e,content:i})});return n?i:e},l=c(e.footnotes,`footnote`),u=c(e.endnotes,`endnote`),d=a!==e.body||o!==e.headers||s!==e.footers||l!==e.footnotes||u!==e.endnotes?{...e,body:a,headers:o,footers:s,footnotes:l,endnotes:u}:e,f=pg(d);Dh.set(d,f),fg(d.body,d.section,f);let p,m=()=>p??=gg(d),h=kg();return Object.freeze({document:d,mathOccurrences:Object.freeze(t),fontFamilyCharsets:Object.freeze({...Dg(d).fontFamilyCharsets??{}}),get bodyLayoutInput(){return ih(m())},bodyModelGateway:Object.freeze({acquisitionInputs:h,get bodySectionIndex(){return m().sectionIndex},effectiveTablePositioning:Nh,publicAnchorBridge:Zh})})}function Tg(e){return e}function Eg(e){return e}function Dg(e){return e}const Og=Object.freeze({numberingMarkerShapeInput:bg,paragraphMarkShapeInput:Sg,tableFormatInput:qh,tableColumnLayoutInput:dg,tableParticipatesInOrdinaryFlow:Mh,paragraphAcquisitionInput:Cg});function kg(){let e=new WeakMap,t=(t,n)=>{let r=e.get(t);r||(r=new Map,e.set(t,r));let i=Wc(n),a=r.get(i);if(a)return a;let o=Cg(t,n);return r.set(i,o),o};return Object.freeze({...Og,paragraphAcquisitionInput:t})}function Ag(e){return wg(e)}function jg(e){return[...wg(e).mathOccurrences]}function Mg(e,t){if(!Number.isFinite(e)||e<0)throw RangeError(`${t} must be finite and non-negative`);return e}function Ng(e){let t=[...e].map(e=>Object.freeze({resourceKey:e.resourceKey,widthPt:Mg(e.widthPt,`widthPt`),heightPt:Mg(e.heightPt,`heightPt`),mimeType:e.mimeType})).sort((e,t)=>e.resourceKey.localeCompare(t.resourceKey)),n=new Map(t.map(({resourceKey:e,...t})=>[e,Object.freeze(t)]));if(n.size!==t.length)throw Error(`Duplicate image resource key`);return Object.freeze({fingerprint:Uc(`images`,t),resolve(e){let t=n.get(e);if(!t)throw Error(`Unknown image resource: ${e}`);return t}})}function Pg(e){let t=[...e].map(e=>Object.freeze({resourceKey:e.resourceKey,widthEm:Mg(e.widthEm,`widthEm`),ascentEm:Mg(e.ascentEm,`ascentEm`),descentEm:Mg(e.descentEm,`descentEm`),diagnostics:Object.freeze(e.diagnostics.map(e=>Object.freeze({...e}))),...e.available===!1?{available:!1}:{}})).sort((e,t)=>e.resourceKey.localeCompare(t.resourceKey)),n=new Map(t.map(e=>[e.resourceKey,e]));if(n.size!==t.length)throw Error(`Duplicate math resource key`);return Object.freeze({fingerprint:Uc(`math`,t),resolve(e){let t=n.get(e);if(!t)throw Error(`Unknown math resource: ${e}`);return t}})}function Fg(e,t,n){let r=[],i=(e,t,n,i,a)=>{r.push({resourceKey:Kc(e,t),widthPt:i,heightPt:a,mimeType:n})},a=(e,t)=>{if(e.type===`image`){i(t,e.imagePath,e.mimeType,e.widthPt,e.heightPt);return}e.type===`shape`&&e.textBlocks?.forEach((e,n)=>{!e.imagePath||!e.mimeType||e.imageWidthPt==null||e.imageHeightPt==null||i({story:`textbox`,storyInstance:`${t.story}:${t.storyInstance}:${t.path.join(`.`)}`,path:[n,0]},e.imagePath,e.mimeType,e.imageWidthPt,e.imageHeightPt)})},o=(e,t,n,r)=>{e.rows.forEach((e,i)=>e.cells.forEach((e,a)=>{s(e.content,t,n,[...r,i,a])}))},s=(e,r,c,l=[])=>{e.forEach((e,u)=>{let d=[...l,u];if(e.type===`paragraph`){let o=e.numbering;if(o?.picBulletImagePath&&o.picBulletMimeType){let n=t?.(e),a=o.picBulletWidthPt??n?.widthPt,s=o.picBulletHeightPt??n?.heightPt;a!=null&&s!=null&&i({story:r,storyInstance:c,path:d},o.picBulletImagePath,o.picBulletMimeType,a,s)}let s={story:r,storyInstance:c,path:d};(n?.paragraphAcquisitionInput(e,s).runs??e.runs).forEach((e,t)=>{(e.type===`image`||e.type===`shape`)&&a(e,{...s,path:[...d,t]})})}else e.type===`table`&&o(e,r,c,d);if(e.type===`sectionBreak`)for(let t of[`default`,`first`,`even`]){let n=e.headers?.[t],r=e.footers?.[t];n&&s(n.body,`header`,`section:${u}:${t}`),r&&s(r.body,`footer`,`section:${u}:${t}`)}})};s(e.body,`body`,`body`);for(let t of[`default`,`first`,`even`]){let n=e.headers[t],r=e.footers[t];n&&s(n.body,`header`,t),r&&s(r.body,`footer`,t)}for(let t of e.footnotes??[])s(t.content,`footnote`,t.id);for(let t of e.endnotes??[])s(t.content,`endnote`,t.id);return r}function Ig(e){let t=new Map(e),n=Object.freeze([...t.keys()].sort());return Object.freeze({keys:n,resolve(e){let n=t.get(e);if(n===void 0)throw Error(`Unknown runtime resource: ${e}`);return n}})}const Lg=new WeakMap,Rg=new WeakMap,zg=new WeakMap,Bg=new WeakMap,Vg=new WeakMap,Hg=new WeakMap;function Ug(){let e=new WeakMap,t=new WeakMap,n=1;return Object.freeze({objectIdentity(t){let r=e.get(t);return r===void 0&&(r=n,n+=1,e.set(t,r)),r},get(e,n){return t.get(e)?.get(n)},set(e,n,r){let i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}})}function Wg(e,t){let n=[e.text,e.images,e.math],r=new Set(n.flatMap(e=>{let t=Rg.get(e);return t?[t]:[]}));if(r.size>1)throw Error(`Layout services combine foreign runtime owners`);let i=r.values().next().value,a=n.filter(e=>!Rg.has(e));if(i&&a.length>1)throw Error(`Layout services are missing service lineage for multiple components`);if(!i&&!t)return;let o=i??{};for(let e of n){let t=Rg.get(e);if(t&&t!==o)throw Error(`Layout services combine foreign runtime owners`);Rg.set(e,o)}return o}function Gg(e,t){let n=Wg(e,!0);if(zg.has(n))throw Error(`Body layout kernel is already attached`);zg.set(n,t)}function Kg(e){let t=Wg(e,!1);return t?zg.get(t):void 0}function qg(e,t){let n=Wg(e,!0);if(Bg.has(n))throw Error(`Vertical glyph measurement service is already attached`);Bg.set(n,t)}function Jg(e){let t=Wg(e,!1),n=t?Bg.get(t):void 0;if(!n)throw Error(`Vertical glyph measurement service is not attached`);return n}function Yg(e,t){if(Vg.has(e))throw Error(`Layout variant store is already attached`);Vg.set(e,t)}function Xg(e){return Vg.get(e)}function Zg(e,t,n=t.keys()){if(Lg.has(e))throw Error(`Private resource lookup is already attached`);let r=new Set(t.keys()),i=new Set(n),a=[...i].filter(e=>!r.has(e)).sort(),o=[...r].filter(e=>!i.has(e)).sort();if(a.length>0||o.length>0)throw Error(`Runtime resource membership mismatch: missing [${a.join(`, `)}]; extra [${o.join(`, `)}]`);Lg.set(e,Ig(t))}function Qg(e){return Lg.get(e)}const $g=new WeakMap,e_=new WeakMap;function t_(e,t={}){let n=Object.freeze({...e,...t}),r=Kg(e);if(!r)throw Error(`Body layout kernel is not attached to the supplied services`);if(Kg(n)!==r)throw Error(`Layout service view did not retain its body layout kernel owner`);let i=Lg.get(e);i&&Lg.set(n,i);let a=$g.get(e);a&&$g.set(n,a);let o=Hg.get(e);return o&&Hg.set(n,o),n}function n_(e){let t=t_(e);return Hg.set(t,Ug()),t}function r_(e){return Hg.get(e)}function i_(e,t){if(!Number.isInteger(t.totalPages)||t.totalPages<1)throw RangeError(`Field acquisition totalPages must be a positive integer`);let n=t_(e);return e_.set(n,Object.freeze({...t})),n}function a_(e){return e_.get(e)??Object.freeze({totalPages:1})}function o_(e,t){if($g.has(e))throw Error(`Paint resource registry is already attached`);$g.set(e,t)}function s_(e){let t=$g.get(e);if(!t)throw Error(`Paint resource registry is not attached`);return t}const c_=[`background`,`behindText`,`header`,`body`,`notes`,`front`,`footer`],l_=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0});function u_(e){return Object.freeze({kind:`clip`,clip:e})}function d_(e,t){return Object.freeze({kind:`transform`,transform:Object.freeze({...l_,e,f:t})})}function f_(e,t){if(!t.textBoxIds?.length)return Object.freeze([]);let n=new Map(e.textBoxes.map(e=>[e.id,e]));return Object.freeze(t.textBoxIds.flatMap(e=>{let t=n.get(e);return t?[t]:[]}))}function p_(e,t,n,r,i){if(e.kind===`drawing`){if(!e.anchorLayer)return;i.push(Object.freeze({drawing:e,textBoxes:Object.freeze([]),frames:Object.freeze([...n]),layoutTranslationPt:Object.freeze({...r}),encounterOrder:i.length,root:t}));return}if(e.kind!==`textbox`){if(e.kind===`note`){let a=e.story.clipBounds?Object.freeze([...n,u_(e.story.clipBounds)]):n;for(let n of e.story.blocks)p_(n,t,a,r,i);return}if(e.kind===`paragraph`){let a=e.clipBounds?Object.freeze([...n,u_(e.clipBounds)]):n;for(let n of e.drawings)n.anchorLayer&&i.push(Object.freeze({drawing:n,owner:e,textBoxes:f_(e,n),frames:Object.freeze([...a]),layoutTranslationPt:Object.freeze({...r}),encounterOrder:i.length,root:t}));return}g_(e,t,n,r,i)}}function m_(e,t,n,r,i,a){let o=t.xPt-e.flowBounds.xPt,s=t.yPt-e.flowBounds.yPt;p_(e,n,Object.freeze([...r,d_(o,s)]),Object.freeze({xPt:i.xPt+o,yPt:i.yPt+s}),a)}function h_(e,t,n,r,i){m_(e.child,{xPt:e.xPt-r.xPt,yPt:e.yPt-r.yPt},t,n,r,i)}function g_(e,t,n,r,i){let a=e.clipBounds?Object.freeze([...n,u_(e.clipBounds)]):n;for(let n of e.rows)for(let e of n.cells){let n=`visualMergeOwnership`in e&&e.visualMergeOwnership===`continuation`;if(e.verticalMerge===`continue`&&!n)continue;let o=e.clipBounds?Object.freeze([...a,u_(e.clipBounds)]):a;for(let n of e.blocks)m_(n.layout,{xPt:e.contentBounds.xPt+(n.layout.kind===`table`?n.layout.flowBounds.xPt:0),yPt:e.flowBounds.yPt+n.offsetPt+(n.layout.kind===`table`?n.layout.flowBounds.yPt:0)},t,o,r,i)}for(let n of e.resolvedFloatingTables??[])h_(n,t,a,r,i)}function __(e){let t=e.drawing.anchorLayer;return Object.freeze({kind:`drawing`,layer:t.behindDoc?`behindText`:`front`,sourceLayer:e.root.layer,rootNodeId:e.root.node.id,coordinateSpace:e.root.coordinateSpace,flowDomainId:e.root.node.flowDomainId,node:e.drawing,...e.owner?{ownerNodeId:e.owner.id}:{},textBoxes:e.textBoxes,frames:e.frames,layoutTranslationPt:e.layoutTranslationPt})}function v_(e,t){return Object.freeze({kind:`node`,layer:e.layer,sourceLayer:e.layer,rootNodeId:e.node.id,coordinateSpace:e.coordinateSpace,flowDomainId:e.node.flowDomainId,node:e.node,omitAnchoredDrawings:t})}function y_(e,t){return e.drawing.anchorLayer.relativeHeight-t.drawing.anchorLayer.relativeHeight||e.drawing.anchorLayer.sourceOrder-t.drawing.anchorLayer.sourceOrder||e.encounterOrder-t.encounterOrder}function b_(e){let t=[];for(let n of e)p_(n.node,n,Object.freeze([]),Object.freeze({xPt:0,yPt:0}),t);let n=t.filter(({drawing:e})=>e.anchorLayer.behindDoc).sort(y_).map(__),r=t.filter(({drawing:e})=>!e.anchorLayer.behindDoc).sort(y_).map(__),i=new Set(t.map(({root:e})=>e.node)),a=e.flatMap(e=>e.node.kind===`drawing`&&e.node.anchorLayer?[]:[v_(e,i.has(e.node))]);return Object.freeze([...n,...a,...r])}function x_(e,t){return t.has(e)||(t.add(e),e.kind===`drawing`)?!1:e.kind===`paragraph`?e.lines.some(e=>e.placements.some(e=>e.kind===`text`&&e.paintOps?.some(e=>e.verticalFeature===!0)===!0))||e.textBoxes.some(e=>x_(e,t)):e.kind===`textbox`||e.kind===`note`?e.story.blocks.some(e=>x_(e,t)):e.rows.some(e=>e.cells.some(e=>e.blocks.some(e=>x_(e.layout,t))))||(e.resolvedFloatingTables??[]).some(e=>x_(e.child,t))}function S_(e){let t=Object.freeze(e.map(({layer:e,node:t,coordinateSpace:n})=>Object.freeze({layer:e,node:t,coordinateSpace:n??`section-logical`}))),n=new Map(c_.map(e=>[e,[]]));for(let e of t)n.get(e.layer).push(e.node);let r=[];for(let e=0;e<t.length;){let n=t[e].layer,i=e+1;for(;t[i]?.layer===n;)i+=1;let a=t.slice(e,i);n===`header`||n===`body`||n===`notes`||n===`footer`?r.push(...b_(a)):r.push(...a.map(e=>v_(e,!1))),e=i}let i=new Set;return Object.freeze({roots:t,paintOrder:Object.freeze(r),capabilities:Object.freeze({requiresElementBackedVerticalGlyphPaint:t.some(({node:e})=>x_(e,i))}),background:Object.freeze(n.get(`background`)),behindText:Object.freeze(n.get(`behindText`)),header:Object.freeze(n.get(`header`)),body:Object.freeze(n.get(`body`)),notes:Object.freeze(n.get(`notes`)),front:Object.freeze(n.get(`front`)),footer:Object.freeze(n.get(`footer`))})}var C_=class extends Error{constructor(e){super(e),this.name=`PageGraphError`}};const w_=S_;function T_(e,t,n){let r=new Map(n.map(e=>[e.id,e]));if(r.size!==n.length||n.length!==e[t].length)throw new C_(`Replacement ${t} layer must preserve unique paint node identities`);return w_(e.roots.map(e=>{if(e.layer!==t)return e;let n=r.get(e.node.id);if(!n)throw new C_(`Missing replacement paint node ${e.node.id}`);return{...e,node:n}}))}function E_(e){return e.layers.roots}function D_(e){let t=!1,n=!1;for(let r of e.layers.roots)if(r.layer===`body`){if(n)throw new C_(`Paint sequence must contain one contiguous body paint run; re-entered at ${r.node.id}`);t=!0}else t&&(n=!0);let r=new Map;for(let t of e.layers.roots){if(r.has(t.node.id))throw new C_(`Duplicate paint node ${t.node.id}`);r.set(t.node.id,t)}let i=new Map;for(let t of c_)for(let n of e.layers[t]){if(i.has(n.id))throw new C_(`Duplicate semantic page node ${n.id}`);i.set(n.id,{layer:t,node:n})}if(i.size!==r.size)throw new C_(`Semantic page layers do not match retained roots`);for(let[e,t]of r){let n=i.get(e);if(!n||n.layer!==t.layer||n.node!==t.node)throw new C_(`Paint root ${e} is not the retained ${t.layer} node`)}let a=new Set,o=new Set;for(let t of e.layers.paintOrder){let e=r.get(t.rootNodeId);if(!e)throw new C_(`Missing paint root ${t.rootNodeId}`);if(e.layer!==t.sourceLayer)throw new C_(`Paint root ${t.rootNodeId} belongs to ${e.layer}, not ${t.sourceLayer}`);if(a.add(t.rootNodeId),t.kind===`node`){if(t.node!==e.node||t.node.id!==t.rootNodeId)throw new C_(`Paint root ${t.rootNodeId} is not the retained ${t.sourceLayer} node`);continue}if(!t.node.anchorLayer)throw new C_(`Drawing paint entry ${t.node.id} is not anchored`);if(o.has(t.node.id))throw new C_(`Duplicate drawing paint reference ${t.node.id}`);o.add(t.node.id)}if(a.size!==r.size)throw new C_(`Missing paint-order reference for ${[...r.keys()].find(e=>!a.has(e))??`<unknown>`}`);return e.layers.roots.map(({node:e})=>e)}const O_=Object.freeze({story:`body`,storyInstance:`parse-error`,path:Object.freeze([])});function k_(e,t,n,r,i){let a=e.trim().split(/\\s+/).filter(Boolean),o=[],s=``,c=e=>r.shape({text:e,fontSizePt:n,fonts:{},genericFamily:`sans-serif`}).advancePt,l=e=>{let n=[0,...$o(e),e.length].filter((e,t,n)=>t===0||e!==n[t-1]),r=n.length-1;for(;r>0&&c(`${e.slice(0,n[r])}…`)>t;)--r;return`${e.slice(0,n[r]??0)}…`},u=()=>{o.length===0?o.push(l(``)):o[o.length-1]=l(o[o.length-1])},d=e=>{let n=[0,...$o(e),e.length].filter((e,t,n)=>t===0||e!==n[t-1]),r=0;for(;r<n.length-1;){if(o.length>=i)return u(),!0;let a=r+1;for(;a<n.length&&c(e.slice(n[r],n[a]))<=t;)a+=1;let s=Math.max(r+1,a-1),d=e.slice(n[r],n[s]);if(o.length>=i-1&&s<n.length-1)return o.push(l(d)),!0;o.push(d),r=s}return!1};for(let e=0;e<a.length;e+=1){let n=a[e],r=s?`${s} ${n}`:n,l=c(r);if(s&&l>t){if(o.push(s),s=``,o.length>=i){u();break}if(c(n)>t){if(d(n))break}else s=n}else if(!s&&l>t){if(d(n))break}else s=r;if(e<a.length-1&&o.length>=i&&!s){u();break}}return s&&o.length<i&&o.push(s),o}function A_(e,t,n){if(!(t.widthPt>0&&t.heightPt>0))throw RangeError(`Error page size must be positive`);let r=Math.max(18,Math.min(t.widthPt,t.heightPt)*.06),i={xPt:r,yPt:r,widthPt:t.widthPt-r*2,heightPt:t.heightPt-r*2},a=Math.max(8,Math.min(t.widthPt,t.heightPt)*.02),o=n.resolve({fonts:{},slot:`ascii`,genericFamily:`sans-serif`}).route,s=k_(e,t.widthPt-r*4,a,n,4),c=a*1.4,l=[{kind:`fill-rect`,rect:{xPt:0,yPt:0,widthPt:t.widthPt,heightPt:t.heightPt},fill:`#ffffff`},{kind:`stroke-rect`,rect:i,stroke:`#c8ccd2`,lineWidthPt:1,dashPt:[6,5]},{kind:`text`,rect:{xPt:0,yPt:t.heightPt*.27,widthPt:t.widthPt,heightPt:36},text:`⚠`,fill:`#b23b3b`,fontRoute:o,fontSizePt:28,fontWeight:400,fontStyle:`normal`,align:`center`,baseline:`middle`},{kind:`text`,rect:{xPt:r*2,yPt:t.heightPt*.4,widthPt:t.widthPt-r*4,heightPt:24},text:`This document could not be displayed`,fill:`#333333`,fontRoute:o,fontSizePt:13,fontWeight:600,fontStyle:`normal`,align:`center`,baseline:`middle`},...s.map((e,n)=>({kind:`text`,rect:{xPt:r*2,yPt:t.heightPt*.5+c*n,widthPt:t.widthPt-r*4,heightPt:c},text:e,fill:`#666666`,fontRoute:o,fontSizePt:a,fontWeight:400,fontStyle:`normal`,align:`center`,baseline:`middle`}))],u={kind:`drawing`,id:`parse-error-page`,source:O_,flowDomainId:`parse-error`,flowBounds:i,inkBounds:i,advancePt:i.heightPt,ordinaryFlow:!1,commands:l},d={geometry:{pageWidth:t.widthPt,pageHeight:t.heightPt,marginTop:r,marginRight:r,marginBottom:r,marginLeft:r,headerDistance:0,footerDistance:0},columns:[{xPt:r,wPt:i.widthPt}],columnSeparator:!1,grid:{kind:`none`,linePitchPt:null,charSpacePt:null},textDirection:`lrTb`,verticalAlignment:`top`};return{pages:[{pageIndex:0,geometry:{xPt:0,yPt:0,widthPt:t.widthPt,heightPt:t.heightPt,contentTopPt:r,contentBottomPt:t.heightPt-r},flowDomains:[{id:`parse-error`,kind:`body`,logicalBounds:i,physicalBounds:i}],section:d,sectionOccurrenceId:`parse-error-section`,pageBorder:null,parityBlank:!1,bookmarkStarts:[],pageNumber:{displayNumber:1,format:`decimal`,sectionOccurrenceId:`parse-error-section`},columnSeparators:[],sectionRegions:[{id:`parse-error-region`,sectionOccurrenceId:`parse-error-section`,coordinateSpace:{writingMode:`horizontal-tb`,logicalToPhysical:{a:1,b:0,c:0,d:1,e:0,f:0},physicalToLogical:{a:1,b:0,c:0,d:1,e:0,f:0}},blockStartPt:r,blockEndPt:t.heightPt-r,columnFlowDirection:`ltr`,columnIndexes:[0],flowDomainIds:[`parse-error`],section:d}],layers:w_([{layer:`body`,node:u}]),readingOrder:[u.id]}],diagnostics:[{code:`UNSUPPORTED_FEATURE`,severity:`error`,source:O_,message:e}]}}function j_(e,t){let n=e==null?t:typeof e==`number`?e:e.getTime();if(!Number.isFinite(n))throw RangeError(`currentDate must resolve to finite epoch milliseconds`);return Object.freeze({currentDateMs:n})}function M_(e){return j_(e.currentDate,e.defaultCurrentDateMs)}function N_(e,t){return Uc(`layout`,{currentDateMs:e.currentDateMs,text:t.text.fingerprint,images:t.images.fingerprint,math:t.math.fingerprint,verticalGlyphs:t.verticalGlyphFingerprint??null})}function P_(e){switch(e){case`tb`:case`tbV`:case`lrTb`:case`lrTbV`:return`horizontal-tb`;case`rl`:case`rlV`:case`tbRl`:case`tbRlV`:return`vertical-rl`;case`btLr`:return`vertical-rl`;case`lr`:case`lrV`:case`tbLrV`:return`vertical-lr`;default:throw RangeError(`Unsupported Transitional text direction ${JSON.stringify(e)}`)}}function F_(e){if(!Number.isFinite(e.widthPt)||!Number.isFinite(e.heightPt)||e.widthPt<=0||e.heightPt<=0)throw RangeError(`Physical page extents must be positive and finite`)}function I_(e){if(!Number.isFinite(e.xPt)||!Number.isFinite(e.yPt))throw RangeError(`Point coordinates must be finite`)}function L_(e){if(![e.a,e.b,e.c,e.d,e.e,e.f].every(Number.isFinite))throw RangeError(`Matrix coefficients must be finite`)}function R_(e){if(I_(e),!Number.isFinite(e.widthPt)||!Number.isFinite(e.heightPt)||e.widthPt<0||e.heightPt<0)throw RangeError(`Rectangle extents must be finite and non-negative`)}function z_(e,t){switch(F_(e),t){case`horizontal-tb`:return{widthPt:e.widthPt,heightPt:e.heightPt};case`vertical-rl`:case`vertical-lr`:return{widthPt:e.heightPt,heightPt:e.widthPt};default:throw RangeError(`Unsupported writing mode ${String(t)}`)}}function B_(e,t){switch(F_(e),t){case`horizontal-tb`:return{widthPt:e.widthPt,heightPt:e.heightPt};case`vertical-rl`:case`vertical-lr`:return{widthPt:e.heightPt,heightPt:e.widthPt};default:throw RangeError(`Unsupported writing mode ${String(t)}`)}}function V_(e,t){switch(F_(t),e){case`horizontal-tb`:return{a:1,b:0,c:0,d:1,e:0,f:0};case`vertical-rl`:return{a:0,b:1,c:-1,d:0,e:t.widthPt,f:0};case`vertical-lr`:return{a:0,b:1,c:1,d:0,e:0,f:0};default:throw RangeError(`Unsupported writing mode ${String(e)}`)}}function H_(e,t){switch(F_(t),e){case`horizontal-tb`:return{a:1,b:0,c:0,d:1,e:0,f:0};case`vertical-rl`:return{a:0,b:-1,c:1,d:0,e:0,f:t.widthPt};case`vertical-lr`:return{a:0,b:1,c:1,d:0,e:0,f:0};default:throw RangeError(`Unsupported writing mode ${String(e)}`)}}function U_(e,t){return L_(e),I_(t),{xPt:e.a*t.xPt+e.c*t.yPt+e.e,yPt:e.b*t.xPt+e.d*t.yPt+e.f}}function W_(e,t){R_(t);let n=[U_(e,t),U_(e,{xPt:t.xPt+t.widthPt,yPt:t.yPt}),U_(e,{xPt:t.xPt,yPt:t.yPt+t.heightPt}),U_(e,{xPt:t.xPt+t.widthPt,yPt:t.yPt+t.heightPt})],r=n.map(({xPt:e})=>e),i=n.map(({yPt:e})=>e),a=Math.min(...r),o=Math.min(...i);return{xPt:a,yPt:o,widthPt:Math.max(...r)-a,heightPt:Math.max(...i)-o}}function G_(e,t){L_(e);let n=U_(e,{xPt:0,yPt:0}),r={top:{xPt:0,yPt:-1},right:{xPt:1,yPt:0},bottom:{xPt:0,yPt:1},left:{xPt:-1,yPt:0}},i={},a=new Set;for(let o of[`top`,`right`,`bottom`,`left`]){let s=U_(e,r[o]),c=s.xPt-n.xPt,l=s.yPt-n.yPt,u=l===0&&c!==0?c>0?`right`:`left`:c===0&&l!==0?l>0?`bottom`:`top`:null;if(u===null||a.has(u))throw RangeError(`Edge transforms require a non-degenerate axis-aligned matrix`);i[u]=t[o],a.add(u)}if(a.size!==4)throw RangeError(`Edge transform must map every physical edge exactly once`);return i}function K_(e,t){return{writingMode:e,logicalToPhysical:V_(e,t),physicalToLogical:H_(e,t)}}function q_(e){return Object.freeze(e)}function J_(e){let t=[];for(let n of e){let{columns:e,columnSeparator:r}=n.section;if(!r||e.length<2||n.blockEndPt<=n.blockStartPt)continue;let i=new Set(n.columnIndexes),a=n.columnFlowDirection===`rtl`?e.map((e,t)=>t).reverse():e.map((e,t)=>t);for(let r=0;r<a.length-1;r+=1){let o=a[r];if(!i.has(o))continue;let s=a[r+1],c=Math.min(o,s),l=Math.max(o,s),u=e[c],d=e[l],f=(u.xPt+u.wPt+d.xPt)/2;t.push(Object.freeze({start:q_(U_(n.coordinateSpace.logicalToPhysical,{xPt:f,yPt:n.blockStartPt})),end:q_(U_(n.coordinateSpace.logicalToPhysical,{xPt:f,yPt:n.blockEndPt}))}))}}return Object.freeze(t)}function Y_(e,t){let n=nt(e,t);return Object.freeze({authoredStyle:e,style:e===`double`?`double`:n.length>0?`dashed`:e.includes(`wave`)?`wavy`:`solid`,dashPatternPt:Object.freeze(n)})}function X_(e,t){switch(e.display){case`firstPage`:return t;case`notFirstPage`:return!t;default:return!0}}function Z_(e){return e!==void 0&&/^[0-9a-fA-F]{6}$/.test(e)?`#${e}`:`#000000`}function Q_(e){return e!==void 0&&Number.isFinite(e.space)?e.space:0}function $_(e,t,n,r){let i=Number.isFinite(e.width)?e.width:.5;return Object.freeze({edge:t,from:Object.freeze(n),to:Object.freeze(r),color:Z_(e.color),widthPt:i,...Y_(e.style,i)})}function ev(e,t,n,r){if(!e||!X_(e,r))return null;let{geometry:i}=t,a=e.offsetFrom===`text`,o=a?i.marginLeft:0,s=a?i.pageWidth-i.marginRight:i.pageWidth,c=a?Mm(i.marginTop):0,l=a?i.pageHeight-Mm(i.marginBottom):i.pageHeight,u=c+Q_(e.top),d=l-Q_(e.bottom),f=o+Q_(e.left),p=s-Q_(e.right),m=[];if(e.top&&m.push($_(e.top,`top`,{xPt:f,yPt:u},{xPt:p,yPt:u})),e.bottom&&m.push($_(e.bottom,`bottom`,{xPt:f,yPt:d},{xPt:p,yPt:d})),e.left&&m.push($_(e.left,`left`,{xPt:f,yPt:u},{xPt:f,yPt:d})),e.right&&m.push($_(e.right,`right`,{xPt:p,yPt:u},{xPt:p,yPt:d})),m.length===0)return null;let h=K_(P_(t.textDirection),n);return Object.freeze({zOrder:e.zOrder===`back`?`back`:`front`,logicalToPhysical:Object.freeze({...h.logicalToPhysical}),segments:Object.freeze(m)})}function tv(e,t,n){return`page:${e}:region:${encodeURIComponent(t)}:column:${n}`}function nv(e){return rv(e),{xPt:0,yPt:0,widthPt:e.widthPt,heightPt:e.heightPt,contentTopPt:e.contentTopPt,contentBottomPt:e.contentBottomPt}}function rv(e){if(!Number.isFinite(e.widthPt)||!Number.isFinite(e.heightPt)||!Number.isFinite(e.contentTopPt)||!Number.isFinite(e.contentBottomPt)||e.widthPt<=0||e.heightPt<=0||e.contentTopPt<0||e.contentTopPt>e.contentBottomPt||e.contentBottomPt>e.heightPt)throw RangeError(`Effective page edges must satisfy 0 <= contentTopPt <= contentBottomPt <= heightPt`)}function iv(e,t){if(e.length===0)throw RangeError(`${t} must not be empty`)}function av(e,t){if(e&&t===void 0)throw RangeError(`Page-border finalization requires explicit section-owned page identity`);return t??!1}function ov(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&e.xPt===r.xPt&&e.wPt===r.wPt})}function sv(e,t){return e===t||e!==void 0&&t!==void 0&&e.start===t.start&&e.countBy===t.countBy&&e.distance===t.distance&&e.restart===t.restart}function cv(e,t){return e.geometry.pageWidth===t.geometry.pageWidth&&e.geometry.pageHeight===t.geometry.pageHeight&&e.geometry.marginTop===t.geometry.marginTop&&e.geometry.marginRight===t.geometry.marginRight&&e.geometry.marginBottom===t.geometry.marginBottom&&e.geometry.marginLeft===t.geometry.marginLeft&&e.geometry.headerDistance===t.geometry.headerDistance&&e.geometry.footerDistance===t.geometry.footerDistance&&ov(e.columns,t.columns)&&e.columnSeparator===t.columnSeparator&&e.textDirection===t.textDirection&&e.sectionBidi===!0==(t.sectionBidi===!0)&&e.grid.kind===t.grid.kind&&e.grid.linePitchPt===t.grid.linePitchPt&&e.grid.charSpacePt===t.grid.charSpacePt&&e.verticalAlignment===t.verticalAlignment&&sv(e.lineNumbering,t.lineNumbering)}function lv(e){if(P_(e.section.textDirection)!==e.writingMode)throw RangeError(`Section region writing mode must agree with its section text direction`);let t=e.section.sectionBidi===!0?`rtl`:`ltr`;if(e.columnFlowDirection!==void 0&&e.columnFlowDirection!==t)throw RangeError(`Section region column flow direction must agree with sectPr bidi`);let n=e.columnIndexes??e.section.columns.map((e,t)=>t);if(e.columns.length!==n.length||n.some((t,r)=>!Number.isInteger(t)||t<0||t>=e.section.columns.length||r>0&&t<=n[r-1])||e.columns.some((t,r)=>{let i=e.section.columns[n[r]];return i===void 0||t.inlineStartPt!==i.xPt||t.inlineExtentPt!==i.wPt}))throw RangeError(`Section region columns must equal its normalized section columns`)}function uv(e){if(!Number.isInteger(e)||e<0)throw RangeError(`Layout page index must be a non-negative integer`)}function dv(e,t,n){let r=[],i=[],a=new Map,o=new Set,s=new Set,c,l=[];for(let u of n){if(iv(u.id,`Section region id`),iv(u.sectionOccurrenceId,`Section occurrence id`),o.has(u.id)||s.has(u.sectionOccurrenceId))throw RangeError(`Section region and occurrence identities must be unique`);if(o.add(u.id),s.add(u.sectionOccurrenceId),c!==void 0&&c!==u.writingMode)throw RangeError(`One physical page cannot mix writing modes`);c=u.writingMode,lv(u);let n=B_({widthPt:u.section.geometry.pageWidth,heightPt:u.section.geometry.pageHeight},u.writingMode);if(n.widthPt!==t.widthPt||n.heightPt!==t.heightPt)throw RangeError(`Section regions on one physical page must use the same page box: expected ${n.widthPt}x${n.heightPt}, got ${t.widthPt}x${t.heightPt}`);let d=z_(t,u.writingMode),f=d.widthPt,p=d.heightPt;if(!Number.isFinite(u.blockStartPt)||!Number.isFinite(u.blockEndPt)||u.blockStartPt<0||u.blockEndPt<u.blockStartPt||u.blockEndPt>p)throw RangeError(`Section regions must be inside the logical page`);if(u.columns.length===0)throw RangeError(`Section region must contain a column`);let m=u.columnIndexes??u.section.columns.map((e,t)=>t),h=0,g=K_(u.writingMode,t),_=u.columns.map((t,n)=>{let r=m[n];if(!Number.isFinite(t.inlineStartPt)||!Number.isFinite(t.inlineExtentPt)||t.inlineStartPt<0||t.inlineExtentPt<=0||t.inlineStartPt+t.inlineExtentPt>f||t.inlineStartPt<h)throw RangeError(`Columns must be ordered, disjoint, and inside the logical page`);h=t.inlineStartPt+t.inlineExtentPt;let o=tv(e,u.id,r);if(a.has(o))throw RangeError(`Duplicate flow domain ${o}`);let s={xPt:t.inlineStartPt,yPt:u.blockStartPt,widthPt:t.inlineExtentPt,heightPt:u.blockEndPt-u.blockStartPt},c=W_(g.logicalToPhysical,s);if(l.some(e=>c.xPt<e.xPt+e.widthPt&&e.xPt<c.xPt+c.widthPt&&c.yPt<e.yPt+e.heightPt&&e.yPt<c.yPt+c.heightPt))throw RangeError(`Section flow domains on one page must be physically disjoint`);return l.push(c),i.push({id:o,kind:`body`,logicalBounds:s,physicalBounds:c}),a.set(o,u.sectionOccurrenceId),o});r.push({id:u.id,sectionOccurrenceId:u.sectionOccurrenceId,coordinateSpace:g,blockStartPt:u.blockStartPt,blockEndPt:u.blockEndPt,columnFlowDirection:u.columnFlowDirection??(u.section.sectionBidi===!0?`rtl`:`ltr`),columnIndexes:Object.freeze([...m]),flowDomainIds:_,section:u.section})}return{regions:r,domains:i,sectionByDomain:a}}function fv(e,t){if(e.kind===`paragraph`){t(e),e.drawings.forEach(e=>fv(e,t)),e.textBoxes.forEach(e=>fv(e,t));return}if(e.kind===`table`){pv(e,t);return}e.kind===`textbox`&&mv(e,t)}function pv(e,t){for(let n of e.rows)for(let e of n.cells)for(let n of e.blocks)fv(n.layout,t)}function mv(e,t){e.story.blocks.forEach(e=>fv(e,t))}function hv(e,t,n){let r=[],i=new Set;for(let a of e){let e=n.get(a.flowDomainId)??t;fv(a,t=>{for(let n of t.bookmarkStarts??[])!n||i.has(n)||(i.add(n),r.push({name:n,nodeId:t.id,sectionOccurrenceId:e}))})}return r}function gv(e){uv(e.pageIndex),iv(e.sectionOccurrenceId,`Page-start section occurrence id`);let{regions:t,domains:n,sectionByDomain:r}=dv(e.pageIndex,e.physicalPage,e.sectionRegions),i=e.sectionRegions[0],a=i?.pageBorders??e.pageBorders;if(i!==void 0&&(e.sectionOccurrenceId!==i.sectionOccurrenceId||!cv(e.section,i.section)))throw RangeError(`Page-start section context must equal the first section region`);return{pageIndex:e.pageIndex,geometry:nv(e.physicalPage),flowDomains:n,section:e.section,sectionOccurrenceId:e.sectionOccurrenceId,parityBlank:!1,bookmarkStarts:hv(e.paint.map(({node:e})=>e),e.sectionOccurrenceId,r),pageNumber:e.pageNumber,sectionRegions:t,columnSeparators:J_(t),pageBorder:ev(a,e.section,e.physicalPage,av(a,e.firstSectionOwnedPage)),layers:w_(e.paint),readingOrder:e.readingOrder.map(e=>e.id)}}function _v(e){return uv(e.pageIndex),iv(e.sectionOccurrenceId,`Page-start section occurrence id`),rv(e.physicalPage),Object.freeze({...e,sectionRegions:Object.freeze([]),paint:Object.freeze([]),readingOrder:Object.freeze([])})}function vv(e,t){return Object.freeze({...e,sectionRegions:Object.freeze([...e.sectionRegions,t])})}function yv(e,t,n){return Object.freeze({...e,paint:Object.freeze([...e.paint,t]),readingOrder:n?Object.freeze([...e.readingOrder,t.node]):e.readingOrder})}function bv(e,t,n){return gv({...e,pageNumber:t,firstSectionOwnedPage:n})}function xv(e){return uv(e.pageIndex),iv(e.sectionOccurrenceId,`Page-start section occurrence id`),{pageIndex:e.pageIndex,geometry:nv(e.physicalPage),flowDomains:[],section:e.section,sectionOccurrenceId:e.sectionOccurrenceId,parityBlank:!0,bookmarkStarts:[],pageNumber:e.pageNumber,sectionRegions:[],columnSeparators:[],pageBorder:ev(e.pageBorders,e.section,e.physicalPage,av(e.pageBorders,e.firstSectionOwnedPage)),layers:w_([]),readingOrder:[]}}function Sv(e){if(e.length===0)return null;let t=Math.min(...e.map(e=>e.xPt)),n=Math.min(...e.map(e=>e.yPt)),r=Math.max(...e.map(e=>e.xPt+e.widthPt)),i=Math.max(...e.map(e=>e.yPt+e.heightPt));return{xPt:t,yPt:n,widthPt:r-t,heightPt:i-n}}const Cv={FLOW_OVERLAP:!0,BOTTOM_MARGIN_INVASION:!0,FLOW_DOMAIN_INVASION:!0,INVALID_REFERENCE:!0,INVALID_GEOMETRY:!0,INVALID_VALUE:!0,MISSING_RESOURCE:!0,NON_CONVERGENCE:!0,UNSUPPORTED_FEATURE:!0},wv={body:!0,header:!0,footer:!0,footnote:!0,endnote:!0,textbox:!0},Tv=new Set(Object.keys(Cv)),Ev=new Set(Object.keys(wv));function Dv(e,t,n=new WeakSet){if(!(e===null||typeof e==`string`||typeof e==`boolean`)){if(typeof e==`number`){if(!Number.isFinite(e))throw new Z(`INVALID_GEOMETRY`,`${t} is not finite`);return}if(typeof e!=`object`)throw new Z(`INVALID_GEOMETRY`,`${t} contains ${typeof e}`);if(n.has(e))throw new Z(`INVALID_GEOMETRY`,`${t} contains a cycle`);n.add(e);try{if(Array.isArray(e)){let r=0;for(let i of Reflect.ownKeys(e)){if(i===`length`)continue;if(typeof i!=`string`)throw new Z(`INVALID_GEOMETRY`,`${t} has a symbol key`);let a=Number(i);if(!Number.isInteger(a)||a<0||String(a)!==i||a>=e.length)throw new Z(`INVALID_GEOMETRY`,`${t}.${i} is not an array index`);let o=Object.getOwnPropertyDescriptor(e,i);if(!o?.enumerable||!(`value`in o))throw new Z(`INVALID_GEOMETRY`,`${t}[${i}] is not plain data`);Dv(o.value,`${t}[${i}]`,n),r+=1}if(r!==e.length)throw new Z(`INVALID_GEOMETRY`,`${t} is sparse`);return}let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)throw new Z(`INVALID_GEOMETRY`,`${t} is not a plain record`);for(let r of Reflect.ownKeys(e)){if(typeof r!=`string`)throw new Z(`INVALID_GEOMETRY`,`${t} has a symbol key`);let i=Object.getOwnPropertyDescriptor(e,r);if(!i?.enumerable||!(`value`in i))throw new Z(`INVALID_GEOMETRY`,`${t}.${r} is not plain data`);Dv(i.value,`${t}.${r}`,n)}}finally{n.delete(e)}}}function Ov(e,t){if(!Number.isFinite(e))throw new Z(`INVALID_GEOMETRY`,`${t} is not finite`)}function kv(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Av(e,t){if(!kv(e))throw new Z(`INVALID_GEOMETRY`,`${t} is not a point`);Ov(e.xPt,`${t}.xPt`),Ov(e.yPt,`${t}.yPt`)}function jv(e,t){if(Av(e,t),Ov(e.widthPt,`${t}.widthPt`),Ov(e.heightPt,`${t}.heightPt`),e.widthPt<0||e.heightPt<0)throw new Z(`INVALID_GEOMETRY`,`${t} has a negative extent`)}function Mv(e,t){if(!kv(e))throw new Z(`INVALID_GEOMETRY`,`${t} is not a matrix`);for(let n of[`a`,`b`,`c`,`d`,`e`,`f`])Ov(e[n],`${t}.${n}`)}function Nv(e,t){if(e!==`horizontal-tb`&&e!==`vertical-rl`&&e!==`vertical-lr`)throw new Z(`INVALID_GEOMETRY`,`${t} is unsupported`)}function Pv(e,t){if(!kv(e))throw new Z(`INVALID_GEOMETRY`,`${t} is not a coordinate space`);Nv(e.writingMode,`${t}.writingMode`),Mv(e.logicalToPhysical,`${t}.logicalToPhysical`),Mv(e.physicalToLogical,`${t}.physicalToLogical`)}function Fv(e,t){let{plan:n}=e;if(Dv(n,`${t}.plan`),Ov(n.rect.x,`${t}.plan.rect.x`),Ov(n.rect.y,`${t}.plan.rect.y`),Ov(n.rect.w,`${t}.plan.rect.w`),Ov(n.rect.h,`${t}.plan.rect.h`),n.rect.w<0||n.rect.h<0)throw new Z(`INVALID_GEOMETRY`,`${t}.plan.rect has a negative extent`);if(Ov(n.transform.rotationDeg,`${t}.plan.transform.rotationDeg`),n.geometry.kind===`preset`){if(n.geometry.name.length===0)throw new Z(`INVALID_GEOMETRY`,`${t}.plan.geometry.name is empty`);n.geometry.adjustments.forEach((e,n)=>{e!==null&&Ov(e,`${t}.plan.geometry.adjustments[${n}]`)})}else n.geometry.subpaths.forEach((e,n)=>{e.forEach((e,r)=>{if(e.cmd.length===0)throw new Z(`INVALID_GEOMETRY`,`${t}.plan.geometry.subpaths[${n}][${r}].cmd is empty`)})});if(n.stroke&&(Ov(n.stroke.width,`${t}.plan.stroke.width`),n.stroke.width<0))throw new Z(`INVALID_GEOMETRY`,`${t}.plan.stroke.width is negative`)}function Iv(e,t){if(e<=t)return!0;let n=2**-52*Math.max(1,Math.abs(e),Math.abs(t));return e-t<=n}function Lv(e,t){return e<t&&!Iv(t,e)}function Rv(e,t){return Lv(e.xPt,t.xPt+t.widthPt)&&Lv(t.xPt,e.xPt+e.widthPt)&&Lv(e.yPt,t.yPt+t.heightPt)&&Lv(t.yPt,e.yPt+e.heightPt)}function zv(e,t){return Iv(e.xPt,t.xPt)&&Iv(e.yPt,t.yPt)&&Iv(t.xPt+t.widthPt,e.xPt+e.widthPt)&&Iv(t.yPt+t.heightPt,e.yPt+e.heightPt)}function Bv(e,t){return Iv(e.xPt,t.xPt)&&Iv(t.xPt+t.widthPt,e.xPt+e.widthPt)}function Vv(e,t,n){return Iv(e,n.yPt)&&Iv(n.yPt+n.heightPt,t)}function Hv(e,t){return Iv(e.yPt,t.yPt)&&Iv(t.yPt+t.heightPt,e.yPt+e.heightPt)}function Uv(e,t){return e.xPt===t.xPt&&e.yPt===t.yPt&&e.widthPt===t.widthPt&&e.heightPt===t.heightPt}function Wv(e,t){return e.a===t.a&&e.b===t.b&&e.c===t.c&&e.d===t.d&&e.e===t.e&&e.f===t.f}function Gv(e,t){let n=e.pageBorder;if(n===null)return;if(n.zOrder!==`front`&&n.zOrder!==`back`)throw new Z(`INVALID_REFERENCE`,`${t}.zOrder is invalid`);Mv(n.logicalToPhysical,`${t}.logicalToPhysical`);let r=K_(P_(e.section.textDirection),e.geometry).logicalToPhysical;if(!Wv(n.logicalToPhysical,r))throw new Z(`INVALID_GEOMETRY`,`${t}.logicalToPhysical contradicts the page-start section`);if(!Array.isArray(n.segments)||n.segments.length===0)throw new Z(`INVALID_GEOMETRY`,`${t}.segments is empty`);n.segments.forEach((e,n)=>{let r=`${t}.segments[${n}]`;if(Av(e.from,`${r}.from`),Av(e.to,`${r}.to`),Ov(e.widthPt,`${r}.widthPt`),e.from.xPt!==e.to.xPt&&e.from.yPt!==e.to.yPt)throw new Z(`INVALID_GEOMETRY`,`${r} is not an axis-aligned page edge`);if(!/^#[0-9a-fA-F]{6}$/.test(e.color))throw new Z(`INVALID_REFERENCE`,`${r}.color is invalid`)})}function Kv(e,t,n){if(n.has(e))throw new Z(`INVALID_REFERENCE`,`duplicate retained node id ${e}`);n.add(e),t.add(e)}function qv(e,t,n){if(Kv(e.id,t,n),e.kind===`paragraph`){e.drawings.forEach(e=>qv(e,t,n)),e.textBoxes.forEach(e=>qv(e,t,n));return}if(e.kind===`table`){e.rows.forEach(e=>{Kv(e.id,t,n),e.cells.forEach(e=>{Kv(e.id,t,n),e.blocks.forEach(e=>qv(e.layout,t,n))})});return}if(e.kind===`note`){e.story.blocks.forEach(e=>qv(e,t,n));return}e.kind===`textbox`&&e.story.blocks.forEach(e=>qv(e,t,n))}function Jv(e,t){if(e.kind===`paragraph`){let n=Sv(e.drawings.filter(e=>e.anchorLayer?.cellContainment===!0).map(e=>e.flowBounds));if(e.cellContainmentBounds&&jv(e.cellContainmentBounds,`${t}.cellContainmentBounds`),n===null!=(e.cellContainmentBounds===void 0)||n&&e.cellContainmentBounds&&!Uv(n,e.cellContainmentBounds))throw new Z(`INVALID_GEOMETRY`,`${t}.cellContainmentBounds does not match its retained layoutInCell drawings`);let r=new Set;(e.anchorCollisions??[]).forEach((e,n)=>{let i=`${t}.anchorCollisions[${n}]`;if(e.occurrenceId.length===0||r.has(e.occurrenceId))throw new Z(`INVALID_REFERENCE`,`${i}.occurrenceId is empty or duplicated`);if(r.add(e.occurrenceId),jv(e.bounds,`${i}.bounds`),e.horizontalOwnership!==`page`&&e.horizontalOwnership!==`host`||e.verticalOwnership!==`page`&&e.verticalOwnership!==`host`)throw new Z(`INVALID_REFERENCE`,`${i} has invalid axis ownership`)}),e.textBoxes.forEach((e,n)=>Jv(e,`${t}.textBoxes[${n}]`));return}if(e.kind===`table`){e.rows.forEach((e,n)=>e.cells.forEach((e,r)=>e.blocks.forEach((e,i)=>Jv(e.layout,`${t}.rows[${n}].cells[${r}].blocks[${i}]`))));return}e.kind===`textbox`&&e.story.blocks.forEach((e,n)=>Jv(e,`${t}.story.blocks[${n}]`))}function Yv(e,t){if(e.orientation===`upright-physical`&&!e.transform)throw new Z(`INVALID_GEOMETRY`,`${t} upright physical drawing is missing its logical transform`);if(e.transform)for(let n of[`a`,`b`,`c`,`d`,`e`,`f`])Ov(e.transform[n],`${t}.transform.${n}`);e.clip?.kind===`rect`&&jv(e.clip.rect,`${t}.clip.rect`),e.clip?.kind===`polygon`&&e.clip.points.forEach((e,n)=>Av(e,`${t}.clip.points[${n}]`)),e.commands.forEach((e,n)=>{let r=`${t}.commands[${n}]`;if(e.kind!==`noop`){if(e.kind===`drawingml-shape`){Fv(e,r);return}if(jv(e.rect,`${r}.rect`),e.kind===`stroke-rect`&&(Ov(e.lineWidthPt,`${r}.lineWidthPt`),e.dashPt.forEach((e,t)=>Ov(e,`${r}.dashPt[${t}]`))),e.kind===`text`&&(Ov(e.fontSizePt,`${r}.fontSizePt`),Ov(e.fontWeight,`${r}.fontWeight`)),e.kind===`watermark-text`){if(jv(e.sourceBounds,`${r}.sourceBounds`),e.sourceBounds.widthPt<=0||e.sourceBounds.heightPt<=0)throw new Z(`INVALID_GEOMETRY`,`${r}.sourceBounds must have positive extents`);if(Ov(e.opacity,`${r}.opacity`),Ov(e.rotationDeg,`${r}.rotationDeg`),Ov(e.fontSizePt,`${r}.fontSizePt`),e.opacity<0||e.opacity>1||e.fontSizePt<=0)throw new Z(`INVALID_GEOMETRY`,`${r} has invalid textPath paint metrics`);e.spans.forEach((e,t)=>{Ov(e.advancePt,`${r}.spans[${t}].advancePt`),Ov(e.fontWeight,`${r}.spans[${t}].fontWeight`)})}}})}function Xv(e){Dv(e,`layout`),e.diagnostics.forEach((e,t)=>{let n=`diagnostics[${t}]`;if(!Tv.has(e.code))throw new Z(`INVALID_REFERENCE`,`${n}.code is unknown`);if(e.severity!==`warning`&&e.severity!==`error`)throw new Z(`INVALID_REFERENCE`,`${n}.severity is unknown`);if(typeof e.message!=`string`||e.message.length===0)throw new Z(`INVALID_REFERENCE`,`${n}.message is empty`);if(e.source!==void 0&&(!Ev.has(e.source.story)||typeof e.source.storyInstance!=`string`||e.source.storyInstance.length===0||!Array.isArray(e.source.path)||e.source.path.some(e=>!Number.isSafeInteger(e)||e<0)))throw new Z(`INVALID_REFERENCE`,`${n}.source is invalid`)});let t=new Set;e.pages.forEach((e,n)=>{if(!Number.isInteger(e.pageIndex)||e.pageIndex!==n)throw new Z(`INVALID_REFERENCE`,`pages[${n}] has invalid page index ${e.pageIndex}`);if(jv(e.geometry,`pages[${n}].geometry`),Ov(e.geometry.contentTopPt,`pages[${n}].geometry.contentTopPt`),Ov(e.geometry.contentBottomPt,`pages[${n}].geometry.contentBottomPt`),e.geometry.widthPt<=0||e.geometry.heightPt<=0||e.geometry.contentTopPt<0||e.geometry.contentTopPt>e.geometry.contentBottomPt||e.geometry.contentBottomPt>e.geometry.heightPt)throw new Z(`INVALID_GEOMETRY`,`pages[${n}] has invalid effective page edges`);Gv(e,`pages[${n}].pageBorder`);let r=new Map;if(e.flowDomains.forEach((e,t)=>{if(jv(e.logicalBounds,`pages[${n}].flowDomains[${t}].logicalBounds`),jv(e.physicalBounds,`pages[${n}].flowDomains[${t}].physicalBounds`),r.has(e.id))throw new Z(`INVALID_REFERENCE`,`duplicate flow domain ${e.id}`);r.set(e.id,e)}),e.parityBlank&&(e.flowDomains.length>0||(e.sectionRegions?.length??0)>0||(e.columnSeparators?.length??0)>0||E_(e).length>0||e.layers.roots.length>0||e.readingOrder.length>0||(e.bookmarkStarts?.length??0)>0))throw new Z(`INVALID_REFERENCE`,`pages[${n}] parity blank retains page content`);let i=new Set;if(e.sectionOccurrenceId!==void 0){if(e.sectionOccurrenceId.length===0)throw new Z(`INVALID_REFERENCE`,`pages[${n}] has an empty section occurrence id`);i.add(e.sectionOccurrenceId)}let a=new Map;if(e.sectionRegions){let t=new Set,o=new Set,s=new Map,c=[],l;if(e.sectionRegions.forEach((u,d)=>{let f=`pages[${n}].sectionRegions[${d}]`;if(u.id.length===0||t.has(u.id))throw new Z(`INVALID_REFERENCE`,`${f} has an invalid region id`);if(t.add(u.id),u.sectionOccurrenceId.length===0)throw new Z(`INVALID_REFERENCE`,`${f} has an empty section occurrence id`);if(o.has(u.sectionOccurrenceId))throw new Z(`INVALID_REFERENCE`,`${f} has a duplicate section occurrence id`);o.add(u.sectionOccurrenceId),i.add(u.sectionOccurrenceId),Pv(u.coordinateSpace,`${f}.coordinateSpace`);let p=u.coordinateSpace.writingMode;if(l!==void 0&&l!==p)throw new Z(`INVALID_GEOMETRY`,`${f} mixes coordinate systems on one physical page`);l=p;let m;try{m=P_(u.section.textDirection)}catch(e){throw new Z(`INVALID_GEOMETRY`,`${f}.section.textDirection is unsupported: ${e.message}`)}if(p!==m)throw new Z(`INVALID_GEOMETRY`,`${f} writing mode contradicts its section text direction`);let h=z_(e.geometry,p),g=B_({widthPt:u.section.geometry.pageWidth,heightPt:u.section.geometry.pageHeight},p);if(g.widthPt!==e.geometry.widthPt||g.heightPt!==e.geometry.heightPt)throw new Z(`INVALID_GEOMETRY`,`${f} section geometry does not match the upright physical page`);if(Ov(u.blockStartPt,`${f}.blockStartPt`),Ov(u.blockEndPt,`${f}.blockEndPt`),u.columnFlowDirection!==`ltr`&&u.columnFlowDirection!==`rtl`)throw new Z(`INVALID_GEOMETRY`,`${f} has an invalid column flow direction`);let _=u.section.sectionBidi===!0?`rtl`:`ltr`;if(u.columnFlowDirection!==_)throw new Z(`INVALID_GEOMETRY`,`${f} column flow direction contradicts its section bidi`);if(u.blockStartPt<0||u.blockEndPt<u.blockStartPt||u.blockEndPt>h.heightPt)throw new Z(`INVALID_GEOMETRY`,`${f} has an invalid block interval`);let v=K_(u.coordinateSpace.writingMode,e.geometry);if(!Wv(u.coordinateSpace.logicalToPhysical,v.logicalToPhysical)||!Wv(u.coordinateSpace.physicalToLogical,v.physicalToLogical))throw new Z(`INVALID_GEOMETRY`,`${f} has an invalid coordinate transform`);let y=u.columnIndexes;if(u.flowDomainIds.length!==y.length||y.some((e,t)=>!Number.isInteger(e)||e<0||e>=u.section.columns.length||t>0&&e<=y[t-1]))throw new Z(`INVALID_GEOMETRY`,`${f} columns contradict its section`);let b=0;u.flowDomainIds.forEach((t,n)=>{let i=r.get(t);if(!i)throw new Z(`INVALID_REFERENCE`,`${f} references missing flow domain ${t}`);if(i.kind!==`body`)throw new Z(`INVALID_REFERENCE`,`${f} owns non-body flow domain ${t}`);s.set(t,(s.get(t)??0)+1),a.set(t,u);let o=i.logicalBounds,l=u.section.columns[y[n]];if(o.widthPt<=0||o.heightPt<0||o.yPt!==u.blockStartPt||o.heightPt!==u.blockEndPt-u.blockStartPt||o.xPt<0||o.xPt<b||o.xPt+o.widthPt>h.widthPt||l===void 0||o.xPt!==l.xPt||o.widthPt!==l.wPt)throw new Z(`INVALID_GEOMETRY`,`${t} is not the section column's non-negative logical region`);if(b=o.xPt+o.widthPt,!Uv(W_(u.coordinateSpace.logicalToPhysical,i.logicalBounds),i.physicalBounds))throw new Z(`INVALID_GEOMETRY`,`${t} physical bounds do not match its section region transform`);if(!zv(e.geometry,i.physicalBounds))throw new Z(`INVALID_GEOMETRY`,`${t} physical bounds leave the upright physical page`);if(c.some(e=>e.regionId!==u.id&&Rv(e.bounds,i.physicalBounds)))throw new Z(`INVALID_GEOMETRY`,`${t} overlaps a body flow domain owned by another section region`);c.push({regionId:u.id,bounds:i.physicalBounds})})}),e.flowDomains.filter(e=>e.kind===`body`).forEach(e=>{if(s.get(e.id)!==1)throw new Z(`INVALID_REFERENCE`,`${e.id} has invalid section region ownership`)}),!e.parityBlank&&e.sectionRegions.length>0){let t=e.sectionRegions[0];if(e.sectionOccurrenceId!==t.sectionOccurrenceId)throw new Z(`INVALID_REFERENCE`,`pages[${n}] page-start section occurrence does not match its first region`);if(!cv(e.section,t.section))throw new Z(`INVALID_GEOMETRY`,`pages[${n}] page-start section facts do not match its first region`)}}let o=J_(e.sectionRegions??[]);if(!Array.isArray(e.columnSeparators)||e.columnSeparators.length!==o.length||e.columnSeparators.some((e,t)=>{let n=o[t];return n===void 0||e.start.xPt!==n.start.xPt||e.start.yPt!==n.start.yPt||e.end.xPt!==n.end.xPt||e.end.yPt!==n.end.yPt}))throw new Z(`INVALID_GEOMETRY`,`pages[${n}].columnSeparators contradict the retained section regions`);let s=new Map(e.sectionRegions.map(e=>[e.id,e]));for(let t of e.flowDomains){if(t.kind!==`footnote`&&t.kind!==`endnote`)continue;let n=t.sectionRegionId?s.get(t.sectionRegionId):e.sectionRegions[0];if(!n)throw new Z(`INVALID_REFERENCE`,`${t.id} references missing page story region ${t.sectionRegionId??`<default>`}`);if(!Uv(W_(n.coordinateSpace.logicalToPhysical,t.logicalBounds),t.physicalBounds))throw new Z(`INVALID_GEOMETRY`,`${t.id} physical bounds do not match the page story transform`);a.set(t.id,n)}for(let t of e.flowDomains)if(!a.has(t.id)&&!Uv(t.logicalBounds,t.physicalBounds))throw new Z(`INVALID_GEOMETRY`,`${t.id} has unequal logical and physical bounds without a section region`);if(e.pageNumber){if(Ov(e.pageNumber.displayNumber,`pages[${n}].pageNumber.displayNumber`),!Number.isInteger(e.pageNumber.displayNumber))throw new Z(`INVALID_GEOMETRY`,`pages[${n}] page number is not an integer`);if(e.pageNumber.format.length===0||!i.has(e.pageNumber.sectionOccurrenceId))throw new Z(`INVALID_REFERENCE`,`pages[${n}] has an invalid page number section owner`)}let c=[];try{D_(e)}catch(e){throw e instanceof C_?new Z(`INVALID_REFERENCE`,e.message):e}let l=new Map,u=new Set;E_(e).forEach(({node:e},i)=>{let o=`pages[${n}].nodes[${i}]`;l.set(e.id,e),qv(e,u,t),Jv(e,o),jv(e.flowBounds,`${o}.flowBounds`),jv(e.inkBounds,`${o}.inkBounds`),e.clipBounds&&jv(e.clipBounds,`${o}.clipBounds`),Ov(e.advancePt,`${o}.advancePt`),e.kind===`drawing`&&Yv(e,o);let s=r.get(e.flowDomainId);if(!s)throw new Z(`INVALID_REFERENCE`,`${e.id} references missing flow domain ${e.flowDomainId}`);if(e.ordinaryFlow&&s.kind===`body`&&s.logicalBounds.heightPt===0)throw new Z(`FLOW_DOMAIN_INVASION`,`${e.id} claims ordinary flow in an empty body domain`);if(!e.ordinaryFlow)return;let d=s.kind===`body`?a.get(s.id):void 0;if(s.kind===`body`){if(!d)throw new Z(`INVALID_REFERENCE`,`${e.id} references a body flow domain without a section region`);if(e.flowBounds.yPt+e.flowBounds.heightPt>d.blockEndPt)throw new Z(`BOTTOM_MARGIN_INVASION`,`${e.id} crosses logical block end`)}if(!(d?Vv(d.blockStartPt,d.blockEndPt,e.flowBounds)&&(e.kind===`table`||Bv(s.logicalBounds,e.flowBounds)):e.kind===`table`?Hv(s.logicalBounds,e.flowBounds):zv(s.logicalBounds,e.flowBounds)))throw new Z(`FLOW_DOMAIN_INVASION`,`${e.id} crosses flow domain ${s.id}`);c.push(e)});let d=new Set;if(e.readingOrder.forEach(e=>{if(!l.has(e)||d.has(e))throw new Z(`INVALID_REFERENCE`,`invalid reading-order reference ${e}`);d.add(e)}),e.bookmarkStarts!==void 0){let t=new Map([...a].map(([e,t])=>[e,t.sectionOccurrenceId])),r=hv(D_(e),e.sectionOccurrenceId??``,t),o=r.every(e=>e.sectionOccurrenceId.length>0&&i.has(e.sectionOccurrenceId)),s=e.bookmarkStarts.length===r.length&&e.bookmarkStarts.every((e,t)=>{let n=r[t];return n!==void 0&&e.name===n.name&&e.nodeId===n.nodeId&&e.sectionOccurrenceId===n.sectionOccurrenceId});if(!o||!s)throw new Z(`INVALID_REFERENCE`,`pages[${n}] bookmark metadata does not match its retained graph (invalid bookmark node or ownership)`)}for(let e=0;e<c.length;e+=1)for(let t=e+1;t<c.length;t+=1){let n=c[e],i=c[t];if(!n||!i)continue;let a=r.get(n.flowDomainId),o=r.get(i.flowDomainId),s=n.flowDomainId===i.flowDomainId,l=a?.kind===`body`&&(o?.kind===`footnote`||o?.kind===`endnote`)||o?.kind===`body`&&(a?.kind===`footnote`||a?.kind===`endnote`),u=a?.id!==o?.id&&(a?.kind===`footnote`||a?.kind===`endnote`)&&(o?.kind===`footnote`||o?.kind===`endnote`);if((s||l||u)&&Rv(n.flowBounds,i.flowBounds))throw new Z(`FLOW_OVERLAP`,`${n.id} overlaps ${i.id}`)}})}function Zv(e){try{Xv(e)}catch(e){throw e instanceof Z?e:e instanceof TypeError||e instanceof RangeError?new Z(`INVALID_GEOMETRY`,e.message):e}}function Qv(e,t){if(typeof e!=`object`||!e||t.has(e))return e;t.add(e);for(let n of Object.values(e))Qv(n,t);return Object.freeze(e)}const $v=new WeakSet,ey=new WeakSet;function ty(e){if($v.has(e))return e;let t=Qv(e,new WeakSet);return $v.add(t),t}function ny(e){return $v.has(e)?e:(Dv(e,`layout`),ty(e))}function ry(e){if(ey.has(e))return e;Zv(e);let t=ty(e);return ey.add(t),t}function iy(e,t){if(!Number.isInteger(t)||t<0||t>=e.pages.length)throw RangeError(`Page index ${t} out of range (count: ${e.pages.length})`);return e.pages[t]}var ay=class{#e;#t;#n=new Map;#r;#i;#a=null;constructor(e,t,n){this.#e=e,this.#r=Object.freeze({...t}),this.#i=N_(this.#r,this.#e),this.#t=n}get defaultLayout(){return this.layoutFor(this.#r)}layoutFor(e){return this.select(e).layout}select(e){let t=Object.isFrozen(e)?e:Object.freeze({...e}),n=N_(t,this.#e),r=this.#n.get(n);return r||(r=ny(this.#t(t)),n!==this.#i&&(this.#a!==null&&this.#a!==n&&this.#n.delete(this.#a),this.#a=n),this.#n.set(n,r)),Object.freeze({key:n,options:t,layout:r})}selectPage(e,t){let n=this.select(e);return Object.freeze({...n,page:iy(n.layout,t)})}isDefault(e){return N_(e,this.#e)===this.#i}};function oy({model:e,services:t,defaultCurrentDateMs:n,buildLayout:r}){let i=M_({defaultCurrentDateMs:n}),a=e.parseError===void 0?null:A_(e.parseError,{widthPt:e.section.pageWidth,heightPt:e.section.pageHeight},t.text),o=new ay(t,i,a===null?r:()=>a);return Yg(t,o),Object.freeze({store:o,defaultOptions:i})}function sy(e,t,n){let r=Xg(e);if(!r)throw Error(`Document layout variant store is not attached to the supplied services`);return r.selectPage(M_(t),n)}function cy(e,t){return Object.freeze({a:e.a*t.a+e.c*t.b,b:e.b*t.a+e.d*t.b,c:e.a*t.c+e.c*t.d,d:e.b*t.c+e.d*t.d,e:e.a*t.e+e.c*t.f+e.e,f:e.b*t.e+e.d*t.f+e.f})}function ly(e){return Object.freeze({a:e,b:0,c:0,d:e,e:0,f:0})}function uy(e,t){return Object.freeze({a:1,b:0,c:0,d:1,e,f:t})}function dy(e,t){return{xPt:e.a*t.xPt+e.c*t.yPt+e.e,yPt:e.b*t.xPt+e.d*t.yPt+e.f}}function fy(e,t){let n=e.a*e.d-e.b*e.c;if(!Number.isFinite(n)||n===0)return null;let r=t.xPt-e.e,i=t.yPt-e.f,a={xPt:(e.d*r-e.c*i)/n,yPt:(-e.b*r+e.a*i)/n};return Number.isFinite(a.xPt)&&Number.isFinite(a.yPt)?a:null}function py(e,t){let n=e.a*e.d-e.b*e.c;if(!Number.isFinite(n)||n===0)return null;let r={xPt:(e.d*t.xPt-e.c*t.yPt)/n,yPt:(-e.b*t.xPt+e.a*t.yPt)/n};return Number.isFinite(r.xPt)&&Number.isFinite(r.yPt)?r:null}const my=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0});function hy(e){let t=new Map(e.sectionRegions.map(e=>[e.id,e])),n=new Map;for(let t of e.sectionRegions)for(let e of t.flowDomainIds)n.set(e,t);for(let r of e.flowDomains){if(r.kind!==`footnote`&&r.kind!==`endnote`)continue;let i=r.sectionRegionId?t.get(r.sectionRegionId):e.sectionRegions[0];if(!i)throw Error(`${r.id} references missing page story region ${r.sectionRegionId??`<default>`}`);n.set(r.id,i)}return n}function gy(e,t){return t.coordinateSpace===`upright-physical`?my:e.get(t.node.flowDomainId)?.coordinateSpace.logicalToPhysical??my}function _y(e,t){let n=e.rootPointToPage.get(t.rootNodeId);if(!n)throw Error(`Drawing entry ${t.node.id} references missing root ${t.rootNodeId}`);let r=n;for(let e of t.frames)e.kind===`transform`&&(r=cy(r,e.transform));return r}function vy(e,t,n){let r=t.xPt-e.flowBounds.xPt,i=t.yPt-e.flowBounds.yPt;return{pointToPage:cy(n.pointToPage,uy(r,i)),layoutTranslationPt:{xPt:n.layoutTranslationPt.xPt+r,yPt:n.layoutTranslationPt.yPt+i},rootNodeId:n.rootNodeId}}function yy(e,t){return(t.textBoxIds??[]).flatMap(t=>{let n=e.get(t);return n?[n]:[]})}function by(e,t,n){if(n.emittedTextBoxes.has(e.id))return;n.emittedTextBoxes.add(e.id);let r={...t,pointToPage:cy(t.pointToPage,e.transform)};for(let t of e.story.blocks)Ty(t,r,n)}function xy(e,t,n,r){let i=yy(e,t);if(i.length===0)return;let a=Sy(t,n,r);for(let e of i)by(e,a,r)}function Sy(e,t,n){let r=n.drawingEntries.get(e.id),i=t;r&&r.rootNodeId===t.rootNodeId&&(i={pointToPage:_y(n,r),layoutTranslationPt:r.layoutTranslationPt,rootNodeId:r.rootNodeId});let a=i.layoutTranslationPt,o=e.anchorLayer?.horizontalOwnership===`page`?-a.xPt:0,s=e.anchorLayer?.verticalOwnership===`page`?-a.yPt:0,c=o===0&&s===0?i:{...i,pointToPage:cy(i.pointToPage,uy(o,s))};if(e.orientation===`upright-physical`){if(!e.transform)throw Error(`Upright physical drawing ${e.id} is missing its logical transform`);c={...c,pointToPage:cy(c.pointToPage,e.transform)}}return c}function Cy(e,t,n){for(let r of e.lines)for(let i of r.placements)i.kind===`text`&&n.runs.push(Object.freeze({placement:i,pointToPage:t.pointToPage,...e.paragraphId===void 0?{}:{paragraphId:e.paragraphId}}));let r=new Map(e.textBoxes.map(e=>[e.id,e])),i=new Set,a=e.drawings.map((e,t)=>{let n=e.source.path.at(-1);if(n===void 0||!Number.isSafeInteger(n)||n<0)throw Error(`Drawing ${e.id} has no retained paragraph run index`);return{drawing:e,index:t,runIndex:n}}).sort((e,t)=>e.runIndex-t.runIndex||e.index-t.index);for(let{drawing:e}of a){for(let t of e.textBoxIds??[])i.add(t);xy(r,e,t,n)}for(let r of e.textBoxes)i.has(r.id)||by(r,t,n)}function wy(e,t,n){for(let r of e.rows)for(let e of r.cells){let r=`visualMergeOwnership`in e&&e.visualMergeOwnership===`continuation`;if(!(e.verticalMerge===`continue`&&!r))for(let r of e.blocks){let i=r.layout;Ty(i,vy(i,{xPt:e.contentBounds.xPt+(i.kind===`table`?i.flowBounds.xPt:0),yPt:e.flowBounds.yPt+r.offsetPt+(i.kind===`table`?i.flowBounds.yPt:0)},t),n)}}for(let r of e.resolvedFloatingTables??[])Ty(r.child,vy(r.child,{xPt:r.xPt-t.layoutTranslationPt.xPt,yPt:r.yPt-t.layoutTranslationPt.yPt},t),n)}function Ty(e,t,n){switch(e.kind){case`paragraph`:Cy(e,t,n);return;case`table`:wy(e,t,n);return;case`note`:for(let r of e.story.blocks)Ty(r,t,n);return;case`textbox`:by(e,t,n);return;case`drawing`:{let r=n.drawingEntries.get(e.id),i=Sy(e,t,n);for(let e of r?.textBoxes??[])by(e,i,n);return}default:throw Error(`Unknown text-index node: ${String(e)}`)}}function Ey(e,t){let n=e.pages[t];if(!n)throw RangeError(`Page index ${t} is out of range`);let r=new Map(n.layers.roots.map(e=>[e.node.id,e])),i=hy(n),a=new Map(n.layers.roots.map(e=>[e.node.id,gy(i,e)])),o=new Map;for(let e of n.layers.paintOrder)e.kind===`drawing`&&o.set(e.node.id,e);let s={drawingEntries:o,rootPointToPage:a,emittedTextBoxes:new Set,runs:[]};for(let e of n.readingOrder){let t=r.get(e);if(!t)throw Error(`Reading-order node ${e} is not a page root`);let n=a.get(e);if(!n)throw Error(`Reading-order node ${e} has no page projection`);Ty(t.node,{pointToPage:n,layoutTranslationPt:{xPt:0,yPt:0},rootNodeId:t.node.id},s)}return Object.freeze(s.runs)}function Dy(e){let t=Math.hypot(e.a,e.b),n=Math.hypot(e.c,e.d),r=e.a/t,i=e.b/t,a=e.c/n,o=e.d/n;if(!(r===1&&i===0&&a===0&&o===1))return r===0&&i===1&&a===-1&&o===0?`rotate(90deg)`:r===0&&i===-1&&a===1&&o===0?`rotate(-90deg)`:`matrix(${r}, ${i}, ${a}, ${o}, 0, 0)`}function Oy(e,t){let{placement:n}=e,r=dy(t,n.bounds),i=Math.hypot(t.a,t.b),a=Math.hypot(t.c,t.d),o=Dy(t),s=n.paintOps[0]?.letterSpacingPt??0;return{...e.paragraphId===void 0?{}:{paragraphId:e.paragraphId},text:n.text,x:r.xPt,y:r.yPt,w:n.bounds.widthPt*i,h:n.bounds.heightPt*a,fontSize:n.fontSizePt*a,font:L(n.fontRoute,n.fontSizePt*a,n.fontWeight,n.fontStyle),...s===0?{}:{letterSpacingPx:s*i},...o?{transform:o}:{},...n.hyperlink?{hyperlink:n.hyperlink}:{},...n.tateChuYoko?{eastAsianVert:!0}:{}}}function ky(e,t,n){if(!Number.isFinite(n.scale)||n.scale<=0)throw RangeError(`Text projection scale must be positive: ${n.scale}`);let r=ly(n.scale);return Ey(e,t).map(e=>Oy(e,cy(r,e.pointToPage)))}function Ay(e,t,n){let r=sy(e,{currentDate:n.currentDate,defaultCurrentDateMs:n.defaultCurrentDateMs},t),i=(n.width??r.page.geometry.widthPt*1.3333333333333333)/r.page.geometry.widthPt;return ky(r.layout,t,{scale:i})}function jy(e,t,n){return`${e}${t?`|clr:${t}`:``}${n?`|duo:${n.clr1}:${n.clr2}`:``}`}const My=new WeakMap;function Ny(e){let t=My.get(e);return t||(t=new Map,My.set(e,t)),t}function Py(e){let t=My.get(e);if(t){for(let n of t.values())va(e,n);t.clear(),My.delete(e)}}async function Fy(e,t){let n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16),a=new OffscreenCanvas(e.width,e.height),o=a.getContext(`2d`);if(!o)throw Error(`2D canvas is unavailable for image color replacement`);o.drawImage(e,0,0);let s=o.getImageData(0,0,e.width,e.height);for(let e=0;e<s.data.length;e+=4)s.data[e]===n&&s.data[e+1]===r&&s.data[e+2]===i&&(s.data[e+3]=0);return o.putImageData(s,0,0),createImageBitmap(a)}async function Iy(e,t,n,r,i=0,a=0,o){let s=await ya(e,t,r,{widthPt:i,heightPt:a,suppressBoundaryFrame:!0});if(!s)return null;if(!n&&!o)return s;let c=Ny(r),l=jy(e,n,o),u=c.get(l);return u||(u=(async()=>{let e=s;if(n&&(e=await Fy(e,n)),o){let{w:t,h:n}=xa(e);t>0&&n>0&&(e=await ka(e,o,{width:t,height:n}))}return e})(),u.catch(()=>c.delete(l)),u.then(e=>{e===s&&c.delete(l)}).catch(()=>{}),c.set(l,u)),u}function Ly(e){let t=new Map,n=e.filter(e=>e.kind===`image`||e.kind===`picture-bullet`).sort((e,t)=>(e.documentOrder??2**53-1)-(t.documentOrder??2**53-1));for(let e of n){let n=wa(e.mimeType,e.srcRect,e.intrinsicSize.widthPt,e.intrinsicSize.heightPt),r={imagePath:e.partPath,mimeType:e.mimeType,...e.svgImagePath===void 0?{}:{svgImagePath:e.svgImagePath},...e.colorReplaceFrom===void 0?{}:{colorReplaceFrom:e.colorReplaceFrom},...e.duotone===void 0?{}:{duotone:e.duotone},widthPt:n.widthPt,heightPt:n.heightPt,hasCrop:e.srcRect!=null},i=jy(r.imagePath,r.colorReplaceFrom,r.duotone),a=t.get(i);a?(a.widthPt=Math.max(a.widthPt,r.widthPt),a.heightPt=Math.max(a.heightPt,r.heightPt),a.hasCrop||=r.hasCrop):t.set(i,r)}return[...t.values()]}async function Ry(e,t){if(!t)return new Map;let n=await Promise.all(Ly(e).map(async e=>{let n=e.mimeType===`image/svg+xml`,r={svgImagePath:e.svgImagePath,srcRect:e.hasCrop||null},i;if(Aa(r))try{i=await Ar(r.svgImagePath,t)}catch(r){let a=n?await Ar(e.imagePath,t):await Iy(e.imagePath,e.mimeType,e.colorReplaceFrom,t,e.widthPt,e.heightPt,e.duotone);if(!a)throw r;i=a}else i=n?await Ar(e.imagePath,t):await Iy(e.imagePath,e.mimeType,e.colorReplaceFrom,t,e.widthPt,e.heightPt,e.duotone);return i==null?null:[jy(e.imagePath,e.colorReplaceFrom,e.duotone),i]}));return new Map(n.filter(e=>e!==null))}function zy(e,t){return Math.round(e*t)/t}function By(e,t,n){let r=e*t;return(n%2==0?Math.round(r):Math.round(r-.5)+.5)/t}function Vy(e,t,n){let r=t*n,i=Math.max(1,Math.round(.5*t)),a=Math.max(1,Math.round(i*n)),o=a/r;if(e.start.xPt===e.end.xPt){let t=By(e.start.xPt,r,a);return{segment:{start:{xPt:t,yPt:zy(e.start.yPt,r)},end:{xPt:t,yPt:zy(e.end.yPt,r)}},widthPt:o}}if(e.start.yPt===e.end.yPt){let t=By(e.start.yPt,r,a);return{segment:{start:{xPt:zy(e.start.xPt,r),yPt:t},end:{xPt:zy(e.end.xPt,r),yPt:t}},widthPt:o}}return{segment:e,widthPt:o}}function Hy(e,t,n,r,i){if(r!==`upright-physical`){i.resources.paint(e,t,n,i.ctx);return}let{ctx:a}=i;a.save(),a.translate(n.xPt+n.widthPt/2,n.yPt+n.heightPt/2),a.rotate(-Math.PI/2),i.resources.paint(e,t,{xPt:-n.heightPt/2,yPt:-n.widthPt/2,widthPt:n.heightPt,heightPt:n.widthPt},a),a.restore()}function Uy(e,t){for(let n of e.commands){if(n.kind===`noop`)continue;if(n.kind===`drawingml-shape`){Er(t.ctx,n.plan,1);continue}if(n.kind===`resource`){if(!t.resources)throw Error(`Missing retained resource painter for ${n.resourceKey}`);Hy(n.resourceKey,n.resourceKind,n.rect,n.orientation,t);continue}if(n.kind===`fill-rect`){t.ctx.fillStyle=n.fill,t.ctx.fillRect(n.rect.xPt,n.rect.yPt,n.rect.widthPt,n.rect.heightPt);continue}if(n.kind===`stroke-rect`){t.ctx.strokeStyle=n.stroke,t.ctx.lineWidth=n.lineWidthPt,t.ctx.setLineDash([...n.dashPt]),t.ctx.strokeRect(n.rect.xPt,n.rect.yPt,n.rect.widthPt,n.rect.heightPt),t.ctx.setLineDash([]);continue}if(n.kind===`watermark-text`){let e=lt(n.fill,t.ctx,n.rect.xPt,n.rect.yPt,n.rect.widthPt,n.rect.heightPt);if(e===null)continue;t.ctx.save();let r=n.rect.xPt+n.rect.widthPt/2,i=n.rect.yPt+n.rect.heightPt/2;t.ctx.translate(r,i),n.rotationDeg!==0&&t.ctx.rotate(n.rotationDeg*Math.PI/180),n.fitShape?(t.ctx.scale(n.rect.widthPt/n.sourceBounds.widthPt,n.rect.heightPt/n.sourceBounds.heightPt),t.ctx.translate(-(n.sourceBounds.xPt+n.sourceBounds.widthPt/2),-(n.sourceBounds.yPt+n.sourceBounds.heightPt/2))):t.ctx.translate(n.rect.xPt-r-n.sourceBounds.xPt,n.rect.yPt-i-n.sourceBounds.yPt),t.ctx.globalAlpha*=n.opacity,t.ctx.fillStyle=e,t.ctx.textAlign=`left`,t.ctx.textBaseline=`alphabetic`;let a=0;for(let e of n.spans)t.ctx.font=L(e.fontRoute,n.fontSizePt,e.fontWeight,e.fontStyle),t.ctx.fillText(e.text,a,0),a+=e.advancePt;t.ctx.restore();continue}t.ctx.fillStyle=n.fill,t.ctx.font=L(n.fontRoute,n.fontSizePt,n.fontWeight,n.fontStyle),t.ctx.textAlign=n.align===`start`?`left`:n.align===`end`?`right`:`center`,t.ctx.textBaseline=n.baseline;let e=n.align===`start`?n.rect.xPt:n.align===`end`?n.rect.xPt+n.rect.widthPt:n.rect.xPt+n.rect.widthPt/2,r=n.baseline===`top`?n.rect.yPt:n.baseline===`bottom`?n.rect.yPt+n.rect.heightPt:n.rect.yPt+n.rect.heightPt/2;t.ctx.fillText(n.text,e,r)}}function Wy(e){return 1/e.dpr}function Gy(e,t,n=0){let r=n/t.scale,i=r>e.widthPt?{...e,widthPt:r,...typeof e.authoredStyle==`string`?{dashPatternPt:Object.freeze(nt(e.authoredStyle,r))}:{}}:e,{ctx:a}=t;a.strokeStyle=i.color,a.lineWidth=i.widthPt,a.setLineDash(`dashPatternPt`in i&&i.dashPatternPt?[...i.dashPatternPt]:[]),a.beginPath();let o=`path`in i&&i.path?.length?i.path:[i.from,i.to],s=o.length===2&&(o[0].xPt===o[1].xPt||o[0].yPt===o[1].yPt),c=s&&o[0].yPt===o[1].yPt,l=s&&o[0].xPt===o[1].xPt,u=t.pointToCss??ly(t.scale),d=o.map(e=>dy(u,e)),f=s?o[1].xPt-o[0].xPt:0,p=s?o[1].yPt-o[0].yPt:0,m=u.a*f+u.c*p,h=u.b*f+u.d*p,g=s&&h===0,_=s&&m===0,v=c?Math.hypot(u.c,u.d):l?Math.hypot(u.a,u.b):0;if(i.style===`double`&&s&&v>0){if(a.fillStyle=i.color,g||_){let e=(e,t,n,r)=>{let i=[{xPt:e,yPt:t},{xPt:e+n,yPt:t},{xPt:e,yPt:t+r},{xPt:e+n,yPt:t+r}].map(e=>fy(u,e));if(i.some(e=>e===null))return;let o=i.filter(e=>e!==null),s=o.map(e=>e.xPt),c=o.map(e=>e.yPt);a.fillRect(Math.min(...s),Math.min(...c),Math.max(...s)-Math.min(...s),Math.max(...c)-Math.min(...c))},{railDev:n,gapDev:r,spanDev:o}=Ia(i.widthPt*v,t.dpr),s=n/t.dpr;if(g){let i=Math.round(d[0].yPt*t.dpr-o/2),a=Math.min(d[0].xPt,d[1].xPt),c=Math.abs(d[1].xPt-d[0].xPt);e(a,i/t.dpr,c,s),e(a,(i+n+r)/t.dpr,c,s)}else{let i=Math.round(d[0].xPt*t.dpr-o/2),a=Math.min(d[0].yPt,d[1].yPt),c=Math.abs(d[1].yPt-d[0].yPt);e(i/t.dpr,a,s,c),e((i+n+r)/t.dpr,a,s,c)}}else{let{railDev:e,gapDev:n,spanDev:r}=Ia(i.widthPt*v,t.dpr),s=e/t.dpr/v,l=n/t.dpr/v,u=r/t.dpr/v;if(c){let e=Math.min(o[0].xPt,o[1].xPt),t=Math.abs(o[1].xPt-o[0].xPt);a.fillRect(e,o[0].yPt-u/2,t,s),a.fillRect(e,o[0].yPt-u/2+s+l,t,s)}else{let e=Math.min(o[0].yPt,o[1].yPt),t=Math.abs(o[1].yPt-o[0].yPt);a.fillRect(o[0].xPt-u/2,e,s,t),a.fillRect(o[0].xPt-u/2+s+l,e,s,t)}}a.setLineDash([]);return}let y=py(u,_&&v>0?{xPt:Na(d[0].xPt,i.widthPt*v,t.dpr),yPt:0}:g&&v>0?{xPt:0,yPt:Na(d[0].yPt,i.widthPt*v,t.dpr)}:{xPt:0,yPt:0})??{xPt:0,yPt:0},b=o[0];a.moveTo(b.xPt+y.xPt,b.yPt+y.yPt);for(let e of o.slice(1))a.lineTo(e.xPt+y.xPt,e.yPt+y.yPt);let x=i.style===`wavy`&&o.length>2;x&&(a.save(),a.lineJoin=`bevel`),a.stroke(),x&&a.restore(),a.setLineDash([])}function Ky(e,t){return n=>()=>{e.save();try{t(),n()}finally{e.restore()}}}function qy(e,t){let n=t.pointToCss??ly(t.scale);if(n.b!==0||n.c!==0)return e;let r=[{xPt:e.xPt,yPt:e.yPt},{xPt:e.xPt+e.widthPt,yPt:e.yPt},{xPt:e.xPt,yPt:e.yPt+e.heightPt},{xPt:e.xPt+e.widthPt,yPt:e.yPt+e.heightPt}].map(e=>dy(n,e)),i=r.map(e=>e.xPt),a=r.map(e=>e.yPt),o=Math.floor(Math.min(...i)*t.dpr)/t.dpr,s=Math.floor(Math.min(...a)*t.dpr)/t.dpr,c=Math.ceil(Math.max(...i)*t.dpr)/t.dpr,l=Math.ceil(Math.max(...a)*t.dpr)/t.dpr,u=[{xPt:o,yPt:s},{xPt:c,yPt:s},{xPt:o,yPt:l},{xPt:c,yPt:l}].map(e=>fy(n,e));if(u.some(e=>e===null))return e;let d=u.filter(e=>e!==null),f=d.map(e=>e.xPt),p=d.map(e=>e.yPt);return{xPt:Math.min(...f),yPt:Math.min(...p),widthPt:Math.max(...f)-Math.min(...f),heightPt:Math.max(...p)-Math.min(...p)}}function Jy(e,t,n,r=!0){let i=t.xPt-e.flowBounds.xPt,a=t.yPt-e.flowBounds.yPt,o=n.layoutTranslationPt??{xPt:0,yPt:0},s=cy(n.pointToCss??ly(n.scale),uy(i,a)),c=Ky(n.ctx,()=>n.ctx.translate(i,a)),l={...n,pointToCss:s,layoutTranslationPt:{xPt:o.xPt+i,yPt:o.yPt+a}};c(()=>{e.kind===`paragraph`?db(e,l):Qy(e,l,e.resolvedFloatingTables??[],r)})()}function Yy(e,t){let n=Wy(t);for(let r of e.borders)Gy(r,t,n)}function Xy(e,t,n){let r=t.xPt-e.flowBounds.xPt,i=t.yPt-e.flowBounds.yPt,a=n.layoutTranslationPt??{xPt:0,yPt:0},o=cy(n.pointToCss??ly(n.scale),uy(r,i)),s=Ky(n.ctx,()=>n.ctx.translate(r,i)),c={...n,pointToCss:o,layoutTranslationPt:{xPt:a.xPt+r,yPt:a.yPt+i}};s(()=>{let t=()=>Yy(e,c);if(!e.clipBounds){t();return}Ky(n.ctx,()=>{n.ctx.beginPath(),n.ctx.rect(e.clipBounds.xPt,e.clipBounds.yPt,e.clipBounds.widthPt,e.clipBounds.heightPt),n.ctx.clip()})(t)()})()}function Zy(e,t,n,r){for(let n of e.rows)for(let e of n.cells){let n=`visualMergeOwnership`in e&&e.visualMergeOwnership===`continuation`;if(e.verticalMerge===`continue`&&!n)continue;e.background&&(t.ctx.fillStyle=e.background.color,t.ctx.fillRect(e.flowBounds.xPt,e.flowBounds.yPt,e.flowBounds.widthPt,e.flowBounds.heightPt));let r=(t,n=!0)=>{for(let r of e.blocks)Jy(r.layout,{xPt:e.contentBounds.xPt+(r.layout.kind===`table`?r.layout.flowBounds.xPt:0),yPt:e.flowBounds.yPt+r.offsetPt+(r.layout.kind===`table`?r.layout.flowBounds.yPt:0)},t,r.layout.kind!==`table`||n)};if(!e.clipBounds){r(t);continue}if(Ky(t.ctx,()=>{t.ctx.beginPath(),t.ctx.rect(e.clipBounds.xPt,e.clipBounds.yPt,e.clipBounds.widthPt,e.clipBounds.heightPt),t.ctx.clip()})(()=>r(t,!1))(),e.blocks.some(e=>e.layout.kind===`table`)){let n=qy(e.clipBounds,t);Ky(t.ctx,()=>{t.ctx.beginPath(),t.ctx.rect(n.xPt,n.yPt,n.widthPt,n.heightPt),t.ctx.clip()})(()=>{for(let n of e.blocks)n.layout.kind===`table`&&Xy(n.layout,{xPt:e.contentBounds.xPt+n.layout.flowBounds.xPt,yPt:e.flowBounds.yPt+n.offsetPt+n.layout.flowBounds.yPt},t)})()}}eb(n,t),r&&Yy(e,t)}function Qy(e,t,n,r){if(!e.clipBounds){Zy(e,t,n,r);return}let i=e.clipBounds;Ky(t.ctx,()=>{t.ctx.beginPath(),t.ctx.rect(i.xPt,i.yPt,i.widthPt,i.heightPt),t.ctx.clip()})(()=>Zy(e,t,n,r))()}function $y(e,t,n){Qy(e,t,n??e.resolvedFloatingTables??[],!0)}function eb(e,t){let n=t.layoutTranslationPt??{xPt:0,yPt:0};for(let r of e)Jy(r.child,{xPt:r.xPt-n.xPt,yPt:r.yPt-n.yPt},t)}function tb(e,t){let n=e.transform;if(n){n.call(e,t.a,t.b,t.c,t.d,t.e,t.f);return}if(e.translate(t.e,t.f),t.a===0&&t.b===1&&t.c===-1&&t.d===0)e.rotate(Math.PI/2);else if(t.a===0&&t.b===-1&&t.c===1&&t.d===0)e.rotate(-Math.PI/2);else if(t.b===0&&t.c===0)e.scale(t.a,t.d);else throw Error(`Canvas context cannot apply the retained point-space transform`)}function nb(e){if(e.text.length!==e.range.end-e.range.start)throw Error(`UTF-16 text range is inconsistent`);if(e.clusters.length===0)throw Error(`Retained glyph slices are incomplete (clusters)`);let t=e.range.start;for(let n of e.clusters){let{advancePt:r,offset:i,range:a}=n;if(!Number.isFinite(r)||!Number.isFinite(i.xPt)||!Number.isFinite(i.yPt)||a.start!==t||a.end<=a.start||a.end>e.range.end)throw Error(`Retained glyph slices are incomplete (cluster range ${t}:${a.start}-${a.end}/${e.range.end}; advance ${r}; offset ${i.xPt},${i.yPt})`);t=a.end}if(t!==e.range.end)throw Error(`Retained glyph slices are incomplete (cluster end ${t}/${e.range.end})`);if(e.paintOps.length===0)throw Error(`Retained glyph slices are incomplete (paint ops)`);let n=e.range.start;for(let t of e.paintOps){let r=t.sourceMapping!==`kashida`&&t.text.length!==t.range.end-t.range.start,i=!Number.isFinite(t.offset.xPt)||!Number.isFinite(t.offset.yPt)||t.glyphOffsetPt!==void 0&&(!Number.isFinite(t.glyphOffsetPt.xPt)||!Number.isFinite(t.glyphOffsetPt.yPt))||t.blockAxisInkBounds!==void 0&&(!Number.isFinite(t.blockAxisInkBounds.startPt)||!Number.isFinite(t.blockAxisInkBounds.endPt)||t.blockAxisInkBounds.endPt<t.blockAxisInkBounds.startPt)||!Number.isFinite(t.letterSpacingPt)||!Number.isFinite(t.scaleX)||t.scaleX<=0||t.scaleY!==void 0&&(!Number.isFinite(t.scaleY)||t.scaleY<=0),a=t.range.start!==n||t.range.end<=t.range.start||t.range.end>e.range.end;if(r||i||a)throw Error(`Retained glyph slices are incomplete (${r?`text`:i?`geometry`:`range ${n}:${t.range.start}-${t.range.end}/${e.range.end}`})`);n=t.range.end}let r=e.text.slice(n-e.range.start);if(r!==``&&!/^\\s+$/u.test(r))throw Error(`Retained glyph slices are incomplete (paint end ${n}/${e.range.end})`)}function rb(e,t){return e.kind===`explicit`?e.color:e.kind===`auto`?ct(e.background??`#FFFFFF`):t.defaultTextColor??`#000000`}function ib(e,t){return rb(e.color,t)}function ab(e,t,n=!1){let{ctx:r}=t;r.fillStyle=rb(e.color,t),r.font=L(e.fontRoute,e.fontSizePt,e.fontWeight,e.fontStyle),n?(r.save(),r.translate(e.origin.xPt,e.origin.yPt),r.rotate(-Math.PI/2),r.fillText(e.text,0,0),r.restore()):r.fillText(e.text,e.origin.xPt,e.origin.yPt)}function ob(e,t){let{ctx:n}=t;if(n.beginPath(),e.points.length>0){let t=e.points[0];n.moveTo(t.xPt,t.yPt);for(let t of e.points.slice(1))n.lineTo(t.xPt,t.yPt)}e.stroke!==null&&(n.strokeStyle=e.stroke,n.lineWidth=e.strokeWidthPt,n.stroke()),e.fill!==null&&(n.fillStyle=e.fill,n.fill())}function sb(e,t){let n=new Map(e.textBoxes.map(e=>[e.id,e]));return(t.textBoxIds??[]).flatMap(e=>{let t=n.get(e);return t?[t]:[]})}function cb(e,t,n){let r=n.layoutTranslationPt,i=e.anchorLayer?.horizontalOwnership===`page`?-(r?.xPt??0):0,a=e.anchorLayer?.verticalOwnership===`page`?-(r?.yPt??0):0;(i!==0||a!==0)&&(n.ctx.save(),n.ctx.translate(i,a));let o=n=>{Uy(e,n);for(let e of t)fb(e,{...n,omitAnchoredDrawings:!1})};try{if(e.orientation===`upright-physical`){if(!e.transform)throw Error(`Upright physical drawing requires its retained logical transform`);let t=cy(n.pointToCss??ly(n.scale),e.transform);Ky(n.ctx,()=>{tb(n.ctx,e.transform)})(()=>o({...n,pointToCss:t}))()}else o(n)}finally{(i!==0||a!==0)&&n.ctx.restore()}}function lb(e,t,n){cb(t,sb(e,t),n)}function ub(e,t){let{ctx:n}=t,r=new Set(e.drawings.flatMap(e=>e.textBoxIds??[])),i=n=>lb(e,n,t),a=e.drawings.filter(e=>e.anchorLayer?.behindDoc===!0).sort((e,t)=>e.anchorLayer.relativeHeight-t.anchorLayer.relativeHeight||e.anchorLayer.sourceOrder-t.anchorLayer.sourceOrder);if(!t.omitAnchoredDrawings)for(let e of a)i(e);for(let t of e.lineNumbers??[])for(let e of t.paintOps)n.fillStyle=e.color,n.font=e.font,n.textAlign=e.textAlign,n.textBaseline=`alphabetic`,n.fillText(e.text,e.origin.xPt,e.origin.yPt);e.shading&&(n.fillStyle=e.shading.color,n.fillRect(e.inkBounds.xPt,e.inkBounds.yPt,e.inkBounds.widthPt,e.inkBounds.heightPt));for(let r of e.lines)for(let e of r.placements){if(e.kind===`resource`){if(!t.resources)throw Error(`Missing retained resource painter for ${e.resourceKey}`);if(t.textBoxVerticalMode){let r=t.textBoxVerticalMode===`vert270`?Math.PI/2:-Math.PI/2;n.save(),n.translate(e.bounds.xPt+e.bounds.widthPt/2,e.bounds.yPt+e.bounds.heightPt/2),n.rotate(r),Hy(e.resourceKey,e.resourceKind,{xPt:-e.bounds.heightPt/2,yPt:-e.bounds.widthPt/2,widthPt:e.bounds.heightPt,heightPt:e.bounds.widthPt},e.orientation,t),n.restore()}else Hy(e.resourceKey,e.resourceKind,e.bounds,e.orientation,t);continue}if(e.kind===`tab`){if(e.leader!==`none`){if(!e.leaderGlyphs)throw Error(`Retained tab leader geometry is missing`);for(let n of e.leaderGlyphs)ab(n,t)}continue}if(e.kind!==`text`)continue;if(nb(e),e.unsupportedGeometry?.length)throw Error(`Unsupported retained typography geometry: ${e.unsupportedGeometry.join(`, `)}`);if(e.highlightFragments)for(let t of e.highlightFragments)n.fillStyle=t.color,n.fillRect(t.rect.xPt,t.rect.yPt,t.rect.widthPt,t.rect.heightPt);else (e.background||e.highlight)&&(n.fillStyle=e.highlight??e.background??`#000000`,n.fillRect(e.bounds.xPt,e.bounds.yPt,e.bounds.widthPt,e.bounds.heightPt));n.fillStyle=ib(e,t),n.font=L(e.fontRoute,e.fontSizePt,e.fontWeight,e.fontStyle),n.textAlign=`left`,n.textBaseline=`alphabetic`;let r=n.letterSpacing,i=n.fontKerning;for(let t of e.paintOps){n.direction=t.direction,n.fontKerning=t.kerning;let r=e.origin.xPt+t.offset.xPt,i=e.origin.yPt+t.offset.yPt,a=t.glyphOffsetPt?.xPt??0,o=t.glyphOffsetPt?.yPt??0;if(t.glyphOrientation===`upright`){n.save(),n.translate(r,i),n.rotate(-Math.PI/2),(t.scaleX!==1||t.scaleY!==void 0)&&(t.writingMode===`vertical-rl`?n.scale(1,t.scaleX):n.scale(t.scaleX,t.scaleY??1)),n.textAlign=`center`,n.textBaseline=`middle`,n.letterSpacing=`${t.letterSpacingPt}px`;let e=()=>n.fillText(t.text,a,o);t.verticalFeature?ws(n,e):e(),n.restore()}else t.glyphOrientation===`rotate`?(n.save(),n.translate(r,i),t.scaleX!==1&&n.scale(t.scaleX,1),n.textAlign=`center`,n.textBaseline=`middle`,n.letterSpacing=`${t.letterSpacingPt/t.scaleX}px`,n.fillText(t.text,a,o),n.restore()):t.scaleX===1?(n.letterSpacing=`${t.letterSpacingPt}px`,n.fillText(t.text,r+a,i+o)):(n.save(),n.translate(r+a,i+o),n.scale(t.scaleX,1),n.letterSpacing=`${t.letterSpacingPt/t.scaleX}px`,n.fillText(t.text,0,0),n.restore())}if(n.letterSpacing=r,n.fontKerning=i,e.ruby){let n=t.textBoxVerticalMode===`eaVert`||t.textBoxVerticalMode===`mongolianVert`;for(let r of e.ruby.paintOps)ab(r,t,n)}for(let n of e.emphasis?.glyphs??[])ab(n,t);for(let n of e.emphasis?.paths??[])ob(n,t);for(let n of e.decorations)Gy(n,t);for(let n of e.runBorderFragments??[])Gy(n,t)}let o=Wy(t);for(let n of e.borders)Gy(n,t,o);for(let t of e.drawings.filter(e=>!e.anchorLayer))i(t);let s=e.drawings.filter(e=>e.anchorLayer&&!e.anchorLayer.behindDoc).sort((e,t)=>e.anchorLayer.relativeHeight-t.anchorLayer.relativeHeight||e.anchorLayer.sourceOrder-t.anchorLayer.sourceOrder);if(!t.omitAnchoredDrawings)for(let e of s)i(e);for(let n of e.textBoxes)r.has(n.id)||fb(n,{...t,omitAnchoredDrawings:!1})}function db(e,t){if(!e.clipBounds){ub(e,t);return}let n=e.clipBounds;Ky(t.ctx,()=>{t.ctx.beginPath(),t.ctx.rect(n.xPt,n.yPt,n.widthPt,n.heightPt),t.ctx.clip()})(()=>ub(e,t))()}function fb(e,t){let n=t=>{for(let n of e.story.blocks)if(n.kind===`paragraph`)db(n,t);else if(n.kind===`table`)$y(n,t,n.resolvedFloatingTables??[]);else throw Error(`Text-box story contains unsupported retained node: ${n.kind}`)},r=cy(t.pointToCss??ly(t.scale),e.transform),i=e.transform.a!==1||e.transform.b!==0||e.transform.c!==0||e.transform.d!==1||e.transform.e!==0||e.transform.f!==0,a=Ky(t.ctx,()=>{i&&(e.verticalMode?(t.ctx.translate(e.transform.e,e.transform.f),t.ctx.rotate(e.verticalMode===`vert270`?-Math.PI/2:Math.PI/2)):t.ctx.transform(e.transform.a,e.transform.b,e.transform.c,e.transform.d,e.transform.e,e.transform.f))}),o=e.clipBounds?Ky(t.ctx,()=>{t.ctx.beginPath(),t.ctx.rect(e.clipBounds.xPt,e.clipBounds.yPt,e.clipBounds.widthPt,e.clipBounds.heightPt),t.ctx.clip()}):null,s=t.documentDefaultTextColor??t.defaultTextColor??`#000000`,c={...t,pointToCss:r,documentDefaultTextColor:s,defaultTextColor:e.defaultTextColor??s,...e.verticalMode?{textBoxVerticalMode:e.verticalMode}:{}};a(()=>{o?o(()=>n(c))():n(c)})()}function pb(e,t){let n=cy(t.pointToCss??ly(t.scale),e.logicalToPhysical),r={...t,pointToCss:n};Ky(t.ctx,()=>{tb(t.ctx,e.logicalToPhysical)})(()=>{for(let t of e.segments)Gy(t,r,.5)})()}const mb=Object.freeze({paint(e,t){throw Error(`Missing retained resource painter for ${e}: expected ${t}`)}});function hb(e,t){return Object.freeze({paint(n,r,i,a){switch(r){case`image`:t.image(e.resolve(n,r),i,a);return;case`chart`:t.chart(e.resolve(n,r),i,a);return;case`math`:t.math(e.resolve(n,r),i,a);return;case`picture-bullet`:t[`picture-bullet`](e.resolve(n,r),i,a);return;default:throw Error(`Unknown retained resource kind: ${String(r)}`)}}})}function gb(e,t){switch(e.kind){case`drawing`:Uy(e,t);return;case`paragraph`:db(e,t);return;case`table`:$y(e,t,e.resolvedFloatingTables??[]);return;case`note`:{e.separator.forEach(e=>Gy(e,t));let n=()=>e.story.blocks.forEach(e=>gb(e,t));if(!e.story.clipBounds){n();return}let r=e.story.clipBounds;t.ctx.save();try{t.ctx.beginPath(),t.ctx.rect(r.xPt,r.yPt,r.widthPt,r.heightPt),t.ctx.clip(),n()}finally{t.ctx.restore()}return}case`textbox`:throw Error(`Unsupported page paint node kind: ${e.kind}`);default:throw Error(`Unknown page paint node kind: ${String(e)}`)}}function _b(e,t){let n=e.columnSeparators;if(n.length===0)return;let{ctx:r}=t;r.save(),r.strokeStyle=`#000000`;for(let e of n){let n=Vy(e,t.scale,t.dpr);r.lineWidth=n.widthPt,r.beginPath(),r.moveTo(n.segment.start.xPt,n.segment.start.yPt),r.lineTo(n.segment.end.xPt,n.segment.end.yPt),r.stroke()}r.restore()}function vb(e,t,n,r){let i=n.get(e.flowDomainId),a=e.coordinateSpace===`upright-physical`?void 0:i?.coordinateSpace.logicalToPhysical,o=Ky(t.ctx,()=>{a&&(a.a!==1||a.b!==0||a.c!==0||a.d!==1||a.e!==0||a.f!==0)&&tb(t.ctx,a)}),s={...t,...a?{pointToCss:{a:a.a*t.scale,b:a.b*t.scale,c:a.c*t.scale,d:a.d*t.scale,e:a.e*t.scale,f:a.f*t.scale}}:{}};o(()=>r(s))()}function yb(e,t){if(e.kind===`transform`){let n=t.transform;if(n)n.call(t,e.transform.a,e.transform.b,e.transform.c,e.transform.d,e.transform.e,e.transform.f);else if(e.transform.a===1&&e.transform.b===0&&e.transform.c===0&&e.transform.d===1)t.translate(e.transform.e,e.transform.f);else throw Error(`Canvas context cannot apply the retained page paint transform`);return}t.beginPath(),t.rect(e.clip.xPt,e.clip.yPt,e.clip.widthPt,e.clip.heightPt),t.clip()}function bb(e,t){let n=t.pointToCss??ly(t.scale);for(let t of e.frames)t.kind===`transform`&&(n=cy(n,t.transform));let r={...t,pointToCss:n,layoutTranslationPt:e.layoutTranslationPt,omitAnchoredDrawings:!1},i=0;try{for(let n of e.frames)t.ctx.save(),i+=1,yb(n,t.ctx);cb(e.node,e.textBoxes,r)}finally{for(;i>0;)t.ctx.restore(),--i}}function xb(e,t){let n=new Map(e.sectionRegions.flatMap(e=>e.flowDomainIds.map(t=>[t,e]))),r=new Map(e.sectionRegions.map(e=>[e.id,e]));for(let t of e.flowDomains)if(t.kind===`footnote`||t.kind===`endnote`){let i=t.sectionRegionId?r.get(t.sectionRegionId):e.sectionRegions[0];if(!i)throw Error(`${t.id} references missing page story region ${t.sectionRegionId??`<default>`}`);n.set(t.id,i)}let i=e.layers.paintOrder,a=i.findIndex(e=>e.sourceLayer!==`background`&&e.sourceLayer!==`behindText`&&e.sourceLayer!==`header`),o=a===-1?i.length:a,s=e=>{for(let r of e)vb(r,t,n,e=>{r.kind===`drawing`?bb(r,e):gb(r.node,{...e,omitAnchoredDrawings:r.omitAnchoredDrawings})})};e.pageBorder?.zOrder===`back`&&pb(e.pageBorder,t),s(i.slice(0,o)),_b(e,t),s(i.slice(o)),e.pageBorder?.zOrder!==`back`&&e.pageBorder&&pb(e.pageBorder,t)}async function Sb(e,t,n,r,i=mb){let a=e.pages[t];if(!a)throw RangeError(`Page ${t} is outside the layout`);let o=n.getContext(`2d`);if(!o)throw Error(`Canvas 2D context is unavailable`);let s=r.scale*r.dpr;n.width=Math.ceil(a.geometry.widthPt*s),n.height=Math.ceil(a.geometry.heightPt*s),o.save();try{o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,n.width,n.height),o.setTransform(s,0,0,s,0,0),xb(a,{ctx:o,scale:r.scale,dpr:r.dpr,resources:i})}finally{o.restore()}}function Cb(e,t){if(typeof e!=`string`||e.trim().length===0)throw TypeError(`${t} must be a non-empty string`)}function wb(e){return Cb(e,`unavailable paint resource reason`),Object.freeze({status:`unavailable`,reason:e})}function Tb(e){return typeof e==`object`&&!!e&&e.status===`unavailable`&&typeof e.reason==`string`&&e.reason.trim().length>0}function Eb(e){typeof e!=`object`||!e||e.status!==`unavailable`||Cb(e.reason,`unavailable paint resource reason`)}function Db(e,t){let n=new Map;for(let r of t){if(n.has(r.resourceKey))throw Error(`Duplicate paint resource handle: ${r.resourceKey}`);Eb(r.handle),e.resolve(r.resourceKey,r.kind),n.set(r.resourceKey,Object.freeze({kind:r.kind,handle:r.handle}))}let r=Object.freeze([...n.keys()].sort());return Object.freeze({keys:r,resolve(t,r){let i=e.resolve(t,r),a=n.get(t);if(!a)throw Error(`Missing paint resource handle for ${t}: expected ${r}`);if(a.kind!==r)throw Error(`Paint resource kind mismatch for ${t}: expected ${r}, got ${a.kind}`);return Object.freeze({descriptor:i,handle:a.handle})}})}function Ob(e,t){return Db(e,e.descriptors.map(e=>{if(e.kind===`chart`)return{resourceKey:e.resourceKey,kind:e.kind,handle:null};let n=t(e);if(n==null)throw Error(`Missing ${e.kind} paint handle for ${e.resourceKey}`);return{resourceKey:e.resourceKey,kind:e.kind,handle:n}}))}function kb(e){if(!Tb(e.handle)){if(e.handle===void 0||e.handle===null)throw Error(`Missing ${e.descriptor.kind} drawable for ${e.descriptor.resourceKey}`);return e.handle}}function Ab(e,t,n){let r=e.descriptor,i=kb(e);if(!i)return;let a=(e,a)=>{Ca(n,i,r.srcRect,e,a,t.widthPt,t.heightPt)},o=r.alpha!==void 0&&r.alpha<1;o&&(n.save(),n.globalAlpha*=r.alpha);let s=r.rotation??0;s===0&&!r.flipH&&!r.flipV?a(t.xPt,t.yPt):(n.save(),n.translate(t.xPt+t.widthPt/2,t.yPt+t.heightPt/2),n.rotate(s*Math.PI/180),n.scale(r.flipH?-1:1,r.flipV?-1:1),a(-t.widthPt/2,-t.heightPt/2),n.restore()),o&&n.restore()}function jb(e,t,n){let r=kb(e);r&&n.drawImage(r,t.xPt,t.yPt,t.widthPt,t.heightPt)}const Mb=Object.freeze({image(e,t,n){Ab(e,t,n)},chart(e,t,n){jn(n,e.descriptor.model,{x:t.xPt,y:t.yPt,w:t.widthPt,h:t.heightPt},1)},math(e,t,n){jb(e,t,n)},\"picture-bullet\"(e,t,n){jb(e,t,n)}}),Nb=new WeakMap;function Pb(e,t){return(t??e.geometry.widthPt*1.3333333333333333)/e.geometry.widthPt}function Fb(e){if(ja(e))return e.ownerDocument??(typeof document>`u`?null:document);let t=e.ownerDocument,n=t?.defaultView?.HTMLCanvasElement;return n&&e instanceof n?t:null}function Ib(e){return Fb(e)!==null}function Lb(e,t){let n=Fb(e);if(!t||n&&e.isConnected)return{canvas:e};let r=n??(typeof document>`u`?void 0:document);if(!r)throw Error(`OpenType vertical glyph paint requires an element-backed document surface`);let i=r.body??r.documentElement;if(!i)throw Error(`OpenType vertical glyph paint requires an attached document surface`);let a=r.createElement(`canvas`);return a.setAttribute(`aria-hidden`,`true`),Object.assign(a.style,{position:`fixed`,left:`-99999px`,top:`0`,opacity:`0`,pointerEvents:`none`}),i.appendChild(a),{canvas:a,release:()=>a.remove()}}async function Rb(e,t,n,r){let i=r.fetchImage?_a(r.fetchImage):void 0,a;try{let i=(Nb.get(n)??0)+1;Nb.set(n,i);let o=()=>Nb.get(n)!==i,s=r.dpr??Ma(),c=Lb(n,!r.parseError&&t.layers.capabilities.requiresElementBackedVerticalGlyphPaint),l=c.canvas;a=c.release;let u=l.getContext(`2d`);if(!u)throw Error(`2D canvas is unavailable for DOCX paint`);let d=Pb(t,r.width),f=t.geometry.widthPt*d,p=t.geometry.heightPt*d,m=Fa(f*s,p*s),h=m.clamped?s*m.scale:s;if(n.width=m.width,n.height=m.height,l!==n&&(l.width=m.width,l.height=m.height),Ib(n)&&(n.style.width=`${f}px`,n.style.height=`${p}px`,n.style.display||(n.style.display=`block`)),Ib(l)&&l!==n&&(l.style.width=`${f}px`,l.style.height=`${p}px`),u.scale(h,h),u.fillStyle=`#ffffff`,u.fillRect(0,0,f,p),r.parseError){await Sb(e,0,n,{scale:d,dpr:h});return}let g;try{g=await Ry(r.registry.descriptors,r.fetchImage)}catch(e){if(o())return;throw e}if(o())return;let _=hb(Ob(r.registry,e=>{if(e.kind===`math`)return r.privateResources?.keys.includes(e.resourceKey)?r.privateResources.resolve(e.resourceKey):wb(`optional math renderer unavailable`);if(e.kind===`image`||e.kind===`picture-bullet`)return g.get(jy(e.partPath,e.colorReplaceFrom,e.duotone))??wb(r.fetchImage?`unsupported image format produced no drawable output`:`image byte source unavailable`)}),Mb);u.save();try{u.scale(d,d),xb(t,{ctx:u,scale:d,dpr:h,resources:_,documentDefaultTextColor:r.defaultTextColor??`#000000`,defaultTextColor:r.defaultTextColor??`#000000`,showTrackChanges:r.showTrackChanges??!0})}finally{u.restore()}if(l!==n){if(o())return;let e=n.getContext(`2d`);if(!e)throw Error(`2D canvas is unavailable for DOCX paint projection`);e.drawImage(l,0,0)}if(r.onTextRun)for(let e of r.textRuns)r.onTextRun(e)}finally{a?.(),i?.()}}var zb=class extends Error{code=`NOTE_CAPACITY_EXCEEDED`;constructor(e,t,n){super(`${e} story exceeds ${n} on page ${t}`),this.kind=e,this.pageIndex=t,this.containerId=n,this.name=`NoteCapacityExceededError`}};function Bb(e){return Object.freeze({...e,pages:Object.freeze([...e.pages])})}function Vb(e){let{kind:t,region:n,...r}=e,i=_v(r);if(n&&(i=vv(i,n)),t===`content`&&i.sectionRegions.length===0)throw RangeError(`A content page draft requires an initial section region`);if(t===`parity-blank`&&i.sectionRegions.length!==0)throw RangeError(`A parity blank cannot retain a section region`);return Object.freeze({kind:t,accumulator:i})}function Hb(e,t){if(t.kind!==`content`||t.accumulator.pageIndex!==e.pageIndex)throw Error(`The initial body page must be owned by the active flow`);return Bb({flow:e,pages:[t],footnoteReservePt:0,balanceTargetPt:null})}function Ub(e,t){if(t!==null&&(!Number.isFinite(t)||t<0))throw RangeError(`A body balance target must be finite and non-negative`);return Bb({...e,balanceTargetPt:t})}function Wb(e,t){if(!Number.isFinite(t)||t<0)throw RangeError(`A footnote reserve increment must be finite and non-negative`);return t===0?e:Bb({...e,footnoteReservePt:e.footnoteReservePt+t})}function Gb(e,t,n){let r=[...e.pages],i=t.state,a=!1;for(let e of t.events){if(e.type===`place`)throw Error(`Occurrence acceptance owns place events`);if(e.type!==`next-column`){if(e.type===`next-page`){if(e.parityBlank)r.push(n.openParityBlankPage(e));else{let a=n.openContentPage(e,t.state);r.push(a.page),i=a.flow}a=!0;continue}if(!a){let t=r.at(-1);if(!t||t.kind!==`content`)throw Error(`A continuous section requires an active content page`);r[r.length-1]=n.openSamePageSectionRegion(t,e,i)}}}let o=r.at(-1);if(!o||o.kind!==`content`||o.accumulator.pageIndex!==i.pageIndex)throw Error(`A page transition must end on the active content page`);return Bb({...e,flow:i,pages:r,footnoteReservePt:a?0:e.footnoteReservePt,balanceTargetPt:a?null:e.balanceTargetPt})}function Kb(e){if(e.length===0)return null;let t=Math.min(...e.map(e=>e.xPt)),n=Math.min(...e.map(e=>e.yPt)),r=Math.max(...e.map(e=>e.xPt+e.widthPt)),i=Math.max(...e.map(e=>e.yPt+e.heightPt));return{xPt:t,yPt:n,widthPt:r-t,heightPt:i-n}}function qb(e){return{x:!e.horzSpecified||e.horzAnchor!==`page`&&e.horzAnchor!==`margin`,y:e.vertAnchor!==`page`&&e.vertAnchor!==`margin`}}function Jb(e,t){return{...e,xPt:e.xPt+t.xPt,yPt:e.yPt+t.yPt}}function Q(e,t){return{...e,xPt:e.xPt+t.xPt,yPt:e.yPt+t.yPt}}function Yb(e,t){return{...e,from:Jb(e.from,t),to:Jb(e.to,t)}}function Xb(e,t){return e.kind===`rect`?{...e,rect:Q(e.rect,t)}:{...e,points:e.points.map(e=>Jb(e,t))}}function Zb(e,t){return e.kind===`noop`?e:e.kind===`drawingml-shape`?{...e,plan:{...e.plan,rect:{...e.plan.rect,x:e.plan.rect.x+t.xPt,y:e.plan.rect.y+t.yPt}}}:{...e,rect:Q(e.rect,t)}}function Qb(e,t){let n=e.orientation===`upright-physical`?{xPt:0,yPt:0}:t;return{...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:Q(e.clipBounds,t)}:{},...e.transform?{transform:{...e.transform,e:e.transform.e+t.xPt,f:e.transform.f+t.yPt}}:{},...e.clip?{clip:Xb(e.clip,t)}:{},commands:e.commands.map(e=>Zb(e,n))}}function $b(e,t,n){let r=`${t.xPt}\\u0000${t.yPt}`,i=n.drawingMemo.get(e);if(i){if(i.key!==r)throw Error(`incompatible projection ownership`);return i.value}let a=Qb(e,t);return n.drawingMemo.set(e,{key:r,value:a}),a}function ex(e,t,n){return e.kind===`text`?{...e,origin:Jb(e.origin,t),bounds:Q(e.bounds,t),decorations:e.decorations.map(e=>({...e,from:Jb(e.from,t),to:Jb(e.to,t),...e.path?{path:e.path.map(e=>Jb(e,t))}:{}})),...e.highlightFragments?{highlightFragments:e.highlightFragments.map(e=>({...e,rect:Q(e.rect,t)}))}:{},...e.ruby?{ruby:{...e.ruby,paintOps:e.ruby.paintOps.map(e=>({...e,origin:Jb(e.origin,t)}))}}:{},...e.emphasis?{emphasis:{...e.emphasis,...e.emphasis.glyphs?{glyphs:e.emphasis.glyphs.map(e=>({...e,origin:Jb(e.origin,t)}))}:{},...e.emphasis.paths?{paths:e.emphasis.paths.map(e=>({...e,points:e.points.map(e=>Jb(e,t))}))}:{}}}:{},...e.runBorderFragments?{runBorderFragments:e.runBorderFragments.map(e=>Yb(e,t))}:{}}:e.kind===`anchor-host`?{...e,bounds:Q(e.bounds,t),baselinePt:e.baselinePt+t.yPt}:e.kind===`drawing`?{...e,bounds:Q(e.bounds,n?.get(e.drawingId)??t)}:e.kind===`tab`&&e.leaderGlyphs?{...e,...e.bounds?{bounds:Q(e.bounds,t)}:{},leaderGlyphs:e.leaderGlyphs.map(e=>({...e,origin:Jb(e.origin,t)}))}:e.bounds?{...e,bounds:Q(e.bounds,t)}:e}function tx(e,t,n){return{...e,bounds:Q(e.bounds,t),baselinePt:e.baselinePt+t.yPt,placements:e.placements.map(e=>ex(e,t,n))}}function nx(e,t){let n=e.axes[t];return n.status===`resolved`&&[`page`,`margin`,`leftMargin`,`rightMargin`,`topMargin`,`bottomMargin`].includes(n.referenceFrame)}function rx(e,t){let n=nx(e,`horizontal`)?0:t.xPt,r=nx(e,`vertical`)?0:t.yPt,i={xPt:n,yPt:r},a={horizontal:e.axes.horizontal.status===`resolved`?{...e.axes.horizontal,baseStartPt:e.axes.horizontal.baseStartPt+n,baseEndPt:e.axes.horizontal.baseEndPt+n,resolvedOriginPt:e.axes.horizontal.resolvedOriginPt+n}:e.axes.horizontal,vertical:e.axes.vertical.status===`resolved`?{...e.axes.vertical,baseStartPt:e.axes.vertical.baseStartPt+r,baseEndPt:e.axes.vertical.baseEndPt+r,resolvedOriginPt:e.axes.vertical.resolvedOriginPt+r}:e.axes.vertical};return e.status===`unsupported`?{...e,axes:a}:{...e,axes:a,geometry:{...e.geometry,objectFrame:Q(e.geometry.objectFrame,i),inkBounds:Q(e.geometry.inkBounds,i),wrapBounds:e.geometry.wrapBounds?Q(e.geometry.wrapBounds,i):null,wrap:{...e.geometry.wrap,polygon:e.geometry.wrap.polygon?{...e.geometry.wrap.polygon,points:e.geometry.wrap.polygon.points.map(e=>Jb(e,i))}:null}}}}function ix(e,t){return ax(e,t,{memo:new WeakMap,drawingMemo:new WeakMap})}function ax(e,t,n){let r=`${t.xPt}\\u0000${t.yPt}`,i=n.memo.get(e);if(i){if(i.key!==r)throw Error(`incompatible projection ownership`);return i.value}let a=new Map(e.drawings.flatMap(e=>e.anchorLayer?[[e.anchorLayer.occurrenceId,e.anchorLayer]]:[])),o=new Map,s=new Map;for(let n of e.drawings){let e={xPt:n.anchorLayer?.horizontalOwnership===`page`?0:t.xPt,yPt:n.anchorLayer?.verticalOwnership===`page`?0:t.yPt};s.set(n.id,e),n.textBoxIds?.forEach(t=>o.set(t,n.orientation===`upright-physical`?{xPt:0,yPt:0}:e))}let c=e.drawings.map(e=>$b(e,s.get(e.id)??t,n)),l=Kb(c.filter(e=>e.anchorLayer?.cellContainment===!0).map(e=>e.flowBounds)),u={...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:Q(e.clipBounds,t)}:{},lines:e.lines.map(e=>tx(e,t,s)),borders:e.borders.map(e=>Yb(e,t)),drawings:c,...l?{cellContainmentBounds:l}:{},textBoxes:e.textBoxes.map(e=>sx(e,o.get(e.id)??t,n)),exclusions:e.exclusions.map(e=>{let n=e.anchorOccurrenceId?a.get(e.anchorOccurrenceId):void 0,r={xPt:n?.horizontalOwnership===`page`?0:t.xPt,yPt:e.verticalOwnership===`page`||n?.verticalOwnership===`page`?0:t.yPt};return{...e,bounds:Q(e.bounds,r),polygon:e.polygon.map(e=>Jb(e,r))}}),...e.anchorCollisions?{anchorCollisions:e.anchorCollisions.map(e=>({...e,bounds:Q(e.bounds,{xPt:e.horizontalOwnership===`page`?0:t.xPt,yPt:e.verticalOwnership===`page`?0:t.yPt})}))}:{},...e.anchorFrames?{anchorFrames:e.anchorFrames.map(e=>rx(e,t))}:{},...e.paragraphMark?{paragraphMark:{...e.paragraphMark,bounds:Q(e.paragraphMark.bounds,t)}}:{},...e.lineNumbers?{lineNumbers:e.lineNumbers.map(e=>({...e,bounds:Q(e.bounds,t),paintOps:e.paintOps.map(e=>({...e,origin:Jb(e.origin,t)}))}))}:{}};return n.memo.set(e,{key:r,value:u}),u}function ox(e,t){return sx(e,t,{memo:new WeakMap,drawingMemo:new WeakMap})}function sx(e,t,n){let r=e.verticalMode===void 0;return{...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:r?Q(e.clipBounds,t):e.clipBounds}:{},...e.contentBounds?{contentBounds:r?Q(e.contentBounds,t):e.contentBounds}:{},transform:r?e.transform:{...e.transform,e:e.transform.e+t.xPt,f:e.transform.f+t.yPt},story:r?{...e.story,flowBounds:Q(e.story.flowBounds,t),inkBounds:Q(e.story.inkBounds,t),...e.story.clipBounds?{clipBounds:Q(e.story.clipBounds,t)}:{},blocks:e.story.blocks.map(e=>{if(e.kind===`paragraph`)return ax(e,t,n);if(e.kind===`table`)return lx(e,t);throw Error(`Text-box story contains unsupported retained node: ${e.kind}`)})}:e.story}}function cx(e,t){return ix(e,t)}function lx(e,t){return{...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:Q(e.clipBounds,t)}:{},borders:e.borders.map(e=>Yb(e,t)),rows:e.rows.map(e=>({...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:Q(e.clipBounds,t)}:{},cells:e.cells.map(e=>({...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:Q(e.clipBounds,t)}:{},contentBounds:Q(e.contentBounds,t),blocks:e.blocks}))}))}}function ux(e,t){return`${e}/occurrence/${encodeURIComponent(t).replaceAll(`%3A`,`:`)}`}function dx(e){if(!Number.isFinite(e.xPt)||!Number.isFinite(e.yPt))throw RangeError(`body occurrence translation must be finite`)}function fx(e){if(e.occurrenceId.length===0)throw RangeError(`occurrenceId must not be empty`);if(e.destination.flowDomainId.length===0)throw RangeError(`flowDomainId must not be empty`);dx(e.destination.translation)}function px(e,t){let n=qb(e.positioning);return{xPt:n.x?t.xPt:0,yPt:n.y?t.yPt:0}}function mx(e){let t=new WeakSet,n=new WeakSet,r=e=>{if(t.has(e))throw TypeError(`body occurrence layout graph must be acyclic`);if(!n.has(e)){if(t.add(e),e.kind===`paragraph`)for(let t of e.textBoxes)for(let e of t.story.blocks)(e.kind===`paragraph`||e.kind===`table`)&&r(e);else{for(let t of e.rows)for(let e of t.cells)for(let t of e.blocks)r(t.layout);for(let t of e.floatingTables??[])r(t.child);for(let t of e.resolvedFloatingTables??[])r(t.source.child),r(t.child)}t.delete(e),n.add(e)}};r(e)}function hx(e,t){mx(e);let n=new WeakMap,r=new WeakMap,i=e=>`${e.xPt}\\u0000${e.yPt}`,a=(e,t)=>{let n=i(t),a=r.get(e);if(a){if(a.key!==n)throw Error(`incompatible projection ownership`);return a.value}let o=cx(e,t),s=Object.freeze({...o,...e.sectionFlowOwnership===void 0?{}:{sectionFlowOwnership:e.sectionFlowOwnership}});return r.set(e,{key:n,value:s}),s},o=(e,t)=>{let r=i(t),a=n.get(e);if(a){if(a.key!==r)throw Error(`incompatible projection ownership`);return a.value}let s={...lx(e,t),...e.sectionFlowOwnership===void 0?{}:{sectionFlowOwnership:e.sectionFlowOwnership}};n.set(e,{key:r,value:s});let c=new Map,l=new Set;for(let n of e.resolvedFloatingTables??[]){let r=e.resolvedFloatingTableCoordinateSpace!==void 0;c.set(n.source,r?{xPt:0,yPt:0}:px(n.source,t)),r&&l.add(n.source)}let u=new Map,d=e=>{let n=u.get(e);if(n)return n;let r=c.get(e)??t,i=l.has(e)?{xPt:0,yPt:0}:t,a={...e,anchorBounds:Q(e.anchorBounds,i),...e.columnBounds?{columnBounds:Q(e.columnBounds,i)}:{},child:o(e.child,r)};return u.set(e,a),a},f=(e.floatingTables??[]).map(d),p=(e.resolvedFloatingTables??[]).map(e=>{let n=d(e.source),r=c.get(e.source)??px(e.source,t);return{...e,xPt:e.xPt+r.xPt,yPt:e.yPt+r.yPt,bounds:Q(e.bounds,r),exclusionBounds:Q(e.exclusionBounds,r),child:n.child,source:n}});return(e.floatingTables||e.resolvedFloatingTables)&&Object.assign(s,{floatingTables:f,resolvedFloatingTables:p}),s};return e.kind===`paragraph`?a(e,t):o(e,t)}function gx(e,t){return dx(t),hx(e,t)}function _x(e,t){fx(t);let n=hx(e,t.destination.translation),r=encodeURIComponent(t.occurrenceId),i=new WeakMap,a=new WeakMap,o=new WeakMap,s=new Map,c=new Map,l=e=>`${t.occurrenceId}/node/${encodeURIComponent(e)}`,u=e=>`${t.occurrenceId}/anchor/${encodeURIComponent(e)}`,d=e=>ux(t.occurrenceId,e),f=(e,n)=>`${t.destination.flowDomainId}/occurrence/${r}/${e}/${encodeURIComponent(n)}`,p=e=>e.kind===`drawing`?{...e,drawingId:l(e.drawingId)}:e.kind===`anchor-host`&&e.anchorOccurrenceId?{...e,anchorOccurrenceId:u(e.anchorOccurrenceId)}:e,m=(e,t)=>{let n=o.get(e);if(n){if(n.domain!==t)throw Error(`incompatible projection ownership`);return n.value}if(e.anchorLayer){let t=s.get(e.anchorLayer.occurrenceId);if(t&&t!==e)throw Error(`duplicate anchor occurrence owner`);s.set(e.anchorLayer.occurrenceId,e)}let r={...e,id:l(e.id),flowDomainId:t,...e.textBoxIds?{textBoxIds:e.textBoxIds.map(l)}:{},...e.anchorLayer?{anchorLayer:{...e.anchorLayer,occurrenceId:u(e.anchorLayer.occurrenceId),acquisitionOccurrenceId:e.anchorLayer.acquisitionOccurrenceId??e.anchorLayer.occurrenceId}}:{}};return o.set(e,{domain:t,value:r}),r},h=e=>{let t=f(`textbox`,e.id);return{...e,id:l(e.id),flowDomainId:t,story:{...e.story,blocks:e.story.blocks.map(e=>{if(e.kind===`paragraph`)return g(e,t);if(e.kind===`table`)return b(e,t);throw Error(`Text-box story contains unsupported retained node: ${e.kind}`)})}}},g=(e,t)=>{let n=a.get(e);if(n){if(n.domain!==t)throw Error(`incompatible projection ownership`);return n.value}let r={...e,id:l(e.id),flowDomainId:t,lines:e.lines.map(e=>({...e,placements:e.placements.map(p)})),drawings:e.drawings.map(e=>m(e,t)),textBoxes:e.textBoxes.map(h),exclusions:e.exclusions.map(e=>({...e,id:e.verticalOwnership===`page`&&!e.anchorOccurrenceId?e.id:l(e.id),...e.anchorOccurrenceId?{anchorOccurrenceId:u(e.anchorOccurrenceId)}:{}})),...e.anchorCollisions?{anchorCollisions:e.anchorCollisions.map(e=>({...e,occurrenceId:u(e.occurrenceId)}))}:{},...e.anchorFrames?{anchorFrames:e.anchorFrames.map(e=>({...e,occurrenceId:u(e.occurrenceId)}))}:{}};return a.set(e,{domain:t,value:r}),r},_=e=>{let t=f(`cell`,e.id);return{...e,id:l(e.id),flowDomainId:t,blocks:e.blocks.map(e=>({...e,layout:x(e.layout,t)}))}},v=(e,t)=>({...e,id:l(e.id),flowDomainId:t,...`occurrenceId`in e&&typeof e.occurrenceId==`string`?{occurrenceId:d(e.occurrenceId)}:{},cells:e.cells.map(_)}),y=e=>{let t=f(`cell`,e.hostCellId);return{...e,occurrenceId:d(e.occurrenceId),hostCellId:l(e.hostCellId),tableId:l(e.tableId),child:b(e.child,t)}},b=(e,t)=>{let n=i.get(e);if(n){if(n.domain!==t)throw Error(`incompatible projection ownership`);return n.value}let r={...e,id:l(e.id),flowDomainId:t,rows:e.rows.map(e=>v(e,t))};i.set(e,{domain:t,value:r});let a=new Map,o=e=>{let t=a.get(e);if(t)return t;let n=c.get(e.occurrenceId);if(n&&n!==e)throw Error(`duplicate floating placement occurrence owner`);c.set(e.occurrenceId,e);let r=y(e);return a.set(e,r),r},s=(e.floatingTables??[]).map(o),u=(e.resolvedFloatingTables??[]).map(e=>{let t=o(e.source);return{...e,occurrenceId:d(e.occurrenceId),child:t.child,source:t}});return(e.floatingTables||e.resolvedFloatingTables)&&Object.assign(r,{floatingTables:s,resolvedFloatingTables:u}),r};function x(e,t){return e.kind===`paragraph`?g(e,t):b(e,t)}let S=Zc(x(n,t.destination.flowDomainId),`DOCX body occurrence projection`);if(S.kind!==`table`||e.kind!==`table`)return S;let C=Object.isFrozen(e.columnWidthsPt)?e.columnWidthsPt:Object.freeze([...e.columnWidthsPt]);return Object.freeze({...S,columnWidthsPt:C})}var vx=class extends Error{code=`NEXT_COLUMN_DESTINATION_UNAVAILABLE`;constructor(e,t,n,r){super(`nextColumn requires a following column on the current page, but column ${e+1} is unavailable (outgoing columns: ${t}, incoming columns: ${n}, reason: ${r})`),this.outgoingColumnIndex=e,this.outgoingColumnCount=t,this.incomingColumnCount=n,this.reason=r,this.name=`UnsupportedPageFlowTransitionError`}};function yx(e,t){return e.sectionBidi?[...t].reverse():[...t]}function bx(e){let t=yx(e.section,e.columnSubset);return t[t.indexOf(e.columnIndex)+1]}function xx(e,t={}){let n=Am(e),r=jm(e),i=t.pageContentStartBlockPt??n,a=t.pageContentEndBlockPt??r,o=t.regionStartBlockPt??i,s=t.regionEndBlockPt??a,c=t.cursorBlockPt??o,l=t.deepestColumnBlockPt??c,u=t.pageIndex??0,d=Object.freeze([...t.columnSubset??e.columns.map((e,t)=>t)]),f=yx(e,d),p=t.columnIndex??f[0]??-1;if(!Number.isInteger(u)||u<0)throw RangeError(`Page index must be a non-negative integer`);if(!Number.isInteger(p)||p<0||p>=e.columns.length)throw RangeError(`Column index must identify a column in the active section`);if(d.length===0||d.some((t,n)=>!Number.isInteger(t)||t<0||t>=e.columns.length||n>0&&t<=d[n-1])||!d.includes(p))throw RangeError(`Column subset must be ordered, unique, and contain the active column`);if(![i,a,o,s,c,l].every(Number.isFinite))throw RangeError(`Page-flow cursors and bounds must be finite`);if(i>o||o>s||s>a||o>c||c>s||c>l)throw RangeError(`Page-flow bounds must contain the region and live cursor`);return Object.freeze({pageIndex:u,columnIndex:p,pageHasContent:t.pageHasContent??!1,cursorBlockPt:c,pageContentStartBlockPt:i,pageContentEndBlockPt:a,regionStartBlockPt:o,regionEndBlockPt:s,columnSubset:d,deepestColumnBlockPt:l,section:e})}function Sx(e,t){return Object.freeze({state:e,events:Object.freeze(t.map(e=>Object.freeze({...e})))})}function Cx(e,t,n){if(!Number.isFinite(n)||n<0)throw RangeError(`A flow node charge must be a finite non-negative value`);let r=e.cursorBlockPt,i=r+n;return Sx(Object.freeze({...e,pageHasContent:!0,cursorBlockPt:i,deepestColumnBlockPt:Math.max(e.deepestColumnBlockPt,i)}),[{type:`place`,node:t,blockStartPt:r,blockEndPt:i}])}function wx(e,t){let n=Math.max(e.deepestColumnBlockPt,e.cursorBlockPt),r=bx(e);if(r!==void 0)return Sx(Object.freeze({...e,columnIndex:r,cursorBlockPt:e.regionStartBlockPt,deepestColumnBlockPt:n}),[{type:`next-column`}]);let i=e.pageIndex+1;return Sx(xx(e.section,{pageIndex:i}),[{type:`next-page`,reason:t,pageIndex:i,sectionOccurrenceId:e.section.sectionOccurrenceId,parityBlank:!1}])}function Tx(e,t){return e.kind===t.kind&&e.linePitchPt===t.linePitchPt&&e.charSpacePt===t.charSpacePt}function Ex(e,t){return e.xPt===t.xPt&&e.yPt===t.yPt&&e.widthPt===t.widthPt&&e.heightPt===t.heightPt}function Dx(e,t){return e.xPt<t.xPt+t.widthPt&&t.xPt<e.xPt+e.widthPt&&e.yPt<t.yPt+t.heightPt&&t.yPt<e.yPt+e.heightPt}function Ox(e,t,n){let r=n=>{throw new vx(e.columnIndex,e.section.columns.length,t.columns.length,n)},i=P_(e.section.textDirection),a=P_(t.textDirection);i!==a&&r(`writing-mode`);let o=B_({widthPt:e.section.geometry.pageWidth,heightPt:e.section.geometry.pageHeight},i),s=B_({widthPt:t.geometry.pageWidth,heightPt:t.geometry.pageHeight},a);(o.widthPt!==s.widthPt||o.heightPt!==s.heightPt)&&r(`page-extent`);let c=n.incomingPageContentStartBlockPt??Am(t),l=n.incomingPageContentEndBlockPt??jm(t);(c!==e.pageContentStartBlockPt||l!==e.pageContentEndBlockPt)&&r(`block-band`),Tx(e.section.grid,t.grid)||r(`grid`);let u=yx(e.section,e.columnSubset),d=u.indexOf(e.columnIndex),f=u[d+1];if(f===void 0)throw Error(`nextColumn destination resolution requires a same-page successor`);let p=K_(i,o),m=e.section.columns[f],h=W_(p.logicalToPhysical,{xPt:m.xPt,yPt:e.regionStartBlockPt,widthPt:m.wPt,heightPt:e.regionEndBlockPt-e.regionStartBlockPt}),g=t.columns.findIndex(t=>Ex(h,W_(p.logicalToPhysical,{xPt:t.xPt,yPt:e.regionStartBlockPt,widthPt:t.wPt,heightPt:e.regionEndBlockPt-e.regionStartBlockPt})));g<0&&r(`physical-column`);let _=yx(t,t.columns.map((e,t)=>t)),v=_.indexOf(g);v<0&&r(`physical-column`);let y=Object.freeze(_.slice(v).sort((e,t)=>e-t)),b=Object.freeze(u.slice(0,d+1).sort((e,t)=>e-t)),x=(t,n)=>{let r=t.columns[n];return W_(p.logicalToPhysical,{xPt:r.xPt,yPt:e.regionStartBlockPt,widthPt:r.wPt,heightPt:e.regionEndBlockPt-e.regionStartBlockPt})},S=b.map(t=>x(e.section,t));return y.some(e=>{let n=x(t,e);return S.some(e=>Dx(e,n))})&&r(`physical-overlap`),Object.freeze({targetColumnIndex:g,targetColumnOrdinal:v,columnSubset:y,outgoingColumnSubset:b})}function kx(e,t,n){let r=e.pageIndex+1;return Sx(xx(t,{pageIndex:r}),[{type:`next-page`,reason:n,pageIndex:r,sectionOccurrenceId:t.sectionOccurrenceId,parityBlank:!1}])}function Ax(e,t){let n=e%2==0;return t===`odd`?n:!n}function jx(e,t,n,r){let i=e.pageIndex+1,a=[];return r!==void 0&&!Ax(i,r)&&(a.push({type:`next-page`,reason:`parity`,pageIndex:i,sectionOccurrenceId:e.section.sectionOccurrenceId,parityBlank:!0}),i+=1),a.push({type:`next-page`,reason:n,pageIndex:i,sectionOccurrenceId:t.sectionOccurrenceId,parityBlank:!1}),Sx(xx(t,{pageIndex:i}),a)}function Mx(e,t,n){return t===`lastRenderedPageBreak`?Sx(e,[]):t===`column`?wx(e,`explicit-break`):t===`pageBreakBefore`&&!e.pageHasContent&&e.columnIndex===yx(e.section,e.columnSubset)[0]&&e.cursorBlockPt===e.pageContentStartBlockPt?Sx(e,[]):t===`page`?jx(e,e.section,`explicit-break`,n):kx(e,e.section,`page-break-before`)}function Nx(e,t,n,r={}){if(n===`continuous`&&!r.hasFootnoteReferenceOnCurrentPage){let n=e.section.columns.length>1?Math.max(e.cursorBlockPt,e.deepestColumnBlockPt):e.cursorBlockPt;return Sx(xx(t,{pageIndex:e.pageIndex,pageContentStartBlockPt:e.pageContentStartBlockPt,pageContentEndBlockPt:e.pageContentEndBlockPt,cursorBlockPt:n,regionStartBlockPt:n,regionEndBlockPt:e.pageContentEndBlockPt,deepestColumnBlockPt:n,pageHasContent:e.pageHasContent}),[{type:`begin-section`,placement:`same-page-block`,section:t,targetColumnOrdinal:0,columnSubset:t.columns.map((e,t)=>t)}])}if(n===`nextColumn`){if(bx(e)===void 0){let n=kx(e,t,`section-break`);return Sx(n.state,[...n.events,{type:`begin-section`,section:t}])}let n=Ox(e,t,r);return Sx(Object.freeze({...e,columnIndex:n.targetColumnIndex,columnSubset:n.columnSubset,cursorBlockPt:e.regionStartBlockPt,deepestColumnBlockPt:Math.max(e.deepestColumnBlockPt,e.cursorBlockPt),section:t}),[{type:`next-column`},{type:`begin-section`,placement:`same-page-column`,section:t,targetColumnOrdinal:n.targetColumnOrdinal,columnSubset:n.columnSubset,outgoingColumnSubset:n.outgoingColumnSubset}])}if(n===`continuous`){let n=kx(e,t,`section-break`);return Sx(n.state,[...n.events,{type:`begin-section`,section:t}])}let i=jx(e,t,`section-break`,n===`oddPage`?`odd`:n===`evenPage`?`even`:void 0);return Sx(i.state,[...i.events,{type:`begin-section`,section:t}])}function Px(e,t,n,r){let i=e,a=0;for(let o=e+1;o<=t;o++){let e=r(o);if(!(e<=n))break;i=o,a=e}return{end:i,fitValue:a}}function Fx(e){return!e.widowControl||e.end>=e.totalLines?{kind:`keep`}:e.totalLines-e.end===1&&e.end-e.start>=2?{kind:`dropLastLine`}:e.start===0&&e.end-e.start===1&&e.canRelocate?{kind:`relocate`}:{kind:`keep`}}function Ix(e,t){let n=e.map(e=>Object.freeze({...e})),r=yd(n);return{lineWindow:({topYPt:e,minimumStartWidthPt:n,squareMinimumStartWidthPt:i,probeHeightPt:a,paragraphXPt:o,maximumWidthPt:s,columnXPt:c,columnWidthPt:l})=>{let u=Ld(e,n,a,o,s,r,c,c+l,t??{xLeftPt:o,xRightPt:o+s,readingDirection:`ltr`},i??n);return{topYPt:u.topY,xOffsetPt:u.xOffset,maximumWidthPt:u.maxWidth}},skipTopAndBottomBands:({yPt:e,columnXPt:t,columnWidthPt:r})=>Rd(e,n,t,t+r)}}function Lx(e){return{type:e.lineGrid.active?`lines`:null,linePitchPt:e.lineGrid.active?e.lineGrid.pitchPt:null,charSpacePt:e.characterGrid.active?e.characterGrid.deltaPt:null}}function Rx(e,t){if(!Xf(t))return e;let n=t.linePitchPt;return n<=0?e:e<=n?n:Math.ceil(e/n)*n}function zx(e,t,n,r,i,a){let o=Lx(t),s=Math.max(1,n.availableWidthPt-t.physicalIndentLeftPt-t.physicalIndentRightPt),c=n.paragraphXPt+t.physicalIndentLeftPt,l=t.spaceBeforePt,u=t.spaceAfterPt,d=Object.freeze({...n}),f=r.fontFamilyClasses,p=i.documentHasEastAsianText===!0||i.useFeLayout===!0,m=n.startYPt+(n.suppressSpaceBefore?0:l);n.wrap&&(m=n.wrap.skipTopAndBottomBands({yPt:m,columnXPt:n.paragraphXPt,columnWidthPt:n.availableWidthPt}));let h=()=>{let a=m,h=rp(e,1,o,t.hasRuby,p,r.context,f,t.lineSpacing,i.resolvedLocalFonts,i.layoutServices?.text,i.paragraphMarkShapeInput);return n.wrap&&(a=n.wrap.lineWindow({topYPt:a,minimumStartWidthPt:Pf(e),squareMinimumStartWidthPt:Gu(Pf(e),1),probeHeightPt:h,paragraphXPt:c,maximumWidthPt:s,columnXPt:n.paragraphXPt,columnWidthPt:n.availableWidthPt}).topYPt),{lines:[],markOnly:!0,requestedSpaceBeforePt:l,requestedSpaceAfterPt:u,uniformRubyAdvancePt:0,contentStartYPt:a,contentEndYPt:a+h,lastLineBelowBaselinePt:ap(e,o,t.hasRuby,p,r.context,f,t.lineSpacing,i.resolvedLocalFonts,i.layoutServices?.text,i.paragraphMarkShapeInput),placement:d}},g=Op(e.runs,i);if(g.length===0)return h();let _=n.wrap?{startPageY:m,paraX:c,columnXPt:n.paragraphXPt,columnWidthPt:n.availableWidthPt,floats:[],paragraphMarkLineStartWidth:Gu(Pf(e),1),lineWindow:e=>n.wrap.lineWindow(e),lineBoxH:(e,n,r,i,a,s)=>$f(t.lineSpacing,e,n,1,o,t.hasRuby,i??0,t.hasRuby?t.hasEastAsianText:a??!1,s),pageH:n.maximumYPt}:void 0,v=kp(r.context,g,s,a?0:t.firstIndentPt,1,[...t.tabStops],_,f,t.physicalIndentLeftPt,t.kinsoku,t.characterGrid.active?t.characterGrid.deltaPt:0,t.defaultTabPt,s+t.physicalIndentRightPt,t.baseRtl,t.isJustified,t.stretchLastLine,a?.boundary,void 0,i.verticalGlyphMeasurement,t.overflowPunct!==!1);if(v.length===0)return h();let y=t.hasRuby?Rx(Math.max(0,...v.map(e=>$f(t.lineSpacing,e.ascent,e.descent,1,o,!0,e.intendedSingle,t.hasEastAsianText))),o):0;t.hasRuby&&a?.uniformRubyAdvancePt!==void 0&&(y=Math.max(y,a.uniformRubyAdvancePt));let b=[];for(let e of v){let n=e.topY!==void 0&&e.topY>m?e.topY:m,r=t.hasRuby?y:$f(t.lineSpacing,e.ascent,e.descent,1,o,!1,e.intendedSingle,e.eastAsian??!1,e.gridCountSingle);b.push({layout:e,topYPt:n,advancePt:r}),m=n+r}let x=b[b.length-1];return{lines:b,markOnly:!1,requestedSpaceBeforePt:l,requestedSpaceAfterPt:u,uniformRubyAdvancePt:y,contentStartYPt:b[0].topYPt,contentEndYPt:m,lastLineBelowBaselinePt:ip(x.advancePt,x.layout.ascent,x.layout.descent),placement:d}}function Bx(e,t,n,r,i=-1/0,a=!0,o=!1){return Ds(e,t,{firstContentSi:n,lastDrawnSi:r,minPerGap:i,seaClusterGaps:o,...a?{}:{isGapChar:()=>!1}})}function Vx(e){if(!e)return 0;let t=0;for(let n of e.perSeg.values())t+=n.splitBefore.length+ +!!n.trailingGap;return e.perGap*t}function Hx(e,t,n,r,i){return t>=0?null:Bx(e,t,n,r,-i*.25,!1)}const Ux=[`U`,`C`,`D`,`L`,`R`,`T`],Wx=[0,173,174,768,880,1155,1162,1425,1470,1471,1472,1473,1475,1476,1478,1479,1480,1552,1563,1564,1565,1568,1569,1570,1574,1575,1576,1577,1578,1583,1587,1600,1601,1608,1609,1611,1632,1646,1648,1649,1652,1653,1656,1672,1690,1728,1729,1731,1740,1741,1742,1743,1744,1746,1748,1749,1750,1757,1759,1765,1767,1769,1770,1774,1776,1786,1789,1791,1792,1807,1808,1809,1810,1813,1818,1822,1823,1832,1833,1834,1835,1836,1837,1839,1840,1867,1869,1870,1881,1884,1899,1901,1905,1906,1907,1909,1912,1914,1920,1958,1969,1994,2027,2036,2042,2043,2045,2046,2070,2074,2075,2084,2085,2088,2089,2094,2112,2113,2118,2120,2121,2122,2132,2133,2134,2137,2140,2144,2145,2146,2150,2151,2152,2153,2155,2160,2179,2182,2183,2185,2190,2191,2192,2199,2208,2218,2221,2222,2223,2225,2227,2233,2234,2249,2250,2274,2275,2307,2362,2363,2364,2365,2369,2377,2381,2382,2385,2392,2402,2404,2433,2434,2492,2493,2497,2501,2509,2510,2530,2532,2558,2559,2561,2563,2620,2621,2625,2627,2631,2633,2635,2638,2641,2642,2672,2674,2677,2678,2689,2691,2748,2749,2753,2758,2759,2761,2765,2766,2786,2788,2810,2816,2817,2818,2876,2877,2879,2880,2881,2885,2893,2894,2901,2903,2914,2916,2946,2947,3008,3009,3021,3022,3072,3073,3076,3077,3132,3133,3134,3137,3142,3145,3146,3150,3157,3159,3170,3172,3201,3202,3260,3261,3263,3264,3270,3271,3276,3278,3298,3300,3328,3330,3387,3389,3393,3397,3405,3406,3426,3428,3457,3458,3530,3531,3538,3541,3542,3543,3633,3634,3636,3643,3655,3663,3761,3762,3764,3773,3784,3791,3864,3866,3893,3894,3895,3896,3897,3898,3953,3967,3968,3973,3974,3976,3981,3992,3993,4029,4038,4039,4141,4145,4146,4152,4153,4155,4157,4159,4184,4186,4190,4193,4209,4213,4226,4227,4229,4231,4237,4238,4253,4254,4957,4960,5906,5909,5938,5940,5970,5972,6002,6004,6068,6070,6071,6078,6086,6087,6089,6100,6109,6110,6151,6152,6154,6155,6158,6159,6160,6176,6265,6277,6279,6313,6314,6315,6432,6435,6439,6441,6450,6451,6457,6460,6679,6681,6683,6684,6742,6743,6744,6751,6752,6753,6754,6755,6757,6765,6771,6781,6783,6784,6832,6878,6880,6892,6912,6916,6964,6965,6966,6971,6972,6973,6978,6979,7019,7028,7040,7042,7074,7078,7080,7082,7083,7086,7142,7143,7144,7146,7149,7150,7151,7154,7212,7220,7222,7224,7376,7379,7380,7393,7394,7401,7405,7406,7412,7413,7416,7418,7616,7680,8203,8204,8205,8206,8208,8234,8239,8288,8293,8298,8304,8400,8433,11503,11506,11647,11648,11744,11776,12330,12334,12441,12443,42607,42611,42612,42622,42654,42656,42736,42738,43010,43011,43014,43015,43019,43020,43045,43047,43052,43053,43072,43122,43123,43204,43206,43232,43250,43263,43264,43302,43310,43335,43346,43392,43395,43443,43444,43446,43450,43452,43454,43493,43494,43561,43567,43569,43571,43573,43575,43587,43588,43596,43597,43644,43645,43696,43697,43698,43701,43703,43705,43710,43712,43713,43714,43756,43758,43766,43767,44005,44006,44008,44009,44013,44014,64286,64287,65024,65040,65056,65072,65279,65280,65529,65532,66045,66046,66272,66273,66422,66427,68097,68100,68101,68103,68108,68112,68152,68155,68159,68160,68288,68293,68294,68295,68296,68297,68299,68301,68302,68307,68311,68312,68317,68318,68321,68322,68324,68325,68327,68331,68335,68336,68480,68481,68482,68483,68486,68489,68490,68492,68493,68494,68496,68497,68498,68521,68525,68527,68864,68865,68898,68899,68900,68904,68969,68974,69291,69293,69314,69315,69317,69318,69320,69370,69376,69424,69427,69428,69445,69446,69457,69460,69461,69488,69492,69494,69506,69510,69552,69553,69554,69556,69559,69560,69561,69563,69565,69566,69568,69569,69570,69572,69573,69577,69578,69579,69580,69633,69634,69688,69703,69744,69745,69747,69749,69759,69762,69811,69815,69817,69819,69826,69827,69888,69891,69927,69932,69933,69941,70003,70004,70016,70018,70070,70079,70089,70093,70095,70096,70191,70194,70196,70197,70198,70200,70206,70207,70209,70210,70367,70368,70371,70379,70400,70402,70459,70461,70464,70465,70502,70509,70512,70517,70587,70593,70606,70607,70608,70609,70610,70611,70625,70627,70712,70720,70722,70725,70726,70727,70750,70751,70835,70841,70842,70843,70847,70849,70850,70852,71090,71094,71100,71102,71103,71105,71132,71134,71219,71227,71229,71230,71231,71233,71339,71340,71341,71342,71344,71350,71351,71352,71453,71454,71455,71456,71458,71462,71463,71468,71727,71736,71737,71739,71995,71997,71998,71999,72003,72004,72148,72152,72154,72156,72160,72161,72193,72203,72243,72249,72251,72255,72263,72264,72273,72279,72281,72284,72330,72343,72344,72346,72544,72545,72546,72549,72550,72551,72752,72759,72760,72766,72767,72768,72850,72872,72874,72881,72882,72884,72885,72887,73009,73015,73018,73019,73020,73022,73023,73030,73031,73032,73104,73106,73109,73110,73111,73112,73459,73461,73472,73474,73526,73531,73536,73537,73538,73539,73562,73563,78896,78913,78919,78934,90398,90410,90413,90416,92912,92917,92976,92983,94031,94032,94095,94099,94180,94181,113821,113823,113824,113828,118528,118574,118576,118599,119143,119146,119155,119171,119173,119180,119210,119214,119362,119365,121344,121399,121403,121453,121461,121462,121476,121477,121499,121504,121505,121520,122880,122887,122888,122905,122907,122914,122915,122917,122918,122923,123023,123024,123184,123191,123566,123567,123628,123632,124140,124144,124398,124400,124643,124644,124646,124647,124654,124656,124661,124662,125136,125143,125184,125252,125260,917505,917506,917536,917632,917760,918e3],Gx=[0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,2,0,4,2,4,2,4,2,4,2,1,2,4,2,5,0,2,5,4,0,4,2,4,2,4,2,4,2,4,2,4,2,4,0,4,5,0,5,0,5,0,5,4,0,2,0,2,0,5,4,5,2,4,2,4,2,4,2,4,2,4,2,4,5,0,4,2,4,2,4,2,4,2,4,2,4,2,0,5,0,2,5,0,1,0,5,0,5,0,5,0,5,0,5,0,4,2,4,2,4,2,4,2,4,5,0,2,0,2,0,4,2,4,0,4,1,2,0,2,4,2,0,5,2,4,0,4,2,4,2,4,2,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,2,0,1,5,0,5,0,2,0,5,2,5,2,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,1,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,2,3,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,2,4,0,4,0,4,0,3,4,2,3,2,4,2,4,0,4,5,0,2,4,0,2,4,2,4,2,4,2,4,2,4,2,4,0,4,2,0,3,2,4,2,5,0,5,0,5,0,4,2,0,2,0,5,0,2,4,2,0,5,2,4,0,2,4,2,5,0,2,0,2,4,0,2,4,2,4,2,0,2,4,2,0,4,2,3,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,2,5,0,5,0,5,0,5,0],Kx=[1587,1588,1589,1590,1690,1691,1692,1693,1694,1786,1787,1884,1901,1904,1917,1918,2223],qx=[1580,1581,1582,1665,1666,1667,1668,1669,1670,1671,1727,1879,1880,1902,1903,1906,1916,2186,2210,2241,2245,2246],Jx=[1576,1578,1579,1646,1657,1658,1659,1660,1661,1662,1663,1664,1872,1873,1874,1875,1876,1877,1878,2208,2209,2230,2231,2232,2238,2239,2240],Yx=[1574,1585,1586,1597,1598,1599,1609,1610,1656,1681,1682,1683,1684,1685,1686,1687,1688,1689,1740,1742,1744,1745,1775,1883,1899,1900,1905,1909,1910,1911,2216,2217,2218,2226,2233,2234,69319],Xx=[1570,1571,1573,1575,1591,1592,1595,1596,1603,1604,1649,1650,1651,1653,1695,1705,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1718,1719,1720,1890,1891,1892,1898,1907,1908,1919,2160,2161,2162,2163,2164,2165,2166,2167,2168,2169,2170,2171,2172,2173,2174,2175,2176,2177,2178,2187,2188,2189,2211,2214,2224,2228,2242,2247,2248,69315,69316],Zx=[1572,1593,1594,1601,1602,1608,1647,1654,1655,1696,1697,1698,1699,1700,1701,1702,1703,1704,1732,1733,1734,1735,1736,1737,1738,1739,1743,1788,1885,1886,1887,1888,1889,1912,1913,2212,2213,2219,2227,2229,2243];function Qx(e){let t=0,n=Wx.length-1,r=-1;for(;t<=n;){let i=t+(n-t>>1);Wx[i]<=e?(r=i,t=i+1):n=i-1}return r<0?`U`:Ux[Gx[r]]??`U`}function $x(e){let t=Qx(e);return t===`D`||t===`L`||t===`C`}function eS(e){let t=Qx(e);return t===`D`||t===`R`||t===`C`}const tS=new Set([1575,1570,1571,1573,1649]),nS=new Set(Kx),rS=new Set(qx),iS=new Set(Jx),aS=new Set(Yx),oS=new Set(Xx),sS=new Set(Zx);var cS=function(e){return e[e.Normal=7]=`Normal`,e[e.Waw=8]=`Waw`,e[e.BaRa=9]=`BaRa`,e[e.Alef=10]=`Alef`,e[e.HahDal=11]=`HahDal`,e[e.Seen=12]=`Seen`,e[e.Kashida=13]=`Kashida`,e}(cS||{});function lS(e){let t=[...e].map(e=>e.codePointAt(0)),n=[],r=t.length>0&&Qx(t[0])!==`T`?0:-1;for(let e=1;e<t.length;e++){let i=t[e];if(Qx(i)!==`T`){if(r>=0){let a=t[r];!(a===1604&&tS.has(i))&&$x(a)&&eS(i)&&n.push(e)}r=e}}return n}function uS(e,t,n){let r=t-1;for(;r>=0&&Qx(e[r])===`T`;)r--;let i=e[r],a=e[t];return i===1600?cS.Kashida:nS.has(i)?cS.Seen:rS.has(i)?cS.HahDal:gf(t,n)&&oS.has(a)?cS.Alef:iS.has(i)&&aS.has(a)?cS.BaRa:gf(t,n)&&sS.has(a)?cS.Waw:cS.Normal}function dS(e){let t=[...e],n=[];for(let e=0;e<t.length;){for(;e<t.length&&/\\s/u.test(t[e]);)e++;if(e>=t.length)break;let r=e+1;for(;r<t.length&&!/\\s/u.test(t[r]);)r++;let i=t.slice(e,r),a=i.map(e=>e.codePointAt(0)),o=a.length-1;for(;o>=0&&Qx(a[o])===`T`;)o--;let s=-1,c=-1;for(let e of lS(i.join(``))){let t=uS(a,e,o);t>=c&&(s=e,c=t)}s>=0&&n.push({beforeCp:e+s,priority:c}),e=r}return n}function fS(e,t){let n=[...e],r=``;for(let e=0;e<n.length;e++){let i=t.get(e)??0;i>0&&(r+=`ـ`.repeat(i)),r+=n[e]}return r}function pS(e,t,n,r){if(t<=.5)return null;let i=[];for(let t=0;t<e.length;t++){let n=e[t].text;if(n!==void 0)for(let{beforeCp:e,priority:r}of dS(n))i.push({si:t,beforeCp:e,priority:r,textOrder:i.length})}if(i.length===0)return null;i.sort((e,t)=>t.priority-e.priority||e.textOrder-t.textOrder);let a=n===`low`?1:n===`medium`?2:1/0,o=a,s=i.length*64,c=new Map,l=new Map,u=new Map;for(let{si:t}of i){if(u.has(t))continue;let n=r(t,e[t].text);l.set(t,n),u.set(t,n)}let d=t,f=0;for(let t=0;t<o&&d>.5&&f<s;t++){let t=!1;for(let{si:n,beforeCp:o}of i){if(d<=.5||f>=s)break;let i=c.get(n);i||(i=new Map,c.set(n,i));let l=i.get(o)??0;if(l>=a)continue;i.set(o,l+1);let p=r(n,fS(e[n].text,i)),m=p-u.get(n);m>0&&m<=d+1e-6?(u.set(n,p),d-=m,f++,t=!0):l===0?i.delete(o):i.set(o,l)}if(!t)break}let p=new Map;for(let[t,n]of c){let r=[...n.entries()].filter(([,e])=>e>0).sort(([e],[t])=>e-t).map(([e,t])=>({beforeCp:e,count:t}));r.length!==0&&p.set(t,{text:fS(e[t].text,n),insertions:r,advanceDeltaPx:u.get(t)-l.get(t)})}if(p.size===0)return null;let m=[...p.values()].reduce((e,t)=>e+t.advanceDeltaPx,0);return{perSeg:p,appliedPx:m,residualPx:t-m}}function mS(e){return Object.freeze({status:`unsupported`,command:Object.freeze({kind:`noop`}),diagnostics:Object.freeze([Object.freeze({code:`UNSUPPORTED_FEATURE`,severity:`error`,message:e})])})}function hS(e){return e?{type:e.type,w:e.w,len:e.len}:void 0}function gS(e){return!e.stroke||!e.strokeWidth||e.strokeWidth<=0?null:{color:e.stroke,width:e.strokeWidth,...e.strokeDash?{dashStyle:e.strokeDash}:{},...e.strokeCap?{lineCap:e.strokeCap}:{},...hS(e.headEnd)?{headEnd:hS(e.headEnd)}:{},...hS(e.tailEnd)?{tailEnd:hS(e.tailEnd)}:{}}}function _S(e,t,n,r){let i=r!==void 0&&(r.textPathOk!==void 0||r.on!==void 0||r.fitShape!==void 0||r.fitPath!==void 0||r.trim!==void 0||r.xScale!==void 0);if(r!==void 0&&(!i||r.textPathOk===!0&&r.on===!0)){if(r.fitPath===!0)return mS(`VML textPath fitPath=true is not rendered`);if(r.xScale===!0)return mS(`VML textPath xScale=true is not rendered`);if(r.string.trim().length===0)return Object.freeze({status:`planned`,command:Object.freeze({kind:`noop`})});if(!n)throw Error(`Shape textPath acquisition requires TextLayoutService`);let a=i?r.fitShape===!0:!0;if(r.fontSizePt!==void 0&&(!Number.isFinite(r.fontSizePt)||r.fontSizePt<0))throw RangeError(`VML textPath fontSizePt must be finite and non-negative`);if(!a&&r.fontSizePt===void 0)return mS(`VML textPath fitShape=false requires an authored font-size`);if(r.fontSizePt===0)return Object.freeze({status:`planned`,command:Object.freeze({kind:`noop`})});let o=r.fontSizePt??1,s=r.fontFamily??void 0,c=n.shape({text:r.string,fontSizePt:o,fonts:{ascii:s,highAnsi:s,eastAsia:s,complexScript:s},weight:r.bold?700:400,style:r.italic?`italic`:`normal`,measure:!0});if(r.trim===!0&&!c.inkBounds)return mS(`VML textPath trim=true requires glyph ink bounds`);let l=r.trim===!0?c.inkBounds?.xMinPt??0:0,u=r.trim===!0?c.inkBounds?.xMaxPt??0:c.advancePt,d=r.trim===!0?c.inkBounds?.ascentPt??0:c.ascentPt,f=r.trim===!0?c.inkBounds?.descentPt??0:c.descentPt,p={xPt:l,yPt:-d,widthPt:u-l,heightPt:d+f};if(!Number.isFinite(c.advancePt)||Object.values(p).some(e=>!Number.isFinite(e))||c.spans.some(e=>!Number.isFinite(e.advancePt)))throw Error(`Shape textPath acquisition produced non-finite metrics`);return p.widthPt<=0||p.heightPt<=0||c.spans.length===0?mS(`VML textPath produced empty glyph metrics`):Object.freeze({status:`planned`,command:Zc({kind:`watermark-text`,rect:{...t},text:r.string,fill:e.fill?{...e.fill,...e.fill.fillType===`gradient`?{stops:e.fill.stops.map(e=>({...e}))}:{}}:null,opacity:Math.max(0,Math.min(1,e.fillOpacity??1)),rotationDeg:e.rotation??0,fitShape:a,fontSizePt:o,sourceBounds:p,spans:c.spans.map(e=>({text:e.text,advancePt:e.advancePt,fontRoute:e.fontRoute,fontWeight:e.font.weight,fontStyle:e.font.style}))},`VML textPath command`)})}let a={rect:{x:t.xPt,y:t.yPt,w:t.widthPt,h:t.heightPt},geometry:e.presetGeometry?{kind:`preset`,name:e.presetGeometry,adjustments:[...e.adjValues??[]]}:{kind:`custom`,subpaths:e.subpaths.map(e=>e.map(e=>({...e})))},fill:e.fill?{...e.fill,...e.fill.fillType===`gradient`?{stops:e.fill.stops.map(e=>({...e}))}:{}}:null,stroke:gS(e),transform:{rotationDeg:e.rotation??0,flipH:e.flipH??!1,flipV:e.flipV??!1}};return Object.freeze({status:`planned`,command:Zc({kind:`drawingml-shape`,plan:a},`DrawingML shape command`)})}function vS(e){if(!Number.isFinite(e.advancePt)||e.advancePt<=0)throw RangeError(`Tab leader glyph advance must be finite and positive`);let t=Math.floor(e.interval.widthPt/e.advancePt),n=e.interval.widthPt-t*e.advancePt;return Array.from({length:t},(t,r)=>({text:e.glyph,origin:{xPt:e.interval.xPt+n/2+r*e.advancePt,yPt:e.baselinePt},fontRoute:e.fontRoute,fontSizePt:e.fontSizePt,fontWeight:e.fontWeight,fontStyle:e.fontStyle,color:e.color}))}function yS(e){let t;if(e.raisePt!==void 0)t=e.baseOrigin.yPt-e.raisePt;else if(e.baseInkTopPt!==void 0&&e.guideInkBottomFromBaselinePt!==void 0)t=e.baseInkTopPt-e.guideInkBottomFromBaselinePt;else throw Error(`Ruby geometry requires authored w:hpsRaise or retained base/guide ink bounds`);let n=e.baseOrigin.xPt+(e.baseAdvancePt-e.guideAdvancePt)/2;return e.spans.map(e=>({text:e.text,origin:{xPt:n+e.offsetPt,yPt:t},fontRoute:e.fontRoute,fontSizePt:e.fontSizePt,fontWeight:e.fontWeight,fontStyle:e.fontStyle,color:e.color}))}function bS(e){return-(e.inkBounds?.ascentPt??e.ascentPt)}function xS(e){return e.inkBounds?.descentPt??e.descentPt}function SS(e){let t=e.inkBounds?e.inkBounds.ascentPt+e.inkBounds.descentPt:Math.min(e.ascentPt,e.descentPt);if(!Number.isFinite(t)||t<=0)throw Error(`Retained decoration probe requires positive selected-face ink`);return t}function CS(e){return e===`double`||e===`dbl`?`double`:e?.includes(`dot`)?`dotted`:e?.includes(`dash`)?`dashed`:e?.includes(`wave`)?`wavy`:`solid`}function wS(e,t,n){let r=Math.max(0,t.xPt-e.xPt),i=n*2,a=Math.max(1,Math.ceil(r/i));return Array.from({length:a+1},(t,i)=>({xPt:e.xPt+r*i/a,yPt:e.yPt+(i%2==0?-n/2:n/2)}))}function TS(e){let t=[],n=e.origin.xPt+e.advancePt;if(e.underline){let r=SS(e.underline.probe),i=e.origin.yPt+(bS(e.underline.probe)+xS(e.underline.probe))/2,a=e.origin.yPt+xS(e.base)+r/2,o=Math.max(i,a),s=CS(e.underline.authoredStyle),c={kind:`underline`,...e.underline.authoredStyle===void 0?{}:{authoredStyle:e.underline.authoredStyle},color:e.underline.color,widthPt:r};if(s===`double`){let i=o+r*2;t.push({...c,style:`solid`,from:{xPt:e.origin.xPt,yPt:o},to:{xPt:n,yPt:o}},{...c,style:`solid`,from:{xPt:e.origin.xPt,yPt:i},to:{xPt:n,yPt:i}})}else{let i={xPt:e.origin.xPt,yPt:o},a={xPt:n,yPt:o};t.push({...c,style:s,from:i,to:a,...s===`wavy`?{path:wS(i,a,r)}:{},...s===`dotted`?{dashPatternPt:[r,r*2]}:{},...s===`dashed`?{dashPatternPt:[r*4,r*3]}:{}})}}if(e.strike){let r=SS(e.strike.probe);if(e.strike.double&&e.strike.doubleProbe){let i=e.origin.yPt+bS(e.strike.doubleProbe)+r/2,a=e.origin.yPt+xS(e.strike.doubleProbe)-r/2;for(let o of[i,a])t.push({kind:`strikethrough`,color:e.color,widthPt:r,style:`solid`,from:{xPt:e.origin.xPt,yPt:o},to:{xPt:n,yPt:o}})}else{let i=e.origin.yPt+(bS(e.strike.probe)+xS(e.strike.probe))/2;t.push({kind:`strikethrough`,color:e.color,widthPt:r,style:`solid`,from:{xPt:e.origin.xPt,yPt:i},to:{xPt:n,yPt:i}})}}return t}function ES(e){let t=e.mark.inkBounds.xMaxPt-e.mark.inkBounds.xMinPt,n=e.mark.inkBounds.ascentPt+e.mark.inkBounds.descentPt;if(!(t>0)||!(n>0))throw Error(`Retained emphasis glyph requires positive selected-face ink bounds`);let r=[];for(let t of e.clusterInk){if(/^\\s+$/u.test(t.text))continue;let n=e.clusters.find(e=>e.range.start===t.range.start&&e.range.end===t.range.end);if(!n)throw Error(`Retained emphasis cluster ink does not match shaped cluster geometry`);let i=(e.origin.xPt+n.offset.xPt+t.ink.xMinPt*e.scaleX+(e.origin.xPt+n.offset.xPt+t.ink.xMaxPt*e.scaleX))/2-(e.mark.inkBounds.xMinPt+e.mark.inkBounds.xMaxPt)/2,a=e.authored===`underDot`?e.origin.yPt+t.ink.descentPt+e.mark.inkBounds.ascentPt:e.origin.yPt-t.ink.ascentPt-e.mark.inkBounds.descentPt;r.push({text:e.glyph,origin:{xPt:i,yPt:a},fontRoute:e.mark.fontRoute,fontSizePt:e.mark.fontSizePt,fontWeight:e.mark.fontWeight,fontStyle:e.mark.fontStyle,color:e.mark.color,inkBounds:e.mark.inkBounds})}return r}function DS(e,t){return e.val===t.val&&e.color===t.color&&e.widthPt===t.widthPt&&e.spacePt===t.spacePt&&e.themeColor===t.themeColor&&e.themeTint===t.themeTint&&e.themeShade===t.themeShade&&e.shadow===t.shadow&&e.frame===t.frame}function OS(e){let t=[],n=0;for(;n<e.length;){let r=e[n],i=n+1,a=r.bounds.xPt+r.bounds.widthPt+r.trailingSlackPt;for(;i<e.length;){let t=e[i];if(!DS(r.border,t.border)||Math.abs(t.bounds.xPt-a)>1e-6||t.bounds.yPt!==r.bounds.yPt||t.bounds.heightPt!==r.bounds.heightPt)break;a=t.bounds.xPt+t.bounds.widthPt+t.trailingSlackPt,i+=1}let o=r.bounds.xPt-r.border.spacePt,s=r.bounds.yPt-r.border.spacePt,c=a+r.border.spacePt,l=r.bounds.yPt+r.bounds.heightPt+r.border.spacePt,u={color:r.border.color,widthPt:r.border.widthPt,...Y_(r.border.val,r.border.widthPt)};t.push({...u,edge:`top`,from:{xPt:o,yPt:s},to:{xPt:c,yPt:s}},{...u,edge:`right`,from:{xPt:c,yPt:s},to:{xPt:c,yPt:l}},{...u,edge:`bottom`,from:{xPt:o,yPt:l},to:{xPt:c,yPt:l}},{...u,edge:`left`,from:{xPt:o,yPt:s},to:{xPt:o,yPt:l}}),n=i}return t}const kS=Y({id:`word-zero-relative-size`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/anchor-frame.test.ts#uses wp:extent when Word does not support an exact-zero relative size`},description:`Word 2010 accepts only positive wp14:pctWidth and wp14:pctHeight values under [MS-ODRAWXML] notes 125/126. Preserve an authored zero as acquisition evidence while resolving the object from wp:extent.`});Y({id:`word-vertical-section-physical-drawing-layer`,evidence:{kind:`regression-test`,reference:`packages/docx/src/anchor-vertical-physical.test.ts#lands an upright-section anchor at the recorded physical centroid`},description:`Resolve anchored drawings in an upright vertical section against the physical page frame independently of the rotated text-flow coordinate space.`}),Y({id:`word-page-level-float-prescan`,evidence:{kind:`regression-test`,reference:`packages/docx/src/page-anchor-prescan.test.ts#pre-scan REGISTERS a page-level (relativeFrom=\"margin\") wrap float on an earlier-scanned paragraph`},description:`A wrapping drawing whose vertical reference is page-level participates from page start so source-earlier paragraphs on that page see its exclusion.`}),Y({id:`word-paragraph-anchor-pre-spacing-origin`,evidence:{kind:`regression-test`,reference:`packages/docx/src/anchor-paragraph-spacebefore.test.ts#anchors a wrapSquare paragraph float at the pre-spaceBefore paragraph top`},description:`Resolve a paragraph-relative anchored drawing from the paragraph top before applying the paragraph spaceBefore contribution.`}),Y({id:`word-vertical-section-physical-header-footer`,evidence:{kind:`regression-test`,reference:`packages/docx/src/vertical-header-footer.test.ts#recovers the physical page box + margins from the logical (swapped) section`},description:`Paint a vertical section header and footer in the unrotated physical page frame rather than rotating them with the body text flow.`}),Y({id:`word-frame-auto-wrap-around`,evidence:{kind:`regression-test`,reference:`packages/docx/src/frame-geometry.test.ts#wrap=\"around\" and \"auto\" → square float (auto ≡ around in Word)`},description:`Resolve an authored frame wrap value of auto through the same square side-wrap path as around.`}),Y({id:`word-lower-layer-same-paragraph-anchor-composition`,evidence:{kind:`office-observation`,syntheticFixtureId:`lower-layer-same-paragraph-anchor-composition`,application:`Microsoft Word`,version:`16.111.1`,platform:`macOS 26.5.2`},description:`Word preserves a source-later, lower-z, page-owned drawing at its authored position when it belongs to the same anchor paragraph as already composed higher layers. This is a Word-observed compatibility override to ECMA-376 §20.4.2.3, not a normative OOXML rule.`}),Y({id:`word-textbox-visible-anchor-extent`,evidence:{kind:`office-observation`,syntheticFixtureId:`textbox-visible-anchor-extent`,application:`Microsoft Word`,version:`16.111.1`,platform:`macOS 26.5.2`},description:`For DrawingML middle and bottom text anchoring, derive the positioned extent through the last visible retained block while preserving structural trailing empty paragraphs and terminal paragraph spacing in the complete story.`});function AS(e){return e.shading||e.borders.length>0||e.resources.length>0||e.drawings.length>0||e.textBoxes.length>0||e.lineNumbers?.some(e=>e.paintOps.length>0)?!0:e.lines.some(e=>e.placements.some(e=>e.kind===`text`||e.kind===`resource`||e.kind===`drawing`?!0:e.kind===`tab`&&(e.leaderGlyphs?.length??0)>0))}function jS(e){let t=e.flowBounds.yPt,n;for(let r of e.blocks){if(r.kind===`table`){n=Math.max(n??t,r.flowBounds.yPt+r.advancePt);continue}r.kind!==`paragraph`||!AS(r)||(n=Math.max(n??t,r.flowBounds.yPt+Math.max(0,r.advancePt-r.spacing.afterPt)))}return n===void 0?0:Math.max(0,n-t)}function MS(e){return e===0}function NS(e,t){return e==null?!t:e!==`paragraph`&&e!==`line`&&e!==`character`}function PS(e,t,n){return e===`page`&&t!==null&&n!==void 0&&t<n}const FS=21600;function $(e,t,n){return{code:e,path:t,message:n}}function IS(e){return typeof e==`number`&&Number.isFinite(e)}function LS(e){return IS(e.xPt)&&IS(e.yPt)&&IS(e.widthPt)&&IS(e.heightPt)&&e.widthPt>=0&&e.heightPt>=0}function RS(e){return e.kind===`align`?e.value:e.kind===`offset`?e.valuePt:e.kind===`percent`?e.fraction:null}function zS(e,t,n,r=!1){let i=t[e];return{axis:e,status:`unsupported`,relativeFrom:r?`page`:i.relativeFrom,choiceKind:r?`simple-position`:i.choice.kind,choiceValue:r?e===`horizontal`?t.simplePosition.xPt:t.simplePosition.yPt:RS(i.choice),issueCode:n.code}}function BS(e,t,n,r){let i=n[e];return i===null?{problem:$(`missing-reference-frame`,r,`${e} frame is required`)}:LS(i)?{base:{startPt:t===`horizontal`?i.xPt:i.yPt,endPt:t===`horizontal`?i.xPt+i.widthPt:i.yPt+i.heightPt,referenceFrame:e}}:{problem:$(`invalid-reference-frame`,r,`${e} frame must be finite and non-negative`)}}function VS(e,t,n,r){let i=BS(`page`,t,n,r);if(!i.base)return i;let a=BS(`margin`,t,n,r);if(!a.base)return a;let o=n.page,s=n.margin,c=e===`leftMargin`||e===`rightMargin`;if(c!==(t===`horizontal`))return{problem:$(`unsupported-relative-from`,r,`${e} is not valid for the ${t} axis`)};let l=c?o.xPt:o.yPt,u=c?o.xPt+o.widthPt:o.yPt+o.heightPt,d=c?s.xPt:s.yPt,f=c?s.xPt+s.widthPt:s.yPt+s.heightPt;if(d<l||f>u)return{problem:$(`invalid-reference-frame`,r,`margin frame must be contained by the page frame`)};let p=e===`leftMargin`||e===`topMargin`;return{base:{startPt:p?l:f,endPt:p?d:u,referenceFrame:e}}}function HS(e,t,n,r){if(t===`page`||t===`margin`||e===`horizontal`&&(t===`column`||t===`character`)||e===`vertical`&&(t===`paragraph`||t===`line`))return BS(t,e,n,r);if(e===`horizontal`&&(t===`leftMargin`||t===`rightMargin`)||e===`vertical`&&(t===`topMargin`||t===`bottomMargin`))return VS(t,e,n,r);if(t===`insideMargin`||t===`outsideMargin`){if(n.pageParity===null)return{problem:$(`missing-page-parity`,r,`${t} requires explicit page parity`)};let i=t===`insideMargin`==(n.pageParity===`odd`);return{...VS(e===`horizontal`?i?`leftMargin`:`rightMargin`:i?`topMargin`:`bottomMargin`,e,n,r),parityRequired:!0}}return{problem:$(`unsupported-relative-from`,r,`${t} is not a valid ${e} reference`)}}function US(e,t,n){let r=t.relativeSize[e],i=e===`horizontal`?`width`:`height`,a=(n=null)=>{let r=e===`horizontal`?t.extent.widthStatus:t.extent.heightStatus,a=e===`horizontal`?t.extent.widthPt:t.extent.heightPt;return r===`missing`?{problem:$(`missing-size`,`extent.${i}`,`${i} is required`)}:r!==`valid`||!IS(a)||a<=0?{problem:$(`invalid-size`,`extent.${i}`,`${i} extent must be finite and positive`)}:{resolved:{valuePt:a,diagnostic:{source:`extent`,valuePt:a,relativeFrom:n?.relativeFrom??null,referenceFrame:null,fraction:n?.fraction??null,...n===null?{}:{compatibilityFallback:kS.id}}}}};if(r===null)return a();let o=`relativeSize.${e}`;if(r.fractionStatus===`missing`||r.fraction===null)return{problem:$(`missing-relative-size-fraction`,`${o}.fraction`,`relative size fraction is required`)};if(r.fractionStatus!==`valid`||!IS(r.fraction))return{problem:$(`invalid-relative-size-fraction`,`${o}.fraction`,`relative size fraction must be finite`)};if(r.fraction<0)return{problem:$(`invalid-relative-size-fraction`,`${o}.fraction`,`relative size fraction must be non-negative`)};if(MS(r.fraction))return a({relativeFrom:r.relativeFrom,fraction:r.fraction});if(r.relativeFromStatus===`missing`||r.relativeFrom===null)return{problem:$(`missing-relative-size-reference`,`${o}.relativeFrom`,`relative size reference is required`)};if(r.relativeFromStatus!==`valid`)return{problem:$(`invalid-relative-size-reference`,`${o}.relativeFrom`,`relative size reference is invalid`)};let s=HS(e,r.relativeFrom,n,`${o}.relativeFrom`);if(!s.base)return{problem:$(s.problem?.code===`missing-reference-frame`?`missing-relative-size-reference`:`invalid-relative-size-reference`,`${o}.relativeFrom`,s.problem?.message??`relative size reference cannot be resolved`)};let c=(s.base.endPt-s.base.startPt)*r.fraction;return!IS(c)||c<0?{problem:$(`invalid-relative-size-fraction`,`${o}.fraction`,`relative size result must be finite and non-negative`)}:{resolved:{valuePt:c,diagnostic:{source:`relative`,valuePt:c,relativeFrom:r.relativeFrom,referenceFrame:s.base.referenceFrame,fraction:r.fraction}}}}function WS(e,t,n,r){let i=n[e],a=e;if(i.relativeFromStatus===`missing`||i.relativeFrom===null){let t=$(`missing-relative-from`,`${a}.relativeFrom`,`${e} relativeFrom is required`);return{diagnostic:zS(e,n,t),problem:t}}if(i.relativeFromStatus!==`valid`){let t=$(`invalid-relative-from`,`${a}.relativeFrom`,`${e} relativeFrom is invalid`);return{diagnostic:zS(e,n,t),problem:t}}let o=HS(e,i.relativeFrom,r,`${a}.relativeFrom`);if(!o.base){let t=o.problem;return{diagnostic:zS(e,n,t),problem:t}}let s=i.choice;if(s.kind===`missing`){let t=$(`missing-axis-choice`,`${a}.choice`,`${e} choice is required`);return{diagnostic:zS(e,n,t),problem:t}}if(s.kind===`invalid`){let t=$(`invalid-axis-choice`,`${a}.choice`,`${e} choice is invalid`);return{diagnostic:zS(e,n,t),problem:t}}let c=o.base.endPt-o.base.startPt,l,u;if(s.kind===`offset`){if(!IS(s.valuePt)){let t=$(`invalid-axis-value`,`${a}.choice`,`offset must be finite`);return{diagnostic:zS(e,n,t),problem:t}}l=o.base.startPt+s.valuePt,u=s.valuePt}else if(s.kind===`percent`){if(!IS(s.fraction)){let t=$(`invalid-axis-value`,`${a}.choice`,`percentage must be finite`);return{diagnostic:zS(e,n,t),problem:t}}l=o.base.startPt+c*s.fraction,u=s.fraction}else if(s.kind===`align`){if(!(e===`horizontal`?[`left`,`center`,`right`,`inside`,`outside`].includes(s.value):[`top`,`center`,`bottom`,`inside`,`outside`].includes(s.value))){let t=$(`invalid-axis-value`,`${a}.choice`,`${s.value} is invalid`);return{diagnostic:zS(e,n,t),problem:t}}if((s.value===`inside`||s.value===`outside`)&&r.pageParity===null){let t=$(`missing-page-parity`,`frames.pageParity`,`${s.value} alignment requires explicit page parity`);return{diagnostic:zS(e,n,t),problem:t}}let i=e===`horizontal`?`left`:`top`,d=e===`horizontal`?`right`:`bottom`,f=s.value===`inside`,p=r.pageParity===`odd`,m=s.value===i||f&&p||s.value===`outside`&&!p,h=s.value===d||f&&!p||s.value===`outside`&&p;l=m?o.base.startPt:h?o.base.endPt-t:o.base.startPt+(c-t)/2,u=s.value}else{let t=$(`invalid-axis-choice`,`${a}.choice`,`${e} choice is invalid`);return{diagnostic:zS(e,n,t),problem:t}}if(!IS(l)){let t=$(`invalid-axis-value`,`${a}.choice`,`resolved origin is not finite`);return{diagnostic:zS(e,n,t),problem:t}}return{valuePt:l,diagnostic:{axis:e,status:`resolved`,relativeFrom:i.relativeFrom,referenceFrame:o.base.referenceFrame,choiceKind:s.kind,choiceValue:u,baseStartPt:o.base.startPt,baseEndPt:o.base.endPt,resolvedOriginPt:l,pageParity:s.kind===`align`&&(s.value===`inside`||s.value===`outside`)?r.pageParity:null}}}function GS(e,t,n){let r=e===`horizontal`?n.xPt:n.yPt,i=e===`horizontal`?n.xPt+n.widthPt:n.yPt+n.heightPt,a=r+t;return{valuePt:a,diagnostic:{axis:e,status:`resolved`,relativeFrom:`page`,referenceFrame:`page`,choiceKind:`simple-position`,choiceValue:t,baseStartPt:r,baseEndPt:i,resolvedOriginPt:a,pageParity:null}}}const KS=[`top`,`right`,`bottom`,`left`];function qS(e,t){return e[`${t}Status`]}function JS(e,t){return e[`${t}Pt`]}function YS(e,t,n){let r=KS.some(t=>qS(e,t)!==`missing`);if(!n&&!r)return{values:{topPt:0,rightPt:0,bottomPt:0,leftPt:0}};let i={topPt:0,rightPt:0,bottomPt:0,leftPt:0};for(let n of KS){let r=qS(e,n),a=JS(e,n);if(r!==`valid`||!IS(a))return{problem:$(`invalid-effect-extent`,`${t}.${n}`,`present effectExtent requires four finite edge values`)};i[`${n}Pt`]=a}return{values:i}}function XS(e,t){let n={topPt:0,rightPt:0,bottomPt:0,leftPt:0},r={};for(let i of KS){let a=qS(t,i),o=qS(e,i),s=a===`valid`||a===`invalid`?{status:a,value:JS(t,i),source:`wrap`}:o===`valid`||o===`invalid`?{status:o,value:JS(e,i),source:`anchor`}:{status:`missing`,value:null,source:`implicit-zero`};if(s.status===`invalid`||s.status===`valid`&&(!IS(s.value)||s.value<0))return{problem:$(`invalid-distance`,`${s.source===`wrap`?`wrap.distances`:`anchorDistances`}.${i}`,`wrap distance must be finite and non-negative`)};n[`${i}Pt`]=s.status===`missing`?0:s.value,r[i]=s.source}return{resolved:{values:n,sources:r}}}function ZS(e,t){let n={xPt:e.xPt-t.leftPt,yPt:e.yPt-t.topPt,widthPt:e.widthPt+t.leftPt+t.rightPt,heightPt:e.heightPt+t.topPt+t.bottomPt};return LS(n)?n:null}function QS(e,t){let n=e.wrap.polygon;if(n===null||n.invalidPointCount!==0||n.coordinateSpace.width!==FS||n.coordinateSpace.height!==FS||n.points.length<3)return{problem:$(`invalid-wrap-polygon`,`wrap.polygon`,`tight and through wrapping require a valid fixed 21600 by 21600 polygon`)};let r=[];for(let[e,i]of n.points.entries()){if(!IS(i.x)||!IS(i.y))return{problem:$(`invalid-wrap-polygon`,`wrap.polygon.points.${e}`,`polygon coordinates must be finite`)};r.push({xPt:t.xPt+i.x/FS*t.widthPt,yPt:t.yPt+i.y/FS*t.heightPt})}let i=r.map(e=>e.xPt),a=r.map(e=>e.yPt),o=Math.min(...i),s=Math.max(...i),c=Math.min(...a),l=Math.max(...a);return{polygon:{edited:n.edited,points:r},bounds:{xPt:o,yPt:c,widthPt:s-o,heightPt:l-c}}}function $S(e){return{coordinateSpace:`anchor-frame`,groupApplication:`parser-resolved-child-frame`,group:e===null?null:{childSourceId:e.childSourceId,sourceIndex:e.sourceIndex,sourceCount:e.sourceCount,transformChain:e.transformChain.map(e=>({...e})),childTransform:e.childTransform===null?null:{...e.childTransform},resolvedChildFrame:{...e.resolvedChildFrame}}}}function eC(e){return Zc(e,`anchor frame result`)}function tC(e){let{acquisition:t,frames:n}=e;for(let e of[`relativeHeight`,`behindDoc`,`locked`,`layoutInCell`,`allowOverlap`]){let n=t.behavior[`${e}Status`],r=t.behavior[e];if(n===`valid`&&r!==null)continue;let i=$(n===`missing`?`missing-required-behavior`:`invalid-required-behavior`,`behavior.${e}`,`CT_Anchor requires a ${e} value`);return eC({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:zS(`horizontal`,t,i),vertical:zS(`vertical`,t,i)},issues:[i]})}let r=[],i=US(`horizontal`,t,n),a=US(`vertical`,t,n);i.problem&&r.push(i.problem),a.problem&&r.push(a.problem);let o,s,c=i.problem??a.problem;if(c||!i.resolved||!a.resolved){let e=c;o={diagnostic:zS(`horizontal`,t,e)},s={diagnostic:zS(`vertical`,t,e)}}else if(t.simplePosition.status===`invalid`){let e=$(`invalid-simple-position`,`simplePosition.enabled`,`simplePos enablement is invalid`);r.push(e),o={diagnostic:zS(`horizontal`,t,e,!0),problem:e},s={diagnostic:zS(`vertical`,t,e,!0),problem:e}}else if(t.simplePosition.status===`valid`&&t.simplePosition.enabled===!0){let e=BS(`page`,`horizontal`,n,`frames.page`),i=t.simplePosition.xPt,a=t.simplePosition.yPt;if(!e.base||n.page===null||!LS(n.page)){let n=e.problem??$(`invalid-reference-frame`,`frames.page`,`simple positioning requires a valid page frame`);r.push(n),o={diagnostic:zS(`horizontal`,t,n,!0),problem:n},s={diagnostic:zS(`vertical`,t,n,!0),problem:n}}else if(t.simplePosition.xStatus!==`valid`||!IS(i)){let e=t.simplePosition.xStatus===`invalid`,n=$(e?`invalid-simple-position`:`missing-simple-coordinate`,`simplePosition.x`,e?`simple position x is lexically invalid`:`simple position x is required`);r.push(n),o={diagnostic:zS(`horizontal`,t,n,!0),problem:n},s={diagnostic:zS(`vertical`,t,n,!0),problem:n}}else if(t.simplePosition.yStatus!==`valid`||!IS(a)){let e=t.simplePosition.yStatus===`invalid`,n=$(e?`invalid-simple-position`:`missing-simple-coordinate`,`simplePosition.y`,e?`simple position y is lexically invalid`:`simple position y is required`);r.push(n),o={diagnostic:zS(`horizontal`,t,n,!0),problem:n},s={diagnostic:zS(`vertical`,t,n,!0),problem:n}}else o=GS(`horizontal`,i,n.page),s=GS(`vertical`,a,n.page)}else{let e=WS(`horizontal`,i.resolved.valuePt,t,n),c=WS(`vertical`,a.resolved.valuePt,t,n);o={...e,diagnostic:e.diagnostic},s={...c,diagnostic:c.diagnostic},e.problem&&r.push(e.problem),c.problem&&r.push(c.problem)}if(r.length>0||!i.resolved||!a.resolved||o.valuePt===void 0||s.valuePt===void 0)return eC({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:r});let l={xPt:o.valuePt,yPt:s.valuePt,widthPt:i.resolved.valuePt,heightPt:a.resolved.valuePt},u=YS(t.parentEffectExtent,`parentEffectExtent`,!1);if(u.problem||!u.values){let e=u.problem;return eC({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e]})}let d=ZS(l,u.values);if(d===null){let e=$(`invalid-effect-extent`,`parentEffectExtent`,`parent effect extents produce invalid ink bounds`);return eC({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e]})}if(t.wrap.kind===`missing`||t.wrap.kind===`invalid`){let e=$(t.wrap.kind===`missing`?`missing-wrap-kind`:`invalid-wrap-kind`,`wrap.kind`,`exactly one valid wrap kind is required`);return eC({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e]})}let f=XS(t.anchorDistances,t.wrap.distances);if(f.problem||!f.resolved)return eC({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[f.problem]});let p=t.wrap.kind===`square`||t.wrap.kind===`tight`||t.wrap.kind===`through`,m=p&&[`bothSides`,`left`,`right`,`largest`].includes(t.wrap.side??``)?t.wrap.side:null;if(p&&m===null){let e=$(`invalid-wrap-side`,`wrap.side`,`square, tight, and through wrapping require an authored wrap side`);return eC({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e]})}let h=u.values,g=KS.some(e=>qS(t.parentEffectExtent,e)!==`missing`)?`parent`:`none`;if(t.wrap.effectExtent!==null){let e=YS(t.wrap.effectExtent,`wrap.effectExtent`,!0);if(e.problem||!e.values)return eC({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e.problem]});h=e.values,g=`wrap-child`}let _=null,v=null,y=null;if(t.wrap.kind===`tight`||t.wrap.kind===`through`){let e=QS(t,l);if(e.problem||!e.polygon||!e.bounds)return eC({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e.problem]});_=e.polygon,v={width:21600,height:21600},y=e.bounds,h={topPt:0,rightPt:0,bottomPt:0,leftPt:0},g=`none`}else if(t.wrap.kind!==`none`&&(y=ZS(l,h),y===null)){let e=$(`invalid-effect-extent`,`wrap.effectExtent`,`wrapping effect extents produce invalid bounds`);return eC({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e]})}let b=y===null?null:ZS(y,f.resolved.values);if(y!==null&&b===null){let e=$(`invalid-distance`,`wrap.distances`,`distances produce invalid bounds`);return eC({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e]})}return eC({status:`resolved`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[],geometry:{objectFrame:l,inkBounds:d,wrapBounds:b,size:{horizontal:i.resolved.diagnostic,vertical:a.resolved.diagnostic},parentEffectExtent:u.values,wrap:{kind:t.wrap.kind,side:m,distances:f.resolved.values,distanceSources:f.resolved.sources,effectExtent:h,effectExtentSource:g,coordinateSpace:v,polygon:_},transform:$S(t.group)}})}function nC(e,t,n,r){if(!e)return r;let i=!!(e.styleId&&e.styleId===t.styleId),a=!!(i&&e.contextualSpacing),o=!!(i&&t.contextualSpacing);return a&&o?0:o?n:a?Math.max(r-n,0):Math.max(n,r)}function rC(e,t,n,r){let i=nC(e,t,n,r),a=i<=n;return{suppressBefore:a,overlap:n+(a?0:r)-i}}function iC(e){return Object.freeze(e.pages.map(e=>Object.freeze({pageIndex:e.pageIndex,displayPageNumber:e.pageNumber.displayNumber,pageNumberFormat:e.pageNumber.format})))}function aC(e){if(e.fieldType===`page`)return`page`;if(/numPages/i.test(e.fieldType)||/NUMPAGES/i.test(e.instruction))return`total-pages`}function oC(e){return e.some(e=>e.type===`paragraph`?e.runs.some(e=>e.type===`field`?aC(e)!==void 0:!1):e.type===`table`?e.rows.some(e=>e.cells.some(e=>oC(e.content))):!1)}function sC(e,t=[],n=[]){return oC(e)||t.some(e=>oC(e.content))||n.some(e=>oC(e))}const cC=new WeakMap;function lC(e){let t=new Set(e.drawings.flatMap(e=>{let t=e.anchorLayer?.acquisitionOccurrenceId??e.anchorLayer?.occurrenceId;return t===void 0?[]:[t]}));return Object.freeze({exclusions:Object.freeze(e.exclusions.filter(e=>!e.id.startsWith(`table-final-frame:`)&&(e.anchorOccurrenceId===void 0||!t.has(e.anchorOccurrenceId)))),collisions:Object.freeze((e.anchorCollisions??[]).filter(e=>!t.has(e.occurrenceId)))})}function uC(e){return new Set((e.anchorFrames??[]).flatMap(e=>e.status===`resolved`?[e.occurrenceId]:[]))}function dC(e){let t=uC(e),n=(e.anchorCollisions??[]).filter(e=>t.has(e.occurrenceId)),r=new Set(n.map(e=>e.occurrenceId));for(let e of t)if(!r.has(e))throw Error(`Paragraph anchor omitted collision geometry: ${e}`);return Object.freeze(n)}function fC(e){let t=uC(e);return Object.freeze(e.exclusions.filter(e=>e.anchorOccurrenceId!==void 0&&t.has(e.anchorOccurrenceId)))}function pC(e){return Object.freeze({flowDomainId:e,collisions:Object.freeze([]),exclusions:Object.freeze([])})}function mC(e,t){let n=cC.get(e);n||(n=new Map,cC.set(e,n));let r=n.get(t);if(r)return r;let i=pC(t);return n.set(t,i),i}function hC(e,t,n){let r=cC.get(e);if(!r||r.get(t.flowDomainId)!==t)throw Error(`Paragraph wrap registry transaction is stale`);r.set(t.flowDomainId,gC(t,n))}function gC(e,t){if(t.flowDomainId!==e.flowDomainId)throw Error(`Paragraph wrap registry cannot cross flow domains`);let n=new Set(e.collisions.map(e=>e.occurrenceId)),r=dC(t);for(let e of r){if(n.has(e.occurrenceId))throw Error(`Paragraph wrap occurrence committed twice: ${e.occurrenceId}`);n.add(e.occurrenceId)}let i=fC(t),a=new Set(r.map(e=>e.occurrenceId)),o=new Set;for(let e of i){let t=e.anchorOccurrenceId;if(t===void 0||!a.has(t))throw Error(`Owned paragraph wrap exclusion omitted its collision occurrence`);if(o.has(t))throw Error(`Paragraph wrap occurrence produced duplicate exclusions: ${t}`);o.add(t)}return Object.freeze({flowDomainId:e.flowDomainId,collisions:Object.freeze([...e.collisions,...r]),exclusions:Object.freeze([...e.exclusions,...i])})}function _C(e,t){if(!Number.isFinite(e)||e<0)throw RangeError(`${t} must be finite and non-negative`);return e}function vC(e){if(!(!e||e.type!==`text`&&e.type!==`field`))return e.typographyInput}function yC(e){switch(e){case`left`:return`left`;case`right`:return`right`;default:return`center`}}function bC(e){return _C(e.measuredWidthPt,`segment.measuredWidthPt`)}function xC(e){return e.map(e=>e.kind===`text`&&!e.fixedPitch?{text:e.text}:{})}function SC(e){return e===`lowKashida`?`low`:e===`mediumKashida`?`medium`:e===`highKashida`?`high`:null}function CC(e,t){if(!e.textLayoutService||!e.textShapeRequest)throw Error(`Kashida acquisition requires the retained TextLayoutService authority`);let n=e.textLayoutService.shape({...e.textShapeRequest,text:t,measure:!0}),r=e.basePaintOps[0]?.scaleX??1,i=e.basePaintOps[0]?.letterSpacingPt??0;return n.advancePt*r+[...t].length*i}function wC(e,t){if(!e)return null;let n=Vx(e),r=new Map,i=0;for(let[n,a]of e.perSeg){let e=t[n],o=a.splitBefore;if(e?.kind===`text`){let t=new Set(e.clusters.slice(1).map(t=>t.range.start-e.range.start)),n=[...e.text],r=[0];for(let e of n)r.push((r.at(-1)??0)+e.length);o=o.filter(e=>t.has(r[e]??-1))}let s=t[n+1],c=a.trailingGap&&!(s?.kind===`text`&&s.breakBefore===!1);i+=o.length+ +!!c,r.set(n,{splitBefore:[...o],trailingGap:c,internalStretch:0})}if(i===0)return null;let a=n/i;for(let e of r.values())e.internalStretch=e.splitBefore.length*a;return{perGap:a,perSeg:r}}function TC(e,t,n){if(!t||t.splitBefore.length===0)return{clusters:e.clusters,paintOps:e.basePaintOps};let r=[...e.text],i=[...t.splitBefore];if(i.some((e,t)=>e<=0||e>=r.length||t>0&&e<=(i[t-1]??0)))throw Error(`Internal paragraph justification contains an invalid code-point cut`);let a=[0];for(let e of r)a.push((a.at(-1)??0)+e.length);let o=i.map(e=>a[e]??-1),s=new Set(e.clusters.map(t=>t.range.start-e.range.start));if(o.some(e=>!s.has(e)))throw Error(`Internal paragraph justification must split at shaped cluster boundaries`);let c=[0,...i,r.length],l=[];for(let t=0;t<c.length-1;t+=1){let r=c[t]??0,i=c[t+1]??r,o=e.range.start+(a[r]??0),s=e.clusters.find(e=>e.range.start===o);if(!s)throw Error(`Internal paragraph justification is missing shaped cluster geometry`);l.push({range:{start:o,end:e.range.start+(a[i]??0)},offset:{xPt:s.offset.xPt+t*n,yPt:s.offset.yPt}})}let u=e.clusters.map(t=>{let r=t.range.start-e.range.start,i=o.filter(e=>e<=r).length;return{...t,offset:{...t.offset,xPt:t.offset.xPt+i*n}}});if(e.basePaintOps.length>1){let t=e.range.start;for(let n of e.basePaintOps){if(n.range.start!==t||n.range.end<=n.range.start)throw Error(`Internal paragraph justification has incomplete retained paint operations`);t=n.range.end}if(t!==e.range.end)throw Error(`Internal paragraph justification has incomplete retained paint operations`);let r=o.map(t=>e.range.start+t),i=[...new Set([e.range.start,e.range.end,...r,...e.basePaintOps.flatMap(e=>[e.range.start,e.range.end])])].sort((e,t)=>e-t),a=[];for(let t=0;t<i.length-1;t+=1){let o=i[t]??e.range.start,s=i[t+1]??o,c=e.basePaintOps.find(e=>e.range.start<=o&&e.range.end>=s);if(!c)throw Error(`Internal paragraph justification lost a retained paint slice`);let l=r.filter(e=>e<=o).length,d=u.find(e=>e.range.start===o);if(!d)throw Error(`Internal paragraph justification is missing retained slice geometry`);a.push({...c,text:c.text.slice(o-c.range.start,s-c.range.start),range:{start:o,end:s},offset:o===c.range.start?{...c.offset,xPt:c.offset.xPt+l*n}:d.offset})}return{clusters:u,paintOps:a}}let d=e.basePaintOps.length===1?e.basePaintOps[0]:void 0;if(!d)throw Error(`Internal paragraph justification requires one contextual paint op`);return i.length===r.length-1&&i.every((e,t)=>e===t+1)?{clusters:u,paintOps:[{...d,letterSpacingPt:d.letterSpacingPt+n}]}:{clusters:u,paintOps:l.map(t=>({...d,text:e.text.slice(t.range.start-e.range.start,t.range.end-e.range.start),range:t.range,offset:t.offset}))}}function EC(e,t){return e.flatMap(e=>{let n=e.text.trimEnd();if(n===``||n.length===e.text.length)return[e];if(e.sourceMapping===`kashida`)return[{...e,text:n}];let r=e.range.start+n.length,i=t.find(e=>e.range.start===r),{inkBounds:a,blockAxisInkBounds:o,...s}=e;return[{...e,text:n,range:{...e.range,end:r}},{...s,text:e.text.slice(n.length),range:{start:r,end:e.range.end},offset:i?.offset??e.offset}]})}function DC(e,t){return e===void 0||t===void 0?e===t:e.length===t.length&&e.every((e,n)=>e===t[n])}function OC(e,t){return e.kind===`underline`&&e.kind===t.kind&&e.authoredStyle===t.authoredStyle&&e.style===t.style&&e.color===t.color&&e.widthPt===t.widthPt&&e.to.xPt===t.from.xPt&&DC(e.dashPatternPt,t.dashPatternPt)}function kC(e,t){let n=Math.max(e.from.yPt,t.from.yPt),r={xPt:e.from.xPt,yPt:n},i={xPt:t.to.xPt,yPt:n},{path:a,...o}=e;return{...o,from:r,to:i,...e.style===`wavy`?{path:wS(r,i,e.widthPt)}:{}}}function AC(e){let t=[];e.forEach((n,r)=>{if(n.kind!==`text`){t=[];return}let i=[],a=[],o=new Set;for(let s of n.decorations){let n=t.filter(e=>!o.has(e)&&OC(e.decoration,s)).sort((e,t)=>Math.abs(e.decoration.from.yPt-s.from.yPt)-Math.abs(t.decoration.from.yPt-s.from.yPt))[0];if(n){o.add(n);let t=e[n.placementIndex];if(!t||t.kind!==`text`)throw Error(`Continuous decoration owner left the retained text line`);let r=[...t.decorations],i=kC(n.decoration,s);r[n.decorationIndex]=i,e[n.placementIndex]={...t,decorations:r},a.push({...n,decoration:i})}else{let e=i.length;i.push(s),a.push({placementIndex:r,decorationIndex:e,decoration:s})}}e[r]={...n,decorations:i},t=a})}function jC(e){let{line:t}=e,n=t.segments,r=e.baseRtl||Pp(n),i=Fp(n.map(e=>e.kind===`tab`?{isTab:!0}:e.kind===`text`?{text:e.text,rtl:e.rtl,digitsAsAN:e.digitsAsAN}:{}),e.baseRtl),a=n.reduce((e,t)=>e+bC(t),0),o=e.paragraphXPt+t.xOffsetPt,s=Math.min(e.availableWidthPt,t.availableWidthPt),c=e.isFirstLine?e.numbering?_C(e.numbering.bodyOffsetPt,`numbering.bodyOffsetPt`):e.firstLineIndentPt??0:0,l=e.baseRtl?0:c,u=(e.baseRtl?s-c:s)-l-a,d=e.isLastLine||t.endsWithBreak,f=e.displayMathJustification===void 0?Ip(e.alignment,e.baseRtl):yC(e.displayMathJustification),p=f===`justify`&&(!d||e.stretchLastLine),m=p?SC(e.alignment):null;if(m&&u>0){let e=pS(n.map(e=>e.kind===`text`?{text:e.text}:{}),u,m,(e,t)=>{let r=n[e];return r?.kind===`text`?CC(r,t):0});e&&(n=n.map((t,n)=>{if(t.kind!==`text`)return t;let r=e.perSeg.get(n);if(!r)return t;let i=t.basePaintOps[0];if(!i)throw Error(`Kashida acquisition requires a contextual text paint operation`);return{...t,measuredWidthPt:t.measuredWidthPt+r.advanceDeltaPx,basePaintOps:[{...i,text:r.text,sourceMapping:`kashida`}]}}),a+=e.appliedPx,u=e.residualPx)}let h=i.order.at(-1)??-1,g=0;if(!r){let e=n.findIndex(e=>e.kind!==`text`||/\\S/.test(e.text));g=e<0?0:e}let _=null,v=0,y=0,b=xC(n);if(p){let i=wC(Bx(b,u,g,r?h:n.length,-(t.baselinePt-t.topPt)*.25,u>0,e.alignment===`thaiDistribute`&&u>0),n);_=i?.perSeg??null,v=i?.perGap??0,y=Vx(i)}else if(u<0){let e=wC(Hx(b,u,g,r?h:n.length,t.baselinePt-t.topPt),n);_=e?.perSeg??null,v=e?.perGap??0,y=Vx(e)}let x=a+y,S=u-y,C=f===`right`?S:f===`center`?S/2:f===`justify`&&e.baseRtl&&!p?S:0,w=o+l,T=e.decimalAutoTabPt===void 0?C:Math.max(0,e.paragraphXPt+e.decimalAutoTabPt-x-w),E=w+T,D=[];for(let e of i.order){let r=n[e];if(!r)continue;let a=_?.get(e),o=a?.internalStretch??0,s=bC(r)+o;if(r.kind===`tab`){let e={xPt:E,yPt:t.topPt,widthPt:r.measuredWidthPt,heightPt:t.advancePt};D.push({kind:`tab`,range:r.range,bounds:e,advancePt:r.measuredWidthPt,leader:r.leader,...r.leader===`none`?{}:r.leaderShape?{leaderGlyphs:vS({interval:e,baselinePt:t.baselinePt,...r.leaderShape})}:{}})}else if(r.kind===`resource`)D.push({kind:`resource`,range:r.range,resourceKey:r.resourceKey,resourceKind:r.resourceKind,...r.orientation?{orientation:r.orientation}:{},bounds:{xPt:E,yPt:t.baselinePt+r.topOffsetPt,widthPt:r.widthPt,heightPt:r.heightPt},advancePt:r.measuredWidthPt});else if(r.kind===`unavailable-resource`)D.push({kind:`drawing`,range:r.range,drawingId:r.drawingId,bounds:{xPt:E,yPt:t.baselinePt+r.topOffsetPt,widthPt:r.widthPt,heightPt:r.heightPt},advancePt:r.measuredWidthPt});else if(r.kind===`anchor-host`)D.push({kind:`anchor-host`,range:r.range,bounds:{xPt:E,yPt:t.topPt,widthPt:0,heightPt:t.advancePt},baselinePt:t.baselinePt,...r.sourceMetrics?{sourceMetrics:r.sourceMetrics}:{},...r.anchorOccurrenceId?{anchorOccurrenceId:r.anchorOccurrenceId}:{}});else{let{measuredWidthPt:n,breakBefore:o,rtl:c,digitsAsAN:l,fixedPitch:u,textLayoutService:d,textShapeRequest:f,retainedGeometry:p,direction:m,...h}=r,g=TC(r,a,v),_=i.rtl[e]?`rtl`:`ltr`,y=_===`rtl`?EC(g.paintOps,g.clusters):g.paintOps,b=r.text.trimEnd().length,x=_===`rtl`?(h.fitText?.trailingPadPt??0)+r.clusters.filter(e=>e.range.start>=r.range.start+b).reduce((e,t)=>e+t.advancePt,0):0,S=a?.trailingGap?v:0,C={xPt:E+x,yPt:t.baselinePt},w=g.paintOps[0]?.offset.yPt??0,T={xPt:E,yPt:t.baselinePt+w},O=p?TS({origin:T,advancePt:s+S,base:p.base,color:ew(h.color),...p.underline?{underline:p.underline}:{},...p.strike?{strike:p.strike}:{}}):h.decorations,k=p?.emphasis?{authored:p.emphasis.authored,glyphs:ES({authored:p.emphasis.authored,glyph:p.emphasis.glyph,origin:{xPt:C.xPt,yPt:t.baselinePt+w},clusters:g.clusters,clusterInk:p.emphasis.clusterInk,mark:p.emphasis.mark,scaleX:r.basePaintOps[0]?.scaleX??1})}:void 0,A={...h,kind:`text`,origin:C,bounds:{xPt:E,yPt:t.topPt,widthPt:s,heightPt:t.advancePt},advancePt:s,clusters:g.clusters,paintOps:y.map(e=>({...e,direction:_})),decorations:O,...k?{emphasis:k}:{},direction:_,...S===0?{}:{ownedTrailingSlackPt:S},...h.highlight||h.background?{highlightFragments:[{rect:{xPt:E,yPt:t.topPt,widthPt:s+S,heightPt:t.advancePt},color:h.highlight??h.background}]}:{},...h.ruby?{ruby:{...h.ruby,paintOps:h.ruby.paintOps.map(e=>({...e,origin:{xPt:e.origin.xPt+E+(s-r.measuredWidthPt)/2,yPt:e.origin.yPt+t.baselinePt}}))}}:{}};D.push(A)}E+=s,a?.trailingGap&&(E+=v)}for(let e=0;e<D.length;){let t=D[e];if(t?.kind!==`text`||!t.runBorder){e+=1;continue}let n=e+1;for(;n<D.length;){let e=D[n];if(e?.kind!==`text`||!e.runBorder)break;n+=1}let r=OS(D.slice(e,n).map(e=>({bounds:e.bounds,trailingSlackPt:e.ownedTrailingSlackPt??0,border:e.runBorder})));D[e]={...t,runBorderFragments:r},e=n}return AC(D),Xc({range:t.range,bounds:{xPt:w+T,yPt:t.topPt,widthPt:x,heightPt:t.advancePt},baselinePt:t.baselinePt,advancePt:t.advancePt,placements:D})}function MC(e){let t=e.continuation,n=t?.lineStart??0,r=t?.lineEnd??e.lines.length;if(n<0||r<n||r>e.lines.length)throw RangeError(`Paragraph continuation line range is outside the retained lines`);let i=t?.continuesFromPrevious?0:e.spacing.beforePt;for(let a=n;a<r;a+=1){let r=e.lines[a];if(r){if(a===0&&!t?.continuesFromPrevious)i+=Math.max(0,r.bounds.yPt-(e.flowBounds.yPt+e.spacing.beforePt));else if(a>n){let t=e.lines[a-1];i+=Math.max(0,r.bounds.yPt-((t?.bounds.yPt??r.bounds.yPt)+(t?.advancePt??0)))}i+=_C(r.advancePt,`line.advancePt`)}}return e.lines.length===0&&e.paragraphMark&&(i+=_C(e.paragraphMark.bounds.heightPt,`paragraphMark.heightPt`)),t?.continuesOnNext||(i+=e.spacing.afterPt),i}function NC(e){let t=e.continuation?.lineStart??0,n=e.continuation?.lineEnd??e.lines.length,r=e.lines.slice(t,n),i=e.continuation?MC(e):_C(e.flowBounds.heightPt,`flowBounds.heightPt`);return Xc({kind:`paragraph`,id:e.id,source:e.source,...e.paragraphId===void 0?{}:{paragraphId:e.paragraphId},flowDomainId:e.flowDomainId,ordinaryFlow:e.ordinaryFlow,...e.styleId===void 0?{}:{styleId:e.styleId},...e.bookmarkStarts?.length?{bookmarkStarts:e.bookmarkStarts}:{},flowBounds:{...e.flowBounds,heightPt:i},inkBounds:e.inkBounds,...e.clipBounds?{clipBounds:e.clipBounds}:{},advancePt:i,spacing:e.spacing,contextualSpacing:e.contextualSpacing??!1,lines:r,borders:e.borders,...e.shading?{shading:e.shading}:{},resources:e.resources,drawings:e.drawings,textBoxes:e.textBoxes,events:e.events,exclusions:e.exclusions,...e.cellContainmentBounds?{cellContainmentBounds:e.cellContainmentBounds}:{},...e.anchorCollisions?.length?{anchorCollisions:e.anchorCollisions}:{},...e.anchorFrames?{anchorFrames:e.anchorFrames}:{},...e.paragraphMark?{paragraphMark:e.paragraphMark}:{},...e.continuation?{continuation:e.continuation}:{}})}function PC(e,t){return{...e,path:[...e.path,t]}}function FC(e,t){if(e.status===`planned`)return Object.freeze([]);let n=Object.freeze({...t,path:Object.freeze([...t.path])});return Object.freeze(e.diagnostics.map(e=>Object.freeze({...e,source:n})))}function IC(e){return Uc(`chart-resource`,e)}function LC(e,t){return Uc(`unavailable-drawing`,PC(e,t))}function RC(e,t){return Object.freeze({code:`MISSING_RESOURCE`,severity:`warning`,source:Object.freeze({...t,path:Object.freeze([...t.path])}),message:`Drawing ${e} resource is unavailable`})}function zC(e){return aC(e)||(/^date$/i.test(e.fieldType)?`date`:/^time$/i.test(e.fieldType)?`time`:`document`)}function BC(e){return e.sourceRunIndex}function VC(e){if(!e.textLayoutService||!e.textShapeRequest)return;let t=e.textLayoutService.shape({...e.textShapeRequest,text:e.text,measure:!0});return{ascentPt:t.ascentPt,descentPt:t.descentPt}}const HC=Object.freeze({yellow:`#FFFF00`,cyan:`#00FFFF`,green:`#00FF00`,magenta:`#FF00FF`,blue:`#0000FF`,red:`#FF0000`,darkBlue:`#000080`,darkCyan:`#008080`,darkGreen:`#008000`,darkMagenta:`#800080`,darkRed:`#800000`,darkYellow:`#808000`,darkGray:`#808080`,lightGray:`#C0C0C0`,black:`#000000`,white:`#FFFFFF`});function UC(e){return e.startsWith(`#`)?e:HC[e]??`#FFFF00`}function WC(e){let t=of(e.vertAlign,e.fontSize)+(e.position??0);return t===0?0:-t}function GC(e,t,n,r,i,a,o){let s=BC(e),c=s===void 0?void 0:t.runs[s],l=vC(c);if(e.metricOnly){let t=VC(e);return{kind:`anchor-host`,range:{start:n,end:n},bounds:{xPt:r,yPt:a,widthPt:0,heightPt:o},baselinePt:i,...t?{sourceMetrics:t}:{}}}let u=e.color?{kind:`explicit`,color:`#${e.color}`}:e.colorAuto?{kind:`auto`,...e.background?{background:`#${e.background}`}:{}}:{kind:`default`},d=e.fontRoute??I(e.fontFamily?`\"${e.fontFamily.replaceAll(`\"`,`\\\\\"`)}\"`:`sans-serif`,e.fontFamily?`native`:`generic`),f=e.ruby&&e.textLayoutService&&e.textShapeRequest?e.textLayoutService.shape({...e.textShapeRequest,text:e.text,measure:!0}):void 0,p=e.ruby&&e.textLayoutService&&e.textShapeRequest?e.textLayoutService.shape({...e.textShapeRequest,text:e.ruby.text,fontSizePt:e.ruby.fontSizePt,measure:!0}):void 0,m=e.ruby&&p?(p.clusters??[]).map(t=>{let n=p.spans.find(e=>e.start<=t.range.start&&e.end>=t.range.end)??p.spans[0];if(!n)throw Error(`Ruby shaping produced no selected-face span`);return{text:e.ruby.text.slice(t.range.start,t.range.end),offsetPt:t.offsetPt,fontRoute:n.fontRoute,fontSizePt:e.ruby.fontSizePt,fontWeight:n.font.weight,fontStyle:n.font.style,color:u}}):[],h=l?.ruby?.raisePt.status===`valid`?l.ruby.raisePt.value??void 0:e.ruby?.hpsRaisePt,g=e.ruby&&p?yS({baseOrigin:{xPt:0,yPt:0},baseAdvancePt:e.measuredWidth,guideAdvancePt:p.advancePt,...h===void 0?{}:{raisePt:h},...f?.inkBounds&&p.inkBounds?{baseInkTopPt:-f.inkBounds.ascentPt,guideInkBottomFromBaselinePt:p.inkBounds.descentPt}:{},spans:m}):[],_=WC(e);return{kind:`text`,text:e.text,...s===void 0?{}:{sourceRunIndex:s},...c?.type===`field`?{role:`field-result`,dependency:zC(c)}:{},...c?.type===`text`&&(c.noteRef?.kind===`footnote`||c.noteRef?.kind===`endnote`)?{noteReference:{kind:c.noteRef.kind,id:c.noteRef.id}}:{},range:{start:n,end:n+e.text.length},origin:{xPt:r,yPt:i+_},bounds:{xPt:r,yPt:a,widthPt:e.measuredWidth,heightPt:o},advancePt:e.measuredWidth,clusters:[{range:{start:n,end:n+e.text.length},offset:{xPt:0,yPt:0},advancePt:e.measuredWidth}],color:u,fontRoute:d,fontSizePt:Ll(e,1),fontWeight:e.bold?700:400,fontStyle:e.italic?`italic`:`normal`,direction:e.rtl?`rtl`:`ltr`,...e.verticalRun?{writingMode:`vertical-rl`}:{},...e.charSpacing===void 0?{}:{characterSpacingPt:e.charSpacing},...e.charScale===void 0?{}:{characterScale:e.charScale},...e.fitTextRegionIndex===void 0?{}:{fitText:{regionIndex:e.fitTextRegionIndex,perGapPt:e.fitTextPerGapPx??0,trailingPadPt:e.fitTextTrailingPadPx??0}},...e.kerning===void 0?{}:{kerning:e.fontSize>=e.kerning},...e.position===void 0?{}:{positionPt:e.position},...e.vertAlign?{verticalAlign:e.vertAlign}:{},...e.tateChuYoko?{tateChuYoko:!0}:{},...e.tateChuYokoCompress?{tateChuYokoCompress:!0}:{},...e.ruby&&p?{ruby:{text:e.ruby.text,advancePt:p.advancePt,authored:{...l?.ruby?.align.status===`valid`&&l.ruby.align.value?{align:l.ruby.align.value}:{},...l?.ruby?.baseFontSizePt.status===`valid`&&l.ruby.baseFontSizePt.value!==null?{baseFontSizePt:l.ruby.baseFontSizePt.value}:{},...h===void 0?{}:{raisePt:h},...l?.ruby?.language.status===`valid`&&l.ruby.language.value?{language:l.ruby.language.value}:{}},paintOps:g}}:{},...e.emphasisMark?{emphasisMark:e.emphasisMark}:{},...e.highlight?{highlight:UC(e.highlight)}:{},...e.background?{background:`#${e.background}`}:{},...e.border?{runBorder:{val:l?.border?.val.value??e.border.style,color:e.border.color?`#${e.border.color}`:`#000000`,widthPt:e.border.width,spacePt:e.border.space??0,...l?.border?.themeColor.value?{themeColor:l.border.themeColor.value}:{},...l?.border?.themeTint.value?{themeTint:l.border.themeTint.value}:{},...l?.border?.themeShade.value?{themeShade:l.border.themeShade.value}:{},...l?.border?.shadow.status===`valid`&&l.border.shadow.value!==null?{shadow:l.border.shadow.value}:{},...l?.border?.frame.status===`valid`&&l.border.frame.value!==null?{frame:l.border.frame.value}:{}}}:{},...e.revision?{revision:e.revision}:{},typography:{caps:l?.caps??!1,smallCaps:l?.smallCaps??e.smallCaps===!0,strike:l?.strike??e.strikethrough,doubleStrike:l?.doubleStrike??e.doubleStrikethrough===!0,verticalAlign:l?.verticalAlign??{status:e.vertAlign?`valid`:`missing`,raw:e.vertAlign??null,value:e.vertAlign??null},positionPt:l?.positionPt??{status:e.position===void 0?`missing`:`valid`,raw:e.position===void 0?null:String(e.position*2),value:e.position??null},emphasis:l?.emphasis??{status:e.emphasisMark?`valid`:`missing`,raw:e.emphasisMark??null,value:e.emphasisMark??null},...l?.underline?{underline:l.underline}:{}},decorations:[],paintOps:[{text:e.text,range:{start:n,end:n+e.text.length},offset:{xPt:0,yPt:_},letterSpacingPt:Vf(e),scaleX:e.charScale??1,direction:e.rtl?`rtl`:`ltr`,kerning:e.kerning===void 0?`auto`:e.fontSize>=e.kerning?`normal`:`none`,writingMode:e.verticalRun?`vertical-rl`:`horizontal-tb`}],...e.hyperlink?{hyperlink:e.hyperlink}:{}}}function KC(e,t){let n=e.layout,r=n.visibleAscent??n.ascent,i=r+(n.visibleDescent??n.descent),a=t.lineSpacing?.rule===`auto`&&!t.hasRuby&&!t.lineGrid.active,o=a&&(t.lineSpacing?.value??1)<1,s=a&&!o?Math.max(i,n.visibleIntendedSingle??n.intendedSingle):e.advancePt;return e.topYPt+(s-i)/2+r}function qC(e,t,n){let r=e.numbering;if(!r)return;if(t.numberingMarkerGeometry)return t.numberingMarkerGeometry;let i=e.numberingMarkerShapeInput,a=n.environment.layoutServices?.text;if(!(!i||!a))return Wp(r,i,{authoredFirstIndentPt:e.indentFirst,physicalIndentLeftPt:t.physicalIndentLeftPt,tabStops:e.tabStops,defaultTabPt:t.defaultTabPt},a)}function JC(e,t,n,r,i){return i.bounds.widthPt<=0?t.baseRtl?n+r:n:t.baseRtl?i.bounds.xPt+i.bounds.widthPt+e.bodyOffsetPt:i.bounds.xPt-e.bodyOffsetPt}function YC(e,t,n,r,i,a){if(!e.shape||e.markerText===``)return[];let o=e.shape,s=Bp({baseRtl:n.baseRtl,alignedLeadingEdgePt:JC(e,n,r,i,a),authoredFirstIndentPt:t.indentFirst,markerShiftPt:e.markerShiftPt,markerWidthPt:e.markerWidthPt}),c=-e.markerText.length,l=t.numbering?.color?{kind:`explicit`,color:`#${t.numbering.color}`}:t.numbering?.colorAuto?{kind:`auto`}:t.paragraphMarkColor?{kind:`explicit`,color:`#${t.paragraphMarkColor}`}:{kind:`default`},u=0;return o.spans.map(e=>{let r=u;u+=e.advancePt;let i=o.clusters?o.clusters.filter(t=>t.range.start>=e.start&&t.range.end<=e.end).map(e=>({range:{start:c+e.range.start,end:c+e.range.end},offset:{xPt:e.offsetPt-r,yPt:0},advancePt:e.advancePt})):[{range:{start:c+e.start,end:c+e.end},offset:{xPt:0,yPt:0},advancePt:e.advancePt}],d=s+r;return{kind:`text`,role:`numbering-marker`,text:e.text,range:{start:c+e.start,end:c+e.end},origin:{xPt:d,yPt:a.baselinePt},bounds:{xPt:d,yPt:a.baselinePt-e.ascentPt,widthPt:e.advancePt,heightPt:e.ascentPt+e.descentPt},advancePt:e.advancePt,clusters:i,paintOps:[{text:e.text,range:{start:c+e.start,end:c+e.end},offset:{xPt:0,yPt:0},letterSpacingPt:0,scaleX:1,direction:n.baseRtl?`rtl`:`ltr`,kerning:`auto`,writingMode:`horizontal-tb`}],color:l,fontRoute:e.fontRoute,fontSizePt:t.numberingMarkerShapeInput?.fontSizePt??e.ascentPt+e.descentPt,fontWeight:e.font.weight,fontStyle:e.font.style,direction:n.baseRtl?`rtl`:`ltr`,decorations:[]}})}function XC(e){if(e)return e.startsWith(`#`)?e:`#${e}`}function ZC(e,t,n){let r=XC(t),i=XC(n);return e.map(e=>({...e,placements:e.placements.map(e=>{if(e.kind!==`text`)return e;let t=e.background??r??i;return!t||e.color.kind===`explicit`?e:{...e,color:{kind:`auto`,background:t}}})}))}function QC(e){return e!=null&&e.style!==`none`}function $C(e,t,n,r,i,a,o){let s=n,c=n+r;e.indentFirst<0&&(e.bidi?c-=e.indentFirst:s+=e.indentFirst);for(let e of t.flatMap(e=>e.placements))!(e.kind===`text`&&e.role===`numbering-marker`||e.kind===`resource`&&e.resourceKind===`picture-bullet`)||!e.bounds||(s=Math.min(s,e.bounds.xPt),c=Math.max(c,e.bounds.xPt+e.bounds.widthPt));let l=e.borders,u=o.top===`none`?null:l?.[o.top]??null,d=o.bottom===`none`?null:l?.bottom??null,f=QC(l?.left??null)?l.left.space??0:0,p=QC(l?.right??null)?l.right.space??0:0,m=QC(u)?u.space??0:0,h=QC(d)?d.space??0:0;return{xPt:s-f,yPt:i-m,widthPt:c-s+f+p,heightPt:a+m+h}}function ew(e){return e.kind===`explicit`?e.color:e.kind===`auto`?ct(e.background??`#FFFFFF`):`#000000`}function tw(e){return e.inkBounds??{xMinPt:0,xMaxPt:e.advancePt,ascentPt:e.ascentPt,descentPt:e.descentPt}}function nw(e){return e===`circle`?`○`:e===`comma`?`﹅`:`•`}function rw(e,t,n){if(!(e.underline||e.strikethrough||e.doubleStrikethrough||e.emphasisMark))return;let r=e.textLayoutService,i=e.textShapeRequest;if(!r||!i)throw Error(`Retained typography geometry requires TextLayoutService`);let a=e=>r.shape({...i,text:e,measure:!0}),o=e=>{let t=a(e),n=t.spans[0];if(!n||t.spans.length!==1||n.start!==0||n.end!==e.length)throw Error(`Retained decoration probe requires one selected-face span`);return{ascentPt:n.ascentPt,descentPt:n.descentPt,...n.inkBounds?{inkBounds:n.inkBounds}:{}}},s=a(e.text),c=ew(n),l=e.underline?{...e.underlineStyle?{authoredStyle:e.underlineStyle}:{},color:e.underlineColor&&e.underlineColor!==`auto`?`#${e.underlineColor}`:c,probe:o(`_`)}:void 0,u=e.strikethrough||e.doubleStrikethrough?{double:e.doubleStrikethrough===!0,probe:o(`-`),...e.doubleStrikethrough?{doubleProbe:o(`=`)}:{}}:void 0,d=e.emphasisMark?(()=>{let r=nw(e.emphasisMark),o=a(r),s=o.spans[0];if(!s)throw Error(`Emphasis shaping produced no selected-face span`);let c=(e.shapedClusters??[]).map(n=>{let r=e.text.slice(n.range.start,n.range.end);return{text:r,range:{start:t+n.range.start,end:t+n.range.end},ink:tw(a(r))}});return{authored:e.emphasisMark,glyph:r,mark:{inkBounds:tw(o),fontRoute:s.fontRoute,fontSizePt:i.fontSizePt,fontWeight:s.font.weight,fontStyle:s.font.style,color:n},clusterInk:c}})():void 0;return{base:s,...l?{underline:l}:{},...u?{strike:u}:{},...d?{emphasis:d}:{}}}function iw(e,t,n,r,i,a){if(e.metricOnly){let t=VC(e);return{kind:`anchor-host`,measuredWidthPt:0,range:{start:n,end:n},...t?{sourceMetrics:t}:{},...i?.type===`anchorHost`&&i.anchorOccurrenceId?{anchorOccurrenceId:i.anchorOccurrenceId}:{}}}let o=GC(e,t,n,0,0,0,0);if(o.kind!==`text`)throw Error(`Visible text segment projected as anchor host`);let s=e.fitTextPerGapPx??Vf(e)+(e.snapToCharacterGrid===!1?0:r),c=e.charScale??1,l=WC(e),u=rw(e,n,o.color),d=e.shapedClusters,f=d?.length&&d[0]?.range.start===0&&d.at(-1)?.range.end===e.text.length&&d.every((e,t)=>t===0||d[t-1]?.range.end===e.range.start)&&d.every(e=>e.range.start<e.range.end&&Number.isFinite(e.offsetPt)&&Number.isFinite(e.advancePt))?d:void 0;if(e.text.length>0&&!f)throw Error(`Visible text acquisition requires complete authoritative grapheme clusters from TextLayoutService`);let p=(f??[]).map((t,r)=>{let i=e.text.slice(0,t.range.start),a=e.text.slice(t.range.start,t.range.end),o=[...i].length,u=[...a].length,d=r===(f?.length??0)-1?e.fitTextTrailingPadPx??0:0,p=e.punctuationCompressions?.filter(e=>e.end<=t.range.start).reduce((e,t)=>e+t.adjustmentPt,0)??0,m=e.punctuationCompressions?.filter(e=>e.end>t.range.start&&e.end<=t.range.end).reduce((e,t)=>e+t.adjustmentPt,0)??0;return{range:{start:n+t.range.start,end:n+t.range.end},offset:{xPt:t.offsetPt*c+o*s+p,yPt:l},advancePt:t.advancePt*c+u*s+d+m}}),{origin:m,bounds:h,advancePt:g,paintOps:_,clusters:v,...y}=o,b=e.tateChuYoko&&e.tateChuYokoCompress?(()=>{if(!e.textLayoutService||!e.textShapeRequest)throw Error(`Tate-chu-yoko compression requires TextLayoutService`);let t=e.textLayoutService.shape({...e.textShapeRequest,text:e.text,fontSizePt:o.fontSizePt,measure:!0,clusterGeometry:!1}),n=t.ascentPt+t.descentPt;return n>o.fontSizePt&&n>0?o.fontSizePt/n:1})():1,x=e.punctuationCompressions?.some(t=>t.end<e.text.length)??!1,S=e.verticalRun?(()=>{if(!a)throw Error(`Vertical glyph planning capability is required for vertical text`);let t=_[0];return a.planRun({text:e.text,font:L(o.fontRoute,o.fontSizePt,o.fontWeight,o.fontStyle),fontKerning:t.kerning,fontSizePt:o.fontSizePt,letterSpacingPt:s,charScale:c,growTrRotateInk:!0,writingMode:t.writingMode}).map(r=>({...t,text:r.text,range:{start:n+r.range.start,end:n+r.range.end},offset:{xPt:r.originPt+(e.punctuationCompressions?.filter(e=>e.end<=r.range.start).reduce((e,t)=>e+t.adjustmentPt,0)??0),yPt:l},letterSpacingPt:s,glyphOrientation:r.orientation,...r.verticalFeature?{verticalFeature:!0}:{},...r.blockAxisInkBounds?{blockAxisInkBounds:r.blockAxisInkBounds}:{},...r.drawOffsetPt.xPt!==0||r.drawOffsetPt.yPt!==0?{glyphOffsetPt:r.drawOffsetPt}:{}}))})():e.tateChuYoko?_.map(t=>({...t,offset:{xPt:t.offset.xPt+e.measuredWidth/2,yPt:t.offset.yPt},glyphOrientation:`upright`,...b===1?{}:{scaleY:b}})):x?(()=>{let t=_[0],r=[];for(let t of p){let i=t.range.end-n,a=e.punctuationCompressions?.find(e=>e.end===i)?.adjustmentPt??null,o=r.at(-1);o&&o.adjustmentPt===a?o.end=t.range.end:r.push({start:t.range.start,end:t.range.end,offset:t.offset,adjustmentPt:a})}return r.map(r=>({...t,text:e.text.slice(r.start-n,r.end-n),range:{start:r.start,end:r.end},offset:r.offset,letterSpacingPt:s+(r.adjustmentPt??0)}))})():_;return{...y,kind:`text`,measuredWidthPt:e.measuredWidth,clusters:p,basePaintOps:S.map(t=>({...t,letterSpacingPt:e.verticalRun&&t.glyphOrientation!==`sideways`?0:x?t.letterSpacingPt:s,...!e.verticalRun&&e.selectedFaceInkBounds?{inkBounds:e.selectedFaceInkBounds}:{},...!e.verticalRun&&e.selectedFaceInkBounds&&t.glyphOrientation===void 0?{blockAxisInkBounds:{startPt:(t.glyphOffsetPt?.yPt??0)-e.selectedFaceInkBounds.ascentPt,endPt:(t.glyphOffsetPt?.yPt??0)+e.selectedFaceInkBounds.descentPt}}:{}})),breakBefore:e.breakBefore!==!1&&!e.joinPrev,rtl:e.rtl,digitsAsAN:e.digitsAsAN,fixedPitch:e.fitTextRegionIndex!==void 0,...u?{retainedGeometry:u}:{},...e.textLayoutService?{textLayoutService:e.textLayoutService}:{},...e.textShapeRequest?{textShapeRequest:e.textShapeRequest}:{}}}function aw(e,t){let n=new Map;for(let e of t.lines)for(let t of e.layout.segments){let e=BC(t);if(e===void 0)continue;let r=`text`in t?t.metricOnly?0:t.text.length:`mathNodes`in t?t.fallbackText.length:+(`isTab`in t||`imagePath`in t);n.set(e,(n.get(e)??0)+r)}let r=e.runs.map((e,t)=>{let r=n.get(t);return r===void 0?e.type===`text`?e.text.length:e.type===`field`?e.fallbackText.length:e.type===`anchorHost`?0:1:r}),i=0;return{runStarts:r.map(e=>{let t=i;return i+=e,t}),runLengths:r}}function ow(e){return`text`in e?e.metricOnly?0:e.text.length:`mathNodes`in e?e.fallbackText.length:1}function sw(e,t,n,r,i,a,o,s,c,l,u=!1){let d=0,f=new Map,p=e.lines.some(e=>e.layout.segments.some(e=>`isTab`in e)),m=t.tabStops?.reduce((e,t)=>!e||t.pos<e.pos?t:e,void 0),h=e.lines.flatMap(e=>e.layout.segments.flatMap(e=>`text`in e&&!e.metricOnly?[e.text]:[])).join(``).trim(),g=!p&&m?.alignment===`decimal`&&h!==``&&/^[+\\-(]?[\\d., ]+\\)?%?$/u.test(h)?m.pos-a.physicalIndentLeftPt:void 0;return e.lines.map((p,m)=>{let h=p.layout,_=KC(p,a),v=1/0,y=d,b=[];for(let e of h.segments){let n=BC(e),r=n===void 0?void 0:t.runs[n],s=ow(e),p=n===void 0?d:(o.runStarts[n]??d)+(f.get(n)??0);if(n!==void 0&&f.set(n,(f.get(n)??0)+s),v=Math.min(v,p),y=Math.max(y,p+s),`isTab`in e){let t=e,n=t.leader??`none`,i;if(n!==`none`){if(!c)throw Error(`Tab leader acquisition requires TextLayoutService`);let e=n===`hyphen`?`-`:n===`underscore`||n===`heavy`?`_`:n===`middleDot`?`·`:`.`,a=r?.type===`text`||r?.type===`field`?r:void 0,o=a,s=c.shape({text:e,fontSizePt:t.fontSize,fonts:o?.fontSlots?.direct??(a?.fontFamily?{ascii:a.fontFamily}:{}),themeFonts:o?.fontSlots?.theme,themeFontPresence:o?.fontSlots?.themePresent,weight:t.bold?700:400,style:t.italic?`italic`:`normal`,measure:!0}),l=s.spans[0];if(!l||!Number.isFinite(s.advancePt)||s.advancePt<=0)throw Error(`Tab leader acquisition produced no shaped glyph advance`);i={glyph:e,advancePt:s.advancePt,fontRoute:l.fontRoute,fontSizePt:t.fontSize,fontWeight:l.font.weight,fontStyle:l.font.style,color:a?.color?{kind:`explicit`,color:`#${a.color}`}:o?.colorAuto?{kind:`auto`}:{kind:`default`}}}b.push({kind:`tab`,range:{start:p,end:p+s},measuredWidthPt:t.measuredWidth,leader:n,fontSizePt:t.fontSize,bold:t.bold,italic:t.italic,...i?{leaderShape:i}:{}})}else if(`imagePath`in e){let t=e;if(t.anchor)continue;let n=BC(e),r=PC(i,n??0);if(t.unavailableResourceKind){b.push({kind:`unavailable-resource`,range:{start:p,end:p+s},resourceKind:t.unavailableResourceKind,measuredWidthPt:t.measuredWidth,widthPt:t.widthPt,heightPt:t.heightPt,topOffsetPt:-t.heightPt,drawingId:LC(i,n??0)}),d=Math.max(d,p+s);continue}let a=t.chart?`chart`:`image`,o=t.chart?IC(r):Kc(r,t.imagePath);b.push({kind:`resource`,range:{start:p,end:p+s},resourceKey:o,resourceKind:a,measuredWidthPt:t.measuredWidth,widthPt:t.widthPt,heightPt:t.heightPt,topOffsetPt:-t.heightPt,...u?{orientation:`upright-physical`}:{}})}else if(`mathNodes`in e){let t=e;b.push({kind:`resource`,range:{start:p,end:p+s},resourceKey:t.mathResourceKey,resourceKind:`math`,measuredWidthPt:t.measuredWidth,widthPt:t.measuredWidth,heightPt:t.mathAscent+t.mathDescent,topOffsetPt:-t.mathAscent})}else b.push(iw(e,t,p,a.characterGrid.active?a.characterGrid.deltaPt:0,r,l));d=Math.max(d,p+s)}let x=h.segments.length===1&&`mathNodes`in(h.segments[0]??{})?h.segments[0]:void 0;return jC({paragraphXPt:n,availableWidthPt:r,alignment:t.alignment,baseRtl:a.baseRtl,isFirstLine:m===0,isLastLine:m===e.lines.length-1,stretchLastLine:a.stretchLastLine,firstLineIndentPt:a.firstIndentPt,...m===0&&s?{numbering:{bodyOffsetPt:s.bodyOffsetPt}}:{},...g===void 0?{}:{decimalAutoTabPt:g},...x?.display?{displayMathJustification:x.jc??a.mathDefJc??`centerGroup`}:{},line:{range:{start:Number.isFinite(v)?v:d,end:y},topPt:p.topYPt,baselinePt:_,advancePt:p.advancePt,xOffsetPt:h.xOffset,availableWidthPt:h.availWidth,endsWithBreak:h.endsWithBreak??!1,segments:b}})})}function cw(e,t){return{start:e.start+t,end:e.end+t}}function lw(e,t){if(!Number.isFinite(t)||t<0)throw RangeError(`Paragraph continuation source range must be finite and non-negative`);let n=e[0];if(!n)return e;let r=t-n.range.start;return r===0?e:e.map(e=>({...e,range:cw(e.range,r),placements:e.placements.map(e=>{let t=cw(e.range,r);return e.kind===`text`?{...e,range:t,clusters:e.clusters.map(e=>({...e,range:cw(e.range,r)})),paintOps:e.paintOps.map(e=>({...e,range:cw(e.range,r)}))}:{...e,range:t}})}))}function uw(e,t,n,r,i){let a=e.contentEndYPt-e.contentStartYPt;return jC({paragraphXPt:n,availableWidthPt:r,alignment:t.alignment,baseRtl:i.baseRtl,isFirstLine:!0,isLastLine:!0,stretchLastLine:i.stretchLastLine,line:{range:{start:0,end:0},topPt:e.contentStartYPt,baselinePt:e.contentEndYPt-e.lastLineBelowBaselinePt,advancePt:a,xOffsetPt:0,availableWidthPt:r,endsWithBreak:!1,segments:[]}})}function dw(e,t){let n=t.anchorFrames,r=e.anchorXRelativeFrom??(e.anchorXFromMargin?`margin`:`page`),i=e.anchorYRelativeFrom??(e.anchorYFromPara?`paragraph`:`page`),a=n?.page,o=n?.margin,s=a&&o?{xPt:a.xPt,yPt:a.yPt,widthPt:Math.max(0,o.xPt-a.xPt),heightPt:a.heightPt}:null,c=a&&o?{xPt:o.xPt+o.widthPt,yPt:a.yPt,widthPt:Math.max(0,a.xPt+a.widthPt-o.xPt-o.widthPt),heightPt:a.heightPt}:null,l=a&&o?{xPt:a.xPt,yPt:a.yPt,widthPt:a.widthPt,heightPt:Math.max(0,o.yPt-a.yPt)}:null,u=a&&o?{xPt:a.xPt,yPt:o.yPt+o.heightPt,widthPt:a.widthPt,heightPt:Math.max(0,a.yPt+a.heightPt-o.yPt-o.heightPt)}:null,d=n?.pageParity===`even`,f=r===`page`?a:r===`column`||r===`character`?n?.column:r===`leftMargin`?s:r===`rightMargin`?c:r===`insideMargin`?d?c:s:r===`outsideMargin`?d?s:c:o,p=i===`paragraph`||i===`line`||i===`character`?{xPt:t.placement.paragraphXPt,yPt:t.placement.startYPt,widthPt:t.placement.availableWidthPt,heightPt:0}:i===`page`?a:i===`column`?n?.column:i===`topMargin`?l:i===`bottomMargin`?u:i===`insideMargin`?d?u:l:i===`outsideMargin`?d?l:u:o;if(!f||!p)return null;let m=e.widthPt,h=e.heightPt,g=e.anchorXPt??0,_=e.anchorYPt??0,v=e.type===`shape`?e.pctPosH:null,y=e.type===`shape`?e.pctPosV:null;return{xPt:v==null?e.anchorXAlign===`center`?f.xPt+(f.widthPt-m)/2:e.anchorXAlign===`right`||e.anchorXAlign===`outside`&&!d||e.anchorXAlign===`inside`&&d?f.xPt+f.widthPt-m:f.xPt+g:f.xPt+f.widthPt*v+g,yPt:y==null?e.anchorYAlign===`center`?p.yPt+(p.heightPt-h)/2:e.anchorYAlign===`bottom`||e.anchorYAlign===`outside`&&!d||e.anchorYAlign===`inside`&&d?p.yPt+p.heightPt-h:p.yPt+_:p.yPt+p.heightPt*y+_,widthPt:m,heightPt:h}}function fw(e,t){return dw(e,t)??{xPt:e.anchorXPt+(e.anchorXFromMargin?t.placement.paragraphXPt:0),yPt:e.anchorYPt+(e.anchorYFromPara?t.placement.startYPt:0),widthPt:e.widthPt,heightPt:e.heightPt}}function pw(e,t,n,r){let i=_S(e,t,n.environment.layoutServices?.text,e.vmlTextPathInput),a=[i.command],o=FC(i,PC(n.source,r));return{kind:`drawing`,id:`${n.id}:drawing:${r}`,source:PC(n.source,r),flowDomainId:n.flowDomainId,flowBounds:t,inkBounds:t,advancePt:0,ordinaryFlow:!1,commands:a,...o.length===0?{}:{diagnostics:o},anchorLayer:{occurrenceId:`public-shape:${n.id}:${r}`,behindDoc:e.behindDoc===!0,relativeHeight:Number.isFinite(e.zOrder)?e.zOrder:r,sourceOrder:r,horizontalOwnership:e.anchorXRelativeFrom===`character`?`host`:`page`,verticalOwnership:e.anchorYRelativeFrom===`paragraph`||e.anchorYRelativeFrom===`line`||e.anchorYRelativeFrom===`character`||!e.anchorYRelativeFrom&&e.anchorYFromPara?`host`:`page`}}}function mw(e,t,n){if(!e.anchor||e.anchorAcquisitionInput)return null;let r=dw(e,t);if(!r)return null;let i=e.anchorYRelativeFrom??(e.anchorYFromPara?`paragraph`:`page`),a=PC(t.source,n);return{kind:`drawing`,id:`${t.id}:public-anchor-drawing:${n}`,source:a,flowDomainId:t.flowDomainId,flowBounds:r,inkBounds:r,advancePt:0,ordinaryFlow:!1,commands:[{kind:`resource`,resourceKind:e.type,resourceKey:e.type===`image`?Kc(a,e.imagePath):IC(a),rect:r,...t.environment.verticalPageFrame?{orientation:`upright-physical`}:{}}],anchorLayer:{occurrenceId:`public-anchor:${t.id}:${n}`,behindDoc:!1,relativeHeight:n,sourceOrder:n,horizontalOwnership:`page`,verticalOwnership:i===`paragraph`?`host`:`page`}}}function hw(e){return(e.type===`image`||e.type===`chart`||e.type===`shape`||e.type===`unavailableDrawing`)&&e.anchorAcquisitionInput!==void 0}function gw(e){return[{xPt:e.xPt,yPt:e.yPt},{xPt:e.xPt+e.widthPt,yPt:e.yPt},{xPt:e.xPt+e.widthPt,yPt:e.yPt+e.heightPt},{xPt:e.xPt,yPt:e.yPt+e.heightPt}]}function _w(e,t,n){let r=t.xPt-e.xPt,i=t.yPt-e.yPt,a=e.xPt+e.widthPt-t.xPt-t.widthPt,o=e.yPt+e.heightPt-t.yPt-t.heightPt;return{xPt:n.xPt-r,yPt:n.yPt-i,widthPt:Math.max(0,n.widthPt+r+a),heightPt:Math.max(0,n.heightPt+i+o)}}function vw(e,t){return{a:t.a,b:t.b,c:t.c,d:t.d,e:e.xPt+e.widthPt/2,f:e.yPt+e.heightPt/2}}function yw(e,t){let n=[fy(t,e),fy(t,{xPt:e.xPt+e.widthPt,yPt:e.yPt}),fy(t,{xPt:e.xPt,yPt:e.yPt+e.heightPt}),fy(t,{xPt:e.xPt+e.widthPt,yPt:e.yPt+e.heightPt})];if(n.some(e=>e===null))throw Error(`Upright drawing transform must be invertible`);let r=n,i=Math.min(...r.map(e=>e.xPt)),a=Math.min(...r.map(e=>e.yPt));return{xPt:i,yPt:a,widthPt:Math.max(...r.map(e=>e.xPt))-i,heightPt:Math.max(...r.map(e=>e.yPt))-a}}function bw(e,t){return W_(t,e)}function xw(e,t){let n=e=>{let n=G_(t,{top:e.topPt,right:e.rightPt,bottom:e.bottomPt,left:e.leftPt});return{topPt:n.top,rightPt:n.right,bottomPt:n.bottom,leftPt:n.left}};return{...e,axes:{horizontal:e.axes.vertical,vertical:e.axes.horizontal},geometry:{...e.geometry,objectFrame:W_(t,e.geometry.objectFrame),inkBounds:W_(t,e.geometry.inkBounds),wrapBounds:e.geometry.wrapBounds?W_(t,e.geometry.wrapBounds):null,size:{horizontal:e.geometry.size.vertical,vertical:e.geometry.size.horizontal},parentEffectExtent:n(e.geometry.parentEffectExtent),wrap:{...e.geometry.wrap,distances:n(e.geometry.wrap.distances),distanceSources:G_(t,e.geometry.wrap.distanceSources),effectExtent:n(e.geometry.wrap.effectExtent),...e.geometry.wrap.polygon?{polygon:{...e.geometry.wrap.polygon,points:e.geometry.wrap.polygon.points.map(e=>U_(t,e))}}:{}}}}}function Sw(e,t){let n=e.geometry.objectFrame;if(n.xPt===t.xPt&&n.yPt===t.yPt&&n.widthPt===t.widthPt&&n.heightPt===t.heightPt)return e;let r=n.widthPt===0?1:t.widthPt/n.widthPt,i=n.heightPt===0?1:t.heightPt/n.heightPt,a=e.geometry.wrap.polygon;return{...e,geometry:{...e.geometry,objectFrame:t,inkBounds:_w(e.geometry.inkBounds,n,t),wrapBounds:e.geometry.wrapBounds?_w(e.geometry.wrapBounds,n,t):null,wrap:{...e.geometry.wrap,polygon:a?{...a,points:a.points.map(e=>({xPt:t.xPt+(e.xPt-n.xPt)*r,yPt:t.yPt+(e.yPt-n.yPt)*i}))}:null}}}}function Cw(e,t,n){let r=e.group?.resolvedChildFrame;if(!r)return t;let i=e.extent.widthPt,a=e.extent.heightPt;if(e.extent.widthStatus!==`valid`||e.extent.heightStatus!==`valid`||i===null||a===null||i<=0||a<=0)throw Error(`resolved grouped anchor requires its authored wp:extent`);let o=n===void 0?t:W_(n.logicalToPhysical,t),s=o.widthPt/i,c=o.heightPt/a,l={xPt:o.xPt+r.offsetXPt*s,yPt:o.yPt+r.offsetYPt*c,widthPt:r.widthPt*s,heightPt:r.heightPt*c};return n===void 0?l:W_(n.physicalToLogical,l)}function ww(e,t,n=!1){let r=e.axes[t];return r.status!==`resolved`||n||r.referenceFrame===`paragraph`||r.referenceFrame===`line`||r.referenceFrame===`character`?`host`:`page`}function Tw(e,t,n,r,i,a,o,s,c,l){let u=-1,d;for(let t=0;t<n.length;t+=1){let r=n[t]?.placements.find(t=>t.kind===`anchor-host`&&t.anchorOccurrenceId===e);if(r?.kind===`anchor-host`){u=t,d=r;break}}if(!d||u<0)return null;let f=[...t].sort((e,t)=>(e.run.anchorAcquisitionInput?.group?.sourceIndex??0)-(t.run.anchorAcquisitionInput?.group?.sourceIndex??0)||e.runIndex-t.runIndex),p=f[0];if(!p?.run.anchorAcquisitionInput)return null;let m=n[u],h=i.anchorFrames,g=p.run.anchorAcquisitionInput.behavior,_=g.layoutInCellStatus===`valid`&&g.layoutInCell===!0&&i.anchorCellBounds!==void 0?i.anchorCellBounds:null,v=tC({acquisition:p.run.anchorAcquisitionInput,frames:{page:h?.page?_?{...h.page,..._}:h.page:null,margin:h?.margin?_?{...h.margin,..._}:h.margin:null,column:h?.column?_?{...h.column,..._}:h.column:null,paragraph:{xPt:i.placement.paragraphXPt,yPt:i.placement.startYPt,widthPt:i.placement.availableWidthPt,heightPt:Math.max(0,a)},line:m.bounds,character:d.bounds,pageParity:h?.pageParity??null}});if(v.status!==`resolved`)return{result:v,textBoxes:[],hostLineIndex:u,hostRange:d.range};let y=i.environment.verticalPageFrame&&h?.page?B_(h.page,i.environment.pageWritingMode):void 0,b=y===void 0?void 0:K_(i.environment.pageWritingMode,y),x=y===void 0?v:xw(v,b.physicalToLogical);if(g.behindDocStatus!==`valid`||g.relativeHeightStatus!==`valid`||g.behindDoc===null||g.relativeHeight===null)throw Error(`resolved anchor frame must retain required CT_Anchor behavior`);let S=x.geometry.objectFrame,C=y===void 0?void 0:vw(S,b.physicalToLogical),w=C?{...i.environment,verticalCJK:!1,verticalPageFrame:!1}:i.environment,T=[],E=[],D=[],O=[],k=new Map,A=S;if(p.run.type===`shape`&&p.run.anchorAcquisitionInput.group===null){let t=PC(i.source,p.runIndex),n=C?yw(S,C):S,r=Pw(p.run,n,{id:`${i.id}:anchor-textbox:${e}:${p.runIndex}`,source:t,flowDomainId:i.flowDomainId,context:i.context,measurer:i.measurer,environment:w,input:p.run.textBoxInput,acquireCompleteStory:i.acquireCompleteStory,...C?{coordinateSpace:`upright-physical`}:{}});r&&(k.set(p.runIndex,r),A=C?bw(r.flowBounds,C):r.flowBounds)}let j=Sw(x,A);if(g.allowOverlapStatus!==`valid`||g.allowOverlap===null||g.layoutInCellStatus!==`valid`||g.layoutInCell===null)throw Error(`resolved anchor frame must retain overlap and cell behavior`);let M=j.geometry.wrapBounds,N=!g.allowOverlap,ee=g.allowOverlap&&i.ordinaryFlow&&M!==null;if(N||ee){let t=ww(j,`vertical`,g.layoutInCell&&i.anchorCellBounds!==void 0),n=l.filter(e=>!PS(t,g.relativeHeight,e.relativeHeight)),r=(N?[...c,...n].filter(t=>t.occurrenceId!==e).map(e=>({occurrenceId:e.occurrenceId,bounds:e.bounds})):o.filter(t=>t.anchorOccurrenceId!==e).map(e=>({occurrenceId:e.anchorOccurrenceId??e.id,bounds:e.bounds}))).map(e=>({occurrenceId:e.occurrenceId,kind:`drawingml`,paragraphId:0,bounds:e.bounds,exclusionBounds:e.bounds})),a=i.anchorFrames?.page,s=N&&g.layoutInCell&&i.anchorCellBounds?i.anchorCellBounds.xPt+i.anchorCellBounds.widthPt:a?a.xPt+a.widthPt:1/0,u=rd({moving:{occurrenceId:e,kind:`drawingml`,paragraphId:1,bounds:A,exclusionBounds:M??A},blockers:r,avoidance:N?{kind:`drawingml-normative`}:{kind:`word-different-paragraph`,paragraphId:1},rightBoundaryPt:s}).displacement;if(u.xPt!==0||u.yPt!==0){if(A=Q(A,u),C)C={...C,e:C.e+u.xPt,f:C.f+u.yPt};else{let e=k.get(p.runIndex);e&&k.set(p.runIndex,ox(e,u))}j=Sw(x,A)}}for(let{run:t,runIndex:n}of f){let r=PC(i.source,n),a=t.anchorAcquisitionInput,o=Cw(a,A,b),s=C?yw(o,C):o;if(t.type===`image`)T.push({kind:`resource`,resourceKind:`image`,resourceKey:Kc(r,t.imagePath),rect:s});else if(t.type===`chart`)T.push({kind:`resource`,resourceKind:`chart`,resourceKey:IC(r),rect:s});else if(t.type===`unavailableDrawing`)T.push({kind:`noop`}),E.push(RC(t.resourceKind,r));else{let o=a.group?.resolvedChildFrame,c=_S(o?{...t,rotation:o.rotationDeg,flipH:o.flipH,flipV:o.flipV}:t,s,i.environment.layoutServices?.text,t.vmlTextPathInput);T.push(c.command),E.push(...FC(c,r));let l=`${i.id}:anchor-textbox:${e}:${n}`,u=k.get(n)??Pw(t,s,{id:l,source:r,flowDomainId:i.flowDomainId,context:i.context,measurer:i.measurer,environment:w,input:t.textBoxInput,acquireCompleteStory:i.acquireCompleteStory,...C?{coordinateSpace:`upright-physical`}:{}});u&&(D.push(u),O.push(l))}}let te={kind:`drawing`,id:`${i.id}:anchor-drawing:${e}`,source:PC(i.source,p.runIndex),flowDomainId:i.flowDomainId,flowBounds:A,inkBounds:j.geometry.inkBounds,advancePt:0,ordinaryFlow:!1,...C?{orientation:`upright-physical`,transform:C}:{},commands:T,...E.length===0?{}:{diagnostics:Object.freeze(E)},anchorLayer:{occurrenceId:e,behindDoc:g.behindDoc,relativeHeight:g.relativeHeight,sourceOrder:p.runIndex,horizontalOwnership:ww(j,`horizontal`,g.layoutInCell&&i.anchorCellBounds!==void 0),verticalOwnership:ww(j,`vertical`,g.layoutInCell&&i.anchorCellBounds!==void 0),...g.layoutInCell&&i.anchorCellBounds?{cellContainment:!0}:{}},...O.length?{textBoxIds:O}:{}},P=j.geometry.wrapBounds,ne=P&&j.geometry.wrap.kind!==`none`?{id:`${i.id}:anchor-exclusion:${e}`,wrap:j.geometry.wrap.kind,...j.geometry.wrap.side?{wrapSide:j.geometry.wrap.side}:{},bounds:P,polygon:j.geometry.wrap.polygon?.points??gw(P),anchorOccurrenceId:e,verticalOwnership:ww(j,`vertical`,g.layoutInCell&&i.anchorCellBounds!==void 0)}:void 0,F={occurrenceId:e,bounds:A,horizontalOwnership:ww(j,`horizontal`,g.layoutInCell&&i.anchorCellBounds!==void 0),verticalOwnership:ww(j,`vertical`,g.layoutInCell&&i.anchorCellBounds!==void 0),...g.relativeHeight===null?{}:{relativeHeight:g.relativeHeight}};return{result:j,drawing:te,exclusion:ne,collision:F,textBoxes:D,...g.layoutInCell&&i.anchorCellBounds?{cellContainmentBounds:A}:{},hostLineIndex:u,hostRange:d.range}}function Ew(e,t){let n=t.bidi===!0,r=t.runs.some(e=>e.type===`text`&&!!e.ruby),i=t.runs.some(e=>e.type===`text`&&Rl.test(e.text));return{...e,physicalIndentLeftPt:n?t.indentRight:t.indentLeft,physicalIndentRightPt:n?t.indentLeft:t.indentRight,firstIndentPt:t.indentFirst,lineSpacing:t.lineSpacing,spaceBeforePt:t.spaceBefore,spaceAfterPt:t.spaceAfter,baseRtl:n,isJustified:Lp(t.alignment),stretchLastLine:Rp(t.alignment),tabStops:[...t.tabStops],hasRuby:r,hasEastAsianText:i}}function Dw(e){return e===`vert`||e===`vert270`||e===`eaVert`||e===`mongolianVert`?e:void 0}function Ow(e,t,n){let r=Math.max(0,t-n);return e===`b`?r:e===`ctr`?r/2:0}function kw(e,t,n,r){let i=t===`eaVert`||t===`mongolianVert`,a=e.lines.map(e=>{let a=t===`mongolianVert`?e.placements.reduce((t,n)=>n.kind===`text`&&n.ruby?Math.max(t,e.baselinePt-Math.min(e.baselinePt,...n.ruby.paintOps.map(e=>e.origin.yPt))):t,0):0,o=(t===`mongolianVert`?2*n.yPt+n.heightPt-e.baselinePt+r.bottomPt-r.leftPt+a:e.baselinePt)-e.baselinePt,s=e.bounds.yPt+o,c=e.placements.map(e=>{if(e.kind!==`text`)return`bounds`in e&&e.bounds?{...e,bounds:{...e.bounds,yPt:e.bounds.yPt+o}}:e;let t=i?e.clusters.map(t=>{let n=e.text.slice(t.range.start-e.range.start,t.range.end-e.range.start),r=e.paintOps.find(e=>e.range.start<=t.range.start&&e.range.end>=t.range.end)??e.paintOps[0],i=Rl.test(n);return{...r,text:n,range:t.range,offset:i?{xPt:t.offset.xPt+t.advancePt/2,yPt:t.offset.yPt}:t.offset,glyphOrientation:i?`upright`:`sideways`}}):e.paintOps;return eT({...e,paintOps:t},o)});return{...e,bounds:{...e.bounds,yPt:s},baselinePt:e.baselinePt+o,placements:c}});return{...e,lines:a}}function Aw(e,t){let n=(e,n)=>e.kind===`paragraph`?kw(e,t===`mongolianVert`?`eaVert`:t,n,{topPt:0,rightPt:0,bottomPt:0,leftPt:0}):Aw(e,t),r={...e,rows:e.rows.map(e=>({...e,cells:e.cells.map(e=>({...e,blocks:e.blocks.map(t=>({...t,layout:n(t.layout,e.contentBounds)}))}))}))},i=new Map,a=e=>{let n=i.get(e);if(n)return n;let r={...e,child:Aw(e.child,t)};return i.set(e,r),r},o=e.floatingTables?.map(a),s=e.resolvedFloatingTables?.map(e=>{let t=a(e.source);return{...e,source:t,child:t.child}});return{...r,...o?{floatingTables:o}:{},...s?{resolvedFloatingTables:s}:{}}}function jw(e,t,n,r){return{...e,blocks:e.blocks.map(e=>{if(e.kind===`paragraph`)return kw(e,t,n,r);if(e.kind===`table`)return Aw(e,t);throw Error(`Text-box story contains unsupported retained node: ${e.kind}`)})}}function Mw(e,t,n=!0){if(t===0)return e;let r={xPt:0,yPt:t};return{...e,flowBounds:Q(e.flowBounds,r),inkBounds:Q(e.inkBounds,r),...e.clipBounds?{clipBounds:n?Q(e.clipBounds,r):e.clipBounds}:{},blocks:e.blocks.map(e=>{if(e.kind===`paragraph`)return ix(e,r);if(e.kind===`table`)return Nw(e,r);throw Error(`Text-box story contains unsupported retained node: ${e.kind}`)})}}function Nw(e,t){let n=lx(e,t),r=new Map,i=e=>{let n=r.get(e);if(n)return n;let i={...e,anchorBounds:Q(e.anchorBounds,t),...e.columnBounds?{columnBounds:Q(e.columnBounds,t)}:{},child:Nw(e.child,t)};return r.set(e,i),i},a=e.floatingTables?.map(i),o=e.resolvedFloatingTables?.map(e=>{let n=i(e.source);return{...e,xPt:e.xPt+t.xPt,yPt:e.yPt+t.yPt,bounds:Q(e.bounds,t),exclusionBounds:Q(e.exclusionBounds,t),source:n,child:n.child}});return{...n,...a?{floatingTables:a}:{},...o?{resolvedFloatingTables:o}:{}}}function Pw(e,t,n){let r=n.source,i=n.input??{kind:`compatibility`,source:{story:`textbox`,storyInstance:`${r.story}:${r.storyInstance}:${r.path.join(`.`)}`,path:[]},paragraphs:tl(e,{story:`textbox`,storyInstance:`${r.story}:${r.storyInstance}:${r.path.join(`.`)}`,path:[]})},a=i.source,o=i.kind===`complete`?i.blocks.length:i.paragraphs.length;if(o===0)return;let s=Dw(e.textVert),c=s?{xPt:-t.heightPt/2,yPt:-t.widthPt/2,widthPt:t.heightPt,heightPt:t.widthPt}:t,l=i.kind===`compatibility`?i.paragraphs:Object.freeze([]),u={topPt:e.textInsetT??0,rightPt:e.textInsetR??0,bottomPt:e.textInsetB??0,leftPt:e.textInsetL??0},d={xPt:c.xPt+u.leftPt,yPt:c.yPt+u.topPt,widthPt:Math.max(0,c.widthPt-u.leftPt-u.rightPt),heightPt:Math.max(0,c.heightPt-u.topPt-u.bottomPt)},f;if(i.kind===`complete`){if(!n.acquireCompleteStory)throw Error(`Complete text-box content requires the shared story acquisition adapter`);f=n.acquireCompleteStory({source:a,container:{id:`${n.id}:story`,kind:`textbox`,bounds:d,capacity:`unbounded`},blocks:i.blocks,coordinateSpace:n.coordinateSpace??`section-logical`})}let p=c.yPt+u.topPt,m=null,h=l.map((t,r)=>{let i=t.runs.map(t=>Vl({text:t.text,fontSizePt:t.fontSizePt,color:t.color?.slice(1)??null,fontFamily:t.fontFamily??null,fontFamilyEastAsia:t.fontFamilyEastAsia??null,bold:t.bold,italic:t.italic,ruby:t.ruby},e.textVert)),a=Math.max(0,c.widthPt-u.leftPt-u.rightPt-t.indentLeftPt-t.indentRightPt-Math.max(0,t.indentFirstPt)),o=s?t.image?.heightPt??0:t.image?.widthPt??0,l=s?t.image?.widthPt??0:t.image?.heightPt??0,f=o>a&&o>0?a/o:1,h=t.image?[{type:`image`,imagePath:t.image.imagePath,mimeType:t.image.mimeType,...t.image.svgImagePath?{svgImagePath:t.image.svgImagePath}:{},widthPt:o>0?o*f:a,heightPt:l>0?l*f:a,anchor:!1}]:i,g={alignment:t.alignment,indentLeft:t.indentLeftPt,indentRight:t.indentRightPt,indentFirst:t.indentFirstPt,spaceBefore:t.spacing.beforePt,spaceAfter:t.spacing.afterPt,lineSpacing:t.lineSpacing,numbering:t.numbering??null,numberingMarkerShapeInput:t.numberingMarkerShapeInput,tabStops:[...t.tabStops],bidi:t.bidi,contextualSpacing:t.contextualSpacing,styleId:t.styleId,runs:h},_=Ew(n.context,g),v=nC(m,t,m?.spacing.afterPt??0,t.spacing.beforePt);p+=v;let y=Kw(g,{id:`${n.id}:paragraph:${r}`,source:t.source,flowDomainId:`${n.flowDomainId}:textbox`,ordinaryFlow:!0,context:_,placement:{startYPt:p,paragraphXPt:c.xPt+u.leftPt,availableWidthPt:Math.max(0,c.widthPt-u.leftPt-u.rightPt),maximumYPt:c.yPt+c.heightPt-u.bottomPt,suppressSpaceBefore:!0},measurer:n.measurer,environment:n.environment,exclusions:[]});return p+=y.advancePt-y.spacing.afterPt,m=t,s?kw(y,s,d,u):y}),g=f?Math.max(0,f.advancePt+u.topPt+u.bottomPt):Math.max(0,p-c.yPt+u.bottomPt),_=e.textAutofit===`sp`&&o>0&&(!s||l.every(e=>e.image===void 0))&&Number.isFinite(g)&&g>0?s?{...t,widthPt:g}:{...t,heightPt:g}:t,v=s?{xPt:-_.heightPt/2,yPt:-_.widthPt/2,widthPt:_.heightPt,heightPt:_.widthPt}:_;if(s&&_.widthPt!==t.widthPt&&s!==`mongolianVert`){let e=v.yPt-c.yPt;h=h.map(t=>nT(t,e))}let y={xPt:v.xPt+u.leftPt,yPt:v.yPt+u.topPt,widthPt:Math.max(0,v.widthPt-u.leftPt-u.rightPt),heightPt:Math.max(0,v.heightPt-u.topPt-u.bottomPt)},b=Sv(h.map(e=>e.flowBounds))??{xPt:y.xPt,yPt:y.yPt,widthPt:0,heightPt:0},x=Sv(h.map(e=>e.inkBounds))??{xPt:y.xPt,yPt:y.yPt,widthPt:0,heightPt:0},S=f??{story:`textbox`,flowBounds:b,inkBounds:x,clipBounds:y,blocks:h,advancePt:Math.max(0,g-u.topPt-u.bottomPt),diagnostics:[]},C=jS(S);return f&&s&&(S=jw(Mw(S,v.yPt-c.yPt),s,y,u)),S=Mw(S,Ow(e.textAnchor,y.heightPt,C),!1),Xc({kind:`textbox`,id:n.id,source:l[0]?.source??a,flowDomainId:`${n.flowDomainId}:textbox`,flowBounds:_,inkBounds:_,...e.defaultTextColor?{defaultTextColor:`#${e.defaultTextColor.replace(/^#/u,``)}`}:{},...e.textAutofit===`none`?{clipBounds:y}:{},advancePt:0,ordinaryFlow:!1,story:S,transform:s?{a:0,b:s===`vert270`?-1:1,c:s===`vert270`?1:-1,d:0,e:_.xPt+_.widthPt/2,f:_.yPt+_.heightPt/2}:{a:1,b:0,c:0,d:1,e:0,f:0},writingMode:e.textVert===`vert270`?`vertical-lr`:e.textVert?`vertical-rl`:`horizontal-tb`,insets:u,contentBounds:v,...s?{verticalMode:s}:{}})}var Fw=class extends Z{reason;states;occurrenceCapacity;constructor(e,t,n){super(`NON_CONVERGENCE`,`parser-owned paragraph anchor reflow did not converge (${e}; ${n} occurrences; ${t.length} states)`),this.name=`ParagraphAnchorReflowNonConvergenceError`,this.reason=e,this.states=Object.freeze([...t]),this.occurrenceCapacity=n}};function Iw(e,t){if(t.length===0)return e.placement;if(e.placement.wrap)throw Error(`Conflicting paragraph wrap authorities: placement.wrap and effective exclusions`);let n=e.anchorFrames?.page,r=Ix(t.map((e,t)=>({kind:`shape`,mode:e.wrap===`topAndBottom`?`topAndBottom`:`square`,authoredWrap:e.wrap,wrapPolygon:e.polygon,imageKey:e.id,imageX:e.bounds.xPt,imageY:e.bounds.yPt,imageW:e.bounds.widthPt,imageH:e.bounds.heightPt,xLeft:e.bounds.xPt,xRight:e.bounds.xPt+e.bounds.widthPt,yTop:e.bounds.yPt,yBottom:e.bounds.yPt+e.bounds.heightPt,side:e.wrapSide??`bothSides`,distLeft:0,distRight:0,distTop:0,distBottom:0,paraId:t})),{xLeftPt:n?.xPt??e.placement.paragraphXPt,xRightPt:n?n.xPt+n.widthPt:e.placement.paragraphXPt+e.placement.availableWidthPt,readingDirection:e.context.baseRtl?`rtl`:`ltr`});return{...e.placement,wrap:r}}function Lw(e,t){let n=new Map;for(let r of e.exclusions){let e=r.anchorOccurrenceId;if(!(!e||!t.has(e))){if(n.has(e))throw Error(`Paragraph anchor occurrence produced duplicate exclusions: ${e}`);n.set(e,r)}}return Object.freeze([...n.values()])}function Rw(e){return Uc(`paragraph-effective-wrap-exclusions`,e.map(e=>({id:e.id,...e.anchorOccurrenceId===void 0?{}:{occurrenceId:e.anchorOccurrenceId},wrap:e.wrap,...e.wrapSide===void 0?{}:{wrapSide:e.wrapSide},bounds:e.bounds,polygon:e.polygon,...e.verticalOwnership===void 0?{}:{verticalOwnership:e.verticalOwnership}})))}function zw(e){let t=new Set;for(let n of e){let e=n.anchorOccurrenceId;if(e){if(t.has(e))throw Error(`Duplicate external paragraph exclusion occurrence: ${e}`);t.add(e)}}return t}function Bw(e,t){let n=zw(e);return Object.freeze([...e,...t.filter(e=>!e.anchorOccurrenceId||!n.has(e.anchorOccurrenceId))])}function Vw(e,t){let n=new Set;for(let t of e){if(n.has(t.occurrenceId))throw Error(`Duplicate external anchor collision occurrence: ${t.occurrenceId}`);n.add(t.occurrenceId)}return Object.freeze([...e,...t.filter(e=>!n.has(e.occurrenceId))])}function Hw(e,t,n,r){let i=n.environment.layoutServices,a=n.environment.verticalGlyphMeasurement,o=n.anchorFrames,s=t.runs.some(hw),c=t.runs.some(e=>e.type===`shape`&&e.textBoxInput?.kind===`complete`),{wrap:l,...u}=n.placement,d=n.context,f=n.environment;return`paragraph-acquisition-v1:${JSON.stringify([n.id,[n.source.story,n.source.storyInstance,n.source.path],n.flowDomainId,n.ordinaryFlow,[u.startYPt,u.paragraphXPt,u.availableWidthPt,u.maximumYPt,u.suppressSpaceBefore,l?e.objectIdentity(l):null],[d.lineGrid.active,d.lineGrid.pitchPt,d.characterGrid.active,d.characterGrid.deltaPt,d.physicalIndentLeftPt,d.physicalIndentRightPt,d.firstIndentPt,d.lineSpacing?[d.lineSpacing.value,d.lineSpacing.rule,d.lineSpacing.explicit??null]:null,d.spaceBeforePt,d.spaceAfterPt,d.baseRtl,d.isJustified,d.stretchLastLine,d.tabStops.map(e=>[e.pos,e.alignment,e.leader]),d.hasRuby,d.hasEastAsianText,[d.kinsoku.enabled,[...d.kinsoku.lineStartForbidden].sort((e,t)=>e-t),[...d.kinsoku.lineEndForbidden].sort((e,t)=>e-t)],d.defaultTabPt,d.overflowPunct!==!1,d.numberingMarkerGeometry?JSON.stringify(d.numberingMarkerGeometry):null,d.mathDefJc??null],[e.objectIdentity(n.measurer.context),e.objectIdentity(n.measurer.fontFamilyClasses)],[f.pageIndex,f.totalPages,f.displayPageNumber??null,f.pageNumberFormat??null,f.currentDateMs??null,f.noteNumbers?[...f.noteNumbers.entries()].sort(([e],[t])=>e.localeCompare(t)):null,f.noteReferenceNumber??null,f.pageWritingMode,f.verticalCJK??null,f.verticalPageFrame??null,f.documentHasEastAsianText,f.useFeLayout??null,f.characterSpacingControl??null,f.resolvedLocalFonts?e.objectIdentity(f.resolvedLocalFonts):null,i?.text.fingerprint??null,i?.images.fingerprint??null,i?.math.fingerprint??null,i?.verticalGlyphFingerprint??null,a?.fingerprint??null],JSON.stringify(n.exclusions),s?JSON.stringify(n.anchorCollisions??[]):null,r?JSON.stringify(r):null,n.paragraphBorderEdges?[n.paragraphBorderEdges.top,n.paragraphBorderEdges.bottom]:null,n.trailingExtentPt??null,n.containerShading??null,n.continuesFromPrevious??null,n.sourceRangeStart??null,o?[o.page?[o.page.xPt,o.page.yPt,o.page.widthPt,o.page.heightPt]:null,o.margin?[o.margin.xPt,o.margin.yPt,o.margin.widthPt,o.margin.heightPt]:null,o.column?[o.column.xPt,o.column.yPt,o.column.widthPt,o.column.heightPt]:null,o.pageParity]:null,s?JSON.stringify(n.anchorCellBounds??null):null,c&&n.acquireCompleteStory?e.objectIdentity(n.acquireCompleteStory):null])}`}function Uw(e){let t=e.src?Object.freeze({...e.src}):void 0;return`text`in e?Object.freeze({...e,...t?{src:t}:{},...e.shapedClusters?{shapedClusters:Object.freeze(e.shapedClusters.map(e=>Object.freeze({...e,range:Object.freeze({...e.range})})))}:{},...e.selectedFaceInkBounds?{selectedFaceInkBounds:Object.freeze({...e.selectedFaceInkBounds})}:{},...e.ruby?{ruby:Object.freeze({...e.ruby})}:{},...e.border?{border:Object.freeze({...e.border})}:{},...e.revision?{revision:Object.freeze({...e.revision})}:{},...e.hyperlink?{hyperlink:Object.freeze({...e.hyperlink})}:{},...e.seaBreaks?{seaBreaks:Object.freeze([...e.seaBreaks])}:{}}):`imagePath`in e?Object.freeze({...e,...t?{src:t}:{},...e.srcRect?{srcRect:Object.freeze({...e.srcRect})}:{},...e.duotone?{duotone:Object.freeze({...e.duotone})}:{}}):`isTab`in e?Object.freeze({...e,...t?{src:t}:{},...e.ptab?{ptab:Object.freeze({...e.ptab})}:{}}):Object.freeze({...e,...t?{src:t}:{}})}function Ww(e){return Object.freeze({...e,layout:Object.freeze({...e.layout,segments:Object.freeze(e.layout.segments.map(Uw)),...e.layout.consumedEnd?{consumedEnd:Object.freeze({...e.layout.consumedEnd})}:{}})})}function Gw(e,t,n){let r=t.environment.layoutServices?r_(t.environment.layoutServices):void 0,i=r?Hw(r,e,t,n):void 0,a=i===void 0?void 0:r.get(e,i);if(a)return a;let o=zw(t.exclusions),s=new Set(e.runs.flatMap(e=>hw(e)?[e.anchorAcquisitionInput.occurrenceId]:[]));for(let e of o)s.delete(e);let c=s.size,l=Object.freeze([]),u=Bw(t.exclusions,l);try{let a=Kd({seedState:Rw(u),step:r=>{let i=Bw(t.exclusions,r?.ownedExclusions??l),a=zx(e,t.context,Iw(t,i),t.measurer,{...t.environment,paragraphMarkShapeInput:e.paragraphMarkShapeInput},n),o=Xw(e,t,a),c=Lw(o,s),u=Rw(Bw(t.exclusions,c));if(Rw(o.exclusions)!==u)throw Error(`Paragraph retained exclusions differ from the measured exclusion authority`);return Object.freeze({measured:a,layout:o,ownedExclusions:c,state:u})},stateOf:e=>e.state,limit:16}).value,o=Object.freeze({...a.measured,lines:Object.freeze(a.measured.lines.map(Ww)),placement:Object.freeze({...a.measured.placement})}),c=Object.freeze({measured:o,layout:a.layout});return i!==void 0&&r.set(e,i,c),c}catch(e){throw e instanceof Gd?new Fw(e.reason,e.states,c):e}}function Kw(e,t){return Gw(e,t).layout}const qw=new WeakMap;function Jw(e){return e===void 0?null:e instanceof Date?{date:e.toISOString()}:e instanceof Set?{set:[...e].map(Jw).sort((e,t)=>JSON.stringify(e).localeCompare(JSON.stringify(t)))}:e instanceof Map?{map:[...e.entries()].map(([e,t])=>[Jw(e),Jw(t)]).sort((e,t)=>JSON.stringify(e[0]).localeCompare(JSON.stringify(t[0])))}:Array.isArray(e)?e.map(Jw):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Jw(t)])):e}function Yw(e,t){if(t.contexts.length!==e.members.length||t.inputs.length!==e.members.length||t.borderEdges.length!==e.members.length||t.borderExtentsPt.length!==e.members.length)throw Error(`Frame acquisition metadata must align with every group member`);if(!Number.isFinite(t.maximumWidthPt)||t.maximumWidthPt<0)throw RangeError(`Frame maximumWidthPt must be finite and non-negative`);let n=qw.get(t.acquisitionSession);n||(n=new Map,qw.set(t.acquisitionSession,n));let r=Uc(`w:frame-acquisition`,[e.id,t.placementSignature,t.maximumWidthPt,t.environment.pageIndex,t.environment.totalPages,t.environment.displayPageNumber??null,t.environment.pageNumberFormat??null,t.environment.currentDateMs??null,t.environment.documentHasEastAsianText,t.environment.layoutServices?.text.fingerprint??null,t.environment.layoutServices?.images.fingerprint??null,t.environment.layoutServices?.math.fingerprint??null,t.environment.layoutServices?.verticalGlyphFingerprint??null,Jw(t.contexts),Jw(t.inputs),Jw(t.borderEdges),Jw(t.borderExtentsPt),t.containerShading??null,Jw(t.anchorFrames)]),i=n.get(r);if(i)return i;let a=e.framePr,o=a.w==null?Math.max(0,...e.members.map((e,n)=>am(e,t.contexts[n],t.maximumWidthPt,t.measurer,t.environment,qC(t.inputs[n],t.contexts[n],t)))):Math.max(0,a.w),s=Math.max(1,o),c=(()=>{let n=pC(`body-frame:${e.id}`),r=0,i=null,a=0,o=0,c=[];return e.members.forEach((l,u)=>{let d=t.contexts[u],f=Math.max(nC(i,l,a,d.spaceBeforePt),o),p={startYPt:r+f,paragraphXPt:0,availableWidthPt:s,maximumYPt:1/0,suppressSpaceBefore:!0},m=t.borderExtentsPt[u]??0,h={story:`body`,storyInstance:`body`,path:[e.sourceIndices[u]]},{measured:g,layout:_}=Gw(t.inputs[u],{id:`body-frame:${e.id}:${u}`,source:h,flowDomainId:`body-frame:${e.id}`,ordinaryFlow:!1,context:d,placement:p,measurer:t.measurer,environment:t.environment,exclusions:n.exclusions,anchorCollisions:n.collisions,containerShading:t.containerShading,paragraphBorderEdges:t.borderEdges[u],trailingExtentPt:Math.max(d.spaceAfterPt,m),anchorFrames:t.anchorFrames});n=gC(n,_),c.push({paragraph:l,fragment:_,source:h}),r=g.contentEndYPt,i=l,a=g.requestedSpaceAfterPt,o=m}),{heightPt:Math.max(0,r+Math.max(a,o)),members:c}})(),l=t.place(o,c.heightPt),u=Object.freeze(c.members.map(e=>{let t=ix(e.fragment,{xPt:l.bounds.xPt,yPt:l.bounds.yPt}),n=NC(a.hRule===`exact`&&a.h!=null?{...t,clipBounds:l.bounds}:t),r=Object.freeze({...n,advancePt:0});return Object.freeze({...e,fragment:r})})),d=Object.freeze({box:Object.freeze({bounds:l.bounds,exclusionBounds:l.exclusionBounds,exclusionId:`frame:${e.id}`}),members:u});return n.set(r,d),d}function Xw(e,t,n){let r=t.continuesFromPrevious?{...t.context,firstIndentPt:0}:t.context,i=t.placement.paragraphXPt+r.physicalIndentLeftPt,a=t.placement.availableWidthPt-r.physicalIndentLeftPt-r.physicalIndentRightPt,o=aw(e,n),s=t.continuesFromPrevious?void 0:qC(e,r,t),c=sw(n,e,i,a,t.source,r,o,s,t.environment.layoutServices?.text,t.environment.verticalGlyphMeasurement,t.environment.verticalPageFrame);t.sourceRangeStart!==void 0&&(c=lw(c,t.sourceRangeStart)),s&&n.markOnly&&c.length===0&&(s.markerText!==``||e.numbering?.picBulletImagePath)&&(c=[uw(n,e,i,a,r)]);let l=[],u=[],d=[],f=[],p=[],m=[],h=[],g=e.runs.map((e,t)=>e.type===`break`?{kind:`break`,breakKind:e.breakType,offset:o.runStarts[t]??0}:void 0).filter(e=>e!==void 0),_=new Map;e.runs.forEach((e,t)=>{if(!hw(e))return;let n=_.get(e.anchorAcquisitionInput.occurrenceId)??[];n.push({run:e,runIndex:t}),_.set(e.anchorAcquisitionInput.occurrenceId,n)});for(let[r,i]of _){let a=Tw(r,i,c,e,t,n.contentEndYPt-t.placement.startYPt,t.exclusions,p,t.anchorCollisions??[],m);a&&(f.push(a.result),a.cellContainmentBounds&&h.push(a.cellContainmentBounds),a.drawing&&(u.push(a.drawing),d.push(...a.textBoxes),a.exclusion&&p.push(a.exclusion),a.collision&&m.push(a.collision),c[a.hostLineIndex]&&(c=c.map((e,t)=>t===a.hostLineIndex?{...e,placements:[...e.placements,{kind:`drawing`,range:a.hostRange,drawingId:a.drawing.id,bounds:a.drawing.inkBounds,advancePt:0}]}:e))))}if(s&&c[0]){let n=YC(s,e,t.context,i,a,c[0]);n.length>0&&(c=[{...c[0],placements:[...n,...c[0].placements]},...c.slice(1)])}if(e.runs.forEach((e,n)=>{let r=PC(t.source,n);if(e.type===`unavailableDrawing`&&e.anchorAcquisitionInput===void 0){let i=LC(t.source,n),a=c.flatMap(e=>e.placements).find(e=>e.kind===`drawing`&&e.drawingId===i);a?.kind===`drawing`&&u.push({kind:`drawing`,id:i,source:r,flowDomainId:t.flowDomainId,flowBounds:a.bounds,inkBounds:a.bounds,advancePt:0,ordinaryFlow:!1,commands:Object.freeze([{kind:`noop`}]),diagnostics:Object.freeze([RC(e.resourceKind,r)])})}if(e.type===`image`&&l.push({kind:`image`,resourceKey:Kc(r,e.imagePath),intrinsicSize:{widthPt:e.widthPt,heightPt:e.heightPt}}),e.type===`chart`&&l.push({kind:`chart`,resourceKey:IC(r),intrinsicSize:{widthPt:e.widthPt,heightPt:e.heightPt}}),e.type===`math`&&l.push({kind:`math`,resourceKey:e.resourceKey??Uc(`math-resource`,r),intrinsicSize:{widthPt:c.flatMap(e=>e.placements).find(e=>e.kind===`resource`&&e.resourceKind===`math`)?.bounds?.widthPt??0,heightPt:e.fontSize}}),(e.type===`image`||e.type===`chart`)&&!t.continuesFromPrevious){let r=mw(e,t,n);if(r){u.push(r);let e=c[0];e&&(c=[{...e,placements:[...e.placements,{kind:`drawing`,range:{start:o.runStarts[n]??0,end:(o.runStarts[n]??0)+(o.runLengths[n]??1)},drawingId:r.id,bounds:r.inkBounds,advancePt:0}]},...c.slice(1)])}}if(e.type===`shape`&&!e.anchorAcquisitionInput&&!t.continuesFromPrevious){let i=fw(e,t),a=`${t.id}:textbox:${n}`,s=Pw(e,i,{id:a,source:r,flowDomainId:t.flowDomainId,context:t.context,measurer:t.measurer,environment:t.environment,input:e.textBoxInput,acquireCompleteStory:t.acquireCompleteStory}),l=pw(e,s?.flowBounds??i,t,n);s&&(d.push(s),l={...l,textBoxIds:[a]}),u.push(l);let f=c[0];f&&(c=[{...f,placements:[...f.placements,{kind:`drawing`,range:{start:o.runStarts[n]??0,end:(o.runStarts[n]??0)+(o.runLengths[n]??1)},drawingId:l.id,bounds:l.inkBounds,advancePt:0}]},...c.slice(1)])}}),e.numbering?.picBulletImagePath&&!t.continuesFromPrevious&&l.push({kind:`picture-bullet`,resourceKey:Kc(t.source,e.numbering.picBulletImagePath),intrinsicSize:{widthPt:e.numbering.picBulletWidthPt??e.numberingMarkerShapeInput?.fontSizePt??0,heightPt:e.numbering.picBulletHeightPt??e.numberingMarkerShapeInput?.fontSizePt??0}}),e.numbering?.picBulletImagePath&&c[0]&&!t.continuesFromPrevious){if(!s)throw Error(`Picture-bullet acquisition requires resolved marker font geometry`);let n=e.numbering.picBulletWidthPt??s.markerWidthPt,r=e.numbering.picBulletHeightPt??e.numberingMarkerShapeInput?.fontSizePt;if(r===void 0)throw Error(`Picture-bullet acquisition requires resolved marker height`);let o=Bp({baseRtl:t.context.baseRtl,alignedLeadingEdgePt:JC(s,t.context,i,a,c[0]),authoredFirstIndentPt:e.indentFirst,markerShiftPt:s.markerShiftPt,markerWidthPt:n});c=[{...c[0],placements:[{kind:`resource`,resourceKind:`picture-bullet`,range:{start:-1,end:0},resourceKey:Kc(t.source,e.numbering.picBulletImagePath),bounds:{xPt:o,yPt:c[0].baselinePt-r,widthPt:n,heightPt:r},advancePt:0},...c[0].placements]},...c.slice(1)]}c=ZC(c,e.shading,t.containerShading);let v=n.contentEndYPt-n.contentStartYPt,y=t.paragraphBorderEdges??{top:`top`,bottom:`bottom`},b=$C(e,c,i,a,n.contentStartYPt,v,y),x=e.borders?[...y.top===`none`?[]:[[y.top,e.borders[y.top]]],[`right`,e.borders.right],...y.bottom===`none`?[]:[[`bottom`,e.borders.bottom]],[`left`,e.borders.left]]:[],S=e.borders?x.flatMap(([e,t])=>{if(!QC(t))return[];let n=e===`top`||e===`between`||e===`bottom`,r=e===`right`||e===`bottom`,i=n?b.yPt+(r?b.heightPt:0):b.xPt+(r?b.widthPt:0);return[{edge:e,from:n?{xPt:b.xPt,yPt:i}:{xPt:i,yPt:b.yPt},to:n?{xPt:b.xPt+b.widthPt,yPt:i}:{xPt:i,yPt:b.yPt+b.heightPt},color:t.color?`#${t.color}`:`#000000`,widthPt:t.width,...Y_(t.style,t.width)}]}):[],C=t.trailingExtentPt??n.requestedSpaceAfterPt,w=Sv(h);return NC({kind:`paragraph`,id:t.id,source:t.source,...e.paragraphId===void 0?{}:{paragraphId:e.paragraphId},flowDomainId:t.flowDomainId,ordinaryFlow:t.ordinaryFlow,...e.styleId===void 0?{}:{styleId:e.styleId},...!t.continuesFromPrevious&&e.bookmarks?.length?{bookmarkStarts:e.bookmarks}:{},flowBounds:{xPt:t.placement.paragraphXPt,yPt:t.placement.startYPt,widthPt:t.placement.availableWidthPt,heightPt:n.contentEndYPt-t.placement.startYPt+C},inkBounds:{...e.shading||e.borders?b:{xPt:i,yPt:n.contentStartYPt,widthPt:Math.max(0,...c.map(e=>e.bounds.widthPt)),heightPt:v}},spacing:{beforePt:t.placement.suppressSpaceBefore?0:n.requestedSpaceBeforePt,afterPt:C},contextualSpacing:e.contextualSpacing??!1,lines:c,borders:S,shading:e.shading?{color:`#${e.shading}`}:void 0,resources:l,drawings:u,textBoxes:d,events:g,exclusions:Bw(t.exclusions,p),...w?{cellContainmentBounds:w}:{},anchorCollisions:Vw(t.anchorCollisions??[],m),...f.length?{anchorFrames:f}:{},paragraphMark:n.markOnly?{hidden:e.markVanish===!0,bounds:{xPt:i,yPt:n.contentStartYPt,widthPt:0,heightPt:v}}:void 0})}const Zw=(e,t)=>Jb(e,{xPt:0,yPt:t}),Qw=(e,t)=>Q(e,{xPt:0,yPt:t}),$w=(e,t)=>Qb(e,{xPt:0,yPt:t}),eT=(e,t)=>ex(e,{xPt:0,yPt:t}),tT=(e,t)=>tx(e,{xPt:0,yPt:t}),nT=(e,t)=>ix(e,{xPt:0,yPt:t}),rT=(e,t)=>ox(e,{xPt:0,yPt:t});function iT(e,t,n,r){if(!e.shading&&e.borders.length===0)return null;let i=t[0],a=t.at(-1);if(!i||!a)return{box:Qw(e.inkBounds,n),borders:[]};let o=e.inkBounds.yPt,s=o+e.inkBounds.heightPt,c=r.continuesFromPrevious?Math.max(o,i.bounds.yPt):o,l=r.continuesOnNext?Math.min(s,a.bounds.yPt+a.advancePt):s,u={xPt:e.inkBounds.xPt,yPt:c+n,widthPt:e.inkBounds.widthPt,heightPt:Math.max(0,l-c)},d=u.xPt,f=d+u.widthPt,p=u.yPt,m=p+u.heightPt;return{box:u,borders:e.borders.flatMap(e=>(e.edge===`top`||e.edge===`between`)&&r.continuesFromPrevious||e.edge===`bottom`&&r.continuesOnNext?[]:e.edge===`top`||e.edge===`between`?[{...e,from:{xPt:d,yPt:p},to:{xPt:f,yPt:p}}]:e.edge===`bottom`?[{...e,from:{xPt:d,yPt:m},to:{xPt:f,yPt:m}}]:e.edge===`left`?[{...e,from:{xPt:d,yPt:p},to:{xPt:d,yPt:m}}]:e.edge===`right`?[{...e,from:{xPt:f,yPt:p},to:{xPt:f,yPt:m}}]:[{...e,from:Zw(e.from,n),to:Zw(e.to,n)}])}}function aT(e,t,n=`${e.id}:${t.lineStart}-${t.lineEnd}`){let r=e.lines.slice(t.lineStart,t.lineEnd),i=r[0],a=r.at(-1),o=t.continuesFromPrevious&&i?e.flowBounds.yPt-i.bounds.yPt:0,s=o===0?r:r.map(e=>tT(e,o)),c=s[0],l=s.at(-1),u=e.lines.map((e,n)=>n>=t.lineStart&&n<t.lineEnd?s[n-t.lineStart]:e),d=c&&l?{xPt:Math.min(...s.map(e=>e.bounds.xPt)),yPt:c.bounds.yPt,widthPt:Math.max(...s.map(e=>e.bounds.xPt+e.bounds.widthPt))-Math.min(...s.map(e=>e.bounds.xPt)),heightPt:l.bounds.yPt+l.bounds.heightPt-c.bounds.yPt}:e.inkBounds,f=iT(e,r,o,t),p=new Set(r.flatMap(e=>e.placements.flatMap(e=>e.kind===`drawing`?[e.drawingId]:[]))),m=e.drawings.filter(e=>p.has(e.id)).map(e=>e.anchorLayer?.verticalOwnership===`page`?e:$w(e,o)),h=Sv(m.filter(e=>e.anchorLayer?.cellContainment===!0).map(e=>e.flowBounds)),g=new Set(e.drawings.flatMap(e=>{if(e.anchorLayer?.verticalOwnership!==`host`)return[];let t=e.anchorLayer.acquisitionOccurrenceId??e.anchorLayer.occurrenceId;return t===void 0?[]:[t]})),_=new Set(m.flatMap(e=>{if(e.anchorLayer?.verticalOwnership!==`host`)return[];let t=e.anchorLayer.acquisitionOccurrenceId??e.anchorLayer.occurrenceId;return t===void 0?[]:[t]})),v=new Set(r.flatMap(e=>e.placements.flatMap(e=>e.kind===`resource`?[e.resourceKey]:[])));for(let e of m)for(let t of e.commands)t.kind===`resource`&&v.add(t.resourceKey);let y=new Set(m.flatMap(e=>[e.id.replace(`:drawing:`,`:textbox:`),...e.textBoxIds??[]])),b=new Set(m.filter(e=>e.anchorLayer?.verticalOwnership===`page`||e.orientation===`upright-physical`).flatMap(e=>e.textBoxIds??[])),x=new Set(m.map(e=>Uc(`source-occurrence`,e.source))),S=i?.range.start,C=a?.range.end,{bookmarkStarts:w,...T}=e;return NC({...T,kind:`paragraph`,id:n,...!t.continuesFromPrevious&&w?.length?{bookmarkStarts:w}:{},lines:u,flowBounds:{...e.flowBounds,yPt:e.flowBounds.yPt},...e.clipBounds?{clipBounds:Qw(e.clipBounds,o)}:{},spacing:{beforePt:t.continuesFromPrevious?0:e.spacing.beforePt,afterPt:t.continuesOnNext?0:e.spacing.afterPt},inkBounds:f?.box??d,borders:f?.borders??e.borders.map(e=>({...e,from:Zw(e.from,o),to:Zw(e.to,o)})),resources:e.resources.filter(e=>v.has(e.resourceKey)),drawings:m,cellContainmentBounds:h??void 0,textBoxes:e.textBoxes.filter(e=>y.has(e.id)||x.has(Uc(`source-occurrence`,e.source))).map(e=>b.has(e.id)?e:rT(e,o)),events:S===void 0||C===void 0?[]:e.events.filter(e=>e.offset>=S&&(e.offset<C||!t.continuesOnNext&&e.offset===C)),exclusions:e.exclusions.filter(e=>e.verticalOwnership===`page`||e.anchorOccurrenceId===void 0||!g.has(e.anchorOccurrenceId)||_.has(e.anchorOccurrenceId)).map(e=>({...e,bounds:e.verticalOwnership===`page`?e.bounds:Qw(e.bounds,o),polygon:e.verticalOwnership===`page`?e.polygon:e.polygon.map(e=>Zw(e,o))})),anchorCollisions:(e.anchorCollisions??[]).filter(e=>e.verticalOwnership===`page`||!g.has(e.occurrenceId)||_.has(e.occurrenceId)).map(e=>({...e,bounds:e.verticalOwnership===`page`?e.bounds:Qw(e.bounds,o)})),...t.continuesOnNext?{paragraphMark:void 0}:e.paragraphMark?{paragraphMark:{...e.paragraphMark,bounds:Qw(e.paragraphMark.bounds,o)}}:{},continuation:t})}function oT(e,t){return e.segIndex-t.segIndex||e.charOffset-t.charOffset}function sT(e,t,n,r,i,a,o,s,c,l){if(![r,i].every(e=>Number.isFinite(e)&&e>=0))throw RangeError(`Paragraph fragment extents must be finite and non-negative`);if(n.length!==e.lines.length)throw RangeError(`Paragraph source boundaries must align with retained lines`);let u=o.authoredSpaceAfterPt??0;if(!Number.isFinite(u)||u<0)throw RangeError(`Authored paragraph spaceAfter must be finite and non-negative`);let d=e.lines.length,f=n=>aT(e,{lineStart:0,lineEnd:n,continuesFromPrevious:t.boundary!==null,continuesOnNext:n<d}),p=e=>{let t=s?.(e)??0;if(!Number.isFinite(t)||t<0)throw RangeError(`Paragraph page-local reserve must be finite and non-negative`);return t},m=e=>l?.(e)??!0,h=(e,t)=>{if(!t)return e.advancePt;let n=Um({advancePt:e.advancePt,retainedSpaceAfterPt:e.spacing.afterPt,authoredSpaceAfterPt:u});return Km({paragraph:e,writingMode:o.writingMode??`horizontal-tb`,logicalLineBoxExtentPt:n,availableBlockExtentPt:r})};if(d===0){let n=p(e),o=h(e,!0);return a&&(o+n>r||!m(n))&&o+n<=i?{fragment:null,nextCursor:t,requiresFreshFlowRegion:!0,additionalReservePt:0,admittedBlockExtentPt:0}:{fragment:e,nextCursor:null,requiresFreshFlowRegion:!1,additionalReservePt:n,admittedBlockExtentPt:Math.min(e.advancePt,r)}}let g=p(e),_=h(e,!0);if(t.boundary===null&&o.keepLines&&a&&(_+g>r||!m(g))&&_+g<=i)return{fragment:null,nextCursor:t,requiresFreshFlowRegion:!0,additionalReservePt:0,admittedBlockExtentPt:0};let v=Px(0,d,r,e=>(()=>{let t=f(e),n=p(t);return m(n)?h(t,e===d)+n:r+1})()).end;if(v===0){if(a)return{fragment:null,nextCursor:t,requiresFreshFlowRegion:!0,additionalReservePt:0,admittedBlockExtentPt:0};v=1}for(;;){let e=Fx({widowControl:o.widowControl,start:0,end:v,totalLines:d,canRelocate:a});if(e.kind===`relocate`)return{fragment:null,nextCursor:t,requiresFreshFlowRegion:!0,additionalReservePt:0,admittedBlockExtentPt:0};if(e.kind!==`dropLastLine`)break;--v}let y=f(v),b=v<d?n[v-1]:null;if(b!==null&&t.boundary!==null&&oT(b,t.boundary)<=0)throw Error(`Paragraph continuation source boundary did not advance`);return{fragment:y,nextCursor:b===null?null:Object.freeze({boundary:b,sourceRangeStart:y.lines.at(-1).range.end,...c===void 0?{}:{uniformRubyAdvancePt:c}}),requiresFreshFlowRegion:!1,additionalReservePt:p(y),admittedBlockExtentPt:Math.min(y.advancePt,r)}}function cT(e,t){let n=new Map;if(!e)return n;let r=new Set(e.map(e=>e.id));return t.forEach(e=>{r.has(e)&&!n.has(e)&&n.set(e,n.size+1)}),n}function lT(e){let t=new Map;if(!e)return t;for(let n of e)t.set(n.id,n);return t}function uT(e,t){let n=[],r=new Set;for(let i of e)if(i.type===`paragraph`)for(let e of i.runs)e.type!==`text`||e.noteRef?.kind!==t||e.noteRef.id.length===0||r.has(e.noteRef.id)||(r.add(e.noteRef.id),n.push(e.noteRef.id));else if(i.type===`table`)for(let e of i.rows)for(let i of e.cells)for(let e of uT(i.content,t))r.has(e)||(r.add(e),n.push(e));return Object.freeze(n)}function dT(e,t){return Object.freeze([...new Set(e.flatMap(e=>e.placements.flatMap(e=>e.kind===`text`&&e.noteReference?.kind===t?[e.noteReference.id]:[])))])}function fT(e,t){return e.rows.flatMap(e=>e.cells.flatMap(e=>e.blocks.flatMap(e=>pT(e.layout,t))))}function pT(e,t){let n=e.kind===`paragraph`?dT(e.lines,t):fT(e,t);return Object.freeze([...new Set(n)])}function mT(e){return dT(e,`footnote`)}function hT(e){return pT(e,`footnote`)}function gT(e){return pT(e,`endnote`)}function _T(e){if(!Number.isInteger(e.columnCount)||e.columnCount<=0)throw RangeError(`Column count must be a positive integer`);for(let t of e.fragments)if(!Number.isFinite(t.extentPt)||t.extentPt<0)throw RangeError(`Column balance fragment extents must be finite and non-negative`);if(e.fragments.length===0)return Object.freeze({targetPt:0,cutIndexes:Object.freeze([]),transitionExpansions:0});let t=[0],n=[0],r=[];e.fragments.forEach((i,a)=>{t.push(t[a]+i.extentPt);let o=a+1;(i.breakAfter!==`forbidden`||o===e.fragments.length)&&n.push(o),i.breakAfter===`forced`&&o<e.fragments.length&&r.push(o)});let i=Math.min(e.columnCount,n.length-1),a=Array.from({length:i+1},()=>Array(n.length).fill(1/0)),o=Array.from({length:i+1},()=>Array(n.length).fill(-1));a[0][0]=0;let s=0;for(let e=1;e<=i;e+=1){let i=a[e-1],c=a[e],l=i.flatMap((e,t)=>Number.isFinite(e)?[t]:[]),u=0,d=0,f=0,p=0;for(let a=1;a<n.length;a+=1){let m=n[a];for(;d<r.length&&r[d]<m;)f=r[d],d+=1;for(;n[p]<f;)p+=1;for(;u<l.length&&l[u]<p;)u+=1;let h=l[u];if(h===void 0||h>=a)continue;let g=e=>{s+=1;let r=n[e];return Math.max(i[e],t[m]-t[r])},_=h,v=g(_);for(;u+1<l.length;){let e=l[u+1];if(e>=a)break;let t=g(e);if(t>v)break;u+=1,_=e,v=t}c[a]=v,o[e][a]=_}}let c=n.length-1,l=-1,u=1/0;for(let e=1;e<=i;e+=1){let t=a[e][c];t<=u&&(u=t,l=e)}if(l<0||!Number.isFinite(u))throw Error(`Authored column breaks exceed the available column frontier`);let d=[],f=c;for(let e=l;e>0;--e)if(d.push(n[f]),f=o[e][f],f<0)throw Error(`Column balance frontier omitted a predecessor`);return d.reverse(),Object.freeze({targetPt:u,cutIndexes:Object.freeze(d),transitionExpansions:s})}function vT(e){let t=new Map;return e.sequence.forEach((e,n)=>{if(e.kind===`body-block`){let r=e.block;t.set(Wc(r.source),Object.freeze({sequenceIndex:n,keepLines:r.kind===`paragraph`&&r.keepLines,keepNext:r.kind===`paragraph`&&r.keepNext,widowControl:r.kind===`paragraph`&&r.widowControl}));return}e.kind===`adjacent-table-group`&&e.tables.forEach(e=>t.set(Wc(e.source),Object.freeze({sequenceIndex:n,keepLines:!1,keepNext:!1,widowControl:!1})))}),t}function yT(e,t,n){let r=t-e;if(n.length<=1)return Object.freeze([r]);let i=[],a=e;for(let e of n){if(!Number.isFinite(e)||e<a||e>t)return Object.freeze([r]);i.push(e-a),a=e}return i[i.length-1]=i.at(-1)+t-a,Object.freeze(i)}function bT(e,t,n,r){let i=new Set(r.flowDomainIds),a=new Map(n.layers.body.map(e=>[e.id,e])),o=vT(e),s=[];for(let e of t){if(!i.has(e.flowDomainId))continue;let t=a.get(e.nodeId);if(!t||!t.ordinaryFlow)continue;let n=Wc(t.source),r=o.get(n);if(!r)continue;let c=t.kind===`paragraph`&&!r.keepLines&&t.lines.length>1?t.lines.map(e=>e.bounds.yPt+e.advancePt):t.kind===`table`&&t.rows.length>1?t.rows.map(e=>e.flowBounds.yPt+e.advancePt):[e.blockEndPt];yT(e.blockStartPt,e.blockEndPt,c).forEach(e=>s.push({extentPt:e,breakAfter:`allowed`,sequenceIndex:r.sequenceIndex,sourceIdentity:n,paragraphLine:t.kind===`paragraph`&&!r.keepLines&&t.lines.length>0}))}let c=new Map;s.forEach((e,t)=>{let n=c.get(e.sourceIdentity)??[];n.push(t),c.set(e.sourceIdentity,n)});for(let[e,t]of c){let n=o.get(e);if(!n)continue;let r=t.filter(e=>s[e].paragraphLine);n.keepLines&&t.slice(0,-1).forEach(e=>{s[e].breakAfter=`forbidden`});for(let e=0;e+1<r.length;e+=1)Fx({widowControl:n.widowControl,start:0,end:e+1,totalLines:r.length,canRelocate:!0}).kind!==`keep`&&(s[r[e]].breakAfter=`forbidden`);n.keepNext&&(s[t.at(-1)].breakAfter=`forbidden`)}let l=e.initialSection.sectionOccurrenceId;return e.sequence.forEach((e,t)=>{if(e.kind===`begin-section`){l=e.section.sectionOccurrenceId;return}if(!(l!==r.sectionOccurrenceId||e.kind!==`authored-break`||e.break!==`column`)){for(let e=s.length-1;e>=0;--e)if(!(s[e].sequenceIndex>=t)){s[e].breakAfter=`forced`;break}}}),Object.freeze(s.map(e=>Object.freeze(e)))}function xT(e,t,n,r,i){let a=bT(e,t,r,i),o=n.get(r.pageIndex)??0;return _T({columnCount:i.flowDomainIds.length,fragments:a}).targetPt+o}function ST(e,t,n,r,i){let a=t,o=e.lines.map((t,o)=>{let s=a++,c=String(s),l=i.measureLineNumberGlyph(c),u=Object.freeze({xPt:e.flowBounds.xPt-r,yPt:t.baselinePt});return Object.freeze({lineIndex:o,counterValue:s,bounds:Object.freeze({xPt:u.xPt-l.widthPt,yPt:u.yPt-l.ascentPt,widthPt:l.widthPt,heightPt:l.ascentPt+l.descentPt}),paintOps:s%n===0?Object.freeze([Object.freeze({kind:`text`,text:c,origin:u,font:l.font??``,color:`#000000`,textAlign:`right`})]):Object.freeze([])})});return Object.freeze({paragraph:Object.freeze({...e,lineNumbers:Object.freeze(o)}),counterEnd:a})}function CT(e,t,n){let r=new Map,i,a=e.pages.map(e=>{if(e.parityBlank)return e;let a=[...e.layers.body];for(let o=0;o<e.sectionRegions.length;o+=1){let s=e.sectionRegions[o],c=new Set(s.flowDomainIds),l=a.flatMap((e,t)=>c.has(e.flowDomainId)?[t]:[]),u=new Map(l.map(e=>[a[e].id,a[e]])),d=n.filter(e=>{let t=u.get(e.nodeId);return c.has(e.flowDomainId)&&e.blockEndPt>e.blockStartPt&&t!==void 0&&(t.ordinaryFlow||t.sectionFlowOwnership===`host-flow`)}),f=d.length===0?s.blockStartPt:Math.min(...d.map(e=>e.blockStartPt)),p=d.length===0?f:Math.max(...d.map(e=>e.blockEndPt)),m=s.blockEndPt,h=Math.max(0,m-s.blockStartPt),g=Math.max(0,p-f),_=s.section.verticalAlignment,v=d.length>0&&g<h?_===`center`?s.blockStartPt+(h-g)/2-f:_===`bottom`?m-g-f:0:0,y=s.section.lineNumbering,b=y?.restart===`newPage`?y.start:y?.restart===`newSection`?r.get(s.sectionOccurrenceId)??y.start:r.get(s.sectionOccurrenceId)??i??y?.start??1;b??=1;for(let e of l){let n=a[e];if(n.kind===`paragraph`&&n.ordinaryFlow&&y){let e=ST(n,b,Math.max(1,y.countBy),Tm(y.distance),t);n=e.paragraph,b=e.counterEnd}v!==0&&(n.ordinaryFlow||n.sectionFlowOwnership===`host-flow`)&&(n.kind===`paragraph`||n.kind===`table`)&&(n=gx(n,{xPt:0,yPt:v})),a[e]=n}y&&(r.set(s.sectionOccurrenceId,b),i=b)}return Object.freeze({...e,layers:T_(e.layers,`body`,a)})});return Object.freeze({...e,pages:Object.freeze(a)})}function wT(e){let t=new Map;for(let n of e)for(let e of n.sectionRegions)t.has(e.sectionOccurrenceId)||t.set(e.sectionOccurrenceId,n.pageIndex);return t}function TT(e,t){let n=e[t];return n?t===0||e[t-1]?.sectionOccurrenceId!==n.sectionOccurrenceId:!1}function ET(e,t){return t.titlePage&&t.firstPageOfSection?e.first:t.evenAndOddHeaders&&t.displayPageNumber%2==0?e.even:e.default}function DT(e,t){if(![e.pageHeight,e.marginTop,e.marginBottom,t.top,t.bottom].every(Number.isFinite))throw RangeError(`Reserved body interval inputs must be finite`);if(e.pageHeight<=0||t.top<0||t.bottom<0)throw RangeError(`Reserved body interval requires a positive page and non-negative reserves`);let n=Math.min(e.pageHeight,Math.abs(e.marginTop)+t.top),r=e.pageHeight-Math.abs(e.marginBottom)-t.bottom;return Object.freeze({blockStartPt:n,blockEndPt:Math.max(n,Math.min(e.pageHeight,r))})}function OT(e,t,n){if(![e,t,n].every(Number.isFinite))throw RangeError(`Header/footer reserve inputs must be finite`);if(e<0)throw RangeError(`Story extent must be non-negative`);return e===0||t<0?0:Math.max(0,e-(t-n))}function kT(e){let t=t=>{let n=Object.freeze(e.measure(t).map(e=>Object.freeze({...e})));return Object.freeze({result:t,reserves:n,pageCount:n.length,fingerprint:Uc(`header-footer-reserve-v1`,{identity:e.identity(t),reserves:n})})},n=t(e.seed);return!e.requiresConvergence&&n.reserves.every(e=>e.top===0&&e.bottom===0)?n:qd(n,n=>t(e.repaginate(n.reserves,n.result)),e.limit??16)}var AT=class extends Z{constructor(e,t){super(`INVALID_GEOMETRY`,`${t} exceeds the available flow capacity`),this.containerId=e,this.layoutId=t,this.name=`FlowCapacityExceededError`}};function jT(e,t){if(e.length===0)return{xPt:t.xPt,yPt:t.yPt,widthPt:0,heightPt:0};let n=Math.min(...e.map(e=>e.xPt)),r=Math.min(...e.map(e=>e.yPt)),i=Math.max(...e.map(e=>e.xPt+e.widthPt)),a=Math.max(...e.map(e=>e.yPt+e.heightPt));return{xPt:n,yPt:r,widthPt:i-n,heightPt:a-r}}function MT(e,t,n){let r=[],i=e.cursor,a=e.container.bounds;if(![a.xPt,a.yPt,a.widthPt,a.heightPt].every(Number.isFinite)||a.widthPt<0||a.heightPt<0)throw new Z(`INVALID_GEOMETRY`,`${e.container.id} has invalid bounds`);let o=e.container.bounds.yPt+e.container.bounds.heightPt,s=e.container.capacity===`unbounded`?2**53-1:o,c=e.container.bounds.xPt+e.container.bounds.widthPt;if(!Number.isFinite(i.xPt)||!Number.isFinite(i.yPt)||i.xPt<a.xPt||i.xPt>c||i.yPt<a.yPt||i.yPt>o)throw new Z(`INVALID_GEOMETRY`,`${e.container.id} has an invalid initial flow cursor`);for(let a of e.blocks){let l={container:e.container,cursor:i,availableBounds:{xPt:e.container.bounds.xPt,yPt:i.yPt,widthPt:e.container.bounds.widthPt,heightPt:Math.max(0,s-i.yPt)}},u=a.kind===`paragraph`?n.layoutParagraph(a,l,t):n.layoutTable(a,l,t);if(u.layout.flowDomainId!==e.container.id)throw new Z(`INVALID_REFERENCE`,`${u.layout.id} belongs to ${u.layout.flowDomainId}, not ${e.container.id}`);if(e.container.capacity!==`unbounded`&&Number.isFinite(u.nextCursor.yPt)&&u.nextCursor.yPt>o)throw new AT(e.container.id,u.layout.id);if(!Number.isFinite(u.nextCursor.xPt)||!Number.isFinite(u.nextCursor.yPt)||u.nextCursor.xPt<e.container.bounds.xPt||u.nextCursor.xPt>c||u.nextCursor.yPt<i.yPt)throw new Z(`INVALID_GEOMETRY`,`${u.layout.id} returned an invalid flow cursor`);r.push(u.layout),i=u.nextCursor}return{source:e.source,container:e.container,blocks:r,nextCursor:i,flowDomainId:e.container.id,flowBounds:jT(r.map(e=>e.flowBounds),e.container.bounds),inkBounds:jT(r.map(e=>e.inkBounds),e.container.bounds),...e.container.capacity===`unbounded`?{}:{clipBounds:e.container.bounds},advancePt:i.yPt-e.cursor.yPt,ordinaryFlow:!0}}const NT=new WeakMap,PT=e=>`type`in e&&e.type===`unsupportedTextBoxBlock`;function FT(e,t){if(NT.has(e))throw Error(`Story block layout algorithms are already attached`);NT.set(e,Object.freeze({...t}))}function IT(e,t){return Object.freeze({...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:Q(e.clipBounds,t)}:{},blocks:Object.freeze(e.blocks.map(e=>{if(e.kind===`paragraph`)return cx(e,t);if(e.kind===`table`)return lx(e,t);throw Error(`Story contains unsupported retained node: ${e.kind}`)}))})}function LT(e,t){return Object.freeze({...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:Q(e.clipBounds,t)}:{},separator:Object.freeze(e.separator.map(e=>Yb(e,t))),story:IT(e.story,t)})}function RT(e,t){for(let t of e.blocks)if(!PT(t)&&(t.source.story!==e.source.story||t.source.storyInstance!==e.source.storyInstance))throw new Z(`INVALID_REFERENCE`,`Story block ${t.source.story}:${t.source.storyInstance} is not owned by ${e.source.story}:${e.source.storyInstance}`);let n=NT.get(t);if(!n)throw Error(`Story block layout algorithms are not attached to the supplied services`);let r=e.blocks.filter(PT),i=MT({blocks:e.blocks.filter(e=>!PT(e)),container:e.container,cursor:{xPt:e.container.bounds.xPt,yPt:e.container.bounds.yPt},source:e.source},t,n);return Object.freeze({story:e.source.story,flowBounds:i.flowBounds,inkBounds:i.inkBounds,...i.clipBounds?{clipBounds:i.clipBounds}:{},blocks:Object.freeze([...i.blocks]),advancePt:i.advancePt,diagnostics:Object.freeze(r.map(t=>Object.freeze({code:`UNSUPPORTED_FEATURE`,severity:`warning`,source:Object.freeze({story:e.source.story,storyInstance:e.source.storyInstance,path:Object.freeze([...t.sourcePath])}),message:`Unsupported text-box block ${t.qName}`})))})}var zT=class extends Error{code=`FOOTNOTE_RESERVE_EXCEEDS_FRESH_PAGE`;constructor(e,t,n){super(`Body footnote admission cannot fit a fresh physical page (reserve: ${e}, charge: ${t}, fresh page: ${n})`),this.reservePt=e,this.admissionChargePt=t,this.freshPageExtentPt=n,this.name=`FootnoteAdmissionOverflowError`}};function BT(e,t){if(t.has(e))return[];t.add(e);let n=e.diagnostics??[];return e.kind===`paragraph`?[...n,...e.drawings.flatMap(e=>BT(e,t)),...e.textBoxes.flatMap(e=>BT(e,t))]:e.kind===`table`?[...n,...e.rows.flatMap(e=>e.cells.flatMap(e=>e.blocks.flatMap(e=>BT(e.layout,t)))),...(e.floatingTables??[]).flatMap(e=>BT(e.child,t)),...(e.resolvedFloatingTables??[]).flatMap(e=>BT(e.child,t))]:e.kind===`textbox`||e.kind===`note`?[...n,...e.story.diagnostics,...e.story.blocks.flatMap(e=>BT(e,t))]:n}function VT(e,t,n){if(e>0&&t>n)throw new zT(e,t,n)}function HT(e){let t=new Set,n=e=>{for(let r of e.resolvedFloatingTables??[])t.add(r.occurrenceId),n(r.child)};return n(e),t}function UT(e,t,n){if(!e.floats)throw Error(`Accepted floating table omitted its float registry delta`);let r=HT(t);return Object.freeze({...e,floats:Object.freeze({...e.floats,entries:Object.freeze(e.floats.entries.map(e=>{let i=r.has(e.occurrenceId)?ux(n,e.occurrenceId):t.ordinaryFlow?null:n;return i===null?e:Object.freeze({...e,occurrenceId:i,exclusionId:i})}))})})}function WT(e,t){let n=new Set(t.drawings.flatMap(e=>{let t=e.anchorLayer?.acquisitionOccurrenceId??e.anchorLayer?.occurrenceId;return t===void 0?[]:[t]})),r=e.floats?.entries.filter(e=>n.has(e.occurrenceId))??[],i=e.drawingCollisions?.entries.filter(e=>n.has(e.occurrenceId))??[];return r.length===0&&i.length===0?null:Object.freeze({...e.floats&&r.length>0?{floats:Object.freeze({...e.floats,entries:Object.freeze(r),nextParagraphId:e.floats.baseNextParagraphId+r.length})}:{},...e.drawingCollisions&&i.length>0?{drawingCollisions:Object.freeze({...e.drawingCollisions,entries:Object.freeze(i)})}:{}})}function GT(e){let t=new Map([[e.initialSection.sectionOccurrenceId,e.initialSection]]);for(let n=0;n<e.sequence.length;n+=1){let r=e.sequence[n];r.kind===`begin-section`&&t.set(r.section.sectionOccurrenceId,r.section)}return t}function KT(e,t){return Lm(e.context,e.pageLayout,t)}function qT(e,t){let n=KT(e,t);return km({sectionOccurrenceId:e.sectionOccurrenceId,geometry:n.geometry,columns:n.columns,textDirection:n.textDirection,sectionBidi:n.sectionBidi===!0,grid:n.grid})}function JT(e,t,n,r=n.blockStartPt,i=KT(e,t).columns.map((e,t)=>t)){let a=KT(e,t);return Object.freeze({id:`page:${t}:section:${encodeURIComponent(e.sectionOccurrenceId)}`,sectionOccurrenceId:e.sectionOccurrenceId,section:a,pageBorders:e.pageBordersAuthored?e.pageBorders:null,writingMode:P_(a.textDirection),blockStartPt:r,blockEndPt:n.blockEndPt,columnFlowDirection:a.sectionBidi===!0?`rtl`:`ltr`,columnIndexes:Object.freeze([...i]),columns:Object.freeze(i.map(e=>{let t=a.columns[e];if(!t)throw Error(`Missing authored section column`);return Object.freeze({inlineStartPt:t.xPt,inlineExtentPt:t.wPt})}))})}function YT(e,t){let n=P_(e.textDirection),r=B_({widthPt:e.geometry.pageWidth,heightPt:e.geometry.pageHeight},n);return Object.freeze(n===`horizontal-tb`?{...r,contentTopPt:t.blockStartPt,contentBottomPt:t.blockEndPt}:{...r,contentTopPt:0,contentBottomPt:r.heightPt})}function XT(e,t,n){return DT(KT(e,t).geometry,n)}function ZT(e,t,n){let r=KT(e,t);return Vb({kind:`content`,pageIndex:t,physicalPage:YT(r,n),sectionOccurrenceId:e.sectionOccurrenceId,section:r,region:JT(e,t,n)})}function QT(e){let t=e.pages.at(-1),n=t?.accumulator.sectionRegions.at(-1);if(!t||t.kind!==`content`||!n)throw Error(`Missing active body region`);return n}function $T(e){let t=QT(e),n=t.columnIndexes??t.section.columns.map((e,t)=>t),r=(t.columnFlowDirection===`rtl`?[...n].reverse():[...n]).at(-1)===e.flow.columnIndex;return e.balanceTargetPt===null||r?t.blockEndPt:Math.min(t.blockEndPt,t.blockStartPt+e.balanceTargetPt)}function eE(e){let t=QT(e),n=t.columnIndexes??t.section.columns.map((e,t)=>t),r=t.columns[n.indexOf(e.flow.columnIndex)];if(!r)throw Error(`Missing active body column`);return Object.freeze({pageIndex:e.flow.pageIndex,columnIndex:e.flow.columnIndex,flowDomainId:tv(e.flow.pageIndex,t.id,e.flow.columnIndex),section:t.section,cursorPt:Object.freeze({xPt:r.inlineStartPt,yPt:e.flow.cursorBlockPt}),availableBounds:Object.freeze({xPt:r.inlineStartPt,yPt:e.flow.cursorBlockPt,widthPt:r.inlineExtentPt,heightPt:Math.max(0,$T(e)-e.footnoteReservePt-e.flow.cursorBlockPt)})})}function tE(e,t){let n=t=>{let n=e.get(t);if(!n)throw Error(`Unknown body section ${t}`);return n};return{openContentPage(e){let r=n(e.sectionOccurrenceId),i=t[e.pageIndex]??{top:0,bottom:0},a=XT(r,e.pageIndex,i),o=xx(qT(r,e.pageIndex),{pageIndex:e.pageIndex,pageContentStartBlockPt:a.blockStartPt,pageContentEndBlockPt:a.blockEndPt});return{page:ZT(r,e.pageIndex,a),flow:o}},openParityBlankPage(e){let r=n(e.sectionOccurrenceId),i=KT(r,e.pageIndex),a=XT(r,e.pageIndex,t[e.pageIndex]??{top:0,bottom:0});return Vb({kind:`parity-blank`,pageIndex:e.pageIndex,physicalPage:YT(i,a),sectionOccurrenceId:r.sectionOccurrenceId,section:i,pageBorders:r.pageBordersAuthored?r.pageBorders:null})},openSamePageSectionRegion(e,t,r){let i=n(t.section.sectionOccurrenceId),a=e.accumulator.sectionRegions,o=a.at(-1);if(!o||!(`placement`in t))throw Error(`A same-page section requires explicit retained placement`);let s=Object.freeze({blockStartPt:e.accumulator.sectionRegions[0].blockStartPt,blockEndPt:o.blockEndPt}),c=t.placement===`same-page-block`?Object.freeze({...o,blockEndPt:r.regionStartBlockPt}):(()=>{let e=t.outgoingColumnSubset;if(!e||e.length===0)throw Error(`A same-page-column transition requires outgoing column ownership`);return Object.freeze({...o,columnIndexes:Object.freeze([...e]),columns:Object.freeze(e.map(e=>{let t=o.section.columns[e];if(!t)throw Error(`Missing outgoing authored column`);return Object.freeze({inlineStartPt:t.xPt,inlineExtentPt:t.wPt})}))})})(),l=Object.freeze([...a.slice(0,-1),c]);return Object.freeze({...e,accumulator:vv(Object.freeze({...e.accumulator,sectionRegions:l}),JT(i,r.pageIndex,s,r.regionStartBlockPt,t.columnSubset))})}}}function nE(e,t,n,r,i,a,o,s){let c=e.pages.at(-1);if(!c||c.kind!==`content`)throw Error(`Body content requires an active page`);let l=QT(e),u=l.columnIndexes??l.section.columns.map((e,t)=>t),d=l.columns[u.indexOf(e.flow.columnIndex)],f=tv(e.flow.pageIndex,l.id,e.flow.columnIndex),p=Gc(n,f,i);if(a.has(p))throw Error(`Duplicate body occurrence acceptance: ${p}`);a.add(p);let m=_x(t,{occurrenceId:p,destination:{coordinateSpace:`logical-page-points`,flowDomainId:f,translation:{xPt:s?s.xPt-t.flowBounds.xPt:t.kind===`table`?d.inlineStartPt:d.inlineStartPt-t.flowBounds.xPt,yPt:(s?.yPt??e.flow.cursorBlockPt)-t.flowBounds.yPt}}}),h=s?.sectionFlowOwnership===void 0?m:Object.freeze({...m,sectionFlowOwnership:s.sectionFlowOwnership}),g=s?.yPt??e.flow.cursorBlockPt,_=h.kind===`paragraph`&&h.ordinaryFlow?(()=>{let e=g+h.spacing.beforePt,t=g+r-h.spacing.afterPt;return Object.freeze({...h,flowBounds:Object.freeze({...h.flowBounds,yPt:e,heightPt:Math.max(0,t-e)})})})():h,v=s?.coordinateSpace===`upright-physical`?{..._,ordinaryFlow:!1,flowBounds:Object.freeze({..._.flowBounds,heightPt:r})}:_,y=Cx(e.flow,v,r),b=y.events[0];if(!b||b.type!==`place`)throw Error(`Flow placement did not emit an allocation`);o.push(Object.freeze({nodeId:v.id,flowDomainId:v.flowDomainId,blockStartPt:b.blockStartPt,blockEndPt:b.blockEndPt}));let x=yv(c.accumulator,{layer:`body`,node:v,...s?.coordinateSpace===`upright-physical`?{coordinateSpace:`upright-physical`}:{}},!0),S=[...e.pages];return S[S.length-1]=Object.freeze({...c,accumulator:x}),Object.freeze({...e,flow:y.state,pages:Object.freeze(S)})}function rE(e){return e.boundary===null?`root`:`paragraph:${e.boundary.segIndex}:${e.boundary.charOffset}`}function iE(e,t){for(let n=t;n<e.sequence.length;n+=1){let t=e.sequence[n];if(t.kind===`consume-source`)continue;if(t.kind===`authored-break`){if(t.break!==`lastRenderedPageBreak`)return!1;continue}if(t.kind===`begin-section`){if(t.section.startType!==`continuous`)return!1;continue}let r=t.kind===`adjacent-table-group`?t:t.block;if(r.kind!==`paragraph`)return!0;if(r.pageBreakBefore)return!1;if(r.inkless!==!0)return!0}return!1}function aE(e){return e.paragraphMark!==void 0&&e.lines.length===0&&e.shading===void 0&&e.borders.length===0&&e.resources.length===0&&e.drawings.length===0&&e.textBoxes.length===0}function oE(e){return[e.rowIndex,e.rowFragmentIndex,e.cells.map(e=>[e.blockIndex,e.paragraphLineStart,e.nestedFragmentIndex,e.nestedCursor===null?null:oE(e.nestedCursor)])]}function sE(e){if(e===void 0)return`root`;if(e.kind===`table`)return`table:${JSON.stringify(oE(e.cursor))}`;let t=e.cursor.tableCursor;return`adjacent-table:${e.cursor.tableIndex}:${e.cursor.sourceRowIndex}:${JSON.stringify(t===void 0?null:oE(t))}`}function cE(e,t){let n=e.cursorPt.yPt+t,r=e.availableBounds.yPt+e.availableBounds.heightPt;return Object.freeze({...e,cursorPt:Object.freeze({...e.cursorPt,yPt:n}),availableBounds:Object.freeze({...e.availableBounds,yPt:n,heightPt:Math.max(0,r-n)})})}function lE(e,t){let n=wT(e.pages.map(e=>e.accumulator)),r=0,i=null,a=e.pages.map(e=>{let a=t.get(e.accumulator.sectionOccurrenceId),o=a.sectionOccurrenceId!==i;a.sectionOccurrenceId!==i&&a.pageNumbering.start!==null?r=Em(a.pageNumbering.start,e.accumulator.pageIndex,n.get(a.sectionOccurrenceId)??e.accumulator.pageIndex):r+=1,i=a.sectionOccurrenceId;let s={displayNumber:r,format:a.pageNumbering.format??`decimal`,sectionOccurrenceId:a.sectionOccurrenceId};return e.kind===`parity-blank`?xv({pageIndex:e.accumulator.pageIndex,physicalPage:e.accumulator.physicalPage,sectionOccurrenceId:e.accumulator.sectionOccurrenceId,section:e.accumulator.section,pageBorders:e.accumulator.pageBorders,firstSectionOwnedPage:o,pageNumber:s}):bv(e.accumulator,s,o)}),o=new WeakSet;return{pages:a,diagnostics:a.flatMap(e=>E_(e).flatMap(({node:e})=>BT(e,o)))}}function uE(e,t,n,r,i,a){let o=Kg(t);if(!o)throw Error(`Body layout kernel is not attached to the supplied services`);let s=GT(e),c=new Set,l=[],u=r[0]??{top:0,bottom:0},d=XT(e.initialSection,0,u),f=Hb(xx(qT(e.initialSection,0),{pageContentStartBlockPt:d.blockStartPt,pageContentEndBlockPt:d.blockEndPt}),ZT(e.initialSection,0,d)),p=e=>{let t=a.get(e.flow.section.sectionOccurrenceId);return t?.pageIndex===e.flow.pageIndex?t.targetPt:null};f=Ub(f,p(f));let m=tE(s,r),h=null,g=o.openBodyLayoutSession({source:e.source,section:e.initialSection.context,initialLocation:eE(f)},t,n),_=e=>{let t=s.get(e.flow.section.sectionOccurrenceId);if(!t)throw Error(`Unknown body section ${e.flow.section.sectionOccurrenceId}`);let n=e.flow.pageIndex+1,i=XT(t,n,r[n]??{top:0,bottom:0});return i.blockEndPt-i.blockStartPt},v=(t,n)=>{if(i!==null){let e=eE(t);return Object.freeze([...i.values()].filter(t=>t.pageIndex===e.pageIndex&&t.flowDomainId===e.flowDomainId).map(({occurrenceId:e,paragraphSource:t})=>Object.freeze({occurrenceId:e,paragraphSource:t})))}let r=[];for(let t=n;t<e.sequence.length;t+=1){let i=e.sequence[t];if(i.kind===`authored-break`&&i.break!==`column`||i.kind===`begin-section`&&i.section.startType!==`continuous`)break;if(!(i.kind!==`body-block`||i.block.kind!==`paragraph`)){if(t>n&&i.block.pageBreakBefore)break;i.block.pageOwnedAnchorOccurrenceIds?.forEach(e=>r.push(Object.freeze({occurrenceId:e,paragraphSource:i.block.source})))}}return Object.freeze(r)},y=(e,t)=>{let n=v(e,t);if(n.length===0)return;if(!g.prescanPageAnchors)throw Error(`Page-owned anchors require canonical prescan acquisition`);let r=eE(e),i=g.prescanPageAnchors({anchors:n,location:r,availableInlineExtentPt:r.availableBounds.widthPt});i&&g.commitFlowRegistryDelta(i)};y(f,0);let b=(e,t,n=!1)=>{let r=f.flow.pageIndex,i=e.events.some(e=>e.type===`next-page`&&e.reason===`overflow`),a=e.events.some(e=>e.type===`begin-section`&&`placement`in e&&e.placement===`same-page-column`);f=Gb(f,e,m),f=Ub(f,p(f));let o=eE(f);f.flow.pageIndex===r?(g.moveAcquisitionCursor(o),a&&y(f,t)):(h=i&&n?t:null,g.resetPageAcquisition(o),y(f,t))},x=new Map,S=new Map,C=new Map,w=e=>(x.get(e)?.size??0)>0,T=(e,t,n)=>E(n??hT(e),t),E=(e,t)=>{let n=x.get(f.flow.pageIndex)??new Set,r=[...new Set(e)].filter(e=>!n.has(e)),i=eE(f);if(r.length>0&&!g.layoutNotes)throw Error(`Footnote layout requires a note-capable layout session`);let a=r.length===0?Object.freeze([]):g.layoutNotes({kind:`footnote`,referenceIds:Object.freeze(r),pageIndex:f.flow.pageIndex,section:i.section,container:{id:`notes:page:${f.flow.pageIndex}`,kind:`footnote`,bounds:{xPt:i.availableBounds.xPt,yPt:0,widthPt:t,heightPt:i.section.geometry.pageHeight}},firstOnPage:n.size===0});return Object.freeze({ids:Object.freeze(r),layouts:a,reservePt:a.reduce((e,t)=>e+t.advancePt,0)})},D=(e,t,n)=>{let r=x.get(f.flow.pageIndex);r||(r=new Set,x.set(f.flow.pageIndex,r)),e.forEach(e=>r.add(e));let i=C.get(f.flow.pageIndex)??[];i.push(...t),C.set(f.flow.pageIndex,i),S.set(f.flow.pageIndex,(S.get(f.flow.pageIndex)??0)+n),f=Wb(f,n)},O=()=>Math.max(0,$T(f)-f.footnoteReservePt-f.flow.deepestColumnBlockPt),k=e=>e>O(),A=null,j=$m(e.sequence);for(let t=0;t<e.sequence.length;t+=1){let n=e.sequence[t];if(n.kind===`consume-source`)continue;if(n.kind===`authored-break`){if(A=null,n.break===`column`&&!j.has(t))continue;b(Mx(f.flow,n.break,n.parity),t+1);continue}if(n.kind===`begin-section`){A=null;let e=P_(QT(f).section.textDirection),i=P_(KT(n.section,f.flow.pageIndex).textDirection),a=B_({widthPt:QT(f).section.geometry.pageWidth,heightPt:QT(f).section.geometry.pageHeight},e),o=KT(n.section,f.flow.pageIndex),s=B_({widthPt:o.geometry.pageWidth,heightPt:o.geometry.pageHeight},i),c=n.section.startType===`continuous`&&(e!==i||a.widthPt!==s.widthPt||a.heightPt!==s.heightPt)?`nextPage`:n.section.startType,l=XT(n.section,f.flow.pageIndex,r[f.flow.pageIndex]??{top:0,bottom:0});b(Nx(f.flow,qT(n.section,f.flow.pageIndex),c,{hasFootnoteReferenceOnCurrentPage:w(f.flow.pageIndex),incomingPageContentStartBlockPt:l.blockStartPt,incomingPageContentEndBlockPt:l.blockEndPt}),t+1);continue}let i=n.kind===`adjacent-table-group`?n:n.block;if(i.kind===`paragraph`){if(i.continuousSectionRole===`collapse-mark`)continue;i.pageBreakBefore&&b(Mx(f.flow,`pageBreakBefore`),t);let n=A?.spaceAfterPt??0,a=rC(A,i,n,i.continuousSectionRole===`suppress-before`?0:i.spaceBeforePt),o=i.continuousSectionRole===`drop-previous-after`?n:a.overlap;o>0&&(f=Object.freeze({...f,flow:Object.freeze({...f.flow,cursorBlockPt:Math.max(f.flow.regionStartBlockPt,f.flow.cursorBlockPt-o)})}));let s=Object.freeze({boundary:null});for(;s;){let n=rE(s),o=eE(f),u=g.measureParagraph({input:i,location:o,availableInlineExtentPt:o.availableBounds.widthPt,suppressSpaceBefore:s.boundary!==null||i.continuousSectionRole===`suppress-before`||a.suppressBefore||s.boundary===null&&!f.flow.pageHasContent&&h===t,continuation:s});if(u.placement){let e=T(u.layout,o.availableBounds.widthPt,u.retainedFootnoteReferenceIds),r=u.relocationBlockExtentPt,a=u.placement.sectionFlowOwnership===`page`?e.reservePt:(r??u.blockExtentPt)+e.reservePt,d=_(f),p=k(e.reservePt);if(VT(e.reservePt,a,d),(a>o.availableBounds.heightPt||p)&&a<=d&&f.flow.pageHasContent){b(p?kx(f.flow,f.flow.section,`overflow`):wx(f.flow,`overflow`),t);continue}f=nE(f,u.layout,i.source,u.blockExtentPt,n,c,l,u.placement),D(e.ids,e.layouts,e.reservePt),u.flowRegistryDelta&&g.commitFlowRegistryDelta(u.flowRegistryDelta),s=null,g.moveAcquisitionCursor(eE(f));continue}if(s.boundary===null&&i.keepNext&&f.flow.pageHasContent){let n=u.blockExtentPt,r=new Set(hT(u.layout)),a=!1,s=qm({keepNext:i.keepNext,inkless:i.inkless===!0,undecoratedMark:aE(u.layout)});for(let i=t+1;i<e.sequence.length;i+=1){let t=e.sequence[i];if(t.kind===`consume-source`)continue;if(t.kind===`authored-break`||t.kind===`begin-section`)break;let c=t.kind===`adjacent-table-group`?t:t.block;if(c.kind===`paragraph`&&c.pageBreakBefore)break;let l=g.measureFollowingBlock({input:c,location:o,availableInlineExtentPt:o.availableBounds.widthPt}),u=c.kind===`paragraph`&&(c.keepNext||s);if(s=!1,n+=u?l.fullExtentPt:l.leadContentExtentPt,(u?l.fullFootnoteReferenceIds:l.leadFootnoteReferenceIds)?.forEach(e=>r.add(e)),!u){a=!0;break}}let c=E([...r],o.availableBounds.widthPt).reservePt,l=n+c;if(a&&l>o.availableBounds.heightPt&&l<=_(f)){b(wx(f.flow,`overflow`),t,!0);continue}}let d=e.sequence[t+1],p=e.sequence[t+2],m=d?.kind===`body-block`&&d.block.kind===`paragraph`&&p?.kind===`authored-break`&&p.break===`page`&&p.sameSourceParagraphAsPrevious!==!0,v=Xm(u.layout);if(s.boundary===null&&v&&m&&f.flow.pageHasContent){let e=cE(o,u.blockExtentPt),n=g.measureParagraph({input:d.block,location:e,availableInlineExtentPt:e.availableBounds.widthPt,suppressSpaceBefore:!1,continuation:Object.freeze({boundary:null})});g.moveAcquisitionCursor(o);let r=Zm(n.layout,e.cursorPt.yPt);if(r!==null){let e=u.blockExtentPt+r;if(e>o.availableBounds.heightPt&&e<=_(f)){b(wx(f.flow,`overflow`),t);continue}}}let y=e.sequence[t+1],x=y?.kind===`authored-break`&&y.break===`page`;if(s.boundary===null&&x){let e=Qm(u.layout);if(e!==null){f=nE(f,e,i.source,0,n,c,l),u.flowRegistryDelta&&g.commitFlowRegistryDelta(u.flowRegistryDelta),s=null,g.moveAcquisitionCursor(eE(f));continue}}let S=T(u.layout,o.availableBounds.widthPt).reservePt,C=(r[f.flow.pageIndex]?.bottom??0)===0&&f.footnoteReservePt===0,w=$T(f)===QT(f).blockEndPt,O=Dm({hasContinuationBoundary:s.boundary!==null,inkless:i.inkless===!0,undecorated:aE(u.layout),keepNext:i.keepNext,markReservePt:S,pageBottomIsUnreserved:C,physicalRegionBottomIsActive:w,hasFollowingInk:iE(e,t+1),markBelowBaselinePt:u.markBelowBaselinePt??0}),A=sT(u.layout,s,u.lineEndBoundaries,o.availableBounds.heightPt+O,_(f),f.flow.pageHasContent,{keepLines:i.keepLines,widowControl:i.widowControl,authoredSpaceAfterPt:i.spaceAfterPt,writingMode:QT(f).writingMode},e=>T(e,o.availableBounds.widthPt).reservePt,u.uniformRubyAdvancePt,e=>!k(e));if(A.requiresFreshFlowRegion){b(wx(f.flow,`overflow`),t);continue}if(!A.fragment)throw Error(`Paragraph acquisition made no progress`);f=nE(f,A.fragment,i.source,Math.min(A.admittedBlockExtentPt,o.availableBounds.heightPt),n,c,l,u.placement);let j=T(A.fragment,o.availableBounds.widthPt);if(VT(j.reservePt,A.fragment.advancePt+j.reservePt,_(f)),D(j.ids,j.layouts,j.reservePt),u.flowRegistryDelta){let e=WT(u.flowRegistryDelta,A.fragment);e&&g.commitFlowRegistryDelta(e)}s=A.nextCursor,s&&b(wx(f.flow,`overflow`),t),o=eE(f),g.moveAcquisitionCursor(o)}A=i}else{A=null;let e,n=!1;for(;!n;){let r=sE(e),a=eE(f),o=t=>g.measureTable({input:i,location:a,availableInlineExtentPt:a.availableBounds.widthPt,availableBlockExtentPt:t,freshPageBlockExtentPt:_(f),...e?{cursor:e}:{}}),s=a.availableBounds.heightPt,u=o(s);if(u.retryAtBlockStartPt!==void 0){if(!Number.isFinite(u.retryAtBlockStartPt)||u.retryAtBlockStartPt<=f.flow.cursorBlockPt)throw Error(`Table repositioning must advance the block cursor`);f=Object.freeze({...f,flow:Object.freeze({...f.flow,cursorBlockPt:u.retryAtBlockStartPt})}),g.moveAcquisitionCursor(eE(f));continue}let d=u.requiresFreshFlowRegion?Object.freeze({ids:Object.freeze([]),layouts:Object.freeze([]),reservePt:0}):T(u.layout,a.availableBounds.widthPt),p=Object.freeze({reservePt:d.reservePt,chargePt:u.blockExtentPt+d.reservePt}),m=new Set;for(;!u.requiresFreshFlowRegion&&u.blockExtentPt+d.reservePt>a.availableBounds.heightPt;){let e=JSON.stringify({advancePt:u.blockExtentPt,nextCursor:u.nextCursor??null,noteIds:d.ids,reservePt:d.reservePt});if(m.has(e))throw VT(p.reservePt,p.chargePt,_(f)),Error(`Table footnote admission did not converge`);m.add(e),s=Math.max(0,a.availableBounds.heightPt-d.reservePt),u=o(s),d=u.requiresFreshFlowRegion?Object.freeze({ids:Object.freeze([]),layouts:Object.freeze([]),reservePt:0}):T(u.layout,a.availableBounds.widthPt),u.requiresFreshFlowRegion||(p=Object.freeze({reservePt:d.reservePt,chargePt:u.blockExtentPt+d.reservePt}))}if(u.requiresFreshFlowRegion){VT(p.reservePt,p.chargePt,_(f));let n=!f.flow.pageHasContent&&u.nextCursor?.kind===`table`&&u.nextCursor.floatingContinuationFrame===`fresh-text`&&!(e?.kind===`table`&&e.floatingContinuationFrame!==void 0);if(u.nextCursor?.kind===`table`&&u.nextCursor.floatingContinuationFrame!==void 0&&(e=u.nextCursor),n)continue;b(wx(f.flow,`overflow`),t);continue}if(k(d.reservePt)&&f.flow.pageHasContent){b(kx(f.flow,f.flow.section,`overflow`),t);continue}f=nE(f,u.layout,i.source,u.blockExtentPt,r,c,l,u.placement),D(d.ids,d.layouts,d.reservePt),u.flowRegistryDelta&&g.commitFlowRegistryDelta(UT(u.flowRegistryDelta,u.layout,Gc(i.source,a.flowDomainId,r))),e=u.nextCursor??void 0,n=e===void 0,e&&b(wx(f.flow,`overflow`),t)}}g.moveAcquisitionCursor(eE(f))}let M=new Set([...S.keys(),...C.keys()]);for(let e of M){let t=S.get(e)??0,n=(C.get(e)??[]).reduce((e,t)=>e+t.advancePt,0);if(t!==n)throw new Z(`INVALID_GEOMETRY`,`Page ${e} footnote reserve ${t} does not equal retained advance ${n}`)}return Object.freeze({layout:lE(f,s),session:g,allocations:Object.freeze(l),footnoteReserveByPage:S,footnoteLayoutsByPage:C})}function dE(e,t){return Object.freeze(e.layout.pages.map((n,r)=>{if(n.parityBlank||P_(n.section.textDirection)!==`horizontal-tb`)return Object.freeze({top:0,bottom:0});let i=t.get(n.sectionOccurrenceId);if(!i)throw Error(`Unknown body section ${n.sectionOccurrenceId}`);let a=Math.max(0,n.section.geometry.pageWidth-Math.abs(n.section.geometry.marginLeft)-Math.abs(n.section.geometry.marginRight)),o=t=>{let o=ET(t===`header`?i.headers:i.footers,{titlePage:i.titlePage,firstPageOfSection:TT(e.layout.pages,r),evenAndOddHeaders:i.evenAndOddHeaders,displayPageNumber:n.pageNumber.displayNumber});if(o===null)return 0;if(!e.session.layoutStory)throw Error(`Header/footer story layout requires a story-capable layout session`);return e.session.layoutStory({source:o,pageIndex:n.pageIndex,section:n.section,container:{id:`story:${t}:page:${n.pageIndex}`,kind:t,bounds:{xPt:Math.abs(n.section.geometry.marginLeft),yPt:0,widthPt:a,heightPt:n.section.geometry.pageHeight}}}).advancePt};return Object.freeze({top:OT(o(`header`),n.section.geometry.marginTop,n.section.geometry.headerDistance),bottom:OT(o(`footer`),n.section.geometry.marginBottom,n.section.geometry.footerDistance)})}))}function fE(e,t,n,r){let i=e.pages.map((i,a)=>{if(i.parityBlank)return i;let o=n.get(i.sectionOccurrenceId);if(!o)throw Error(`Unknown body section ${i.sectionOccurrenceId}`);if(!t.layoutStory){if(!(Object.values(o.headers).some(e=>e!==null)||Object.values(o.footers).some(e=>e!==null)||(r.get(i.pageIndex)?.length??0)>0))return i;throw Error(`Page-story composition requires a story-capable layout session`)}let s=P_(i.section.textDirection)!==`horizontal-tb`,c=s?Pm(i.section.geometry):i.section.geometry,l=Math.abs(c.marginLeft),u=Math.max(0,c.pageWidth-Math.abs(c.marginLeft)-Math.abs(c.marginRight)),d=s?`upright-physical`:`section-logical`,f=s?Object.freeze({...i.section,geometry:Object.freeze({...c}),columns:Object.freeze([Object.freeze({xPt:l,wPt:u})]),textDirection:`lrTb`}):i.section,p=t=>ET(t===`header`?o.headers:o.footers,{titlePage:o.titlePage,firstPageOfSection:TT(e.pages,a),evenAndOddHeaders:o.evenAndOddHeaders,displayPageNumber:i.pageNumber.displayNumber}),m=e=>{let n=p(e);if(n===null)return null;let r=t.layoutStory({source:n,pageIndex:i.pageIndex,section:f,container:{id:`story:${e}:page:${i.pageIndex}`,kind:e,bounds:{xPt:l,yPt:0,widthPt:u,heightPt:c.pageHeight}}});return IT(r,{xPt:0,yPt:(e===`header`?c.headerDistance:c.pageHeight-c.footerDistance-r.advancePt)-r.flowBounds.yPt})},h=m(`header`),g=m(`footer`),_=r.get(i.pageIndex)??[],v=_.reduce((e,t)=>e+t.advancePt,0),y=i.sectionRegions[0],b=(y?.blockEndPt??Math.max(0,i.section.geometry.pageHeight-Math.abs(i.section.geometry.marginBottom)))-v,x=b,S=_.map(e=>{let t=LT(e,{xPt:0,yPt:x-e.flowBounds.yPt});return x+=e.advancePt,t}),C=S.length===0?0:Math.min(...S.map(e=>e.flowBounds.xPt)),w=S.length===0?0:Math.max(...S.map(e=>e.flowBounds.xPt+e.flowBounds.widthPt)),T=Object.freeze({xPt:C,yPt:b,widthPt:w-C,heightPt:v}),E=y?Object.freeze(W_(y.coordinateSpace.logicalToPhysical,T)):T,D=[...h?[Object.freeze({id:`story:header:page:${i.pageIndex}`,kind:`header`,logicalBounds:Object.freeze({xPt:l,yPt:h.flowBounds.yPt,widthPt:u,heightPt:h.advancePt}),physicalBounds:Object.freeze({xPt:l,yPt:h.flowBounds.yPt,widthPt:u,heightPt:h.advancePt})})]:[],...S.length>0?[Object.freeze({id:`notes:page:${i.pageIndex}`,kind:`footnote`,...y?{sectionRegionId:y.id}:{},logicalBounds:T,physicalBounds:E})]:[],...g?[Object.freeze({id:`story:footer:page:${i.pageIndex}`,kind:`footer`,logicalBounds:Object.freeze({xPt:l,yPt:g.flowBounds.yPt,widthPt:u,heightPt:g.advancePt}),physicalBounds:Object.freeze({xPt:l,yPt:g.flowBounds.yPt,widthPt:u,heightPt:g.advancePt})})]:[]],O=i.layers.roots.map(e=>e),k=O.findIndex(e=>e.layer!==`background`&&e.layer!==`behindText`),A=k<0?O.length:k,j=[...O.slice(0,A),...h?.blocks.map(e=>({layer:`header`,node:e,coordinateSpace:d}))??[],...O.slice(A)],M=-1;for(let e=0;e<j.length;e+=1)j[e].layer===`body`&&(M=e);let N=M<0?j.length:M+1,ee=[...j.slice(0,N),...S.map(e=>({layer:`notes`,node:e,coordinateSpace:`section-logical`})),...j.slice(N),...g?.blocks.map(e=>({layer:`footer`,node:e,coordinateSpace:d}))??[]];return Object.freeze({...i,flowDomains:Object.freeze([...i.flowDomains,...D]),layers:w_(ee),readingOrder:Object.freeze([...h?.blocks.map(e=>e.id)??[],...i.readingOrder,...S.map(e=>e.id),...g?.blocks.map(e=>e.id)??[]])})});return Object.freeze({...e,pages:Object.freeze(i)})}function pE(e,t,n){if(n.length===0)return e;let r=-1;for(let t=e.pages.length-1;t>=0;--t)if(!e.pages[t].parityBlank){r=t;break}if(r<0)return e;let i=e.pages[r];if(!t.layoutNotes)return Object.freeze({...e,diagnostics:Object.freeze([...e.diagnostics,Object.freeze({code:`UNSUPPORTED_FEATURE`,severity:`error`,source:Object.freeze({story:`endnote`,storyInstance:n[0],path:Object.freeze([])}),message:`Document-end notes require a note-capable layout session`})])});let a=new Map(i.flowDomains.map(e=>[e.id,e])),o=i.layers.body.filter(e=>e.ordinaryFlow&&a.get(e.flowDomainId)?.kind===`body`).reduce((e,t)=>e===null||t.flowBounds.yPt+t.flowBounds.heightPt>e.flowBounds.yPt+e.flowBounds.heightPt?t:e,null),s=o?a.get(o.flowDomainId):[...i.flowDomains].reverse().find(e=>e.kind===`body`);if(!s)return Object.freeze({...e,diagnostics:Object.freeze([...e.diagnostics,Object.freeze({code:`UNSUPPORTED_FEATURE`,severity:`error`,message:`Document-end notes require a retained body flow domain`})])});let c=i.sectionRegions.find(e=>e.flowDomainIds.includes(s.id))??i.sectionRegions[0],l=o?o.flowBounds.yPt+o.flowBounds.heightPt:s.logicalBounds.yPt,u=i.layers.notes.filter(e=>e.kind===`note`&&e.source.story===`footnote`).reduce((e,t)=>Math.min(e,t.flowBounds.yPt),s.logicalBounds.yPt+s.logicalBounds.heightPt),d=Math.min(s.logicalBounds.yPt+s.logicalBounds.heightPt,u),f=`endnotes:page:${i.pageIndex}`;try{let a=t.layoutNotes({kind:`endnote`,referenceIds:Object.freeze([...n]),pageIndex:i.pageIndex,section:c?.section??i.section,container:{id:f,kind:`endnote`,bounds:{xPt:s.logicalBounds.xPt,yPt:l,widthPt:s.logicalBounds.widthPt,heightPt:Math.max(0,d-l)}},firstOnPage:!0});if(a.length===0)return e;let o=a.reduce((e,t)=>e+t.advancePt,0),u=Object.freeze({xPt:s.logicalBounds.xPt,yPt:l,widthPt:s.logicalBounds.widthPt,heightPt:o}),p=Object.freeze({id:f,kind:`endnote`,...c?{sectionRegionId:c.id}:{},logicalBounds:u,physicalBounds:c?Object.freeze(W_(c.coordinateSpace.logicalToPhysical,u)):u}),m=i.layers.roots.map(e=>e),h=-1;for(let e=0;e<m.length;e+=1)m[e].layer===`body`&&(h=e);h+=1,m.splice(h,0,...a.map(e=>({layer:`notes`,node:e,coordinateSpace:`section-logical`})));let g=new Set(i.layers.body.map(e=>e.id)),_=-1;for(let e=0;e<i.readingOrder.length;e+=1)g.has(i.readingOrder[e])&&(_=e);_+=1;let v=[...i.readingOrder];v.splice(_,0,...a.map(e=>e.id));let y=[...e.pages];return y[r]=Object.freeze({...i,flowDomains:Object.freeze([...i.flowDomains,p]),layers:w_(m),readingOrder:Object.freeze(v)}),Object.freeze({...e,pages:Object.freeze(y)})}catch(t){if(!(t instanceof zb)||t.kind!==`endnote`||t.pageIndex!==i.pageIndex||t.containerId!==f)throw t;return Object.freeze({...e,diagnostics:Object.freeze([...e.diagnostics,Object.freeze({code:`UNSUPPORTED_FEATURE`,severity:`error`,source:Object.freeze({story:`endnote`,storyInstance:n[0],path:Object.freeze([])}),message:`Document-end notes do not fit the retained terminal flow region: ${t instanceof Error?t.message:String(t)}`})])})}}function mE(e,t,n,r){return Object.freeze({...e,diagnostics:Object.freeze([...e.diagnostics,Object.freeze({code:`UNSUPPORTED_FEATURE`,severity:`error`,message:`Unsupported ${t} position ${JSON.stringify(n)}; retained layout uses the ${r} fallback`})])})}function hE(e){let t=new Map;for(let n of e.pages)for(let e of n.layers.body)if(e.kind===`paragraph`)for(let r of e.drawings){let i=r.anchorLayer;if(!i||i.horizontalOwnership!==`page`||i.verticalOwnership!==`page`)continue;let a=i.acquisitionOccurrenceId??i.occurrenceId;t.set(a,Object.freeze({occurrenceId:a,paragraphSource:e.source,pageIndex:n.pageIndex,flowDomainId:e.flowDomainId}))}return t}function gE(e){return JSON.stringify([...e].sort(([e],[t])=>e.localeCompare(t)))}function _E(e,t,n,r,i){if(!e.sequence.some(e=>e.kind===`body-block`&&e.block.kind===`paragraph`&&(e.block.pageOwnedAnchorOccurrenceIds?.length??0)>0))return uE(e,t,n,r,null,i);try{return Kd({step:a=>{let o=uE(e,t,n,r,a?.plan??null,i);return Object.freeze({pass:o,plan:hE(o.layout)})},stateOf:e=>gE(e.plan),limit:16}).value.pass}catch(e){throw e instanceof Gd?new Z(`NON_CONVERGENCE`,e.reason===`cycle`?`Page-anchor destination acquisition repeated an exact-state cycle`:`Page-anchor destination acquisition reached the operational pass limit 16`):e}}function vE(e){let t=[],n=e.initialSection;for(let r of e.sequence)r.kind===`begin-section`&&(r.section.startType===`continuous`&&t.push(Object.freeze({outgoingSectionOccurrenceId:n.sectionOccurrenceId,incomingSectionOccurrenceId:r.section.sectionOccurrenceId})),n=r.section);return Object.freeze(t)}function yE(e,t,n){for(let r of e.pages)for(let e=0;e+1<r.sectionRegions.length;e+=1){let i=r.sectionRegions[e],a=r.sectionRegions[e+1];if(i.sectionOccurrenceId===t&&a.sectionOccurrenceId===n)return Object.freeze({page:r,outgoing:i})}return null}function bE(e,t,n,r){let i=new Map,a=_E(e,t,n,r,i);for(let o of vE(e)){let s=yE(a.layout,o.outgoingSectionOccurrenceId,o.incomingSectionOccurrenceId);if(s===null||s.outgoing.flowDomainIds.length<2)continue;let c=s.page.pageIndex,l=xT(e,a.allocations,a.footnoteReserveByPage,s.page,s.outgoing),u=new Map(i);u.set(o.outgoingSectionOccurrenceId,Object.freeze({pageIndex:c,targetPt:l})),i=u,a=_E(e,t,n,r,i)}return a}function xE(e,t,n){t=n_(t);let r=GT(e),i=bE(e,t,n,[]),a=kT({seed:i,measure:e=>dE(e,r),repaginate:(r,i)=>{let a=iC(i.layout);return bE(e,i_(t,{totalPages:i.layout.pages.length,resolveDestinationPage:e=>a[e]}),n,r)},identity:e=>iC(e.layout),requiresConvergence:i.session.hasPaginationFields}).result,o=CT(a.layout,a.session,a.allocations),s=e.noteLayoutSettings??Object.freeze({footnotePosition:`pageBottom`,endnotePosition:`docEnd`}),c=fE(o,a.session,r,a.footnoteLayoutsByPage),l=c.pages.some(e=>e.layers.notes.some(e=>e.source.story===`footnote`))&&s.footnotePosition!==`pageBottom`?mE(c,`footnote`,s.footnotePosition,`pageBottom`):c,u=new Set(o.pages.flatMap(e=>e.layers.body.flatMap(e=>e.kind===`paragraph`||e.kind===`table`?gT(e):[]))),d=(e.endnoteIds??[]).filter(e=>u.has(e)),f=pE(l,a.session,d),p=d.length>0&&s.endnotePosition!==`docEnd`?mE(f,`endnote`,s.endnotePosition,`docEnd`):f,m=e.parserDiagnostics??[];return ry(m.length===0?p:Object.freeze({...p,diagnostics:Object.freeze([...m,...p.diagnostics])}))}function SE(e,t,n=j_(void 0,Date.now())){return xE(e,t,n)}function CE(e,t,n){if(Xg(e))return;let{model:r,input:i}=n();oy({model:r,services:e,defaultCurrentDateMs:t,buildLayout:t=>SE(i,e,t)})}function wE(e,t){switch(e){case`margin`:return{left:t.marginLeft,right:t.pageWidth-t.marginRight};case`page`:return{left:0,right:t.pageWidth};default:return{left:t.contentX,right:t.contentX+t.contentW}}}function TE(e,t,n,r){switch(e){case`margin`:return{start:r.marginTop,end:r.pageH-r.marginBottom};case`page`:return{start:0,end:r.pageH};default:return{start:t,end:t+n}}}function EE(e,t,n,r){switch(e){case`center`:return t+(n-t-r)/2;case`right`:case`outside`:return n-r;default:return t}}function DE(e,t,n){switch(e){case`center`:return t.start+(t.end-t.start-n)/2;case`bottom`:case`outside`:return t.end-n;default:return t.start}}function OE(e,t,n){return e+t<=n.end?e:Math.max(n.start,n.end-t)}function kE(e,t,n,r,i,a){let o=e.dropCap===`drop`||e.dropCap===`margin`,s=wE(e.hAnchor,t),c=TE(e.vAnchor,n,i,t),l=e.w==null?r:e.w,u;if(o)u=Math.max(1,e.lines)*a;else{let t=e.h??0;u=e.hRule===`exact`?t:e.hRule===`atLeast`?Math.max(t,i):i}let d;d=e.dropCap===`drop`?s.left:e.dropCap===`margin`?s.left-l:e.xAlign?EE(e.xAlign,s.left,s.right,l):s.left+(e.x??0);let f;f=o?c.start:e.yAlign&&e.vAnchor!==`text`?DE(e.yAlign,c,u):c.start+(e.y??0),(e.vAnchor===`page`||e.vAnchor===`margin`)&&(f=OE(f,u,c));let p=e.wrap===`around`||e.wrap===`auto`?e.hSpace:0,m=e.vSpace;return{x:d,y:f,w:l,h:u,exLeft:d-p,exRight:d+l+p,exTop:f-m,exBottom:f+u+m}}function AE(e,t){if(t.kind===`table`&&t.tableOverlap===void 0)throw Error(`Floating-table transport omitted tblOverlap`);let n=t.x,r=t.y;if(t.avoidOverlap){let i={occurrenceId:`display-moving-float`,paragraphId:t.paraId,bounds:{xPt:n,yPt:r,widthPt:t.w,heightPt:t.h},exclusionBounds:{xPt:n-t.dl,yPt:r-t.dt,widthPt:t.w+t.dl+t.dr,heightPt:t.h+t.dt+t.db}},a=rd({moving:t.kind===`table`?{...i,kind:`table`,tableOverlap:t.tableOverlap}:{...i,kind:t.kind===`frame`?`frame`:`drawingml`},blockers:e.floats.map(Zu),avoidance:t.kind===`table`?Ju(t.tableOverlap,t.paraId):Yu(t.allowOverlap??!0,t.paraId),rightBoundaryPt:e.pageWidth,overlapEpsilonPt:Ku,rightBoundarySlackPt:qu});n=a.bounds.xPt,r=a.bounds.yPt}let i={mode:t.mode,imageKey:t.imageKey,imageX:n,imageY:r,imageW:t.w,imageH:t.h,xLeft:n-t.dl,xRight:n+t.w+t.dr,yTop:r-t.dt,yBottom:r+t.h+t.db,side:t.side,distLeft:t.dl,distRight:t.dr,distTop:t.dt,distBottom:t.db,paraId:t.paraId},a=t.kind===`table`?{...i,kind:`table`,tableOverlap:t.tableOverlap}:{...i,kind:t.kind};return e.floats.push(a),a}function jE(e){return e.xPt+e.widthPt}function ME(e){return e.yPt+e.heightPt}function NE(e,t,n,r){return e===`center`?t+(n-t-r)/2:e===`right`||e===`outside`?n-r:t}function PE(e,t,n,r){return e===`center`?t+(n-t-r)/2:e===`bottom`||e===`outside`?n-r:t}function FE(e,t,n,r,i=!1){let a=e.horzSpecified?e.horzAnchor===`page`?t.page:e.horzAnchor===`margin`?t.margin:t.text:t.text,o=e.vertAnchor===`page`?t.page:e.vertAnchor===`margin`?t.margin:t.text,s=e.xAlign?NE(e.xAlign,a.xPt,jE(a),n):a.xPt+e.xPt,c=e.yAlign&&e.vertAnchor!==`text`?PE(e.yAlign,o.yPt,ME(o),r):o.yPt+e.yPt;return!i&&(e.vertAnchor===`page`||e.vertAnchor===`margin`)&&c+r>ME(o)&&(c=Math.max(o.yPt,ME(o)-r)),Object.freeze({x:s,y:c,w:n,h:r})}function IE(e,t,n,r){return FE(e,t,n,r)}function LE(e,t,n){let r=e.child.columnWidthsPt.reduce((e,t)=>e+t,0),i=e.child.advancePt,a=e.positioning,o=Object.freeze({xPt:t,yPt:n,widthPt:r,heightPt:i}),s=Object.freeze({xPt:t-a.leftFromTextPt,yPt:n-a.topFromTextPt,widthPt:r+a.leftFromTextPt+a.rightFromTextPt,heightPt:i+a.topFromTextPt+a.bottomFromTextPt});return Object.freeze({kind:`resolved-floating-table-placement`,occurrenceId:e.occurrenceId,xPt:t,yPt:n,bounds:o,exclusionBounds:s,overlap:e.overlap,child:e.child,source:e})}function RE(e,t){let n=e.child.columnWidthsPt.reduce((e,t)=>e+t,0),r=e.child.advancePt,i=IE(e.positioning,t,n,r),a=qb(e.positioning);return LE(e,a.x&&e.acquiredTextOffsetPt?t.text.xPt+e.acquiredTextOffsetPt.xPt:i.x,a.y&&e.acquiredTextOffsetPt?t.text.yPt+e.acquiredTextOffsetPt.yPt:i.y)}function zE(e,t,n){return Object.freeze({coordinateSpace:e.coordinateSpace,flowDomainId:e.flowDomainId,baseEntries:e.entries,baseNextParagraphId:e.nextParagraphId,nextParagraphId:n,entries:Object.freeze([...t])})}function BE(e,t){if(t.coordinateSpace!==e.coordinateSpace||t.flowDomainId!==e.flowDomainId||t.entries!==e.baseEntries||t.nextParagraphId!==e.baseNextParagraphId)throw Error(`Floating table registry delta base/domain mismatch`);let n=new Set(t.entries.map(e=>e.occurrenceId));if(e.entries.some(e=>n.has(e.occurrenceId)))throw Error(`Floating table registry delta was already committed`);if(e.nextParagraphId!==e.baseNextParagraphId+e.entries.length)throw Error(`Floating table registry delta sequence mismatch`)}function VE(e,t,n=`logical-page-points`,r=`logical-page`){let i=new Set;for(let t of e){if(i.has(t.occurrenceId))throw Error(`Duplicate float registry occurrence: ${t.occurrenceId}`);i.add(t.occurrenceId)}return Object.freeze({coordinateSpace:n,flowDomainId:r,base:Object.freeze([...e]),delta:Object.freeze([]),nextParagraphId:t})}function HE(e,t,n){let r=[...n.base,...n.delta],i=r.find(t=>t.occurrenceId===e.occurrenceId);if(i)return Object.freeze({placement:Object.freeze({...LE(e,i.bounds.xPt,i.bounds.yPt),bounds:i.bounds,exclusionBounds:i.exclusionBounds}),transaction:n});let a=RE(e,t),o=rd({moving:{occurrenceId:e.occurrenceId,kind:`table`,tableOverlap:e.overlap,paragraphId:n.nextParagraphId,bounds:a.bounds,exclusionBounds:a.exclusionBounds},blockers:r.filter(e=>e.kind!==`shape`||e.wrap!==void 0).map(Xu),avoidance:Ju(e.overlap,n.nextParagraphId),rightBoundaryPt:jE(t.page),overlapEpsilonPt:Ku,rightBoundarySlackPt:qu}),s=LE(e,o.bounds.xPt,o.bounds.yPt),c=Object.freeze({kind:`table`,occurrenceId:e.occurrenceId,overlap:e.overlap,paragraphId:n.nextParagraphId,bounds:s.bounds,exclusionBounds:s.exclusionBounds});return Object.freeze({placement:s,transaction:Object.freeze({coordinateSpace:n.coordinateSpace,flowDomainId:n.flowDomainId,base:n.base,delta:Object.freeze([...n.delta,c]),nextParagraphId:n.nextParagraphId+1})})}function UE(e,t,n){let r=n.pageWidth,i=n.marginLeft,a=n.marginRight;switch(e??(t?`margin`:`page`)){case`page`:return{start:0,end:r};case`leftMargin`:return{start:0,end:i};case`rightMargin`:return{start:r-a,end:r};case`insideMargin`:return{start:0,end:i};case`outsideMargin`:return{start:r-a,end:r};case`character`:case`column`:return{start:n.contentX,end:n.contentX+n.contentW};default:return{start:i,end:r-a}}}function WE(e,t,n,r){let i=r.marginTop,a=r.marginBottom;switch(e??(t?`paragraph`:`page`)){case`page`:return{start:0,end:r.pageH};case`topMargin`:return{start:0,end:i};case`bottomMargin`:return{start:r.pageH-a,end:r.pageH};case`paragraph`:case`line`:return{start:n,end:r.pageH};default:return{start:i,end:r.pageH-a}}}function GE(e,t,n,r,i,a,o,s){let c=UE(a,t,i);if(o!=null)return c.start+(c.end-c.start)*o+n;if(!e)return c.start+n;let l=c.end-c.start,u=s??r,d=s==null?0:n;switch(e){case`center`:return c.start+(l-u)/2+d;case`right`:case`outside`:return c.end-u+d;default:return c.start+d}}function KE(e,t,n,r,i,a,o,s,c){let l=WE(o,t,i,a);if(s!=null)return l.start+(l.end-l.start)*s+n;if(!e)return l.start+n;let u=l.end-l.start,d=c??r,f=c==null?0:n;switch(e){case`center`:return l.start+(u-d)/2+f;case`bottom`:case`outside`:return l.end-d+f;default:return l.start+f}}function qE(e){return JE(e.textDirection)}function JE(e){return typeof e==`string`&&Fm(e)}function YE(e){return e===`btLr`}function XE(e){return{...e,...Nm(e)}}function ZE(e){return{...e,...Pm(e)}}function QE(e){for(let t of e.body){if(t.type!==`paragraph`)continue;let e=t;if(typeof e.defaultFontSize==`number`)return e.defaultFontSize;for(let t of e.runs)if(t.type===`text`)return t.fontSize}return 10}function $E(e){return{pageIndex:e.pageIndex,totalPages:e.totalPages,displayPageNumber:e.displayPageNumber,pageNumberFormat:e.pageNumberFormat,currentDateMs:e.currentDateMs,noteNumbers:e.noteNumbers,noteReferenceNumber:e.noteReferenceNumber,pageWritingMode:P_(e.sectionLayout.textDirection),verticalCJK:e.verticalCJK&&!e.verticalAllRotated,verticalPageFrame:e.verticalCJK===!0,documentHasEastAsianText:e.docEastAsian,useFeLayout:e.layoutSettings.compat.useFeLayout,characterSpacingControl:e.layoutSettings.characterSpacingControl,resolvedLocalFonts:e.resolvedLocalFonts,layoutServices:e.layoutServices,verticalGlyphMeasurement:e.verticalGlyphMeasurement}}function eD(e,t){return{type:e.sectionLayout.grid.kind===`none`?null:e.sectionLayout.grid.kind,linePitchPt:t.lineGrid.active?t.lineGrid.pitchPt:null,charSpacePt:t.characterGrid.active?t.characterGrid.deltaPt:null}}const tD=Object.freeze({story:`body`,containers:Object.freeze([]),lineNumberingEligible:!0});function nD(e){let t=Math.max(0,e.pageH-e.marginTop-e.marginBottom);return{page:{xPt:0,yPt:0,widthPt:e.pageWidth,heightPt:e.pageH},margin:{xPt:e.marginLeft,yPt:e.marginTop,widthPt:Math.max(0,e.pageWidth-e.marginLeft-e.marginRight),heightPt:t},column:{xPt:e.contentX,yPt:e.marginTop,widthPt:e.contentW,heightPt:t},pageParity:e.pageIndex%2==0?`odd`:`even`}}function rD(e,t,n){return Vp(n,{numbering:t.numbering,...t.numbering?{markerInput:e.acquisitionInputs.numberingMarkerShapeInput(t.numbering,Pf(t))}:{},authoredFirstIndentPt:t.indentFirst,tabStops:t.tabStops,defaultTabPt:e.defaultTabPt,service:e.layoutServices?.text})}function iD(e,t){return rD(e,t,wm(e.layoutSettings,e.sectionLayout,tD,t))}function aD(e,t){return rD(e,t,wm(e.layoutSettings,e.sectionLayout,e.storyContext??tD,t))}function oD(e){return{...e,storyContext:pm(e.storyContext??tD)}}function sD(e,t){let n=e.retainedTablesBySourceIndex?.get(t);if(!n)throw Error(`Table placement requires retained table acquisition`);return n}function cD(e,t){if(t!==e.length-1||t===0)return!1;let n=e[t],r=e[t-1];return n?.type===`paragraph`&&r?.type===`table`&&n.runs.length===0}function lD(e,t){let{cell:n,table:r,cellTotalWidthPt:i,outerState:a,sourcePath:o}=e,s=t.resolveContentWidthPt(n,r,i),c=t.createCellState(a,s,n),l=[];for(let e=0;e<n.content.length;e+=1){let r=n.content[e];if(!r)continue;let i=[...o,e];if(r.type===`paragraph`){let a=n.content[e-1],o=n.content[e+1],u=r,d=t.acquireParagraph(c,u,s,i,im(a?.type===`paragraph`?a:null,u,o?.type===`paragraph`?o:null));l.push(d),t.advanceState(c,d.advancePt);continue}let a=r,u=r;l.push(t.acquireNestedTable(c,a,s,i,{fromPrevious:u.nestedSliceContinuesFromPrevious??!1,onNext:u.nestedSliceContinuesOnNext??!1},(e,n,r,i,a)=>lD({cell:e,table:n,cellTotalWidthPt:r,outerState:i,sourcePath:a},t)))}return l}function uD(e){return mh(e.style,e.width)}function dD(e){let t=fh.indexOf(e);return t===-1?fh.length:t}function fD(e){if(!e)return{r:0,g:0,b:0};let t=e.replace(/^#/,``);return t.length!==6||/[^0-9a-fA-F]/.test(t)?{r:0,g:0,b:0}:{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}function pD(e,t){let n=fD(e),r=fD(t),i=e=>e.r+e.b+2*e.g,a=e=>e.b+2*e.g,o=e=>e.g;for(let e of[i,a,o]){let t=e(n)-e(r);if(t!==0)return t}return 0}function mD(e,t){if(hh(e?.spec.style,t?.spec.style))return null;let n=e&&e.spec.style!==`none`?e:null,r=t&&t.spec.style!==`none`?t:null;if(!n&&!r)return null;if(!n)return r;if(!r||n.source===`cell`&&r.source===`table`)return n;if(r.source===`cell`&&n.source===`table`)return r;let i=uD(n.spec),a=uD(r.spec);if(i!==a)return i>a?n:r;let o=dD(n.spec.style),s=dD(r.spec.style);if(o!==s)return o<s?n:r;let c=pD(n.spec.color,r.spec.color);return c===0||c<0?n:r}function hD(...e){for(let t of e)if(t&&sh(t.authoredStyle))return t;return null}function gD(e){return Math.max(0,e.advancePt-e.spacing.beforePt-e.spacing.afterPt)}function _D(e){let t=[],n=0,r=null,i=0,a,o=0,s=null,c=null;for(let l of e){let e=l.layout;if(e.kind===`paragraph`){let u=e.spacing.beforePt,d=e.spacing.afterPt,f=r?nC(r,e,i,u):u,p=l.structuralTrailing?0:gD(e),m=n+(l.structuralTrailing?0:f);if(t.push({layout:e,offsetPt:m,advancePt:p}),l.structuralTrailing||(n=m+p,a??=m,o=Math.max(o,n),r=e,i=d),e.cellContainmentBounds){let t=m+e.cellContainmentBounds.yPt-e.flowBounds.yPt,n=t+e.cellContainmentBounds.heightPt;a=a===void 0?t:Math.min(a,t),o=Math.max(o,n),s=s===null?t:Math.min(s,t),c=c===null?n:Math.max(c,n)}continue}r&&(n+=i);let u=e.advancePt;t.push({layout:e,offsetPt:n,advancePt:u}),a??=n,n+=u,o=n,r=null,i=0}let l=n+(r?i:0),u=a??0;return{blocks:t,flowHeightPt:l,inkTopPt:u,inkHeightPt:Math.max(0,o-u),cellContainmentTopPt:s,cellContainmentBottomPt:c}}function vD(e){let t=e.cellContainmentTopPt??0,n=e.cellContainmentBottomPt??0;return Math.max(e.flowHeightPt,n)-Math.min(0,t)}function yD(e){return vD(_D(e))}function bD(e){return Number.isFinite(e?.cellSpacingPt)?Math.max(0,e?.cellSpacingPt??0):0}function xD(e,t){let n=bD(e[t]),r=bD(e[t-1]),i=bD(e[t+1]);return{topPt:t===0?n:Math.max(r,n)/2,bottomPt:t===e.length-1?n:Math.max(n,i)/2}}function SD(e,t,n){return n.topPt+e.margins.topPt+vD(t)+e.margins.bottomPt+n.bottomPt}function CD(e,t,n,r){let i=t;for(let a=t+1;a<e.length&&e[a]?.cells.find(e=>e.columnStart===n&&e.columnSpan===r&&e.verticalMerge===`continue`);a+=1)i=a;return i}function wD(e){return e.heightRule===`exact`?oh(e.heightPt,e.cells.map(e=>e.margins.bottomPt)):e.heightRule===`atLeast`?Math.max(0,e.heightPt??0):0}function TD(e,t){let n=e.map(e=>wD(e)),r=e.map((n,r)=>Math.max(0,...n.cells.filter(e=>e.verticalMerge!==`continue`).map(n=>{let i=n.verticalMerge===`restart`?CD(e,r,n.columnStart,n.columnSpan):r,a=xD(e,r),o=xD(e,i);return SD(n,t.get(n.id)??_D([]),{topPt:a.topPt,bottomPt:o.bottomPt})})));e.forEach((r,i)=>{let a=xD(e,i);for(let e of r.cells){if(e.verticalMerge!==`none`)continue;let o=SD(e,t.get(e.id)??_D([]),a);r.heightRule!==`exact`&&(n[i]=Math.max(n[i]??0,o))}});let i=[];e.forEach((n,r)=>{for(let a of n.cells)a.verticalMerge===`restart`&&i.push({start:r,end:CD(e,r,a.columnStart,a.columnSpan),requiredPt:SD(a,t.get(a.id)??_D([]),{topPt:xD(e,r).topPt,bottomPt:xD(e,CD(e,r,a.columnStart,a.columnSpan)).bottomPt})})}),i.sort((e,t)=>e.end-t.end||e.start-t.start);for(let t of i){let r=0;for(let e=t.start;e<=t.end;e+=1)r+=n[e]??0;let i=t.requiredPt-r;if(!(i<=0)){for(let r=t.end;r>=t.start;--r)if(e[r]?.heightRule!==`exact`){n[r]=(n[r]??0)+i;break}}}return{heights:n,contentHeights:r}}function ED(e,t){return e?{source:t,spec:{width:e.widthPt,color:e.color,style:e.authoredStyle}}:null}function DD(e,t,n,r,i,a,o,s){let c=(e,t,n,r,i,a,o)=>{let s=hD(e,o?t:null);return s?ED(s,`cell`):ED(o?hD(r,a):hD(n,i),`table`)},l=c(e.borders.top,e.borders.insideH,n?.top??null,n?.insideH??null,t.top,t.insideH,r!==0),u=c(e.borders.bottom,e.borders.insideH,n?.bottom??null,n?.insideH??null,t.bottom,t.insideH,i!==a-1),d=c(e.borders.left,e.borders.insideV,n?.left??null,n?.insideV??null,t.left,t.insideV,e.columnStart!==0),f=c(e.borders.right,e.borders.insideV,n?.right??null,n?.insideV??null,t.right,t.insideV,e.columnStart+e.columnSpan!==o);return s?{top:l,right:d,bottom:u,left:f}:{top:l,right:f,bottom:u,left:d}}function OD(e){return e?{widthPt:e.spec.width,color:e.spec.color??`#000000`,authoredStyle:e.spec.style}:null}function kD(e,t,n){let r=OD(mD(e,t));return r?{border:r,edge:n}:null}function AD(e){let t=e.columnWidthsPt.length,n=[],r=e.rows.map(()=>Array(t).fill(-1));return e.rows.forEach((i,a)=>{for(let o of i.cells){if(o.verticalMerge===`continue`)continue;let i=o.verticalMerge===`restart`?CD(e.rows,a,o.columnStart,o.columnSpan):a,s=n.length;n.push({input:o,rowIndex:a,lastRowIndex:i});let c=Math.min(t,o.columnStart+o.columnSpan);for(let e=a;e<=i;e+=1)for(let t=Math.max(0,o.columnStart);t<c;t+=1)r[e][t]=s}}),{owners:n,occupancy:r}}function jD(e){let t=e.rows.length,n=e.columnWidthsPt.length,{owners:r,occupancy:i}=AD(e),a=i=>{let a=r[i];return a?DD(a.input,e.borders,e.rows[a.rowIndex]?.exceptionBorders??null,a.rowIndex,a.lastRowIndex,t,n,e.bidiVisual):null};return{horizontal:Array.from({length:t+1},(e,o)=>Array.from({length:n},(e,n)=>{let s=o>0?i[o-1]?.[n]??-1:-1,c=o<t?i[o]?.[n]??-1:-1;if(s>=0&&s===c)return null;let l=a(s),u=a(c),d=o===0?`top`:o===t?`bottom`:`between`;return{above:{owner:r[s]??null,border:l?.bottom??null},below:{owner:r[c]??null,border:u?.top??null},edge:d}})),vertical:Array.from({length:n+1},(r,o)=>Array.from({length:t},(t,r)=>{let s=o>0?i[r]?.[o-1]??-1:-1,c=o<n?i[r]?.[o]??-1:-1,l=e.bidiVisual?c:s,u=e.bidiVisual?s:c;return l>=0&&l===u?null:kD(a(l)?.right??null,a(u)?.left??null,o===0?e.bidiVisual?`right`:`left`:o===n?e.bidiVisual?`left`:`right`:`between`)})),occupancy:i}}function MD(e,t,n){return{edge:e.edge,from:t,to:n,color:e.border.color,widthPt:e.border.widthPt,...Y_(e.border.authoredStyle,e.border.widthPt)}}const ND=Object.freeze({top:null,right:null,bottom:null,left:null,insideH:null,insideV:null});function PD(e){let t=OD(e);return t&&t.authoredStyle!==`nil`&&t.authoredStyle!==`none`?t:null}function FD(e,t,n,r,i){let a=[0];for(let t of e.columnWidthsPt)a.push((a.at(-1)??0)+t);let o=[0];for(let e of r)o.push((o.at(-1)??0)+e);let s=a.at(-1)??0,c=(n,r)=>(t[n]??0)+(e.bidiVisual?s-(a[r]??0):a[r]??0),l=e=>n+(o[e]??0),u=[],d=(e,t,n,r)=>{!e||e.authoredStyle===`nil`||e.authoredStyle===`none`||u.push(MD({border:e,edge:t},n,r))},f=new Set,p=(t,n,r,i)=>{let a=t.owner;if(!a)return;let o=`${n}:${r}:${a.input.id}`;if(f.has(o))return;f.add(o);let s=e.rows[a.rowIndex];if(!s)return;let u=bD(s),p=c(a.rowIndex,a.input.columnStart),m=c(a.rowIndex,Math.min(e.columnWidthsPt.length,a.input.columnStart+a.input.columnSpan)),{startPt:h,endPt:g}=vl(u,a.input.columnStart,a.input.columnSpan,e.columnWidthsPt.length),_=Math.min(p,m)+(e.bidiVisual?g:h),v=Math.max(p,m)-(e.bidiVisual?h:g),y=l(a.rowIndex)+xD(e.rows,a.rowIndex).topPt,b=l(a.lastRowIndex+1)-xD(e.rows,a.lastRowIndex).bottomPt,x=DD(a.input,ND,null,a.rowIndex,a.lastRowIndex,e.rows.length,e.columnWidthsPt.length,e.bidiVisual),S=r===`top`?x.top:x.bottom,C=r===`top`?y:b;d(PD(S),i,{xPt:_,yPt:C},{xPt:v,yPt:C})};return i.horizontal.forEach((n,r)=>{let a=r>0&&bD(e.rows[r-1])>0,o=r<e.rows.length&&bD(e.rows[r])>0;if(a||o){let a=Math.max(bD(e.rows[r-1]),bD(e.rows[r])),u=o?r:r-1,f=t[u]??0,m=r===0?`top`:r===e.rows.length?`bottom`:`between`;r===0||r===e.rows.length?d(hD(r===0?e.rows[0]?.exceptionBorders?.top??null:e.rows.at(-1)?.exceptionBorders?.bottom??null,r===0?e.borders.top:e.borders.bottom),m,{xPt:f,yPt:l(r)},{xPt:f+s,yPt:l(r)}):n.forEach((t,n)=>{let o=i.occupancy[r-1]?.[n]??-1,s=i.occupancy[r]?.[n]??-1;if(!t||!(o!==s&&(o>=0||s>=0))||[{side:t.above,directEdge:`bottom`},{side:t.below,directEdge:`top`}].some(({side:e,directEdge:t})=>{let n=e.owner;return n?lh({spacingPt:a,directStyle:n.input.borders[t]?.authoredStyle,conditionalInsideStyle:n.input.borders.insideH?.authoredStyle}):!1}))return;let f=c(u,n),p=c(u,n+1),h=hD(e.rows[r-1]?.exceptionBorders?.insideH??null,e.borders.insideH),g=hD(e.rows[r]?.exceptionBorders?.insideH??null,e.borders.insideH);d(kD(ED(h,`table`),ED(g,`table`),m)?.border??null,m,{xPt:Math.min(f,p),yPt:l(r)},{xPt:Math.max(f,p),yPt:l(r)})}),n.forEach(e=>{e&&(p(e.above,r,`bottom`,e.edge),p(e.below,r,`top`,e.edge))});return}let f=[],m=new Map;n.forEach(t=>{if(!t)return;let n=(t,n)=>{if(!n.owner||!n.border)return;let r=`${t}:${n.owner.input.id}`;if(m.has(r))return;let i=c(n.owner.rowIndex,n.owner.input.columnStart),a=c(n.owner.rowIndex,Math.min(e.columnWidthsPt.length,n.owner.input.columnStart+n.owner.input.columnSpan));m.set(r,{side:t,border:n.border,leftPt:Math.min(i,a),rightPt:Math.max(i,a)})};n(`above`,t.above),n(`below`,t.below)});let h=[...m.values()],g=[...new Set(h.flatMap(e=>[e.leftPt,e.rightPt]))].sort((e,t)=>e-t),_=r===0?`top`:r===e.rows.length?`bottom`:`between`;for(let e=1;e<g.length;e+=1){let t=g[e-1]??0,n=g[e]??t;if(n<=t)continue;let r=(t+n)/2,i=h.filter(e=>r>e.leftPt&&r<e.rightPt),a=kD(i.find(e=>e.side===`above`)?.border??null,i.find(e=>e.side===`below`)?.border??null,_);a&&f.push({resolved:a,leftPt:t,rightPt:n})}f.sort((e,t)=>e.leftPt-t.leftPt);let v=[];for(let e of f){let t=v.at(-1);t&&t.rightPt===e.leftPt&&t.resolved.edge===e.resolved.edge&&t.resolved.border.widthPt===e.resolved.border.widthPt&&t.resolved.border.color===e.resolved.border.color&&t.resolved.border.authoredStyle===e.resolved.border.authoredStyle?t.rightPt=e.rightPt:v.push({...e})}for(let e of v)u.push(MD(e.resolved,{xPt:e.leftPt,yPt:l(r)},{xPt:e.rightPt,yPt:l(r)}))}),i.vertical.forEach((t,n)=>{t.forEach((t,r)=>{bD(e.rows[r])>0||t&&u.push(MD(t,{xPt:c(r,n),yPt:l(r)},{xPt:c(r,n),yPt:l(r+1)}))})}),e.rows.forEach((n,r)=>{let a=bD(n);if(a<=0)return;let o=l(r),u=l(r+1),f=t[r]??0;d(hD(n.exceptionBorders?.left??null,e.borders.left),`left`,{xPt:f,yPt:o},{xPt:f,yPt:u}),d(hD(n.exceptionBorders?.right??null,e.borders.right),`right`,{xPt:f+s,yPt:o},{xPt:f+s,yPt:u});let p=new Set;for(let e of n.cells)lh({spacingPt:a,directStyle:e.borders.left?.authoredStyle,conditionalInsideStyle:e.borders.insideV?.authoredStyle})&&p.add(e.columnStart),lh({spacingPt:a,directStyle:e.borders.right?.authoredStyle,conditionalInsideStyle:e.borders.insideV?.authoredStyle})&&p.add(e.columnStart+e.columnSpan);for(let t=1;t<e.columnWidthsPt.length;t+=1){let a=i.occupancy[r]?.[t-1]??-1,s=i.occupancy[r]?.[t]??-1;if(!(a!==s&&(a>=0||s>=0)))continue;let l=c(r,t);p.has(t)||d(hD(n.exceptionBorders?.insideV??null,e.borders.insideV),`between`,{xPt:l,yPt:o},{xPt:l,yPt:u})}for(let t of n.cells){if(t.verticalMerge===`continue`)continue;let n=t.verticalMerge===`restart`?CD(e.rows,r,t.columnStart,t.columnSpan):r,i=c(r,t.columnStart),o=c(r,Math.min(e.columnWidthsPt.length,t.columnStart+t.columnSpan)),{startPt:s,endPt:u}=vl(a,t.columnStart,t.columnSpan,e.columnWidthsPt.length),f=Math.min(i,o)+(e.bidiVisual?u:s),p=Math.max(i,o)-(e.bidiVisual?s:u),m=l(r)+xD(e.rows,r).topPt,h=l(n+1)-xD(e.rows,n).bottomPt,g=DD(t,ND,null,r,n,e.rows.length,e.columnWidthsPt.length,e.bidiVisual);d(PD(g.right),`right`,{xPt:p,yPt:m},{xPt:p,yPt:h}),d(PD(g.left),`left`,{xPt:f,yPt:m},{xPt:f,yPt:h})}}),u}function ID(e,t,n,r,i){let a=r.availableBounds,o=e===`center`?a.xPt+(a.widthPt-i)/2:e===`right`?a.xPt+a.widthPt-i:a.xPt;return t===0?o:ch(o,t,n)}function LD(e,t){if(t.length===0)return e;let n=Math.min(e.xPt,...t.map(e=>Math.min(e.from.xPt,e.to.xPt)-e.widthPt/2)),r=Math.min(e.yPt,...t.map(e=>Math.min(e.from.yPt,e.to.yPt)-e.widthPt/2)),i=Math.max(e.xPt+e.widthPt,...t.map(e=>Math.max(e.from.xPt,e.to.xPt)+e.widthPt/2)),a=Math.max(e.yPt+e.heightPt,...t.map(e=>Math.max(e.from.yPt,e.to.yPt)+e.widthPt/2));return{xPt:n,yPt:r,widthPt:i-n,heightPt:a-r}}function RD(e,t){let n=Math.max(e.xPt,t.xPt),r=Math.max(e.yPt,t.yPt),i=Math.min(e.xPt+e.widthPt,t.xPt+t.widthPt),a=Math.min(e.yPt+e.heightPt,t.yPt+t.heightPt);return i>n&&a>r?{xPt:n,yPt:r,widthPt:i-n,heightPt:a-r}:null}function zD(e,t,n){let r=e.layout,i=t+(r.kind===`table`?r.flowBounds.xPt:0),a=n+e.offsetPt+(r.kind===`table`?r.flowBounds.yPt:0),o=i-r.flowBounds.xPt,s=a-r.flowBounds.yPt;return{xPt:r.inkBounds.xPt+o,yPt:r.inkBounds.yPt+s,widthPt:r.inkBounds.widthPt,heightPt:r.inkBounds.heightPt}}function BD(e,t,n){let r=Zc(e,`TableLayoutInput`);if(r.columnWidthsPt.some(e=>!Number.isFinite(e)||e<0))throw TypeError(`TableLayoutInput.columnWidthsPt must contain finite non-negative widths`);let i=new Map;r.rows.forEach(e=>e.cells.forEach(e=>{i.set(e.id,_D(e.verticalMerge===`continue`?[]:e.blocks))}));let a=jD(r),o=TD(r.rows,i),s=o.heights,c=r.columnWidthsPt.reduce((e,t)=>e+t,0),l=s.reduce((e,t)=>e+t,0),u=t.cursor.yPt,d=r.rows.map(e=>ID(e.alignment??r.alignment,Number.isFinite(e.indentPt)?e.indentPt:r.indentPt,r.bidiVisual,t,c)),f=d[0]??ID(r.alignment,r.indentPt,r.bidiVisual,t,c),p=FD(r,d,u,s,a),m=[0];for(let e of r.columnWidthsPt)m.push((m.at(-1)??0)+e);let h=[0];for(let e of s)h.push((h.at(-1)??0)+e);let g=(e,t)=>(d[e]??f)+(r.bidiVisual?c-(m[t]??0):m[t]??0),_=r.rows.map((e,n)=>{let a=u+(h[n]??0),l=s[n]??0,p=d[n]??f,m=xD(r.rows,n),_=bD(e),v=e.cells.map(e=>{let o=e.verticalMerge===`restart`?CD(r.rows,n,e.columnStart,e.columnSpan):n,s=xD(r.rows,o),c=u+(h[o+1]??h[n+1]??0)-s.bottomPt,d=g(n,e.columnStart),f=g(n,Math.min(r.columnWidthsPt.length,e.columnStart+e.columnSpan)),p=Math.min(d,f),v=Math.max(d,f),{startPt:y,endPt:b}=vl(_,e.columnStart,e.columnSpan,r.columnWidthsPt.length),x=p+(r.bidiVisual?b:y),S=v-(r.bidiVisual?y:b),C=Math.max(0,S-x),w=a+m.topPt,T=e.verticalMerge===`restart`?Math.max(0,c-w):Math.max(0,l-m.topPt-m.bottomPt),E=i.get(e.id)??_D([]),D=Math.max(0,T-e.margins.topPt-e.margins.bottomPt),O=e.margins.topPt-Math.min(0,E.inkTopPt),k=E.inkHeightPt>=D?O:e.vAlign===`center`?e.margins.topPt+(D-E.inkHeightPt)/2-E.inkTopPt:e.vAlign===`bottom`?T-e.margins.bottomPt-E.inkHeightPt-E.inkTopPt:O,A={xPt:x+e.margins.leftPt,yPt:w+k,widthPt:Math.max(0,C-e.margins.leftPt-e.margins.rightPt),heightPt:D},j={xPt:x,yPt:w,widthPt:C,heightPt:T},M=e.verticalMerge!==`continue`&&r.rows.slice(n,o+1).every(e=>e.heightRule===`exact`)?uh(j,t.availableBounds):void 0,N=e.verticalMerge===`continue`?[]:E.blocks.map(e=>({...e,offsetPt:k+e.offsetPt})),ee=Sv([j,...N.map(e=>zD(e,A.xPt,j.yPt)).map(e=>M?RD(e,M):e).filter(e=>e!==null)])??j;return{kind:`table-cell`,id:e.id,source:e.source,flowDomainId:r.flowDomainId,ordinaryFlow:r.ordinaryFlow,flowBounds:j,inkBounds:ee,...M?{clipBounds:M}:{},contentBounds:A,advancePt:T,verticalMerge:e.verticalMerge,vAlign:e.vAlign,...e.background?{background:e.background}:{},blocks:N}}),y={xPt:p,yPt:a,widthPt:c,heightPt:l},b=Sv([y,...v.map(e=>e.inkBounds)])??y;return{kind:`table-row`,id:e.id,source:e.source,flowDomainId:r.flowDomainId,ordinaryFlow:r.ordinaryFlow,flowBounds:y,inkBounds:b,advancePt:l,heightPt:l,contentHeightPt:o.contentHeights[n]??0,...e.repeatedHeader?{repeatedHeader:!0}:{},cells:v}}),v=d.length>0?Math.min(...d):f,y=d.length>0?Math.max(...d.map(e=>e+c)):f+c,b={xPt:v,yPt:u,widthPt:Math.max(0,y-v),heightPt:l},x=Sv([b,..._.map(e=>e.inkBounds)])??b;return Zc({layout:{kind:`table`,id:r.id,source:r.source,flowDomainId:r.flowDomainId,ordinaryFlow:r.ordinaryFlow,flowBounds:b,inkBounds:LD(x,p),advancePt:l,columnWidthsPt:r.columnWidthsPt,rows:_,borders:p},nextCursor:{xPt:t.cursor.xPt,yPt:t.cursor.yPt+l}},`TableLayoutResult`)}function VD(e,t){let n=e.findIndex((e,n)=>n>t&&e.type===`paragraph`&&e.framePr==null);if(n<0)throw Error(`A nested floating table requires a following regular paragraph anchor`);return n}function HD(e){if(!e)return null;let t=e.color??`000000`;return Object.freeze({widthPt:e.width,color:t.startsWith(`#`)?t:`#${t}`,authoredStyle:e.style})}function UD(e){return Object.freeze({top:HD(e.top),right:HD(e.right),bottom:HD(e.bottom),left:HD(e.left),insideH:HD(e.insideH),insideV:HD(e.insideV)})}function WD(e,t){if(e===`center`)return`center`;let n=e===`right`||e===`end`;return(t?!n:n)?`right`:`left`}function GD(e){return e.lines.some(e=>e.placements.some(e=>e.kind===`text`&&e.dependency===`page`))}function KD(e,t,n,r,i,a){let o=Array.isArray(i)?{story:`body`,storyInstance:`body`,path:i}:i,s=o.path,c=e=>({story:o.story,storyInstance:o.storyInstance,path:e}),l=a.layoutServices(r);if(!l)throw Error(`Retained table acquisition requires layout services`);let u=o.story===`body`&&o.storyInstance===`body`?`table:${s.join(`.`)}`:`${o.story}:${o.storyInstance}:table:${s.join(`.`)}`,d=a.tableFormat(e),f=e.bidiVisual===!0,p=d.firstRowException,m=p?.indentAuthored?p.indentPt??0:e.tblInd??0,h={},g=[],_=e.rows.map((n,i)=>{let o=d.rows[i],l=Math.max(0,Math.min(t.length,n.gridBefore??0)),p=n.cells.map((n,d)=>{let f=o?.cells[d]?.marginsPt??{top:n.marginTop??e.cellMarginTop,right:n.marginRight??e.cellMarginRight,bottom:n.marginBottom??e.cellMarginBottom,left:n.marginLeft??e.cellMarginLeft},p=l,m=Math.min(Math.max(1,n.colSpan),Math.max(0,t.length-p));l+=m;let _=t.slice(p,p+m).reduce((e,t)=>e+t,0),v=vl(o?.cellSpacingPt??0,p,m,t.length),y=[...s,i,d],b=`${u}:cell:${i}.${d}`,x=n.vMerge===!1?[]:lD({cell:n,table:e,cellTotalWidthPt:_,outerState:r,sourcePath:y},{resolveContentWidthPt:(e,t,n)=>Math.max(0,n-v.startPt-v.endPt-f.left-f.right),createCellState:a.createCellState,acquireParagraph:(e,t,n,r,o)=>a.acquireParagraph(e,t,n,r,`${u}:cell:${i}.${d}`,o,void 0,c(r)),acquireNestedTable:(e,t,r,i)=>{let o=KD(t,a.resolveColumns(t,r,e),r,e,c(i),a);h[o.layout.id]=o;let s=a.tableFormat(t).positioning;if(s){let r=i[i.length-1],c=s,l=t.overlap===`never`?`never`:`overlap`,u=a.registerFloatingTable(e,{child:o.layout,positioning:c,overlap:l}),d={hostCellId:b,sourceBlockIndex:r,anchorBlockIndex:VD(n.content,r),tableId:o.layout.id,overlap:l,positioning:c,...u==null?{}:{acquiredTextOffsetPt:Object.freeze({...u})}};g.push(d)}return o.layout},advanceState:a.advanceState});return{id:b,source:c(y),columnStart:p,columnSpan:m,verticalMerge:n.vMerge===!0?`restart`:n.vMerge===!1?`continue`:`none`,margins:{topPt:f.top,rightPt:f.right,bottomPt:f.bottom,leftPt:f.left},vAlign:n.vAlign,...n.background?{background:{color:n.background.startsWith(`#`)?n.background:`#${n.background}`}}:{},borders:UD(n.borders),blocks:x.flatMap((e,t)=>{let r=n.content[t];return r?.type===`table`&&a.tableFormat(r).ordinaryFlow===!1?[]:[{layout:e,sourceBlockIndex:t,...e.kind===`paragraph`&&GD(e)?{pageDependent:!0}:{},...cD(n.content,t)?{structuralTrailing:!0}:{}}]})}}),_=o?.height?.rule??`auto`;return{id:`${u}:row:${i}`,source:c([...s,i]),logicalRowIndex:i,cantSplit:o?.cantSplit??n.cantSplit===!0,heightPt:o?.height?.valuePt??null,heightRule:_,cellSpacingPt:o?.cellSpacingPt??0,exceptionBorders:o?.exception?.borders?UD(o.exception.borders):null,alignment:WD(o?.justification??e.jc,f),indentPt:m,cells:p,repeatedHeader:o?.repeatedHeader??n.isHeader===!0}}),v=Zc({kind:`table`,id:u,source:c([...s]),flowDomainId:u,ordinaryFlow:d.ordinaryFlow,alignment:WD(e.jc,f),indentPt:m,bidiVisual:f,columnWidthsPt:t,borders:UD(e.borders),rows:_},`RetainedTableAcquisition.input`),y={xPt:0,yPt:0,widthPt:n,heightPt:1},b=BD(v,{container:{id:u,kind:`tableCell`,bounds:y},cursor:{xPt:0,yPt:0},availableBounds:y},l).layout;return Object.freeze({input:v,layout:b,nestedById:Object.freeze(h),floatingTables:Zc(g,`RetainedTableAcquisition.floatingTables`)})}function qD(e,t,n){return t===n?e:Object.freeze({...e,left:e.right,right:e.left})}function JD(e,t,n){let r=qD(e.borders,e.bidiVisual,n),i=t.exceptionBorders==null?null:qD(t.exceptionBorders,e.bidiVisual,n);return i?Object.freeze({top:hD(i.top,r.top),right:hD(i.right,r.right),bottom:hD(i.bottom,r.bottom),left:hD(i.left,r.left),insideH:hD(i.insideH,r.insideH),insideV:hD(i.insideV,r.insideV)}):r}var YD=class{nodes=[Object.freeze({kind:`zero`})];interned=new Map([[`Z`,0]]);intern(e,t){let n=this.interned.get(e);if(n!==void 0)return n;let r=this.nodes.length;return this.nodes.push(Object.freeze(t)),this.interned.set(e,r),r}token(e,t){return this.intern(`T:${e}:${t}`,{kind:`token`})}add(e,t){if(e===0)return t;if(t===0)return e;let n=this.nodes[e],r=this.nodes[t];return n.kind===`sub`&&n.right===t?n.left:r.kind===`sub`&&r.right===e?r.left:this.intern(`A:${e}:${t}`,{kind:`add`,left:e,right:t})}subtract(e,t){if(e===t)return 0;if(t===0)return e;let n=this.nodes[t];return n.kind===`sub`&&n.left===e?n.right:this.intern(`S:${e}:${t}`,{kind:`sub`,left:e,right:t})}divide(e,t){return e===0?0:this.intern(`D:${e}:${t}`,{kind:`div`,value:e,divisor:t})}};function XD(e,t=0){return Object.freeze({position:e,sym:t,identity:`${e}|${t}`})}function ZD(e,t,n){return XD(fl(t.position,n.position),e.add(t.sym,n.sym))}function QD(e,t,n){return XD(ml(t.position,n.position),e.subtract(t.sym,n.sym))}function $D(e,t,n){return XD(hl(t.position,n),e.divide(t.sym,n))}function eO(e,t,n){let r=[XD(`0/1`)];return t.columnWidthsPt.forEach((i,a)=>{let o=t.columnWidthKeys?.[a],s=cl(i)??`0/1`,c=o===null?XD(s,e.token(n,a)):XD(o??s);r.push(ZD(e,r.at(-1),c))}),Object.freeze(r)}function tO(e,t,n,r){let i=QD(e,r,n);return t.alignment===`right`?i:t.alignment===`center`?$D(e,i,2n):XD(`0/1`)}function nO(e,t,n,r,i){return ZD(e,i,r?QD(e,n,t):t)}function rO(e,t){if(e.length===0)throw RangeError(`Adjacent table group id must not be empty`);if(t.length===0)throw RangeError(`Adjacent table group requires at least one table`);if(t.some(e=>!e.ordinaryFlow))throw Error(`An absolutely positioned table cannot join an adjacent table group`);let n=t[0],r=n.bidiVisual,i=new YD,a=XD(`0/1`),o=t.map((e,t)=>eO(i,e,t)),s=o.map(e=>e.at(-1)??a),c=s.reduce((e,t)=>gl(t.position,e.position)>0?t:e,a),l=(e,t,n,a)=>{let o=nO(i,e,t,n,a);return r?QD(i,c,o):o},u=[];t.forEach((e,t)=>{let n=o[t],a=s[t],d=e.bidiVisual!==r;e.rows.forEach(t=>{let r=tO(i,t,a,c),o=n.map(t=>l(t,a,e.bidiVisual,r));u.push({input:e,row:t,groupBoundaries:o,descending:d})})});let d=new Map;for(let e of[a,c])d.set(e.identity,{boundary:e,count:1});for(let e of u){let t=new Map;for(let n of e.groupBoundaries){let e=t.get(n.identity);t.set(n.identity,{boundary:n,count:(e?.count??0)+1})}for(let[e,n]of t){let t=d.get(e);n.count>(t?.count??0)&&d.set(e,n)}}let f=new Map,p=e=>{let t=f.get(e);return t||(t={position:e,identities:new Map,edges:new Map,firstSeen:new Map},f.set(e,t)),t};for(let[e,t]of d)p(t.boundary.position).identities.set(e,t);let m=0;for(let e of u){let t=e.descending?[...e.groupBoundaries].reverse():e.groupBoundaries,n=null,r=null;for(let e of t){let t=p(e.position);if(t.firstSeen.has(e.identity)||t.firstSeen.set(e.identity,m++),n!==e.position&&(n=e.position,r=null),r!==null&&r!==e.identity){let n=t.edges.get(r);n||(n=new Set,t.edges.set(r,n)),n.add(e.identity)}r=e.identity}}for(let e of f.values())for(let t of e.identities.keys())e.firstSeen.has(t)||e.firstSeen.set(t,m++);let h=[...f.values()].sort((e,t)=>gl(e.position,t.position)),g=[],_=new Map;for(let e of h){let t=new Map([...e.identities.keys()].map(e=>[e,0]));for(let n of e.edges.values())for(let e of n)t.set(e,(t.get(e)??0)+1);let n=[],r=t=>{n.push(t);let r=n.length-1;for(;r>0;){let t=Math.floor((r-1)/2);if(e.firstSeen.get(n[t])<=e.firstSeen.get(n[r]))break;[n[t],n[r]]=[n[r],n[t]],r=t}},i=()=>{let t=n[0],r=n.pop();if(n.length>0){n[0]=r;let t=0;for(;;){let r=t*2+1,i=r+1;if(r>=n.length)break;let a=r;if(i<n.length&&e.firstSeen.get(n[i])<e.firstSeen.get(n[r])&&(a=i),e.firstSeen.get(n[t])<=e.firstSeen.get(n[a]))break;[n[t],n[a]]=[n[a],n[t]],t=a}}return t};for(let n of e.identities.keys())t.get(n)===0&&r(n);let a=[];for(;n.length>0;){let n=i();a.push(n);for(let i of e.edges.get(n)??[]){let e=t.get(i)-1;t.set(i,e),e===0&&r(i)}}if(a.length!==e.identities.size)throw Error(`Adjacent table symbolic boundary ordering cycle at ${e.position}`);for(let t of a){let{boundary:n,count:r}=e.identities.get(t);_.set(t,g.length);for(let e=0;e<r;e+=1)g.push(n)}}let v=g.slice(1).map((e,t)=>{let n=g[t];return e.sym===n.sym?ml(e.position,n.position):null}),y=g.slice(1).map((e,t)=>dl(ml(e.position,g[t].position))),b=(e,t)=>{let n=new Map,r=Array(e.length);return e.forEach((e,i)=>{let a=n.get(e.identity)??0;n.set(e.identity,a+1);let o=_.get(e.identity),s=d.get(e.identity).count;r[i]=t?o+(s-1-a):o+a}),r},x=0,S=u.map(e=>{let{input:t,row:n,groupBoundaries:i,descending:a}=e,o=b(i,a),s=o[0],c=o[i.length-1],l=n.cells.map(e=>{let n=o[e.columnStart],i=o[e.columnStart+e.columnSpan];if(n==null||i==null)throw RangeError(`Table cell ${e.id} exceeds its authored grid`);let a=Math.min(n,i),s=Math.max(n,i);if(s<=a)throw Error(`Table cell ${e.id} cannot be mapped into the logical group grid`);let c=qD(e.borders,t.bidiVisual,r);return Object.freeze({...e,columnStart:a,columnSpan:s-a,borders:c})});return Object.freeze({...n,logicalRowIndex:x++,exceptionBorders:null,sourceTableEdges:JD(t,n,r),indentPt:t.bidiVisual===r?n.indentPt:-n.indentPt,sourceOuterColumnStart:Math.min(s,c),sourceOuterColumnEnd:Math.max(s,c),cells:Object.freeze(l)})});return i.nodes.length,Object.freeze({kind:`adjacent-table-group-grid`,id:e,source:n.source,flowDomainId:`${n.flowDomainId}:adjacent-group:${e}`,alignment:n.alignment,indentPt:n.indentPt,bidiVisual:r,columnWidthsPt:Object.freeze(y),columnWidthKeys:Object.freeze(v),rows:Object.freeze(S)})}const iO=1e-4;function aO(){return Object.freeze({blockIndex:0,paragraphLineStart:0,nestedCursor:null,nestedFragmentIndex:0})}function oO(){return Object.freeze({rowIndex:0,rowFragmentIndex:0,cells:Object.freeze([])})}function sO(e){let t=0;for(;e.rows[t]?.repeatedHeader===!0;)t+=1;return t}function cO(e,t){let n=e.layout.rows[t];return n?e.input.rows[t]?.heightRule===`exact`?Math.max(0,n.heightPt):Math.max(0,n.heightPt,n.contentHeightPt):0}function lO(e,t,n,r){if(t===e.input.rows[n])return cO(e,n);let i=BD({...e.input,id:`${e.input.id}:row-occurrence:${r.page.occurrenceId}:${t.logicalRowIndex}`,rows:[t]},r.placement,r.services).layout;return Math.max(0,i.rows[0]?.heightPt??i.advancePt)}function uO(e,t,n,r){return t===e.input.rows[n]?Math.max(0,e.layout.rows[n]?.heightPt??0):lO(e,t,n,r)}function dO(e,t,n,r){let i=BD({...e.input,id:`${e.input.id}:completed-partial:${r.page.occurrenceId}:${t.logicalRowIndex}`,rows:[t,...e.input.rows.slice(n+1)]},r.placement,r.services).layout;return Math.max(0,i.rows[0]?.heightPt??0)}function fO(e){return e.cells.map(e=>e.blocks.map(e=>({kind:`whole`,blockIndex:e.sourceBlockIndex})))}function pO(e,t,n,r){let i=r.reacquirePageDependentBlock;return!i||!t.cells.some(e=>e.blocks.some(e=>e.pageDependent===!0))?t:{...t,cells:t.cells.map((e,a)=>({...e,blocks:e.blocks.map(e=>e.pageDependent===!0?{...e,layout:i({logicalRowIndex:t.logicalRowIndex,logicalCellIndex:a,sourceBlockIndex:e.sourceBlockIndex,ownership:n,page:r.page,acquired:e.layout})}:e)}))}}function mO(e){let t=e.positioning.horzSpecified&&(e.positioning.horzAnchor===`page`||e.positioning.horzAnchor===`margin`),n=e.positioning.vertAnchor===`page`||e.positioning.vertAnchor===`margin`;return t||n}function hO(e,t,n,r,i){return{...t,heightPt:null,heightRule:`auto`,cells:t.cells.map((t,a)=>{let o=n.cells[a]??aO();return{...t,blocks:t.blocks.slice(o.blockIndex).map((n,a)=>{if(a===0&&o.nestedCursor&&n.layout.kind===`table`){let a=e.nestedById[n.layout.id];if(a){let e=DO(a,o.nestedCursor,{...r,availableHeightPt:r.freshPageHeightPt,placement:{...r.placement,availableBounds:{...r.placement.availableBounds,heightPt:r.freshPageHeightPt}}}),s=i.get(t.id);if(e.nextCursor&&s!==void 0&&n.sourceBlockIndex<s)throw Error(`Floating table anchor cannot follow an incomplete nested-table candidate`);if(e.fragment)return{...n,layout:e.fragment}}}return a!==0||o.paragraphLineStart===0||n.layout.kind!==`paragraph`?n:{...n,layout:SO(n.layout,o.paragraphLineStart,n.layout.lines.length)}})}})}}function gO(e,t,n,r,i,a,o,s,c){let l=i.floatingTableFrames,u=i.reacquirePageDependentBlock,d=e.input.rows[t.logicalRowIndex];if(!l||!u||!d)return{row:t,resolved:[],registry:a,nextParagraphId:o};let f=e.floatingTables.filter(e=>d.cells.some(t=>t.id===e.hostCellId)&&c(e));if(f.length===0)return{row:t,resolved:[],registry:a,nextParagraphId:o};let p=new Map;for(let e of f)p.set(e.hostCellId,Math.min(p.get(e.hostCellId)??1/0,e.anchorBlockIndex));let m={...i.placement,cursor:{...i.placement.cursor,yPt:i.placement.cursor.yPt+r}},h=hO(e,t,s,i,p),g=BD({...e.input,id:`${e.input.id}:float-probe:${i.page.occurrenceId}:${t.logicalRowIndex}`,rows:[h]},m,i.services).layout,_=i.finalPlacementTranslationPt??{xPt:0,yPt:0},v=(t,r,a)=>{let o=a.cells.findIndex(e=>e.id===t.hostCellId),s=r.rows[0]?.cells[o],c=a.cells[o]?.blocks.findIndex(e=>e.sourceBlockIndex===t.anchorBlockIndex)??-1,l=c<0?void 0:s?.blocks[c],u=e.nestedById[t.tableId]?.layout;return!s||!l||!u?null:Object.freeze({kind:`floating-table-placement`,occurrenceId:[i.page.occurrenceId,t.hostCellId,t.sourceBlockIndex,t.tableId].join(`:`),ownership:n,physicalPageIndex:i.page.physicalPageIndex,displayPageNumber:i.page.displayPageNumber,...t,columnBounds:Object.freeze({xPt:s.contentBounds.xPt+_.xPt,yPt:s.contentBounds.yPt+_.yPt,widthPt:s.contentBounds.widthPt,heightPt:s.contentBounds.heightPt}),anchorBounds:Object.freeze({xPt:s.contentBounds.xPt+_.xPt,yPt:s.flowBounds.yPt+l.offsetPt+_.yPt,widthPt:l.layout.flowBounds.widthPt,heightPt:l.layout.flowBounds.heightPt}),child:u})},y=n=>{let r=hO(e,n,s,i,p),c=n===t?g:BD({...e.input,id:`${e.input.id}:float-converge:${i.page.occurrenceId}:${t.logicalRowIndex}`,rows:[r]},m,i.services).layout,u=VE(a,o,i.floatingTableRegistry?.coordinateSpace??`logical-page-points`,i.floatingTableRegistry?.flowDomainId??e.input.flowDomainId),d=[];for(let e of f){let t=v(e,c,r);if(!t||i.floatingTableRegistry?.coordinateSpace!==`upright-physical-page-points`&&!mO(t))continue;let n=HE(t,{page:l.page,margin:l.margin,text:{xPt:t.columnBounds?.xPt??t.anchorBounds.xPt,yPt:t.anchorBounds.yPt,widthPt:t.columnBounds?.widthPt??t.anchorBounds.widthPt,heightPt:t.anchorBounds.heightPt}},u);d.push(n.placement),u=n.transaction}return{resolved:Object.freeze(d),transaction:u}},b=e=>({...t,cells:t.cells.map((r,a)=>({...r,blocks:r.blocks.map(o=>{let s=e.filter(e=>e.source.hostCellId===r.id&&e.source.anchorBlockIndex===o.sourceBlockIndex).map(e=>Object.freeze({xPt:e.exclusionBounds.xPt-e.source.anchorBounds.xPt,yPt:e.exclusionBounds.yPt-e.source.anchorBounds.yPt,widthPt:e.exclusionBounds.widthPt,heightPt:e.exclusionBounds.heightPt}));return s.length===0||o.layout.kind!==`paragraph`?o:{...o,layout:u({logicalRowIndex:t.logicalRowIndex,logicalCellIndex:a,sourceBlockIndex:o.sourceBlockIndex,ownership:n,page:i.page,acquired:o.layout,floatingTableExclusions:Object.freeze(s)})}})}))}),x=(e,t)=>JSON.stringify({blocks:e.cells.map(e=>e.blocks.map(e=>({sourceBlockIndex:e.sourceBlockIndex,layout:e.layout}))),placements:t}),S=y(t);if(S.resolved.length===0)return{row:t,resolved:[],registry:a,nextParagraphId:o};try{let e=Kd({seedState:x(t,S.resolved),step:e=>{let t=b(e?.resolution.resolved??S.resolved),n=y(t);return Object.freeze({candidate:t,resolution:n,state:x(t,n.resolved)})},stateOf:e=>e.state,limit:16}).value;return{row:e.candidate,resolved:e.resolution.resolved,registry:Object.freeze([...e.resolution.transaction.base,...e.resolution.transaction.delta]),nextParagraphId:e.resolution.transaction.nextParagraphId}}catch(e){throw e instanceof Gd?new Z(`NON_CONVERGENCE`,`floating table final-frame reflow did not converge (${e.reason}; ${e.states.length} states)`):e}}function _O(e,t,n){let r=e.input.rows[t.logicalRowIndex]?.cells.findIndex(e=>e.id===n.hostCellId)??-1;return r>=0&&(t.ranges[r]?.some(e=>e.blockIndex===n.anchorBlockIndex&&(e.kind===`whole`||e.kind===`paragraph`&&e.lineStart===0||e.kind===`nested-table`&&e.childFragmentIndex===0))??!1)}function vO(e){return`${e.hostCellId}:${e.sourceBlockIndex}:${e.tableId}`}function yO(e,t){return new Set(e.floatingTables.filter(n=>_O(e,t,n)).map(vO))}function bO(e,t){return e.size===t.size&&[...e].every(e=>t.has(e))}function xO(e,t,n=0,r=!1,i=[]){return{input:e,logicalRowIndex:e.logicalRowIndex,fragmentIndex:n,ownership:t,ranges:fO(e),...r?{clipAtPageEnd:!0}:{},...i.length?{resolvedFloatingTables:i}:{}}}function SO(e,t,n){return aT(e,{lineStart:t,lineEnd:n,continuesFromPrevious:t>0,continuesOnNext:n<e.lines.length})}function CO(e,t,n,r,i){let a=null,o=n;for(let s=n+1;s<=e.lines.length;s+=1){let c=SO(e,n,s),l={layout:c,sourceBlockIndex:t};if(yD([...r,l])>i+iO)break;a=c,o=s}return a?{block:{layout:a,sourceBlockIndex:t},range:{kind:`paragraph`,blockIndex:t,lineStart:n,lineEnd:o},lineEnd:o,advancePt:a.advancePt}:{block:null,range:null,lineEnd:n,advancePt:0}}function wO(e,t,n,r,i){if(t.verticalMerge===`continue`)return{input:t,range:[],next:n,complete:!0};let a=[],o=[],s=n.blockIndex,c=n.paragraphLineStart,l=n.nestedCursor,u=n.nestedFragmentIndex;for(;s<t.blocks.length;){let n=t.blocks[s],d=n.layout;if(d.kind===`paragraph`){if(n.structuralTrailing){a.push(n),o.push({kind:`whole`,blockIndex:n.sourceBlockIndex}),s+=1,c=0;continue}if(d.lines.length===0){if(yD([...a,n])>r+iO)break;a.push(n),o.push({kind:`whole`,blockIndex:n.sourceBlockIndex}),s+=1,c=0;continue}let e=CO(d,n.sourceBlockIndex,c,a,r);if(!e.block||!e.range)break;if(a.push({...e.block,...n.structuralTrailing?{structuralTrailing:!0}:{}}),o.push(e.range),e.lineEnd<d.lines.length){c=e.lineEnd;break}s+=1,c=0;continue}let f=e.nestedById[d.id];if(f){let e=Math.max(0,r-yD(a)),t=DO(f,l??oO(),{...i,availableHeightPt:e,placement:{...i.placement,availableBounds:{...i.placement.availableBounds,heightPt:e}}});if(!t.fragment)break;if(a.push({layout:t.fragment,sourceBlockIndex:n.sourceBlockIndex}),o.push({kind:`nested-table`,blockIndex:n.sourceBlockIndex,childFragmentIndex:u}),t.nextCursor){l=t.nextCursor,u+=1;break}s+=1,l=null,u=0;continue}if(yD([...a,n])>r+iO)break;a.push(n),o.push({kind:`whole`,blockIndex:n.sourceBlockIndex}),s+=1}let d=s>=t.blocks.length;return{input:{...t,blocks:a},range:o,next:Object.freeze({blockIndex:s,paragraphLineStart:c,nestedCursor:l,nestedFragmentIndex:u}),complete:d}}function TO(e,t,n,r,i){let a=t.cells.map((e,t)=>n.cells[t]??aO()),o=Math.max(0,...t.cells.map(e=>e.margins.topPt+e.margins.bottomPt)),s=Math.max(0,t.cellSpacingPt)*2,c=Math.max(0,r-o-s),l=t.cells.map((t,n)=>wO(e,t,a[n],c,i));if(!l.some((e,t)=>e.next.blockIndex!==a[t]?.blockIndex||e.next.paragraphLineStart!==a[t]?.paragraphLineStart||e.next.nestedFragmentIndex!==a[t]?.nestedFragmentIndex))return{selected:null,next:n,complete:!1};let u=l.every(e=>e.complete);return u&&n.rowFragmentIndex===0?{selected:xO(t,`source`),next:Object.freeze({rowIndex:n.rowIndex+1,rowFragmentIndex:0,cells:Object.freeze([])}),complete:!0}:{selected:{input:{...t,id:`${t.id}:fragment:${n.rowFragmentIndex}`,heightPt:null,heightRule:`auto`,cells:l.map((e,t)=>({...e.input,id:`${e.input.id}:fragment:${n.rowFragmentIndex}:${t}`}))},logicalRowIndex:t.logicalRowIndex,fragmentIndex:n.rowFragmentIndex,ownership:`source`,ranges:l.map(e=>e.range)},next:Object.freeze({rowIndex:u?n.rowIndex+1:n.rowIndex,rowFragmentIndex:u?0:n.rowFragmentIndex+1,cells:Object.freeze(u?[]:l.map(e=>e.next))}),complete:u}}function EO(e,t,n){let r=BD({...e.input,id:`${e.input.id}:fragment:${n.page.occurrenceId}`,rows:t.map(e=>e.input)},n.placement,n.services).layout,i=r.rows.map((e,r)=>{let i=t[r];return Object.freeze({...e,logicalRowIndex:i.logicalRowIndex,fragmentIndex:i.fragmentIndex,ownership:i.ownership,occurrenceId:n.page.occurrenceId,physicalPageIndex:n.page.physicalPageIndex,displayPageNumber:n.page.displayPageNumber,cells:Object.freeze(e.cells.map((e,n)=>{let a=i.input.cells[n]?.verticalMerge??`none`,o=i.input.cells[n],s=a===`continue`&&t.slice(0,r).some(e=>e.input.cells.some(e=>e.verticalMerge===`restart`&&e.columnStart===o?.columnStart&&e.columnSpan===o?.columnSpan));return Object.freeze({...e,contentRanges:Object.freeze([...i.ranges[n]??[]]),...a===`continue`&&!s?{visualMergeOwnership:`continuation`}:{}})}))})}),a=t.flatMap((t,r)=>{let a=e.input.rows[t.logicalRowIndex];return a?e.floatingTables.flatMap(o=>{let s=a.cells.findIndex(e=>e.id===o.hostCellId);if(s<0||!(t.ranges[s]?.some(e=>e.blockIndex===o.anchorBlockIndex&&(e.kind===`whole`||e.kind===`paragraph`&&e.lineStart===0))??!1))return[];let c=t.input.cells[s],l=i[r]?.cells[s],u=c?.blocks.findIndex(e=>e.sourceBlockIndex===o.anchorBlockIndex)??-1,d=u<0?void 0:l?.blocks[u],f=e.nestedById[o.tableId]?.layout;if(!l||!d||!f)throw Error(`Floating table occurrence references missing retained layout data`);let p=Object.freeze({xPt:l.contentBounds.xPt,yPt:l.flowBounds.yPt+d.offsetPt,widthPt:d.layout.flowBounds.widthPt,heightPt:d.layout.flowBounds.heightPt});return[Object.freeze({kind:`floating-table-placement`,occurrenceId:[n.page.occurrenceId,o.hostCellId,o.sourceBlockIndex,o.tableId].join(`:`),ownership:t.ownership,physicalPageIndex:n.page.physicalPageIndex,displayPageNumber:n.page.displayPageNumber,...o,anchorBounds:p,child:f})]}):[]}),o=Object.freeze(t.flatMap(e=>e.resolvedFloatingTables??[])),s=new Set(o.map(e=>e.occurrenceId)),c=t.some(e=>e.clipAtPageEnd===!0),l=c?Math.min(r.advancePt,n.availableHeightPt):r.advancePt,u=c?{...r.flowBounds,heightPt:l}:r.flowBounds;return Object.freeze({...r,flowBounds:u,...c?{inkBounds:u,clipBounds:u,advancePt:l}:{},columnWidthsPt:e.layout.columnWidthsPt,rows:Object.freeze(i),floatingTables:Object.freeze(a.filter(e=>!s.has(e.occurrenceId))),resolvedFloatingTables:o,...n.floatingTableRegistry?{resolvedFloatingTableCoordinateSpace:n.floatingTableRegistry.coordinateSpace}:{}})}function DO(e,t,n){if(t.rowIndex>=e.input.rows.length)return{fragment:null,nextCursor:null,requiresFreshPage:!1};let r=[],i=n.floatingTableRegistry;if(i&&i.flowDomainId.length===0)throw Error(`Floating table registry coordinate/domain mismatch`);let a=Object.freeze([...i?.entries??[]]),o=i?.nextParagraphId??0,s=Math.max(0,n.availableHeightPt),c=sO(e.input);if(t.rowIndex>=c&&t.rowIndex>0&&c>0)for(let i=0;i<c;i+=1){let c=gO(e,pO(e,e.input.rows[i],`repeated-header`,n),`repeated-header`,n.availableHeightPt-s,n,a,o,oO(),()=>!0),l=c.row,u=lO(e,l,i,n);if(u>s+iO)return{fragment:null,nextCursor:t,requiresFreshPage:!0};r.push(xO(l,`repeated-header`,0,!1,c.resolved)),a=c.registry,o=c.nextParagraphId,s-=u}let l=t,u=t.rowIndex,d=t.rowFragmentIndex===0&&t.cells.length===0&&e.layout.rows.slice(t.rowIndex).reduce((e,t)=>e+Math.max(0,t.heightPt),0)<=s+iO,f=!1;for(;u<e.input.rows.length;){let i=`source`,c=pO(e,e.input.rows[u],i,n),p=u===t.rowIndex?t:Object.freeze({rowIndex:u,rowFragmentIndex:0,cells:Object.freeze([])}),m=u!==t.rowIndex||t.rowFragmentIndex===0,h=m?gO(e,c,i,n.availableHeightPt-s,n,a,o,p,e=>{let t=c.cells.findIndex(t=>t.id===e.hostCellId),n=c.cells[t]?.blocks.findIndex(t=>t.sourceBlockIndex===e.anchorBlockIndex)??-1;if(n<0)return!1;let r=p.cells[t]??aO();return r.blockIndex<n||r.blockIndex===n&&r.paragraphLineStart===0}):{row:c,resolved:Object.freeze([]),registry:a,nextParagraphId:o},g=h.row,_=d||f?uO(e,g,u,n):lO(e,g,u,n);if(m&&_<=s+iO){r.push(xO(g,`source`,0,!1,h.resolved)),a=h.registry,o=h.nextParagraphId,s-=_,u+=1,l=u<e.input.rows.length?Object.freeze({rowIndex:u,rowFragmentIndex:0,cells:Object.freeze([])}):null;continue}if(g.cantSplit){if(r.some(e=>e.ownership===`source`))break;if(_+(n.availableHeightPt-s)<=n.freshPageHeightPt+iO||n.availableHeightPt+iO<n.freshPageHeightPt)return{fragment:null,nextCursor:t,requiresFreshPage:!0};if(dh({compatibility:n.compatibility,availableHeightPt:n.availableHeightPt,freshPageHeightPt:n.freshPageHeightPt,epsilonPt:iO})){r.push(xO(g,`source`,0,!0,h.resolved)),a=h.registry,o=h.nextParagraphId,l=u+1<e.input.rows.length?Object.freeze({rowIndex:u+1,rowFragmentIndex:0,cells:Object.freeze([])}):null;break}}if(n.oversizedRowPolicy===`atomic`&&r.every(e=>e.ownership===`repeated-header`)&&n.availableHeightPt+iO>=n.freshPageHeightPt&&_>n.freshPageHeightPt+iO){r.push(xO(g,`source`,0,!1,h.resolved)),a=h.registry,o=h.nextParagraphId,l=u+1<e.input.rows.length?Object.freeze({rowIndex:u+1,rowFragmentIndex:0,cells:Object.freeze([])}):null;break}let v=TO(e,c,p,s,n),y=null,b=new Set;for(;v.selected;){let t=yO(e,v.selected),r=JSON.stringify([...t].sort());if(b.has(r))throw Error(`Floating table selected ownership did not converge`);b.add(r),y=gO(e,c,i,n.availableHeightPt-s,n,a,o,p,e=>t.has(vO(e)));let l=TO(e,y.row,p,s,n);if(!l.selected){v=l;break}let u=yO(e,l.selected);if(v=l,bO(t,u))break;y=null}if(v.selected&&y===null)throw Error(`Floating table selected ownership did not converge`);if(v.selected){let t=y?.resolved??[];if(t.some(t=>!_O(e,v.selected,t.source)))throw Error(`Floating table transaction included an unowned occurrence`);let i=a.length,c=(y?.registry??a).slice(i);if(r.push({...v.selected,...t.length?{resolvedFloatingTables:Object.freeze(t)}:{}}),a=Object.freeze([...a,...c]),o+=c.length,l=v.next.rowIndex>=e.input.rows.length?null:v.next,v.complete&&v.next.rowIndex<e.input.rows.length){s=Math.max(0,s-dO(e,v.selected.input,u,n)),f=!0,u=v.next.rowIndex;continue}}break}if(r.filter(e=>e.ownership===`source`).length===0){if(!(n.availableHeightPt+iO<n.freshPageHeightPt))throw new Z(`NON_CONVERGENCE`,`Table pagination cannot advance from a fresh page`);return{fragment:null,nextCursor:t,requiresFreshPage:!0}}let p=EO(e,r,n);for(;p.advancePt>n.availableHeightPt+iO;){let t=r.at(-1),i=r.filter(e=>e.ownership===`source`).length;if(!(t?.ownership===`source`&&t.fragmentIndex===0&&t.ranges.every(e=>e.every(e=>e.kind===`whole`)))||i<=1)break;r.pop(),l=Object.freeze({rowIndex:t.logicalRowIndex,rowFragmentIndex:0,cells:Object.freeze([])}),p=EO(e,r,n)}return p.advancePt>n.availableHeightPt+iO&&n.availableHeightPt+iO<n.freshPageHeightPt&&p.advancePt<=n.freshPageHeightPt+iO?{fragment:null,nextCursor:t,requiresFreshPage:!0}:{fragment:p,nextCursor:l,requiresFreshPage:!1,floatingTablePlacements:p.resolvedFloatingTables,...i?{floatingTableRegistryDelta:(()=>{let e=a.slice(i.entries.length).filter(e=>p.resolvedFloatingTables.some(t=>t.occurrenceId===e.occurrenceId));return zE(i,e,i.nextParagraphId+e.length)})()}:{}}}function OO(e,t,n,r){let i=mC(e,n.flowDomainId),a=Gw(t,{...n,exclusions:Object.freeze([...n.exclusions,...i.exclusions,...r?.exclusions??[]]),anchorCollisions:Object.freeze([...n.anchorCollisions??[],...i.collisions,...r?.collisions??[]])});return hC(e,i,a.layout),a}function kO(e,t){return e.flatMap((e,n)=>e.kind===`shape`&&e.anchorOccurrenceId&&e.authoredWrap===void 0?[]:[{id:e.imageKey||`${t}:float:${n}`,wrap:e.authoredWrap??(e.mode===`topAndBottom`?`topAndBottom`:`square`),wrapSide:dd(e.side),bounds:{xPt:e.xLeft,yPt:e.yTop,widthPt:Math.max(0,e.xRight-e.xLeft),heightPt:Math.max(0,e.yBottom-e.yTop)},polygon:e.wrapPolygon??[{xPt:e.xLeft,yPt:e.yTop},{xPt:e.xRight,yPt:e.yTop},{xPt:e.xRight,yPt:e.yBottom},{xPt:e.xLeft,yPt:e.yBottom}],...e.kind===`table`&&!e.anchorOccurrenceId?{verticalOwnership:`page`}:{},...e.anchorOccurrenceId?{anchorOccurrenceId:e.anchorOccurrenceId,verticalOwnership:`page`}:{}}])}function AO(e){return e.flatMap(e=>e.kind!==`shape`||!e.anchorOccurrenceId?[]:[{occurrenceId:e.anchorOccurrenceId,bounds:{xPt:e.imageX,yPt:e.imageY,widthPt:e.imageW,heightPt:e.imageH},horizontalOwnership:`page`,verticalOwnership:`page`}])}function jO(e){if(e.occurrenceId.length===0)throw Error(`DrawingML collision occurrence ID must not be empty`);let{xPt:t,yPt:n,widthPt:r,heightPt:i}=e.bounds;if(![t,n,r,i].every(Number.isFinite)||r<0||i<0)throw Error(`DrawingML collision bounds are invalid: ${e.occurrenceId}`);if(e.horizontalOwnership!==`page`&&e.horizontalOwnership!==`host`||e.verticalOwnership!==`page`&&e.verticalOwnership!==`host`)throw Error(`DrawingML collision ownership is invalid: ${e.occurrenceId}`)}function MO(e){return jO(e),Object.freeze({occurrenceId:e.occurrenceId,bounds:Object.freeze({...e.bounds}),horizontalOwnership:e.horizontalOwnership,verticalOwnership:e.verticalOwnership,...e.relativeHeight===void 0?{}:{relativeHeight:e.relativeHeight}})}function NO(e,t){return Object.freeze({coordinateSpace:t,flowDomainId:e,entries:Object.freeze([])})}function PO(e,t){return Object.freeze({coordinateSpace:e.coordinateSpace,flowDomainId:e.flowDomainId,baseEntries:e.entries,baseEntryCount:e.entries.length,entries:Object.freeze(t.map(MO))})}function FO(e,t){if(t.coordinateSpace!==e.coordinateSpace)throw Error(`DrawingML collision registry coordinate space mismatch`);if(t.flowDomainId!==e.flowDomainId)throw Error(`DrawingML collision registry flow domain mismatch`);if(t.baseEntries!==e.entries||t.baseEntryCount!==e.entries.length)throw Error(`DrawingML collision registry delta is stale`);let n=new Set(e.entries.map(e=>e.occurrenceId));for(let e of t.entries){if(jO(e),n.has(e.occurrenceId))throw Error(`DrawingML collision occurrence committed twice: ${e.occurrenceId}`);n.add(e.occurrenceId)}}function IO(e,t){return FO(e,t),Object.freeze({coordinateSpace:e.coordinateSpace,flowDomainId:e.flowDomainId,entries:Object.freeze([...e.entries,...t.entries])})}function LO(e,t){return NS(e,t)}function RO(e){return fd(e.wrapMode)&&LO(e.anchorYRelativeFrom??null,e.anchorYFromPara??!1)}function zO(e){let t=is(e);return t===`U`||t===`Tu`?`upright`:t===`Tr`?`rotate`:`sideways`}const BO=new Set([65294]);function VO(e){return BO.has(e)?{dx:.4,dy:-.4}:{dx:0,dy:0}}function HO(e){let t=[],n=``,r=null;for(let i of e){let e=zO(i.codePointAt(0)??0);r===null?(r=e,n=i):e===r?n+=i:(t.push({text:n,mode:r}),n=i,r=e)}return n!==``&&r!==null&&t.push({text:n,mode:r}),t}const UO=()=>!1;function WO(e,t,n){let r=e.textBaseline;e.textBaseline=`alphabetic`;let i=e.measureText(t);e.textBaseline=r;let a=i.fontBoundingBoxAscent,o=i.fontBoundingBoxDescent;return typeof a==`number`&&typeof o==`number`&&(a!==0||o!==0)?(a-o)/2:.38*n}function GO(e,t){let n=e.textAlign,r=e.textBaseline;e.textAlign=`center`,e.textBaseline=`middle`;let i=e.measureText(t);e.textAlign=n,e.textBaseline=r;let a=i.actualBoundingBoxAscent,o=i.actualBoundingBoxDescent;return typeof a==`number`&&typeof o==`number`?(a-o)/2:0}function KO(e){return zO(e)===`rotate`&&ss(e)===null&&!us(e)}function qO(e){let t=is(e);return t===`Tu`||t===`Tr`}function JO(e,t){let n=e.textAlign,r=e.textBaseline;e.textAlign=`center`,e.textBaseline=`middle`;let i=e.measureText(t);e.textAlign=n,e.textBaseline=r;let a=i.actualBoundingBoxLeft,o=i.actualBoundingBoxRight;return typeof a!=`number`||typeof o!=`number`||!Number.isFinite(a)||!Number.isFinite(o)?null:{extentPx:a+o,shiftPx:(a-o)/2}}function YO(e,t,n,r,i,a,o){let s=e.textAlign,c=e.textBaseline,l=()=>(e.textAlign=n===`sideways`?`left`:`center`,e.textBaseline=n===`sideways`?`alphabetic`:`middle`,e.measureText(t)),u;try{u=o?ws(e,l):l()}finally{e.textAlign=s,e.textBaseline=c}if(n===`upright`){if(!Number.isFinite(u.actualBoundingBoxLeft)||!Number.isFinite(u.actualBoundingBoxRight))return;let e=u.actualBoundingBoxLeft,t=u.actualBoundingBoxRight,n=a===`vertical-rl`?1:i,o=-(r.xPt-e)*n,s=-(r.xPt+t)*n;return Object.freeze({startPt:Math.min(o,s),endPt:Math.max(o,s)})}if(!Number.isFinite(u.actualBoundingBoxAscent)||!Number.isFinite(u.actualBoundingBoxDescent))return;let d=u.actualBoundingBoxAscent,f=u.actualBoundingBoxDescent,p=r.yPt-d,m=r.yPt+f;return Object.freeze({startPt:Math.min(p,m),endPt:Math.max(p,m)})}function XO(e,t,n,r,i){let a=e.measureText(t).width;if(qO(n)&&r(n)){let n=Ts(e,t);return{naturalPx:n.cellAdvancePx,vert:n,rotateInkShiftPx:0}}if(i&&KO(n)){let n=JO(e,t);if(n!==null&&n.extentPx>a)return{naturalPx:n.extentPx,vert:null,rotateInkShiftPx:n.shiftPx}}return{naturalPx:a,vert:null,rotateInkShiftPx:0}}function ZO(e,t,n,r,i=1,a=!1,o=UO,s=`vertical-rl`){let c=[],l=WO(e,t,n),u=0,d=0;for(let f of HO(t)){if(f.mode===`sideways`){let t=[...f.text].length,n=e.measureText(f.text).width*i+r*t,a={xPt:0,yPt:l},o=YO(e,f.text,`sideways`,a,i,s,!1);c.push({range:{start:d,end:d+f.text.length},text:f.text,orientation:`sideways`,originPt:u,advancePt:n,drawOffsetPt:a,verticalFeature:!1,...o?{blockAxisInkBounds:o}:{}}),u+=n,d+=f.text.length;continue}for(let t of f.text){let l=t.codePointAt(0)??0,f=zO(l),p=f===`rotate`?ss(l):null,m=f===`rotate`&&p===null&&us(l),h=XO(e,t,l,o,a),g=h.naturalPx*i+r,_={start:d,end:d+t.length};if(h.vert!==null){let n={xPt:0,yPt:0},r=YO(e,t,`upright`,n,i,s,!0);c.push({range:_,text:t,orientation:`upright`,originPt:u+h.vert.originInCellPx*i,advancePt:g,drawOffsetPt:n,verticalFeature:!0,...r?{blockAxisInkBounds:r}:{}})}else if(f===`upright`||p!==null||m){let r=p===null?as(l):null,a=p??r,o=a===null?t:String.fromCodePoint(a),d=a===null?VO(l):{dx:0,dy:0},f=_f(r),m=d.dy===0&&!f?GO(e,o)/n:0,h={xPt:d.dx*n,yPt:(m+d.dy)*n},v=YO(e,o,`upright`,h,i,s,!1);c.push({range:_,text:o,orientation:`upright`,originPt:u+g/2,advancePt:g,drawOffsetPt:h,verticalFeature:!1,...v?{blockAxisInkBounds:v}:{}})}else{let n={xPt:0,yPt:0},r=YO(e,t,`rotate`,n,i,s,!1);c.push({range:_,text:t,orientation:`rotate`,originPt:u+g/2+i*h.rotateInkShiftPx,advancePt:g,drawOffsetPt:n,verticalFeature:!1,...r?{blockAxisInkBounds:r}:{}})}u+=g,d+=t.length}}return c}function QO(e,t,n){let r=0;for(let i of HO(t)){if(i.mode===`sideways`){r+=e.measureText(i.text).width;continue}for(let t of i.text){let i=XO(e,t,t.codePointAt(0)??0,n,!0);r+=i.naturalPx}}return r-e.measureText(t).width}function $O(e,t){return QO(e,t,t=>Cs(e,t))}function ek(e,t,n,r,i){return{x:t,y:i-(e+n),w:r,h:n}}function tk(e,t,n,r){let i=r.acquisitionInputs,a=()=>r.bodySectionIndex,o=r.effectiveTablePositioning,s=r.publicAnchorBridge,c=Of(e.fontFamilyClasses,e.fontFamilyPitches),l=(e,t,n)=>`${e}${t?`|clr:${t}`:``}${n?`|duo:${n.clr1}:${n.clr2}`:``}`;function u(e,t,n={},r,a={},o,c){let l=Sm(r,t),u=o;return{ctx:e,verticalGlyphMeasurement:Jg(u),acquisitionInputs:i,contentX:t.marginLeft,contentW:t.pageWidth-t.marginLeft-t.marginRight,y:0,pageH:t.pageHeight,pageIndex:0,totalPages:a_(u).totalPages,marginLeft:t.marginLeft,marginRight:t.marginRight,marginTop:Mm(t.marginTop),marginBottom:Mm(t.marginBottom),pageWidth:t.pageWidth,floats:[],floatParaSeq:0,layoutSettings:r,sectionLayout:l,storyContext:tD,docEastAsian:r.documentHasEastAsianText,fontFamilyClasses:n,resolvedLocalFonts:a,layoutServices:u,retainedTableAcquisition:{layoutServices:e=>e.layoutServices,tableFormat:i.tableFormatInput,resolveColumns:m,createCellState:(e,t,n)=>({...oD(e),contentX:0,contentW:t,y:0,containerShading:n.background??e.containerShading,floats:[],floatParaSeq:0,pageAnchorPrescanned:new Set}),acquireParagraph:(e,t,n,r,i,a,o,c)=>{let l=c??{story:`body`,storyInstance:`body`,path:[...r]},u=t.runs.filter((e,t)=>s(e,l,t)!==null);u.length>0&&E({...t,runs:u},e,e.y);let d=aD(e,t),f=OO(e,e.acquisitionInputs.paragraphAcquisitionInput(t,l),{id:`${l.story}:${l.storyInstance}:${l.path.join(`.`)}`,source:l,flowDomainId:i,ordinaryFlow:!0,context:d,placement:{startYPt:e.y,paragraphXPt:0,availableWidthPt:n,maximumYPt:e.pageH,suppressSpaceBefore:!0},measurer:{context:e.ctx,fontFamilyClasses:e.fontFamilyClasses},environment:$E(e),exclusions:kO(e.floats,i),anchorCollisions:AO(e.floats),anchorCellBounds:{xPt:0,yPt:0,widthPt:n,heightPt:e.pageH},containerShading:e.containerShading,...a?{paragraphBorderEdges:a}:{},trailingExtentPt:Math.max(d.spaceAfterPt,a?.bottom===`none`?0:Qp(t.borders)),continuesFromPrevious:!1,anchorFrames:nD(e),acquireCompleteStory:e.acquireCompleteTextBoxStory},o).layout;return t.spaceBefore===0?f:Object.freeze({...f,flowBounds:Object.freeze({...f.flowBounds,heightPt:f.flowBounds.heightPt+t.spaceBefore}),advancePt:f.advancePt+t.spaceBefore,spacing:Object.freeze({...f.spacing,beforePt:t.spaceBefore})})},registerFloatingTable:(e,t)=>{let n=!t.positioning.horzSpecified||t.positioning.horzAnchor!==`page`&&t.positioning.horzAnchor!==`margin`,r=t.positioning.vertAnchor!==`page`&&t.positioning.vertAnchor!==`margin`;if(!n||!r)return null;let i=e.pageH,a={xPt:e.contentX,yPt:e.y,widthPt:e.contentW,heightPt:t.child.advancePt},o=IE(t.positioning,{page:{xPt:0,yPt:0,widthPt:e.pageWidth,heightPt:i},margin:{xPt:e.marginLeft,yPt:e.marginTop,widthPt:Math.max(0,e.pageWidth-e.marginLeft-e.marginRight),heightPt:Math.max(0,i-e.marginTop-e.marginBottom)},text:a},t.child.columnWidthsPt.reduce((e,t)=>e+t,0),t.child.advancePt),s=AE(e,{x:o.x,y:o.y,w:o.w,h:o.h,dl:t.positioning.leftFromTextPt,dr:t.positioning.rightFromTextPt,dt:t.positioning.topFromTextPt,db:t.positioning.bottomFromTextPt,kind:`table`,mode:`square`,side:`bothSides`,imageKey:``,paraId:e.floatParaSeq++,avoidOverlap:!0,tableOverlap:t.overlap});return Object.freeze({xPt:s.imageX-a.xPt,yPt:s.imageY-a.yPt})},advanceState:(e,t)=>{e.y+=t}},retainedTablesBySourceIndex:new Map,currentDateMs:c?.currentDateMs,kinsoku:r.kinsoku,defaultTabPt:r.defaultTabPt,get verticalCJK(){return JE(this.sectionLayout.textDirection)},get verticalAllRotated(){return JE(this.sectionLayout.textDirection)&&YE(this.sectionLayout.textDirection)},verticalPhys:qE(t)?(()=>{let e=ZE(t);return{pageWidth:e.pageWidth,pageHeight:e.pageHeight,marginLeft:e.marginLeft,marginRight:e.marginRight,marginTop:Mm(e.marginTop),marginBottom:Mm(e.marginBottom),physicalPageWidthPt:e.pageWidth}})():void 0}}function d(e,t,n){let r=e=>{let t=Object.freeze({top:null,right:null,bottom:null,left:null,insideH:null,insideV:null});return Object.freeze({kind:`table`,id:e.id,source:e.source,flowDomainId:e.flowDomainId,ordinaryFlow:!0,alignment:e.alignment,indentPt:e.indentPt,bidiVisual:e.bidiVisual,columnWidthsPt:e.columnWidthsPt,columnWidthKeys:e.columnWidthKeys,borders:t,rows:Object.freeze(e.rows.map(e=>Object.freeze({...e,exceptionBorders:e.sourceTableEdges})))})},i=t=>{if(t.story!==`body`||t.storyInstance!==`body`||t.path.length!==1)throw Error(`Body acquisition requires a top-level body source`);let n=e.body[t.path[0]];if(!n||n.type!==`paragraph`&&n.type!==`table`)throw Error(`Body source does not identify a flow block: ${t.path.join(`.`)}`);return n},l=t=>{if(t.story!==`body`||t.storyInstance!==`body`||t.path.length===0||(t.path.length-1)%3!=0)throw Error(`Nested body acquisition requires a canonical source path`);let n=e.body[t.path[0]];for(let e=1;e<t.path.length;e+=3){if(!n||n.type!==`table`)throw Error(`Nested body source leaves table ownership: ${t.path.join(`.`)}`);n=n.rows[t.path[e]]?.cells[t.path[e+1]]?.content[t.path[e+2]]}if(!n||n.type!==`paragraph`&&n.type!==`table`)throw Error(`Nested body source does not identify a flow block: ${t.path.join(`.`)}`);return n},d=(e,t,n,r,i,a,o=Object.freeze({boundary:null}),s)=>{let c=fm(t)??{top:`top`,bottom:`bottom`},l=iD(e,t);return Gw(e.acquisitionInputs.paragraphAcquisitionInput(t,n),{id:`${n.story}:${n.storyInstance}:${n.path.join(`.`)}`,source:n,flowDomainId:r.flowDomainId,ordinaryFlow:!0,context:l,placement:{startYPt:e.y,paragraphXPt:r.availableBounds.xPt,availableWidthPt:i,maximumYPt:e.pageH,suppressSpaceBefore:a},measurer:{context:e.ctx,fontFamilyClasses:e.fontFamilyClasses},environment:$E(e),exclusions:kO(e.floats,r.flowDomainId),anchorCollisions:s??AO(e.floats),containerShading:e.containerShading,paragraphBorderEdges:c,trailingExtentPt:Math.max(l.spaceAfterPt,c.bottom===`none`?0:Qp(t.borders)),continuesFromPrevious:o.boundary!==null,...o.sourceRangeStart===void 0?{}:{sourceRangeStart:o.sourceRangeStart},anchorFrames:nD(e),acquireCompleteStory:e.acquireCompleteTextBoxStory},o.boundary===null?void 0:{boundary:o.boundary,...o.uniformRubyAdvancePt===void 0?{}:{uniformRubyAdvancePt:o.uniformRubyAdvancePt}})};return Object.freeze({openBodyLayoutSession(f,_,v){if(!t)throw Error(`Body layout acquisition requires a measurement context`);let y={...e.section,...f.section.geometry,textDirection:f.section.textDirection,vAlign:f.section.verticalAlignment},b=u(t,JE(y.textDirection)?XE(y):y,c,_m(e),n,_,v),x=lT(e.footnotes??[]);b.noteNumbers=new Map([...[...cT(e.footnotes,uT(e.body,`footnote`))].map(([e,t])=>[`footnote:${e}`,t]),...[...cT(e.endnotes,uT(e.body,`endnote`))].map(([e,t])=>[`endnote:${e}`,t])]);let S=new Map;Bm(a()).occurrences.forEach(e=>{let t=e.markerBodyIndex===null?null:`section:${e.markerBodyIndex}`;for(let n of[`default`,`first`,`even`]){let r=t===null?n:`${t}:${n}`,i=e.headers[n],a=e.footers[n];i&&S.set(`header:${r}`,i),a&&S.set(`footer:${r}`,a)}});let C=f.initialLocation,w=e=>`body:page:${e}:registry`,T=Object.freeze({coordinateSpace:`logical-page-points`,flowDomainId:w(C.pageIndex),entries:Object.freeze([]),nextParagraphId:0}),O=NO(w(C.pageIndex),`logical-page-points`),k=(e,t)=>{let n=t.section.geometry;e.sectionLayout=t.section,e.pageIndex=t.pageIndex;let r=a_(_).resolveDestinationPage?.(t.pageIndex);e.displayPageNumber=r?.displayPageNumber??t.pageIndex+1,e.pageNumberFormat=r?.pageNumberFormat??e.pageNumberFormat,e.pageWidth=n.pageWidth,e.pageH=n.pageHeight,e.marginLeft=n.marginLeft,e.marginRight=n.marginRight,e.marginTop=Mm(n.marginTop),e.marginBottom=Mm(n.marginBottom),e.contentX=t.availableBounds.xPt,e.contentW=t.availableBounds.widthPt,e.y=t.cursorPt.yPt},A=e=>{C=e,k(b,e)};A(C);let j=(e,t,n,r,i=T.nextParagraphId)=>{let a=new Set(T.entries.map(e=>e.occurrenceId)),o=e.runs.flatMap((i,o)=>{if(i.type!==`shape`&&i.type!==`image`&&i.type!==`chart`)return[];let c=s(i,t,o);return!c||r&&!r.has(c.occurrenceId)||a.has(c.occurrenceId)||c.pageOwned&&n.pageAnchorPrescanned?.has(e)?[]:[{run:i,occurrenceId:c.occurrenceId}]});if(o.length===0)return Object.freeze([]);let c=n.floats.length;E({...e,runs:o.map(({run:e})=>e)},n,n.y);let l=n.floats.slice(c);if(l.length!==o.length)throw Error(`Public paragraph anchor acquisition did not retain every wrap float`);return Object.freeze(l.map((e,t)=>{let n=o[t].occurrenceId;return Object.freeze({kind:`shape`,occurrenceId:n,exclusionId:n,paragraphId:i,bounds:Object.freeze({xPt:e.imageX,yPt:e.imageY,widthPt:e.imageW,heightPt:e.imageH}),exclusionBounds:Object.freeze({xPt:e.xLeft,yPt:e.yTop,widthPt:e.xRight-e.xLeft,heightPt:e.yBottom-e.yTop}),wrap:o[t].run.wrapMode,wrapSide:e.side,wrapDistances:Object.freeze({topPt:e.distTop,rightPt:e.distRight,bottomPt:e.distBottom,leftPt:e.distLeft}),...e.wrapPolygon?{wrapPolygon:Object.freeze([...e.wrapPolygon])}:{}})}))},M=e=>{let t=new Map((e.anchorFrames??[]).flatMap(e=>{if(e.status!==`resolved`)return[];let t=e=>e.status===`resolved`&&(e.referenceFrame===`paragraph`||e.referenceFrame===`line`||e.referenceFrame===`character`);return t(e.axes.horizontal)||t(e.axes.vertical)?[[e.occurrenceId,e]]:[]}));if(t.size===0)return Object.freeze([]);let n=new Map(e.exclusions.flatMap(e=>e.anchorOccurrenceId?[[e.anchorOccurrenceId,e]]:[]));return Object.freeze((e.anchorCollisions??[]).flatMap(e=>{let r=t.get(e.occurrenceId);if(!r||r.geometry.wrap.kind===`none`)return[];let i=n.get(e.occurrenceId);if(!i)throw Error(`Wrapped anchor omitted exclusion geometry: ${e.occurrenceId}`);return[Object.freeze({kind:`shape`,occurrenceId:e.occurrenceId,exclusionId:e.occurrenceId,paragraphId:T.nextParagraphId,bounds:e.bounds,exclusionBounds:i.bounds,horizontalOwnership:e.horizontalOwnership,verticalOwnership:e.verticalOwnership,wrap:r.geometry.wrap.kind,wrapSide:r.geometry.wrap.side,wrapDistances:r.geometry.wrap.distances,...r.geometry.wrap.polygon?{wrapPolygon:r.geometry.wrap.polygon.points}:{}})]}))},N=e=>{if(e.acquired.kind!==`paragraph`)return e.acquired;let t=l(e.acquired.source);if(t.type!==`paragraph`)throw Error(`Table paragraph re-acquisition source kind mismatch`);let n={...oD(b),contentX:0,contentW:e.acquired.flowBounds.widthPt,y:e.acquired.flowBounds.yPt,floats:(e.floatingTableExclusions??[]).map((e,t)=>({kind:`table`,tableOverlap:`never`,mode:`square`,imageKey:`table-final-frame:${t}`,imageX:e.xPt,imageY:e.yPt,imageW:e.widthPt,imageH:e.heightPt,xLeft:e.xPt,xRight:e.xPt+e.widthPt,yTop:e.yPt,yBottom:e.yPt+e.heightPt,side:`bothSides`,distLeft:0,distRight:0,distTop:0,distBottom:0,paraId:t})),floatParaSeq:e.floatingTableExclusions?.length??0,pageAnchorPrescanned:new Set},r=lC(e.acquired);return b.retainedTableAcquisition.acquireParagraph(n,t,e.acquired.flowBounds.widthPt,e.acquired.source.path,e.acquired.flowDomainId,void 0,r)},ee=lT(e.endnotes??[]),te=new Map,P=e=>{if(e.path.length!==0)throw Error(`Story acquisition requires a story-root source`);if(e.story===`header`||e.story===`footer`){let t=S.get(`${e.story}:${e.storyInstance}`);if(!t)throw Error(`Unknown ${e.story} story source`);return t.body}if(e.story===`footnote`||e.story===`endnote`){let t=(e.story===`footnote`?x:ee).get(e.storyInstance);if(!t)throw Error(`Unknown ${e.story} story source`);return t.content}throw Error(`Unsupported shared story source: ${e.story}`)},ne=(e,t)=>{if(t.path.length===0||(t.path.length-1)%3!=0)throw Error(`Story block acquisition requires a canonical source path`);let n=e[t.path[0]];for(let e=1;e<t.path.length;e+=3){if(!n||n.type!==`table`)throw Error(`Story source leaves table ownership: ${t.path.join(`.`)}`);n=n.rows?.[t.path[e]]?.cells[t.path[e+1]]?.content[t.path[e+2]]}if(!n||n.type!==`paragraph`&&n.type!==`table`)throw Error(`Story source does not identify a flow block: ${t.path.join(`.`)}`);return n},F=(e,t)=>{let n=JSON.stringify({source:e.source,pageIndex:e.pageIndex,section:e.section,container:e.container}),r=te.get(n);if(r)return r;let i=t??P(e.source),a=e.source.story===`footnote`||e.source.story===`endnote`?b.noteNumbers?.get(`${e.source.story}:${e.source.storyInstance}`):void 0,o=a_(_),c=o.resolveDestinationPage?.(e.pageIndex),l=JE(e.section.textDirection),u={...b,sectionLayout:e.section,pageIndex:e.pageIndex,totalPages:o.totalPages,displayPageNumber:c?.displayPageNumber??e.pageIndex+1,pageNumberFormat:c?.pageNumberFormat??b.pageNumberFormat,pageWidth:e.section.geometry.pageWidth,pageH:e.container.capacity===`unbounded`?2**53-1:e.section.geometry.pageHeight,marginLeft:e.section.geometry.marginLeft,marginRight:e.section.geometry.marginRight,marginTop:Mm(e.section.geometry.marginTop),marginBottom:Mm(e.section.geometry.marginBottom),contentX:e.container.bounds.xPt,contentW:e.container.bounds.widthPt,y:e.container.bounds.yPt,floats:[],floatParaSeq:0,retainedTablesBySourceIndex:new Map,pageAnchorPrescanned:new Set,noteReferenceNumber:a,verticalCJK:l,verticalAllRotated:l&&YE(e.section.textDirection),...l?{}:{verticalPhys:void 0},storyContext:{story:e.source.story,containers:[],lineNumberingEligible:!1}};D(i,0,u);let d=t_(_);u.layoutServices=d;let f=i.flatMap((t,n)=>{let r={story:e.source.story,storyInstance:e.source.storyInstance,path:[n]};if(t.type===`unsupportedTextBoxBlock`)return[{type:`unsupportedTextBoxBlock`,qName:t.qName,sourcePath:t.sourcePath}];if(t.type===`paragraph`)return[{kind:`paragraph`,source:r}];if(t.type!==`table`)throw Error(`Unsupported ${e.source.story} story block: ${t.type}`);let i=u.retainedTableAcquisition,a=t;return[KD(a,m(a,e.container.bounds.widthPt,u),e.container.bounds.widthPt,u,r,i).input]}),p=null;FT(d,{layoutParagraph(e,t){let n=ne(i,e.source);if(n.type!==`paragraph`)throw Error(`Story paragraph source kind mismatch`);let r=e.source.path[0],a=r>0&&i[r-1]?.type===`paragraph`?i[r-1]:null,o=i[r+1]?.type===`paragraph`?i[r+1]:null,c=p?.spaceAfter??0,l=rC(p,n,c,n.spaceBefore),d=Math.max(t.container.bounds.yPt,t.cursor.yPt-l.overlap);u.y=d,u.contentX=t.container.bounds.xPt,u.contentW=t.container.bounds.widthPt;let f=n.runs.filter((t,n)=>s(t,e.source,n)!==null);f.length>0&&E({...n,runs:f},u,u.y);let m=aD(u,n),h=im(a,n,o),g=OO(u,u.acquisitionInputs.paragraphAcquisitionInput(n,e.source),{id:`${e.source.story}:${e.source.storyInstance}:${e.source.path.join(`.`)}`,source:e.source,flowDomainId:t.container.id,ordinaryFlow:!0,context:m,placement:{startYPt:d,paragraphXPt:t.container.bounds.xPt,availableWidthPt:t.container.bounds.widthPt,maximumYPt:t.availableBounds.yPt+t.availableBounds.heightPt,suppressSpaceBefore:l.suppressBefore},measurer:{context:u.ctx,fontFamilyClasses:u.fontFamilyClasses},environment:$E(u),exclusions:kO(u.floats,t.container.id),anchorCollisions:AO(u.floats),containerShading:u.containerShading,paragraphBorderEdges:h,trailingExtentPt:Math.max(m.spaceAfterPt,h.bottom===`none`?0:Qp(n.borders)),continuesFromPrevious:!1,anchorFrames:nD(u),acquireCompleteStory:u.acquireCompleteTextBoxStory});p=n;let _={xPt:t.cursor.xPt,yPt:d+g.layout.advancePt};return u.y=_.yPt,{layout:g.layout,nextCursor:_}},layoutTable(e,t){p=null;let n=BD({...e,flowDomainId:t.container.id},t,d);return u.y=n.nextCursor.yPt,n}});let h=RT({source:e.source,container:e.container,blocks:Object.freeze(f)},d),g=Object.freeze({...h,blocks:Object.freeze(h.blocks.map((t,n)=>{if(t.kind!==`paragraph`&&t.kind!==`table`)throw Error(`Shared story emitted unsupported node: ${t.kind}`);return _x(t,{occurrenceId:`${e.container.id}:block:${n}`,destination:{coordinateSpace:`logical-page-points`,flowDomainId:e.container.id,translation:{xPt:0,yPt:0}}})}))});return te.set(n,g),g};b.acquireCompleteTextBoxStory=e=>{let t=e.coordinateSpace===`upright-physical`?{...b.sectionLayout,geometry:Pm(b.sectionLayout.geometry),textDirection:`lrTb`}:b.sectionLayout;return F({source:e.source,pageIndex:b.pageIndex,section:t,container:e.container},e.blocks)};let I={hasPaginationFields:sC(e.body,e.footnotes??[],[...[...S.values()].map(e=>e.body),...(e.endnotes??[]).map(e=>e.content)]),measureParagraph(t){A(t.location);let n=i(t.input.source);if(n.type!==`paragraph`)throw Error(`Paragraph source kind mismatch`);if(n.framePr){if(t.continuation.boundary!==null)throw Error(`Body frame acquisition cannot continue across flow regions`);let r,i=dm(n);if(!i)throw Error(`Body frame acquisition requires an indexed adjacency group`);let a=g(n,i,b,h(e.body,n,b),e=>{r=e});if(!r)throw Error(`Body frame acquisition omitted its retained group`);let o=r.members.find(e=>e.paragraph===n);if(!o)throw Error(`Body frame acquisition omitted its retained member`);let s=n.framePr.vAnchor===`page`||n.framePr.vAnchor===`margin`,c=a.exclusionId??`frame:${t.input.source.path.join(`:`)}`,l=Object.freeze({kind:`frame`,occurrenceId:c,exclusionId:c,paragraphId:T.nextParagraphId,bounds:Object.freeze({xPt:a.x,yPt:a.y,widthPt:a.w,heightPt:a.h}),exclusionBounds:Object.freeze({xPt:a.exLeft,yPt:a.exTop,widthPt:a.exRight-a.exLeft,heightPt:a.exBottom-a.exTop})});return Object.freeze({layout:o.fragment,blockExtentPt:0,lineEndBoundaries:Object.freeze([]),placement:Object.freeze({coordinateSpace:`logical-body`,xPt:o.fragment.flowBounds.xPt,yPt:o.fragment.flowBounds.yPt,sectionFlowOwnership:s?`page`:`host-flow`}),...n===i.owner?{retainedFootnoteReferenceIds:Object.freeze([...new Set(r.members.flatMap(e=>hT(e.fragment)))])}:{},...s?{}:{relocationBlockExtentPt:Math.max(0,a.y+a.h-t.location.cursorPt.yPt)},...a.registerExclusion===!1?{}:{flowRegistryDelta:Object.freeze({floats:zE(T,Object.freeze([l]),T.nextParagraphId+1)})}})}let r={...b,floats:[...b.floats],pageAnchorPrescanned:new Set(b.pageAnchorPrescanned)};k(r,t.location);let a=t.continuation.boundary===null?j(n,t.input.source,r):Object.freeze([]),{measured:o,layout:s}=d(r,n,t.input.source,t.location,t.availableInlineExtentPt,t.suppressSpaceBefore,t.continuation,O.entries),c=o.lines.map(e=>{let t=e.layout.consumedEnd;if(!t)throw Error(`Measured line omitted its source boundary`);return t}),l=M(s),u=Object.freeze([...a,...l]),f=dC(s);return Object.freeze({layout:s,blockExtentPt:s.advancePt,lineEndBoundaries:Object.freeze(c),...o.markOnly?{markBelowBaselinePt:o.lastLineBelowBaselinePt}:{},...o.uniformRubyAdvancePt==null?{}:{uniformRubyAdvancePt:o.uniformRubyAdvancePt},...u.length===0&&f.length===0?{}:{flowRegistryDelta:Object.freeze({...u.length===0?{}:{floats:zE(T,u,T.nextParagraphId+u.length)},...f.length===0?{}:{drawingCollisions:PO(O,f)}})}})},measureTable(e){if(A(e.location),e.input.kind===`adjacent-table-group`){if(e.cursor&&e.cursor.kind!==`adjacent-table-group`)throw Error(`Adjacent table group acquisition received an ordinary table cursor`);let t=e.input.tables.map(t=>{let n=i(t.source);if(n.type!==`table`)throw Error(`Table source kind mismatch`);let r=t.source.path[0];return p(b,n,e.availableInlineExtentPt,r),sD(b,r).acquisition}),n=r(rO(e.input.logicalSequenceId,t.map(e=>e.input))),a={container:{id:e.location.flowDomainId,kind:`body`,bounds:{xPt:0,yPt:0,widthPt:e.availableInlineExtentPt,heightPt:e.freshPageBlockExtentPt}},cursor:{xPt:0,yPt:0},availableBounds:{xPt:0,yPt:0,widthPt:e.availableInlineExtentPt,heightPt:e.freshPageBlockExtentPt}},o=BD(n,a,_).layout,s={};t.forEach(e=>Object.entries(e.nestedById).forEach(([e,t])=>{if(s[e]&&s[e]!==t)throw Error(`Adjacent table group has duplicate nested table id: ${e}`);s[e]=t}));let c=Object.freeze({input:n,layout:o,nestedById:Object.freeze(s),floatingTables:Object.freeze(t.flatMap(e=>e.floatingTables))}),l=e.cursor?.cursor??Object.freeze({tableIndex:0,sourceRowIndex:0}),u=e.input.tables.slice(0,l.tableIndex).reduce((e,t)=>e+(t.rowCount??0),0)+l.sourceRowIndex,d=l.tableCursor??Object.freeze({...oO(),rowIndex:u});if(d.rowIndex!==u)throw Error(`Adjacent-table group and table-fragment cursors disagree`);let f=DO(c,d,{availableHeightPt:e.availableBlockExtentPt,freshPageHeightPt:e.freshPageBlockExtentPt,placement:a,services:_,compatibility:`word`,page:{physicalPageIndex:e.location.pageIndex,displayPageNumber:e.location.pageIndex+1,occurrenceId:`${n.id}:body:${e.location.pageIndex}`}});if(!f.fragment||f.requiresFreshPage)return Object.freeze({layout:c.layout,blockExtentPt:0,nextCursor:Object.freeze({kind:`adjacent-table-group`,cursor:l}),requiresFreshFlowRegion:!0});let m=f.nextCursor?(()=>{let t=0,n=0;for(;t<e.input.tables.length;){let r=e.input.tables[t].rowCount??0;if(f.nextCursor.rowIndex<n+r)break;n+=r,t+=1}return t>=e.input.tables.length?null:Object.freeze({tableIndex:t,sourceRowIndex:f.nextCursor.rowIndex-n,tableCursor:f.nextCursor})})():null;return Object.freeze({layout:f.fragment,blockExtentPt:f.fragment.advancePt,nextCursor:m?Object.freeze({kind:`adjacent-table-group`,cursor:m}):null,...f.floatingTableRegistryDelta?{flowRegistryDelta:Object.freeze({floats:f.floatingTableRegistryDelta})}:{}})}let t=i(e.input.source);if(t.type!==`table`)throw Error(`Table source kind mismatch`);let n=e.input.source.path[0];p(b,t,e.availableInlineExtentPt,n);let a=sD(b,n).acquisition;if(e.cursor&&e.cursor.kind!==`table`)throw Error(`Ordinary table acquisition received an adjacent-group cursor`);let s=e.cursor?.cursor??oO(),c=b.pageH,l=b.acquisitionInputs.tableFormatInput(t).positioning;if(l){let n=e.cursor?.kind===`table`&&e.cursor.floatingContinuationFrame===`fresh-text`?Object.freeze({...l,vertAnchor:`text`,yPt:0,yAlign:void 0}):l,r=a.layout.columnWidthsPt.reduce((e,t)=>e+t,0),i=Object.freeze({page:Object.freeze({xPt:0,yPt:0,widthPt:b.pageWidth,heightPt:c}),margin:Object.freeze({xPt:b.marginLeft,yPt:b.marginTop,widthPt:Math.max(0,b.pageWidth-b.marginLeft-b.marginRight),heightPt:Math.max(0,c-b.marginTop-b.marginBottom)}),text:Object.freeze({xPt:e.location.cursorPt.xPt,yPt:e.location.cursorPt.yPt,widthPt:e.availableInlineExtentPt,heightPt:a.layout.advancePt})}),o=IE(n,i,r,a.layout.advancePt);if(e.cursor?.kind!==`table`&&(n.vertAnchor===`page`||n.vertAnchor===`margin`)&&ad({bounds:{xPt:o.x,yPt:o.y,widthPt:o.w,heightPt:o.h},blockers:T.entries.map(Xu),overlapEpsilonPt:.01}).defer)return Object.freeze({layout:a.layout,blockExtentPt:0,nextCursor:Object.freeze({kind:`table`,cursor:s,floatingContinuationFrame:`authored`}),requiresFreshFlowRegion:!0});let u=(n.vertAnchor===`page`||n.vertAnchor===`margin`)&&a.layout.advancePt>e.freshPageBlockExtentPt,d=u?e.location.availableBounds.yPt+e.location.availableBounds.heightPt:n.vertAnchor===`page`?i.page.yPt+i.page.heightPt:n.vertAnchor===`margin`?i.margin.yPt+i.margin.heightPt:e.location.availableBounds.yPt+e.location.availableBounds.heightPt,f=u?e.freshPageBlockExtentPt:n.vertAnchor===`page`?i.page.heightPt:n.vertAnchor===`margin`?i.margin.heightPt:e.freshPageBlockExtentPt,p;try{p=Kd({step:r=>{if(r?.kind===`fresh-flow-region`||r?.kind===`candidate`&&r.resolved.placement.xPt===r.parentFrame.xPt&&r.resolved.placement.yPt===r.parentFrame.yPt)return r;let c=r?.resolved.placement??{xPt:o.x,yPt:o.y},l=Math.max(0,d-c.yPt),u=DO(a,s,{availableHeightPt:l,freshPageHeightPt:f,placement:{container:{id:`${e.location.flowDomainId}:floating-table`,kind:`body`,bounds:{xPt:0,yPt:0,widthPt:e.availableInlineExtentPt,heightPt:l}},cursor:{xPt:0,yPt:0},availableBounds:{xPt:0,yPt:0,widthPt:e.availableInlineExtentPt,heightPt:l}},services:_,compatibility:`word`,oversizedRowPolicy:`atomic`,page:{physicalPageIndex:e.location.pageIndex,displayPageNumber:b.displayPageNumber??e.location.pageIndex+1,occurrenceId:`${a.input.id}:fitting-outer:${e.location.pageIndex}:${s.rowIndex}:${s.rowFragmentIndex}`},floatingTableFrames:{page:i.page,margin:i.margin,column:i.text},floatingTableRegistry:T,finalPlacementTranslationPt:c,reacquirePageDependentBlock:N});if(!u.fragment||u.requiresFreshPage)return Object.freeze({kind:`fresh-flow-region`,result:u});let p=Object.freeze({kind:`floating-table-placement`,occurrenceId:`${a.input.id}:root:${e.location.pageIndex}:${s.rowIndex}:${s.rowFragmentIndex}`,ownership:`source`,physicalPageIndex:e.location.pageIndex,displayPageNumber:b.displayPageNumber??e.location.pageIndex+1,hostCellId:e.location.flowDomainId,sourceBlockIndex:e.input.source.path[0],anchorBlockIndex:e.input.source.path[0],tableId:u.fragment.id,overlap:t.overlap===`never`?`never`:`overlap`,positioning:n,anchorBounds:i.text,child:u.fragment}),m=u.floatingTableRegistryDelta?.entries??[],h=u.floatingTableRegistryDelta?.nextParagraphId??T.nextParagraphId,g=HE(p,i,VE(T.entries,h,T.coordinateSpace,T.flowDomainId)),v=JSON.stringify({parentFrame:{xPt:g.placement.xPt,yPt:g.placement.yPt},fragment:u.fragment,nestedEntries:m,resolvedBounds:g.placement.bounds});return Object.freeze({kind:`candidate`,parentFrame:Object.freeze({xPt:c.xPt,yPt:c.yPt}),result:u,fragment:u.fragment,resolved:g,nestedEntries:m,fingerprint:v})},stateOf:e=>e.kind===`fresh-flow-region`?`fresh-flow-region`:e.fingerprint,limit:16}).value}catch(e){throw e instanceof Gd?new Z(`NON_CONVERGENCE`,e.reason===`cycle`?`Floating table parent/child transaction repeated an exact-state cycle`:`Floating table parent/child transaction reached the operational pass limit 16`):e}if(p.kind===`fresh-flow-region`)return Object.freeze({layout:a.layout,blockExtentPt:0,nextCursor:Object.freeze({kind:`table`,cursor:s,floatingContinuationFrame:`fresh-text`}),requiresFreshFlowRegion:!0});let{result:m,fragment:h,resolved:g,nestedEntries:v}=p,y=e.cursor?.kind===`table`&&e.cursor.floatingContinuationFrame!==void 0,x=e.location.availableBounds.yPt+e.location.availableBounds.heightPt,S=[...h.resolvedFloatingTables??[],g.placement].filter(e=>e.source.positioning.vertAnchor===`text`);return!y&&S.some(e=>e.exclusionBounds.yPt+e.exclusionBounds.heightPt>x)?Object.freeze({layout:h,blockExtentPt:0,nextCursor:Object.freeze({kind:`table`,cursor:s,floatingContinuationFrame:`fresh-text`}),requiresFreshFlowRegion:!0}):Object.freeze({layout:h,blockExtentPt:0,nextCursor:m.nextCursor?Object.freeze({kind:`table`,cursor:m.nextCursor,floatingContinuationFrame:`fresh-text`}):null,flowRegistryDelta:Object.freeze({floats:zE(T,Object.freeze([...v,...g.transaction.delta]),g.transaction.nextParagraphId)}),placement:Object.freeze({coordinateSpace:`logical-body`,xPt:g.placement.xPt,yPt:g.placement.yPt,sectionFlowOwnership:n.vertAnchor===`page`||n.vertAnchor===`margin`?`page`:`host-flow`})})}if(b.verticalPhys&&!o(t)){if(e.cursor)throw Error(`An upright physical table must remain atomic`);let t=b.verticalPhys,n=a.layout.columnWidthsPt.reduce((e,t)=>e+t,0);if(n>e.availableBlockExtentPt&&e.availableBlockExtentPt<e.freshPageBlockExtentPt)return Object.freeze({layout:a.layout,blockExtentPt:0,nextCursor:Object.freeze({kind:`table`,cursor:s}),requiresFreshFlowRegion:!0});let r=t.physicalPageWidthPt-e.location.cursorPt.yPt-n,i=e.location.cursorPt.xPt,o=Math.max(a.layout.advancePt,t.pageHeight-t.marginTop-t.marginBottom),c=`upright-physical-page:${e.location.pageIndex}`,l=DO(a,oO(),{availableHeightPt:o,freshPageHeightPt:o,placement:{container:{id:c,kind:`body`,bounds:{xPt:0,yPt:0,widthPt:n,heightPt:o}},cursor:{xPt:0,yPt:0},availableBounds:{xPt:0,yPt:0,widthPt:n,heightPt:o}},services:_,compatibility:`word`,oversizedRowPolicy:`atomic`,page:{physicalPageIndex:e.location.pageIndex,displayPageNumber:b.displayPageNumber??e.location.pageIndex+1,occurrenceId:`${a.input.id}:upright-page:${e.location.pageIndex}`},floatingTableFrames:{page:{xPt:0,yPt:0,widthPt:t.pageWidth,heightPt:t.pageHeight},margin:{xPt:t.marginLeft,yPt:t.marginTop,widthPt:Math.max(0,t.pageWidth-t.marginLeft-t.marginRight),heightPt:Math.max(0,t.pageHeight-t.marginTop-t.marginBottom)},column:{xPt:t.marginLeft,yPt:t.marginTop,widthPt:Math.max(0,t.pageWidth-t.marginLeft-t.marginRight),heightPt:Math.max(0,t.pageHeight-t.marginTop-t.marginBottom)}},floatingTableRegistry:Object.freeze({coordinateSpace:`upright-physical-page-points`,flowDomainId:c,entries:Object.freeze([]),nextParagraphId:0}),finalPlacementTranslationPt:{xPt:r,yPt:i},reacquirePageDependentBlock:N});if(!l.fragment||l.nextCursor||l.requiresFreshPage)throw Error(`Upright table final-frame layout must remain atomic`);return Object.freeze({layout:l.fragment,blockExtentPt:n,nextCursor:null,placement:Object.freeze({coordinateSpace:`upright-physical`,xPt:r+l.fragment.flowBounds.xPt,yPt:i+l.fragment.flowBounds.yPt,sectionFlowOwnership:`host-flow`})})}let u=DO(a,s,{availableHeightPt:e.availableBlockExtentPt,freshPageHeightPt:e.freshPageBlockExtentPt,placement:{container:{id:e.location.flowDomainId,kind:`body`,bounds:{xPt:0,yPt:0,widthPt:e.availableInlineExtentPt,heightPt:e.availableBlockExtentPt}},cursor:{xPt:0,yPt:0},availableBounds:{xPt:0,yPt:0,widthPt:e.availableInlineExtentPt,heightPt:e.availableBlockExtentPt}},services:_,compatibility:`word`,page:{physicalPageIndex:e.location.pageIndex,displayPageNumber:e.location.pageIndex+1,occurrenceId:`${a.input.id}:body:${e.location.pageIndex}`},floatingTableFrames:{page:{xPt:0,yPt:0,widthPt:b.pageWidth,heightPt:c},margin:{xPt:b.marginLeft,yPt:b.marginTop,widthPt:Math.max(0,b.pageWidth-b.marginLeft-b.marginRight),heightPt:Math.max(0,c-b.marginTop-b.marginBottom)},column:e.location.availableBounds},floatingTableRegistry:T,finalPlacementTranslationPt:{xPt:e.location.availableBounds.xPt,yPt:e.location.cursorPt.yPt},reacquirePageDependentBlock:N}),d=e.location.availableBounds.xPt+a.layout.flowBounds.xPt,f=d+a.layout.flowBounds.widthPt,m=u.fragment?.advancePt??0,h=id({inlineStartPt:d,inlineEndPt:f,blockStartPt:e.location.cursorPt.yPt,blockExtentPt:m,blockers:T.entries.map(Xu),overlapEpsilonPt:Ku}).blockStartPt;return h>e.location.cursorPt.yPt?Object.freeze({layout:a.layout,blockExtentPt:0,nextCursor:e.cursor??null,retryAtBlockStartPt:h}):!u.fragment||u.requiresFreshPage?Object.freeze({layout:a.layout,blockExtentPt:0,nextCursor:Object.freeze({kind:`table`,cursor:s}),requiresFreshFlowRegion:!0}):Object.freeze({layout:u.fragment,blockExtentPt:u.fragment.advancePt,nextCursor:u.nextCursor?Object.freeze({kind:`table`,cursor:u.nextCursor}):null,...u.floatingTableRegistryDelta?{flowRegistryDelta:Object.freeze({floats:u.floatingTableRegistryDelta})}:{}})},layoutStory:F,layoutNotes(e){let t=[],n=e.container.bounds.yPt,r=e.firstOnPage;for(let i of e.referenceIds){if(!(e.kind===`footnote`?x:ee).has(i))continue;let a={story:e.kind,storyInstance:i,path:[]},o=r?6:0,s={...e.container,id:`${e.container.id}:${e.kind}:${i}`,bounds:{...e.container.bounds,yPt:n+o,heightPt:Math.max(0,e.container.bounds.yPt+e.container.bounds.heightPt-n-o)}},c;try{c=F({source:a,pageIndex:e.pageIndex,section:e.section,container:s})}catch(t){throw t instanceof AT&&t.containerId===s.id?new zb(e.kind,e.pageIndex,e.container.id):t}let l=Object.freeze(r?[Object.freeze({edge:`top`,from:Object.freeze({xPt:e.container.bounds.xPt,yPt:n+o/2}),to:Object.freeze({xPt:e.container.bounds.xPt+e.container.bounds.widthPt/3,yPt:n+o/2}),color:`#000000`,widthPt:.5,authoredStyle:`single`,style:`solid`})]:[]),u=o+c.advancePt,d=Object.freeze({xPt:e.container.bounds.xPt,yPt:n,widthPt:e.container.bounds.widthPt,heightPt:u}),f=Object.freeze({kind:`note`,id:`${e.kind}:${i}:page:${e.pageIndex}`,source:a,flowDomainId:e.container.id,ordinaryFlow:!0,flowBounds:d,inkBounds:Object.freeze({xPt:Math.min(d.xPt,c.inkBounds.xPt),yPt:Math.min(d.yPt,c.inkBounds.yPt),widthPt:Math.max(d.xPt+d.widthPt,c.inkBounds.xPt+c.inkBounds.widthPt)-Math.min(d.xPt,c.inkBounds.xPt),heightPt:Math.max(d.yPt+d.heightPt,c.inkBounds.yPt+c.inkBounds.heightPt)-Math.min(d.yPt,c.inkBounds.yPt)}),clipBounds:e.container.bounds,advancePt:u,separator:l,story:c});t.push(f),n+=u,r=!1}return Object.freeze(t)},measureFollowingBlock(e){let t={...b,floats:[...b.floats],retainedTablesBySourceIndex:new Map(b.retainedTablesBySourceIndex)};if(k(t,e.location),e.input.kind===`adjacent-table-group`){let n=e.input.tables.map(n=>{let r=i(n.source);if(r.type!==`table`)throw Error(`Following table source kind mismatch`);let a=n.source.path[0];return p(t,r,e.availableInlineExtentPt,a),sD(t,a).acquisition}),a=BD(r(rO(e.input.logicalSequenceId,n.map(e=>e.input))),{container:{id:e.location.flowDomainId,kind:`body`,bounds:e.location.availableBounds},cursor:e.location.cursorPt,availableBounds:e.location.availableBounds},_).layout;return Object.freeze({fullExtentPt:a.advancePt,leadContentExtentPt:a.rows[0]?.advancePt??a.advancePt,fullFootnoteReferenceIds:hT(a),leadFootnoteReferenceIds:hT({...a,rows:a.rows.slice(0,1)})})}let n=i(e.input.source);if(e.input.kind===`paragraph`){if(n.type!==`paragraph`)throw Error(`Following paragraph source kind mismatch`);let{layout:r}=d(t,n,e.input.source,e.location,e.availableInlineExtentPt,!1,void 0,O.entries),i=r.lines[0];return Object.freeze({fullExtentPt:r.advancePt,leadContentExtentPt:i?i.bounds.yPt+i.advancePt-r.flowBounds.yPt:r.advancePt,fullFootnoteReferenceIds:hT(r),leadFootnoteReferenceIds:i?mT([i]):[]})}if(n.type!==`table`)throw Error(`Following table source kind mismatch`);let a=e.input.source.path[0];p(t,n,e.availableInlineExtentPt,a);let o=sD(t,a).acquisition.layout;return Object.freeze({fullExtentPt:o.advancePt,leadContentExtentPt:o.rows[0]?.advancePt??o.advancePt,fullFootnoteReferenceIds:hT(o),leadFootnoteReferenceIds:hT({...o,rows:o.rows.slice(0,1)})})},prescanPageAnchors(e){let t=e.location.section.geometry,n=Mm(t.marginTop),r=Mm(t.marginBottom),a=Object.freeze({page:Object.freeze({xPt:0,yPt:0,widthPt:t.pageWidth,heightPt:t.pageHeight}),margin:Object.freeze({xPt:t.marginLeft,yPt:n,widthPt:Math.max(0,t.pageWidth-t.marginLeft-t.marginRight),heightPt:Math.max(0,t.pageHeight-n-r)}),column:Object.freeze({xPt:e.location.availableBounds.xPt,yPt:n,widthPt:e.availableInlineExtentPt,heightPt:Math.max(0,t.pageHeight-n-r)}),paragraph:null,line:null,character:null,pageParity:e.location.pageIndex%2==0?`odd`:`even`}),o=new Set,c=e=>`${e.story}:${e.storyInstance}:${e.path.join(`.`)}`,l=new Map,u=e=>{let t=c(e);return l.has(t)||l.set(t,T.nextParagraphId+l.size),l.get(t)},d=e.anchors.flatMap(t=>{let n=i(t.paragraphSource);if(n.type!==`paragraph`)throw Error(`Page-anchor prescan source kind mismatch`);let r=b.acquisitionInputs.paragraphAcquisitionInput(n,t.paragraphSource),c=r.runs.filter(e=>e.type===`anchorHost`&&e.anchorOccurrenceId===t.occurrenceId),l=r.runs.map((e,t)=>({run:e,runIndex:t})).filter(e=>(e.run.type===`image`||e.run.type===`chart`||e.run.type===`shape`||e.run.type===`unavailableDrawing`)&&e.run.anchorAcquisitionInput?.occurrenceId===t.occurrenceId).sort((e,t)=>(e.run.anchorAcquisitionInput.group?.sourceIndex??0)-(t.run.anchorAcquisitionInput.group?.sourceIndex??0)||e.runIndex-t.runIndex);if(c.length!==1||l.length===0){let r=n.runs.find((e,n)=>s(e,t.paragraphSource,n)?.occurrenceId===t.occurrenceId);if(r){if((r.type===`image`||r.type===`chart`||r.type===`shape`)&&r.wrapMode===`none`)return[];let i={...b,floats:[...b.floats],pageAnchorPrescanned:new Set(b.pageAnchorPrescanned)};k(i,e.location);let a=j(n,t.paragraphSource,i,new Set([t.occurrenceId]),u(t.paragraphSource));if(a.length!==1)throw Error(`Public page-anchor prescan occurrence mismatch: ${t.occurrenceId}`);return o.add(n),a}throw Error(`Page-anchor prescan occurrence acquisition mismatch: ${t.occurrenceId}`)}let d=tC({acquisition:l[0].run.anchorAcquisitionInput,frames:a});if(d.status!==`resolved`)throw Error(`Page-anchor prescan could not resolve occurrence: ${t.occurrenceId}`);let f=JE(e.location.section.textDirection)?(()=>{let t=P_(e.location.section.textDirection);return xw(d,H_(t,B_({widthPt:a.page.widthPt,heightPt:a.page.heightPt},t)))})():d,p=f.geometry.wrapBounds;if(p===null||f.geometry.wrap.kind===`none`)return[];let m=f.geometry.wrap.polygon?.points??Object.freeze([Object.freeze({xPt:p.xPt,yPt:p.yPt}),Object.freeze({xPt:p.xPt+p.widthPt,yPt:p.yPt}),Object.freeze({xPt:p.xPt+p.widthPt,yPt:p.yPt+p.heightPt}),Object.freeze({xPt:p.xPt,yPt:p.yPt+p.heightPt})]);return[Object.freeze({kind:`shape`,occurrenceId:t.occurrenceId,paragraphId:u(t.paragraphSource),bounds:f.geometry.objectFrame,exclusionBounds:p,wrap:f.geometry.wrap.kind,wrapSide:f.geometry.wrap.side,wrapDistances:f.geometry.wrap.distances,wrapPolygon:Object.freeze([...m])})]});return o.forEach(e=>b.pageAnchorPrescanned?.add(e)),d.length===0?null:Object.freeze({floats:Object.freeze({coordinateSpace:`logical-page-points`,flowDomainId:T.flowDomainId,baseEntries:T.entries,baseNextParagraphId:T.nextParagraphId,nextParagraphId:T.nextParagraphId+d.length,entries:Object.freeze(d)})})},measureLineNumberGlyph(n){let r=t.font;try{let r=QE(e),i=jf(!1,!1,r,null,{});t.font=i;let a=t.measureText(n);return Object.freeze({widthPt:a.width,ascentPt:a.fontBoundingBoxAscent??a.actualBoundingBoxAscent??r*.8,descentPt:a.fontBoundingBoxDescent??a.actualBoundingBoxDescent??r*.2,font:i})}finally{t.font=r}},resetPageAcquisition(e){b.floats=[],b.floatParaSeq=0,b.pageAnchorPrescanned=new Set,T=Object.freeze({coordinateSpace:`logical-page-points`,flowDomainId:w(e.pageIndex),entries:Object.freeze([]),nextParagraphId:0}),O=NO(w(e.pageIndex),`logical-page-points`),A(e)},moveAcquisitionCursor:A,flowRegistrySnapshot(){return Object.freeze({floats:T,drawingCollisions:O})},commitFlowRegistryDelta(e){if(!e.floats&&!e.drawingCollisions)throw Error(`Body flow registry delta must update at least one registry`);e.floats&&BE(e.floats,{coordinateSpace:T.coordinateSpace,flowDomainId:T.flowDomainId,entries:T.entries,nextParagraphId:T.nextParagraphId}),e.drawingCollisions&&FO(O,e.drawingCollisions);let t=e.drawingCollisions?IO(O,e.drawingCollisions):O,n=(e.floats?.entries??[]).map(e=>{let t=e.wrapDistances?.leftPt??e.bounds.xPt-e.exclusionBounds.xPt,n=e.wrapDistances?.topPt??e.bounds.yPt-e.exclusionBounds.yPt,r=e.wrapDistances?.rightPt??e.exclusionBounds.xPt+e.exclusionBounds.widthPt-e.bounds.xPt-e.bounds.widthPt,i=e.wrapDistances?.bottomPt??e.exclusionBounds.yPt+e.exclusionBounds.heightPt-e.bounds.yPt-e.bounds.heightPt,a={mode:e.wrap===`topAndBottom`?`topAndBottom`:`square`,...e.kind===`shape`?{anchorOccurrenceId:e.occurrenceId,acquisitionOccurrenceId:e.occurrenceId}:{},...e.wrap?{authoredWrap:e.wrap,wrapPolygon:e.wrapPolygon}:{},imageKey:e.exclusionId??(e.kind===`table`?`body:float:${e.paragraphId}`:``),imageX:e.bounds.xPt,imageY:e.bounds.yPt,imageW:e.bounds.widthPt,imageH:e.bounds.heightPt,xLeft:e.exclusionBounds.xPt,xRight:e.exclusionBounds.xPt+e.exclusionBounds.widthPt,yTop:e.exclusionBounds.yPt,yBottom:e.exclusionBounds.yPt+e.exclusionBounds.heightPt,side:e.wrapSide??`bothSides`,distLeft:t,distRight:r,distTop:n,distBottom:i,paraId:e.paragraphId};return e.kind===`table`?{...a,kind:`table`,tableOverlap:e.overlap}:{...a,kind:e.kind}});e.floats&&(b.floats.push(...n),T=Object.freeze({...T,entries:Object.freeze([...T.entries,...e.floats.entries]),nextParagraphId:e.floats.nextParagraphId}),b.floatParaSeq=e.floats.nextParagraphId),O=t}};return Object.freeze(I)}})}function f(e,t){return eD(t,aD(t,e))}function p(e,t,n,r){let i=e.retainedTablesBySourceIndex.get(r),a=m(t,n,e),o=e.retainedTableAcquisition,s=KD(t,a,n,e,[r],o),c=i?.contentWidthPt===n?Object.freeze({...s,layout:Object.freeze({...s.layout,columnWidthsPt:i.acquisition.layout.columnWidthsPt})}):s;e.retainedTablesBySourceIndex.set(r,Object.freeze({sourceIndex:r,acquisition:c,contentWidthPt:n,anchorYPt:e.y}));let l=c.layout.rows.map(e=>e.advancePt);return{colWidthsPt:a,rowContentHeightsPt:l,rowHeightsPt:l}}function m(e,t,n){let r=n.acquisitionInputs.tableFormatInput(e),i=new WeakMap;e.rows.forEach((t,n)=>t.cells.forEach((t,a)=>{let o=r.rows[n]?.cells[a]?.marginsPt;i.set(t,o??j(t,e))}));let a=Number.isFinite(e.tblInd)?e.tblInd??0:0,o=r.rows.map(e=>{let t=e.exception;return t?.indentAuthored?t.indentPt??0:a}),s=n.storyContext?.story,c=n.storyContext?.containers.length===0&&(s===`header`||s===`footer`||s===`body`&&n.sectionLayout?.columns.length===1),l=r.ordinaryFlow&&c&&!JE(n.sectionLayout.textDirection)&&[a,...o].some(e=>e<0),u=r.rows.length===0?[{justification:e.jc,indentPt:a}]:r.rows.map((t,n)=>({justification:t.justification??e.jc,indentPt:o[n]??a})),d=e.bidiVisual===!0,f=Math.min(n.pageWidth,...u.map(({justification:e,indentPt:r})=>{let i=e===`right`||e===`end`,a=e===`center`?`center`:(d?!i:i)?`right`:`left`,o=d?-r:r;if(a===`left`){let e=n.contentX+o;return n.pageWidth-e}if(a===`right`)return n.contentX+t+o;let s=n.contentX+t/2+o;return 2*Math.min(s,n.pageWidth-s)})),p=l?Math.max(t,f):t;return[...Il(n.acquisitionInputs.tableColumnLayoutInput(e,t,r=>Gp(r,i.get(r)??j(r,e),{paragraph:e=>{let r=wm(n.layoutSettings,n.sectionLayout,n.storyContext??tD,e),i=e.numbering?n.acquisitionInputs.numberingMarkerShapeInput(e.numbering,Pf(e)):void 0,a=Vp(r,{numbering:e.numbering,...i?{markerInput:i}:{},authoredFirstIndentPt:e.indentFirst,tabStops:e.tabStops,defaultTabPt:n.defaultTabPt,service:n.layoutServices?.text,clusterGeometry:!1}),o=a.numberingMarkerGeometry??(e.numbering&&i&&n.layoutServices?.text?Wp(e.numbering,i,{authoredFirstIndentPt:e.indentFirst,physicalIndentLeftPt:a.physicalIndentLeftPt,tabStops:e.tabStops,defaultTabPt:n.defaultTabPt},n.layoutServices.text,!1):void 0);return Zp(e,a,t,{context:n.ctx,fontFamilyClasses:n.fontFamilyClasses},$E(n),o)},nestedTable:e=>{let r=m(e,t,n).reduce((e,t)=>e+t,0);return{minWidthPt:r,maxWidthPt:r}}}),n.acquisitionInputs.tableParticipatesInOrdinaryFlow(e)?p:Math.max(t,n.pageWidth)))]}function h(e,t,n){let r=e.indexOf(t);for(let t=r+1;t<e.length;t++){let r=e[t];if(r.type!==`paragraph`)continue;let i=r;if(!i.framePr)return rp(i,1,f(i,n),iD(n,i).hasRuby,n.docEastAsian,n.ctx,n.fontFamilyClasses,i.lineSpacing,n.resolvedLocalFonts,n.layoutServices?.text,n.acquisitionInputs.paragraphMarkShapeInput(i))}let i=t;return rp(i,1,f(i,n),iD(n,i).hasRuby,n.docEastAsian,n.ctx,n.fontFamilyClasses,i.lineSpacing,n.resolvedLocalFonts,n.layoutServices?.text,n.acquisitionInputs.paragraphMarkShapeInput(i))}function g(e,t,n,r,i){let a={context:n.ctx,fontFamilyClasses:n.fontFamilyClasses},o=$E(n),s=t.members.map(fm),c=wE(t.framePr.hAnchor,n),l={contentXPt:n.contentX,contentWidthPt:n.contentW,pageHeightPt:n.pageH,yPt:n.y,anchorLineHeightPt:r},u=Yw(t,{contexts:t.members.map(e=>iD(n,e)),inputs:t.members.map((e,r)=>n.acquisitionInputs.paragraphAcquisitionInput(e,{story:`body`,storyInstance:`body`,path:[t.sourceIndices[r]]})),borderEdges:s,borderExtentsPt:t.members.map((e,t)=>s[t]?.bottom===`none`?0:Qp(e.borders)),measurer:a,environment:o,containerShading:n.containerShading,maximumWidthPt:Math.max(0,c.right-c.left),acquisitionSession:n,placementSignature:[l.contentXPt,l.contentWidthPt,l.pageHeightPt,l.yPt,l.anchorLineHeightPt,n.pageWidth,n.marginLeft,n.marginRight,n.marginTop,n.marginBottom].join(`|`),place:(e,r)=>{let i=kE(t.framePr,n,l.yPt,e,r,l.anchorLineHeightPt);return Object.freeze({bounds:Object.freeze({xPt:i.x,yPt:i.y,widthPt:i.w,heightPt:i.h}),exclusionBounds:Object.freeze({xPt:i.exLeft,yPt:i.exTop,widthPt:i.exRight-i.exLeft,heightPt:i.exBottom-i.exTop})})},anchorFrames:nD(n)});i?.(u);let d={x:u.box.bounds.xPt,y:u.box.bounds.yPt,w:u.box.bounds.widthPt,h:u.box.bounds.heightPt,exLeft:u.box.exclusionBounds.xPt,exTop:u.box.exclusionBounds.yPt,exRight:u.box.exclusionBounds.xPt+u.box.exclusionBounds.widthPt,exBottom:u.box.exclusionBounds.yPt+u.box.exclusionBounds.heightPt,registerExclusion:!0,exclusionId:u.box.exclusionId};return e===t.owner?d:{...d,registerExclusion:!1}}function _(e,t,n){if(t.verticalPhys){let n=_(e,w(t),t.contentX);return ek(n.x,n.y,n.w,n.h,t.verticalPhys.physicalPageWidthPt)}let r=e.widthPt,i=e.heightPt,a=e.anchorXPt,o=e.anchorYPt,s=e.groupWidthPt??null,c=e.groupHeightPt??null;if(e.widthPct!=null){let n=UE(e.widthRelativeFrom,!1,t),i=(n.end-n.start)*e.widthPct;if(e.groupWidthPt!=null&&e.groupWidthPt>0){let t=i/e.groupWidthPt;r=e.widthPt*t,a=e.anchorXPt*t}else r=i;s=i}if(e.heightPct!=null){let r=WE(e.heightRelativeFrom,!1,n,t),a=(r.end-r.start)*e.heightPct;if(e.groupHeightPt!=null&&e.groupHeightPt>0){let t=a/e.groupHeightPt;i=e.heightPt*t,o=e.anchorYPt*t}else i=a;c=a}return{x:GE(e.anchorXAlign,e.anchorXFromMargin,a,r,t,e.anchorXRelativeFrom,e.pctPosH,s),y:KE(e.anchorYAlign,e.anchorYFromPara,o,i,n,t,e.anchorYRelativeFrom,e.pctPosV,c),w:r,h:i}}let v=(e,t,n)=>T(e,t,n),y=(e,t,n)=>_(e,t,n),b=e=>ZE(e),x=e=>XE(e),S=(e,t,n)=>D(e,t,n);function C(e){let t=e.verticalPhys;return t?{...e,pageWidth:t.pageWidth,marginLeft:t.marginLeft,marginRight:t.marginRight,marginTop:t.marginTop,marginBottom:t.marginBottom,pageH:t.pageHeight}:e}function w(e){let t=e.verticalPhys;return t?{...C(e),contentX:t.marginLeft,contentW:t.pageWidth-t.marginLeft-t.marginRight,verticalCJK:!1,verticalAllRotated:!1,verticalPhys:void 0,floats:[]}:e}function T(e,t,n){let r=e.widthPt,i=e.heightPt,a=e.distLeft??0,o=e.distRight??0,s=e.distTop??0,c=e.distBottom??0;if(t.verticalPhys){let n=C(t),l=ek(GE(e.anchorXAlign,e.anchorXFromMargin??!1,e.anchorXPt??0,r,n,e.anchorXRelativeFrom??null,null,null),KE(e.anchorYAlign,e.anchorYFromPara??!1,e.anchorYPt??0,i,t.contentX,n,e.anchorYRelativeFrom??null,null,null),r,i,t.verticalPhys.physicalPageWidthPt);return{x:l.x,y:l.y,w:l.w,h:l.h,dl:s,dr:c,dt:o,db:a}}return{x:GE(e.anchorXAlign,e.anchorXFromMargin??!1,e.anchorXPt??0,r,t,e.anchorXRelativeFrom??null,null,null),y:KE(e.anchorYAlign,e.anchorYFromPara??!1,e.anchorYPt??0,i,n,t,e.anchorYRelativeFrom??null,null,null),w:r,h:i,dl:a,dr:o,dt:s,db:c}}function E(e,t,n){let r=t.floatParaSeq++,i=t.pageAnchorPrescanned?.has(e)??!1;for(let a of e.runs)if(a.type===`image`){let e=a;if(i&&RO(e))continue;O(e,t,n,r)}else if(a.type===`chart`){let e=a;if(i&&RO(e))continue;k(e,t,n,r)}else if(a.type===`shape`){let e=a;if(i&&RO(e))continue;A(e,t,n,r)}}function D(e,t,n){n.pageAnchorPrescanned||=new Set;for(let r=t;r<e.length;r++){let t=e[r];if(!t)continue;if(t.type===`pageBreak`)break;if(t.type===`sectionBreak`){let e=t;if(e.kind&&e.kind!==`continuous`)break;continue}if(t.type!==`paragraph`)continue;let i=t;if(n.pageAnchorPrescanned.has(i))continue;let a=!1;for(let e of i.runs)if(e.type===`image`){if(RO(e)){a=!0;break}}else if(e.type===`chart`){if(RO(e)){a=!0;break}}else if(e.type===`shape`&&RO(e)){a=!0;break}if(!a)continue;let o=n.floatParaSeq++;for(let e of i.runs)if(e.type===`image`){let t=e;if(!RO(t))continue;O(t,n,0,o)}else if(e.type===`chart`){let t=e;if(!RO(t))continue;k(t,n,0,o)}else if(e.type===`shape`){let t=e;if(!RO(t))continue;A(t,n,0,o)}n.pageAnchorPrescanned.add(i)}}function O(e,t,n,r){if(!e.anchor||!fd(e.wrapMode))return;let i=e.wrapMode===`topAndBottom`?`topAndBottom`:`square`,a=T(e,t,n),{w:o,h:s,dl:c,dr:u,dt:d,db:f}=a,p=e.allowOverlap??!0,m=l(e.imagePath,e.colorReplaceFrom,e.duotone);AE(t,{x:a.x,y:a.y,w:o,h:s,dl:c,dr:u,dt:d,db:f,kind:`shape`,mode:i,side:e.wrapSide??`bothSides`,imageKey:m,paraId:r,avoidOverlap:!0,allowOverlap:p})}function k(e,t,n,r){if(!e.anchor||!fd(e.wrapMode))return;let i=T(e,t,n),{w:a,h:o,dl:s,dr:c,dt:l,db:u}=i;a<=0||o<=0||AE(t,{x:i.x,y:i.y,w:a,h:o,dl:s,dr:c,dt:l,db:u,kind:`shape`,mode:e.wrapMode===`topAndBottom`?`topAndBottom`:`square`,side:e.wrapSide??`bothSides`,allowOverlap:e.allowOverlap??!0,avoidOverlap:!0,paraId:r,imageKey:``})}function A(e,t,n,r){if(!fd(e.wrapMode))return;let{x:i,y:a,w:o,h:s}=_(e,t,n);if(o<=0||s<=0)return;let c=e.wrapMode===`topAndBottom`?`topAndBottom`:`square`,l=e.distLeft??0,u=e.distRight??0,d=e.distTop??0,f=e.distBottom??0,p=!!t.verticalPhys;AE(t,{x:i,y:a,w:o,h:s,dl:p?d:l,dr:p?f:u,dt:p?u:d,db:p?l:f,kind:`shape`,mode:c,side:e.wrapSide??`bothSides`,imageKey:``,paraId:r,avoidOverlap:!0,allowOverlap:!0})}function j(e,t){return{top:e.marginTop??t.cellMarginTop,bottom:e.marginBottom??t.cellMarginBottom,left:e.marginLeft??t.cellMarginLeft,right:e.marginRight??t.cellMarginRight}}let M=d(e,t,n);return Object.freeze({kernel:M,internals:Object.freeze({resolveColumnWidths:m,resolveAnchorBox:v,resolveShapeBox:y,physicalLayoutSection:b,verticalLayoutSection:x,preRegisterPageFloats:S})})}function*nk(e){e.textPath&&(yield{text:e.textPath.string,fontFamilies:[e.textPath.fontFamily],bold:e.textPath.bold,italic:e.textPath.italic});for(let t of e.textBlocks??[])yield*rk(t)}function*rk(e){if(e.numbering&&(yield{text:e.numbering.text,fontFamilies:[e.numbering.fontFamily,e.numbering.fontFamilyEastAsia],bold:!1,italic:!1}),e.runs?.length)for(let t of e.runs)yield{text:t.text,fontFamilies:[t.fontFamily,t.fontFamilyEastAsia,e.fontFamily],bold:t.bold??e.bold,italic:t.italic??e.italic};else yield{text:e.text,fontFamilies:[e.fontFamily],bold:e.bold,italic:e.italic}}function*ik(e){if(e.type===`text`){let t=e;yield{text:e.text,fontFamilies:[e.fontFamily,t.fontFamilyHighAnsi,e.fontFamilyEastAsia],bold:e.bold,italic:e.italic},yield{text:e.text,fontFamilies:[e.fontFamilyCs],bold:e.boldCs??!1,italic:e.italicCs??!1}}else if(e.type===`field`){let t=e;yield{text:t.fallbackText,fontFamilies:[t.fontFamily,t.fontFamilyHighAnsi,t.fontFamilyEastAsia],bold:t.bold,italic:t.italic},yield{text:t.fallbackText,fontFamilies:[t.fontFamilyCs],bold:t.boldCs??!1,italic:t.italicCs??!1}}else e.type===`shape`?yield*nk(e):e.type===`anchorHost`&&(yield{text:``,fontFamilies:[e.fontFamily,e.fontFamilyEastAsia],bold:e.bold,italic:e.italic})}function*ak(e){yield{text:``,fontFamilies:[e.defaultFontFamily,e.defaultFontFamilyEastAsia]},e.numbering&&(yield{text:e.numbering.text,fontFamilies:[e.numbering.fontFamily,e.numbering.fontFamilyEastAsia]});for(let t of e.runs)yield*ik(t)}function*ok(e){for(let t of e.rows)for(let e of t.cells)yield*ck(e.content)}function*sk(e){if(e)for(let t of[e.default,e.first,e.even])t&&(yield*ck(t.body))}function*ck(e){for(let t of e)t.type===`paragraph`?yield*ak(t):t.type===`table`?yield*ok(t):t.type===`sectionBreak`&&(yield*sk(t.headers),yield*sk(t.footers))}function*lk(e){yield*ck(e.body??[]),yield*sk(e.headers),yield*sk(e.footers);for(let t of[...e.footnotes??[],...e.endnotes??[]])yield*ck(t.content)}function uk(e){let t=new Set;for(let n of lk(e))for(let e of n.fontFamilies){let n=e?.trim();n&&t.add(n)}return[...t]}const dk={...F,...re};function*fk(e){for(let t of lk(e))yield t.text}function pk(e){let t=R(e.majorFont)??R(e.minorFont)??null;return[e.majorFont,e.minorFont,...ie(fk(e),t)]}function mk(e){return e.trim().toLocaleLowerCase(`en-US`)}function hk(e){return e==null||!Number.isFinite(e)?400:Math.min(900,Math.max(100,Math.round(e/100)*100))}function gk(e){return Object.freeze({...e,diagnostics:Object.freeze([...e.diagnostics])})}function _k(e){return`\"${e.replaceAll(`\\\\`,`\\\\\\\\`).replaceAll(`\"`,`\\\\\"`)}\"`}function vk(e,t){return`${_k(e)}, ${t}`}function yk(e,t={}){let n={embedded:0,local:1,google:2,substitute:3},r=e.filter(e=>e.requestedFamily.trim()&&e.resolvedFamily.trim()).map(e=>Object.freeze({...e,weight:hk(e.weight),style:e.style??`normal`})).sort((e,t)=>mk(e.requestedFamily).localeCompare(mk(t.requestedFamily))||n[e.source]-n[t.source]||e.resolvedFamily.localeCompare(t.resolvedFamily)||e.weight-t.weight||e.style.localeCompare(t.style)),i=new Map;for(let e of r){let t=mk(e.requestedFamily);i.set(t,[...i.get(t)??[],e])}let a=Object.freeze(Object.fromEntries(Object.entries(t.nativeFamilyLists??{}).filter(([e,t])=>e.trim()&&t.trim()).map(([e,t])=>[mk(e),t]).sort(([e],[t])=>e.localeCompare(t)))),o=Uc(`fonts`,{faces:r,nativeFamilyLists:a});return Object.freeze({fingerprint:o,resolve(e){let t=e.requestedFamily?.trim()||e.genericFamily||`sans-serif`,n=hk(e.weight),r=e.style??`normal`,o=(i.get(mk(t))??[]).find(e=>e.weight===n&&e.style===r);if(o){let i=o.source===`substitute`?[{code:`UNSUPPORTED_FEATURE`,severity:`warning`,message:`ECMA-376 §17.8.2 implementation-dependent font substitution: ${t} resolved to ${o.resolvedFamily}`}]:[],a=vk(o.resolvedFamily,e.genericFamily??`sans-serif`);return gk({requestedFamily:t,resolvedFamily:o.resolvedFamily,route:I(a,`registered`),source:o.source,weight:n,style:r,diagnostics:i,genericFamily:e.genericFamily??`sans-serif`})}let s=e.genericFamily??`sans-serif`,c=e.requestedFamily?.trim();return gk(c?{requestedFamily:t,resolvedFamily:c,route:I(a[mk(c)]??vk(c,s),`native`),source:`native`,weight:n,style:r,diagnostics:[],genericFamily:s}:{requestedFamily:t,resolvedFamily:s,route:I(s,`generic`),source:`generic`,weight:n,style:r,diagnostics:[],genericFamily:s})}})}function bk(e,t){if(typeof e!=`string`||e.trim().length===0)throw TypeError(`${t} must be a non-empty string`)}function xk(e,t){if(!Number.isFinite(e)||e<0)throw TypeError(`${t} must be finite and non-negative`)}function Sk(e,t){if(!Number.isFinite(e))throw TypeError(`${t} must be finite`)}function Ck(e,t){if(!Number.isFinite(e)||e<0||e>1)throw TypeError(`${t} must be between 0 and 1`)}function wk(e,t){xk(e.widthPt,`${t}.widthPt`),xk(e.heightPt,`${t}.heightPt`)}function Tk(e){switch(bk(e.resourceKey,`resourceKey`),e.kind){case`image`:case`picture-bullet`:if(e.documentOrder!==void 0&&(!Number.isSafeInteger(e.documentOrder)||e.documentOrder<0))throw TypeError(`documentOrder must be a non-negative safe integer`);if(bk(e.partPath,`partPath`),bk(e.mimeType,`mimeType`),e.svgImagePath!==void 0&&bk(e.svgImagePath,`svgImagePath`),wk(e.intrinsicSize,`intrinsicSize`),e.alpha!==void 0&&Ck(e.alpha,`alpha`),e.rotation!==void 0&&!Number.isFinite(e.rotation))throw TypeError(`rotation must be finite`);e.srcRect!==void 0&&(Sk(e.srcRect.l,`srcRect.l`),Sk(e.srcRect.t,`srcRect.t`),Sk(e.srcRect.r,`srcRect.r`),Sk(e.srcRect.b,`srcRect.b`));break;case`chart`:wk(e.intrinsicSize,`intrinsicSize`);break;case`math`:break;default:throw TypeError(`Unknown paint resource kind: ${String(e)}`)}}function Ek(e){return Tk(e),Zc(e,`paint resource ${e.resourceKey}`)}function Dk(e,t,n){return Error(`Paint resource kind mismatch for ${e}: expected ${t}, got ${n}`)}function Ok(e){let t=new Set;for(let n of e){if(t.has(n.resourceKey))throw Error(`Duplicate paint resource key: ${n.resourceKey}`);t.add(n.resourceKey)}let n=e.map(Ek).sort((e,t)=>e.resourceKey.localeCompare(t.resourceKey)),r=Object.freeze(n),i=new Map(r.map(e=>[e.resourceKey,e])),a=Object.freeze(r.map(e=>e.resourceKey));return Object.freeze({keys:a,descriptors:r,resolve(e,t){let n=i.get(e);if(!n)throw Error(`Unknown paint resource: ${e}`);if(n.kind!==t)throw Dk(e,t,n.kind);return n}})}function kk(e){return Uc(`chart-resource`,e)}function Ak(e,t,n,r={}){return{kind:e,resourceKey:t,partPath:n,...r.svgImagePath===void 0?{}:{svgImagePath:r.svgImagePath},...r.srcRect==null?{}:{srcRect:{...r.srcRect}},...r.rotation===void 0?{}:{rotation:r.rotation},...r.flipH===void 0?{}:{flipH:r.flipH},...r.flipV===void 0?{}:{flipV:r.flipV},...r.alpha===void 0?{}:{alpha:r.alpha},...r.colorReplaceFrom===void 0?{}:{colorReplaceFrom:r.colorReplaceFrom},...r.duotone===void 0?{}:{duotone:{...r.duotone}}}}function jk(e,t,n){let r=[],i=[],a=(e,t)=>{if(e.type===`image`){r.push(Ak(`image`,Kc(t,e.imagePath),e.imagePath,e));return}if(e.type===`chart`){i.push({kind:`chart`,resourceKey:kk(t),intrinsicSize:{widthPt:e.widthPt,heightPt:e.heightPt},model:e.chart});return}if(e.type!==`shape`)return;let n=`${t.story}:${t.storyInstance}:${t.path.join(`.`)}`;e.textBlocks?.forEach((e,t)=>{if(!e.imagePath)return;let i={story:`textbox`,storyInstance:n,path:[t,0]};r.push(Ak(`image`,Kc(i,e.imagePath),e.imagePath,{svgImagePath:e.svgImagePath}))})},o=(e,t,n,r)=>{e.rows.forEach((e,i)=>e.cells.forEach((e,a)=>{l(e.content,t,n,[...r,i,a])}))},s=(e,t,n)=>{if(e)for(let r of[`default`,`first`,`even`]){let i=e[r];i&&l(i.body,t,n?`${n}:${r}`:r)}},c=(e,t)=>{let i=e.numbering;i?.picBulletImagePath&&r.push(Ak(`picture-bullet`,Kc(t,i.picBulletImagePath),i.picBulletImagePath)),(n?.paragraphAcquisitionInput(e,t).runs??e.runs).forEach((e,n)=>{(e.type===`image`||e.type===`chart`||e.type===`shape`)&&a(e,{...t,path:[...t.path,n]})})},l=(e,t,n,r=[])=>{e.forEach((e,i)=>{let a=[...r,i];e.type===`paragraph`?c(e,{story:t,storyInstance:n,path:a}):e.type===`table`?o(e,t,n,a):e.type===`sectionBreak`&&(s(e.headers,`header`,`section:${i}`),s(e.footers,`footer`,`section:${i}`))})};l(e.body,`body`,`body`),s(e.headers,`header`),s(e.footers,`footer`);for(let t of e.footnotes??[])l(t.content,`footnote`,t.id);for(let t of e.endnotes??[])l(t.content,`endnote`,t.id);let u=t??Fg(e,void 0,n),d=new Map(u.map(e=>[e.resourceKey,e])),f=r.map(e=>e.resourceKey).sort(),p=u.map(e=>e.resourceKey).sort();if(f.length!==p.length||f.some((e,t)=>e!==p[t]))throw Error(`Paint image descriptor membership differs from layout image metadata`);for(let[e,t]of r.entries()){let n=d.get(t.resourceKey);if(!n)throw Error(`Missing layout image metadata: ${t.resourceKey}`);i.push({...t,documentOrder:e,mimeType:n.mimeType,intrinsicSize:{widthPt:n.widthPt,heightPt:n.heightPt}})}for(let t of jg(e))i.push({kind:`math`,resourceKey:t.resourceKey});return i}function Mk(e,t,n){return Ok(jk(e,t,n))}function Nk(e,t){let n=Wl(t.localMetrics),r=Object.freeze(Object.fromEntries(Object.entries(t.fontFamilyCharsets).map(([e,t])=>[e.trim().toLowerCase(),t]))),i=e=>e.trim().replace(/^(['\"])(.*)\\1$/,`$2`),a=e=>i(e).toLocaleLowerCase(`en-US`),o=e=>{let t=e.style.trim().toLocaleLowerCase(`en-US`);return t===`normal`||t===`italic`?t:null},s=e=>{let t=e.weight.trim().toLocaleLowerCase(`en-US`);if(t===`normal`)return 400;if(t===`bold`)return 700;if(!/^\\d+$/.test(t))return null;let n=Number(t);return n>=100&&n<=900?n:null},c=e=>e.flatMap(e=>{if(e.status!==`loaded`)return[];let t=s(e),n=o(e);return t==null||n==null?[]:[{family:a(e.family),displayFamily:i(e.family),weight:t,style:n}]}),l=new Map(c(t.embeddedFaces??[]).map(e=>[`${e.family}:${e.weight}:${e.style}`,e])),u=(e.embeddedFonts??[]).flatMap(e=>{let t=e.style===`bold`||e.style===`boldItalic`?700:400,n=e.style===`italic`||e.style===`boldItalic`?`italic`:`normal`,r=l.get(`${a(e.fontName)}:${t}:${n}`);return r?[{requestedFamily:e.fontName,resolvedFamily:r.displayFamily,source:`embedded`,weight:t,style:n}]:[]});for(let[e,t]of Object.entries(n))u.push({requestedFamily:t.requestedFamily??e,resolvedFamily:t.family,source:`local`,weight:t.weight??400,style:t.style??`normal`});if(t.useGoogleFonts){let n=c(t.googleFaces??[]),r=new Set;for(let t of pk(e)){if(!t)continue;let e=t.toLocaleLowerCase(`en-US`);if(r.has(e))continue;r.add(e);let i=dk[e],o=i?.loadFamily??t;if(i)for(let e of n.filter(e=>e.family===a(o)))u.push({requestedFamily:t,resolvedFamily:e.displayFamily,source:a(o)===a(t)?`google`:`substitute`,weight:e.weight,style:e.style})}}let d=t.measureContext,f=[...new Set([...Object.keys(e.fontFamilyClasses??{}),...Object.keys(e.fontFamilyPitches??{}),...uk(e),...e.majorFont?[e.majorFont]:[],...e.minorFont?[e.minorFont]:[]])],p=Yl({fonts:yk(u,{nativeFamilyLists:Object.fromEntries(f.map(t=>[t,Af(t,e.fontFamilyClasses??{},e.fontFamilyPitches??{})]))}),localMetrics:n,eastAsiaFontCharsets:r,genericFamilies:Object.fromEntries(f.map(t=>[t,Hl(t,e.fontFamilyClasses,e.fontFamilyPitches)])),measurer:{fingerprint:d?`canvas-text-metrics-v1`:`deterministic-text-metrics-v1`,measure(e){if(!d)return{advancePt:[...e.text].length*e.fontSizePt*.5,ascentPt:e.fontSizePt*.8,descentPt:e.fontSizePt*.2};let t=d.font,n=d.letterSpacing,r=d.fontKerning;try{d.font=L(e.fontRoute,e.fontSizePt,e.weight,e.style),d.letterSpacing=`${e.letterSpacingPt}px`,e.kerning!=null&&(d.fontKerning=e.kerning?`normal`:`none`);let t=d.measureText(e.text),n=Number.isFinite(t.actualBoundingBoxLeft)&&Number.isFinite(t.actualBoundingBoxRight),r={xMinPt:n?-t.actualBoundingBoxLeft:0,xMaxPt:n?t.actualBoundingBoxRight:t.width,ascentPt:t.actualBoundingBoxAscent,descentPt:t.actualBoundingBoxDescent};return{advancePt:t.width,ascentPt:t.fontBoundingBoxAscent??t.actualBoundingBoxAscent??0,descentPt:t.fontBoundingBoxDescent??t.actualBoundingBoxDescent??0,...Object.values(r).every(Number.isFinite)?{inkBounds:r,...n?{horizontalInkBoundsAreTight:!0}:{}}:{}}}finally{d.font=t,d.letterSpacing=n,e.kerning!=null&&(d.fontKerning=r)}}}}),m=t.mathResources??t.mathOccurrences.map(({display:e,source:t})=>({resourceKey:qc(t,e?`display`:`inline`),widthEm:0,ascentEm:0,descentEm:0,available:!1,diagnostics:[{code:`UNSUPPORTED_FEATURE`,severity:`warning`,message:`The optional DOM math engine is unavailable; using the worker-safe text fallback`}]})),h=Fg(e,e=>{let n=e.numbering;if(!n)throw Error(`Picture-bullet metadata requires numbering`);let r=t.acquisitionInputs.numberingMarkerShapeInput(n,Pf(e));return{widthPt:n.picBulletWidthPt??r.fontSizePt,heightPt:n.picBulletHeightPt??r.fontSizePt}},t.acquisitionInputs),g=Object.freeze({text:p,images:Ng(h),math:Pg(m),verticalGlyphFingerprint:t.verticalGlyphMeasurement.fingerprint}),_=t.mathOccurrences.map(({source:e,display:t})=>qc(e,t?`display`:`inline`)),v=m.map(e=>e.resourceKey),y=_.filter(e=>!v.includes(e)),b=v.filter(e=>!_.includes(e));if(y.length||b.length)throw Error(`Math metadata membership mismatch: missing [${y.join(`, `)}]; extra [${b.join(`, `)}]`);return Zg(g,t.mathDrawables??new Map,m.filter(e=>e.available!==!1).map(e=>e.resourceKey)),o_(g,Mk(e,h,t.acquisitionInputs)),qg(g,t.verticalGlyphMeasurement),g}function Pk(e,t,n,r){return tk(e,t,n,r).kernel}function Fk(e,t={}){let n=Ag(e);e=n.document;let r=t.measureContext??(()=>{if(typeof document<`u`){let e=document.createElement(`canvas`).getContext(`2d`);if(e!==null)return e}return typeof OffscreenCanvas<`u`?new OffscreenCanvas(1,1).getContext(`2d`):null})(),i=r===null?null:Object.freeze({get font(){return r.font},set font(e){r.font=e},get letterSpacing(){return r.letterSpacing},set letterSpacing(e){r.letterSpacing=e},get fontKerning(){return r.fontKerning},set fontKerning(e){r.fontKerning=e},measureText(e){return r.measureText(e)}}),a=r?.canvas,o=a?.ownerDocument?.defaultView?.HTMLCanvasElement,s=r!==null&&(typeof o==`function`&&a instanceof o||typeof HTMLCanvasElement<`u`&&a instanceof HTMLCanvasElement),c=Object.freeze({fingerprint:r===null?`vertical-glyph-measurement:deterministic-v1`:s?`vertical-glyph-measurement:dom-vert-probe-v2`:`vertical-glyph-measurement:no-dom-vert-probe-v1`,measureRunInkExtra(e){if(r===null)throw Error(`Vertical glyph measurement requires a concrete text context`);return _s(r,()=>$O(r,e))},planRun(e){if(r===null)throw Error(`Vertical glyph planning requires a concrete text context`);return _s(r,()=>{let t=r.font,n=r.fontKerning;r.font=e.font,r.fontKerning=e.fontKerning;try{return ZO(r,e.text,e.fontSizePt,e.letterSpacingPt,e.charScale,e.growTrRotateInk,e=>Cs(r,e),e.writingMode)}finally{r.font=t,r.fontKerning=n}})}}),l=Wl(t.localMetrics),u=Nk(e,{...t,localMetrics:l,measureContext:i,verticalGlyphMeasurement:c,fontFamilyCharsets:n.fontFamilyCharsets,mathOccurrences:n.mathOccurrences,acquisitionInputs:n.bodyModelGateway.acquisitionInputs});return Gg(u,Pk(e,i,l,n.bodyModelGateway)),u}function Ik(e){Py(e)}function Lk(e,t,n,r){let i=r.layoutServices??Fk(e,e.parseError==null?{measureContext:t.getContext(`2d`)}:{}),a=r.defaultCurrentDateMs??Date.now();CE(i,a,()=>{let t=Ag(e);return{model:t.document,input:t.bodyLayoutInput}});let o=sy(i,{currentDate:r.currentDate,defaultCurrentDateMs:a},n),s=Pb(o.page,r.width);return{selection:o,paintOptions:{width:r.width,dpr:r.dpr,defaultTextColor:r.defaultTextColor,showTrackChanges:r.showTrackChanges,fetchImage:r.fetchImage,parseError:e.parseError!=null,registry:s_(i),privateResources:Qg(i),textRuns:r.onTextRun?ky(o.layout,n,{scale:s}):[],onTextRun:r.onTextRun}}}async function Rk(e,t,n,r={}){let i=Lk(e,t,n,r);return Rb(i.selection.layout,i.selection.page,t,i.paintOptions)}function zk(e){let t=new Map;for(let n of e.pages)for(let e of n.bookmarkStarts)e.name!==``&&!t.has(e.name)&&t.set(e.name,n.pageIndex);return t}async function Bk(e,t){let n=e.embeddedFonts;if(!n||n.length===0)return[];let r=(await Promise.all(n.map(async e=>{try{let n=await t(e.partPath);return{family:e.fontName,bytes:n,odttf:e.partPath.toLowerCase().endsWith(`.odttf`),fontKey:e.fontKey,weight:Vk(e.style),style:Hk(e.style)}}catch{return null}}))).filter(e=>e!==null);return r.length===0?[]:te(r)}function Vk(e){return e===`bold`||e===`boldItalic`?`bold`:`normal`}function Hk(e){return e===`italic`||e===`boldItalic`?`italic`:`normal`}function Uk(e){let t=new Set((e.embeddedFonts??[]).map(e=>{let t=e.style===`bold`||e.style===`boldItalic`?700:400,n=e.style===`italic`||e.style===`boldItalic`?`italic`:`normal`;return`${Nc(e.fontName)}:${t}:${n}`})),n=[],r=new Set,i=e=>{let i=e?.trim();if(!i)return;let a=Nc(i);if(!(a===`meiryo`||i===`メイリオ`))return;let o=`${a}:400:normal`;t.has(o)||r.has(o)||(r.add(o),n.push({family:i,localNames:[`Meiryo`],lineHeightMultiplier:1.3}))};for(let t of lk(e))if(!(t.bold||t.italic))for(let e of t.fontFamilies)i(e);return n}function Wk(e){return Lc(Uk(e))}function Gk(e,t=Fk(e),n){return SE(Ag(e).bodyLayoutInput,t,n)}function Kk(e,t,n){let r=oy({model:e,services:t,defaultCurrentDateMs:n,buildLayout:n=>Gk(e,t,n)});return Object.freeze({model:e,layoutServices:t,layoutVariants:r.store,defaultCurrentDateMs:n})}const qk=new Set([`tbRl`,`tbRlV`,`tbLrV`]);function Jk(e){let t=[e],n=new Set;for(;t.length>0;){let e=t.pop();if(!(typeof e!=`object`||!e||n.has(e))){if(n.add(e),!Array.isArray(e)){let t=e;if(typeof t.textDirection==`string`&&qk.has(t.textDirection))return!0}t.push(...Object.values(e))}}return!1}const Yk=new Ba(x,{freeArchive:e=>e.free(),reinit:S});let Xk=null,Zk=[];const Qk=new Map,$k=(e,t)=>self.postMessage(e,t);function eA(e,t){let n=Qk.get(e);if(n)return n;let r=(async()=>{let n=Yk.archive;if(!n)throw Error(`No docx loaded`);let r=Yk.run(()=>n.extract_image(e));return new Blob([new Uint8Array(r).slice()],{type:t})})();return Qk.set(e,r),r}self.onmessage=async t=>{let n=t.data;if(n.type===`init`){Yk.setWasmUrl(La(n.wasmUrl)??n.wasmUrl);return}let r=n.id;try{if(await Yk.ensureReady(),n.type===`parse`){Xk=null,Zk.length>0&&(Rc(Zk),Zk=[]),Qk.clear(),ba(eA),Ik(eA),jr(eA);let t=typeof n.maxZipEntryBytes==`number`&&n.maxZipEntryBytes>0?BigInt(n.maxZipEntryBytes):void 0,i=new Uint8Array(n.data),a=Yk.run(()=>{let n=new e(i,t);return Yk.setArchive(n),JSON.parse(new TextDecoder().decode(n.parse()))}),o=wg(a).document;if(Jk(o)){let e=new TextEncoder().encode(JSON.stringify(a)),t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);$k({type:`mainThreadVerticalFallback`,id:r,documentJson:t},[t]);return}let s=[];n.useGoogleFonts&&(s=await j(pk(o),dk));let c=[];o.embeddedFonts?.length&&(c=await Bk(o,async e=>{let t=Yk.archive;if(!t)throw Error(`No docx loaded`);return new Uint8Array(Yk.run(()=>t.extract_image(e))).slice()}));let l=await Wk(o);Zk=l.faces,Xk=Kk(o,Fk(o,{localMetrics:l.metrics,useGoogleFonts:!!n.useGoogleFonts,embeddedFaces:c,googleFaces:s}),n.defaultCurrentDateMs);let u=Xk.layoutVariants.defaultLayout,d=u.pages.map(e=>({widthPt:e.geometry.widthPt,heightPt:e.geometry.heightPt}));$k({type:`parsedMeta`,id:r,meta:{pageCount:u.pages.length,comments:o.comments??[],footnotes:o.footnotes??[],endnotes:o.endnotes??[],pageSizes:d,bookmarkPages:[...zk(u)]}});return}if(n.type===`renderPage`){if(!Xk)throw Error(`Document not loaded`);let e=new OffscreenCanvas(1,1);await Rk(Xk.model,e,n.pageIndex,{...n.opts,fetchImage:eA,layoutServices:Xk.layoutServices,defaultCurrentDateMs:Xk.defaultCurrentDateMs});let t=Ay(Xk.layoutServices,n.pageIndex,{...n.opts,defaultCurrentDateMs:Xk.defaultCurrentDateMs}),i=e.transferToImageBitmap();$k({type:`pageRendered`,id:r,bitmap:i,runs:t},[i]);return}if(n.type===`collectRuns`){if(!Xk)throw Error(`Document not loaded`);$k({type:`runsCollected`,id:r,runs:Ay(Xk.layoutServices,n.pageIndex,{...n.opts,defaultCurrentDateMs:Xk.defaultCurrentDateMs})});return}if(n.type===`extractImage`){let e=Yk.archive;if(!e)throw Error(`No docx loaded`);let t=Yk.run(()=>e.extract_image(n.path)),i=new Uint8Array(t).slice().buffer;$k({type:`imageExtracted`,id:r,bytes:i},[i]);return}if(n.type===`toMarkdown`){let e=Yk.archive;if(!e)throw Error(`No docx loaded`);$k({type:`markdownRendered`,id:r,markdown:Yk.run(()=>e.to_markdown())});return}}catch(e){let t=e instanceof Error?e:Error(String(e)),n=t;$k({type:`error`,id:r,message:t.message,errorName:t.name,...n.code===void 0?{}:{code:n.code},...n.reason===void 0?{}:{reason:n.reason},...n.outgoingColumnIndex===void 0?{}:{outgoingColumnIndex:n.outgoingColumnIndex},...n.outgoingColumnCount===void 0?{}:{outgoingColumnCount:n.outgoingColumnCount},...n.incomingColumnCount===void 0?{}:{incomingColumnCount:n.incomingColumnCount}})}};", t = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", e], { type: "text/javascript;charset=utf-8" });
2
+ var e = "var e=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,n.unregister(this),e}free(){let e=this.__destroy_into_raw();v.__wbg_docxarchive_free(e,0)}extract_image(e){let t=d(e,v.__wbindgen_malloc,v.__wbindgen_realloc),n=_,i=v.docxarchive_extract_image(this.__wbg_ptr,t,n);if(i[3])throw f(i[2]);var a=r(i[0],i[1]).slice();return v.__wbindgen_free(i[0],i[1]*1,1),a}constructor(e,t){let r=u(e,v.__wbindgen_malloc),i=_,a=v.docxarchive_new(r,i,!l(t),l(t)?BigInt(0):t);if(a[2])throw f(a[1]);return this.__wbg_ptr=a[0]>>>0,n.register(this,this.__wbg_ptr,this),this}parse(){let e=v.docxarchive_parse(this.__wbg_ptr);if(e[3])throw f(e[2]);var t=r(e[0],e[1]).slice();return v.__wbindgen_free(e[0],e[1]*1,1),t}to_markdown(){let e,t;try{let i=v.docxarchive_to_markdown(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,f(i[2]);return e=n,t=r,o(n,r)}finally{v.__wbindgen_free(e,t,1)}}};Symbol.dispose&&(e.prototype[Symbol.dispose]=e.prototype.free);function t(){return{__proto__:null,\"./docx_parser_bg.js\":{__proto__:null,__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(o(e,t))},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(o(e,t))}finally{v.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=d(n,v.__wbindgen_malloc,v.__wbindgen_realloc),i=_;a().setInt32(e+4,i,!0),a().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return o(e,t)},__wbindgen_init_externref_table:function(){let e=v.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}const n=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>v.__wbg_docxarchive_free(e>>>0,1));function r(e,t){return e>>>=0,c().subarray(e/1,e/1+t)}let i=null;function a(){return(i===null||i.buffer.detached===!0||i.buffer.detached===void 0&&i.buffer!==v.memory.buffer)&&(i=new DataView(v.memory.buffer)),i}function o(e,t){return e>>>=0,h(e,t)}let s=null;function c(){return(s===null||s.byteLength===0)&&(s=new Uint8Array(v.memory.buffer)),s}function l(e){return e==null}function u(e,t){let n=t(e.length*1,1)>>>0;return c().set(e,n/1),_=e.length,n}function d(e,t,n){if(n===void 0){let n=g.encode(e),r=t(n.length,1)>>>0;return c().subarray(r,r+n.length).set(n),_=n.length,r}let r=e.length,i=t(r,1)>>>0,a=c(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=c().subarray(i+o,i+r),a=g.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return _=o,i}function f(e){let t=v.__wbindgen_externrefs.get(e);return v.__externref_table_dealloc(e),t}let p=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});p.decode();let m=0;function h(e,t){return m+=t,m>=2146435072&&(p=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),p.decode(),m=t),p.decode(c().subarray(e,e+t))}const g=new TextEncoder;`encodeInto`in g||(g.encodeInto=function(e,t){let n=g.encode(e);return t.set(n),{read:e.length,written:n.length}});let _=0,v;function y(e,t){return v=e.exports,i=null,s=null,v.__wbindgen_start(),v}async function b(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}async function x(e){if(v!==void 0)return v;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`));let n=t();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:r,module:i}=await b(await e,n);return y(r,i)}async function S(e){return v=void 0,i=null,s=null,x(e)}const C=new Map;function w(e,t,n){let r=C.get(e);if(r&&r.set===t)return r.refs++,{face:r.face,isNew:!1};let i=n();return C.set(e,{face:i,set:t,refs:1}),{face:i,isNew:!0}}function T(e){let t=new Set;for(let n of e)if(!t.has(n)){t.add(n);for(let[e,t]of C)if(t.face===n){if(t.refs--,t.refs<=0){try{t.set.delete(n)}catch{}C.delete(e)}break}}}function E(e){return Promise.race([e,new Promise(e=>setTimeout(e,15e3))])}const D=new Map;function O(e){let t=[],n=/@font-face\\s*\\{([^}]*)\\}/g,r;for(;r=n.exec(e);){let e=r[1],n=t=>e.match(RegExp(`(?:^|;|\\\\n)\\\\s*${t}\\\\s*:\\\\s*([^;]+)`,`i`))?.[1].trim(),i=n(`font-family`),a=n(`src`);if(!i||!a)continue;let o={},s=n(`font-style`);s&&(o.style=s);let c=n(`font-weight`);c&&(o.weight=c);let l=n(`font-stretch`);l&&(o.stretch=l);let u=n(`unicode-range`);u&&(o.unicodeRange=u),t.push({family:i.replace(/^['\"]|['\"]$/g,``),src:a,descriptors:o})}return t}function k(){return typeof document<`u`&&document&&document.fonts?document.fonts:typeof self<`u`&&self&&`fonts`in self?self.fonts:null}function A(e,t){let n=t.descriptors;return[`gfonts`,e,t.family.toLowerCase(),n.style??``,n.weight??``,n.stretch??``,n.unicodeRange??``,t.src].join(`|`)}async function j(e,t){let n=k();if(!n||typeof FontFace>`u`||typeof fetch>`u`)return[];let r=new Set,i=new Set,a=new Set,o=new Map,s=new Set;for(let n of e){if(!n)continue;let e=n.toLowerCase();if(r.has(e))continue;r.add(e);let s=t[e];if(!s)continue;a.add(s.url);let c=(s.loadFamily??n).toLowerCase();i.add(c);let l=o.get(s.url);l||(l=new Set,o.set(s.url,l)),l.add(c)}if(i.size===0)return[];let c=await E(Promise.all([...a].map(async e=>{let t=D.get(e);if(t)return{url:e,rules:await t};let n=(async()=>{try{let t=await fetch(e);if(!t.ok)throw Error(`HTTP ${t.status}`);return O(await t.text())}catch{D.delete(e);for(let t of o.get(e)??[])s.add(t);return[]}})();return D.set(e,n),{url:e,rules:await n}}))),l=[],u=[];for(let e of Array.isArray(c)?c:[])for(let t of e.rules){let{face:r,isNew:i}=w(A(e.url,t),n,()=>{let e=new FontFace(t.family,t.src,t.descriptors);return n.add(e),e});l.push(r),i&&u.push(r)}return u.length>0&&await E(Promise.allSettled(u.map(e=>e.load())).then(e=>(e.forEach((e,t)=>{e.status===`rejected`&&s.add(u[t].family.replace(/['\"]/g,``).toLowerCase())}),n.ready))),s.size>0&&console.warn(`[ooxml] failed to preload web font(s): ${[...s].join(`, `)}; falling back to system fonts (text may shift or differ).`),l}function M(e,t){let n=N(t),r=e.slice(),i=Math.min(32,r.length);for(let e=0;e<i;e++)r[e]^=n[e%16];return r}function N(e){let t=e.replace(/[{}\\-\\s]/g,``);if(t.length!==32||/[^0-9a-fA-F]/.test(t))throw Error(`invalid fontKey GUID: ${e}`);let n=new Uint8Array(16);for(let e=0;e<16;e++)n[e]=parseInt(t.slice(e*2,e*2+2),16);return n.reverse()}function ee(e,t,n,r){let i=2166136261;for(let e=0;e<r.length;e++)i^=r[e],i=Math.imul(i,16777619);return`${e}|${t}|${n}|${r.length}|${(i>>>0).toString(16)}`}async function te(e,t=30*1024*1024){let n=k();if(!n||typeof FontFace>`u`)return[];let r=[],i=[],a=[];for(let o of e)try{if(o.bytes.length===0||o.bytes.length>t){a.push(o.family);continue}let e=o.odttf?M(o.bytes,o.fontKey??``):o.bytes,{face:s,isNew:c}=w(`embedded:${ee(o.family,o.weight,o.style,e)}`,n,()=>{let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),r=new FontFace(o.family,t,{weight:o.weight,style:o.style});return n.add(r),r});r.push(s),c&&i.push(s)}catch{a.push(o.family)}return i.length>0&&await E(Promise.allSettled(i.map(e=>e.load())).then(e=>(e.forEach((e,t)=>{e.status===`rejected`&&a.push(i[t].family)}),n.ready))),a.length>0&&console.warn(`[ooxml] failed to register embedded font(s): ${[...new Set(a)].join(`, `)}; falling back to substitute fonts (text may shift or differ).`),r}const P=`https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;700&display=swap`,ne=`https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;700&display=swap`,F={calibri:{url:`https://fonts.googleapis.com/css2?family=Carlito:ital,wght@0,400;0,700;1,400;1,700&display=swap`,loadFamily:`Carlito`},\"calibri light\":{url:`https://fonts.googleapis.com/css2?family=Carlito:ital,wght@0,400;0,700;1,400;1,700&display=swap`,loadFamily:`Carlito`},cambria:{url:`https://fonts.googleapis.com/css2?family=Caladea:ital,wght@0,400;0,700;1,400;1,700&display=swap`,loadFamily:`Caladea`},\"cambria math\":{url:`https://fonts.googleapis.com/css2?family=Caladea:ital,wght@0,400;0,700;1,400;1,700&display=swap`,loadFamily:`Caladea`},\"nunito sans\":{url:`https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap`},nunito:{url:`https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,400;0,700;1,400;1,700&display=swap`},\"open sans\":{url:`https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap`},roboto:{url:`https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700&display=swap`},lato:{url:`https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;1,400;1,700&display=swap`},montserrat:{url:`https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,700;1,400;1,700&display=swap`},poppins:{url:`https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,700;1,400;1,700&display=swap`},raleway:{url:`https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,400;0,700;1,400;1,700&display=swap`},\"playfair display\":{url:`https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&display=swap`},ubuntu:{url:`https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,400;0,700;1,400;1,700&display=swap`},\"sakkal majalla\":{url:P,loadFamily:`Noto Naskh Arabic`},\"traditional arabic\":{url:P,loadFamily:`Noto Naskh Arabic`},\"simplified arabic\":{url:P,loadFamily:`Noto Naskh Arabic`},\"arabic typesetting\":{url:P,loadFamily:`Noto Naskh Arabic`},\"univers next arabic\":{url:ne,loadFamily:`Noto Sans Arabic`},\"noto naskh arabic\":{url:P,loadFamily:`Noto Naskh Arabic`},\"noto sans arabic\":{url:ne,loadFamily:`Noto Sans Arabic`}};function I(e,t){let n=e.trim();if(!n)throw TypeError(`Canvas font route requires a family list`);return Object.freeze({familyList:n,scope:t,fingerprint:`canvas-font-route-v1:${encodeURIComponent(t)}:${encodeURIComponent(n)}`})}function L(e,t,n,r){if(!Number.isFinite(t)||t<0)throw RangeError(`Canvas font size must be finite and non-negative`);if(!Number.isFinite(n)||n<1||n>1e3)throw RangeError(`Canvas font weight must be finite and between 1 and 1000`);if(!e.familyList.trim())throw TypeError(`Canvas font route requires a family list`);return`${r} ${n} ${t}px ${e.familyList}`}function R(e){if(!e)return null;let t=e.toLowerCase();return/[ᄀ-ᇿ㄰-㆏가-힯]/.test(e)?`kr`:/[぀-ヿ]/.test(e)?`jp`:/jhenghei|微軟正黑|新細明|細明|pmingliu|mingliu|dfkai|標楷|華康|cns11643|kaiti tc|ming\\s*liu/.test(t)||/新細明體|細明體|標楷體|微軟正黑體|華康/.test(e)?`tc`:/simsun|nsimsun|simhei|simkai|simfang|yahei|dengxian|fangsong|kaiti|youyuan|lisu|stsong|stkaiti|stfangsong|stheiti|stxihei|stzhongsong|songti sc|heiti sc|微软雅黑/.test(t)||/宋体|黑体|楷体|仿宋|等线|微软雅黑|隶书|幼圆/.test(e)?`sc`:/malgun|batang|gulim|dotum|gungsuh|nanum|new gulim|hancom|hy(gothic|graphic|namu)?/.test(t)?`kr`:/\\bmeiryo\\b|\\byu\\s*(gothic|mincho)\\b|yugothic|yumincho|hiragino|\\bms\\s*(gothic|mincho|pgothic|pmincho|ui\\s*gothic)\\b|\\bms[pg]?(gothic|mincho)\\b|ipa(ex)?(gothic|mincho)|noto\\s+(sans|serif)\\s+jp|游ゴシック|游明朝|MS|メイリオ|ヒラギノ/.test(t)||/游ゴシック|游明朝|MS ゴシック|MS 明朝|MS Pゴシック|メイリオ|ヒラギノ/.test(e)?`jp`:null}function z(e){if(!e)return`sans`;let t=e.toLowerCase();return/mono|courier|consolas|等幅|gothic_m/.test(t)?`mono`:/roman|times|cambria|caladea|georgia|garamond|century(?!\\s*gothic)|palatino|antiqua|didot|bodoni|playfair|source serif|noto serif|min\\s*cho|明朝体|明朝|song|sung|simsun|nsimsun|batang|gungsuh|ming\\s*liu|mingliu|pmingliu|fang\\s*song|fangsong|kai\\s*ti|kaiti|simkai|simfang|stsong|stkaiti|stfangsong|stzhongsong|新細明|細明|宋体|楷体|楷體|仿宋|標楷|游明朝|MS 明朝|ms mincho|yu mincho|hiragino mincho|ヒラギノ明朝/.test(t)||/新細明體|細明體|宋体|明朝|楷体|楷體|仿宋|標楷體|游明朝|MS 明朝/.test(e)?`serif`:`sans`}function B(e,t){let n=t===`serif`?`Noto Serif`:`Noto Sans`,r={jp:[`jp`,`sc`,`tc`,`kr`],sc:[`sc`,`tc`,`jp`,`kr`],tc:[`tc`,`sc`,`jp`,`kr`],kr:[`kr`,`jp`,`sc`,`tc`]},i={kr:`KR`,sc:`SC`,tc:`TC`,jp:`JP`};return r[e].map(e=>`${n} ${i[e]}`)}const V=[`Noto Sans`,`Noto Sans Hebrew`,`Noto Sans Thai`,`Noto Sans Devanagari`],H=[`Noto Serif`,`Noto Serif Hebrew`],U=e=>`https://fonts.googleapis.com/css2?family=${e}:wght@400;700&display=swap`,re={\"noto sans kr\":{url:U(`Noto+Sans+KR`)},\"noto sans sc\":{url:U(`Noto+Sans+SC`)},\"noto sans tc\":{url:U(`Noto+Sans+TC`)},\"noto sans jp\":{url:U(`Noto+Sans+JP`)},\"noto serif kr\":{url:U(`Noto+Serif+KR`)},\"noto serif sc\":{url:U(`Noto+Serif+SC`)},\"noto serif tc\":{url:U(`Noto+Serif+TC`)},\"noto serif jp\":{url:U(`Noto+Serif+JP`)},\"noto sans\":{url:U(`Noto+Sans`)},\"noto serif\":{url:U(`Noto+Serif`)},\"noto sans devanagari\":{url:U(`Noto+Sans+Devanagari`)},\"noto sans thai\":{url:U(`Noto+Sans+Thai`)},\"noto sans hebrew\":{url:U(`Noto+Sans+Hebrew`)},\"noto serif hebrew\":{url:U(`Noto+Serif+Hebrew`)}};function ie(e,t){let n=!1,r=!1,i=!1,a=!1,o=!1,s=!1,c=!1,l=!1,u=()=>n&&r&&i&&a&&o&&s&&c&&l;outer:for(let t of e)if(t)for(let e of t){let t=e.codePointAt(0);if(t!==void 0&&!(t<=591)&&(t>=4352&&t<=4607||t>=12592&&t<=12687||t>=44032&&t<=55215?r=!0:t>=12352&&t<=12543?i=!0:t>=13312&&t<=19903||t>=19968&&t<=40959||t>=63744&&t<=64255||t>=131072&&t<=195103?n=!0:t>=1536&&t<=1791||t>=1872&&t<=1919||t>=2208&&t<=2303||t>=64336&&t<=65023||t>=65136&&t<=65279?a=!0:t>=3584&&t<=3711?o=!0:t>=1424&&t<=1535||t>=64285&&t<=64335?s=!0:t>=2304&&t<=2431?c=!0:(t>=1024&&t<=1279||t>=880&&t<=1023)&&(l=!0),u()))break outer}let d=[],f=new Set;r&&f.add(`kr`),i&&f.add(`jp`),n&&f.size===0&&f.add(t??`jp`);for(let e of[`kr`,`sc`,`tc`,`jp`])if(f.has(e)){let t={kr:`KR`,sc:`SC`,tc:`TC`,jp:`JP`}[e];d.push(`Noto Sans ${t}`,`Noto Serif ${t}`)}return l&&d.push(`Noto Sans`,`Noto Serif`),a&&d.push(`Noto Naskh Arabic`,`Noto Sans Arabic`),o&&d.push(`Noto Sans Thai`),s&&d.push(`Noto Sans Hebrew`,`Noto Serif Hebrew`),c&&d.push(`Noto Sans Devanagari`),d}const ae={167:`♣`,168:`♦`,169:`♥`,170:`♠`,171:`↔`,172:`←`,173:`↑`,174:`→`,175:`↓`,183:`•`,184:`÷`,185:`≠`,180:`×`,176:`°`,177:`±`,163:`≤`,179:`≥`},oe={33:`✏`,34:`✂`,36:`👓`,74:`☺`,75:`😐`,76:`☹`,118:`❖`,167:`▪`,108:`●`,110:`■`,116:`◆`,119:`◆`,251:`✗`,252:`✓`,253:`☒`,254:`☑`,223:`←`,224:`→`,225:`↑`,226:`↓`,227:`↖`,228:`↗`,229:`↙`,230:`↘`};function se(e){let t={};for(let n of Object.keys(e)){let r=Number(n);t[r]=e[r],t[61440+r]=e[r]}return t}const ce=se(ae),le=se(oe);function ue(e,t){if(!t)return e;let n=t.trim().toLowerCase(),r=n===`wingdings`?le:n===`symbol`?ce:null;return r?r[e.charCodeAt(0)]??e:e}function de(e){if(!e)return!1;let t=e.toLowerCase();return t===`symbol`||t.includes(`wingdings`)}function W(e,t){if(!de(t)||e.length===0)return[{text:e,mapped:!1}];let n=[],r=``,i=null;for(let a of e){let e=ue(a,t),o=e!==a;i===null||o===i?(i=o,r+=e):(n.push({text:r,mapped:i}),i=o,r=e)}return r.length>0&&n.push({text:r,mapped:i??!1}),n}function G(e,t,n){return e.titleFontSizeHpt?e.titleFontSizeHpt/100*n:Math.max(10,t*.085)}const fe=.62;function pe(e,t,n,r,i){if(!e.title)return{fontPx:0,topPad:0,bottomPad:0,bandH:0};let a=G(e,t,n),o=a+t*r+t*i,s=Math.min(Math.max(0,o-a),a*fe);return{fontPx:a,topPad:s,bottomPad:o-a-s,bandH:o}}function me(e,t,n,r){if(!e.showLegend)return null;let i=e.legendPos??`r`,a=i===`l`?`l`:i===`t`?`t`:i===`b`?`b`:`r`;return a===`r`||a===`l`?{side:a,reserveW:Math.max(80,t*r),reserveH:0}:{side:a,reserveW:0,reserveH:Math.max(18,n*.08)}}function he(e){return{legRightW:e?.side===`r`?e.reserveW:0,legLeftW:e?.side===`l`?e.reserveW:0,legTopH:e?.side===`t`?e.reserveH:0,legBottomH:e?.side===`b`?e.reserveH:0}}function ge(e,t,n){return e?e/100*n:Math.max(8,Math.min(10,t*.045))}function _e(e){return Math.max(8,e*.02)}function ve(e,t,n,r){let i=ge(e.catAxisTitleFontSizeHpt,n,r),a=ge(e.valAxisTitleFontSizeHpt,n,r);return{catFontPx:i,valFontPx:a,catBandH:e.catAxisTitle?i+_e(n)+4:0,valBandW:e.valAxisTitle?a+_e(t)+4:0}}function ye(e,t,n){if(!e.title)return{fontPx:0,topPad:0,bottomPad:0,bandH:0};let r=G(e,t,n),i=r*2.25,a=Math.min(Math.max(0,i-r),r*fe);return{fontPx:r,topPad:a,bottomPad:i-r-a,bandH:i}}function be(e){return e*2.75}function K(e,t,n,r,i,a,o){let s=o.titleBand??pe(e,i,a,o.titleTopPadFrac??0,o.titleBottomPadFrac??0),c=me(e,r,i,o.legendSideReserveFrac),l=he(c),u=ve(e,r,i,a),d,f,p,m;if(o.radialGapFrac!=null){let e=i*o.radialGapFrac;p=r-l.legRightW-l.legLeftW,m=i-s.bandH-l.legTopH-l.legBottomH-e,d=t+l.legLeftW,f=n+s.bandH+l.legTopH+e}else{let a=o.pad;if(!a)throw Error(`computeChartFrame: cartesian frame requires params.pad`);let s=o.honorPlotAreaManualLayout?e.plotAreaManualLayout:null;if(s&&s.w!=null&&s.h!=null){let e=t+s.x*r,o=n+s.y*i,c=e+s.w*r,l=o+s.h*i;if(s.layoutTarget===`inner`){d=Math.max(e,t+a.l),f=Math.max(o,n+a.t);let s=Math.min(c,t+r-a.r),u=Math.min(l,n+i-a.b);p=Math.max(0,s-d),m=Math.max(0,u-f)}else d=e,f=o,p=s.w*r,m=s.h*i}else d=t+a.l,f=n+a.t,p=r-a.l-a.r,m=i-a.t-a.b}return{title:s,legend:c,legendBands:l,axisTitles:u,plotRect:{px0:d,py0:f,pw:p,ph:m},center:{cx:d+p/2,cy:f+m/2}}}function xe(e,t=5){if(e===0)return 1;let n=e/t,r=10**Math.floor(Math.log10(n)),i=n/r;return(i<1.5?1:i<3.5?2:i<7.5?5:10)*r}function Se(e,t,n=0){if(e<=0)return t;let r=e+(e-n)/20;return Math.ceil(r/t)*t}function Ce(e,t){if(e>=0)return 0;let n=Math.floor(e/t)*t;return Math.abs(n-e)<t*1e-9?n-t:n}function we(e){return e==null||!isFinite(e)||e<=0?5:Math.min(15,Math.max(4,Math.round(e/42)))}function Te(e,t,n,r,i,a){let o=xe(t-e,we(i)),s=a!=null&&isFinite(a)&&a>0?a:o,c=n??Ce(e,o);return{min:c,max:r??Se(t,o,c),step:s}}function Ee(e,t,n,r){let i,a=r?.logBase;if(a!=null&&isFinite(a)&&a>=2&&t>0&&n>0){let r=Math.log(t),a=Math.log(n)-r;i=a===0?0:(Math.log(Math.max(e,Number.MIN_VALUE))-r)/a}else{let r=n-t;i=r===0?0:(e-t)/r}return r?.reversed?1-i:i}function De(e,t,n,r,i){let a=isFinite(n)&&n>=2?n:10,o=e=>Math.log(e)/Math.log(a),s=t>0?t:1,c=Math.floor(o(e>0?e:s)),l=Math.ceil(o(s)),u=r??a**+c,d=i??a**+Math.max(l,c+1),f=[],p=Math.ceil(o(u)-1e-9),m=Math.floor(o(d)+1e-9);for(let e=p;e<=m;e++)f.push(a**+e);return{min:u,max:d,lines:f}}function Oe(e,t,n,r){let i=Math.min(e.length,t.length);if(i<2)return{xs:[],ys:[]};if(n===`linear`){let n=r?.intercept,a=0,o=0,s=0,c=0;for(let n=0;n<i;n++)a+=e[n],o+=t[n],s+=e[n]*e[n],c+=e[n]*t[n];let l,u;if(n!=null&&isFinite(n)){let e=s,t=c-n*a;l=e===0?0:t/e,u=n}else{let e=i*s-a*a;l=e===0?0:(i*c-a*o)/e,u=(o-l*a)/i}let d=e[0],f=e[i-1];return{xs:[d,f],ys:[l*d+u,l*f+u]}}if(n===`movingAvg`){let n=Math.max(2,Math.round(r?.period??2));if(i<n)return{xs:[],ys:[]};let a=[],o=[];for(let r=n-1;r<i;r++){let i=0;for(let e=0;e<n;e++)i+=t[r-e];a.push(e[r]),o.push(i/n)}return{xs:a,ys:o}}return{xs:[],ys:[]}}const ke=12700;function Ae(e,t){return e?Math.max(.5,e/ke)*t:1}function je(e,t,n){return{color:e?`#${e}`:`#aaa`,width:Ae(t,n)}}function Me(e,t,n){return{color:e?`#${e}`:`#e0e0e0`,width:t?Ae(t,n):.5}}function Ne(e){return e.catAxisCrossBetween!==`midCat`}const Pe=864e5,Fe=Date.UTC(1899,11,30),Ie=Date.UTC(1904,0,1);function Le(e,t=!1){if(t)return new Date(Ie+e*Pe);let n=e<60?e+1:e;return new Date(Fe+n*Pe)}function Re(e,t){if(!Number.isFinite(e))return String(e);let n=Math.max(0,Math.trunc(t)),r=e<0,[i,a=``]=ze(Math.abs(e).toString()).split(`.`),o=a.padEnd(n+1,`0`),s=o.slice(0,n),c=o.charCodeAt(n)-48,l=(i+s).split(``).map(e=>e.charCodeAt(0)-48);if(c>=5){let e=l.length-1;for(;e>=0;e--)if(l[e]===9)l[e]=0;else{l[e]+=1;break}e<0&&l.unshift(1)}let u=l.map(e=>String(e)).join(``),d=n,f=(d>0?u.slice(0,u.length-d):u)||`0`,p=d>0?u.slice(u.length-d):``,m=f.replace(/^0+(?=\\d)/,``),h=p.length>0?`${m}.${p}`:m,g=/^[0.]*$/.test(h)&&!/[1-9]/.test(h);return r&&!g?`-${h}`:h}function ze(e){let t=/^(\\d+)(?:\\.(\\d+))?[eE]([+-]?\\d+)$/.exec(e);if(!t)return e;let[,n,r=``,i]=t,a=parseInt(i,10),o=n+r,s=n.length+a;return s<=0?`0.`+`0`.repeat(-s)+o:s>=o.length?o+`0`.repeat(s-o.length):o.slice(0,s)+`.`+o.slice(s)}function Be(e){return Number.isInteger(e)?String(e):Re(e,6).replace(/\\.?0+$/,``)}function Ve(e,t,n=!1){if(!t||t.trim().toLowerCase()===`general`)return Be(e);if(Ue(t))return We(e,t,n);let r=Ge(t),i;return i=e>0?r[0]??t:e<0?r[1]??r[0]??t:r[2]??r[0]??t,i===``?``:(e<0&&r.length<2?`-`:``)+Ke(Math.abs(e),i)}function He(e,t,n=!1){if(!t||e.trim()===``)return e;let r=Number(e);return Number.isFinite(r)?Ve(r,t,n):e}function Ue(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`\"`){t=!t;continue}if(!t){if(r===`\\\\`){n++;continue}if(r===`[`){for(;n<e.length&&e[n]!==`]`;)n++;continue}if(r===`y`||r===`Y`||r===`d`||r===`D`||r===`m`||r===`M`||r===`h`||r===`H`||r===`s`||r===`S`)return!0}}return!1}function We(e,t,n=!1){let r=Le(Math.floor(e),n),i=r.getUTCFullYear(),a=r.getUTCMonth()+1,o=r.getUTCDate(),s=(e-Math.floor(e))*86400,c=Math.floor(s/3600),l=Math.floor(s%3600/60),u=Math.floor(s%60),d=``,f=!1,p=0;for(;p<t.length;){let e=t[p];if(e===`\"`){f=!f,p++;continue}if(f){d+=e,p++;continue}if(e===`\\\\`&&p+1<t.length){d+=t[p+1],p+=2;continue}if(e===`[`){for(;p<t.length&&t[p]!==`]`;)p++;p<t.length&&p++;continue}if(e===`y`||e===`Y`){let e=0;for(;p<t.length&&(t[p]===`y`||t[p]===`Y`);)e++,p++;d+=e>=3?String(i):String(i%100).padStart(2,`0`);continue}if(e===`m`||e===`M`){let e=0;for(;p<t.length&&(t[p]===`m`||t[p]===`M`);)e++,p++;d.match(/[Hh]+\\W*$/)?d+=e>=2?String(l).padStart(2,`0`):String(l):d+=e>=2?String(a).padStart(2,`0`):String(a);continue}if(e===`d`||e===`D`){let e=0;for(;p<t.length&&(t[p]===`d`||t[p]===`D`);)e++,p++;d+=e>=2?String(o).padStart(2,`0`):String(o);continue}if(e===`h`||e===`H`){let e=0;for(;p<t.length&&(t[p]===`h`||t[p]===`H`);)e++,p++;d+=e>=2?String(c).padStart(2,`0`):String(c);continue}if(e===`s`||e===`S`){let e=0;for(;p<t.length&&(t[p]===`s`||t[p]===`S`);)e++,p++;d+=e>=2?String(u).padStart(2,`0`):String(u);continue}d+=e,p++}return d}function Ge(e){let t=[],n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\\\`&&r+1<e.length){n+=i+e[r+1],r++;continue}if(i===`\"`){for(n+=i,r++;r<e.length&&e[r]!==`\"`;)n+=e[r],r++;r<e.length&&(n+=e[r]);continue}if(i===`[`){for(n+=i,r++;r<e.length&&e[r]!==`]`;)n+=e[r],r++;r<e.length&&(n+=e[r]);continue}if(i===`;`){t.push(n),n=``;continue}n+=i}return t.push(n),t}function Ke(e,t){let n=[],r=0,i=!1,a=!1;for(;r<t.length;){let e=t[r];if(e===`\"`){r++;let e=``;for(;r<t.length&&t[r]!==`\"`;)e+=t[r],r++;r<t.length&&r++,n.push({kind:`lit`,text:e});continue}if(e===`\\\\`&&r+1<t.length){n.push({kind:`lit`,text:t[r+1]}),r+=2;continue}if(e===`_`&&r+1<t.length){n.push({kind:`lit`,text:` `}),r+=2;continue}if(e===`*`&&r+1<t.length){r+=2;continue}if(e===`[`){for(r++;r<t.length&&t[r]!==`]`;)r++;r<t.length&&r++;continue}if(e===`%`){a=!0,n.push({kind:`lit`,text:`%`}),r++;continue}if(e===`#`||e===`0`||e===`.`||e===`,`||e===`?`){let e=``;for(;r<t.length&&(t[r]===`#`||t[r]===`0`||t[r]===`.`||t[r]===`,`||t[r]===`?`);)e+=t[r],r++;n.push({kind:`num`,text:e}),i=!0;continue}n.push({kind:`lit`,text:e}),r++}if(!i)return n.map(e=>e.text).join(``);let o=a?e*100:e,s=``;for(let e of n)e.kind===`num`&&(s+=e.text);let c=qe(o,s),l=!1;return n.map(e=>e.kind===`lit`?e.text:l?``:(l=!0,c)).join(``)}function qe(e,t){let n=t.indexOf(`.`),r=n>=0?t.slice(0,n):t,i=n>=0?t.slice(n+1):``,a=/,/.test(r),o=(i.match(/[#0?]/g)??[]).length,s=(r.replace(/,/g,``).match(/0/g)??[]).length,[c,l=``]=Re(e,o).split(`.`),u=c.padStart(s,`0`),d=a?u.replace(/\\B(?=(\\d{3})+(?!\\d))/g,`,`):u;return o===0?d:`${d}.${l.padEnd(o,`0`)}`}function Je(e,t,n){if(t===``||n<=0)return``;if(e.measureText(t).width<=n)return t;if(e.measureText(`…`).width>n)return``;let r=0,i=t.length-1,a=0;for(;r<=i;){let o=r+i>>1;e.measureText(t.slice(0,o)+`…`).width<=n?(a=o,r=o+1):i=o-1}let o=a>0?t.charCodeAt(a-1):0;return o>=55296&&o<=56319&&a--,t.slice(0,a)+`…`}function Ye(e,t){return[Math.max(1,Math.ceil(e)),Math.max(1,Math.ceil(t))]}function Xe(e,t){let[n,r]=Ye(e,t);if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(n,r);if(typeof document<`u`){let e=document.createElement(`canvas`);return e.width=n,e.height=r,e}return null}const Ze={pct5:[0,16,0,0,0,1,0,0],pct10:[136,0,34,0,136,0,34,0],pct20:[136,34,136,34,136,34,136,34],pct25:[136,85,34,85,136,85,34,85],pct30:[170,85,170,85,170,85,170,85],pct40:[170,119,170,221,170,119,170,221],pct50:[170,85,170,85,170,85,170,85],pct60:[221,85,119,85,221,85,119,85],pct70:[238,85,187,85,238,85,187,85],pct75:[238,170,187,170,238,170,187,170],pct80:[254,239,251,191,254,239,251,191],pct90:[255,239,255,251,255,239,255,251],horz:[255,0,0,0,255,0,0,0],vert:[136,136,136,136,136,136,136,136],ltHorz:[0,255,0,0,0,0,0,0],ltVert:[32,32,32,32,32,32,32,32],dkHorz:[255,255,0,0,255,255,0,0],dkVert:[204,204,204,204,204,204,204,204],narHorz:[255,0,255,0,255,0,255,0],narVert:[170,170,170,170,170,170,170,170],cross:[255,136,136,136,255,136,136,136],lgGrid:[255,128,128,128,128,128,128,128],smGrid:[255,136,136,136,255,136,136,136],dotGrid:[136,0,0,0,136,0,0,0],dnDiag:[128,64,32,16,8,4,2,1],upDiag:[1,2,4,8,16,32,64,128],ltDnDiag:[136,68,34,17,136,68,34,17],ltUpDiag:[17,34,68,136,17,34,68,136],dkDnDiag:[195,129,0,129,195,129,0,129],dkUpDiag:[195,129,0,129,195,129,0,129],wdDnDiag:[128,64,32,16,8,4,2,129],wdUpDiag:[1,2,4,8,16,32,64,129],diagCross:[129,66,36,24,24,36,66,129],horzBrick:[255,16,16,16,255,1,1,1],diagBrick:[129,66,36,24,36,66,129,0],lgCheck:[240,240,240,240,15,15,15,15],smCheck:[204,204,51,51,204,204,51,51],trellis:[165,90,165,90,165,90,165,90]};function Qe(e,t,n){let r=Ze[e];if(!r)return null;let i=Xe(8,8);if(!i)return null;let a=i.getContext(`2d`);if(!a)return null;a.fillStyle=$e(n),a.fillRect(0,0,8,8),a.fillStyle=$e(t);for(let e=0;e<8;e++){let t=r[e];for(let n=0;n<8;n++)t&1<<7-n&&a.fillRect(n,e,1,1)}return i}function $e(e){return`rgba(${parseInt(e.slice(0,2),16)},${parseInt(e.slice(2,4),16)},${parseInt(e.slice(4,6),16)},${e.length>=8?parseInt(e.slice(6,8),16)/255:1})`}function et(e,t){return e.map(e=>e*t)}const tt={dotted:[1,2],dashed:[3,2],dashSmallGap:[3,1],dotDash:[1,2,3,2],dotDotDash:[1,2,1,2,3,2],dashDotStroked:[1,2,3,2]};function nt(e,t){let n=tt[e];return n?et(n,t):[]}const rt={dash:[6,3],dot:[1.5,3],dashDot:[6,3,1.5,3],lgDash:[10,4],lgDashDot:[10,4,1.5,4],lgDashDotDot:[10,4,1.5,4,1.5,4],sysDash:[4,2],sysDot:[1,2],sysDashDot:[4,2,1,2],sysDashDotDot:[4,2,1,2,1,2]};function it(e,t){let n=rt[e];return n?et(n,t):[]}function at(e,t){let n=it(e,t);if(n.length>0)return n;let r=e.trim().split(/[\\s,]+/).map(Number);return r.length>=2&&r.every(e=>Number.isFinite(e)&&e>=0)&&r.some(e=>e>0)?(r.length%2!=0&&r.pop(),et(r,t)):[]}function ot(e,t=1){let n=e.charCodeAt(0)===35?e.slice(1):e;return`rgba(${parseInt(n.slice(0,2),16)},${parseInt(n.slice(2,4),16)},${parseInt(n.slice(4,6),16)},${n.length>=8?parseInt(n.slice(6,8),16)/255:t})`}function st(e){let t=e.charCodeAt(0)===35?e.slice(1):e,n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16);return .299*n+.587*r+.114*i}function ct(e){return e&&st(e)<128?`#FFFFFF`:`#000000`}function lt(e,t,n,r,i,a){if(!e||e.fillType===`none`)return null;if(e.fillType===`solid`)return ot(e.color);if(e.fillType===`pattern`)return dt(e,t);if(e.fillType===`gradient`){let o=e.stops;if(o.length===0)return null;if(o.length===1)return ot(o[0].color);let s;if(e.gradType===`radial`){let e=n+i/2,o=r+a/2,c=Math.sqrt(i*i+a*a)/2;s=t.createRadialGradient(e,o,0,e,o,c)}else{let o=e.angle*Math.PI/180,c=n+i/2,l=r+a/2,u=(Math.abs(Math.cos(o))*i+Math.abs(Math.sin(o))*a)/2;s=t.createLinearGradient(c-Math.cos(o)*u,l-Math.sin(o)*u,c+Math.cos(o)*u,l+Math.sin(o)*u)}for(let e of o)s.addColorStop(Math.min(1,Math.max(0,e.position)),ot(e.color));return s}return null}const ut=new WeakMap;function dt(e,t){let n=`${e.preset}|${e.fg}|${e.bg}`,r=ut.get(t);r||(r=new Map,ut.set(t,r));let i=r.get(n);if(i)return i;let a=Qe(e.preset,e.fg,e.bg);if(!a)return ot(e.fg);let o=t.createPattern(a,`repeat`);return o?(r.set(n,o),o):ot(e.fg)}function ft(e,t,n){if(!t){e.strokeStyle=`transparent`,e.lineWidth=0,e.setLineDash([]),e.lineCap=`butt`;return}e.strokeStyle=ot(t.color);let r=Math.max(.5,t.width*n);e.lineWidth=r;let i=t.dashStyle?at(t.dashStyle,r):[],a=t.lineCap??`butt`,o=i.some((e,t)=>t%2==0&&e===0);e.lineCap=a===`butt`&&o?`square`:a,e.setLineDash(i)}const pt=[`4472C4`,`ED7D31`,`A9D18E`,`FF0000`,`70AD47`,`4BACC6`,`FFC000`,`9E480E`,`843C0C`,`636363`,`255E91`,`967300`];function mt(e,t){return t?.color?`#${t.color}`:`#${pt[e%pt.length]}`}function ht(e,t){let n=t.dataPointColors?.[e];return n?`#${n}`:`#${pt[e%pt.length]}`}function gt(e,t){let n=e.startsWith(`#`)?e.slice(1):e;if(n.length<6)return`#${n}`;let r=Math.max(0,Math.min(1,t)),i=Math.round(parseInt(n.slice(0,2),16)*r),a=Math.round(parseInt(n.slice(2,4),16)*r),o=Math.round(parseInt(n.slice(4,6),16)*r),s=e=>e.toString(16).padStart(2,`0`);return`#${s(i)}${s(a)}${s(o)}`}function _t(e,t){return t&&(t.startsWith(`+mj`)?e.themeMajorFontLatin??null:t.startsWith(`+mn`)?e.themeMinorFontLatin??null:t)}function vt(e,t,n){let r=n===`major`?e.themeMajorFontLatin:e.themeMinorFontLatin,i=_t(e,t)??r;return i?`\"${i}\", Calibri, Arial, sans-serif`:`sans-serif`}function yt(e){return e===`pie`||e===`doughnut`}function bt(e){return!!e.varyColors&&e.series.length===1&&typeof e.chartType==`string`&&/Bar/.test(e.chartType)}function xt(e,t,n,r=!1){if(r||yt(e)){let e=t[0];return e?ht(n,e):`#${pt[n%pt.length]}`}return mt(n,t[n])}function St(e,t,n,r,i,a,o,s,c,l=`sans-serif`){e.save(),e.font=`${o?`bold `:``}${a}px ${l}`,e.fillStyle=s;let u=Je(e,t,c);i===`cat`?(e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(u,n,r)):(e.translate(n,r),e.rotate(-Math.PI/2),e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(u,0,0)),e.restore()}function Ct(e){return e?`#${e}`:`#555`}function wt(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(t.valAxisTitle){let r=n+u+_e(i)+p/2,a=s+l/2;St(e,t.valAxisTitle,r,a,`val`,p,t.valAxisTitleFontBold??!0,Ct(t.valAxisTitleFontColor),l,vt(t,t.valAxisTitleFontFace,`major`))}if(t.catAxisTitle){let n=o+c/2,i=r+a-d-_e(a)-f/2;St(e,t.catAxisTitle,n,i,`cat`,f,t.catAxisTitleFontBold??!0,Ct(t.catAxisTitleFontColor),c,vt(t,t.catAxisTitleFontFace,`major`))}}function Tt(e){return e&&(e===`line`||e===`stackedLine`||e===`stackedLinePct`||e===`radar`||e===`scatter`||e===`stock`)?`line`:`fill`}function Et(e,t,n){if(e!==`scatter`)return!1;let r=t??`marker`;return(r===`line`||r===`lineMarker`||r===`lineNoMarker`||r===`smooth`||r===`smoothMarker`||r===`smoothNoMarker`)&&n.lineHidden!==!0}function Dt(e,t,n,r){if(e!==`scatter`)return null;let i=n[r];if(!i||Et(e,t,i))return null;let a=i.markerSymbol??`circle`;if(a===`none`)return null;let o=mt(r,i);return{symbol:a,fill:i.markerFill??o.replace(/^#/,``),line:i.markerLine??null}}function Ot(e,t,n,r,i,a,o,s=null){if(s){pn(e,r+a/2,i+o/2,s.symbol,o,s.fill,s.line,1);return}if(e.fillStyle=n,t===`line`){e.strokeStyle=n;let t=e.lineWidth;e.lineWidth=Math.max(1.5,o*.15),e.beginPath();let s=i+o/2;e.moveTo(r,s),e.lineTo(r+a,s),e.stroke(),e.lineWidth=t}else e.fillRect(r,i,a,o)}function kt(e,t,n,r=!1,i=[]){if(r||yt(t)){let n=e[0],a=n?n.values.length:0,o=n?.categories??i;return Array.from({length:a},(n,i)=>({label:(o[i]??`Item ${i+1}`).toString(),color:xt(t,e,i,r),marker:null,swatchStyle:Tt(t)}))}return e.map((r,i)=>({label:r.name||`Series ${i+1}`,color:xt(t,e,i),marker:Dt(t,n,e,i),swatchStyle:Tt(r.seriesType??t)}))}const At={fontFamily:`sans-serif`,color:`#333`,bold:!1,sizePx:null};function jt(e,t,n,r,i,a,o=`vertical`,s,c=At,l,u=!1,d=[]){let f=kt(t,s,l,u,d),p=c.bold?`bold `:``;if(o===`horizontal`){let t=c.sizePx??Math.max(9,Math.min(12,a*.7));e.font=`${p}${t}px ${c.fontFamily}`,e.textBaseline=`middle`;let o=Math.max(1,f.length),s=i-10-4,l=f.map(t=>Je(e,t.label,s)),u=l.map(t=>14+e.measureText(t).width),d=n+(i-(u.reduce((e,t)=>e+t,0)+12*(o-1)))/2,m=r+a/2;for(let n=0;n<f.length;n++)Ot(e,f[n].swatchStyle,f[n].color,d,m-t/2,10,t,f[n].marker),e.fillStyle=c.color,e.textAlign=`left`,e.fillText(l[n],d+10+4,m),d+=u[n]+12;return}let m=c.sizePx??Math.max(9,Math.min(12,a/(f.length+1)));e.font=`${p}${m}px ${c.fontFamily}`,e.textBaseline=`middle`;let h=m+4,g=i-10-4,_=r+(a-h*f.length)/2;for(let t=0;t<f.length;t++)Ot(e,f[t].swatchStyle,f[t].color,n,_,10,m,f[t].marker),e.fillStyle=c.color,e.textAlign=`left`,e.fillText(Je(e,f[t].label,g),n+10+4,_+m/2),_+=h}function Mt(e){let t=_t(e,e.legendFontFace)??e.themeMinorFontLatin;return{fontFamily:t?`\"${t}\", Calibri, Arial, sans-serif`:`sans-serif`,color:e.legendFontColor?`#${e.legendFontColor}`:`#333`,bold:e.legendFontBold??!1,sizePx:e.legendFontSizeHpt==null?null:e.legendFontSizeHpt/100}}function Nt(e,t,n,r,i,a,o,s,c,l,u,d){if(!n)return;let f=Mt(t),p=bt(t),m=t.legendManualLayout;if(m&&m.xMode===`edge`&&m.yMode===`edge`&&m.w>0&&m.h>0){let n=r+m.x*a,s=i+m.y*o,c=m.w*a,l=m.h*o,u=c>=l?`horizontal`:`vertical`;jt(e,t.series,n,s,c,l,u,t.chartType,f,t.scatterStyle,p,t.categories);return}switch(n.side){case`r`:jt(e,t.series,r+a-n.reserveW+4,c,n.reserveW-8,u,`vertical`,t.chartType,f,t.scatterStyle,p,t.categories);break;case`l`:jt(e,t.series,r+4,c,n.reserveW-8,u,`vertical`,t.chartType,f,t.scatterStyle,p,t.categories);break;case`t`:jt(e,t.series,s,i+d,l,n.reserveH,`horizontal`,t.chartType,f,t.scatterStyle,p,t.categories);break;case`b`:jt(e,t.series,s,i+o-n.reserveH,l,n.reserveH,`horizontal`,t.chartType,f,t.scatterStyle,p,t.categories);break}}function Pt(e,t,n,r,i,a,o,s=!1){if(t===`none`||!t)return;let c=o?Math.max(4,o+2):4,l=e.strokeStyle,u=e.lineWidth;if(e.strokeStyle=a??`#888`,e.lineWidth=o??1,e.beginPath(),n===`val`){let n=r,a=i,o=s?1:-1,l=t===`out`||t===`cross`?o*c:0,u=t===`in`||t===`cross`?-o*c:0;e.moveTo(n+l,a),e.lineTo(n+u,a)}else{let n=r,a=i,o=t===`out`||t===`cross`?c:0,s=t===`in`||t===`cross`?-c:0;e.moveTo(a,n+o),e.lineTo(a,n+s)}e.stroke(),e.strokeStyle=l,e.lineWidth=u}function Ft(e,t,n,r,i,a){a&&a.explicit?(e.strokeStyle=a.color,e.lineWidth=a.width):(e.strokeStyle=i?`#aaa`:a?.color??`#e0e0e0`,e.lineWidth=i?1:a?.width??.5),e.beginPath(),e.moveTo(t,r),e.lineTo(t+n,r),e.stroke()}function It(e,t){let{color:n,width:r}=Me(e.valAxisGridlineColor,e.valAxisGridlineWidthEmu,t);return{color:n,width:r,explicit:e.valAxisGridlineColor!=null}}function Lt(e){return e.catAxisMajorGridlines===!0}function Rt(e,t){return Me(e.catAxisGridlineColor,e.catAxisGridlineWidthEmu,t)}function zt(e,t){if(t<=0)return[];let n=Ne(e),r=[],i=n?t:t-1;for(let e=0;e<=i;e++)r.push(n?e/t:t===1?.5:e/(t-1));return r}function Bt(e){return e.valAxisOrientation===`maxMin`}function Vt(e){return e.catAxisOrientation===`maxMin`}function Ht(e){return e.valAxisMajorGridlines!==!1}function Ut(e,t){return e==null||!t?e:e*100}function Wt(e,t,n){return Ve(n?t/100:t,n?e.valAxisFormatCode??`0%`:e.valAxisFormatCode,e.date1904)}function Gt(e,t,n,r,i=!1){let a=Bt(e),o=e.valAxisLogBase,s=Ut(e.valMin,i)??(i?t:e.valMin),c=Ut(e.valMax,i)??(i?n:e.valMax),l=Ut(e.valAxisMajorUnit,i);if(o!=null&&isFinite(o)&&o>=2){let{min:e,max:r,lines:i}=De(t,n,o,s,c);return{min:e,max:r,step:i.length>1?i[1]-i[0]:r-e,majorLines:i,minorLines:[],frac:t=>Ee(t,e,r,{logBase:o,reversed:a})}}let{min:u,max:d,step:f}=Te(t,n,s,c,r,l),p=d-u||1,m=[],h=Math.round((d-u)/f);for(let e=0;e<=h;e++)m.push(u+e*f);let g=[],_=Ut(e.valAxisMinorUnit,i);if(e.valAxisMinorGridlines&&_!=null&&isFinite(_)&&_>0&&_<f)for(let e=u+_;e<d-1e-9;e+=_)Math.abs((e-u)/f-Math.round((e-u)/f))>1e-6&&g.push(e);return{min:u,max:d,step:f,majorLines:m,minorLines:g,frac:e=>a?1-(e-u)/p:(e-u)/p}}function Kt(e,t,n,r,i,a){let o=t.trendLines;if(!o||o.length===0)return;let s=[],c=[];for(let e=0;e<t.values.length;e++){let n=t.values[e];n!=null&&(s.push(e),c.push(n))}if(s.length<2)return;let l=e.getLineDash?e.getLineDash():[];for(let t of o){let o=Oe(s,c,t.trendlineType,{period:t.period,intercept:t.intercept});if(o.xs.length<2)continue;let l=o.xs,u=o.ys;if(t.trendlineType===`linear`){let e=(o.ys[1]-o.ys[0])/(o.xs[1]-o.xs[0]||1),n=t.backward??0,r=t.forward??0;l=[o.xs[0]-n,o.xs[1]+r],u=[o.ys[0]-e*n,o.ys[1]+e*r]}e.strokeStyle=t.lineColor?`#${t.lineColor}`:n,e.lineWidth=t.lineWidthEmu?Ae(t.lineWidthEmu,a):1.5,e.setLineDash([6,4]),e.beginPath();for(let t=0;t<l.length;t++){let n=r(l[t]),a=i(u[t]);t===0?e.moveTo(n,a):e.lineTo(n,a)}e.stroke()}e.setLineDash(l)}function qt(e,t,n){return e?e/100*n:Math.max(8,t*.045)}function Jt(e){return e.catAxisTickLabelPos!==`none`}function Yt(e){let t=e.catAxisLabelRotation;return t==null||t===0||Math.abs(t)>54e5?0:t/6e4*(Math.PI/180)}function Xt(e,t,n,r,i){if(i===0){e.fillText(t,n,r);return}e.save(),e.translate(n,r),e.rotate(i),e.textAlign=`right`,e.textBaseline=`middle`,e.fillText(t,0,0),e.restore()}function Zt(e,t,n){if(!e)return null;let r=[];for(let e of t)if(e.useSecondaryAxis===!0)for(let t of e.values)t!=null&&r.push(t);let i=r.length?Math.min(...r):0,a=r.length?Math.max(...r):1,{min:o,max:s,step:c}=Te(Math.min(0,i),a,e.min,e.max,n,e.majorUnit),l=s-o||1;return{min:o,max:s,step:c,makeToY:(e,t)=>n=>e+t-(n-o)/l*t}}function Qt(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=i+o,{color:h,width:g}=je(t.lineColor,t.lineWidthEmu,l);if(t.lineHidden||(e.strokeStyle=h,e.lineWidth=g,e.beginPath(),e.moveTo(m,a),e.lineTo(m,a+s),e.stroke()),!t.hidden){e.font=`${u}px sans-serif`,e.fillStyle=t.fontColor?`#${t.fontColor}`:f,e.textAlign=`left`,e.textBaseline=`middle`;let i=n.max-n.min||1,a=Math.max(1,Math.round(i/n.step));for(let i=0;i<=a;i++){let a=n.min+i*n.step,o=r(a);Pt(e,t.majorTickMark,`val`,m,o,h,g,!0),e.fillText(Ve(a,t.formatCode??null,p),m+14,o)}}if(t.title){let n=t.titleFontSizeHpt?t.titleFontSizeHpt/100*l:Math.max(9,c*.05);e.save(),e.fillStyle=t.titleFontColor?`#${t.titleFontColor}`:t.fontColor?`#${t.fontColor}`:`#555`,e.font=`${t.titleFontBold?`bold `:``}${n}px sans-serif`,e.textAlign=`center`,e.textBaseline=`middle`,e.translate(i+o+d+n*.6,a+s/2),e.rotate(Math.PI/2),e.fillText(t.title,0,0),e.restore()}}function $t(e,t,n,r,i,a){if(!t.title)return;let o=_t(t,t.titleFontFace),s=o?`\"${o}\", Calibri, Arial, sans-serif`:`Calibri, Arial, sans-serif`;e.font=`${t.titleFontBold??!0?`bold `:``}${a}px ${s}`,e.fillStyle=t.titleFontColor?`#${t.titleFontColor}`:`#333`,e.textAlign=`center`,e.textBaseline=`top`,e.fillText(t.title,n+i/2,r)}function en(e){if(e.categories.length>0)return e.categories;let t=e.series[0];if(t?.categories&&t.categories.length>0)return t.categories;let n=0;for(let t of e.series)t.values.length>n&&(n=t.values.length);return n>0?Array.from({length:n},(e,t)=>String(t+1)):[]}function tn(e,t,n,r,i,a,o,s,c,l=!1){let u=s??`outEnd`;if(e.fillStyle=c?`#${c}`:`#333`,o===`vertical`){let o=n+a/2,s=l?r+i:r,c=l?r:r+i;u===`inBase`?(e.textAlign=`center`,e.textBaseline=l?`top`:`bottom`,e.fillText(t,o,l?c+2:c-2)):u===`inEnd`?(e.textAlign=`center`,e.textBaseline=l?`bottom`:`top`,e.fillText(t,o,l?s-2:s+2)):u===`ctr`?(e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(t,o,r+i/2)):(e.textAlign=`center`,e.textBaseline=l?`top`:`bottom`,e.fillText(t,o,l?s+1:s-1))}else{let o=r+a/2,s=l?n:n+i,c=l?n+i:n;u===`inBase`?(e.textAlign=l?`right`:`left`,e.textBaseline=`middle`,e.fillText(t,l?c-4:c+4,o)):u===`inEnd`?(e.textAlign=l?`left`:`right`,e.textBaseline=`middle`,e.fillText(t,l?s+4:s-4,o)):u===`ctr`?(e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(t,n+i/2,o)):(e.textAlign=l?`right`:`left`,e.textBaseline=`middle`,e.fillText(t,l?s-2:s+2,o))}}function nn(e,t,n,r){let{x:i,y:a,w:o,h:s}=n,c=t.chartType===`clusteredBarH`||t.chartType===`stackedBarH`||t.chartType===`stackedBarHPct`,l=t.chartType.startsWith(`stacked`),u=t.chartType===`stackedBarPct`||t.chartType===`stackedBarHPct`,d=t.series.filter(e=>e.seriesType!==`line`),f=t.series.filter(e=>e.seriesType===`line`),p=!c&&t.secondaryValAxis&&f.some(e=>e.useSecondaryAxis===!0)?t.secondaryValAxis:null,m=en(t),h=m.length;if(h===0)return;let g=bt(t),_=ye(t,s,r),v=_.fontPx,y=_.topPad,b=_.bandH,x=qt(t.catAxisFontSizeHpt,s,r),S=qt(t.valAxisFontSizeHpt,s,r),C=me(t,o,s,.22),{legRightW:w,legLeftW:T,legTopH:E,legBottomH:D}=he(C),O=ve(t,o,s,r),k=O.catFontPx,A=O.valFontPx,j=O.catBandH,M=O.valBandW,N=b+E+S/2+2,ee=c?(t.valAxisHidden?s*.02:be(S))+j+D:be(x)+j+D,te=s-N-ee,P=c?o-((t.catAxisHidden?o*.03:o*.22)+M+T)-(w+o*.03):0,ne=(c?P:te)/r,F=0,I=0;for(let e=0;e<h;e++){let t=0,n=0;for(let r of d){let i=r.values[e]??0;l?i>=0?t+=i:n+=i:(F=Math.max(F,i),I=Math.min(I,i))}l&&(F=Math.max(F,t),I=Math.min(I,n))}if(!u){for(let e of f)if(!(p&&e.useSecondaryAxis===!0))for(let t=0;t<h;t++){let n=e.values[t];n!=null&&(F=Math.max(F,n),I=Math.min(I,n))}}u&&(F=F>0?100:0,I=I<0?-100:0),t.valMax!=null&&(F=u?t.valMax*100:t.valMax),t.valMin!=null&&(I=u?t.valMin*100:t.valMin),F===0&&I===0&&(F=1);let L=Gt(t,I,F,ne,u),{min:R,max:z,step:B}=L,V=Zt(p,f,te/r),H=V?V.min:0,U=V?V.max:1,re=V?V.step:1,ie=Math.max(8,Math.min(11,s/20)),ae=t.valAxisFontSizeHpt==null?Math.max(8,Math.min(11,te/20)):S,oe=e.font,se=0;if(!c&&!t.valAxisHidden){e.font=`${ae}px ${vt(t,t.valAxisFontFace,`minor`)}`;let n=0,r=Math.round((z-R)/B);for(let i=0;i<=r;i++){let r=Wt(t,R+i*B,u);n=Math.max(n,e.measureText(r).width)}se=n+16}let ce=p?.fontSizeHpt?p.fontSizeHpt/100*r:ie,le=0;if(p&&!p.hidden){e.font=`${ce}px sans-serif`;let n=0,r=Math.round((U-H)/re);for(let i=0;i<=r;i++)n=Math.max(n,e.measureText(Ve(H+i*re,p.formatCode??null,t.date1904)).width);le=n+18}e.font=oe;let ue=p&&p.title?(p.titleFontSizeHpt?p.titleFontSizeHpt/100*r:Math.max(9,s*.05))+8:0,de={t:N,r:w+o*.03+le+ue,b:ee,l:c?(t.catAxisHidden?o*.03:o*.22)+M+T:T+M+se};$t(e,t,i,a+y,o,v);let{plotRect:{px0:W,py0:G,pw:fe,ph:pe}}=K(t,i,a,o,s,r,{titleBand:_,legendSideReserveFrac:.22,pad:de,honorPlotAreaManualLayout:!0});if(fe<=0||pe<=0)return;t.plotAreaBg&&(e.fillStyle=`#${t.plotAreaBg}`,e.fillRect(W,G,fe,pe));let ge=U-H||1,_e=z-R||1,xe=e=>G+pe-L.frac(e)*pe,Se=e=>W+L.frac(e)*fe,Ce=xe(0),we=Se(0),Te=xe,Ee=V?V.makeToY(G,pe):xe,De=It(t,r),Oe=Math.round(_e/B);e.textBaseline=`middle`,e.font=`${t.valAxisFontSizeHpt==null?Math.max(8,Math.min(11,pe/20)):S}px ${vt(t,t.valAxisFontFace,`minor`)}`;let ke=t.valAxisFontColor?`#${t.valAxisFontColor}`:`#555`;if(e.fillStyle=ke,!t.valAxisHidden){for(let t of L.minorLines)if(!c)Ft(e,W,fe,xe(t),!1,De);else{let n=Se(t);e.strokeStyle=De.color,e.lineWidth=De.width,e.beginPath(),e.moveTo(n,G),e.lineTo(n,G+pe),e.stroke()}let n=Ht(t),r=t.valAxisTickLabelPos!==`none`;for(let i of L.majorLines){let a=Math.abs(i)<B*1e-9,o=Wt(t,i,u);if(c){let t=Se(i);n&&(e.strokeStyle=De.explicit?De.color:a?`#aaa`:De.color,e.lineWidth=De.explicit?De.width:a?1:De.width,e.beginPath(),e.moveTo(t,G),e.lineTo(t,G+pe),e.stroke()),r&&(e.textAlign=`center`,e.fillText(o,t,G+pe+10))}else{let t=xe(i);n&&Ft(e,W,fe,t,a,De),r&&(e.textAlign=`right`,e.fillText(o,W-12,t))}}}if(!t.catAxisHidden&&Lt(t)){let n=Rt(t,r);e.strokeStyle=n.color,e.lineWidth=n.width;for(let n of zt(t,h)){if(e.beginPath(),c){let t=G+n*pe;e.moveTo(W,t),e.lineTo(W+fe,t)}else{let t=W+n*fe;e.moveTo(t,G),e.lineTo(t,G+pe)}e.stroke()}}let{color:Ae,width:Me}=je(t.catAxisLineColor,t.catAxisLineWidthEmu,r),{color:Pe,width:Fe}=je(t.valAxisLineColor,t.valAxisLineWidthEmu,r),Ie=(t,n,r,i,a,o)=>{e.strokeStyle=a,e.lineWidth=o,e.beginPath(),e.moveTo(t,n),e.lineTo(r,i),e.stroke()},Le=!t.catAxisHidden&&!t.catAxisLineHidden,Re=!t.valAxisHidden&&!t.valAxisLineHidden&&t.valAxisLineColor!=null,ze=()=>{if(c?(Le&&Ie(W,G,W,G+pe,Ae,Me),Re&&Ie(W,G+pe,W+fe,G+pe,Pe,Fe)):(Le&&Ie(W,G+pe,W+fe,G+pe,Ae,Me),Re&&Ie(W,G,W,G+pe,Pe,Fe)),!t.valAxisHidden&&t.valAxisMajorTickMark&&t.valAxisMajorTickMark!==`none`)for(let n=0;n<=Oe;n++){let r=R+n*B;c?Pt(e,t.valAxisMajorTickMark,`cat`,G+pe,Se(r),Pe,Fe):Pt(e,t.valAxisMajorTickMark,`val`,W,xe(r),Pe,Fe)}if(!t.catAxisHidden&&t.catAxisMajorTickMark&&t.catAxisMajorTickMark!==`none`){let n=Ne(t),r=n?h:h-1;for(let i=0;i<=r;i++){let r=n?i/h:h===1?.5:i/(h-1);c?Pt(e,t.catAxisMajorTickMark,`val`,W,G+r*pe,Ae,Me):Pt(e,t.catAxisMajorTickMark,`cat`,G+pe,W+r*fe,Ae,Me)}}},Be=c?pe/h:fe/h,Ue=l?1:Math.max(1,d.length),We=l?0:t.barOverlap??0,Ge=t.barGapWidth??150,Ke=Be/(1+(Ue-1)*(1-We/100)+Ge/100),qe=l?0:Ke*(1-We/100),Ye=(Be-(Ke+(Ue-1)*qe))/2;for(let n=0;n<h;n++){let i=0,a=0,o=0;if(u){for(let e of d)o+=Math.abs(e.values[n]??0);o===0&&(o=1)}for(let s=0;s<d.length;s++){let f=d[s],p=f.values[n]??0,m=u?p/o*100:p,_=m<0,v=g?ht(n,f):mt(s,f);if(c){let o=l?s:d.length-1-s,c=l?G+(h-1-n)*Be+Ye:G+(h-1-n)*Be+Ye+o*qe,p=l?Se(_?a:i):we,g=Se(l?(_?a:i)+m:m),y=Math.min(p,g),b=Math.abs(g-p);if(e.fillStyle=v,e.fillRect(y,c,b,Ke),t.showDataLabels&&m!==0){let n=f.seriesDataLabels,i=n?.fontSizeHpt??t.dataLabelFontSizeHpt,a=i?i/100*r:Math.max(7,Math.min(11,Ke*.6));e.font=`${n?.fontBold??!0?`bold `:``}${a}px ${vt(t,t.dataLabelFontFace,`minor`)}`,tn(e,u?`${Math.round(m)}%`:Ve(m,n?.formatCode??t.dataLabelFormatCode??f.valFormatCode??null,t.date1904),y,c,b,Ke,`horizontal`,n?.position??t.dataLabelPosition??null,n?.fontColor??f.labelColor??t.dataLabelFontColor??null,_)}}else{let o=l?W+n*Be+Ye:W+n*Be+Ye+s*qe,c=l?xe(_?a:i):Ce,d=xe(l?(_?a:i)+m:m),p=Math.min(c,d),h=Math.abs(d-c);if(e.fillStyle=v,e.fillRect(o,p,Ke,h),t.showDataLabels&&m!==0){let n=f.seriesDataLabels,i=n?.fontSizeHpt??t.dataLabelFontSizeHpt,a=i?i/100*r:Math.max(7,Math.min(11,Ke*.6));e.font=`${n?.fontBold??!0?`bold `:``}${a}px ${vt(t,t.dataLabelFontFace,`minor`)}`,tn(e,u?`${Math.round(m)}%`:Ve(m,n?.formatCode??t.dataLabelFormatCode??f.valFormatCode??null,t.date1904),o,p,h,Ke,`vertical`,n?.position??t.dataLabelPosition??null,n?.fontColor??f.labelColor??t.dataLabelFontColor??null,_)}}l&&(_?a+=m:i+=m)}}if(!t.catAxisHidden&&Jt(t)){e.fillStyle=t.catAxisFontColor?`#${t.catAxisFontColor}`:`#555`,e.font=`${Math.max(8,Math.min(11,Be*.5))}px ${vt(t,t.catAxisFontFace,`minor`)}`;let n=Be-4,r=W-4-(i+T+M),a=Yt(t);for(let i=0;i<h;i++){let o=He((m[i]??``).toString(),t.catAxisFormatCode,t.date1904);if(c){let t=G+(h-1-i)*Be+Be/2;e.textAlign=`right`,e.textBaseline=`middle`,e.fillText(Je(e,o,r),W-4,t)}else{let t=W+i*Be+Be/2;e.textAlign=`center`,e.textBaseline=`top`,Xt(e,Je(e,o,a===0?n:pe*.4),t,G+pe+3,a)}}}if(f.length>0&&!c)for(let t=0;t<f.length;t++){let n=f[t],i=mt(d.length+t,n),a=p&&n.useSecondaryAxis===!0?Ee:Te;e.strokeStyle=i,e.lineWidth=2,e.setLineDash([]),e.beginPath();let o=!1;for(let t=0;t<h;t++){let r=n.values[t];if(r==null){o=!1;continue}let i=W+t*Be+Be/2,s=a(r);o?e.lineTo(i,s):(e.moveTo(i,s),o=!0)}if(e.stroke(),n.showMarker!==!1)for(let t=0;t<h;t++){let r=n.values[t];if(r==null)continue;let o=W+t*Be+Be/2,s=a(r);e.fillStyle=i,e.beginPath(),e.arc(o,s,3,0,Math.PI*2),e.fill()}Kt(e,n,i,e=>W+e*Be+Be/2,a,r)}if(ze(),p){let n=W+fe,{color:i,width:a}=je(p.lineColor,p.lineWidthEmu,r);if(p.lineHidden||Ie(n,G,n,G+pe,i,a),!p.hidden){e.font=`${ce}px sans-serif`,e.fillStyle=p.fontColor?`#${p.fontColor}`:ke,e.textAlign=`left`,e.textBaseline=`middle`;let r=Math.max(1,Math.round(ge/re));for(let o=0;o<=r;o++){let r=H+o*re,s=Ee(r);Pt(e,p.majorTickMark,`val`,n,s,i,a,!0),e.fillText(Ve(r,p.formatCode??null,t.date1904),n+14,s)}}if(p.title){let t=p.titleFontSizeHpt?p.titleFontSizeHpt/100*r:Math.max(9,s*.05);e.save(),e.fillStyle=p.titleFontColor?`#${p.titleFontColor}`:p.fontColor?`#${p.fontColor}`:`#555`,e.font=`${p.titleFontBold?`bold `:``}${t}px sans-serif`,e.textAlign=`center`,e.textBaseline=`middle`,e.translate(W+fe+le+t*.6,G+pe/2),e.rotate(Math.PI/2),e.fillText(p.title,0,0),e.restore()}}Nt(e,c&&!l?{...t,series:[...t.series].reverse()}:t,C,i,a,o,s,W,G,fe,pe,b+2),wt(e,t,i,a,o,s,W,G,fe,pe,T,D,k,A)}function rn(e,t,n,r){let{x:i,y:a,w:o,h:s}=n,c=en(t),l=c.length;if(l===0)return;let u=t.chartType===`stackedLine`||t.chartType===`stackedLinePct`,d=t.chartType===`stackedLinePct`,f=d?c.map((e,n)=>{let r=0;for(let e of t.series)r+=Math.abs(e.values[n]??0);return r||1}):null,p=t.dispBlanksAs??`gap`,m=(e,n)=>{if(!u)return t.series[e].values[n]??0;let r=0;for(let i=0;i<=e;i++)r+=t.series[i].values[n]??0;return d&&f?r/f[n]*100:r},h=!u&&t.secondaryValAxis&&t.series.some(e=>e.useSecondaryAxis===!0)?t.secondaryValAxis:null,g=e=>h!=null&&e.useSecondaryAxis===!0,_=ye(t,s,r),v=_.fontPx,y=_.topPad,b=_.bandH,x=me(t,o,s,.22),{legRightW:S,legLeftW:C,legTopH:w,legBottomH:T}=he(x),E=qt(t.catAxisFontSizeHpt,s,r),D=qt(t.valAxisFontSizeHpt,s,r),O=ve(t,o,s,r),k=O.catFontPx,A=O.valFontPx,j=O.catBandH,M=O.valBandW,N=b+w+D/2+2,ee=be(E)+j+T,te=s-N-ee,P=Zt(h,t.series,te/r),ne=Math.max(8,Math.min(11,s/20)),F=h?.fontSizeHpt?h.fontSizeHpt/100*r:ne,I=0;if(h&&P&&!h.hidden){let n=e.font;e.font=`${F}px sans-serif`;let r=0,i=Math.round((P.max-P.min)/P.step);for(let n=0;n<=i;n++)r=Math.max(r,e.measureText(Ve(P.min+n*P.step,h.formatCode??null,t.date1904)).width);I=r+18,e.font=n}let L=h&&h.title?(h.titleFontSizeHpt?h.titleFontSizeHpt/100*r:Math.max(9,s*.05))+8:0,R={t:N,r:S+o*.05+I+L,b:ee,l:D*2.2+10+M+C};$t(e,t,i,a+y,o,v);let{plotRect:{px0:z,py0:B,pw:V,ph:H}}=K(t,i,a,o,s,r,{titleBand:_,legendSideReserveFrac:.22,pad:R});if(V<=0||H<=0)return;t.plotAreaBg&&(e.fillStyle=`#${t.plotAreaBg}`,e.fillRect(z,B,V,H));let U=1/0,re=-1/0;for(let e=0;e<l;e++)for(let n=0;n<t.series.length;n++){if(g(t.series[n])||!u&&t.series[n].values[e]==null)continue;let r=m(n,e);U=Math.min(U,r),re=Math.max(re,r)}isFinite(U)||(U=0,re=1);let ie=t.valAxisLogBase!=null&&t.valAxisLogBase>=2;t.valMin==null?U>0&&!ie&&(U=0):U=d?t.valMin*100:t.valMin,t.valMax==null?re<0&&(re=0):re=d?t.valMax*100:t.valMax,re===U&&(re=U+1);let ae=Gt(t,U,re,H/r,d);if(ae.max-ae.min===0)return;let oe=e=>B+H-ae.frac(e)*H,se=P?P.makeToY(B,H):oe,ce=e=>g(e)?se:oe,le=Ne(t),ue=Vt(t),de=le?e=>z+((ue?l-1-e:e)+.5)/l*V:e=>{let t=ue?l-1-e:e;return z+(l===1?V/2:t/(l-1)*V)};if(!t.valAxisHidden){e.font=`${D}px ${vt(t,t.valAxisFontFace,`minor`)}`,e.textBaseline=`middle`;let n=It(t,r);for(let t of ae.minorLines)Ft(e,z,V,oe(t),!1,n);let i=Ht(t),a=t.valAxisTickLabelPos!==`none`;for(let r of ae.majorLines){let o=oe(r);i&&Ft(e,z,V,o,r===0,n),Pt(e,t.valAxisMajorTickMark,`val`,z,o),a&&(e.fillStyle=t.valAxisFontColor?`#${t.valAxisFontColor}`:`#555`,e.textAlign=`right`,e.fillText(Wt(t,r,d),z-6,o))}}if(!t.catAxisHidden&&Lt(t)){let n=Rt(t,r);e.strokeStyle=n.color,e.lineWidth=n.width;for(let n of zt(t,l)){let t=z+n*V;e.beginPath(),e.moveTo(t,B),e.lineTo(t,B+H),e.stroke()}}e.strokeStyle=`#aaa`,e.lineWidth=1,!t.catAxisHidden&&!t.catAxisLineHidden&&(e.beginPath(),e.moveTo(z,B+H),e.lineTo(z+V,B+H),e.stroke()),!t.valAxisHidden&&!t.valAxisLineHidden&&(e.beginPath(),e.moveTo(z,B),e.lineTo(z,B+H),e.stroke());let W=Math.max(1,2.25*r),G=Math.max(2,2.5*r),fe=qt(t.dataLabelFontSizeHpt,s,r);for(let n=0;n<t.series.length;n++){let i=t.series[n],a=mt(n,i),o=ce(i);e.strokeStyle=a,e.lineWidth=W,e.setLineDash([]),e.beginPath();let s=i.smooth===!0,d=[],f=()=>{d.length!==0&&(e.moveTo(d[0].x,d[0].y),vn(e,d,s),d=[])};for(let e=0;e<l;e++){if(!u&&i.values[e]==null){if(p===`gap`){f();continue}if(p===`span`)continue}d.push({x:de(e),y:o(m(n,e))})}f(),e.stroke();let h=e=>m(n,e);for(let t of i.errBars??[])xn(e,i,t,l,de,o,h,a);e.fillStyle=a;let g=i.showMarker!==!1,_=bn(i),v=Sn(e,i,c,l,de,o,h,H,r,t.date1904??!1,u||p===`zero`,vt(t,t.dataLabelFontFace,`minor`),t.dataLabelPosition??`r`);v&&(e.fillStyle=a);for(let s=0;s<l;s++){if(!u&&i.values[s]==null&&p!==`zero`)continue;let c=m(n,s);if(g)if(_){let t=(i.dataPointOverrides??[]).find(e=>e.idx===s),n=t?.markerSymbol??i.markerSymbol??`circle`;if(n!==`none`){let l=t?.markerSize??i.markerSize??5,u=t?.markerFill??t?.color??i.markerFill??a,d=t?.markerLine??i.markerLine??null;pn(e,de(s),o(c),n,l,u,d,r)}}else e.beginPath(),e.arc(de(s),o(c),G,0,Math.PI*2),e.fill();t.showDataLabels&&!v&&(gn(e,de(s),o(c),Be(c),t.dataLabelPosition??`r`,fe,void 0,!1,vt(t,t.dataLabelFontFace,`minor`),g?G+1:2),e.fillStyle=a)}Kt(e,i,a,de,o,r)}if(!t.catAxisHidden){let n=Math.max(1,Math.ceil(l/8)),r=t.catAxisFontColor?`#${t.catAxisFontColor}`:`#555`;e.fillStyle=r,e.textAlign=`center`,e.textBaseline=`top`,e.font=`${E}px ${vt(t,t.catAxisFontFace,`minor`)}`;let i=V/l*n-4,a=Jt(t),o=Yt(t);for(let s=0;s<l;s+=n){let n=de(s);Pt(e,t.catAxisMajorTickMark,`cat`,B+H,n),a&&(e.fillStyle=r,Xt(e,Je(e,He((c[s]??``).toString(),t.catAxisFormatCode,t.date1904),o===0?i:H*.4),n,B+H+5,o))}}if(h&&P){let n=t.valAxisFontColor?`#${t.valAxisFontColor}`:`#555`;Qt(e,h,P,se,z,B,V,H,s,r,F,I,n,t.date1904)}Nt(e,t,x,i,a,o,s,z,B,V,H,b+2),wt(e,t,i,a,o,s,z,B,V,H,C,T,k,A)}function an(e,t,n,r){let{x:i,y:a,w:o,h:s}=n,c=en(t),l=c.length;if(l===0)return;let u=t.series,d=u.length>=4,f=d?0:-1,p=+!!d,m=d?2:1,h=d?3:2,g=u[p],_=u[m],v=u[h],y=f>=0?u[f]:void 0,b=ye(t,s,r),x=b.fontPx,S=b.topPad,C=b.bandH,w=me(t,o,s,.22),{legRightW:T,legLeftW:E,legBottomH:D,legTopH:O}=he(w),k=qt(t.catAxisFontSizeHpt,s,r),A=qt(t.valAxisFontSizeHpt,s,r),j=ve(t,o,s,r),M=j.catFontPx,N=j.valFontPx,ee=j.catBandH,te=j.valBandW,P=C+O+A/2+2,ne=be(k)+ee+D,F={t:P,r:T+o*.05,b:ne,l:A*2.2+10+te+E};$t(e,t,i,a+S,o,x);let{plotRect:{px0:I,py0:L,pw:R,ph:z}}=K(t,i,a,o,s,r,{titleBand:b,legendSideReserveFrac:.22,pad:F});if(R<=0||z<=0)return;t.plotAreaBg&&(e.fillStyle=`#${t.plotAreaBg}`,e.fillRect(I,L,R,z));let B=1/0,V=-1/0;for(let e of u)for(let t=0;t<l;t++){let n=e.values[t];n!=null&&(B=Math.min(B,n),V=Math.max(V,n))}isFinite(B)||(B=0,V=1),t.valMin==null?B>0&&(B=0):B=t.valMin,t.valMax==null?V<0&&(V=0):V=t.valMax,V===B&&(V=B+1);let H=Gt(t,B,V,z/r);if(H.max-H.min===0)return;let U=e=>L+z-H.frac(e)*z,re=Ne(t),ie=Vt(t),ae=re?e=>I+((ie?l-1-e:e)+.5)/l*R:e=>{let t=ie?l-1-e:e;return I+(l===1?R/2:t/(l-1)*R)};if(!t.valAxisHidden){e.font=`${A}px ${vt(t,t.valAxisFontFace,`minor`)}`,e.textBaseline=`middle`;let n=It(t,r);for(let t of H.minorLines)Ft(e,I,R,U(t),!1,n);let i=Ht(t),a=t.valAxisTickLabelPos!==`none`;for(let r of H.majorLines){let o=U(r);i&&Ft(e,I,R,o,r===0,n),Pt(e,t.valAxisMajorTickMark,`val`,I,o),a&&(e.fillStyle=t.valAxisFontColor?`#${t.valAxisFontColor}`:`#555`,e.textAlign=`right`,e.fillText(Ve(r,t.valAxisFormatCode,t.date1904),I-6,o))}}if(e.strokeStyle=`#aaa`,e.lineWidth=1,!t.catAxisHidden&&!t.catAxisLineHidden&&(e.beginPath(),e.moveTo(I,L+z),e.lineTo(I+R,L+z),e.stroke()),!t.valAxisHidden&&!t.valAxisLineHidden&&(e.beginPath(),e.moveTo(I,L),e.lineTo(I,L+z),e.stroke()),(t.stockHiLowLines??!0)&&g!=null&&_!=null&&g&&_){e.strokeStyle=t.stockHiLowLineColor?`#${t.stockHiLowLineColor}`:`#595959`,e.lineWidth=Math.max(1,.75*r),e.setLineDash([]);for(let t=0;t<l;t++){let n=g.values[t],r=_.values[t];if(n==null||r==null)continue;let i=ae(t);e.beginPath(),e.moveTo(i,U(n)),e.lineTo(i,U(r)),e.stroke()}}let oe=(t,n,i)=>{if(!t)return;let a=mt(n,t),o=t.markerSymbol??null,s=o!=null&&o!==`none`&&bn(t),c=Math.max(3,R/l*.22);for(let n=0;n<l;n++){let l=t.values[n];if(l==null)continue;let u=ae(n),d=U(l);if(s){pn(e,u,d,o,t.markerSize??3,t.markerFill??a,t.markerLine??null,r);continue}e.strokeStyle=a,e.lineWidth=Math.max(1,.75*r),e.beginPath();let f=i===`right`?u:i===`left`?u-c:u-c/2,p=i===`right`?u+c:i===`left`?u:u+c/2;e.moveTo(f,d),e.lineTo(p,d),e.stroke()}};if(oe(y,f,`left`),oe(v,h,`right`),u.length<3)for(let e=0;e<u.length;e++)oe(u[e],e,`both`);if(!t.catAxisHidden){let n=Math.max(1,Math.ceil(l/8)),r=t.catAxisFontColor?`#${t.catAxisFontColor}`:`#555`;e.fillStyle=r,e.textAlign=`center`,e.textBaseline=`top`,e.font=`${k}px ${vt(t,t.catAxisFontFace,`minor`)}`;let i=R/l*n-4,a=Jt(t),o=Yt(t);for(let s=0;s<l;s+=n){let n=ae(s);Pt(e,t.catAxisMajorTickMark,`cat`,L+z,n),a&&(e.fillStyle=r,Xt(e,Je(e,He((c[s]??``).toString(),t.catAxisFormatCode,t.date1904),o===0?i:z*.4),n,L+z+5,o))}}Nt(e,t,w,i,a,o,s,I,L,R,z,C+2),wt(e,t,i,a,o,s,I,L,R,z,E,D,M,N)}function on(e,t,n,r){let{x:i,y:a,w:o,h:s}=n,c=en(t),l=c.length;if(l===0)return;let u=t.chartType===`stackedArea`||t.chartType===`stackedAreaPct`,d=t.chartType===`stackedAreaPct`,f=d?c.map((e,n)=>{let r=0;for(let e of t.series)r+=Math.abs(e.values[n]??0);return r||1}):null,p=(e,n)=>{let r=t.series[e].values[n]??0;return d&&f?r/f[n]*100:r},m=!u&&t.secondaryValAxis&&t.series.some(e=>e.useSecondaryAxis===!0)?t.secondaryValAxis:null,h=e=>m!=null&&e.useSecondaryAxis===!0,g=ye(t,s,r),_=g.fontPx,v=g.topPad,y=g.bandH,b=qt(t.catAxisFontSizeHpt,s,r),x=qt(t.valAxisFontSizeHpt,s,r),S=me(t,o,s,.22),{legRightW:C,legLeftW:w,legTopH:T,legBottomH:E}=he(S),D=ve(t,o,s,r),O=D.catFontPx,k=D.valFontPx,A=D.catBandH,j=D.valBandW,M=y+T+x/2+2,N=be(b)+A+E,ee=s-M-N,te=Zt(m,t.series,ee/r),P=Math.max(8,Math.min(11,s/20)),ne=m?.fontSizeHpt?m.fontSizeHpt/100*r:P,F=0;if(m&&te&&!m.hidden){let n=e.font;e.font=`${ne}px sans-serif`;let r=0,i=Math.round((te.max-te.min)/te.step);for(let n=0;n<=i;n++)r=Math.max(r,e.measureText(Ve(te.min+n*te.step,m.formatCode??null,t.date1904)).width);F=r+18,e.font=n}let I=m&&m.title?(m.titleFontSizeHpt?m.titleFontSizeHpt/100*r:Math.max(9,s*.05))+8:0,L={t:M,r:C+o*.05+F+I,b:N,l:o*.12+j+w};$t(e,t,i,a+v,o,_);let{plotRect:{px0:R,py0:z,pw:B,ph:V}}=K(t,i,a,o,s,r,{titleBand:g,legendSideReserveFrac:.22,pad:L});if(B<=0||V<=0)return;t.plotAreaBg&&(e.fillStyle=`#${t.plotAreaBg}`,e.fillRect(R,z,B,V));let H=0;for(let e=0;e<l;e++)if(u){let n=0;for(let r=0;r<t.series.length;r++)n+=p(r,e);H=Math.max(H,n)}else for(let n of t.series)h(n)||(H=Math.max(H,n.values[e]??0));d&&(H=H>0?100:0),t.valMax!=null&&(H=d?t.valMax*100:t.valMax),H===0&&(H=1);let U=d?H:t.valMax,re=Ut(t.valAxisMajorUnit,d),{max:ie,step:ae}=Te(0,H,void 0,U,V/r,re),oe=Ne(t),se=oe?e=>R+(e+.5)/l*B:e=>R+(l===1?B/2:e/(l-1)*B),ce=e=>z+V-e/ie*V,le=te?te.makeToY(z,V):ce,ue=e=>h(e)?le:ce,{color:de,width:W}=je(t.catAxisLineColor,t.catAxisLineWidthEmu,r),{color:G,width:fe}=je(t.valAxisLineColor,t.valAxisLineWidthEmu,r);if(!t.valAxisHidden){let n=It(t,r),i=Ut(t.valAxisMinorUnit,d);if(t.valAxisMinorGridlines&&i!=null&&isFinite(i)&&i>0&&i<ae)for(let t=i;t<ie-1e-9;t+=i)Math.abs(t/ae-Math.round(t/ae))>1e-6&&Ft(e,R,B,ce(t),!1,n);if(Ht(t)){let t=Math.round(ie/ae);for(let r=0;r<=t;r++)Ft(e,R,B,ce(r*ae),r===0,n)}}if(!t.catAxisHidden&&Lt(t)){let n=Rt(t,r);e.strokeStyle=n.color,e.lineWidth=n.width;for(let n of zt(t,l)){let t=R+n*B;e.beginPath(),e.moveTo(t,z),e.lineTo(t,z+V),e.stroke()}}let pe=u?Array(l).fill(0):null;for(let n=t.series.length-1;n>=0;n--){let r=t.series[n],i=mt(n,r),a=z+V,o=ue(r),s=r.smooth===!0;if(e.beginPath(),u&&pe){let t=[];for(let e=0;e<l;e++)t.push({x:se(e),y:ce(p(n,e)+pe[e])});e.moveTo(t[0].x,t[0].y),vn(e,t,s);for(let t=l-1;t>=0;t--)e.lineTo(se(t),ce(pe[t]));for(let e=0;e<l;e++)pe[e]+=p(n,e)}else{let t=[];for(let e=0;e<l;e++)t.push({x:se(e),y:o(r.values[e]??0)});e.moveTo(se(0),a),e.lineTo(t[0].x,t[0].y),vn(e,t,s),e.lineTo(se(l-1),a)}e.closePath(),e.fillStyle=ot(i,.6),e.fill(),e.strokeStyle=i,e.lineWidth=1.5,e.setLineDash([]),e.stroke()}{let n=Math.max(2,2.5*r),i=(e,n)=>{if(u){let r=0;for(let i=e;i<t.series.length;i++)r+=p(i,n);return r}return t.series[e].values[n]??0};for(let a=0;a<t.series.length;a++){let o=t.series[a],s=mt(a,o),u=ue(o),d=e=>i(a,e);for(let t of o.errBars??[])xn(e,o,t,l,se,u,d,s);if(o.showMarker===!0||bn(o))for(let t=0;t<l;t++){if(o.values[t]==null)continue;let i=(o.dataPointOverrides??[]).find(e=>e.idx===t),a=i?.markerSymbol??o.markerSymbol??`circle`;if(a===`none`)continue;let c=se(t),l=u(d(t));bn(o)?pn(e,c,l,a,i?.markerSize??o.markerSize??5,i?.markerFill??i?.color??o.markerFill??s,i?.markerLine??o.markerLine??null,r):(e.fillStyle=s,e.beginPath(),e.arc(c,l,n,0,Math.PI*2),e.fill())}Sn(e,o,c,l,se,u,d,V,r,t.date1904??!1,!0,vt(t,t.dataLabelFontFace,`minor`),t.dataLabelPosition??`ctr`)}}if(!t.valAxisHidden){e.font=`${Math.max(8,Math.min(11,V/20))}px ${vt(t,t.valAxisFontFace,`minor`)}`,e.textBaseline=`middle`;let n=Math.round(ie/ae);for(let r=0;r<=n;r++){let n=r*ae,i=ce(n);Pt(e,t.valAxisMajorTickMark,`val`,R,i,G,fe),e.fillStyle=t.valAxisFontColor?`#${t.valAxisFontColor}`:`#555`,e.textAlign=`right`,e.fillText(Wt(t,n,d),R-6,i)}}if(!t.catAxisHidden&&!t.catAxisLineHidden&&(e.strokeStyle=de,e.lineWidth=W,e.beginPath(),e.moveTo(R,z+V),e.lineTo(R+B,z+V),e.stroke()),!t.valAxisHidden&&!t.valAxisLineHidden&&t.valAxisLineColor!=null&&(e.strokeStyle=G,e.lineWidth=fe,e.beginPath(),e.moveTo(R,z),e.lineTo(R,z+V),e.stroke()),!t.catAxisHidden&&t.catAxisMajorTickMark&&t.catAxisMajorTickMark!==`none`)if(oe)for(let n=0;n<=l;n++)Pt(e,t.catAxisMajorTickMark,`cat`,z+V,R+n/l*B,de,W);else for(let n=0;n<l;n++)Pt(e,t.catAxisMajorTickMark,`cat`,z+V,se(n),de,W);if(!t.catAxisHidden){e.fillStyle=t.catAxisFontColor?`#${t.catAxisFontColor}`:`#555`,e.textAlign=`center`,e.textBaseline=`top`,e.font=`${Math.max(8,Math.min(11,B/l*.8))}px ${vt(t,t.catAxisFontFace,`minor`)}`;let n=c.map(e=>He((e??``).toString(),t.catAxisFormatCode,t.date1904)),r=0;for(let t=0;t<l;t++)r=Math.max(r,e.measureText(n[t]??``).width);let i=Math.max(1,Math.ceil((r+6)/(B/l))),a=B/l*i-4;for(let t=0;t<l;t+=i)e.fillText(Je(e,n[t]??``,a),se(t),z+V+3)}if(m&&te){let n=t.valAxisFontColor?`#${t.valAxisFontColor}`:`#555`;Qt(e,m,te,le,R,z,B,V,s,r,ne,F,n,t.date1904)}Nt(e,t,S,i,a,o,s,R,z,B,V,y+2),wt(e,t,i,a,o,s,R,z,B,V,w,E,O,k)}function sn(e,t,n,r,i){let{x:a,y:o,w:s,h:c}=n,l=t.series[0];if(!l)return;let u=l.categories&&l.categories.length>0?l.categories:t.categories,d=l.values.map(e=>Math.abs(e??0)),f=d.reduce((e,t)=>e+t,0);if(f===0)return;let p=K(t,a,o,s,c,i,{titleTopPadFrac:.035,titleBottomPadFrac:.035,legendSideReserveFrac:.28,radialGapFrac:.02}),m=p.title.fontPx,h=p.title.bandH;$t(e,t,a,o+p.title.topPad,s,m);let g=p.legend,{px0:_,py0:v,pw:y,ph:b}=p.plotRect,x=p.center.cx,S=p.center.cy,C=Math.min(y,b)*.42,w=-Math.PI/2+(t.firstSliceAngle??0)*Math.PI/180,T=r?Math.max(1,Math.min(90,t.holeSize??50)):0,E=r?t.series:[l],D=T/100*C,O=(C-D)/E.length,k=(e,t)=>{let n=(e.dataPointOverrides??[]).find(e=>e.idx===t)?.explosion??0;return n>0?n/100*C:0},A=l.seriesDataLabels,j=A!=null&&(A.showVal||A.showCatName||A.showSerName||A.showPercent),M=t.showDataLabels&&!j,N=vt(t,t.dataLabelFontFace,`minor`);for(let t=0;t<E.length;t++){let n=E[t],i=n.values.map(e=>Math.abs(e??0)),a=i.reduce((e,t)=>e+t,0);if(a===0)continue;let o=C-t*O,s=o-O,c=w;for(let l=0;l<i.length;l++){let u=i[l]/a*Math.PI*2,d=ht(l,n),f=c+u/2,p=k(n,l),m=p>0?Math.cos(f)*p:0,h=p>0?Math.sin(f)*p:0;if(e.beginPath(),s>.01?(e.arc(x+m,S+h,o,c,c+u),e.arc(x+m,S+h,s,c+u,c,!0)):(e.moveTo(x+m,S+h),e.arc(x+m,S+h,o,c,c+u)),e.closePath(),e.fillStyle=d,e.fill(),e.strokeStyle=`#fff`,e.lineWidth=1,e.stroke(),M&&t===0&&u>.15){let t=C*(r?.75:.6),n=x+m+Math.cos(f)*t,o=S+h+Math.sin(f)*t,s=Math.round(i[l]/a*100);e.font=`bold ${Math.max(8,C*.1)}px ${N}`,e.fillStyle=`#fff`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(`${s}%`,n,o)}c+=u}}if(j&&cn(e,t,A,l,u,d,f,x,S,C,D,w,N,i,_,v,y,b),g){let n=[{...l,categories:u}];Nt(e,{...t,series:n},g,a,o,s,c,_,v,y,b,h+2)}}function cn(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){if(n.labelBox){ln(e,t,n,r,i,a,o,s,c,l,d,f,p,m,g,h,_);return}let v=r.dataLabelOverrides??[],y=d;for(let d=0;d<a.length;d++){let p=a[d]/o*Math.PI*2,m=y+p/2;y+=p;let h=v.find(e=>e.idx===d);if(h?.deleted)continue;let g=h?.showCatName??n.showCatName,_=h?.showSerName??n.showSerName,b=h?.showVal??n.showVal,x=h?.showPercent??n.showPercent,S;if(h&&h.text)S=h.text;else{let e=[];g&&e.push((i[d]??``).toString()),_&&e.push(r.name),b&&e.push(Ve(a[d],n.formatCode??null,t.date1904??!1)),x&&e.push(`${Math.round(a[d]/o*100)}%`),S=e.filter(Boolean).join(` `)}if(!S)continue;let C=(h?.position??n.position??`bestFit`)===`outEnd`,w=C?l+Math.max(10,l*.12):u>.01?(u+l)/2:l*.88,T=s+Math.cos(m)*w,E=c+Math.sin(m)*w,D=h?.fontSizeHpt??n.fontSizeHpt,O=D?D/100:Math.max(8,l*.1),k=h?.fontBold??n.fontBold,A=h?.fontColor??n.fontColor;e.font=`${k?`bold `:``}${O}px ${f}`,e.fillStyle=A?`#${A}`:C?`#333`:`#fff`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(S,T,E)}}function ln(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){let _=r.dataLabelOverrides??[],v=e=>_.find(t=>t.idx===e),y=n.fontSizeHpt?n.fontSizeHpt/100:Math.max(9,l*.09),b=Math.max(4,y*.45),x=Math.max(2,y*.28),S=y*.22,C=n.labelBox,w=[],T=u;for(let u=0;u<a.length;u++){let p=a[u]/o*Math.PI*2,m=T+p/2;if(T+=p,p<=0)continue;let h=v(u);if(h?.deleted)continue;let g=h?.showCatName??n.showCatName,_=h?.showSerName??n.showSerName,E=h?.showVal??n.showVal,D=h?.showPercent??n.showPercent,O=[];if(h&&h.text)O.push(h.text);else{if(g){let e=(i[u]??``).toString();e&&O.push(e)}_&&r.name&&O.push(r.name),E&&O.push(Ve(a[u],n.formatCode??null,t.date1904??!1)),D&&O.push(`${Math.round(a[u]/o*100)}%`)}if(O.length===0)continue;let k=h?.fontSizeHpt?h.fontSizeHpt/100:y,A=h?.fontBold??n.fontBold??!1,j=h?.fontColor?`#${h.fontColor}`:n.fontColor?`#${n.fontColor}`:`#000`,M=h?.labelBox??C,N=M?.fill?`#${M.fill}`:null,ee=M?.borderColor?`#${M.borderColor}`:null,te=M?.borderWidthEmu?Math.max(.75,M.borderWidthEmu/ke*f):1;e.font=`${A?`bold `:``}${k}px ${d}`;let P=0;for(let t of O)P=Math.max(P,e.measureText(t).width);let ne=k+S,F=P+b*2,I=O.length*ne-S+x*2,L=s+Math.cos(m)*l,R=c+Math.sin(m)*l,z=Math.cos(m)<0,B=Math.max(F,I)*.55+l*.06,V=L+Math.cos(m)*B,H=R+Math.sin(m)*B;w.push({lines:O,midAngle:m,rimX:L,rimY:R,boxW:F,boxH:I,cxBox:V,cyBox:H,leftSide:z,fontColor:j,boxFill:N,boxBorder:ee,boxBorderPx:te,fontPx:k,bold:A})}let E=h+2,D=h+g-2,O=D-E,k=e=>{if(e.length===0)return;e.sort((e,t)=>e.cyBox-t.cyBox);let t=0;for(let n of e)t+=n.boxH;if(t+=(e.length-1)*3,t>O){let t=e.reduce((e,t)=>e+t.boxH,0),n=e.length;if(n===1){e[0].cyBox=Math.min(Math.max(e[0].cyBox,E+e[0].boxH/2),D-e[0].boxH/2);return}let r=(O-t)/(n-1),i=E;for(let t of e)t.cyBox=i+t.boxH/2,i+=t.boxH+r;return}for(let t=1;t<e.length;t++){let n=e[t-1],r=e[t],i=(n.boxH+r.boxH)/2+3;r.cyBox-n.cyBox<i&&(r.cyBox=n.cyBox+i)}let n=e[e.length-1].cyBox+e[e.length-1].boxH/2-D;if(n>0)for(let t of e)t.cyBox-=n;let r=E-(e[0].cyBox-e[0].boxH/2);if(r>0)for(let t of e)t.cyBox+=r};k(w.filter(e=>!e.leftSide)),k(w.filter(e=>e.leftSide));for(let e of w)e.cyBox=Math.max(E+e.boxH/2,e.cyBox),e.cyBox=Math.min(D-e.boxH/2,e.cyBox);let A=p+2,j=p+m-2;for(let e of w){let t=e.boxW/2;e.cxBox-t<A&&(e.cxBox=A+t),e.cxBox+t>j&&(e.cxBox=j-t)}let M=n.leaderLineColor?`#${n.leaderLineColor}`:`#a6a6a6`,N=n.leaderLineWidthEmu?Math.max(.5,n.leaderLineWidthEmu/ke*f):1;for(let t of w){let r=t.cxBox+(t.leftSide?t.boxW/2:-t.boxW/2),i=t.cyBox,a=r-t.rimX,o=i-t.rimY,s=Math.hypot(a,o);n.showLeaderLines&&s>t.fontPx*.9&&(e.beginPath(),e.moveTo(t.rimX,t.rimY),e.lineTo(r,i),e.strokeStyle=M,e.lineWidth=N,e.stroke())}for(let t of w){let n=t.cxBox-t.boxW/2,r=t.cyBox-t.boxH/2;t.boxFill&&(e.fillStyle=t.boxFill,e.fillRect(n,r,t.boxW,t.boxH)),t.boxBorder&&(e.strokeStyle=t.boxBorder,e.lineWidth=t.boxBorderPx,e.strokeRect(n,r,t.boxW,t.boxH)),e.font=`${t.bold?`bold `:``}${t.fontPx}px ${d}`,e.fillStyle=t.fontColor,e.textAlign=`center`,e.textBaseline=`middle`;let i=t.fontPx+S,a=t.cyBox-(t.lines.length*i-S)/2+t.fontPx/2;for(let n=0;n<t.lines.length;n++)e.fillText(t.lines[n],t.cxBox,a+n*i)}}function un(e,t,n,r){let{x:i,y:a,w:o,h:s}=n,c=en(t),l=c.length;if(l<3)return;let u=K(t,i,a,o,s,r,{titleTopPadFrac:.035,titleBottomPadFrac:.035,legendSideReserveFrac:.22,radialGapFrac:.02}),d=u.legend,f=u.title.fontPx;$t(e,t,i,a+u.title.topPad,o,f);let{px0:p,py0:m,pw:h,ph:g}=u.plotRect,_=u.center.cx,v=u.center.cy,y=Math.min(h,g)*.38,b=0;for(let e of t.series)for(let t of e.values)b=Math.max(b,t??0);t.valMax!=null&&(b=t.valMax),b===0&&(b=1);let{max:x,step:S}=Te(0,b,void 0,t.valMax,void 0,t.valAxisMajorUnit),C=-Math.PI/2,w=e=>C+e/l*Math.PI*2,T=Math.round(x/S),E=e=>Math.min(e*S,x);e.strokeStyle=`#ddd`,e.lineWidth=.5;for(let t=1;t<=T;t++){let n=E(t)/x*y;e.beginPath();for(let t=0;t<l;t++){let r=w(t),i=_+Math.cos(r)*n,a=v+Math.sin(r)*n;t===0?e.moveTo(i,a):e.lineTo(i,a)}e.closePath(),e.stroke()}e.strokeStyle=`#bbb`,e.lineWidth=.5;for(let t=0;t<l;t++){let n=w(t);e.beginPath(),e.moveTo(_,v),e.lineTo(_+Math.cos(n)*y,v+Math.sin(n)*y),e.stroke()}if(!t.valAxisHidden){e.font=`${qt(t.valAxisFontSizeHpt,s,r)}px ${vt(t,t.valAxisFontFace,`minor`)}`,e.fillStyle=`#555`,e.textAlign=`right`,e.textBaseline=`middle`;for(let t=1;t<=T;t++){let n=E(t),r=n/x*y;e.fillText(Be(n),_-3,v-r)}}e.font=`${Math.max(8,Math.min(11,y*.2))}px ${vt(t,t.catAxisFontFace,`minor`)}`,e.fillStyle=`#444`,e.textBaseline=`middle`;let D=_-h/2,O=_+h/2;for(let n=0;n<l;n++){let r=w(n),i=_+Math.cos(r)*(y+12),a=v+Math.sin(r)*(y+12),o=Math.cos(r)<-.1?`right`:Math.cos(r)>.1?`left`:`center`;e.textAlign=o;let s=o===`right`?i-D:o===`left`?O-i:2*Math.min(O-i,i-D),l=He((c[n]??``).toString(),t.catAxisFormatCode,t.date1904);e.fillText(Je(e,l,s),i,a)}let k=t.radarStyle===`filled`,A=Math.max(2,y*.025);for(let n=0;n<t.series.length;n++){let r=t.series[n],i=mt(n,r),a=[];for(let e=0;e<l;e++){let t=r.values[e];if(t==null){a.push(null);continue}let n=t/x,i=w(e);a.push([_+Math.cos(i)*y*n,v+Math.sin(i)*y*n])}e.beginPath();let o=!1;for(let t of a){if(t==null){o=!1;continue}o?e.lineTo(t[0],t[1]):(e.moveTo(t[0],t[1]),o=!0)}let s=a.every(e=>e!=null);if(k&&s?(e.closePath(),e.fillStyle=ot(i,.25),e.fill()):s&&e.closePath(),e.strokeStyle=i,e.lineWidth=2,e.stroke(),!k&&r.showMarker!==!1){e.fillStyle=i;for(let t of a)t!=null&&(e.beginPath(),e.arc(t[0],t[1],A,0,Math.PI*2),e.fill())}}Nt(e,t,d,i,a,o,s,p,m,h,g,u.title.bandH+2)}function dn(e,t,n){if(n)return t;let r=e[t];if(r==null)return null;let i=parseFloat(r);return Number.isNaN(i)?null:i}function fn(e,t,n,r){let{x:i,y:a,w:o,h:s}=n,c=ye(t,s,r),l=c.fontPx,u=c.topPad,d=qt(t.catAxisFontSizeHpt,s,r),f=qt(t.valAxisFontSizeHpt,s,r),p=me(t,o,s,.22),{legRightW:m,legLeftW:h,legTopH:g,legBottomH:_}=he(p),v=ve(t,o,s,r),y=v.catFontPx,b=v.valFontPx,x=v.catBandH,S=v.valBandW;if(t.title){let n=t.titleManualLayout;n&&(n.x!==void 0||n.y!==void 0)?$t(e,t,i+n.x*o,a+n.y*s,(n.w??.5)*o,l):$t(e,t,i,a+u,o,l)}let{plotRect:{px0:C,py0:w,pw:T,ph:E}}=K(t,i,a,o,s,r,{titleBand:c,legendSideReserveFrac:.22,pad:{t:c.bandH+g+f/2+2,r:m+o*.05,b:(t.catAxisHidden?s*.04:be(d))+x+_,l:(t.valAxisHidden?o*.04:o*.12)+S+h},honorPlotAreaManualLayout:!0});if(T<=0||E<=0)return;t.plotAreaBg&&(e.fillStyle=`#${t.plotAreaBg}`,e.fillRect(C,w,T,E));let D=[],O=[];for(let e of t.series){let n=e.categories??t.categories;for(let e of n){let t=parseFloat(e);isNaN(t)||D.push(t)}}let k=D.length===0;if(k){let e=Math.max(...t.series.map(e=>e.values.length));for(let t=0;t<e;t++)D.push(t);for(let e of t.series)for(let t of e.values)t!=null&&O.push(t)}else{D.length=0;for(let e of t.series){let n=e.categories??t.categories;for(let t=0;t<e.values.length;t++){let r=e.values[t];if(r==null)continue;let i=dn(n,t,!1);i!=null&&(D.push(i),O.push(r))}}}let A=Math.min(...D),j=Math.max(...D),M=Math.min(...O),N=Math.max(...O);A===j&&(--A,j+=1),M===N&&(--M,N+=1),t.valMin==null?M>0&&(M=0):M=t.valMin,t.valMax!=null&&(N=t.valMax);let{min:ee,max:te,step:P}=Te(M,N,t.valMin,t.valMax,void 0,t.valAxisMajorUnit);if(M=ee,N=te,t.catAxisMin!=null&&(A=t.catAxisMin),t.catAxisMax!=null&&(j=t.catAxisMax),t.catAxisMin==null||t.catAxisMax==null){let e=xe(j-A);e>0&&(t.catAxisMin??(A=Math.floor(A/e)*e),t.catAxisMax??(j=Math.ceil(j/e)*e))}let ne=e=>C+(e-A)/(j-A)*T,F=e=>w+E-(e-M)/(N-M)*E,I=It(t,r);if(!t.valAxisHidden){let n=Math.max(8,Math.min(11,E/20));e.font=`${t.valAxisFontBold?`bold `:``}${n}px ${vt(t,t.valAxisFontFace,`minor`)}`;let i=Math.round((N-M)/P)+1;for(let n=0;n<i;n++){let i=M+n*P;if(i>N+P*.01)break;let a=F(i);e.strokeStyle=I.color,e.lineWidth=I.width,e.beginPath(),e.moveTo(C,a),e.lineTo(C+T,a),e.stroke(),e.fillStyle=`#555`,e.textAlign=`right`,e.textBaseline=`middle`,e.fillText(Ve(i,t.valAxisFormatCode,t.date1904),C-4,a);let o=t.valAxisLineColor?`#${t.valAxisLineColor}`:void 0;Pt(e,t.valAxisMajorTickMark,`val`,C,a,o,Ae(t.valAxisLineWidthEmu,r))}}let L=w+E;if(t.catAxisCrossesAt!=null)L=_n(F(t.catAxisCrossesAt),w,w+E);else{let e=t.catAxisCrosses??`autoZero`;e===`autoZero`&&M<0&&N>0?L=_n(F(0),w,w+E):e===`min`?L=w+E:e===`max`&&(L=w)}if(!t.catAxisHidden&&!t.catAxisLineHidden&&(e.save(),e.strokeStyle=t.catAxisLineColor?`#${t.catAxisLineColor}`:`#888`,e.lineWidth=Ae(t.catAxisLineWidthEmu,r),e.lineCap=`butt`,e.beginPath(),e.moveTo(C,L),e.lineTo(C+T,L),e.stroke(),e.restore()),!t.valAxisHidden&&!t.valAxisLineHidden&&(e.save(),e.strokeStyle=t.valAxisLineColor?`#${t.valAxisLineColor}`:`#888`,e.lineWidth=Ae(t.valAxisLineWidthEmu,r),e.beginPath(),e.moveTo(C,w),e.lineTo(C,w+E),e.stroke(),e.restore()),!t.catAxisHidden){let n=Math.max(8,Math.min(11,E/20));e.font=`${t.catAxisFontBold?`bold `:``}${n}px ${vt(t,t.catAxisFontFace,`minor`)}`;let i=xe(j-A),a=Math.round((j-A)/i)+1;e.fillStyle=`#555`,e.textAlign=`center`,e.textBaseline=`top`;for(let n=0;n<a;n++){let a=A+n*i;if(a>j+i*.01)break;let o=ne(a);e.fillText(Ve(a,t.catAxisFormatCode,t.date1904),o,L+4);let s=t.catAxisLineColor?`#${t.catAxisLineColor}`:void 0;Pt(e,t.catAxisMajorTickMark,`cat`,L,o,s,Ae(t.catAxisLineWidthEmu,r))}}let R=t.chartType===`bubble`,z=R?`marker`:t.scatterStyle??`marker`,B=z===`line`||z===`lineMarker`||z===`lineNoMarker`,V=z===`smooth`||z===`smoothMarker`||z===`smoothNoMarker`,H=z===`lineNoMarker`||z===`smoothNoMarker`;for(let n=0;n<t.series.length;n++){let i=t.series[n],a=mt(n,i),o=i.categories??t.categories;for(let t of i.errBars??[])mn(e,i,t,o,k,ne,F,a);if((B||V)&&i.lineHidden!==!0){let t=[];for(let e=0;e<i.values.length;e++){let n=i.values[e];if(n==null)continue;let r=dn(o,e,k);r!=null&&t.push({x:ne(r),y:F(n)})}if(t.length>=2){if(e.save(),e.strokeStyle=i.color?`#${i.color}`:a,e.lineWidth=1.5,e.beginPath(),e.moveTo(t[0].x,t[0].y),V&&t.length>=3)for(let n=0;n<t.length-1;n++){let r=t[n-1]??t[n],i=t[n],a=t[n+1],o=t[n+2]??a,s=i.x+(a.x-r.x)/6,c=i.y+(a.y-r.y)/6,l=a.x-(o.x-i.x)/6,u=a.y-(o.y-i.y)/6;e.bezierCurveTo(s,c,l,u,a.x,a.y)}else for(let n=1;n<t.length;n++)e.lineTo(t[n].x,t[n].y);e.stroke(),e.restore()}}if(!(H||i.showMarker===!1||typeof i.markerSymbol==`string`&&i.markerSymbol===`none`)){let t=0;if(R&&i.bubbleSizes&&i.bubbleSizes.length>0){let e=Math.max(0,...i.bubbleSizes.filter(e=>e!=null));e>0&&(t=Math.min(T,E)/Math.max(8,i.values.length*1.6)/Math.sqrt(e))}for(let n=0;n<i.values.length;n++){let s=i.values[n];if(s==null)continue;let c=dn(o,n,k);if(c==null)continue;let l=(i.dataPointOverrides??[]).find(e=>e.idx===n),u=l?.markerSymbol??i.markerSymbol??`circle`,d=l?.markerSize??i.markerSize??5;if(R&&t>0){let e=i.bubbleSizes?.[n];e!=null&&e>0&&(d=Math.sqrt(e)*t*2/r)}let f=l?.markerFill??l?.color??i.markerFill??a,p=l?.markerLine??i.markerLine??null;pn(e,ne(c),F(s),u,d,f,p,r)}}hn(e,i,o,k,ne,F,E,r,t.date1904,vt(t,t.dataLabelFontFace,`minor`),t.dataLabelPosition??`r`)}Nt(e,t,p,i,a,o,s,C,w,T,E,c.bandH+2),wt(e,t,i,a,o,s,C,w,T,E,h,_,y,b)}function pn(e,t,n,r,i,a,o,s){let c=Math.max(2,i*s),l=c/2,u=a.startsWith(`#`)?a:`#${a}`,d=o?o.startsWith(`#`)?o:`#${o}`:null;switch(e.save(),e.fillStyle=u,d&&(e.strokeStyle=d,e.lineWidth=1),r){case`square`:e.fillRect(t-l,n-l,c,c),o&&e.strokeRect(t-l,n-l,c,c);break;case`diamond`:e.beginPath(),e.moveTo(t,n-l),e.lineTo(t+l,n),e.lineTo(t,n+l),e.lineTo(t-l,n),e.closePath(),e.fill(),o&&e.stroke();break;case`triangle`:e.beginPath(),e.moveTo(t,n-l),e.lineTo(t+l,n+l),e.lineTo(t-l,n+l),e.closePath(),e.fill(),o&&e.stroke();break;case`x`:e.strokeStyle=u,e.lineWidth=Math.max(1,c*.18),e.beginPath(),e.moveTo(t-l,n-l),e.lineTo(t+l,n+l),e.moveTo(t-l,n+l),e.lineTo(t+l,n-l),e.stroke();break;case`plus`:e.strokeStyle=u,e.lineWidth=Math.max(1,c*.18),e.beginPath(),e.moveTo(t-l,n),e.lineTo(t+l,n),e.moveTo(t,n-l),e.lineTo(t,n+l),e.stroke();break;case`star`:e.beginPath();for(let r=0;r<10;r++){let i=r%2==0?l:l*.45,a=-Math.PI/2+r*Math.PI/5,o=t+Math.cos(a)*i,s=n+Math.sin(a)*i;r===0?e.moveTo(o,s):e.lineTo(o,s)}e.closePath(),e.fill(),o&&e.stroke();break;case`dot`:e.beginPath(),e.arc(t,n,Math.max(1,c*.25),0,Math.PI*2),e.fill();break;case`dash`:{let r=Math.max(1,c*.25);e.fillRect(t-l,n-r/2,c,r);break}default:e.beginPath(),e.arc(t,n,l,0,Math.PI*2),e.fill(),o&&e.stroke();break}e.restore()}function mn(e,t,n,r,i,a,o,s){e.save(),e.strokeStyle=n.color?`#${n.color}`:s,e.lineWidth=n.lineWidthEmu?Math.max(.5,n.lineWidthEmu/ke):1,e.setLineDash(yn(n.dash));let c=n.barType===`plus`||n.barType===`both`,l=n.barType===`minus`||n.barType===`both`,u=n.dir===`x`,d=e.lineWidth*1.5;for(let s=0;s<t.values.length;s++){let f=t.values[s];if(f==null)continue;let p=dn(r,s,i);if(p==null)continue;let m=a(p),h=o(f),g=t=>{let r=m,i=h;u?r=a(p+t):i=o(f+t),e.beginPath(),e.moveTo(m,h),e.lineTo(r,i),e.stroke(),n.noEndCap||(e.save(),e.setLineDash([]),e.beginPath(),u?(e.moveTo(r,i-d),e.lineTo(r,i+d)):(e.moveTo(r-d,i),e.lineTo(r+d,i)),e.stroke(),e.restore())};if(c){let e=n.plus[s];e!=null&&g(e)}if(l){let e=n.minus[s];e!=null&&g(-e)}}e.restore()}function hn(e,t,n,r,i,a,o,s,c=!1,l=`sans-serif`,u=`r`){let d=t.dataLabelOverrides??[];if(d.length===0&&!t.seriesDataLabels)return;let f=t.seriesDataLabels;for(let p=0;p<t.values.length;p++){let m=t.values[p];if(m==null)continue;let h=dn(n,p,r);if(h==null)continue;let g=d.find(e=>e.idx===p);if(g?.deleted)continue;let _=g?.showCatName??f?.showCatName,v=g?.showSerName??f?.showSerName,y=g?.showVal??f?.showVal,b;if(g?.text)b=g.text;else if(y||v||_){let e=[];if(_&&!r&&e.push(n[p]??``),v&&e.push(t.name),y&&e.push(Ve(m,f?.formatCode??null,c)),b=e.filter(Boolean).join(` `),!b)continue}else continue;let x=g?.position??f?.position??u,S=g?.fontSizeHpt??f?.fontSizeHpt,C=S?S/100*s:Math.max(9,Math.min(11,o/25)),w=g?.fontColor??f?.fontColor,T=g?.fontBold??f?.fontBold??!1;gn(e,i(h),a(m),b,x,C,w,T,l)}}function gn(e,t,n,r,i,a,o,s,c=`sans-serif`,l=0){e.save(),e.font=`${s?`bold `:``}${a}px ${c}`,e.fillStyle=o?`#${o}`:`#333`;let u=a*.6+l,d=t,f=n;switch(i){case`l`:e.textAlign=`right`,e.textBaseline=`middle`,d=t-u;break;case`r`:e.textAlign=`left`,e.textBaseline=`middle`,d=t+u;break;case`t`:e.textAlign=`center`,e.textBaseline=`bottom`,f=n-u;break;case`b`:e.textAlign=`center`,e.textBaseline=`top`,f=n+u;break;case`ctr`:e.textAlign=`center`,e.textBaseline=`middle`;break;default:e.textAlign=`left`,e.textBaseline=`middle`,d=t+u;break}let p=r.split(/\\r?\\n/),m=a*1.15,h=m*p.length,g=f;e.textBaseline===`middle`?g=f-(h-m)/2:e.textBaseline===`bottom`&&(g=f-(h-m));for(let t of p)e.fillText(t,d,g),g+=m;e.restore()}function _n(e,t,n){return e<t?t:e>n?n:e}function vn(e,t,n){if(t.length!==0)if(n&&t.length>=3)for(let n=0;n<t.length-1;n++){let r=t[n-1]??t[n],i=t[n],a=t[n+1],o=t[n+2]??a,s=i.x+(a.x-r.x)/6,c=i.y+(a.y-r.y)/6,l=a.x-(o.x-i.x)/6,u=a.y-(o.y-i.y)/6;e.bezierCurveTo(s,c,l,u,a.x,a.y)}else for(let n=1;n<t.length;n++)e.lineTo(t[n].x,t[n].y)}function yn(e){if(!e)return[];switch(e){case`solid`:return[];case`dot`:case`sysDot`:return[1,2];case`dash`:case`sysDash`:return[4,2];case`lgDash`:return[8,3];case`dashDot`:case`sysDashDot`:return[4,2,1,2];case`lgDashDot`:return[8,3,1,3];case`dashDotDot`:case`sysDashDotDot`:case`lgDashDotDot`:return[4,2,1,2,1,2];default:return[]}}function bn(e){return e.markerSymbol!=null||e.markerSize!=null||e.markerFill!=null||e.markerLine!=null||e.dataPointOverrides!=null&&e.dataPointOverrides.length>0}function xn(e,t,n,r,i,a,o,s){if(n.dir===`x`)return;let c=n.barType===`plus`||n.barType===`both`,l=n.barType===`minus`||n.barType===`both`;e.save(),e.strokeStyle=n.color?`#${n.color}`:s,e.lineWidth=n.lineWidthEmu?Math.max(.5,n.lineWidthEmu/ke):1,e.setLineDash(yn(n.dash));let u=e.lineWidth*1.5;for(let s=0;s<r;s++){if(t.values[s]==null)continue;let r=o(s),d=i(s),f=a(r),p=t=>{let i=a(r+t);e.beginPath(),e.moveTo(d,f),e.lineTo(d,i),e.stroke(),n.noEndCap||(e.save(),e.setLineDash([]),e.beginPath(),e.moveTo(d-u,i),e.lineTo(d+u,i),e.stroke(),e.restore())};if(c){let e=n.plus[s];e!=null&&p(e)}if(l){let e=n.minus[s];e!=null&&p(-e)}}e.restore()}function Sn(e,t,n,r,i,a,o,s,c,l,u,d=`sans-serif`,f=`t`){let p=t.dataLabelOverrides??[],m=t.seriesDataLabels;if(p.length===0&&!m)return!1;for(let h=0;h<r;h++){if(t.values[h]==null&&!u)continue;let r=o(h),g=p.find(e=>e.idx===h);if(g?.deleted)continue;let _=g?.showCatName??m?.showCatName,v=g?.showSerName??m?.showSerName,y=g?.showVal??m?.showVal,b;if(g?.text)b=g.text;else if(y||v||_){let e=[];if(_&&e.push(n[h]??``),v&&e.push(t.name),y&&e.push(Ve(r,m?.formatCode??null,l)),b=e.filter(Boolean).join(` `),!b)continue}else continue;let x=g?.position??m?.position??f,S=g?.fontSizeHpt??m?.fontSizeHpt,C=S?S/100*c:Math.max(9,Math.min(11,s/25)),w=g?.fontColor??m?.fontColor,T=g?.fontBold??m?.fontBold??!1;gn(e,i(h),a(r),b,x,C,w,T,d)}return!0}function Cn(e,t,n){let{x:r,y:i,w:a,h:o}=n,s=t.plotAreaManualLayout,c,l,u,d;if(s&&s.w!=null&&s.h!=null)c=r+s.x*a,l=i+s.y*o,u=s.w*a,d=s.h*o;else{let e=t.valAxisHidden?a*.01:a*.11,n=a*.01,s=o*.12,f=o*.14;c=r+e,l=i+s,u=a-e-n,d=o-s-f}let f=t.series[0]?.values??[],p=t.categories,m=p.length;if(m===0)return;let h=new Set(t.subtotalIndices),g=0,_=[];for(let e=0;e<m;e++){let t=f[e]??0;if(e===0||h.has(e))_.push({start:0,end:t,isSub:!0,isPos:!0}),g=t;else{let e=t>=0?g:g+t,n=t>=0?g+t:g;_.push({start:e,end:n,isSub:!1,isPos:t>=0}),g+=t}}let v=_.map(e=>e.end),y=_.map(e=>e.start),b=Math.max(...v,...y),x=Math.min(...y,0),S=b-x;if(S<=0)return;let C=x<0?x-S*.05:0,w=(b-C)*1.1,T=C+w,E=xe(w);e.save();let D=Math.round(o*.042);if(e.font=`${D}px ${vt(t,t.valAxisFontFace,`minor`)}`,!t.valAxisHidden){e.strokeStyle=`#e8e8e8`,e.lineWidth=.7,e.fillStyle=`#666`,e.textAlign=`right`,e.textBaseline=`middle`;for(let n=Math.ceil(C/E)*E;n<=T;n+=E){let r=l+d*(1-(n-C)/w);e.beginPath(),e.moveTo(c,r),e.lineTo(c+u,r),e.stroke(),e.fillText(Ve(n,t.valAxisFormatCode,t.date1904),c-4,r)}}let O=!t.valAxisHidden&&!t.valAxisLineHidden,k=!t.catAxisHidden&&!t.catAxisLineHidden;(O||k)&&(e.strokeStyle=`#bbb`,e.lineWidth=1,e.beginPath(),O?(e.moveTo(c,l),e.lineTo(c,l+d),k&&e.lineTo(c+u,l+d)):k&&(e.moveTo(c,l+d),e.lineTo(c+u,l+d)),e.stroke());let A=u/m,j=A/(1+(t.barGapWidth??150)/100);_.forEach((n,r)=>{let i=c+A*r+(A-j)/2,a=l+d*(1-(n.end-C)/w),s=l+d*(1-(n.start-C)/w),u=Math.max(1,s-a);if(n.isSub?(e.fillStyle=`#196ECA`,e.fillRect(i,a,j,u)):(e.strokeStyle=n.isPos?`#5BA4E6`:`#E46970`,e.lineWidth=1.5,e.strokeRect(i+.75,a+.75,j-1.5,u-1.5)),r<m-1){let t=c+A*(r+1)+(A-j)/2,o=n.isPos?a:s;e.strokeStyle=`#ccc`,e.lineWidth=.8,e.setLineDash([3,3]),e.beginPath(),e.moveTo(i+j,o),e.lineTo(t,o),e.stroke(),e.setLineDash([])}let p=f[r]??0,h=t.dataLabelFormatCode??t.series[0]?.valFormatCode??null,g=p<0?`△ ${Ve(Math.abs(p),h,t.date1904)}`:Ve(p,h,t.date1904),_=t.series[0]?.dataLabelColors?.[r]??null;e.fillStyle=_?`#${_}`:t.dataLabelFontColor?`#${t.dataLabelFontColor}`:`#595959`,e.font=`bold ${Math.round(o*.044)}px ${vt(t,t.dataLabelFontFace,`minor`)}`,e.textAlign=`center`,p<0?(e.textBaseline=`top`,e.fillText(g,i+j/2,s+3)):(e.textBaseline=`bottom`,e.fillText(g,i+j/2,a-3))}),e.textAlign=`center`,e.textBaseline=`top`,e.fillStyle=`#666`,e.font=`${Math.round(o*.038)}px ${vt(t,t.catAxisFontFace,`minor`)}`;let M=l+d+4;for(let n=0;n<m;n++){let r=c+A*n+A/2;He(p[n],t.catAxisFormatCode,t.date1904).split(/\\s+/).forEach((t,n)=>e.fillText(t,r,M+n*(D+2)))}e.restore()}function wn(e,t,n){let r=e.length;if(r===0)return 0;if(r===1)return e[0];let i;n===`inclusive`?i=t*(r-1)+1:(i=t*(r+1),i<1&&(i=1),i>r&&(i=r));let a=Math.floor(i),o=i-a;return a>=r?e[r-1]:e[a-1]+o*(e[a]-e[a-1])}function Tn(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>e-t),r=wn(n,.25,t),i=wn(n,.5,t),a=wn(n,.75,t),o=a-r,s=r-1.5*o,c=a+1.5*o,l=[],u=[];for(let e of n)e<s||e>c?u.push(e):l.push(e);return{q1:r,median:i,q3:a,whiskerLo:l.length?l[0]:n[0],whiskerHi:l.length?l[l.length-1]:n[n.length-1],mean:e.reduce((e,t)=>e+t,0)/e.length,outliers:u,inner:l}}function En(e,t,n,r){let i=t.chartexBox;if(!i||i.categories.length===0||i.series.length===0)return;let{x:a,y:o,w:s,h:c}=n,l=ye(t,c,r),u=qt(t.catAxisFontSizeHpt,c,r),d=qt(t.valAxisFontSizeHpt,c,r),f=K(t,a,o,s,c,r,{titleBand:l,legendSideReserveFrac:0,pad:{t:l.bandH+d/2+2,r:s*.02,b:t.catAxisHidden?c*.02:be(u),l:t.valAxisHidden?s*.02:s*.1}});$t(e,t,a,o+f.title.topPad,s,f.title.fontPx);let{px0:p,py0:m,pw:h,ph:g}=f.plotRect,_=i.categories,v=_.length,y=i.series.length,b=1/0,x=-1/0;for(let e of i.series)for(let t of e.valuesByCategory)for(let e of t)e<b&&(b=e),e>x&&(x=e);if(!isFinite(b)||!isFinite(x))return;let{min:S,max:C,step:w}=Te(b,x,t.valMin,t.valMax,g/r,t.valAxisMajorUnit),T=C-S||1,E=e=>m+g*(1-(e-S)/T),D=vt(t,t.valAxisFontFace,`minor`),O=qt(t.valAxisFontSizeHpt,c,r);if(e.save(),!t.valAxisHidden){e.font=`${O}px ${D}`,e.textAlign=`right`,e.textBaseline=`middle`;for(let n=S;n<=C+1e-6;n+=w){let r=E(n);e.strokeStyle=`#e6e6e6`,e.lineWidth=1,e.beginPath(),e.moveTo(p,r),e.lineTo(p+h,r),e.stroke(),e.fillStyle=t.valAxisFontColor?`#${t.valAxisFontColor}`:`#595959`,e.fillText(Ve(n,t.valAxisFormatCode,t.date1904),p-4,r)}}!t.catAxisHidden&&!t.catAxisLineHidden&&(e.strokeStyle=`#bfbfbf`,e.lineWidth=1,e.beginPath(),e.moveTo(p,m+g),e.lineTo(p+h,m+g),e.stroke());let k=h/v,A=k/(1+(t.barGapWidth??150)/100),j=A*.06,M=(A-j*(y-1))/y,N=e=>{let n=t.chartexAccents?.[e%(t.chartexAccents?.length??1)];return`#${i.series[e].color??n??pt[e%pt.length]}`},ee=qt(t.catAxisFontSizeHpt,c,r);for(let n=0;n<v;n++){let r=p+k*n+(k-A)/2;for(let t=0;t<y;t++){let a=i.series[t],o=Tn(a.valuesByCategory[n]??[],a.quartileMethod);if(!o)continue;let s=r+t*(M+j),c=s+M/2,l=N(t),u=gt(l,.8),d=E(o.q1),f=E(o.q3),p=Math.min(d,f),m=Math.max(1,Math.abs(d-f)),h=M*.4;e.strokeStyle=u,e.lineWidth=1,e.beginPath(),e.moveTo(c,E(o.whiskerHi)),e.lineTo(c,f),e.moveTo(c,d),e.lineTo(c,E(o.whiskerLo)),e.moveTo(c-h/2,E(o.whiskerHi)),e.lineTo(c+h/2,E(o.whiskerHi)),e.moveTo(c-h/2,E(o.whiskerLo)),e.lineTo(c+h/2,E(o.whiskerLo)),e.stroke(),e.fillStyle=l,e.fillRect(s,p,M,m),e.strokeStyle=u,e.lineWidth=.75,e.strokeRect(s+.375,p+.375,M-.75,m-.75);let g=E(o.median);if(e.strokeStyle=u,e.lineWidth=1,e.beginPath(),e.moveTo(s,g),e.lineTo(s+M,g),e.stroke(),a.meanMarker){let t=E(o.mean),n=Math.max(2,M*.14);e.strokeStyle=u,e.lineWidth=1,e.beginPath(),e.moveTo(c-n,t-n),e.lineTo(c+n,t+n),e.moveTo(c+n,t-n),e.lineTo(c-n,t+n),e.stroke()}if(a.showOutliers){e.fillStyle=l;let t=Math.max(1.5,M*.06);for(let n of o.outliers)e.beginPath(),e.arc(c,E(n),t,0,Math.PI*2),e.fill()}}if(!t.catAxisHidden){e.font=`${ee}px ${vt(t,t.catAxisFontFace,`minor`)}`,e.fillStyle=t.catAxisFontColor?`#${t.catAxisFontColor}`:`#595959`,e.textAlign=`center`,e.textBaseline=`top`;let r=_[n],i=p+k*n+k/2;e.fillText(r,i,m+g+4)}}e.restore()}function Dn(e){let t={label:``,value:0,depth:-1,children:[],branchIndex:-1,a0:0,a1:0};for(let n of e){let e=t;for(let t=0;t<n.path.length;t++){let r=n.path[t],i=e.children.find(e=>e.label===r);i||(i={label:r,value:0,depth:t,children:[],branchIndex:t===0?e.children.length:e.branchIndex,a0:0,a1:0},e.children.push(i)),i.value+=n.size,e=i}}return t.value=t.children.reduce((e,t)=>e+t.value,0),t}function On(e){let t=e.children.reduce((e,t)=>e+t.value,0);if(t<=0)return;let n=e.a0;for(let r of e.children){let i=(e.a1-e.a0)*r.value/t;r.a0=n,r.a1=n+i,n=r.a1,On(r)}}function kn(e){return e.children.length===0?e.depth:Math.max(...e.children.map(kn))}function An(e,t,n,r){let i=t.chartexSunburst;if(!i||i.rows.length===0)return;let{x:a,y:o,w:s,h:c}=n,l=K(t,a,o,s,c,r,{titleTopPadFrac:.035,titleBottomPadFrac:.035,legendSideReserveFrac:0,radialGapFrac:.02});$t(e,t,a,o+l.title.topPad,s,l.title.fontPx);let{px0:u,py0:d,pw:f,ph:p}=l.plotRect,m=u+f/2,h=d+p/2,g=Math.min(f,p)*.46,_=Dn(i.rows);if(_.value<=0||_.children.length===0)return;_.a0=-Math.PI/2,_.a1=-Math.PI/2+Math.PI*2,On(_);let v=kn(_)+1,y=g*.18,b=(g-y)/v,x=t.chartexAccents,S=e=>`#${x?.[e%x.length]??pt[e%pt.length]}`,C=vt(t,t.dataLabelFontFace,`minor`),w=Math.max(7,Math.min(13,g*.075)),T=Array.from({length:v},()=>[]),E=e=>{e.depth>=0&&T[e.depth].push(e),e.children.forEach(E)};E(_),e.save();for(let t=0;t<v;t++){let n=y+t*b,r=n+b;for(let i of T[t]){let t=i.a1-i.a0;if(t<=1e-4)continue;e.beginPath(),e.arc(m,h,r,i.a0,i.a1),e.arc(m,h,n,i.a1,i.a0,!0),e.closePath(),e.fillStyle=S(i.branchIndex),e.fill(),e.strokeStyle=`#ffffff`,e.lineWidth=1,e.stroke();let a=(i.a0+i.a1)/2,o=(n+r)/2,s=b-4,c=t*o;if(s<w*.9&&c<w*.9)continue;e.save(),e.translate(m+Math.cos(a)*o,h+Math.sin(a)*o);let l=a+Math.PI/2,u=l*180/Math.PI%360;u>90&&u<270&&(l+=Math.PI),e.rotate(l),e.font=`${w}px ${C}`,e.fillStyle=`#ffffff`,e.textAlign=`center`,e.textBaseline=`middle`;let d=i.label.split(/\\s+/).filter(Boolean),f=c-2,p=[],g=``;for(let t of d){let n=g?`${g} ${t}`:t;e.measureText(n).width<=f||!g?g=n:(p.push(g),g=t)}g&&p.push(g);let _=w*1.05,v=Math.max(1,Math.floor(s/_)),y=p.slice(0,v).map(t=>Je(e,t,f)),x=y.length*_;y.forEach((t,n)=>{t!==``&&e.fillText(t,0,-x/2+_/2+n*_)}),e.restore()}}e.restore()}function jn(e,t,n,r=1.3333333333333333){e.save();try{let{x:i,y:a,w:o,h:s}=n;if(t.chartBg&&(e.fillStyle=`#${t.chartBg}`,e.fillRect(i,a,o,s)),t.chartBorderColor){e.save(),e.strokeStyle=`#${t.chartBorderColor}`,e.lineWidth=t.chartBorderWidthEmu?Math.max(.5,t.chartBorderWidthEmu/ke)*r:1;let n=e.lineWidth;e.strokeRect(i+n/2,a+n/2,o-n,s-n),e.restore()}let c=t.chartexBox!=null||t.chartexSunburst!=null;if(t.series.length===0&&!c){e.fillStyle=`#888`,e.font=`12px sans-serif`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(`(no data)`,i+o/2,a+s/2);return}switch(t.chartType){case`clusteredBar`:case`clusteredBarH`:case`stackedBar`:case`stackedBarH`:case`stackedBarPct`:case`stackedBarHPct`:nn(e,t,n,r);break;case`line`:case`stackedLine`:case`stackedLinePct`:rn(e,t,n,r);break;case`area`:case`stackedArea`:case`stackedAreaPct`:on(e,t,n,r);break;case`pie`:sn(e,t,n,!1,r);break;case`doughnut`:sn(e,t,n,!0,r);break;case`radar`:un(e,t,n,r);break;case`scatter`:case`bubble`:fn(e,t,n,r);break;case`waterfall`:Cn(e,t,n);break;case`stock`:an(e,t,n,r);break;case`boxWhisker`:En(e,t,n,r);break;case`sunburst`:An(e,t,n,r);break;default:e.fillStyle=`#888`,e.font=`11px sans-serif`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(`Chart: ${t.chartType}`,i+o/2,a+s/2)}}finally{e.restore()}}function Mn(e,t,n,r,i,a){for(let o of t){let t=0,s=0;for(let c of o)switch(c.cmd){case`moveTo`:e.moveTo(n+c.x*i,r+c.y*a),t=c.x,s=c.y;break;case`lineTo`:e.lineTo(n+c.x*i,r+c.y*a),t=c.x,s=c.y;break;case`cubicBezTo`:e.bezierCurveTo(n+c.x1*i,r+c.y1*a,n+c.x2*i,r+c.y2*a,n+c.x*i,r+c.y*a),t=c.x,s=c.y;break;case`arcTo`:{let o=c.wr*i,l=c.hr*a;if(o<=0||l<=0)break;let u=c.stAng*Math.PI/180,d=c.swAng*Math.PI/180,f=n+t*i,p=r+s*a,m=f-o*Math.cos(u),h=p-l*Math.sin(u),g=u+d;e.ellipse(m,h,o,l,0,u,g,d<0),t=(m+o*Math.cos(g)-n)/i,s=(h+l*Math.sin(g)-r)/a;break}case`close`:e.closePath();break}}}const Nn=1e-9;function Pn(e){return e.cmd===`lineTo`||e.cmd===`cubicBezTo`||e.cmd===`arcTo`}function Fn(e,t,n,r){let i=n===0?0:n,a=r===0?0:r;return{x:e,y:t,dx:i,dy:a,angle:Math.atan2(a,i)}}function In(e,t,n){switch(n.cmd){case`lineTo`:return{dx:n.x-e,dy:n.y-t};case`cubicBezTo`:{let r=n.x1-e,i=n.y1-t;return Math.abs(r)<Nn&&Math.abs(i)<Nn&&(r=n.x2-e,i=n.y2-t),Math.abs(r)<Nn&&Math.abs(i)<Nn&&(r=n.x-e,i=n.y-t),{dx:r,dy:i}}case`arcTo`:{let e=n.stAng*Math.PI/180,t=n.swAng<0?-1:1;return{dx:-n.wr*Math.sin(e)*t,dy:n.hr*Math.cos(e)*t}}default:return{dx:0,dy:0}}}function Ln(e,t,n){switch(n.cmd){case`moveTo`:case`lineTo`:case`cubicBezTo`:return{x:n.x,y:n.y};case`arcTo`:{if(n.wr<=0||n.hr<=0)return{x:e,y:t};let r=n.stAng*Math.PI/180,i=r+n.swAng*Math.PI/180,a=e-n.wr*Math.cos(r),o=t-n.hr*Math.sin(r);return{x:a+n.wr*Math.cos(i),y:o+n.hr*Math.sin(i)}}default:return{x:e,y:t}}}function Rn(e,t,n){let{x:r,y:i}=Ln(e,t,n);switch(n.cmd){case`lineTo`:return{dx:n.x-e,dy:n.y-t,x:r,y:i};case`cubicBezTo`:{let a=n.x-n.x2,o=n.y-n.y2;return Math.abs(a)<Nn&&Math.abs(o)<Nn&&(a=n.x-n.x1,o=n.y-n.y1),Math.abs(a)<Nn&&Math.abs(o)<Nn&&(a=n.x-e,o=n.y-t),{dx:a,dy:o,x:r,y:i}}case`arcTo`:{if(n.wr<=0||n.hr<=0)return{dx:0,dy:0,x:r,y:i};let e=n.stAng*Math.PI/180+n.swAng*Math.PI/180,t=n.swAng<0?-1:1;return{dx:-n.wr*Math.sin(e)*t,dy:n.hr*Math.cos(e)*t,x:r,y:i}}default:return{dx:0,dy:0,x:r,y:i}}}function zn(e){let t=0,n=0,r=!1;for(let i of e)i.cmd===`moveTo`&&(r=!0),{x:t,y:n}=Ln(t,n,i);return r?{x:t,y:n}:null}function Bn(e){if(e.some(e=>e.cmd===`close`))return!0;let t=e.find(e=>e.cmd===`moveTo`);if(!t)return!1;let n=zn(e);return!n||!e.some(Pn)?!1:Math.abs(n.x-t.x)<Nn&&Math.abs(n.y-t.y)<Nn}function Vn(e){let t={start:null,end:null};if(!e||e.length===0)return t;let n=e[0];if(n&&n.length>0&&!Bn(n)){let e=n.find(e=>e.cmd===`moveTo`),r=n.find(Pn);if(e&&r){let n=In(e.x,e.y,r);(Math.abs(n.dx)>Nn||Math.abs(n.dy)>Nn)&&(t.start=Fn(e.x,e.y,-n.dx,-n.dy))}}let r=e[e.length-1];if(r&&r.length>0&&!Bn(r)){let e=0,n=0,i=-1;for(let e=0;e<r.length;e++)Pn(r[e])&&(i=e);if(i>=0){for(let t=0;t<i;t++)({x:e,y:n}=Ln(e,n,r[t]));let a=Rn(e,n,r[i]);(Math.abs(a.dx)>Nn||Math.abs(a.dy)>Nn)&&(t.end=Fn(a.x,a.y,a.dx,a.dy))}}return t}var Hn={accentbordercallout1:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 112500`],[`adj4`,`val -38333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`t`],[`c`],[`l`,`x1`,`b`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`]]}]},accentbordercallout2:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 112500`],[`adj6`,`val -46667`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`t`],[`c`],[`l`,`x1`,`b`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`]]}]},accentbordercallout3:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 100000`],[`adj6`,`val -16667`],[`adj7`,`val 112963`],[`adj8`,`val -8333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`],[`y4`,`*/ h adj7 100000`],[`x4`,`*/ w adj8 100000`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`t`],[`c`],[`l`,`x1`,`b`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`],[`l`,`x4`,`y4`]]}]},accentcallout1:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 112500`],[`adj4`,`val -38333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`t`],[`c`],[`l`,`x1`,`b`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`]]}]},accentcallout2:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 112500`],[`adj6`,`val -46667`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`t`],[`c`],[`l`,`x1`,`b`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`]]}]},accentcallout3:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 100000`],[`adj6`,`val -16667`],[`adj7`,`val 112963`],[`adj8`,`val -8333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`],[`y4`,`*/ h adj7 100000`],[`x4`,`*/ w adj8 100000`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`t`],[`c`],[`l`,`x1`,`b`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`],[`l`,`x4`,`y4`]]}]},actionbuttonbackprevious:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g11`,`vc`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g11`,`vc`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g11`,`vc`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonbeginning:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 1 8`],[`g15`,`*/ g13 1 4`],[`g16`,`+- g11 g14 0`],[`g17`,`+- g11 g15 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g17`,`vc`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`c`],[`m`,`g16`,`g9`],[`l`,`g11`,`g9`],[`l`,`g11`,`g10`],[`l`,`g16`,`g10`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g17`,`vc`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`c`],[`m`,`g16`,`g9`],[`l`,`g11`,`g9`],[`l`,`g11`,`g10`],[`l`,`g16`,`g10`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g17`,`vc`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`c`],[`m`,`g16`,`g9`],[`l`,`g16`,`g10`],[`l`,`g11`,`g10`],[`l`,`g11`,`g9`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonblank:{adj:[],gd:[],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttondocument:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`dx1`,`*/ ss 9 32`],[`g11`,`+- hc 0 dx1`],[`g12`,`+- hc dx1 0`],[`g13`,`*/ ss 3 16`],[`g14`,`+- g12 0 g13`],[`g15`,`+- g9 g13 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g11`,`g9`],[`l`,`g14`,`g9`],[`l`,`g12`,`g15`],[`l`,`g12`,`g10`],[`l`,`g11`,`g10`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g11`,`g9`],[`l`,`g14`,`g9`],[`l`,`g14`,`g15`],[`l`,`g12`,`g15`],[`l`,`g12`,`g10`],[`l`,`g11`,`g10`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g14`,`g9`],[`l`,`g14`,`g15`],[`l`,`g12`,`g15`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g11`,`g9`],[`l`,`g14`,`g9`],[`l`,`g12`,`g15`],[`l`,`g12`,`g10`],[`l`,`g11`,`g10`],[`c`],[`m`,`g12`,`g15`],[`l`,`g14`,`g15`],[`l`,`g14`,`g9`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonend:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 3 4`],[`g15`,`*/ g13 7 8`],[`g16`,`+- g11 g14 0`],[`g17`,`+- g11 g15 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g16`,`vc`],[`l`,`g11`,`g9`],[`l`,`g11`,`g10`],[`c`],[`m`,`g17`,`g9`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`l`,`g17`,`g10`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g16`,`vc`],[`l`,`g11`,`g9`],[`l`,`g11`,`g10`],[`c`],[`m`,`g17`,`g9`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`l`,`g17`,`g10`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g16`,`vc`],[`l`,`g11`,`g10`],[`l`,`g11`,`g9`],[`c`],[`m`,`g17`,`g9`],[`l`,`g12`,`g9`],[`l`,`g12`,`g10`],[`l`,`g17`,`g10`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonforwardnext:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g12`,`vc`],[`l`,`g11`,`g9`],[`l`,`g11`,`g10`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g12`,`vc`],[`l`,`g11`,`g9`],[`l`,`g11`,`g10`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g12`,`vc`],[`l`,`g11`,`g10`],[`l`,`g11`,`g9`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonhelp:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g11`,`+- hc 0 dx2`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 1 7`],[`g15`,`*/ g13 3 14`],[`g16`,`*/ g13 2 7`],[`g19`,`*/ g13 3 7`],[`g20`,`*/ g13 4 7`],[`g21`,`*/ g13 17 28`],[`g23`,`*/ g13 21 28`],[`g24`,`*/ g13 11 14`],[`g27`,`+- g9 g16 0`],[`g29`,`+- g9 g21 0`],[`g30`,`+- g9 g23 0`],[`g31`,`+- g9 g24 0`],[`g33`,`+- g11 g15 0`],[`g36`,`+- g11 g19 0`],[`g37`,`+- g11 g20 0`],[`g41`,`*/ g13 1 14`],[`g42`,`*/ g13 3 28`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g33`,`g27`],[`a`,`g16`,`g16`,`cd2`,`cd2`],[`a`,`g14`,`g15`,`0`,`cd4`],[`a`,`g41`,`g42`,`3cd4`,`-5400000`],[`l`,`g37`,`g30`],[`l`,`g36`,`g30`],[`l`,`g36`,`g29`],[`a`,`g14`,`g15`,`cd2`,`cd4`],[`a`,`g41`,`g42`,`cd4`,`-5400000`],[`a`,`g14`,`g14`,`0`,`-10800000`],[`c`],[`m`,`hc`,`g31`],[`a`,`g42`,`g42`,`3cd4`,`21600000`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g33`,`g27`],[`a`,`g16`,`g16`,`cd2`,`cd2`],[`a`,`g14`,`g15`,`0`,`cd4`],[`a`,`g41`,`g42`,`3cd4`,`-5400000`],[`l`,`g37`,`g30`],[`l`,`g36`,`g30`],[`l`,`g36`,`g29`],[`a`,`g14`,`g15`,`cd2`,`cd4`],[`a`,`g41`,`g42`,`cd4`,`-5400000`],[`a`,`g14`,`g14`,`0`,`-10800000`],[`c`],[`m`,`hc`,`g31`],[`a`,`g42`,`g42`,`3cd4`,`21600000`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g33`,`g27`],[`a`,`g16`,`g16`,`cd2`,`cd2`],[`a`,`g14`,`g15`,`0`,`cd4`],[`a`,`g41`,`g42`,`3cd4`,`-5400000`],[`l`,`g37`,`g30`],[`l`,`g36`,`g30`],[`l`,`g36`,`g29`],[`a`,`g14`,`g15`,`cd2`,`cd4`],[`a`,`g41`,`g42`,`cd4`,`-5400000`],[`a`,`g14`,`g14`,`0`,`-10800000`],[`c`],[`m`,`hc`,`g31`],[`a`,`g42`,`g42`,`3cd4`,`21600000`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonhome:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 1 16`],[`g15`,`*/ g13 1 8`],[`g16`,`*/ g13 3 16`],[`g17`,`*/ g13 5 16`],[`g18`,`*/ g13 7 16`],[`g19`,`*/ g13 9 16`],[`g20`,`*/ g13 11 16`],[`g21`,`*/ g13 3 4`],[`g22`,`*/ g13 13 16`],[`g23`,`*/ g13 7 8`],[`g24`,`+- g9 g14 0`],[`g25`,`+- g9 g16 0`],[`g26`,`+- g9 g17 0`],[`g27`,`+- g9 g21 0`],[`g28`,`+- g11 g15 0`],[`g29`,`+- g11 g18 0`],[`g30`,`+- g11 g19 0`],[`g31`,`+- g11 g20 0`],[`g32`,`+- g11 g22 0`],[`g33`,`+- g11 g23 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`hc`,`g9`],[`l`,`g11`,`vc`],[`l`,`g28`,`vc`],[`l`,`g28`,`g10`],[`l`,`g33`,`g10`],[`l`,`g33`,`vc`],[`l`,`g12`,`vc`],[`l`,`g32`,`g26`],[`l`,`g32`,`g24`],[`l`,`g31`,`g24`],[`l`,`g31`,`g25`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g32`,`g26`],[`l`,`g32`,`g24`],[`l`,`g31`,`g24`],[`l`,`g31`,`g25`],[`c`],[`m`,`g28`,`vc`],[`l`,`g28`,`g10`],[`l`,`g29`,`g10`],[`l`,`g29`,`g27`],[`l`,`g30`,`g27`],[`l`,`g30`,`g10`],[`l`,`g33`,`g10`],[`l`,`g33`,`vc`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`hc`,`g9`],[`l`,`g11`,`vc`],[`l`,`g12`,`vc`],[`c`],[`m`,`g29`,`g27`],[`l`,`g30`,`g27`],[`l`,`g30`,`g10`],[`l`,`g29`,`g10`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`hc`,`g9`],[`l`,`g31`,`g25`],[`l`,`g31`,`g24`],[`l`,`g32`,`g24`],[`l`,`g32`,`g26`],[`l`,`g12`,`vc`],[`l`,`g33`,`vc`],[`l`,`g33`,`g10`],[`l`,`g28`,`g10`],[`l`,`g28`,`vc`],[`l`,`g11`,`vc`],[`c`],[`m`,`g31`,`g25`],[`l`,`g32`,`g26`],[`m`,`g33`,`vc`],[`l`,`g28`,`vc`],[`m`,`g29`,`g10`],[`l`,`g29`,`g27`],[`l`,`g30`,`g27`],[`l`,`g30`,`g10`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttoninformation:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g11`,`+- hc 0 dx2`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 1 32`],[`g17`,`*/ g13 5 16`],[`g18`,`*/ g13 3 8`],[`g19`,`*/ g13 13 32`],[`g20`,`*/ g13 19 32`],[`g22`,`*/ g13 11 16`],[`g23`,`*/ g13 13 16`],[`g24`,`*/ g13 7 8`],[`g25`,`+- g9 g14 0`],[`g28`,`+- g9 g17 0`],[`g29`,`+- g9 g18 0`],[`g30`,`+- g9 g23 0`],[`g31`,`+- g9 g24 0`],[`g32`,`+- g11 g17 0`],[`g34`,`+- g11 g19 0`],[`g35`,`+- g11 g20 0`],[`g37`,`+- g11 g22 0`],[`g38`,`*/ g13 3 32`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`hc`,`g9`],[`a`,`dx2`,`dx2`,`3cd4`,`21600000`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`hc`,`g9`],[`a`,`dx2`,`dx2`,`3cd4`,`21600000`],[`c`],[`m`,`hc`,`g25`],[`a`,`g38`,`g38`,`3cd4`,`21600000`],[`m`,`g32`,`g28`],[`l`,`g32`,`g29`],[`l`,`g34`,`g29`],[`l`,`g34`,`g30`],[`l`,`g32`,`g30`],[`l`,`g32`,`g31`],[`l`,`g37`,`g31`],[`l`,`g37`,`g30`],[`l`,`g35`,`g30`],[`l`,`g35`,`g28`],[`c`]]},{w:null,h:null,fill:`lighten`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`hc`,`g25`],[`a`,`g38`,`g38`,`3cd4`,`21600000`],[`m`,`g32`,`g28`],[`l`,`g35`,`g28`],[`l`,`g35`,`g30`],[`l`,`g37`,`g30`],[`l`,`g37`,`g31`],[`l`,`g32`,`g31`],[`l`,`g32`,`g30`],[`l`,`g34`,`g30`],[`l`,`g34`,`g29`],[`l`,`g32`,`g29`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`hc`,`g9`],[`a`,`dx2`,`dx2`,`3cd4`,`21600000`],[`c`],[`m`,`hc`,`g25`],[`a`,`g38`,`g38`,`3cd4`,`21600000`],[`m`,`g32`,`g28`],[`l`,`g35`,`g28`],[`l`,`g35`,`g30`],[`l`,`g37`,`g30`],[`l`,`g37`,`g31`],[`l`,`g32`,`g31`],[`l`,`g32`,`g30`],[`l`,`g34`,`g30`],[`l`,`g34`,`g29`],[`l`,`g32`,`g29`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonmovie:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 1455 21600`],[`g15`,`*/ g13 1905 21600`],[`g16`,`*/ g13 2325 21600`],[`g17`,`*/ g13 16155 21600`],[`g18`,`*/ g13 17010 21600`],[`g19`,`*/ g13 19335 21600`],[`g20`,`*/ g13 19725 21600`],[`g21`,`*/ g13 20595 21600`],[`g22`,`*/ g13 5280 21600`],[`g23`,`*/ g13 5730 21600`],[`g24`,`*/ g13 6630 21600`],[`g25`,`*/ g13 7492 21600`],[`g26`,`*/ g13 9067 21600`],[`g27`,`*/ g13 9555 21600`],[`g28`,`*/ g13 13342 21600`],[`g29`,`*/ g13 14580 21600`],[`g30`,`*/ g13 15592 21600`],[`g31`,`+- g11 g14 0`],[`g32`,`+- g11 g15 0`],[`g33`,`+- g11 g16 0`],[`g34`,`+- g11 g17 0`],[`g35`,`+- g11 g18 0`],[`g36`,`+- g11 g19 0`],[`g37`,`+- g11 g20 0`],[`g38`,`+- g11 g21 0`],[`g39`,`+- g9 g22 0`],[`g40`,`+- g9 g23 0`],[`g41`,`+- g9 g24 0`],[`g42`,`+- g9 g25 0`],[`g43`,`+- g9 g26 0`],[`g44`,`+- g9 g27 0`],[`g45`,`+- g9 g28 0`],[`g46`,`+- g9 g29 0`],[`g47`,`+- g9 g30 0`],[`g48`,`+- g9 g31 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g11`,`g39`],[`l`,`g11`,`g44`],[`l`,`g31`,`g44`],[`l`,`g32`,`g43`],[`l`,`g33`,`g43`],[`l`,`g33`,`g47`],[`l`,`g35`,`g47`],[`l`,`g35`,`g45`],[`l`,`g36`,`g45`],[`l`,`g38`,`g46`],[`l`,`g12`,`g46`],[`l`,`g12`,`g41`],[`l`,`g38`,`g41`],[`l`,`g37`,`g42`],[`l`,`g35`,`g42`],[`l`,`g35`,`g41`],[`l`,`g34`,`g40`],[`l`,`g32`,`g40`],[`l`,`g31`,`g39`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g11`,`g39`],[`l`,`g11`,`g44`],[`l`,`g31`,`g44`],[`l`,`g32`,`g43`],[`l`,`g33`,`g43`],[`l`,`g33`,`g47`],[`l`,`g35`,`g47`],[`l`,`g35`,`g45`],[`l`,`g36`,`g45`],[`l`,`g38`,`g46`],[`l`,`g12`,`g46`],[`l`,`g12`,`g41`],[`l`,`g38`,`g41`],[`l`,`g37`,`g42`],[`l`,`g35`,`g42`],[`l`,`g35`,`g41`],[`l`,`g34`,`g40`],[`l`,`g32`,`g40`],[`l`,`g31`,`g39`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g11`,`g39`],[`l`,`g31`,`g39`],[`l`,`g32`,`g40`],[`l`,`g34`,`g40`],[`l`,`g35`,`g41`],[`l`,`g35`,`g42`],[`l`,`g37`,`g42`],[`l`,`g38`,`g41`],[`l`,`g12`,`g41`],[`l`,`g12`,`g46`],[`l`,`g38`,`g46`],[`l`,`g36`,`g45`],[`l`,`g35`,`g45`],[`l`,`g35`,`g47`],[`l`,`g33`,`g47`],[`l`,`g33`,`g43`],[`l`,`g32`,`g43`],[`l`,`g31`,`g44`],[`l`,`g11`,`g44`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonreturn:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 7 8`],[`g15`,`*/ g13 3 4`],[`g16`,`*/ g13 5 8`],[`g17`,`*/ g13 3 8`],[`g18`,`*/ g13 1 4`],[`g19`,`+- g9 g15 0`],[`g20`,`+- g9 g16 0`],[`g21`,`+- g9 g18 0`],[`g22`,`+- g11 g14 0`],[`g23`,`+- g11 g15 0`],[`g24`,`+- g11 g16 0`],[`g25`,`+- g11 g17 0`],[`g26`,`+- g11 g18 0`],[`g27`,`*/ g13 1 8`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g12`,`g21`],[`l`,`g23`,`g9`],[`l`,`hc`,`g21`],[`l`,`g24`,`g21`],[`l`,`g24`,`g20`],[`a`,`g27`,`g27`,`0`,`cd4`],[`l`,`g25`,`g19`],[`a`,`g27`,`g27`,`cd4`,`cd4`],[`l`,`g26`,`g21`],[`l`,`g11`,`g21`],[`l`,`g11`,`g20`],[`a`,`g17`,`g17`,`cd2`,`-5400000`],[`l`,`hc`,`g10`],[`a`,`g17`,`g17`,`cd4`,`-5400000`],[`l`,`g22`,`g21`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g12`,`g21`],[`l`,`g23`,`g9`],[`l`,`hc`,`g21`],[`l`,`g24`,`g21`],[`l`,`g24`,`g20`],[`a`,`g27`,`g27`,`0`,`cd4`],[`l`,`g25`,`g19`],[`a`,`g27`,`g27`,`cd4`,`cd4`],[`l`,`g26`,`g21`],[`l`,`g11`,`g21`],[`l`,`g11`,`g20`],[`a`,`g17`,`g17`,`cd2`,`-5400000`],[`l`,`hc`,`g10`],[`a`,`g17`,`g17`,`cd4`,`-5400000`],[`l`,`g22`,`g21`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g12`,`g21`],[`l`,`g22`,`g21`],[`l`,`g22`,`g20`],[`a`,`g17`,`g17`,`0`,`cd4`],[`l`,`g25`,`g10`],[`a`,`g17`,`g17`,`cd4`,`cd4`],[`l`,`g11`,`g21`],[`l`,`g26`,`g21`],[`l`,`g26`,`g20`],[`a`,`g27`,`g27`,`cd2`,`-5400000`],[`l`,`hc`,`g19`],[`a`,`g27`,`g27`,`cd4`,`-5400000`],[`l`,`g24`,`g21`],[`l`,`hc`,`g21`],[`l`,`g23`,`g9`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},actionbuttonsound:{adj:[],gd:[[`dx2`,`*/ ss 3 8`],[`g9`,`+- vc 0 dx2`],[`g10`,`+- vc dx2 0`],[`g11`,`+- hc 0 dx2`],[`g12`,`+- hc dx2 0`],[`g13`,`*/ ss 3 4`],[`g14`,`*/ g13 1 8`],[`g15`,`*/ g13 5 16`],[`g16`,`*/ g13 5 8`],[`g17`,`*/ g13 11 16`],[`g18`,`*/ g13 3 4`],[`g19`,`*/ g13 7 8`],[`g20`,`+- g9 g14 0`],[`g21`,`+- g9 g15 0`],[`g22`,`+- g9 g17 0`],[`g23`,`+- g9 g19 0`],[`g24`,`+- g11 g15 0`],[`g25`,`+- g11 g16 0`],[`g26`,`+- g11 g18 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`g11`,`g21`],[`l`,`g11`,`g22`],[`l`,`g24`,`g22`],[`l`,`g25`,`g10`],[`l`,`g25`,`g9`],[`l`,`g24`,`g21`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`g11`,`g21`],[`l`,`g11`,`g22`],[`l`,`g24`,`g22`],[`l`,`g25`,`g10`],[`l`,`g25`,`g9`],[`l`,`g24`,`g21`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`g11`,`g21`],[`l`,`g24`,`g21`],[`l`,`g25`,`g9`],[`l`,`g25`,`g10`],[`l`,`g24`,`g22`],[`l`,`g11`,`g22`],[`c`],[`m`,`g26`,`g21`],[`l`,`g12`,`g20`],[`m`,`g26`,`vc`],[`l`,`g12`,`vc`],[`m`,`g26`,`g22`],[`l`,`g12`,`g23`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},arc:{adj:[[`adj1`,`val 16200000`],[`adj2`,`val 0`]],gd:[[`stAng`,`pin 0 adj1 21599999`],[`enAng`,`pin 0 adj2 21599999`],[`sw11`,`+- enAng 0 stAng`],[`sw12`,`+- sw11 21600000 0`],[`swAng`,`?: sw11 sw11 sw12`],[`wt1`,`sin wd2 stAng`],[`ht1`,`cos hd2 stAng`],[`dx1`,`cat2 wd2 ht1 wt1`],[`dy1`,`sat2 hd2 ht1 wt1`],[`wt2`,`sin wd2 enAng`],[`ht2`,`cos hd2 enAng`],[`dx2`,`cat2 wd2 ht2 wt2`],[`dy2`,`sat2 hd2 ht2 wt2`],[`x1`,`+- hc dx1 0`],[`y1`,`+- vc dy1 0`],[`x2`,`+- hc dx2 0`],[`y2`,`+- vc dy2 0`],[`sw0`,`+- 21600000 0 stAng`],[`da1`,`+- swAng 0 sw0`],[`g1`,`max x1 x2`],[`ir`,`?: da1 r g1`],[`sw1`,`+- cd4 0 stAng`],[`sw2`,`+- 27000000 0 stAng`],[`sw3`,`?: sw1 sw1 sw2`],[`da2`,`+- swAng 0 sw3`],[`g5`,`max y1 y2`],[`ib`,`?: da2 b g5`],[`sw4`,`+- cd2 0 stAng`],[`sw5`,`+- 32400000 0 stAng`],[`sw6`,`?: sw4 sw4 sw5`],[`da3`,`+- swAng 0 sw6`],[`g9`,`min x1 x2`],[`il`,`?: da3 l g9`],[`sw7`,`+- 3cd4 0 stAng`],[`sw8`,`+- 37800000 0 stAng`],[`sw9`,`?: sw7 sw7 sw8`],[`da4`,`+- swAng 0 sw9`],[`g13`,`min y1 y2`],[`it`,`?: da4 t g13`],[`cang1`,`+- stAng 0 cd4`],[`cang2`,`+- enAng cd4 0`],[`cang3`,`+/ cang1 cang2 2`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`a`,`wd2`,`hd2`,`stAng`,`swAng`],[`l`,`hc`,`vc`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`a`,`wd2`,`hd2`,`stAng`,`swAng`]]}]},bentarrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 43750`]],gd:[[`a2`,`pin 0 adj2 50000`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`a3`,`pin 0 adj3 50000`],[`th`,`*/ ss a1 100000`],[`aw2`,`*/ ss a2 100000`],[`th2`,`*/ th 1 2`],[`dh2`,`+- aw2 0 th2`],[`ah`,`*/ ss a3 100000`],[`bw`,`+- r 0 ah`],[`bh`,`+- b 0 dh2`],[`bs`,`min bw bh`],[`maxAdj4`,`*/ 100000 bs ss`],[`a4`,`pin 0 adj4 maxAdj4`],[`bd`,`*/ ss a4 100000`],[`bd3`,`+- bd 0 th`],[`bd2`,`max bd3 0`],[`x3`,`+- th bd2 0`],[`x4`,`+- r 0 ah`],[`y3`,`+- dh2 th 0`],[`y4`,`+- y3 dh2 0`],[`y5`,`+- dh2 bd 0`],[`y6`,`+- y3 bd2 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`l`,`y5`],[`a`,`bd`,`bd`,`cd2`,`cd4`],[`l`,`x4`,`dh2`],[`l`,`x4`,`t`],[`l`,`r`,`aw2`],[`l`,`x4`,`y4`],[`l`,`x4`,`y3`],[`l`,`x3`,`y3`],[`a`,`bd2`,`bd2`,`3cd4`,`-5400000`],[`l`,`th`,`b`],[`c`]]}]},bentconnector2:{adj:[],gd:[],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`]]}]},bentconnector3:{adj:[[`adj1`,`val 50000`]],gd:[[`x1`,`*/ w adj1 100000`]],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`l`,`x1`,`b`],[`l`,`r`,`b`]]}]},bentconnector4:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`x1`,`*/ w adj1 100000`],[`x2`,`+/ x1 r 2`],[`y2`,`*/ h adj2 100000`],[`y1`,`+/ t y2 2`]],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`l`,`x1`,`y2`],[`l`,`r`,`y2`],[`l`,`r`,`b`]]}]},bentconnector5:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`],[`adj3`,`val 50000`]],gd:[[`x1`,`*/ w adj1 100000`],[`x3`,`*/ w adj3 100000`],[`x2`,`+/ x1 x3 2`],[`y2`,`*/ h adj2 100000`],[`y1`,`+/ t y2 2`],[`y3`,`+/ b y2 2`]],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`l`,`x1`,`y2`],[`l`,`x3`,`y2`],[`l`,`x3`,`b`],[`l`,`r`,`b`]]}]},bentuparrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`]],gd:[[`a1`,`pin 0 adj1 50000`],[`a2`,`pin 0 adj2 50000`],[`a3`,`pin 0 adj3 50000`],[`y1`,`*/ ss a3 100000`],[`dx1`,`*/ ss a2 50000`],[`x1`,`+- r 0 dx1`],[`dx3`,`*/ ss a2 100000`],[`x3`,`+- r 0 dx3`],[`dx2`,`*/ ss a1 200000`],[`x2`,`+- x3 0 dx2`],[`x4`,`+- x3 dx2 0`],[`dy2`,`*/ ss a1 100000`],[`y2`,`+- b 0 dy2`],[`x0`,`*/ x4 1 2`],[`y3`,`+/ y2 b 2`],[`y15`,`+/ y1 b 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`y1`],[`l`,`x1`,`y1`],[`l`,`x3`,`t`],[`l`,`r`,`y1`],[`l`,`x4`,`y1`],[`l`,`x4`,`b`],[`l`,`l`,`b`],[`c`]]}]},bevel:{adj:[[`adj`,`val 12500`]],gd:[[`a`,`pin 0 adj 50000`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`y2`,`+- b 0 x1`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x1`,`x1`],[`l`,`x2`,`x1`],[`l`,`x2`,`y2`],[`l`,`x1`,`y2`],[`c`]]},{w:null,h:null,fill:`lightenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`x2`,`x1`],[`l`,`x1`,`x1`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`b`],[`l`,`x1`,`y2`],[`l`,`x2`,`y2`],[`l`,`r`,`b`],[`c`]]},{w:null,h:null,fill:`lighten`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`x1`],[`l`,`x1`,`y2`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`darken`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`r`,`t`],[`l`,`r`,`b`],[`l`,`x2`,`y2`],[`l`,`x2`,`x1`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`x1`,`x1`],[`l`,`x2`,`x1`],[`l`,`x2`,`y2`],[`l`,`x1`,`y2`],[`c`],[`m`,`l`,`t`],[`l`,`x1`,`x1`],[`m`,`l`,`b`],[`l`,`x1`,`y2`],[`m`,`r`,`t`],[`l`,`x2`,`x1`],[`m`,`r`,`b`],[`l`,`x2`,`y2`]]}]},blockarc:{adj:[[`adj1`,`val 10800000`],[`adj2`,`val 0`],[`adj3`,`val 25000`]],gd:[[`stAng`,`pin 0 adj1 21599999`],[`istAng`,`pin 0 adj2 21599999`],[`a3`,`pin 0 adj3 50000`],[`sw11`,`+- istAng 0 stAng`],[`sw12`,`+- sw11 21600000 0`],[`swAng`,`?: sw11 sw11 sw12`],[`iswAng`,`+- 0 0 swAng`],[`wt1`,`sin wd2 stAng`],[`ht1`,`cos hd2 stAng`],[`wt3`,`sin wd2 istAng`],[`ht3`,`cos hd2 istAng`],[`dx1`,`cat2 wd2 ht1 wt1`],[`dy1`,`sat2 hd2 ht1 wt1`],[`dx3`,`cat2 wd2 ht3 wt3`],[`dy3`,`sat2 hd2 ht3 wt3`],[`x1`,`+- hc dx1 0`],[`y1`,`+- vc dy1 0`],[`x3`,`+- hc dx3 0`],[`y3`,`+- vc dy3 0`],[`dr`,`*/ ss a3 100000`],[`iwd2`,`+- wd2 0 dr`],[`ihd2`,`+- hd2 0 dr`],[`wt2`,`sin iwd2 istAng`],[`ht2`,`cos ihd2 istAng`],[`wt4`,`sin iwd2 stAng`],[`ht4`,`cos ihd2 stAng`],[`dx2`,`cat2 iwd2 ht2 wt2`],[`dy2`,`sat2 ihd2 ht2 wt2`],[`dx4`,`cat2 iwd2 ht4 wt4`],[`dy4`,`sat2 ihd2 ht4 wt4`],[`x2`,`+- hc dx2 0`],[`y2`,`+- vc dy2 0`],[`x4`,`+- hc dx4 0`],[`y4`,`+- vc dy4 0`],[`sw0`,`+- 21600000 0 stAng`],[`da1`,`+- swAng 0 sw0`],[`g1`,`max x1 x2`],[`g2`,`max x3 x4`],[`g3`,`max g1 g2`],[`ir`,`?: da1 r g3`],[`sw1`,`+- cd4 0 stAng`],[`sw2`,`+- 27000000 0 stAng`],[`sw3`,`?: sw1 sw1 sw2`],[`da2`,`+- swAng 0 sw3`],[`g5`,`max y1 y2`],[`g6`,`max y3 y4`],[`g7`,`max g5 g6`],[`ib`,`?: da2 b g7`],[`sw4`,`+- cd2 0 stAng`],[`sw5`,`+- 32400000 0 stAng`],[`sw6`,`?: sw4 sw4 sw5`],[`da3`,`+- swAng 0 sw6`],[`g9`,`min x1 x2`],[`g10`,`min x3 x4`],[`g11`,`min g9 g10`],[`il`,`?: da3 l g11`],[`sw7`,`+- 3cd4 0 stAng`],[`sw8`,`+- 37800000 0 stAng`],[`sw9`,`?: sw7 sw7 sw8`],[`da4`,`+- swAng 0 sw9`],[`g13`,`min y1 y2`],[`g14`,`min y3 y4`],[`g15`,`min g13 g14`],[`it`,`?: da4 t g15`],[`x5`,`+/ x1 x4 2`],[`y5`,`+/ y1 y4 2`],[`x6`,`+/ x3 x2 2`],[`y6`,`+/ y3 y2 2`],[`cang1`,`+- stAng 0 cd4`],[`cang2`,`+- istAng cd4 0`],[`cang3`,`+/ cang1 cang2 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`a`,`wd2`,`hd2`,`stAng`,`swAng`],[`l`,`x2`,`y2`],[`a`,`iwd2`,`ihd2`,`istAng`,`iswAng`],[`c`]]}]},bordercallout1:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 112500`],[`adj4`,`val -38333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`]]}]},bordercallout2:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 112500`],[`adj6`,`val -46667`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`]]}]},bordercallout3:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 100000`],[`adj6`,`val -16667`],[`adj7`,`val 112963`],[`adj8`,`val -8333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`],[`y4`,`*/ h adj7 100000`],[`x4`,`*/ w adj8 100000`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`],[`l`,`x4`,`y4`]]}]},bracepair:{adj:[[`adj`,`val 8333`]],gd:[[`a`,`pin 0 adj 25000`],[`x1`,`*/ ss a 100000`],[`x2`,`*/ ss a 50000`],[`x3`,`+- r 0 x2`],[`x4`,`+- r 0 x1`],[`y2`,`+- vc 0 x1`],[`y3`,`+- vc x1 0`],[`y4`,`+- b 0 x1`],[`it`,`*/ x1 29289 100000`],[`il`,`+- x1 it 0`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 it`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x2`,`b`],[`a`,`x1`,`x1`,`cd4`,`cd4`],[`l`,`x1`,`y3`],[`a`,`x1`,`x1`,`0`,`-5400000`],[`a`,`x1`,`x1`,`cd4`,`-5400000`],[`l`,`x1`,`x1`],[`a`,`x1`,`x1`,`cd2`,`cd4`],[`l`,`x3`,`t`],[`a`,`x1`,`x1`,`3cd4`,`cd4`],[`l`,`x4`,`y2`],[`a`,`x1`,`x1`,`cd2`,`-5400000`],[`a`,`x1`,`x1`,`3cd4`,`-5400000`],[`l`,`x4`,`y4`],[`a`,`x1`,`x1`,`0`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x2`,`b`],[`a`,`x1`,`x1`,`cd4`,`cd4`],[`l`,`x1`,`y3`],[`a`,`x1`,`x1`,`0`,`-5400000`],[`a`,`x1`,`x1`,`cd4`,`-5400000`],[`l`,`x1`,`x1`],[`a`,`x1`,`x1`,`cd2`,`cd4`],[`m`,`x3`,`t`],[`a`,`x1`,`x1`,`3cd4`,`cd4`],[`l`,`x4`,`y2`],[`a`,`x1`,`x1`,`cd2`,`-5400000`],[`a`,`x1`,`x1`,`3cd4`,`-5400000`],[`l`,`x4`,`y4`],[`a`,`x1`,`x1`,`0`,`cd4`]]}]},bracketpair:{adj:[[`adj`,`val 16667`]],gd:[[`a`,`pin 0 adj 50000`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`y2`,`+- b 0 x1`],[`il`,`*/ x1 29289 100000`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`x1`],[`a`,`x1`,`x1`,`cd2`,`cd4`],[`l`,`x2`,`t`],[`a`,`x1`,`x1`,`3cd4`,`cd4`],[`l`,`r`,`y2`],[`a`,`x1`,`x1`,`0`,`cd4`],[`l`,`x1`,`b`],[`a`,`x1`,`x1`,`cd4`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`b`],[`a`,`x1`,`x1`,`cd4`,`cd4`],[`l`,`l`,`x1`],[`a`,`x1`,`x1`,`cd2`,`cd4`],[`m`,`x2`,`t`],[`a`,`x1`,`x1`,`3cd4`,`cd4`],[`l`,`r`,`y2`],[`a`,`x1`,`x1`,`0`,`cd4`]]}]},callout1:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 112500`],[`adj4`,`val -38333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`]]}]},callout2:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 112500`],[`adj6`,`val -46667`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`]]}]},callout3:{adj:[[`adj1`,`val 18750`],[`adj2`,`val -8333`],[`adj3`,`val 18750`],[`adj4`,`val -16667`],[`adj5`,`val 100000`],[`adj6`,`val -16667`],[`adj7`,`val 112963`],[`adj8`,`val -8333`]],gd:[[`y1`,`*/ h adj1 100000`],[`x1`,`*/ w adj2 100000`],[`y2`,`*/ h adj3 100000`],[`x2`,`*/ w adj4 100000`],[`y3`,`*/ h adj5 100000`],[`x3`,`*/ w adj6 100000`],[`y4`,`*/ h adj7 100000`],[`x4`,`*/ w adj8 100000`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y2`],[`l`,`x3`,`y3`],[`l`,`x4`,`y4`]]}]},can:{adj:[[`adj`,`val 25000`]],gd:[[`maxAdj`,`*/ 50000 h ss`],[`a`,`pin 0 adj maxAdj`],[`y1`,`*/ ss a 200000`],[`y2`,`+- y1 y1 0`],[`y3`,`+- b 0 y1`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`y1`],[`a`,`wd2`,`y1`,`cd2`,`-10800000`],[`l`,`r`,`y3`],[`a`,`wd2`,`y1`,`0`,`cd2`],[`c`]]},{w:null,h:null,fill:`lighten`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`y1`],[`a`,`wd2`,`y1`,`cd2`,`cd2`],[`a`,`wd2`,`y1`,`0`,`cd2`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`r`,`y1`],[`a`,`wd2`,`y1`,`0`,`cd2`],[`a`,`wd2`,`y1`,`cd2`,`cd2`],[`l`,`r`,`y3`],[`a`,`wd2`,`y1`,`0`,`cd2`],[`l`,`l`,`y1`]]}]},chartplus:{adj:[],gd:[],paths:[{w:10,h:10,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`5`,`0`],[`l`,`5`,`10`],[`m`,`0`,`5`],[`l`,`10`,`5`]]},{w:10,h:10,fill:null,stroke:!1,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`0`,`10`],[`l`,`10`,`10`],[`l`,`10`,`0`],[`c`]]}]},chartstar:{adj:[],gd:[],paths:[{w:10,h:10,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`0`,`0`],[`l`,`10`,`10`],[`m`,`0`,`10`],[`l`,`10`,`0`],[`m`,`5`,`0`],[`l`,`5`,`10`]]},{w:10,h:10,fill:null,stroke:!1,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`0`,`10`],[`l`,`10`,`10`],[`l`,`10`,`0`],[`c`]]}]},chartx:{adj:[],gd:[],paths:[{w:10,h:10,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`0`,`0`],[`l`,`10`,`10`],[`m`,`0`,`10`],[`l`,`10`,`0`]]},{w:10,h:10,fill:null,stroke:!1,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`0`,`10`],[`l`,`10`,`10`],[`l`,`10`,`0`],[`c`]]}]},chevron:{adj:[[`adj`,`val 50000`]],gd:[[`maxAdj`,`*/ 100000 w ss`],[`a`,`pin 0 adj maxAdj`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`x3`,`*/ x2 1 2`],[`dx`,`+- x2 0 x1`],[`il`,`?: dx x1 l`],[`ir`,`?: dx x2 r`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x2`,`t`],[`l`,`r`,`vc`],[`l`,`x2`,`b`],[`l`,`l`,`b`],[`l`,`x1`,`vc`],[`c`]]}]},chord:{adj:[[`adj1`,`val 2700000`],[`adj2`,`val 16200000`]],gd:[[`stAng`,`pin 0 adj1 21599999`],[`enAng`,`pin 0 adj2 21599999`],[`sw1`,`+- enAng 0 stAng`],[`sw2`,`+- sw1 21600000 0`],[`swAng`,`?: sw1 sw1 sw2`],[`wt1`,`sin wd2 stAng`],[`ht1`,`cos hd2 stAng`],[`dx1`,`cat2 wd2 ht1 wt1`],[`dy1`,`sat2 hd2 ht1 wt1`],[`wt2`,`sin wd2 enAng`],[`ht2`,`cos hd2 enAng`],[`dx2`,`cat2 wd2 ht2 wt2`],[`dy2`,`sat2 hd2 ht2 wt2`],[`x1`,`+- hc dx1 0`],[`y1`,`+- vc dy1 0`],[`x2`,`+- hc dx2 0`],[`y2`,`+- vc dy2 0`],[`x3`,`+/ x1 x2 2`],[`y3`,`+/ y1 y2 2`],[`midAng0`,`*/ swAng 1 2`],[`midAng`,`+- stAng midAng0 cd2`],[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`a`,`wd2`,`hd2`,`stAng`,`swAng`],[`c`]]}]},circulararrow:{adj:[[`adj1`,`val 12500`],[`adj2`,`val 1142319`],[`adj3`,`val 20457681`],[`adj4`,`val 10800000`],[`adj5`,`val 12500`]],gd:[[`a5`,`pin 0 adj5 25000`],[`maxAdj1`,`*/ a5 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`enAng`,`pin 1 adj3 21599999`],[`stAng`,`pin 0 adj4 21599999`],[`th`,`*/ ss a1 100000`],[`thh`,`*/ ss a5 100000`],[`th2`,`*/ th 1 2`],[`rw1`,`+- wd2 th2 thh`],[`rh1`,`+- hd2 th2 thh`],[`rw2`,`+- rw1 0 th`],[`rh2`,`+- rh1 0 th`],[`rw3`,`+- rw2 th2 0`],[`rh3`,`+- rh2 th2 0`],[`wtH`,`sin rw3 enAng`],[`htH`,`cos rh3 enAng`],[`dxH`,`cat2 rw3 htH wtH`],[`dyH`,`sat2 rh3 htH wtH`],[`xH`,`+- hc dxH 0`],[`yH`,`+- vc dyH 0`],[`rI`,`min rw2 rh2`],[`u1`,`*/ dxH dxH 1`],[`u2`,`*/ dyH dyH 1`],[`u3`,`*/ rI rI 1`],[`u4`,`+- u1 0 u3`],[`u5`,`+- u2 0 u3`],[`u6`,`*/ u4 u5 u1`],[`u7`,`*/ u6 1 u2`],[`u8`,`+- 1 0 u7`],[`u9`,`sqrt u8`],[`u10`,`*/ u4 1 dxH`],[`u11`,`*/ u10 1 dyH`],[`u12`,`+/ 1 u9 u11`],[`u13`,`at2 1 u12`],[`u14`,`+- u13 21600000 0`],[`u15`,`?: u13 u13 u14`],[`u16`,`+- u15 0 enAng`],[`u17`,`+- u16 21600000 0`],[`u18`,`?: u16 u16 u17`],[`u19`,`+- u18 0 cd2`],[`u20`,`+- u18 0 21600000`],[`u21`,`?: u19 u20 u18`],[`maxAng`,`abs u21`],[`aAng`,`pin 0 adj2 maxAng`],[`ptAng`,`+- enAng aAng 0`],[`wtA`,`sin rw3 ptAng`],[`htA`,`cos rh3 ptAng`],[`dxA`,`cat2 rw3 htA wtA`],[`dyA`,`sat2 rh3 htA wtA`],[`xA`,`+- hc dxA 0`],[`yA`,`+- vc dyA 0`],[`wtE`,`sin rw1 stAng`],[`htE`,`cos rh1 stAng`],[`dxE`,`cat2 rw1 htE wtE`],[`dyE`,`sat2 rh1 htE wtE`],[`xE`,`+- hc dxE 0`],[`yE`,`+- vc dyE 0`],[`dxG`,`cos thh ptAng`],[`dyG`,`sin thh ptAng`],[`xG`,`+- xH dxG 0`],[`yG`,`+- yH dyG 0`],[`dxB`,`cos thh ptAng`],[`dyB`,`sin thh ptAng`],[`xB`,`+- xH 0 dxB 0`],[`yB`,`+- yH 0 dyB 0`],[`sx1`,`+- xB 0 hc`],[`sy1`,`+- yB 0 vc`],[`sx2`,`+- xG 0 hc`],[`sy2`,`+- yG 0 vc`],[`rO`,`min rw1 rh1`],[`x1O`,`*/ sx1 rO rw1`],[`y1O`,`*/ sy1 rO rh1`],[`x2O`,`*/ sx2 rO rw1`],[`y2O`,`*/ sy2 rO rh1`],[`dxO`,`+- x2O 0 x1O`],[`dyO`,`+- y2O 0 y1O`],[`dO`,`mod dxO dyO 0`],[`q1`,`*/ x1O y2O 1`],[`q2`,`*/ x2O y1O 1`],[`DO`,`+- q1 0 q2`],[`q3`,`*/ rO rO 1`],[`q4`,`*/ dO dO 1`],[`q5`,`*/ q3 q4 1`],[`q6`,`*/ DO DO 1`],[`q7`,`+- q5 0 q6`],[`q8`,`max q7 0`],[`sdelO`,`sqrt q8`],[`ndyO`,`*/ dyO -1 1`],[`sdyO`,`?: ndyO -1 1`],[`q9`,`*/ sdyO dxO 1`],[`q10`,`*/ q9 sdelO 1`],[`q11`,`*/ DO dyO 1`],[`dxF1`,`+/ q11 q10 q4`],[`q12`,`+- q11 0 q10`],[`dxF2`,`*/ q12 1 q4`],[`adyO`,`abs dyO`],[`q13`,`*/ adyO sdelO 1`],[`q14`,`*/ DO dxO -1`],[`dyF1`,`+/ q14 q13 q4`],[`q15`,`+- q14 0 q13`],[`dyF2`,`*/ q15 1 q4`],[`q16`,`+- x2O 0 dxF1`],[`q17`,`+- x2O 0 dxF2`],[`q18`,`+- y2O 0 dyF1`],[`q19`,`+- y2O 0 dyF2`],[`q20`,`mod q16 q18 0`],[`q21`,`mod q17 q19 0`],[`q22`,`+- q21 0 q20`],[`dxF`,`?: q22 dxF1 dxF2`],[`dyF`,`?: q22 dyF1 dyF2`],[`sdxF`,`*/ dxF rw1 rO`],[`sdyF`,`*/ dyF rh1 rO`],[`xF`,`+- hc sdxF 0`],[`yF`,`+- vc sdyF 0`],[`x1I`,`*/ sx1 rI rw2`],[`y1I`,`*/ sy1 rI rh2`],[`x2I`,`*/ sx2 rI rw2`],[`y2I`,`*/ sy2 rI rh2`],[`dxI`,`+- x2I 0 x1I`],[`dyI`,`+- y2I 0 y1I`],[`dI`,`mod dxI dyI 0`],[`v1`,`*/ x1I y2I 1`],[`v2`,`*/ x2I y1I 1`],[`DI`,`+- v1 0 v2`],[`v3`,`*/ rI rI 1`],[`v4`,`*/ dI dI 1`],[`v5`,`*/ v3 v4 1`],[`v6`,`*/ DI DI 1`],[`v7`,`+- v5 0 v6`],[`v8`,`max v7 0`],[`sdelI`,`sqrt v8`],[`v9`,`*/ sdyO dxI 1`],[`v10`,`*/ v9 sdelI 1`],[`v11`,`*/ DI dyI 1`],[`dxC1`,`+/ v11 v10 v4`],[`v12`,`+- v11 0 v10`],[`dxC2`,`*/ v12 1 v4`],[`adyI`,`abs dyI`],[`v13`,`*/ adyI sdelI 1`],[`v14`,`*/ DI dxI -1`],[`dyC1`,`+/ v14 v13 v4`],[`v15`,`+- v14 0 v13`],[`dyC2`,`*/ v15 1 v4`],[`v16`,`+- x1I 0 dxC1`],[`v17`,`+- x1I 0 dxC2`],[`v18`,`+- y1I 0 dyC1`],[`v19`,`+- y1I 0 dyC2`],[`v20`,`mod v16 v18 0`],[`v21`,`mod v17 v19 0`],[`v22`,`+- v21 0 v20`],[`dxC`,`?: v22 dxC1 dxC2`],[`dyC`,`?: v22 dyC1 dyC2`],[`sdxC`,`*/ dxC rw2 rI`],[`sdyC`,`*/ dyC rh2 rI`],[`xC`,`+- hc sdxC 0`],[`yC`,`+- vc sdyC 0`],[`ist0`,`at2 sdxC sdyC`],[`ist1`,`+- ist0 21600000 0`],[`istAng`,`?: ist0 ist0 ist1`],[`isw1`,`+- stAng 0 istAng`],[`isw2`,`+- isw1 0 21600000`],[`iswAng`,`?: isw1 isw2 isw1`],[`p1`,`+- xF 0 xC`],[`p2`,`+- yF 0 yC`],[`p3`,`mod p1 p2 0`],[`p4`,`*/ p3 1 2`],[`p5`,`+- p4 0 thh`],[`xGp`,`?: p5 xF xG`],[`yGp`,`?: p5 yF yG`],[`xBp`,`?: p5 xC xB`],[`yBp`,`?: p5 yC yB`],[`en0`,`at2 sdxF sdyF`],[`en1`,`+- en0 21600000 0`],[`en2`,`?: en0 en0 en1`],[`sw0`,`+- en2 0 stAng`],[`sw1`,`+- sw0 21600000 0`],[`swAng`,`?: sw0 sw0 sw1`],[`wtI`,`sin rw3 stAng`],[`htI`,`cos rh3 stAng`],[`dxI`,`cat2 rw3 htI wtI`],[`dyI`,`sat2 rh3 htI wtI`],[`xI`,`+- hc dxI 0`],[`yI`,`+- vc dyI 0`],[`aI`,`+- stAng 0 cd4`],[`aA`,`+- ptAng cd4 0`],[`aB`,`+- ptAng cd2 0`],[`idx`,`cos rw1 2700000`],[`idy`,`sin rh1 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`xE`,`yE`],[`a`,`rw1`,`rh1`,`stAng`,`swAng`],[`l`,`xGp`,`yGp`],[`l`,`xA`,`yA`],[`l`,`xBp`,`yBp`],[`l`,`xC`,`yC`],[`a`,`rw2`,`rh2`,`istAng`,`iswAng`],[`c`]]}]},cloud:{adj:[],gd:[[`il`,`*/ w 2977 21600`],[`it`,`*/ h 3262 21600`],[`ir`,`*/ w 17087 21600`],[`ib`,`*/ h 17337 21600`],[`g27`,`*/ w 67 21600`],[`g28`,`*/ h 21577 21600`],[`g29`,`*/ w 21582 21600`],[`g30`,`*/ h 1235 21600`]],paths:[{w:43200,h:43200,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`3900`,`14370`],[`a`,`6753`,`9190`,`-11429249`,`7426832`],[`a`,`5333`,`7267`,`-8646143`,`5396714`],[`a`,`4365`,`5945`,`-8748475`,`5983381`],[`a`,`4857`,`6595`,`-7859164`,`7034504`],[`a`,`5333`,`7273`,`-4722533`,`6541615`],[`a`,`6775`,`9220`,`-2776035`,`7816140`],[`a`,`5785`,`7867`,`37501`,`6842000`],[`a`,`6752`,`9215`,`1347096`,`6910353`],[`a`,`7720`,`10543`,`3974558`,`4542661`],[`a`,`4360`,`5918`,`-16496525`,`8804134`],[`a`,`4345`,`5945`,`-14809710`,`9151131`],[`c`]]},{w:43200,h:43200,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`4693`,`26177`],[`a`,`4345`,`5945`,`5204520`,`1585770`],[`m`,`6928`,`34899`],[`a`,`4360`,`5918`,`4416628`,`686848`],[`m`,`16478`,`39090`],[`a`,`6752`,`9215`,`8257449`,`844866`],[`m`,`28827`,`34751`],[`a`,`6752`,`9215`,`387196`,`959901`],[`m`,`34129`,`22954`],[`a`,`5785`,`7867`,`-4217541`,`4255042`],[`m`,`41798`,`15354`],[`a`,`5333`,`7273`,`1819082`,`1665090`],[`m`,`38324`,`5426`],[`a`,`4857`,`6595`,`-824660`,`891534`],[`m`,`29078`,`3952`],[`a`,`4857`,`6595`,`-8950887`,`1091722`],[`m`,`22141`,`4720`],[`a`,`4365`,`5945`,`-9809656`,`1061181`],[`m`,`14000`,`5192`],[`a`,`6753`,`9190`,`-4002417`,`739161`],[`m`,`4127`,`15789`],[`a`,`6753`,`9190`,`9459261`,`711490`]]}]},cloudcallout:{adj:[[`adj1`,`val -20833`],[`adj2`,`val 62500`]],gd:[[`dxPos`,`*/ w adj1 100000`],[`dyPos`,`*/ h adj2 100000`],[`xPos`,`+- hc dxPos 0`],[`yPos`,`+- vc dyPos 0`],[`ht`,`cat2 hd2 dxPos dyPos`],[`wt`,`sat2 wd2 dxPos dyPos`],[`g2`,`cat2 wd2 ht wt`],[`g3`,`sat2 hd2 ht wt`],[`g4`,`+- hc g2 0`],[`g5`,`+- vc g3 0`],[`g6`,`+- g4 0 xPos`],[`g7`,`+- g5 0 yPos`],[`g8`,`mod g6 g7 0`],[`g9`,`*/ ss 6600 21600`],[`g10`,`+- g8 0 g9`],[`g11`,`*/ g10 1 3`],[`g12`,`*/ ss 1800 21600`],[`g13`,`+- g11 g12 0`],[`g14`,`*/ g13 g6 g8`],[`g15`,`*/ g13 g7 g8`],[`g16`,`+- g14 xPos 0`],[`g17`,`+- g15 yPos 0`],[`g18`,`*/ ss 4800 21600`],[`g19`,`*/ g11 2 1`],[`g20`,`+- g18 g19 0`],[`g21`,`*/ g20 g6 g8`],[`g22`,`*/ g20 g7 g8`],[`g23`,`+- g21 xPos 0`],[`g24`,`+- g22 yPos 0`],[`g25`,`*/ ss 1200 21600`],[`g26`,`*/ ss 600 21600`],[`x23`,`+- xPos g26 0`],[`x24`,`+- g16 g25 0`],[`x25`,`+- g23 g12 0`],[`il`,`*/ w 2977 21600`],[`it`,`*/ h 3262 21600`],[`ir`,`*/ w 17087 21600`],[`ib`,`*/ h 17337 21600`],[`g27`,`*/ w 67 21600`],[`g28`,`*/ h 21577 21600`],[`g29`,`*/ w 21582 21600`],[`g30`,`*/ h 1235 21600`],[`pang`,`at2 dxPos dyPos`]],paths:[{w:43200,h:43200,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`3900`,`14370`],[`a`,`6753`,`9190`,`-11429249`,`7426832`],[`a`,`5333`,`7267`,`-8646143`,`5396714`],[`a`,`4365`,`5945`,`-8748475`,`5983381`],[`a`,`4857`,`6595`,`-7859164`,`7034504`],[`a`,`5333`,`7273`,`-4722533`,`6541615`],[`a`,`6775`,`9220`,`-2776035`,`7816140`],[`a`,`5785`,`7867`,`37501`,`6842000`],[`a`,`6752`,`9215`,`1347096`,`6910353`],[`a`,`7720`,`10543`,`3974558`,`4542661`],[`a`,`4360`,`5918`,`-16496525`,`8804134`],[`a`,`4345`,`5945`,`-14809710`,`9151131`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x23`,`yPos`],[`a`,`g26`,`g26`,`0`,`21600000`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x24`,`g17`],[`a`,`g25`,`g25`,`0`,`21600000`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x25`,`g24`],[`a`,`g12`,`g12`,`0`,`21600000`],[`c`]]},{w:43200,h:43200,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`4693`,`26177`],[`a`,`4345`,`5945`,`5204520`,`1585770`],[`m`,`6928`,`34899`],[`a`,`4360`,`5918`,`4416628`,`686848`],[`m`,`16478`,`39090`],[`a`,`6752`,`9215`,`8257449`,`844866`],[`m`,`28827`,`34751`],[`a`,`6752`,`9215`,`387196`,`959901`],[`m`,`34129`,`22954`],[`a`,`5785`,`7867`,`-4217541`,`4255042`],[`m`,`41798`,`15354`],[`a`,`5333`,`7273`,`1819082`,`1665090`],[`m`,`38324`,`5426`],[`a`,`4857`,`6595`,`-824660`,`891534`],[`m`,`29078`,`3952`],[`a`,`4857`,`6595`,`-8950887`,`1091722`],[`m`,`22141`,`4720`],[`a`,`4365`,`5945`,`-9809656`,`1061181`],[`m`,`14000`,`5192`],[`a`,`6753`,`9190`,`-4002417`,`739161`],[`m`,`4127`,`15789`],[`a`,`6753`,`9190`,`9459261`,`711490`]]}]},corner:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj1`,`*/ 100000 h ss`],[`maxAdj2`,`*/ 100000 w ss`],[`a1`,`pin 0 adj1 maxAdj1`],[`a2`,`pin 0 adj2 maxAdj2`],[`x1`,`*/ ss a2 100000`],[`dy1`,`*/ ss a1 100000`],[`y1`,`+- b 0 dy1`],[`cx1`,`*/ x1 1 2`],[`cy1`,`+/ y1 b 2`],[`d`,`+- w 0 h`],[`it`,`?: d y1 t`],[`ir`,`?: d r x1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`l`,`x1`,`y1`],[`l`,`r`,`y1`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},cornertabs:{adj:[],gd:[[`md`,`mod w h 0`],[`dx`,`*/ 1 md 20`],[`y1`,`+- 0 b dx`],[`x1`,`+- 0 r dx`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`dx`,`t`],[`l`,`l`,`dx`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y1`],[`l`,`dx`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`t`],[`l`,`r`,`t`],[`l`,`r`,`dx`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`r`,`y1`],[`l`,`r`,`b`],[`l`,`x1`,`b`],[`c`]]}]},cube:{adj:[[`adj`,`val 25000`]],gd:[[`a`,`pin 0 adj 100000`],[`y1`,`*/ ss a 100000`],[`y4`,`+- b 0 y1`],[`y2`,`*/ y4 1 2`],[`y3`,`+/ y1 b 2`],[`x4`,`+- r 0 y1`],[`x2`,`*/ x4 1 2`],[`x3`,`+/ y1 r 2`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`y1`],[`l`,`x4`,`y1`],[`l`,`x4`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x4`,`y1`],[`l`,`r`,`t`],[`l`,`r`,`y4`],[`l`,`x4`,`b`],[`c`]]},{w:null,h:null,fill:`lightenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`y1`],[`l`,`y1`,`t`],[`l`,`r`,`t`],[`l`,`x4`,`y1`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`y1`],[`l`,`y1`,`t`],[`l`,`r`,`t`],[`l`,`r`,`y4`],[`l`,`x4`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`l`,`y1`],[`l`,`x4`,`y1`],[`l`,`r`,`t`],[`m`,`x4`,`y1`],[`l`,`x4`,`b`]]}]},curvedconnector2:{adj:[],gd:[],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`C`,`wd2`,`t`,`r`,`hd2`,`r`,`b`]]}]},curvedconnector3:{adj:[[`adj1`,`val 50000`]],gd:[[`x2`,`*/ w adj1 100000`],[`x1`,`+/ l x2 2`],[`x3`,`+/ r x2 2`],[`y3`,`*/ h 3 4`]],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`C`,`x1`,`t`,`x2`,`hd4`,`x2`,`vc`],[`C`,`x2`,`y3`,`x3`,`b`,`r`,`b`]]}]},curvedconnector4:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`x2`,`*/ w adj1 100000`],[`x1`,`+/ l x2 2`],[`x3`,`+/ r x2 2`],[`x4`,`+/ x2 x3 2`],[`x5`,`+/ x3 r 2`],[`y4`,`*/ h adj2 100000`],[`y1`,`+/ t y4 2`],[`y2`,`+/ t y1 2`],[`y3`,`+/ y1 y4 2`],[`y5`,`+/ b y4 2`]],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`C`,`x1`,`t`,`x2`,`y2`,`x2`,`y1`],[`C`,`x2`,`y3`,`x4`,`y4`,`x3`,`y4`],[`C`,`x5`,`y4`,`r`,`y5`,`r`,`b`]]}]},curvedconnector5:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`],[`adj3`,`val 50000`]],gd:[[`x3`,`*/ w adj1 100000`],[`x6`,`*/ w adj3 100000`],[`x1`,`+/ x3 x6 2`],[`x2`,`+/ l x3 2`],[`x4`,`+/ x3 x1 2`],[`x5`,`+/ x6 x1 2`],[`x7`,`+/ x6 r 2`],[`y4`,`*/ h adj2 100000`],[`y1`,`+/ t y4 2`],[`y2`,`+/ t y1 2`],[`y3`,`+/ y1 y4 2`],[`y5`,`+/ b y4 2`],[`y6`,`+/ y5 y4 2`],[`y7`,`+/ y5 b 2`]],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`C`,`x2`,`t`,`x3`,`y2`,`x3`,`y1`],[`C`,`x3`,`y3`,`x4`,`y4`,`x1`,`y4`],[`C`,`x5`,`y4`,`x6`,`y6`,`x6`,`y5`],[`C`,`x6`,`y7`,`x7`,`b`,`r`,`b`]]}]},curveddownarrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 50000`],[`adj3`,`val 25000`]],gd:[[`maxAdj2`,`*/ 50000 w ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`a1`,`pin 0 adj1 100000`],[`th`,`*/ ss a1 100000`],[`aw`,`*/ ss a2 100000`],[`q1`,`+/ th aw 4`],[`wR`,`+- wd2 0 q1`],[`q7`,`*/ wR 2 1`],[`q8`,`*/ q7 q7 1`],[`q9`,`*/ th th 1`],[`q10`,`+- q8 0 q9`],[`q11`,`sqrt q10`],[`idy`,`*/ q11 h q7`],[`maxAdj3`,`*/ 100000 idy ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`ah`,`*/ ss adj3 100000`],[`x3`,`+- wR th 0`],[`q2`,`*/ h h 1`],[`q3`,`*/ ah ah 1`],[`q4`,`+- q2 0 q3`],[`q5`,`sqrt q4`],[`dx`,`*/ q5 wR h`],[`x5`,`+- wR dx 0`],[`x7`,`+- x3 dx 0`],[`q6`,`+- aw 0 th`],[`dh`,`*/ q6 1 2`],[`x4`,`+- x5 0 dh`],[`x8`,`+- x7 dh 0`],[`aw2`,`*/ aw 1 2`],[`x6`,`+- r 0 aw2`],[`y1`,`+- b 0 ah`],[`swAng`,`at2 ah dx`],[`mswAng`,`+- 0 0 swAng`],[`iy`,`+- b 0 idy`],[`ix`,`+/ wR x3 2`],[`q12`,`*/ th 1 2`],[`dang2`,`at2 idy q12`],[`stAng`,`+- 3cd4 swAng 0`],[`stAng2`,`+- 3cd4 0 dang2`],[`swAng2`,`+- dang2 0 cd4`],[`swAng3`,`+- cd4 dang2 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x6`,`b`],[`l`,`x4`,`y1`],[`l`,`x5`,`y1`],[`a`,`wR`,`h`,`stAng`,`mswAng`],[`l`,`x3`,`t`],[`a`,`wR`,`h`,`3cd4`,`swAng`],[`l`,`x8`,`y1`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`ix`,`iy`],[`a`,`wR`,`h`,`stAng2`,`swAng2`],[`l`,`l`,`b`],[`a`,`wR`,`h`,`cd2`,`swAng3`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`ix`,`iy`],[`a`,`wR`,`h`,`stAng2`,`swAng2`],[`l`,`l`,`b`],[`a`,`wR`,`h`,`cd2`,`cd4`],[`l`,`x3`,`t`],[`a`,`wR`,`h`,`3cd4`,`swAng`],[`l`,`x8`,`y1`],[`l`,`x6`,`b`],[`l`,`x4`,`y1`],[`l`,`x5`,`y1`],[`a`,`wR`,`h`,`stAng`,`mswAng`]]}]},curvedleftarrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 50000`],[`adj3`,`val 25000`]],gd:[[`maxAdj2`,`*/ 50000 h ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`a1`,`pin 0 adj1 a2`],[`th`,`*/ ss a1 100000`],[`aw`,`*/ ss a2 100000`],[`q1`,`+/ th aw 4`],[`hR`,`+- hd2 0 q1`],[`q7`,`*/ hR 2 1`],[`q8`,`*/ q7 q7 1`],[`q9`,`*/ th th 1`],[`q10`,`+- q8 0 q9`],[`q11`,`sqrt q10`],[`idx`,`*/ q11 w q7`],[`maxAdj3`,`*/ 100000 idx ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`ah`,`*/ ss a3 100000`],[`y3`,`+- hR th 0`],[`q2`,`*/ w w 1`],[`q3`,`*/ ah ah 1`],[`q4`,`+- q2 0 q3`],[`q5`,`sqrt q4`],[`dy`,`*/ q5 hR w`],[`y5`,`+- hR dy 0`],[`y7`,`+- y3 dy 0`],[`q6`,`+- aw 0 th`],[`dh`,`*/ q6 1 2`],[`y4`,`+- y5 0 dh`],[`y8`,`+- y7 dh 0`],[`aw2`,`*/ aw 1 2`],[`y6`,`+- b 0 aw2`],[`x1`,`+- l ah 0`],[`swAng`,`at2 ah dy`],[`mswAng`,`+- 0 0 swAng`],[`ix`,`+- l idx 0`],[`iy`,`+/ hR y3 2`],[`q12`,`*/ th 1 2`],[`dang2`,`at2 idx q12`],[`swAng2`,`+- dang2 0 swAng`],[`swAng3`,`+- swAng dang2 0`],[`stAng3`,`+- 0 0 dang2`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`y6`],[`l`,`x1`,`y4`],[`l`,`x1`,`y5`],[`a`,`w`,`hR`,`swAng`,`swAng2`],[`a`,`w`,`hR`,`stAng3`,`swAng3`],[`l`,`x1`,`y8`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`r`,`y3`],[`a`,`w`,`hR`,`0`,`-5400000`],[`l`,`l`,`t`],[`a`,`w`,`hR`,`3cd4`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`r`,`y3`],[`a`,`w`,`hR`,`0`,`-5400000`],[`l`,`l`,`t`],[`a`,`w`,`hR`,`3cd4`,`cd4`],[`l`,`r`,`y3`],[`a`,`w`,`hR`,`0`,`swAng`],[`l`,`x1`,`y8`],[`l`,`l`,`y6`],[`l`,`x1`,`y4`],[`l`,`x1`,`y5`],[`a`,`w`,`hR`,`swAng`,`swAng2`]]}]},curvedrightarrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 50000`],[`adj3`,`val 25000`]],gd:[[`maxAdj2`,`*/ 50000 h ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`a1`,`pin 0 adj1 a2`],[`th`,`*/ ss a1 100000`],[`aw`,`*/ ss a2 100000`],[`q1`,`+/ th aw 4`],[`hR`,`+- hd2 0 q1`],[`q7`,`*/ hR 2 1`],[`q8`,`*/ q7 q7 1`],[`q9`,`*/ th th 1`],[`q10`,`+- q8 0 q9`],[`q11`,`sqrt q10`],[`idx`,`*/ q11 w q7`],[`maxAdj3`,`*/ 100000 idx ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`ah`,`*/ ss a3 100000`],[`y3`,`+- hR th 0`],[`q2`,`*/ w w 1`],[`q3`,`*/ ah ah 1`],[`q4`,`+- q2 0 q3`],[`q5`,`sqrt q4`],[`dy`,`*/ q5 hR w`],[`y5`,`+- hR dy 0`],[`y7`,`+- y3 dy 0`],[`q6`,`+- aw 0 th`],[`dh`,`*/ q6 1 2`],[`y4`,`+- y5 0 dh`],[`y8`,`+- y7 dh 0`],[`aw2`,`*/ aw 1 2`],[`y6`,`+- b 0 aw2`],[`x1`,`+- r 0 ah`],[`swAng`,`at2 ah dy`],[`stAng`,`+- cd2 0 swAng`],[`mswAng`,`+- 0 0 swAng`],[`ix`,`+- r 0 idx`],[`iy`,`+/ hR y3 2`],[`q12`,`*/ th 1 2`],[`dang2`,`at2 idx q12`],[`swAng2`,`+- dang2 0 cd4`],[`swAng3`,`+- cd4 dang2 0`],[`stAng3`,`+- cd2 0 dang2`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`hR`],[`a`,`w`,`hR`,`cd2`,`mswAng`],[`l`,`x1`,`y4`],[`l`,`r`,`y6`],[`l`,`x1`,`y8`],[`l`,`x1`,`y7`],[`a`,`w`,`hR`,`stAng`,`swAng`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`r`,`th`],[`a`,`w`,`hR`,`3cd4`,`swAng2`],[`a`,`w`,`hR`,`stAng3`,`swAng3`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`hR`],[`a`,`w`,`hR`,`cd2`,`mswAng`],[`l`,`x1`,`y4`],[`l`,`r`,`y6`],[`l`,`x1`,`y8`],[`l`,`x1`,`y7`],[`a`,`w`,`hR`,`stAng`,`swAng`],[`l`,`l`,`hR`],[`a`,`w`,`hR`,`cd2`,`cd4`],[`l`,`r`,`th`],[`a`,`w`,`hR`,`3cd4`,`swAng2`]]}]},curveduparrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 50000`],[`adj3`,`val 25000`]],gd:[[`maxAdj2`,`*/ 50000 w ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`a1`,`pin 0 adj1 100000`],[`th`,`*/ ss a1 100000`],[`aw`,`*/ ss a2 100000`],[`q1`,`+/ th aw 4`],[`wR`,`+- wd2 0 q1`],[`q7`,`*/ wR 2 1`],[`q8`,`*/ q7 q7 1`],[`q9`,`*/ th th 1`],[`q10`,`+- q8 0 q9`],[`q11`,`sqrt q10`],[`idy`,`*/ q11 h q7`],[`maxAdj3`,`*/ 100000 idy ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`ah`,`*/ ss adj3 100000`],[`x3`,`+- wR th 0`],[`q2`,`*/ h h 1`],[`q3`,`*/ ah ah 1`],[`q4`,`+- q2 0 q3`],[`q5`,`sqrt q4`],[`dx`,`*/ q5 wR h`],[`x5`,`+- wR dx 0`],[`x7`,`+- x3 dx 0`],[`q6`,`+- aw 0 th`],[`dh`,`*/ q6 1 2`],[`x4`,`+- x5 0 dh`],[`x8`,`+- x7 dh 0`],[`aw2`,`*/ aw 1 2`],[`x6`,`+- r 0 aw2`],[`y1`,`+- t ah 0`],[`swAng`,`at2 ah dx`],[`mswAng`,`+- 0 0 swAng`],[`iy`,`+- t idy 0`],[`ix`,`+/ wR x3 2`],[`q12`,`*/ th 1 2`],[`dang2`,`at2 idy q12`],[`swAng2`,`+- dang2 0 swAng`],[`mswAng2`,`+- 0 0 swAng2`],[`stAng3`,`+- cd4 0 swAng`],[`swAng3`,`+- swAng dang2 0`],[`stAng2`,`+- cd4 0 dang2`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x6`,`t`],[`l`,`x8`,`y1`],[`l`,`x7`,`y1`],[`a`,`wR`,`h`,`stAng3`,`swAng3`],[`a`,`wR`,`h`,`stAng2`,`swAng2`],[`l`,`x4`,`y1`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`wR`,`b`],[`a`,`wR`,`h`,`cd4`,`cd4`],[`l`,`th`,`t`],[`a`,`wR`,`h`,`cd2`,`-5400000`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`ix`,`iy`],[`a`,`wR`,`h`,`stAng2`,`swAng2`],[`l`,`x4`,`y1`],[`l`,`x6`,`t`],[`l`,`x8`,`y1`],[`l`,`x7`,`y1`],[`a`,`wR`,`h`,`stAng3`,`swAng`],[`l`,`wR`,`b`],[`a`,`wR`,`h`,`cd4`,`cd4`],[`l`,`th`,`t`],[`a`,`wR`,`h`,`cd2`,`-5400000`]]}]},decagon:{adj:[[`vf`,`val 105146`]],gd:[[`shd2`,`*/ hd2 vf 100000`],[`dx1`,`cos wd2 2160000`],[`dx2`,`cos wd2 4320000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`dy1`,`sin shd2 4320000`],[`dy2`,`sin shd2 2160000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`],[`y4`,`+- vc dy1 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`x1`,`y2`],[`l`,`x2`,`y1`],[`l`,`x3`,`y1`],[`l`,`x4`,`y2`],[`l`,`r`,`vc`],[`l`,`x4`,`y3`],[`l`,`x3`,`y4`],[`l`,`x2`,`y4`],[`l`,`x1`,`y3`],[`c`]]}]},diagstripe:{adj:[[`adj`,`val 50000`]],gd:[[`a`,`pin 0 adj 100000`],[`x2`,`*/ w a 100000`],[`x1`,`*/ x2 1 2`],[`x3`,`+/ x2 r 2`],[`y2`,`*/ h a 100000`],[`y1`,`*/ y2 1 2`],[`y3`,`+/ y2 b 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y2`],[`l`,`x2`,`t`],[`l`,`r`,`t`],[`l`,`l`,`b`],[`c`]]}]},diamond:{adj:[],gd:[[`ir`,`*/ w 3 4`],[`ib`,`*/ h 3 4`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`hc`,`t`],[`l`,`r`,`vc`],[`l`,`hc`,`b`],[`c`]]}]},dodecagon:{adj:[],gd:[[`x1`,`*/ w 2894 21600`],[`x2`,`*/ w 7906 21600`],[`x3`,`*/ w 13694 21600`],[`x4`,`*/ w 18706 21600`],[`y1`,`*/ h 2894 21600`],[`y2`,`*/ h 7906 21600`],[`y3`,`*/ h 13694 21600`],[`y4`,`*/ h 18706 21600`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y2`],[`l`,`x1`,`y1`],[`l`,`x2`,`t`],[`l`,`x3`,`t`],[`l`,`x4`,`y1`],[`l`,`r`,`y2`],[`l`,`r`,`y3`],[`l`,`x4`,`y4`],[`l`,`x3`,`b`],[`l`,`x2`,`b`],[`l`,`x1`,`y4`],[`l`,`l`,`y3`],[`c`]]}]},donut:{adj:[[`adj`,`val 25000`]],gd:[[`a`,`pin 0 adj 50000`],[`dr`,`*/ ss a 100000`],[`iwd2`,`+- wd2 0 dr`],[`ihd2`,`+- hd2 0 dr`],[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`],[`m`,`dr`,`vc`],[`a`,`iwd2`,`ihd2`,`cd2`,`-5400000`],[`a`,`iwd2`,`ihd2`,`cd4`,`-5400000`],[`a`,`iwd2`,`ihd2`,`0`,`-5400000`],[`a`,`iwd2`,`ihd2`,`3cd4`,`-5400000`],[`c`]]}]},doublewave:{adj:[[`adj1`,`val 6250`],[`adj2`,`val 0`]],gd:[[`a1`,`pin 0 adj1 12500`],[`a2`,`pin -10000 adj2 10000`],[`y1`,`*/ h a1 100000`],[`dy2`,`*/ y1 10 3`],[`y2`,`+- y1 0 dy2`],[`y3`,`+- y1 dy2 0`],[`y4`,`+- b 0 y1`],[`y5`,`+- y4 0 dy2`],[`y6`,`+- y4 dy2 0`],[`dx1`,`*/ w a2 100000`],[`of2`,`*/ w a2 50000`],[`x1`,`abs dx1`],[`dx2`,`?: of2 0 of2`],[`x2`,`+- l 0 dx2`],[`dx8`,`?: of2 of2 0`],[`x8`,`+- r 0 dx8`],[`dx3`,`+/ dx2 x8 6`],[`x3`,`+- x2 dx3 0`],[`dx4`,`+/ dx2 x8 3`],[`x4`,`+- x2 dx4 0`],[`x5`,`+/ x2 x8 2`],[`x6`,`+- x5 dx3 0`],[`x7`,`+/ x6 x8 2`],[`x9`,`+- l dx8 0`],[`x15`,`+- r dx2 0`],[`x10`,`+- x9 dx3 0`],[`x11`,`+- x9 dx4 0`],[`x12`,`+/ x9 x15 2`],[`x13`,`+- x12 dx3 0`],[`x14`,`+/ x13 x15 2`],[`x16`,`+- r 0 x1`],[`xAdj`,`+- hc dx1 0`],[`il`,`max x2 x9`],[`ir`,`min x8 x15`],[`it`,`*/ h a1 50000`],[`ib`,`+- b 0 it`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x2`,`y1`],[`C`,`x3`,`y2`,`x4`,`y3`,`x5`,`y1`],[`C`,`x6`,`y2`,`x7`,`y3`,`x8`,`y1`],[`l`,`x15`,`y4`],[`C`,`x14`,`y6`,`x13`,`y5`,`x12`,`y4`],[`C`,`x11`,`y6`,`x10`,`y5`,`x9`,`y4`],[`c`]]}]},downarrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 100000 h ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`dy1`,`*/ ss a2 100000`],[`y1`,`+- b 0 dy1`],[`dx1`,`*/ w a1 200000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc dx1 0`],[`dy2`,`*/ x1 dy1 wd2`],[`y2`,`+- y1 dy2 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y1`],[`l`,`x1`,`y1`],[`l`,`x1`,`t`],[`l`,`x2`,`t`],[`l`,`x2`,`y1`],[`l`,`r`,`y1`],[`l`,`hc`,`b`],[`c`]]}]},downarrowcallout:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 64977`]],gd:[[`maxAdj2`,`*/ 50000 w ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`*/ 100000 h ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`q2`,`*/ a3 ss h`],[`maxAdj4`,`+- 100000 0 q2`],[`a4`,`pin 0 adj4 maxAdj4`],[`dx1`,`*/ ss a2 100000`],[`dx2`,`*/ ss a1 200000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`dy3`,`*/ ss a3 100000`],[`y3`,`+- b 0 dy3`],[`y2`,`*/ h a4 100000`],[`y1`,`*/ y2 1 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`y2`],[`l`,`x3`,`y2`],[`l`,`x3`,`y3`],[`l`,`x4`,`y3`],[`l`,`hc`,`b`],[`l`,`x1`,`y3`],[`l`,`x2`,`y3`],[`l`,`x2`,`y2`],[`l`,`l`,`y2`],[`c`]]}]},ellipse:{adj:[],gd:[[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`]]}]},ellipseribbon:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 50000`],[`adj3`,`val 12500`]],gd:[[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 25000 adj2 75000`],[`q10`,`+- 100000 0 a1`],[`q11`,`*/ q10 1 2`],[`q12`,`+- a1 0 q11`],[`minAdj3`,`max 0 q12`],[`a3`,`pin minAdj3 adj3 a1`],[`dx2`,`*/ w a2 200000`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- x2 wd8 0`],[`x4`,`+- r 0 x3`],[`x5`,`+- r 0 x2`],[`x6`,`+- r 0 wd8`],[`dy1`,`*/ h a3 100000`],[`f1`,`*/ 4 dy1 w`],[`q1`,`*/ x3 x3 w`],[`q2`,`+- x3 0 q1`],[`y1`,`*/ f1 q2 1`],[`cx1`,`*/ x3 1 2`],[`cy1`,`*/ f1 cx1 1`],[`cx2`,`+- r 0 cx1`],[`q1`,`*/ h a1 100000`],[`dy3`,`+- q1 0 dy1`],[`q3`,`*/ x2 x2 w`],[`q4`,`+- x2 0 q3`],[`q5`,`*/ f1 q4 1`],[`y3`,`+- q5 dy3 0`],[`q6`,`+- dy1 dy3 y3`],[`q7`,`+- q6 dy1 0`],[`cy3`,`+- q7 dy3 0`],[`rh`,`+- b 0 q1`],[`q8`,`*/ dy1 14 16`],[`y2`,`+/ q8 rh 2`],[`y5`,`+- q5 rh 0`],[`y6`,`+- y3 rh 0`],[`cx4`,`*/ x2 1 2`],[`q9`,`*/ f1 cx4 1`],[`cy4`,`+- q9 rh 0`],[`cx5`,`+- r 0 cx4`],[`cy6`,`+- cy3 rh 0`],[`y7`,`+- y1 dy3 0`],[`cy7`,`+- q1 q1 y7`],[`y8`,`+- b 0 dy1`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`Q`,`cx1`,`cy1`,`x3`,`y1`],[`l`,`x2`,`y3`],[`Q`,`hc`,`cy3`,`x5`,`y3`],[`l`,`x4`,`y1`],[`Q`,`cx2`,`cy1`,`r`,`t`],[`l`,`x6`,`y2`],[`l`,`r`,`rh`],[`Q`,`cx5`,`cy4`,`x5`,`y5`],[`l`,`x5`,`y6`],[`Q`,`hc`,`cy6`,`x2`,`y6`],[`l`,`x2`,`y5`],[`Q`,`cx4`,`cy4`,`l`,`rh`],[`l`,`wd8`,`y2`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x3`,`y7`],[`l`,`x3`,`y1`],[`l`,`x2`,`y3`],[`Q`,`hc`,`cy3`,`x5`,`y3`],[`l`,`x4`,`y1`],[`l`,`x4`,`y7`],[`Q`,`hc`,`cy7`,`x3`,`y7`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`Q`,`cx1`,`cy1`,`x3`,`y1`],[`l`,`x2`,`y3`],[`Q`,`hc`,`cy3`,`x5`,`y3`],[`l`,`x4`,`y1`],[`Q`,`cx2`,`cy1`,`r`,`t`],[`l`,`x6`,`y2`],[`l`,`r`,`rh`],[`Q`,`cx5`,`cy4`,`x5`,`y5`],[`l`,`x5`,`y6`],[`Q`,`hc`,`cy6`,`x2`,`y6`],[`l`,`x2`,`y5`],[`Q`,`cx4`,`cy4`,`l`,`rh`],[`l`,`wd8`,`y2`],[`c`],[`m`,`x2`,`y5`],[`l`,`x2`,`y3`],[`m`,`x5`,`y3`],[`l`,`x5`,`y5`],[`m`,`x3`,`y1`],[`l`,`x3`,`y7`],[`m`,`x4`,`y7`],[`l`,`x4`,`y1`]]}]},ellipseribbon2:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 50000`],[`adj3`,`val 12500`]],gd:[[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 25000 adj2 75000`],[`q10`,`+- 100000 0 a1`],[`q11`,`*/ q10 1 2`],[`q12`,`+- a1 0 q11`],[`minAdj3`,`max 0 q12`],[`a3`,`pin minAdj3 adj3 a1`],[`dx2`,`*/ w a2 200000`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- x2 wd8 0`],[`x4`,`+- r 0 x3`],[`x5`,`+- r 0 x2`],[`x6`,`+- r 0 wd8`],[`dy1`,`*/ h a3 100000`],[`f1`,`*/ 4 dy1 w`],[`q1`,`*/ x3 x3 w`],[`q2`,`+- x3 0 q1`],[`u1`,`*/ f1 q2 1`],[`y1`,`+- b 0 u1`],[`cx1`,`*/ x3 1 2`],[`cu1`,`*/ f1 cx1 1`],[`cy1`,`+- b 0 cu1`],[`cx2`,`+- r 0 cx1`],[`q1`,`*/ h a1 100000`],[`dy3`,`+- q1 0 dy1`],[`q3`,`*/ x2 x2 w`],[`q4`,`+- x2 0 q3`],[`q5`,`*/ f1 q4 1`],[`u3`,`+- q5 dy3 0`],[`y3`,`+- b 0 u3`],[`q6`,`+- dy1 dy3 u3`],[`q7`,`+- q6 dy1 0`],[`cu3`,`+- q7 dy3 0`],[`cy3`,`+- b 0 cu3`],[`rh`,`+- b 0 q1`],[`q8`,`*/ dy1 14 16`],[`u2`,`+/ q8 rh 2`],[`y2`,`+- b 0 u2`],[`u5`,`+- q5 rh 0`],[`y5`,`+- b 0 u5`],[`u6`,`+- u3 rh 0`],[`y6`,`+- b 0 u6`],[`cx4`,`*/ x2 1 2`],[`q9`,`*/ f1 cx4 1`],[`cu4`,`+- q9 rh 0`],[`cy4`,`+- b 0 cu4`],[`cx5`,`+- r 0 cx4`],[`cu6`,`+- cu3 rh 0`],[`cy6`,`+- b 0 cu6`],[`u7`,`+- u1 dy3 0`],[`y7`,`+- b 0 u7`],[`cu7`,`+- q1 q1 u7`],[`cy7`,`+- b 0 cu7`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`b`],[`Q`,`cx1`,`cy1`,`x3`,`y1`],[`l`,`x2`,`y3`],[`Q`,`hc`,`cy3`,`x5`,`y3`],[`l`,`x4`,`y1`],[`Q`,`cx2`,`cy1`,`r`,`b`],[`l`,`x6`,`y2`],[`l`,`r`,`q1`],[`Q`,`cx5`,`cy4`,`x5`,`y5`],[`l`,`x5`,`y6`],[`Q`,`hc`,`cy6`,`x2`,`y6`],[`l`,`x2`,`y5`],[`Q`,`cx4`,`cy4`,`l`,`q1`],[`l`,`wd8`,`y2`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x3`,`y7`],[`l`,`x3`,`y1`],[`l`,`x2`,`y3`],[`Q`,`hc`,`cy3`,`x5`,`y3`],[`l`,`x4`,`y1`],[`l`,`x4`,`y7`],[`Q`,`hc`,`cy7`,`x3`,`y7`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`b`],[`l`,`wd8`,`y2`],[`l`,`l`,`q1`],[`Q`,`cx4`,`cy4`,`x2`,`y5`],[`l`,`x2`,`y6`],[`Q`,`hc`,`cy6`,`x5`,`y6`],[`l`,`x5`,`y5`],[`Q`,`cx5`,`cy4`,`r`,`q1`],[`l`,`x6`,`y2`],[`l`,`r`,`b`],[`Q`,`cx2`,`cy1`,`x4`,`y1`],[`l`,`x5`,`y3`],[`Q`,`hc`,`cy3`,`x2`,`y3`],[`l`,`x3`,`y1`],[`Q`,`cx1`,`cy1`,`l`,`b`],[`c`],[`m`,`x2`,`y3`],[`l`,`x2`,`y5`],[`m`,`x5`,`y5`],[`l`,`x5`,`y3`],[`m`,`x3`,`y7`],[`l`,`x3`,`y1`],[`m`,`x4`,`y1`],[`l`,`x4`,`y7`]]}]},flowchartalternateprocess:{adj:[],gd:[[`x2`,`+- r 0 ssd6`],[`y2`,`+- b 0 ssd6`],[`il`,`*/ ssd6 29289 100000`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`ssd6`],[`a`,`ssd6`,`ssd6`,`cd2`,`cd4`],[`l`,`x2`,`t`],[`a`,`ssd6`,`ssd6`,`3cd4`,`cd4`],[`l`,`r`,`y2`],[`a`,`ssd6`,`ssd6`,`0`,`cd4`],[`l`,`ssd6`,`b`],[`a`,`ssd6`,`ssd6`,`cd4`,`cd4`],[`c`]]}]},flowchartcollate:{adj:[],gd:[[`ir`,`*/ w 3 4`],[`ib`,`*/ h 3 4`]],paths:[{w:2,h:2,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`2`,`0`],[`l`,`1`,`1`],[`l`,`2`,`2`],[`l`,`0`,`2`],[`l`,`1`,`1`],[`c`]]}]},flowchartconnector:{adj:[],gd:[[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`]]}]},flowchartdecision:{adj:[],gd:[[`ir`,`*/ w 3 4`],[`ib`,`*/ h 3 4`]],paths:[{w:2,h:2,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`1`],[`l`,`1`,`0`],[`l`,`2`,`1`],[`l`,`1`,`2`],[`c`]]}]},flowchartdelay:{adj:[],gd:[[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`hc`,`t`],[`a`,`wd2`,`hd2`,`3cd4`,`cd2`],[`l`,`l`,`b`],[`c`]]}]},flowchartdisplay:{adj:[],gd:[[`x2`,`*/ w 5 6`]],paths:[{w:6,h:6,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`3`],[`l`,`1`,`0`],[`l`,`5`,`0`],[`a`,`1`,`3`,`3cd4`,`cd2`],[`l`,`1`,`6`],[`c`]]}]},flowchartdocument:{adj:[],gd:[[`y1`,`*/ h 17322 21600`],[`y2`,`*/ h 20172 21600`]],paths:[{w:21600,h:21600,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`21600`,`0`],[`l`,`21600`,`17322`],[`C`,`10800`,`17322`,`10800`,`23922`,`0`,`20172`],[`c`]]}]},flowchartextract:{adj:[],gd:[[`x2`,`*/ w 3 4`]],paths:[{w:2,h:2,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`2`],[`l`,`1`,`0`],[`l`,`2`,`2`],[`c`]]}]},flowchartinputoutput:{adj:[],gd:[[`x3`,`*/ w 2 5`],[`x4`,`*/ w 3 5`],[`x5`,`*/ w 4 5`],[`x6`,`*/ w 9 10`]],paths:[{w:5,h:5,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`5`],[`l`,`1`,`0`],[`l`,`5`,`0`],[`l`,`4`,`5`],[`c`]]}]},flowchartinternalstorage:{adj:[],gd:[],paths:[{w:1,h:1,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`0`,`0`],[`l`,`1`,`0`],[`l`,`1`,`1`],[`l`,`0`,`1`],[`c`]]},{w:8,h:8,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`1`,`0`],[`l`,`1`,`8`],[`m`,`0`,`1`],[`l`,`8`,`1`]]},{w:1,h:1,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`1`,`0`],[`l`,`1`,`1`],[`l`,`0`,`1`],[`c`]]}]},flowchartmagneticdisk:{adj:[],gd:[[`y3`,`*/ h 5 6`]],paths:[{w:6,h:6,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`0`,`1`],[`a`,`3`,`1`,`cd2`,`cd2`],[`l`,`6`,`5`],[`a`,`3`,`1`,`0`,`cd2`],[`c`]]},{w:6,h:6,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`6`,`1`],[`a`,`3`,`1`,`0`,`cd2`]]},{w:6,h:6,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`1`],[`a`,`3`,`1`,`cd2`,`cd2`],[`l`,`6`,`5`],[`a`,`3`,`1`,`0`,`cd2`],[`c`]]}]},flowchartmagneticdrum:{adj:[],gd:[[`x2`,`*/ w 2 3`]],paths:[{w:6,h:6,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`1`,`0`],[`l`,`5`,`0`],[`a`,`1`,`3`,`3cd4`,`cd2`],[`l`,`1`,`6`],[`a`,`1`,`3`,`cd4`,`cd2`],[`c`]]},{w:6,h:6,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`5`,`6`],[`a`,`1`,`3`,`cd4`,`cd2`]]},{w:6,h:6,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`1`,`0`],[`l`,`5`,`0`],[`a`,`1`,`3`,`3cd4`,`cd2`],[`l`,`1`,`6`],[`a`,`1`,`3`,`cd4`,`cd2`],[`c`]]}]},flowchartmagnetictape:{adj:[],gd:[[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`],[`ang1`,`at2 w h`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`hc`,`b`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`ang1`],[`l`,`r`,`ib`],[`l`,`r`,`b`],[`c`]]}]},flowchartmanualinput:{adj:[],gd:[],paths:[{w:5,h:5,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`1`],[`l`,`5`,`0`],[`l`,`5`,`5`],[`l`,`0`,`5`],[`c`]]}]},flowchartmanualoperation:{adj:[],gd:[[`x3`,`*/ w 4 5`],[`x4`,`*/ w 9 10`]],paths:[{w:5,h:5,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`5`,`0`],[`l`,`4`,`5`],[`l`,`1`,`5`],[`c`]]}]},flowchartmerge:{adj:[],gd:[[`x2`,`*/ w 3 4`]],paths:[{w:2,h:2,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`2`,`0`],[`l`,`1`,`2`],[`c`]]}]},flowchartmultidocument:{adj:[],gd:[[`y2`,`*/ h 3675 21600`],[`y8`,`*/ h 20782 21600`],[`x3`,`*/ w 9298 21600`],[`x4`,`*/ w 12286 21600`],[`x5`,`*/ w 18595 21600`]],paths:[{w:21600,h:21600,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`0`,`20782`],[`C`,`9298`,`23542`,`9298`,`18022`,`18595`,`18022`],[`l`,`18595`,`3675`],[`l`,`0`,`3675`],[`c`],[`m`,`1532`,`3675`],[`l`,`1532`,`1815`],[`l`,`20000`,`1815`],[`l`,`20000`,`16252`],[`C`,`19298`,`16252`,`18595`,`16352`,`18595`,`16352`],[`l`,`18595`,`3675`],[`c`],[`m`,`2972`,`1815`],[`l`,`2972`,`0`],[`l`,`21600`,`0`],[`l`,`21600`,`14392`],[`C`,`20800`,`14392`,`20000`,`14467`,`20000`,`14467`],[`l`,`20000`,`1815`],[`c`]]},{w:21600,h:21600,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`0`,`3675`],[`l`,`18595`,`3675`],[`l`,`18595`,`18022`],[`C`,`9298`,`18022`,`9298`,`23542`,`0`,`20782`],[`c`],[`m`,`1532`,`3675`],[`l`,`1532`,`1815`],[`l`,`20000`,`1815`],[`l`,`20000`,`16252`],[`C`,`19298`,`16252`,`18595`,`16352`,`18595`,`16352`],[`m`,`2972`,`1815`],[`l`,`2972`,`0`],[`l`,`21600`,`0`],[`l`,`21600`,`14392`],[`C`,`20800`,`14392`,`20000`,`14467`,`20000`,`14467`]]},{w:21600,h:21600,fill:`none`,stroke:!1,extrusionOk:!0,cmds:[[`m`,`0`,`20782`],[`C`,`9298`,`23542`,`9298`,`18022`,`18595`,`18022`],[`l`,`18595`,`16352`],[`C`,`18595`,`16352`,`19298`,`16252`,`20000`,`16252`],[`l`,`20000`,`14467`],[`C`,`20000`,`14467`,`20800`,`14392`,`21600`,`14392`],[`l`,`21600`,`0`],[`l`,`2972`,`0`],[`l`,`2972`,`1815`],[`l`,`1532`,`1815`],[`l`,`1532`,`3675`],[`l`,`0`,`3675`],[`c`]]}]},flowchartofflinestorage:{adj:[],gd:[[`x4`,`*/ w 3 4`]],paths:[{w:2,h:2,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`0`,`0`],[`l`,`2`,`0`],[`l`,`1`,`2`],[`c`]]},{w:5,h:5,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`2`,`4`],[`l`,`3`,`4`]]},{w:2,h:2,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`2`,`0`],[`l`,`1`,`2`],[`c`]]}]},flowchartoffpageconnector:{adj:[],gd:[[`y1`,`*/ h 4 5`]],paths:[{w:10,h:10,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`10`,`0`],[`l`,`10`,`8`],[`l`,`5`,`10`],[`l`,`0`,`8`],[`c`]]}]},flowchartonlinestorage:{adj:[],gd:[[`x2`,`*/ w 5 6`]],paths:[{w:6,h:6,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`1`,`0`],[`l`,`6`,`0`],[`a`,`1`,`3`,`3cd4`,`-10800000`],[`l`,`1`,`6`],[`a`,`1`,`3`,`cd4`,`cd2`],[`c`]]}]},flowchartor:{adj:[],gd:[[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`hc`,`t`],[`l`,`hc`,`b`],[`m`,`l`,`vc`],[`l`,`r`,`vc`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`]]}]},flowchartpredefinedprocess:{adj:[],gd:[[`x2`,`*/ w 7 8`]],paths:[{w:1,h:1,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`0`,`0`],[`l`,`1`,`0`],[`l`,`1`,`1`],[`l`,`0`,`1`],[`c`]]},{w:8,h:8,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`1`,`0`],[`l`,`1`,`8`],[`m`,`7`,`0`],[`l`,`7`,`8`]]},{w:1,h:1,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`1`,`0`],[`l`,`1`,`1`],[`l`,`0`,`1`],[`c`]]}]},flowchartpreparation:{adj:[],gd:[[`x2`,`*/ w 4 5`]],paths:[{w:10,h:10,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`5`],[`l`,`2`,`0`],[`l`,`8`,`0`],[`l`,`10`,`5`],[`l`,`8`,`10`],[`l`,`2`,`10`],[`c`]]}]},flowchartprocess:{adj:[],gd:[],paths:[{w:1,h:1,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`0`],[`l`,`1`,`0`],[`l`,`1`,`1`],[`l`,`0`,`1`],[`c`]]}]},flowchartpunchedcard:{adj:[],gd:[],paths:[{w:5,h:5,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`1`],[`l`,`1`,`0`],[`l`,`5`,`0`],[`l`,`5`,`5`],[`l`,`0`,`5`],[`c`]]}]},flowchartpunchedtape:{adj:[],gd:[[`y2`,`*/ h 9 10`],[`ib`,`*/ h 4 5`]],paths:[{w:20,h:20,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`2`],[`a`,`5`,`2`,`cd2`,`-10800000`],[`a`,`5`,`2`,`cd2`,`cd2`],[`l`,`20`,`18`],[`a`,`5`,`2`,`0`,`-10800000`],[`a`,`5`,`2`,`0`,`cd2`],[`c`]]}]},flowchartsort:{adj:[],gd:[[`ir`,`*/ w 3 4`],[`ib`,`*/ h 3 4`]],paths:[{w:2,h:2,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`0`,`1`],[`l`,`1`,`0`],[`l`,`2`,`1`],[`l`,`1`,`2`],[`c`]]},{w:2,h:2,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`0`,`1`],[`l`,`2`,`1`]]},{w:2,h:2,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`0`,`1`],[`l`,`1`,`0`],[`l`,`2`,`1`],[`l`,`1`,`2`],[`c`]]}]},flowchartsummingjunction:{adj:[],gd:[[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`il`,`it`],[`l`,`ir`,`ib`],[`m`,`ir`,`it`],[`l`,`il`,`ib`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`]]}]},flowchartterminator:{adj:[],gd:[[`il`,`*/ w 1018 21600`],[`ir`,`*/ w 20582 21600`],[`it`,`*/ h 3163 21600`],[`ib`,`*/ h 18437 21600`]],paths:[{w:21600,h:21600,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`3475`,`0`],[`l`,`18125`,`0`],[`a`,`3475`,`10800`,`3cd4`,`cd2`],[`l`,`3475`,`21600`],[`a`,`3475`,`10800`,`cd4`,`cd2`],[`c`]]}]},foldedcorner:{adj:[[`adj`,`val 16667`]],gd:[[`a`,`pin 0 adj 50000`],[`dy2`,`*/ ss a 100000`],[`dy1`,`*/ dy2 1 5`],[`x1`,`+- r 0 dy2`],[`x2`,`+- x1 dy1 0`],[`y2`,`+- b 0 dy2`],[`y1`,`+- y2 dy1 0`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`y2`],[`l`,`x1`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x1`,`b`],[`l`,`x2`,`y1`],[`l`,`r`,`y2`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`b`],[`l`,`x2`,`y1`],[`l`,`r`,`y2`],[`l`,`x1`,`b`],[`l`,`l`,`b`],[`l`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`y2`]]}]},frame:{adj:[[`adj1`,`val 12500`]],gd:[[`a1`,`pin 0 adj1 50000`],[`x1`,`*/ ss a1 100000`],[`x4`,`+- r 0 x1`],[`y4`,`+- b 0 x1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`],[`m`,`x1`,`x1`],[`l`,`x1`,`y4`],[`l`,`x4`,`y4`],[`l`,`x4`,`x1`],[`c`]]}]},funnel:{adj:[],gd:[[`d`,`*/ ss 1 20`],[`rw2`,`+- wd2 0 d`],[`rh2`,`+- hd4 0 d`],[`t1`,`cos wd2 480000`],[`t2`,`sin hd4 480000`],[`da`,`at2 t1 t2`],[`2da`,`*/ da 2 1`],[`stAng1`,`+- cd2 0 da`],[`swAng1`,`+- cd2 2da 0`],[`swAng3`,`+- cd2 0 2da`],[`rw3`,`*/ wd2 1 4`],[`rh3`,`*/ hd4 1 4`],[`ct1`,`cos hd4 stAng1`],[`st1`,`sin wd2 stAng1`],[`m1`,`mod ct1 st1 0`],[`n1`,`*/ wd2 hd4 m1`],[`dx1`,`cos n1 stAng1`],[`dy1`,`sin n1 stAng1`],[`x1`,`+- hc dx1 0`],[`y1`,`+- hd4 dy1 0`],[`ct3`,`cos rh3 da`],[`st3`,`sin rw3 da`],[`m3`,`mod ct3 st3 0`],[`n3`,`*/ rw3 rh3 m3`],[`dx3`,`cos n3 da`],[`dy3`,`sin n3 da`],[`x3`,`+- hc dx3 0`],[`vc3`,`+- b 0 rh3`],[`y2`,`+- vc3 dy3 0`],[`x2`,`+- wd2 0 rw2`],[`cd`,`*/ cd2 2 1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`a`,`wd2`,`hd4`,`stAng1`,`swAng1`],[`l`,`x3`,`y2`],[`a`,`rw3`,`rh3`,`da`,`swAng3`],[`c`],[`m`,`x2`,`hd4`],[`a`,`rw2`,`rh2`,`cd2`,`-21600000`],[`c`]]}]},gear6:{adj:[[`adj1`,`val 15000`],[`adj2`,`val 3526`]],gd:[[`a1`,`pin 0 adj1 20000`],[`a2`,`pin 0 adj2 5358`],[`th`,`*/ ss a1 100000`],[`lFD`,`*/ ss a2 100000`],[`th2`,`*/ th 1 2`],[`l2`,`*/ lFD 1 2`],[`l3`,`+- th2 l2 0`],[`rh`,`+- hd2 0 th`],[`rw`,`+- wd2 0 th`],[`dr`,`+- rw 0 rh`],[`maxr`,`?: dr rh rw`],[`ha`,`at2 maxr l3`],[`aA1`,`+- 19800000 0 ha`],[`aD1`,`+- 19800000 ha 0`],[`ta11`,`cos rw aA1`],[`ta12`,`sin rh aA1`],[`bA1`,`at2 ta11 ta12`],[`cta1`,`cos rh bA1`],[`sta1`,`sin rw bA1`],[`ma1`,`mod cta1 sta1 0`],[`na1`,`*/ rw rh ma1`],[`dxa1`,`cos na1 bA1`],[`dya1`,`sin na1 bA1`],[`xA1`,`+- hc dxa1 0`],[`yA1`,`+- vc dya1 0`],[`td11`,`cos rw aD1`],[`td12`,`sin rh aD1`],[`bD1`,`at2 td11 td12`],[`ctd1`,`cos rh bD1`],[`std1`,`sin rw bD1`],[`md1`,`mod ctd1 std1 0`],[`nd1`,`*/ rw rh md1`],[`dxd1`,`cos nd1 bD1`],[`dyd1`,`sin nd1 bD1`],[`xD1`,`+- hc dxd1 0`],[`yD1`,`+- vc dyd1 0`],[`xAD1`,`+- xA1 0 xD1`],[`yAD1`,`+- yA1 0 yD1`],[`lAD1`,`mod xAD1 yAD1 0`],[`a1`,`at2 yAD1 xAD1`],[`dxF1`,`sin lFD a1`],[`dyF1`,`cos lFD a1`],[`xF1`,`+- xD1 dxF1 0`],[`yF1`,`+- yD1 dyF1 0`],[`xE1`,`+- xA1 0 dxF1`],[`yE1`,`+- yA1 0 dyF1`],[`yC1t`,`sin th a1`],[`xC1t`,`cos th a1`],[`yC1`,`+- yF1 yC1t 0`],[`xC1`,`+- xF1 0 xC1t`],[`yB1`,`+- yE1 yC1t 0`],[`xB1`,`+- xE1 0 xC1t`],[`aD6`,`+- 3cd4 ha 0`],[`td61`,`cos rw aD6`],[`td62`,`sin rh aD6`],[`bD6`,`at2 td61 td62`],[`ctd6`,`cos rh bD6`],[`std6`,`sin rw bD6`],[`md6`,`mod ctd6 std6 0`],[`nd6`,`*/ rw rh md6`],[`dxd6`,`cos nd6 bD6`],[`dyd6`,`sin nd6 bD6`],[`xD6`,`+- hc dxd6 0`],[`yD6`,`+- vc dyd6 0`],[`xA6`,`+- hc 0 dxd6`],[`xF6`,`+- xD6 0 lFD`],[`xE6`,`+- xA6 lFD 0`],[`yC6`,`+- yD6 0 th`],[`swAng1`,`+- bA1 0 bD6`],[`aA2`,`+- 1800000 0 ha`],[`aD2`,`+- 1800000 ha 0`],[`ta21`,`cos rw aA2`],[`ta22`,`sin rh aA2`],[`bA2`,`at2 ta21 ta22`],[`yA2`,`+- h 0 yD1`],[`td21`,`cos rw aD2`],[`td22`,`sin rh aD2`],[`bD2`,`at2 td21 td22`],[`yD2`,`+- h 0 yA1`],[`yC2`,`+- h 0 yB1`],[`yB2`,`+- h 0 yC1`],[`xB2`,`val xC1`],[`swAng2`,`+- bA2 0 bD1`],[`aD3`,`+- cd4 ha 0`],[`td31`,`cos rw aD3`],[`td32`,`sin rh aD3`],[`bD3`,`at2 td31 td32`],[`yD3`,`+- h 0 yD6`],[`yB3`,`+- h 0 yC6`],[`aD4`,`+- 9000000 ha 0`],[`td41`,`cos rw aD4`],[`td42`,`sin rh aD4`],[`bD4`,`at2 td41 td42`],[`xD4`,`+- w 0 xD1`],[`xC4`,`+- w 0 xC1`],[`xB4`,`+- w 0 xB1`],[`aD5`,`+- 12600000 ha 0`],[`td51`,`cos rw aD5`],[`td52`,`sin rh aD5`],[`bD5`,`at2 td51 td52`],[`xD5`,`+- w 0 xA1`],[`xC5`,`+- w 0 xB1`],[`xB5`,`+- w 0 xC1`],[`xCxn1`,`+/ xB1 xC1 2`],[`yCxn1`,`+/ yB1 yC1 2`],[`yCxn2`,`+- b 0 yCxn1`],[`xCxn4`,`+/ r 0 xCxn1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`xA1`,`yA1`],[`l`,`xB1`,`yB1`],[`l`,`xC1`,`yC1`],[`l`,`xD1`,`yD1`],[`a`,`rw`,`rh`,`bD1`,`swAng2`],[`l`,`xC1`,`yB2`],[`l`,`xB1`,`yC2`],[`l`,`xA1`,`yD2`],[`a`,`rw`,`rh`,`bD2`,`swAng1`],[`l`,`xF6`,`yB3`],[`l`,`xE6`,`yB3`],[`l`,`xA6`,`yD3`],[`a`,`rw`,`rh`,`bD3`,`swAng1`],[`l`,`xB4`,`yC2`],[`l`,`xC4`,`yB2`],[`l`,`xD4`,`yA2`],[`a`,`rw`,`rh`,`bD4`,`swAng2`],[`l`,`xB5`,`yC1`],[`l`,`xC5`,`yB1`],[`l`,`xD5`,`yA1`],[`a`,`rw`,`rh`,`bD5`,`swAng1`],[`l`,`xE6`,`yC6`],[`l`,`xF6`,`yC6`],[`l`,`xD6`,`yD6`],[`a`,`rw`,`rh`,`bD6`,`swAng1`],[`c`]]}]},gear9:{adj:[[`adj1`,`val 10000`],[`adj2`,`val 1763`]],gd:[[`a1`,`pin 0 adj1 20000`],[`a2`,`pin 0 adj2 2679`],[`th`,`*/ ss a1 100000`],[`lFD`,`*/ ss a2 100000`],[`th2`,`*/ th 1 2`],[`l2`,`*/ lFD 1 2`],[`l3`,`+- th2 l2 0`],[`rh`,`+- hd2 0 th`],[`rw`,`+- wd2 0 th`],[`dr`,`+- rw 0 rh`],[`maxr`,`?: dr rh rw`],[`ha`,`at2 maxr l3`],[`aA1`,`+- 18600000 0 ha`],[`aD1`,`+- 18600000 ha 0`],[`ta11`,`cos rw aA1`],[`ta12`,`sin rh aA1`],[`bA1`,`at2 ta11 ta12`],[`cta1`,`cos rh bA1`],[`sta1`,`sin rw bA1`],[`ma1`,`mod cta1 sta1 0`],[`na1`,`*/ rw rh ma1`],[`dxa1`,`cos na1 bA1`],[`dya1`,`sin na1 bA1`],[`xA1`,`+- hc dxa1 0`],[`yA1`,`+- vc dya1 0`],[`td11`,`cos rw aD1`],[`td12`,`sin rh aD1`],[`bD1`,`at2 td11 td12`],[`ctd1`,`cos rh bD1`],[`std1`,`sin rw bD1`],[`md1`,`mod ctd1 std1 0`],[`nd1`,`*/ rw rh md1`],[`dxd1`,`cos nd1 bD1`],[`dyd1`,`sin nd1 bD1`],[`xD1`,`+- hc dxd1 0`],[`yD1`,`+- vc dyd1 0`],[`xAD1`,`+- xA1 0 xD1`],[`yAD1`,`+- yA1 0 yD1`],[`lAD1`,`mod xAD1 yAD1 0`],[`a1`,`at2 yAD1 xAD1`],[`dxF1`,`sin lFD a1`],[`dyF1`,`cos lFD a1`],[`xF1`,`+- xD1 dxF1 0`],[`yF1`,`+- yD1 dyF1 0`],[`xE1`,`+- xA1 0 dxF1`],[`yE1`,`+- yA1 0 dyF1`],[`yC1t`,`sin th a1`],[`xC1t`,`cos th a1`],[`yC1`,`+- yF1 yC1t 0`],[`xC1`,`+- xF1 0 xC1t`],[`yB1`,`+- yE1 yC1t 0`],[`xB1`,`+- xE1 0 xC1t`],[`aA2`,`+- 21000000 0 ha`],[`aD2`,`+- 21000000 ha 0`],[`ta21`,`cos rw aA2`],[`ta22`,`sin rh aA2`],[`bA2`,`at2 ta21 ta22`],[`cta2`,`cos rh bA2`],[`sta2`,`sin rw bA2`],[`ma2`,`mod cta2 sta2 0`],[`na2`,`*/ rw rh ma2`],[`dxa2`,`cos na2 bA2`],[`dya2`,`sin na2 bA2`],[`xA2`,`+- hc dxa2 0`],[`yA2`,`+- vc dya2 0`],[`td21`,`cos rw aD2`],[`td22`,`sin rh aD2`],[`bD2`,`at2 td21 td22`],[`ctd2`,`cos rh bD2`],[`std2`,`sin rw bD2`],[`md2`,`mod ctd2 std2 0`],[`nd2`,`*/ rw rh md2`],[`dxd2`,`cos nd2 bD2`],[`dyd2`,`sin nd2 bD2`],[`xD2`,`+- hc dxd2 0`],[`yD2`,`+- vc dyd2 0`],[`xAD2`,`+- xA2 0 xD2`],[`yAD2`,`+- yA2 0 yD2`],[`lAD2`,`mod xAD2 yAD2 0`],[`a2`,`at2 yAD2 xAD2`],[`dxF2`,`sin lFD a2`],[`dyF2`,`cos lFD a2`],[`xF2`,`+- xD2 dxF2 0`],[`yF2`,`+- yD2 dyF2 0`],[`xE2`,`+- xA2 0 dxF2`],[`yE2`,`+- yA2 0 dyF2`],[`yC2t`,`sin th a2`],[`xC2t`,`cos th a2`],[`yC2`,`+- yF2 yC2t 0`],[`xC2`,`+- xF2 0 xC2t`],[`yB2`,`+- yE2 yC2t 0`],[`xB2`,`+- xE2 0 xC2t`],[`swAng1`,`+- bA2 0 bD1`],[`aA3`,`+- 1800000 0 ha`],[`aD3`,`+- 1800000 ha 0`],[`ta31`,`cos rw aA3`],[`ta32`,`sin rh aA3`],[`bA3`,`at2 ta31 ta32`],[`cta3`,`cos rh bA3`],[`sta3`,`sin rw bA3`],[`ma3`,`mod cta3 sta3 0`],[`na3`,`*/ rw rh ma3`],[`dxa3`,`cos na3 bA3`],[`dya3`,`sin na3 bA3`],[`xA3`,`+- hc dxa3 0`],[`yA3`,`+- vc dya3 0`],[`td31`,`cos rw aD3`],[`td32`,`sin rh aD3`],[`bD3`,`at2 td31 td32`],[`ctd3`,`cos rh bD3`],[`std3`,`sin rw bD3`],[`md3`,`mod ctd3 std3 0`],[`nd3`,`*/ rw rh md3`],[`dxd3`,`cos nd3 bD3`],[`dyd3`,`sin nd3 bD3`],[`xD3`,`+- hc dxd3 0`],[`yD3`,`+- vc dyd3 0`],[`xAD3`,`+- xA3 0 xD3`],[`yAD3`,`+- yA3 0 yD3`],[`lAD3`,`mod xAD3 yAD3 0`],[`a3`,`at2 yAD3 xAD3`],[`dxF3`,`sin lFD a3`],[`dyF3`,`cos lFD a3`],[`xF3`,`+- xD3 dxF3 0`],[`yF3`,`+- yD3 dyF3 0`],[`xE3`,`+- xA3 0 dxF3`],[`yE3`,`+- yA3 0 dyF3`],[`yC3t`,`sin th a3`],[`xC3t`,`cos th a3`],[`yC3`,`+- yF3 yC3t 0`],[`xC3`,`+- xF3 0 xC3t`],[`yB3`,`+- yE3 yC3t 0`],[`xB3`,`+- xE3 0 xC3t`],[`swAng2`,`+- bA3 0 bD2`],[`aA4`,`+- 4200000 0 ha`],[`aD4`,`+- 4200000 ha 0`],[`ta41`,`cos rw aA4`],[`ta42`,`sin rh aA4`],[`bA4`,`at2 ta41 ta42`],[`cta4`,`cos rh bA4`],[`sta4`,`sin rw bA4`],[`ma4`,`mod cta4 sta4 0`],[`na4`,`*/ rw rh ma4`],[`dxa4`,`cos na4 bA4`],[`dya4`,`sin na4 bA4`],[`xA4`,`+- hc dxa4 0`],[`yA4`,`+- vc dya4 0`],[`td41`,`cos rw aD4`],[`td42`,`sin rh aD4`],[`bD4`,`at2 td41 td42`],[`ctd4`,`cos rh bD4`],[`std4`,`sin rw bD4`],[`md4`,`mod ctd4 std4 0`],[`nd4`,`*/ rw rh md4`],[`dxd4`,`cos nd4 bD4`],[`dyd4`,`sin nd4 bD4`],[`xD4`,`+- hc dxd4 0`],[`yD4`,`+- vc dyd4 0`],[`xAD4`,`+- xA4 0 xD4`],[`yAD4`,`+- yA4 0 yD4`],[`lAD4`,`mod xAD4 yAD4 0`],[`a4`,`at2 yAD4 xAD4`],[`dxF4`,`sin lFD a4`],[`dyF4`,`cos lFD a4`],[`xF4`,`+- xD4 dxF4 0`],[`yF4`,`+- yD4 dyF4 0`],[`xE4`,`+- xA4 0 dxF4`],[`yE4`,`+- yA4 0 dyF4`],[`yC4t`,`sin th a4`],[`xC4t`,`cos th a4`],[`yC4`,`+- yF4 yC4t 0`],[`xC4`,`+- xF4 0 xC4t`],[`yB4`,`+- yE4 yC4t 0`],[`xB4`,`+- xE4 0 xC4t`],[`swAng3`,`+- bA4 0 bD3`],[`aA5`,`+- 6600000 0 ha`],[`aD5`,`+- 6600000 ha 0`],[`ta51`,`cos rw aA5`],[`ta52`,`sin rh aA5`],[`bA5`,`at2 ta51 ta52`],[`td51`,`cos rw aD5`],[`td52`,`sin rh aD5`],[`bD5`,`at2 td51 td52`],[`xD5`,`+- w 0 xA4`],[`xC5`,`+- w 0 xB4`],[`xB5`,`+- w 0 xC4`],[`swAng4`,`+- bA5 0 bD4`],[`aD6`,`+- 9000000 ha 0`],[`td61`,`cos rw aD6`],[`td62`,`sin rh aD6`],[`bD6`,`at2 td61 td62`],[`xD6`,`+- w 0 xA3`],[`xC6`,`+- w 0 xB3`],[`xB6`,`+- w 0 xC3`],[`aD7`,`+- 11400000 ha 0`],[`td71`,`cos rw aD7`],[`td72`,`sin rh aD7`],[`bD7`,`at2 td71 td72`],[`xD7`,`+- w 0 xA2`],[`xC7`,`+- w 0 xB2`],[`xB7`,`+- w 0 xC2`],[`aD8`,`+- 13800000 ha 0`],[`td81`,`cos rw aD8`],[`td82`,`sin rh aD8`],[`bD8`,`at2 td81 td82`],[`xA8`,`+- w 0 xD1`],[`xD8`,`+- w 0 xA1`],[`xC8`,`+- w 0 xB1`],[`xB8`,`+- w 0 xC1`],[`aA9`,`+- 3cd4 0 ha`],[`aD9`,`+- 3cd4 ha 0`],[`td91`,`cos rw aD9`],[`td92`,`sin rh aD9`],[`bD9`,`at2 td91 td92`],[`ctd9`,`cos rh bD9`],[`std9`,`sin rw bD9`],[`md9`,`mod ctd9 std9 0`],[`nd9`,`*/ rw rh md9`],[`dxd9`,`cos nd9 bD9`],[`dyd9`,`sin nd9 bD9`],[`xD9`,`+- hc dxd9 0`],[`yD9`,`+- vc dyd9 0`],[`ta91`,`cos rw aA9`],[`ta92`,`sin rh aA9`],[`bA9`,`at2 ta91 ta92`],[`xA9`,`+- hc 0 dxd9`],[`xF9`,`+- xD9 0 lFD`],[`xE9`,`+- xA9 lFD 0`],[`yC9`,`+- yD9 0 th`],[`swAng5`,`+- bA9 0 bD8`],[`xCxn1`,`+/ xB1 xC1 2`],[`yCxn1`,`+/ yB1 yC1 2`],[`xCxn2`,`+/ xB2 xC2 2`],[`yCxn2`,`+/ yB2 yC2 2`],[`xCxn3`,`+/ xB3 xC3 2`],[`yCxn3`,`+/ yB3 yC3 2`],[`xCxn4`,`+/ xB4 xC4 2`],[`yCxn4`,`+/ yB4 yC4 2`],[`xCxn5`,`+/ r 0 xCxn4`],[`xCxn6`,`+/ r 0 xCxn3`],[`xCxn7`,`+/ r 0 xCxn2`],[`xCxn8`,`+/ r 0 xCxn1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`xA1`,`yA1`],[`l`,`xB1`,`yB1`],[`l`,`xC1`,`yC1`],[`l`,`xD1`,`yD1`],[`a`,`rw`,`rh`,`bD1`,`swAng1`],[`l`,`xB2`,`yB2`],[`l`,`xC2`,`yC2`],[`l`,`xD2`,`yD2`],[`a`,`rw`,`rh`,`bD2`,`swAng2`],[`l`,`xB3`,`yB3`],[`l`,`xC3`,`yC3`],[`l`,`xD3`,`yD3`],[`a`,`rw`,`rh`,`bD3`,`swAng3`],[`l`,`xB4`,`yB4`],[`l`,`xC4`,`yC4`],[`l`,`xD4`,`yD4`],[`a`,`rw`,`rh`,`bD4`,`swAng4`],[`l`,`xB5`,`yC4`],[`l`,`xC5`,`yB4`],[`l`,`xD5`,`yA4`],[`a`,`rw`,`rh`,`bD5`,`swAng3`],[`l`,`xB6`,`yC3`],[`l`,`xC6`,`yB3`],[`l`,`xD6`,`yA3`],[`a`,`rw`,`rh`,`bD6`,`swAng2`],[`l`,`xB7`,`yC2`],[`l`,`xC7`,`yB2`],[`l`,`xD7`,`yA2`],[`a`,`rw`,`rh`,`bD7`,`swAng1`],[`l`,`xB8`,`yC1`],[`l`,`xC8`,`yB1`],[`l`,`xD8`,`yA1`],[`a`,`rw`,`rh`,`bD8`,`swAng5`],[`l`,`xE9`,`yC9`],[`l`,`xF9`,`yC9`],[`l`,`xD9`,`yD9`],[`a`,`rw`,`rh`,`bD9`,`swAng5`],[`c`]]}]},halfframe:{adj:[[`adj1`,`val 33333`],[`adj2`,`val 33333`]],gd:[[`maxAdj2`,`*/ 100000 w ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`x1`,`*/ ss a2 100000`],[`g1`,`*/ h x1 w`],[`g2`,`+- h 0 g1`],[`maxAdj1`,`*/ 100000 g2 ss`],[`a1`,`pin 0 adj1 maxAdj1`],[`y1`,`*/ ss a1 100000`],[`dx2`,`*/ y1 w h`],[`x2`,`+- r 0 dx2`],[`dy2`,`*/ x1 h w`],[`y2`,`+- b 0 dy2`],[`cx1`,`*/ x1 1 2`],[`cy1`,`+/ y2 b 2`],[`cx2`,`+/ x2 r 2`],[`cy2`,`*/ y1 1 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`x2`,`y1`],[`l`,`x1`,`y1`],[`l`,`x1`,`y2`],[`l`,`l`,`b`],[`c`]]}]},heart:{adj:[],gd:[[`dx1`,`*/ w 49 48`],[`dx2`,`*/ w 10 48`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`y1`,`+- t 0 hd3`],[`il`,`*/ w 1 6`],[`ir`,`*/ w 5 6`],[`ib`,`*/ h 2 3`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`hc`,`hd4`],[`C`,`x3`,`y1`,`x4`,`hd4`,`hc`,`b`],[`C`,`x1`,`hd4`,`x2`,`y1`,`hc`,`hd4`],[`c`]]}]},heptagon:{adj:[[`hf`,`val 102572`],[`vf`,`val 105210`]],gd:[[`swd2`,`*/ wd2 hf 100000`],[`shd2`,`*/ hd2 vf 100000`],[`svc`,`*/ vc vf 100000`],[`dx1`,`*/ swd2 97493 100000`],[`dx2`,`*/ swd2 78183 100000`],[`dx3`,`*/ swd2 43388 100000`],[`dy1`,`*/ shd2 62349 100000`],[`dy2`,`*/ shd2 22252 100000`],[`dy3`,`*/ shd2 90097 100000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc 0 dx3`],[`x4`,`+- hc dx3 0`],[`x5`,`+- hc dx2 0`],[`x6`,`+- hc dx1 0`],[`y1`,`+- svc 0 dy1`],[`y2`,`+- svc dy2 0`],[`y3`,`+- svc dy3 0`],[`ib`,`+- b 0 y1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y2`],[`l`,`x2`,`y1`],[`l`,`hc`,`t`],[`l`,`x5`,`y1`],[`l`,`x6`,`y2`],[`l`,`x4`,`y3`],[`l`,`x3`,`y3`],[`c`]]}]},hexagon:{adj:[[`adj`,`val 25000`],[`vf`,`val 115470`]],gd:[[`maxAdj`,`*/ 50000 w ss`],[`a`,`pin 0 adj maxAdj`],[`shd2`,`*/ hd2 vf 100000`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`dy1`,`sin shd2 3600000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc dy1 0`],[`q1`,`*/ maxAdj -1 2`],[`q2`,`+- a q1 0`],[`q3`,`?: q2 4 2`],[`q4`,`?: q2 3 2`],[`q5`,`?: q2 q1 0`],[`q6`,`+/ a q5 q1`],[`q7`,`*/ q6 q4 -1`],[`q8`,`+- q3 q7 0`],[`il`,`*/ w q8 24`],[`it`,`*/ h q8 24`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 it`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`x1`,`y1`],[`l`,`x2`,`y1`],[`l`,`r`,`vc`],[`l`,`x2`,`y2`],[`l`,`x1`,`y2`],[`c`]]}]},homeplate:{adj:[[`adj`,`val 50000`]],gd:[[`maxAdj`,`*/ 100000 w ss`],[`a`,`pin 0 adj maxAdj`],[`dx1`,`*/ ss a 100000`],[`x1`,`+- r 0 dx1`],[`ir`,`+/ x1 r 2`],[`x2`,`*/ x1 1 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`l`,`r`,`vc`],[`l`,`x1`,`b`],[`l`,`l`,`b`],[`c`]]}]},horizontalscroll:{adj:[[`adj`,`val 12500`]],gd:[[`a`,`pin 0 adj 25000`],[`ch`,`*/ ss a 100000`],[`ch2`,`*/ ch 1 2`],[`ch4`,`*/ ch 1 4`],[`y3`,`+- ch ch2 0`],[`y4`,`+- ch ch 0`],[`y6`,`+- b 0 ch`],[`y7`,`+- b 0 ch2`],[`y5`,`+- y6 0 ch2`],[`x3`,`+- r 0 ch`],[`x4`,`+- r 0 ch2`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`r`,`ch2`],[`a`,`ch2`,`ch2`,`0`,`cd4`],[`l`,`x4`,`ch2`],[`a`,`ch4`,`ch4`,`0`,`cd2`],[`l`,`x3`,`ch`],[`l`,`ch2`,`ch`],[`a`,`ch2`,`ch2`,`3cd4`,`-5400000`],[`l`,`l`,`y7`],[`a`,`ch2`,`ch2`,`cd2`,`-10800000`],[`l`,`ch`,`y6`],[`l`,`x4`,`y6`],[`a`,`ch2`,`ch2`,`cd4`,`-5400000`],[`c`],[`m`,`ch2`,`y4`],[`a`,`ch2`,`ch2`,`cd4`,`-5400000`],[`a`,`ch4`,`ch4`,`0`,`-10800000`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`ch2`,`y4`],[`a`,`ch2`,`ch2`,`cd4`,`-5400000`],[`a`,`ch4`,`ch4`,`0`,`-10800000`],[`c`],[`m`,`x4`,`ch`],[`a`,`ch2`,`ch2`,`cd4`,`-16200000`],[`a`,`ch4`,`ch4`,`cd2`,`-10800000`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`y3`],[`a`,`ch2`,`ch2`,`cd2`,`cd4`],[`l`,`x3`,`ch`],[`l`,`x3`,`ch2`],[`a`,`ch2`,`ch2`,`cd2`,`cd2`],[`l`,`r`,`y5`],[`a`,`ch2`,`ch2`,`0`,`cd4`],[`l`,`ch`,`y6`],[`l`,`ch`,`y7`],[`a`,`ch2`,`ch2`,`0`,`cd2`],[`c`],[`m`,`x3`,`ch`],[`l`,`x4`,`ch`],[`a`,`ch2`,`ch2`,`cd4`,`-5400000`],[`m`,`x4`,`ch`],[`l`,`x4`,`ch2`],[`a`,`ch4`,`ch4`,`0`,`cd2`],[`m`,`ch2`,`y4`],[`l`,`ch2`,`y3`],[`a`,`ch4`,`ch4`,`cd2`,`cd2`],[`a`,`ch2`,`ch2`,`0`,`cd2`],[`m`,`ch`,`y3`],[`l`,`ch`,`y6`]]}]},irregularseal1:{adj:[],gd:[[`x5`,`*/ w 4627 21600`],[`x12`,`*/ w 8485 21600`],[`x21`,`*/ w 16702 21600`],[`x24`,`*/ w 14522 21600`],[`y3`,`*/ h 6320 21600`],[`y6`,`*/ h 8615 21600`],[`y9`,`*/ h 13937 21600`],[`y18`,`*/ h 13290 21600`]],paths:[{w:21600,h:21600,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`10800`,`5800`],[`l`,`14522`,`0`],[`l`,`14155`,`5325`],[`l`,`18380`,`4457`],[`l`,`16702`,`7315`],[`l`,`21097`,`8137`],[`l`,`17607`,`10475`],[`l`,`21600`,`13290`],[`l`,`16837`,`12942`],[`l`,`18145`,`18095`],[`l`,`14020`,`14457`],[`l`,`13247`,`19737`],[`l`,`10532`,`14935`],[`l`,`8485`,`21600`],[`l`,`7715`,`15627`],[`l`,`4762`,`17617`],[`l`,`5667`,`13937`],[`l`,`135`,`14587`],[`l`,`3722`,`11775`],[`l`,`0`,`8615`],[`l`,`4627`,`7617`],[`l`,`370`,`2295`],[`l`,`7312`,`6320`],[`l`,`8352`,`2295`],[`c`]]}]},irregularseal2:{adj:[],gd:[[`x2`,`*/ w 9722 21600`],[`x5`,`*/ w 5372 21600`],[`x16`,`*/ w 11612 21600`],[`x19`,`*/ w 14640 21600`],[`y2`,`*/ h 1887 21600`],[`y3`,`*/ h 6382 21600`],[`y8`,`*/ h 12877 21600`],[`y14`,`*/ h 19712 21600`],[`y16`,`*/ h 18842 21600`],[`y17`,`*/ h 15935 21600`],[`y24`,`*/ h 6645 21600`]],paths:[{w:21600,h:21600,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`11462`,`4342`],[`l`,`14790`,`0`],[`l`,`14525`,`5777`],[`l`,`18007`,`3172`],[`l`,`16380`,`6532`],[`l`,`21600`,`6645`],[`l`,`16985`,`9402`],[`l`,`18270`,`11290`],[`l`,`16380`,`12310`],[`l`,`18877`,`15632`],[`l`,`14640`,`14350`],[`l`,`14942`,`17370`],[`l`,`12180`,`15935`],[`l`,`11612`,`18842`],[`l`,`9872`,`17370`],[`l`,`8700`,`19712`],[`l`,`7527`,`18125`],[`l`,`4917`,`21600`],[`l`,`4805`,`18240`],[`l`,`1285`,`17825`],[`l`,`3330`,`15370`],[`l`,`0`,`12877`],[`l`,`3935`,`11592`],[`l`,`1172`,`8270`],[`l`,`5372`,`7817`],[`l`,`4502`,`3625`],[`l`,`8550`,`6382`],[`l`,`9722`,`1887`],[`c`]]}]},leftarrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 100000 w ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`dx2`,`*/ ss a2 100000`],[`x2`,`+- l dx2 0`],[`dy1`,`*/ h a1 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc dy1 0`],[`dx1`,`*/ y1 dx2 hd2`],[`x1`,`+- x2 0 dx1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`x2`,`t`],[`l`,`x2`,`y1`],[`l`,`r`,`y1`],[`l`,`r`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`b`],[`c`]]}]},leftarrowcallout:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 64977`]],gd:[[`maxAdj2`,`*/ 50000 h ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`*/ 100000 w ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`q2`,`*/ a3 ss w`],[`maxAdj4`,`+- 100000 0 q2`],[`a4`,`pin 0 adj4 maxAdj4`],[`dy1`,`*/ ss a2 100000`],[`dy2`,`*/ ss a1 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`],[`y4`,`+- vc dy1 0`],[`x1`,`*/ ss a3 100000`],[`dx2`,`*/ w a4 100000`],[`x2`,`+- r 0 dx2`],[`x3`,`+/ x2 r 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`x1`,`y1`],[`l`,`x1`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`x2`,`b`],[`l`,`x2`,`y3`],[`l`,`x1`,`y3`],[`l`,`x1`,`y4`],[`c`]]}]},leftbrace:{adj:[[`adj1`,`val 8333`],[`adj2`,`val 50000`]],gd:[[`a2`,`pin 0 adj2 100000`],[`q1`,`+- 100000 0 a2`],[`q2`,`min q1 a2`],[`q3`,`*/ q2 1 2`],[`maxAdj1`,`*/ q3 h ss`],[`a1`,`pin 0 adj1 maxAdj1`],[`y1`,`*/ ss a1 100000`],[`y3`,`*/ h a2 100000`],[`y4`,`+- y3 y1 0`],[`dx1`,`cos wd2 2700000`],[`dy1`,`sin y1 2700000`],[`il`,`+- r 0 dx1`],[`it`,`+- y1 0 dy1`],[`ib`,`+- b dy1 y1`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`r`,`b`],[`a`,`wd2`,`y1`,`cd4`,`cd4`],[`l`,`hc`,`y4`],[`a`,`wd2`,`y1`,`0`,`-5400000`],[`a`,`wd2`,`y1`,`cd4`,`-5400000`],[`l`,`hc`,`y1`],[`a`,`wd2`,`y1`,`cd2`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`r`,`b`],[`a`,`wd2`,`y1`,`cd4`,`cd4`],[`l`,`hc`,`y4`],[`a`,`wd2`,`y1`,`0`,`-5400000`],[`a`,`wd2`,`y1`,`cd4`,`-5400000`],[`l`,`hc`,`y1`],[`a`,`wd2`,`y1`,`cd2`,`cd4`]]}]},leftbracket:{adj:[[`adj`,`val 8333`]],gd:[[`maxAdj`,`*/ 50000 h ss`],[`a`,`pin 0 adj maxAdj`],[`y1`,`*/ ss a 100000`],[`y2`,`+- b 0 y1`],[`dx1`,`cos w 2700000`],[`dy1`,`sin y1 2700000`],[`il`,`+- r 0 dx1`],[`it`,`+- y1 0 dy1`],[`ib`,`+- b dy1 y1`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`r`,`b`],[`a`,`w`,`y1`,`cd4`,`cd4`],[`l`,`l`,`y1`],[`a`,`w`,`y1`,`cd2`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`r`,`b`],[`a`,`w`,`y1`,`cd4`,`cd4`],[`l`,`l`,`y1`],[`a`,`w`,`y1`,`cd2`,`cd4`]]}]},leftcirculararrow:{adj:[[`adj1`,`val 12500`],[`adj2`,`val -1142319`],[`adj3`,`val 1142319`],[`adj4`,`val 10800000`],[`adj5`,`val 12500`]],gd:[[`a5`,`pin 0 adj5 25000`],[`maxAdj1`,`*/ a5 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`enAng`,`pin 1 adj3 21599999`],[`stAng`,`pin 0 adj4 21599999`],[`th`,`*/ ss a1 100000`],[`thh`,`*/ ss a5 100000`],[`th2`,`*/ th 1 2`],[`rw1`,`+- wd2 th2 thh`],[`rh1`,`+- hd2 th2 thh`],[`rw2`,`+- rw1 0 th`],[`rh2`,`+- rh1 0 th`],[`rw3`,`+- rw2 th2 0`],[`rh3`,`+- rh2 th2 0`],[`wtH`,`sin rw3 enAng`],[`htH`,`cos rh3 enAng`],[`dxH`,`cat2 rw3 htH wtH`],[`dyH`,`sat2 rh3 htH wtH`],[`xH`,`+- hc dxH 0`],[`yH`,`+- vc dyH 0`],[`rI`,`min rw2 rh2`],[`u1`,`*/ dxH dxH 1`],[`u2`,`*/ dyH dyH 1`],[`u3`,`*/ rI rI 1`],[`u4`,`+- u1 0 u3`],[`u5`,`+- u2 0 u3`],[`u6`,`*/ u4 u5 u1`],[`u7`,`*/ u6 1 u2`],[`u8`,`+- 1 0 u7`],[`u9`,`sqrt u8`],[`u10`,`*/ u4 1 dxH`],[`u11`,`*/ u10 1 dyH`],[`u12`,`+/ 1 u9 u11`],[`u13`,`at2 1 u12`],[`u14`,`+- u13 21600000 0`],[`u15`,`?: u13 u13 u14`],[`u16`,`+- u15 0 enAng`],[`u17`,`+- u16 21600000 0`],[`u18`,`?: u16 u16 u17`],[`u19`,`+- u18 0 cd2`],[`u20`,`+- u18 0 21600000`],[`u21`,`?: u19 u20 u18`],[`u22`,`abs u21`],[`minAng`,`*/ u22 -1 1`],[`u23`,`abs adj2`],[`a2`,`*/ u23 -1 1`],[`aAng`,`pin minAng a2 0`],[`ptAng`,`+- enAng aAng 0`],[`wtA`,`sin rw3 ptAng`],[`htA`,`cos rh3 ptAng`],[`dxA`,`cat2 rw3 htA wtA`],[`dyA`,`sat2 rh3 htA wtA`],[`xA`,`+- hc dxA 0`],[`yA`,`+- vc dyA 0`],[`wtE`,`sin rw1 stAng`],[`htE`,`cos rh1 stAng`],[`dxE`,`cat2 rw1 htE wtE`],[`dyE`,`sat2 rh1 htE wtE`],[`xE`,`+- hc dxE 0`],[`yE`,`+- vc dyE 0`],[`wtD`,`sin rw2 stAng`],[`htD`,`cos rh2 stAng`],[`dxD`,`cat2 rw2 htD wtD`],[`dyD`,`sat2 rh2 htD wtD`],[`xD`,`+- hc dxD 0`],[`yD`,`+- vc dyD 0`],[`dxG`,`cos thh ptAng`],[`dyG`,`sin thh ptAng`],[`xG`,`+- xH dxG 0`],[`yG`,`+- yH dyG 0`],[`dxB`,`cos thh ptAng`],[`dyB`,`sin thh ptAng`],[`xB`,`+- xH 0 dxB 0`],[`yB`,`+- yH 0 dyB 0`],[`sx1`,`+- xB 0 hc`],[`sy1`,`+- yB 0 vc`],[`sx2`,`+- xG 0 hc`],[`sy2`,`+- yG 0 vc`],[`rO`,`min rw1 rh1`],[`x1O`,`*/ sx1 rO rw1`],[`y1O`,`*/ sy1 rO rh1`],[`x2O`,`*/ sx2 rO rw1`],[`y2O`,`*/ sy2 rO rh1`],[`dxO`,`+- x2O 0 x1O`],[`dyO`,`+- y2O 0 y1O`],[`dO`,`mod dxO dyO 0`],[`q1`,`*/ x1O y2O 1`],[`q2`,`*/ x2O y1O 1`],[`DO`,`+- q1 0 q2`],[`q3`,`*/ rO rO 1`],[`q4`,`*/ dO dO 1`],[`q5`,`*/ q3 q4 1`],[`q6`,`*/ DO DO 1`],[`q7`,`+- q5 0 q6`],[`q8`,`max q7 0`],[`sdelO`,`sqrt q8`],[`ndyO`,`*/ dyO -1 1`],[`sdyO`,`?: ndyO -1 1`],[`q9`,`*/ sdyO dxO 1`],[`q10`,`*/ q9 sdelO 1`],[`q11`,`*/ DO dyO 1`],[`dxF1`,`+/ q11 q10 q4`],[`q12`,`+- q11 0 q10`],[`dxF2`,`*/ q12 1 q4`],[`adyO`,`abs dyO`],[`q13`,`*/ adyO sdelO 1`],[`q14`,`*/ DO dxO -1`],[`dyF1`,`+/ q14 q13 q4`],[`q15`,`+- q14 0 q13`],[`dyF2`,`*/ q15 1 q4`],[`q16`,`+- x2O 0 dxF1`],[`q17`,`+- x2O 0 dxF2`],[`q18`,`+- y2O 0 dyF1`],[`q19`,`+- y2O 0 dyF2`],[`q20`,`mod q16 q18 0`],[`q21`,`mod q17 q19 0`],[`q22`,`+- q21 0 q20`],[`dxF`,`?: q22 dxF1 dxF2`],[`dyF`,`?: q22 dyF1 dyF2`],[`sdxF`,`*/ dxF rw1 rO`],[`sdyF`,`*/ dyF rh1 rO`],[`xF`,`+- hc sdxF 0`],[`yF`,`+- vc sdyF 0`],[`x1I`,`*/ sx1 rI rw2`],[`y1I`,`*/ sy1 rI rh2`],[`x2I`,`*/ sx2 rI rw2`],[`y2I`,`*/ sy2 rI rh2`],[`dxI`,`+- x2I 0 x1I`],[`dyI`,`+- y2I 0 y1I`],[`dI`,`mod dxI dyI 0`],[`v1`,`*/ x1I y2I 1`],[`v2`,`*/ x2I y1I 1`],[`DI`,`+- v1 0 v2`],[`v3`,`*/ rI rI 1`],[`v4`,`*/ dI dI 1`],[`v5`,`*/ v3 v4 1`],[`v6`,`*/ DI DI 1`],[`v7`,`+- v5 0 v6`],[`v8`,`max v7 0`],[`sdelI`,`sqrt v8`],[`v9`,`*/ sdyO dxI 1`],[`v10`,`*/ v9 sdelI 1`],[`v11`,`*/ DI dyI 1`],[`dxC1`,`+/ v11 v10 v4`],[`v12`,`+- v11 0 v10`],[`dxC2`,`*/ v12 1 v4`],[`adyI`,`abs dyI`],[`v13`,`*/ adyI sdelI 1`],[`v14`,`*/ DI dxI -1`],[`dyC1`,`+/ v14 v13 v4`],[`v15`,`+- v14 0 v13`],[`dyC2`,`*/ v15 1 v4`],[`v16`,`+- x1I 0 dxC1`],[`v17`,`+- x1I 0 dxC2`],[`v18`,`+- y1I 0 dyC1`],[`v19`,`+- y1I 0 dyC2`],[`v20`,`mod v16 v18 0`],[`v21`,`mod v17 v19 0`],[`v22`,`+- v21 0 v20`],[`dxC`,`?: v22 dxC1 dxC2`],[`dyC`,`?: v22 dyC1 dyC2`],[`sdxC`,`*/ dxC rw2 rI`],[`sdyC`,`*/ dyC rh2 rI`],[`xC`,`+- hc sdxC 0`],[`yC`,`+- vc sdyC 0`],[`ist0`,`at2 sdxC sdyC`],[`ist1`,`+- ist0 21600000 0`],[`istAng0`,`?: ist0 ist0 ist1`],[`isw1`,`+- stAng 0 istAng0`],[`isw2`,`+- isw1 21600000 0`],[`iswAng0`,`?: isw1 isw1 isw2`],[`istAng`,`+- istAng0 iswAng0 0`],[`iswAng`,`+- 0 0 iswAng0`],[`p1`,`+- xF 0 xC`],[`p2`,`+- yF 0 yC`],[`p3`,`mod p1 p2 0`],[`p4`,`*/ p3 1 2`],[`p5`,`+- p4 0 thh`],[`xGp`,`?: p5 xF xG`],[`yGp`,`?: p5 yF yG`],[`xBp`,`?: p5 xC xB`],[`yBp`,`?: p5 yC yB`],[`en0`,`at2 sdxF sdyF`],[`en1`,`+- en0 21600000 0`],[`en2`,`?: en0 en0 en1`],[`sw0`,`+- en2 0 stAng`],[`sw1`,`+- sw0 0 21600000`],[`swAng`,`?: sw0 sw1 sw0`],[`stAng0`,`+- stAng swAng 0`],[`swAng0`,`+- 0 0 swAng`],[`wtI`,`sin rw3 stAng`],[`htI`,`cos rh3 stAng`],[`dxI`,`cat2 rw3 htI wtI`],[`dyI`,`sat2 rh3 htI wtI`],[`xI`,`+- hc dxI 0`],[`yI`,`+- vc dyI 0`],[`aI`,`+- stAng cd4 0`],[`aA`,`+- ptAng 0 cd4`],[`aB`,`+- ptAng cd2 0`],[`idx`,`cos rw1 2700000`],[`idy`,`sin rh1 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`xE`,`yE`],[`l`,`xD`,`yD`],[`a`,`rw2`,`rh2`,`istAng`,`iswAng`],[`l`,`xBp`,`yBp`],[`l`,`xA`,`yA`],[`l`,`xGp`,`yGp`],[`l`,`xF`,`yF`],[`a`,`rw1`,`rh1`,`stAng0`,`swAng0`],[`c`]]}]},leftrightarrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 50000 w ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`x2`,`*/ ss a2 100000`],[`x3`,`+- r 0 x2`],[`dy`,`*/ h a1 200000`],[`y1`,`+- vc 0 dy`],[`y2`,`+- vc dy 0`],[`dx1`,`*/ y1 x2 hd2`],[`x1`,`+- x2 0 dx1`],[`x4`,`+- x3 dx1 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`x2`,`t`],[`l`,`x2`,`y1`],[`l`,`x3`,`y1`],[`l`,`x3`,`t`],[`l`,`r`,`vc`],[`l`,`x3`,`b`],[`l`,`x3`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`b`],[`c`]]}]},leftrightarrowcallout:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 48123`]],gd:[[`maxAdj2`,`*/ 50000 h ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`*/ 50000 w ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`q2`,`*/ a3 ss wd2`],[`maxAdj4`,`+- 100000 0 q2`],[`a4`,`pin 0 adj4 maxAdj4`],[`dy1`,`*/ ss a2 100000`],[`dy2`,`*/ ss a1 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`],[`y4`,`+- vc dy1 0`],[`x1`,`*/ ss a3 100000`],[`x4`,`+- r 0 x1`],[`dx2`,`*/ w a4 200000`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`x1`,`y1`],[`l`,`x1`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`t`],[`l`,`x3`,`t`],[`l`,`x3`,`y2`],[`l`,`x4`,`y2`],[`l`,`x4`,`y1`],[`l`,`r`,`vc`],[`l`,`x4`,`y4`],[`l`,`x4`,`y3`],[`l`,`x3`,`y3`],[`l`,`x3`,`b`],[`l`,`x2`,`b`],[`l`,`x2`,`y3`],[`l`,`x1`,`y3`],[`l`,`x1`,`y4`],[`c`]]}]},leftrightcirculararrow:{adj:[[`adj1`,`val 12500`],[`adj2`,`val 1142319`],[`adj3`,`val 20457681`],[`adj4`,`val 11942319`],[`adj5`,`val 12500`]],gd:[[`a5`,`pin 0 adj5 25000`],[`maxAdj1`,`*/ a5 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`enAng`,`pin 1 adj3 21599999`],[`stAng`,`pin 0 adj4 21599999`],[`th`,`*/ ss a1 100000`],[`thh`,`*/ ss a5 100000`],[`th2`,`*/ th 1 2`],[`rw1`,`+- wd2 th2 thh`],[`rh1`,`+- hd2 th2 thh`],[`rw2`,`+- rw1 0 th`],[`rh2`,`+- rh1 0 th`],[`rw3`,`+- rw2 th2 0`],[`rh3`,`+- rh2 th2 0`],[`wtH`,`sin rw3 enAng`],[`htH`,`cos rh3 enAng`],[`dxH`,`cat2 rw3 htH wtH`],[`dyH`,`sat2 rh3 htH wtH`],[`xH`,`+- hc dxH 0`],[`yH`,`+- vc dyH 0`],[`rI`,`min rw2 rh2`],[`u1`,`*/ dxH dxH 1`],[`u2`,`*/ dyH dyH 1`],[`u3`,`*/ rI rI 1`],[`u4`,`+- u1 0 u3`],[`u5`,`+- u2 0 u3`],[`u6`,`*/ u4 u5 u1`],[`u7`,`*/ u6 1 u2`],[`u8`,`+- 1 0 u7`],[`u9`,`sqrt u8`],[`u10`,`*/ u4 1 dxH`],[`u11`,`*/ u10 1 dyH`],[`u12`,`+/ 1 u9 u11`],[`u13`,`at2 1 u12`],[`u14`,`+- u13 21600000 0`],[`u15`,`?: u13 u13 u14`],[`u16`,`+- u15 0 enAng`],[`u17`,`+- u16 21600000 0`],[`u18`,`?: u16 u16 u17`],[`u19`,`+- u18 0 cd2`],[`u20`,`+- u18 0 21600000`],[`u21`,`?: u19 u20 u18`],[`maxAng`,`abs u21`],[`aAng`,`pin 0 adj2 maxAng`],[`ptAng`,`+- enAng aAng 0`],[`wtA`,`sin rw3 ptAng`],[`htA`,`cos rh3 ptAng`],[`dxA`,`cat2 rw3 htA wtA`],[`dyA`,`sat2 rh3 htA wtA`],[`xA`,`+- hc dxA 0`],[`yA`,`+- vc dyA 0`],[`dxG`,`cos thh ptAng`],[`dyG`,`sin thh ptAng`],[`xG`,`+- xH dxG 0`],[`yG`,`+- yH dyG 0`],[`dxB`,`cos thh ptAng`],[`dyB`,`sin thh ptAng`],[`xB`,`+- xH 0 dxB 0`],[`yB`,`+- yH 0 dyB 0`],[`sx1`,`+- xB 0 hc`],[`sy1`,`+- yB 0 vc`],[`sx2`,`+- xG 0 hc`],[`sy2`,`+- yG 0 vc`],[`rO`,`min rw1 rh1`],[`x1O`,`*/ sx1 rO rw1`],[`y1O`,`*/ sy1 rO rh1`],[`x2O`,`*/ sx2 rO rw1`],[`y2O`,`*/ sy2 rO rh1`],[`dxO`,`+- x2O 0 x1O`],[`dyO`,`+- y2O 0 y1O`],[`dO`,`mod dxO dyO 0`],[`q1`,`*/ x1O y2O 1`],[`q2`,`*/ x2O y1O 1`],[`DO`,`+- q1 0 q2`],[`q3`,`*/ rO rO 1`],[`q4`,`*/ dO dO 1`],[`q5`,`*/ q3 q4 1`],[`q6`,`*/ DO DO 1`],[`q7`,`+- q5 0 q6`],[`q8`,`max q7 0`],[`sdelO`,`sqrt q8`],[`ndyO`,`*/ dyO -1 1`],[`sdyO`,`?: ndyO -1 1`],[`q9`,`*/ sdyO dxO 1`],[`q10`,`*/ q9 sdelO 1`],[`q11`,`*/ DO dyO 1`],[`dxF1`,`+/ q11 q10 q4`],[`q12`,`+- q11 0 q10`],[`dxF2`,`*/ q12 1 q4`],[`adyO`,`abs dyO`],[`q13`,`*/ adyO sdelO 1`],[`q14`,`*/ DO dxO -1`],[`dyF1`,`+/ q14 q13 q4`],[`q15`,`+- q14 0 q13`],[`dyF2`,`*/ q15 1 q4`],[`q16`,`+- x2O 0 dxF1`],[`q17`,`+- x2O 0 dxF2`],[`q18`,`+- y2O 0 dyF1`],[`q19`,`+- y2O 0 dyF2`],[`q20`,`mod q16 q18 0`],[`q21`,`mod q17 q19 0`],[`q22`,`+- q21 0 q20`],[`dxF`,`?: q22 dxF1 dxF2`],[`dyF`,`?: q22 dyF1 dyF2`],[`sdxF`,`*/ dxF rw1 rO`],[`sdyF`,`*/ dyF rh1 rO`],[`xF`,`+- hc sdxF 0`],[`yF`,`+- vc sdyF 0`],[`x1I`,`*/ sx1 rI rw2`],[`y1I`,`*/ sy1 rI rh2`],[`x2I`,`*/ sx2 rI rw2`],[`y2I`,`*/ sy2 rI rh2`],[`dxI`,`+- x2I 0 x1I`],[`dyI`,`+- y2I 0 y1I`],[`dI`,`mod dxI dyI 0`],[`v1`,`*/ x1I y2I 1`],[`v2`,`*/ x2I y1I 1`],[`DI`,`+- v1 0 v2`],[`v3`,`*/ rI rI 1`],[`v4`,`*/ dI dI 1`],[`v5`,`*/ v3 v4 1`],[`v6`,`*/ DI DI 1`],[`v7`,`+- v5 0 v6`],[`v8`,`max v7 0`],[`sdelI`,`sqrt v8`],[`v9`,`*/ sdyO dxI 1`],[`v10`,`*/ v9 sdelI 1`],[`v11`,`*/ DI dyI 1`],[`dxC1`,`+/ v11 v10 v4`],[`v12`,`+- v11 0 v10`],[`dxC2`,`*/ v12 1 v4`],[`adyI`,`abs dyI`],[`v13`,`*/ adyI sdelI 1`],[`v14`,`*/ DI dxI -1`],[`dyC1`,`+/ v14 v13 v4`],[`v15`,`+- v14 0 v13`],[`dyC2`,`*/ v15 1 v4`],[`v16`,`+- x1I 0 dxC1`],[`v17`,`+- x1I 0 dxC2`],[`v18`,`+- y1I 0 dyC1`],[`v19`,`+- y1I 0 dyC2`],[`v20`,`mod v16 v18 0`],[`v21`,`mod v17 v19 0`],[`v22`,`+- v21 0 v20`],[`dxC`,`?: v22 dxC1 dxC2`],[`dyC`,`?: v22 dyC1 dyC2`],[`sdxC`,`*/ dxC rw2 rI`],[`sdyC`,`*/ dyC rh2 rI`],[`xC`,`+- hc sdxC 0`],[`yC`,`+- vc sdyC 0`],[`wtI`,`sin rw3 stAng`],[`htI`,`cos rh3 stAng`],[`dxI`,`cat2 rw3 htI wtI`],[`dyI`,`sat2 rh3 htI wtI`],[`xI`,`+- hc dxI 0`],[`yI`,`+- vc dyI 0`],[`lptAng`,`+- stAng 0 aAng`],[`wtL`,`sin rw3 lptAng`],[`htL`,`cos rh3 lptAng`],[`dxL`,`cat2 rw3 htL wtL`],[`dyL`,`sat2 rh3 htL wtL`],[`xL`,`+- hc dxL 0`],[`yL`,`+- vc dyL 0`],[`dxK`,`cos thh lptAng`],[`dyK`,`sin thh lptAng`],[`xK`,`+- xI dxK 0`],[`yK`,`+- yI dyK 0`],[`dxJ`,`cos thh lptAng`],[`dyJ`,`sin thh lptAng`],[`xJ`,`+- xI 0 dxJ 0`],[`yJ`,`+- yI 0 dyJ 0`],[`p1`,`+- xF 0 xC`],[`p2`,`+- yF 0 yC`],[`p3`,`mod p1 p2 0`],[`p4`,`*/ p3 1 2`],[`p5`,`+- p4 0 thh`],[`xGp`,`?: p5 xF xG`],[`yGp`,`?: p5 yF yG`],[`xBp`,`?: p5 xC xB`],[`yBp`,`?: p5 yC yB`],[`en0`,`at2 sdxF sdyF`],[`en1`,`+- en0 21600000 0`],[`en2`,`?: en0 en0 en1`],[`od0`,`+- en2 0 enAng`],[`od1`,`+- od0 21600000 0`],[`od2`,`?: od0 od0 od1`],[`st0`,`+- stAng 0 od2`],[`st1`,`+- st0 21600000 0`],[`st2`,`?: st0 st0 st1`],[`sw0`,`+- en2 0 st2`],[`sw1`,`+- sw0 21600000 0`],[`swAng`,`?: sw0 sw0 sw1`],[`ist0`,`at2 sdxC sdyC`],[`ist1`,`+- ist0 21600000 0`],[`istAng`,`?: ist0 ist0 ist1`],[`id0`,`+- istAng 0 enAng`],[`id1`,`+- id0 0 21600000`],[`id2`,`?: id0 id1 id0`],[`ien0`,`+- stAng 0 id2`],[`ien1`,`+- ien0 0 21600000`],[`ien2`,`?: ien1 ien1 ien0`],[`isw1`,`+- ien2 0 istAng`],[`isw2`,`+- isw1 0 21600000`],[`iswAng`,`?: isw1 isw2 isw1`],[`wtE`,`sin rw1 st2`],[`htE`,`cos rh1 st2`],[`dxE`,`cat2 rw1 htE wtE`],[`dyE`,`sat2 rh1 htE wtE`],[`xE`,`+- hc dxE 0`],[`yE`,`+- vc dyE 0`],[`wtD`,`sin rw2 ien2`],[`htD`,`cos rh2 ien2`],[`dxD`,`cat2 rw2 htD wtD`],[`dyD`,`sat2 rh2 htD wtD`],[`xD`,`+- hc dxD 0`],[`yD`,`+- vc dyD 0`],[`xKp`,`?: p5 xE xK`],[`yKp`,`?: p5 yE yK`],[`xJp`,`?: p5 xD xJ`],[`yJp`,`?: p5 yD yJ`],[`aL`,`+- lptAng 0 cd4`],[`aA`,`+- ptAng cd4 0`],[`aB`,`+- ptAng cd2 0`],[`aJ`,`+- lptAng cd2 0`],[`idx`,`cos rw1 2700000`],[`idy`,`sin rh1 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`xL`,`yL`],[`l`,`xKp`,`yKp`],[`l`,`xE`,`yE`],[`a`,`rw1`,`rh1`,`st2`,`swAng`],[`l`,`xGp`,`yGp`],[`l`,`xA`,`yA`],[`l`,`xBp`,`yBp`],[`l`,`xC`,`yC`],[`a`,`rw2`,`rh2`,`istAng`,`iswAng`],[`l`,`xJp`,`yJp`],[`c`]]}]},leftrightribbon:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`],[`adj3`,`val 16667`]],gd:[[`a3`,`pin 0 adj3 33333`],[`maxAdj1`,`+- 100000 0 a3`],[`a1`,`pin 0 adj1 maxAdj1`],[`w1`,`+- wd2 0 wd32`],[`maxAdj2`,`*/ 100000 w1 ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`x1`,`*/ ss a2 100000`],[`x4`,`+- r 0 x1`],[`dy1`,`*/ h a1 200000`],[`dy2`,`*/ h a3 -200000`],[`ly1`,`+- vc dy2 dy1`],[`ry4`,`+- vc dy1 dy2`],[`ly2`,`+- ly1 dy1 0`],[`ry3`,`+- b 0 ly2`],[`ly4`,`*/ ly2 2 1`],[`ry1`,`+- b 0 ly4`],[`ly3`,`+- ly4 0 ly1`],[`ry2`,`+- b 0 ly3`],[`hR`,`*/ a3 ss 400000`],[`x2`,`+- hc 0 wd32`],[`x3`,`+- hc wd32 0`],[`y1`,`+- ly1 hR 0`],[`y2`,`+- ry2 0 hR`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`ly2`],[`l`,`x1`,`t`],[`l`,`x1`,`ly1`],[`l`,`hc`,`ly1`],[`a`,`wd32`,`hR`,`3cd4`,`cd2`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`x4`,`ry2`],[`l`,`x4`,`ry1`],[`l`,`r`,`ry3`],[`l`,`x4`,`b`],[`l`,`x4`,`ry4`],[`l`,`hc`,`ry4`],[`a`,`wd32`,`hR`,`cd4`,`cd4`],[`l`,`x2`,`ly3`],[`l`,`x1`,`ly3`],[`l`,`x1`,`ly4`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x3`,`y1`],[`a`,`wd32`,`hR`,`0`,`cd4`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`x3`,`ry2`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`ly2`],[`l`,`x1`,`t`],[`l`,`x1`,`ly1`],[`l`,`hc`,`ly1`],[`a`,`wd32`,`hR`,`3cd4`,`cd2`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`x4`,`ry2`],[`l`,`x4`,`ry1`],[`l`,`r`,`ry3`],[`l`,`x4`,`b`],[`l`,`x4`,`ry4`],[`l`,`hc`,`ry4`],[`a`,`wd32`,`hR`,`cd4`,`cd4`],[`l`,`x2`,`ly3`],[`l`,`x1`,`ly3`],[`l`,`x1`,`ly4`],[`c`],[`m`,`x3`,`y1`],[`l`,`x3`,`ry2`],[`m`,`x2`,`y2`],[`l`,`x2`,`ly3`]]}]},leftrightuparrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`]],gd:[[`a2`,`pin 0 adj2 50000`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`q1`,`+- 100000 0 maxAdj1`],[`maxAdj3`,`*/ q1 1 2`],[`a3`,`pin 0 adj3 maxAdj3`],[`x1`,`*/ ss a3 100000`],[`dx2`,`*/ ss a2 100000`],[`x2`,`+- hc 0 dx2`],[`x5`,`+- hc dx2 0`],[`dx3`,`*/ ss a1 200000`],[`x3`,`+- hc 0 dx3`],[`x4`,`+- hc dx3 0`],[`x6`,`+- r 0 x1`],[`dy2`,`*/ ss a2 50000`],[`y2`,`+- b 0 dy2`],[`y4`,`+- b 0 dx2`],[`y3`,`+- y4 0 dx3`],[`y5`,`+- y4 dx3 0`],[`il`,`*/ dx3 x1 dx2`],[`ir`,`+- r 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y4`],[`l`,`x1`,`y2`],[`l`,`x1`,`y3`],[`l`,`x3`,`y3`],[`l`,`x3`,`x1`],[`l`,`x2`,`x1`],[`l`,`hc`,`t`],[`l`,`x5`,`x1`],[`l`,`x4`,`x1`],[`l`,`x4`,`y3`],[`l`,`x6`,`y3`],[`l`,`x6`,`y2`],[`l`,`r`,`y4`],[`l`,`x6`,`b`],[`l`,`x6`,`y5`],[`l`,`x1`,`y5`],[`l`,`x1`,`b`],[`c`]]}]},leftuparrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`]],gd:[[`a2`,`pin 0 adj2 50000`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`+- 100000 0 maxAdj1`],[`a3`,`pin 0 adj3 maxAdj3`],[`x1`,`*/ ss a3 100000`],[`dx2`,`*/ ss a2 50000`],[`x2`,`+- r 0 dx2`],[`y2`,`+- b 0 dx2`],[`dx4`,`*/ ss a2 100000`],[`x4`,`+- r 0 dx4`],[`y4`,`+- b 0 dx4`],[`dx3`,`*/ ss a1 200000`],[`x3`,`+- x4 0 dx3`],[`x5`,`+- x4 dx3 0`],[`y3`,`+- y4 0 dx3`],[`y5`,`+- y4 dx3 0`],[`il`,`*/ dx3 x1 dx4`],[`cx1`,`+/ x1 x5 2`],[`cy1`,`+/ x1 y5 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y4`],[`l`,`x1`,`y2`],[`l`,`x1`,`y3`],[`l`,`x3`,`y3`],[`l`,`x3`,`x1`],[`l`,`x2`,`x1`],[`l`,`x4`,`t`],[`l`,`r`,`x1`],[`l`,`x5`,`x1`],[`l`,`x5`,`y5`],[`l`,`x1`,`y5`],[`l`,`x1`,`b`],[`c`]]}]},lightningbolt:{adj:[],gd:[[`x1`,`*/ w 5022 21600`],[`x3`,`*/ w 8472 21600`],[`x4`,`*/ w 8757 21600`],[`x5`,`*/ w 10012 21600`],[`x8`,`*/ w 12860 21600`],[`x9`,`*/ w 13917 21600`],[`x11`,`*/ w 16577 21600`],[`y1`,`*/ h 3890 21600`],[`y2`,`*/ h 6080 21600`],[`y4`,`*/ h 7437 21600`],[`y6`,`*/ h 9705 21600`],[`y7`,`*/ h 12007 21600`],[`y10`,`*/ h 14277 21600`],[`y11`,`*/ h 14915 21600`]],paths:[{w:21600,h:21600,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`8472`,`0`],[`l`,`12860`,`6080`],[`l`,`11050`,`6797`],[`l`,`16577`,`12007`],[`l`,`14767`,`12877`],[`l`,`21600`,`21600`],[`l`,`10012`,`14915`],[`l`,`12222`,`13987`],[`l`,`5022`,`9705`],[`l`,`7602`,`8382`],[`l`,`0`,`3890`],[`c`]]}]},line:{adj:[],gd:[],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`b`]]}]},lineinv:{adj:[],gd:[],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`r`,`t`]]}]},mathdivide:{adj:[[`adj1`,`val 23520`],[`adj2`,`val 5880`],[`adj3`,`val 11760`]],gd:[[`a1`,`pin 1000 adj1 36745`],[`ma1`,`+- 0 0 a1`],[`ma3h`,`+/ 73490 ma1 4`],[`ma3w`,`*/ 36745 w h`],[`maxAdj3`,`min ma3h ma3w`],[`a3`,`pin 1000 adj3 maxAdj3`],[`m4a3`,`*/ -4 a3 1`],[`maxAdj2`,`+- 73490 m4a3 a1`],[`a2`,`pin 0 adj2 maxAdj2`],[`dy1`,`*/ h a1 200000`],[`yg`,`*/ h a2 100000`],[`rad`,`*/ h a3 100000`],[`dx1`,`*/ w 73490 200000`],[`y3`,`+- vc 0 dy1`],[`y4`,`+- vc dy1 0`],[`a`,`+- yg rad 0`],[`y2`,`+- y3 0 a`],[`y1`,`+- y2 0 rad`],[`y5`,`+- b 0 y1`],[`x1`,`+- hc 0 dx1`],[`x3`,`+- hc dx1 0`],[`x2`,`+- hc 0 rad`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`hc`,`y1`],[`a`,`rad`,`rad`,`3cd4`,`21600000`],[`c`],[`m`,`hc`,`y5`],[`a`,`rad`,`rad`,`cd4`,`21600000`],[`c`],[`m`,`x1`,`y3`],[`l`,`x3`,`y3`],[`l`,`x3`,`y4`],[`l`,`x1`,`y4`],[`c`]]}]},mathequal:{adj:[[`adj1`,`val 23520`],[`adj2`,`val 11760`]],gd:[[`a1`,`pin 0 adj1 36745`],[`2a1`,`*/ a1 2 1`],[`mAdj2`,`+- 100000 0 2a1`],[`a2`,`pin 0 adj2 mAdj2`],[`dy1`,`*/ h a1 100000`],[`dy2`,`*/ h a2 200000`],[`dx1`,`*/ w 73490 200000`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`],[`y1`,`+- y2 0 dy1`],[`y4`,`+- y3 dy1 0`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc dx1 0`],[`yC1`,`+/ y1 y2 2`],[`yC2`,`+/ y3 y4 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y1`],[`l`,`x2`,`y2`],[`l`,`x1`,`y2`],[`c`],[`m`,`x1`,`y3`],[`l`,`x2`,`y3`],[`l`,`x2`,`y4`],[`l`,`x1`,`y4`],[`c`]]}]},mathminus:{adj:[[`adj1`,`val 23520`]],gd:[[`a1`,`pin 0 adj1 100000`],[`dy1`,`*/ h a1 200000`],[`dx1`,`*/ w 73490 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc dy1 0`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc dx1 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`l`,`x2`,`y1`],[`l`,`x2`,`y2`],[`l`,`x1`,`y2`],[`c`]]}]},mathmultiply:{adj:[[`adj1`,`val 23520`]],gd:[[`a1`,`pin 0 adj1 51965`],[`th`,`*/ ss a1 100000`],[`a`,`at2 w h`],[`sa`,`sin 1 a`],[`ca`,`cos 1 a`],[`ta`,`tan 1 a`],[`dl`,`mod w h 0`],[`rw`,`*/ dl 51965 100000`],[`lM`,`+- dl 0 rw`],[`xM`,`*/ ca lM 2`],[`yM`,`*/ sa lM 2`],[`dxAM`,`*/ sa th 2`],[`dyAM`,`*/ ca th 2`],[`xA`,`+- xM 0 dxAM`],[`yA`,`+- yM dyAM 0`],[`xB`,`+- xM dxAM 0`],[`yB`,`+- yM 0 dyAM`],[`xBC`,`+- hc 0 xB`],[`yBC`,`*/ xBC ta 1`],[`yC`,`+- yBC yB 0`],[`xD`,`+- r 0 xB`],[`xE`,`+- r 0 xA`],[`yFE`,`+- vc 0 yA`],[`xFE`,`*/ yFE 1 ta`],[`xF`,`+- xE 0 xFE`],[`xL`,`+- xA xFE 0`],[`yG`,`+- b 0 yA`],[`yH`,`+- b 0 yB`],[`yI`,`+- b 0 yC`],[`xC2`,`+- r 0 xM`],[`yC3`,`+- b 0 yM`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`xA`,`yA`],[`l`,`xB`,`yB`],[`l`,`hc`,`yC`],[`l`,`xD`,`yB`],[`l`,`xE`,`yA`],[`l`,`xF`,`vc`],[`l`,`xE`,`yG`],[`l`,`xD`,`yH`],[`l`,`hc`,`yI`],[`l`,`xB`,`yH`],[`l`,`xA`,`yG`],[`l`,`xL`,`vc`],[`c`]]}]},mathnotequal:{adj:[[`adj1`,`val 23520`],[`adj2`,`val 6600000`],[`adj3`,`val 11760`]],gd:[[`a1`,`pin 0 adj1 50000`],[`crAng`,`pin 4200000 adj2 6600000`],[`2a1`,`*/ a1 2 1`],[`maxAdj3`,`+- 100000 0 2a1`],[`a3`,`pin 0 adj3 maxAdj3`],[`dy1`,`*/ h a1 100000`],[`dy2`,`*/ h a3 200000`],[`dx1`,`*/ w 73490 200000`],[`x1`,`+- hc 0 dx1`],[`x8`,`+- hc dx1 0`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`],[`y1`,`+- y2 0 dy1`],[`y4`,`+- y3 dy1 0`],[`cadj2`,`+- crAng 0 cd4`],[`xadj2`,`tan hd2 cadj2`],[`len`,`mod xadj2 hd2 0`],[`bhw`,`*/ len dy1 hd2`],[`bhw2`,`*/ bhw 1 2`],[`x7`,`+- hc xadj2 bhw2`],[`dx67`,`*/ xadj2 y1 hd2`],[`x6`,`+- x7 0 dx67`],[`dx57`,`*/ xadj2 y2 hd2`],[`x5`,`+- x7 0 dx57`],[`dx47`,`*/ xadj2 y3 hd2`],[`x4`,`+- x7 0 dx47`],[`dx37`,`*/ xadj2 y4 hd2`],[`x3`,`+- x7 0 dx37`],[`dx27`,`*/ xadj2 2 1`],[`x2`,`+- x7 0 dx27`],[`rx7`,`+- x7 bhw 0`],[`rx6`,`+- x6 bhw 0`],[`rx5`,`+- x5 bhw 0`],[`rx4`,`+- x4 bhw 0`],[`rx3`,`+- x3 bhw 0`],[`rx2`,`+- x2 bhw 0`],[`dx7`,`*/ dy1 hd2 len`],[`rxt`,`+- x7 dx7 0`],[`lxt`,`+- rx7 0 dx7`],[`rx`,`?: cadj2 rxt rx7`],[`lx`,`?: cadj2 x7 lxt`],[`dy3`,`*/ dy1 xadj2 len`],[`dy4`,`+- 0 0 dy3`],[`ry`,`?: cadj2 dy3 t`],[`ly`,`?: cadj2 t dy4`],[`dlx`,`+- w 0 rx`],[`drx`,`+- w 0 lx`],[`dly`,`+- h 0 ry`],[`dry`,`+- h 0 ly`],[`xC1`,`+/ rx lx 2`],[`xC2`,`+/ drx dlx 2`],[`yC1`,`+/ ry ly 2`],[`yC2`,`+/ y1 y2 2`],[`yC3`,`+/ y3 y4 2`],[`yC4`,`+/ dry dly 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`l`,`x6`,`y1`],[`l`,`lx`,`ly`],[`l`,`rx`,`ry`],[`l`,`rx6`,`y1`],[`l`,`x8`,`y1`],[`l`,`x8`,`y2`],[`l`,`rx5`,`y2`],[`l`,`rx4`,`y3`],[`l`,`x8`,`y3`],[`l`,`x8`,`y4`],[`l`,`rx3`,`y4`],[`l`,`drx`,`dry`],[`l`,`dlx`,`dly`],[`l`,`x3`,`y4`],[`l`,`x1`,`y4`],[`l`,`x1`,`y3`],[`l`,`x4`,`y3`],[`l`,`x5`,`y2`],[`l`,`x1`,`y2`],[`c`]]}]},mathplus:{adj:[[`adj1`,`val 23520`]],gd:[[`a1`,`pin 0 adj1 73490`],[`dx1`,`*/ w 73490 200000`],[`dy1`,`*/ h 73490 200000`],[`dx2`,`*/ ss a1 200000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dx2`],[`y3`,`+- vc dx2 0`],[`y4`,`+- vc dy1 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`y1`],[`l`,`x3`,`y1`],[`l`,`x3`,`y2`],[`l`,`x4`,`y2`],[`l`,`x4`,`y3`],[`l`,`x3`,`y3`],[`l`,`x3`,`y4`],[`l`,`x2`,`y4`],[`l`,`x2`,`y3`],[`l`,`x1`,`y3`],[`c`]]}]},moon:{adj:[[`adj`,`val 50000`]],gd:[[`a`,`pin 0 adj 87500`],[`g0`,`*/ ss a 100000`],[`g0w`,`*/ g0 w ss`],[`g1`,`+- ss 0 g0`],[`g2`,`*/ g0 g0 g1`],[`g3`,`*/ ss ss g1`],[`g4`,`*/ g3 2 1`],[`g5`,`+- g4 0 g2`],[`g6`,`+- g5 0 g0`],[`g6w`,`*/ g6 w ss`],[`g7`,`*/ g5 1 2`],[`g8`,`+- g7 0 g0`],[`dy1`,`*/ g8 hd2 ss`],[`g10h`,`+- vc 0 dy1`],[`g11h`,`+- vc dy1 0`],[`g12`,`*/ g0 9598 32768`],[`g12w`,`*/ g12 w ss`],[`g13`,`+- ss 0 g12`],[`q1`,`*/ ss ss 1`],[`q2`,`*/ g13 g13 1`],[`q3`,`+- q1 0 q2`],[`q4`,`sqrt q3`],[`dy4`,`*/ q4 hd2 ss`],[`g15h`,`+- vc 0 dy4`],[`g16h`,`+- vc dy4 0`],[`g17w`,`+- g6w 0 g0w`],[`g18w`,`*/ g17w 1 2`],[`dx2p`,`+- g0w g18w w`],[`dx2`,`*/ dx2p -1 1`],[`dy2`,`*/ hd2 -1 1`],[`stAng1`,`at2 dx2 dy2`],[`enAngp1`,`at2 dx2 hd2`],[`enAng1`,`+- enAngp1 0 21600000`],[`swAng1`,`+- enAng1 0 stAng1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`r`,`b`],[`a`,`w`,`hd2`,`cd4`,`cd2`],[`a`,`g18w`,`dy1`,`stAng1`,`swAng1`],[`c`]]}]},nonisoscelestrapezoid:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`]],gd:[[`maxAdj`,`*/ 50000 w ss`],[`a1`,`pin 0 adj1 maxAdj`],[`a2`,`pin 0 adj2 maxAdj`],[`x1`,`*/ ss a1 200000`],[`x2`,`*/ ss a1 100000`],[`dx3`,`*/ ss a2 100000`],[`x3`,`+- r 0 dx3`],[`x4`,`+/ r x3 2`],[`il`,`*/ wd3 a1 maxAdj`],[`adjm`,`max a1 a2`],[`it`,`*/ hd3 adjm maxAdj`],[`irt`,`*/ wd3 a2 maxAdj`],[`ir`,`+- r 0 irt`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`x2`,`t`],[`l`,`x3`,`t`],[`l`,`r`,`b`],[`c`]]}]},nosmoking:{adj:[[`adj`,`val 18750`]],gd:[[`a`,`pin 0 adj 50000`],[`dr`,`*/ ss a 100000`],[`iwd2`,`+- wd2 0 dr`],[`ihd2`,`+- hd2 0 dr`],[`ang`,`at2 w h`],[`ct`,`cos ihd2 ang`],[`st`,`sin iwd2 ang`],[`m`,`mod ct st 0`],[`n`,`*/ iwd2 ihd2 m`],[`drd2`,`*/ dr 1 2`],[`dang`,`at2 n drd2`],[`dang2`,`*/ dang 2 1`],[`swAng`,`+- -10800000 dang2 0`],[`t3`,`at2 w h`],[`stAng1`,`+- t3 0 dang`],[`stAng2`,`+- stAng1 0 cd2`],[`ct1`,`cos ihd2 stAng1`],[`st1`,`sin iwd2 stAng1`],[`m1`,`mod ct1 st1 0`],[`n1`,`*/ iwd2 ihd2 m1`],[`dx1`,`cos n1 stAng1`],[`dy1`,`sin n1 stAng1`],[`x1`,`+- hc dx1 0`],[`y1`,`+- vc dy1 0`],[`x2`,`+- hc 0 dx1`],[`y2`,`+- vc 0 dy1`],[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`a`,`wd2`,`hd2`,`3cd4`,`cd4`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`],[`m`,`x1`,`y1`],[`a`,`iwd2`,`ihd2`,`stAng1`,`swAng`],[`c`],[`m`,`x2`,`y2`],[`a`,`iwd2`,`ihd2`,`stAng2`,`swAng`],[`c`]]}]},notchedrightarrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 100000 w ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`dx2`,`*/ ss a2 100000`],[`x2`,`+- r 0 dx2`],[`dy1`,`*/ h a1 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc dy1 0`],[`x1`,`*/ dy1 dx2 hd2`],[`x3`,`+- r 0 x1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y1`],[`l`,`x2`,`y1`],[`l`,`x2`,`t`],[`l`,`r`,`vc`],[`l`,`x2`,`b`],[`l`,`x2`,`y2`],[`l`,`l`,`y2`],[`l`,`x1`,`vc`],[`c`]]}]},octagon:{adj:[[`adj`,`val 29289`]],gd:[[`a`,`pin 0 adj 50000`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`y2`,`+- b 0 x1`],[`il`,`*/ x1 1 2`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`x1`],[`l`,`x1`,`t`],[`l`,`x2`,`t`],[`l`,`r`,`x1`],[`l`,`r`,`y2`],[`l`,`x2`,`b`],[`l`,`x1`,`b`],[`l`,`l`,`y2`],[`c`]]}]},parallelogram:{adj:[[`adj`,`val 25000`]],gd:[[`maxAdj`,`*/ 100000 w ss`],[`a`,`pin 0 adj maxAdj`],[`x1`,`*/ ss a 200000`],[`x2`,`*/ ss a 100000`],[`x6`,`+- r 0 x1`],[`x5`,`+- r 0 x2`],[`x3`,`*/ x5 1 2`],[`x4`,`+- r 0 x3`],[`il`,`*/ wd2 a maxAdj`],[`q1`,`*/ 5 a maxAdj`],[`q2`,`+/ 1 q1 12`],[`il`,`*/ q2 w 1`],[`it`,`*/ q2 h 1`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 it`],[`q3`,`*/ h hc x2`],[`y1`,`pin 0 q3 h`],[`y2`,`+- b 0 y1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`x2`,`t`],[`l`,`r`,`t`],[`l`,`x5`,`b`],[`c`]]}]},pentagon:{adj:[[`hf`,`val 105146`],[`vf`,`val 110557`]],gd:[[`swd2`,`*/ wd2 hf 100000`],[`shd2`,`*/ hd2 vf 100000`],[`svc`,`*/ vc vf 100000`],[`dx1`,`cos swd2 1080000`],[`dx2`,`cos swd2 18360000`],[`dy1`,`sin shd2 1080000`],[`dy2`,`sin shd2 18360000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`y1`,`+- svc 0 dy1`],[`y2`,`+- svc 0 dy2`],[`it`,`*/ y1 dx2 dx1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`l`,`hc`,`t`],[`l`,`x4`,`y1`],[`l`,`x3`,`y2`],[`l`,`x2`,`y2`],[`c`]]}]},pie:{adj:[[`adj1`,`val 0`],[`adj2`,`val 16200000`]],gd:[[`stAng`,`pin 0 adj1 21599999`],[`enAng`,`pin 0 adj2 21599999`],[`sw1`,`+- enAng 0 stAng`],[`sw2`,`+- sw1 21600000 0`],[`swAng`,`?: sw1 sw1 sw2`],[`wt1`,`sin wd2 stAng`],[`ht1`,`cos hd2 stAng`],[`dx1`,`cat2 wd2 ht1 wt1`],[`dy1`,`sat2 hd2 ht1 wt1`],[`x1`,`+- hc dx1 0`],[`y1`,`+- vc dy1 0`],[`wt2`,`sin wd2 enAng`],[`ht2`,`cos hd2 enAng`],[`dx2`,`cat2 wd2 ht2 wt2`],[`dy2`,`sat2 hd2 ht2 wt2`],[`x2`,`+- hc dx2 0`],[`y2`,`+- vc dy2 0`],[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`a`,`wd2`,`hd2`,`stAng`,`swAng`],[`l`,`hc`,`vc`],[`c`]]}]},piewedge:{adj:[],gd:[[`g1`,`cos w 13500000`],[`g2`,`sin h 13500000`],[`x1`,`+- r g1 0`],[`y1`,`+- b g2 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`a`,`w`,`h`,`cd2`,`cd4`],[`l`,`r`,`b`],[`c`]]}]},plaque:{adj:[[`adj`,`val 16667`]],gd:[[`a`,`pin 0 adj 50000`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`y2`,`+- b 0 x1`],[`il`,`*/ x1 70711 100000`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`x1`],[`a`,`x1`,`x1`,`cd4`,`-5400000`],[`l`,`x2`,`t`],[`a`,`x1`,`x1`,`cd2`,`-5400000`],[`l`,`r`,`y2`],[`a`,`x1`,`x1`,`3cd4`,`-5400000`],[`l`,`x1`,`b`],[`a`,`x1`,`x1`,`0`,`-5400000`],[`c`]]}]},plaquetabs:{adj:[],gd:[[`md`,`mod w h 0`],[`dx`,`*/ 1 md 20`],[`y1`,`+- 0 b dx`],[`x1`,`+- 0 r dx`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`dx`,`t`],[`a`,`dx`,`dx`,`0`,`cd4`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y1`],[`a`,`dx`,`dx`,`3cd4`,`cd4`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`r`,`t`],[`l`,`r`,`dx`],[`a`,`dx`,`dx`,`cd4`,`cd4`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`b`],[`a`,`dx`,`dx`,`cd2`,`cd4`],[`l`,`r`,`b`],[`c`]]}]},plus:{adj:[[`adj`,`val 25000`]],gd:[[`a`,`pin 0 adj 50000`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`y2`,`+- b 0 x1`],[`d`,`+- w 0 h`],[`il`,`?: d l x1`],[`ir`,`?: d r x2`],[`it`,`?: d x1 t`],[`ib`,`?: d y2 b`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`x1`],[`l`,`x1`,`x1`],[`l`,`x1`,`t`],[`l`,`x2`,`t`],[`l`,`x2`,`x1`],[`l`,`r`,`x1`],[`l`,`r`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`b`],[`l`,`x1`,`b`],[`l`,`x1`,`y2`],[`l`,`l`,`y2`],[`c`]]}]},quadarrow:{adj:[[`adj1`,`val 22500`],[`adj2`,`val 22500`],[`adj3`,`val 22500`]],gd:[[`a2`,`pin 0 adj2 50000`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`q1`,`+- 100000 0 maxAdj1`],[`maxAdj3`,`*/ q1 1 2`],[`a3`,`pin 0 adj3 maxAdj3`],[`x1`,`*/ ss a3 100000`],[`dx2`,`*/ ss a2 100000`],[`x2`,`+- hc 0 dx2`],[`x5`,`+- hc dx2 0`],[`dx3`,`*/ ss a1 200000`],[`x3`,`+- hc 0 dx3`],[`x4`,`+- hc dx3 0`],[`x6`,`+- r 0 x1`],[`y2`,`+- vc 0 dx2`],[`y5`,`+- vc dx2 0`],[`y3`,`+- vc 0 dx3`],[`y4`,`+- vc dx3 0`],[`y6`,`+- b 0 x1`],[`il`,`*/ dx3 x1 dx2`],[`ir`,`+- r 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`x1`,`y2`],[`l`,`x1`,`y3`],[`l`,`x3`,`y3`],[`l`,`x3`,`x1`],[`l`,`x2`,`x1`],[`l`,`hc`,`t`],[`l`,`x5`,`x1`],[`l`,`x4`,`x1`],[`l`,`x4`,`y3`],[`l`,`x6`,`y3`],[`l`,`x6`,`y2`],[`l`,`r`,`vc`],[`l`,`x6`,`y5`],[`l`,`x6`,`y4`],[`l`,`x4`,`y4`],[`l`,`x4`,`y6`],[`l`,`x5`,`y6`],[`l`,`hc`,`b`],[`l`,`x2`,`y6`],[`l`,`x3`,`y6`],[`l`,`x3`,`y4`],[`l`,`x1`,`y4`],[`l`,`x1`,`y5`],[`c`]]}]},quadarrowcallout:{adj:[[`adj1`,`val 18515`],[`adj2`,`val 18515`],[`adj3`,`val 18515`],[`adj4`,`val 48123`]],gd:[[`a2`,`pin 0 adj2 50000`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`+- 50000 0 a2`],[`a3`,`pin 0 adj3 maxAdj3`],[`q2`,`*/ a3 2 1`],[`maxAdj4`,`+- 100000 0 q2`],[`a4`,`pin a1 adj4 maxAdj4`],[`dx2`,`*/ ss a2 100000`],[`dx3`,`*/ ss a1 200000`],[`ah`,`*/ ss a3 100000`],[`dx1`,`*/ w a4 200000`],[`dy1`,`*/ h a4 200000`],[`x8`,`+- r 0 ah`],[`x2`,`+- hc 0 dx1`],[`x7`,`+- hc dx1 0`],[`x3`,`+- hc 0 dx2`],[`x6`,`+- hc dx2 0`],[`x4`,`+- hc 0 dx3`],[`x5`,`+- hc dx3 0`],[`y8`,`+- b 0 ah`],[`y2`,`+- vc 0 dy1`],[`y7`,`+- vc dy1 0`],[`y3`,`+- vc 0 dx2`],[`y6`,`+- vc dx2 0`],[`y4`,`+- vc 0 dx3`],[`y5`,`+- vc dx3 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`ah`,`y3`],[`l`,`ah`,`y4`],[`l`,`x2`,`y4`],[`l`,`x2`,`y2`],[`l`,`x4`,`y2`],[`l`,`x4`,`ah`],[`l`,`x3`,`ah`],[`l`,`hc`,`t`],[`l`,`x6`,`ah`],[`l`,`x5`,`ah`],[`l`,`x5`,`y2`],[`l`,`x7`,`y2`],[`l`,`x7`,`y4`],[`l`,`x8`,`y4`],[`l`,`x8`,`y3`],[`l`,`r`,`vc`],[`l`,`x8`,`y6`],[`l`,`x8`,`y5`],[`l`,`x7`,`y5`],[`l`,`x7`,`y7`],[`l`,`x5`,`y7`],[`l`,`x5`,`y8`],[`l`,`x6`,`y8`],[`l`,`hc`,`b`],[`l`,`x3`,`y8`],[`l`,`x4`,`y8`],[`l`,`x4`,`y7`],[`l`,`x2`,`y7`],[`l`,`x2`,`y5`],[`l`,`ah`,`y5`],[`l`,`ah`,`y6`],[`c`]]}]},ribbon:{adj:[[`adj1`,`val 16667`],[`adj2`,`val 50000`]],gd:[[`a1`,`pin 0 adj1 33333`],[`a2`,`pin 25000 adj2 75000`],[`x10`,`+- r 0 wd8`],[`dx2`,`*/ w a2 200000`],[`x2`,`+- hc 0 dx2`],[`x9`,`+- hc dx2 0`],[`x3`,`+- x2 wd32 0`],[`x8`,`+- x9 0 wd32`],[`x5`,`+- x2 wd8 0`],[`x6`,`+- x9 0 wd8`],[`x4`,`+- x5 0 wd32`],[`x7`,`+- x6 wd32 0`],[`y1`,`*/ h a1 200000`],[`y2`,`*/ h a1 100000`],[`y4`,`+- b 0 y2`],[`y3`,`*/ y4 1 2`],[`hR`,`*/ h a1 400000`],[`y5`,`+- b 0 hR`],[`y6`,`+- y2 0 hR`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`x4`,`t`],[`a`,`wd32`,`hR`,`3cd4`,`cd2`],[`l`,`x3`,`y1`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`x8`,`y2`],[`a`,`wd32`,`hR`,`cd4`,`-10800000`],[`l`,`x7`,`y1`],[`a`,`wd32`,`hR`,`cd4`,`cd2`],[`l`,`r`,`t`],[`l`,`x10`,`y3`],[`l`,`r`,`y4`],[`l`,`x9`,`y4`],[`l`,`x9`,`y5`],[`a`,`wd32`,`hR`,`0`,`cd4`],[`l`,`x3`,`b`],[`a`,`wd32`,`hR`,`cd4`,`cd4`],[`l`,`x2`,`y4`],[`l`,`l`,`y4`],[`l`,`wd8`,`y3`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x5`,`hR`],[`a`,`wd32`,`hR`,`0`,`cd4`],[`l`,`x3`,`y1`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`x5`,`y2`],[`c`],[`m`,`x6`,`hR`],[`a`,`wd32`,`hR`,`cd2`,`-5400000`],[`l`,`x8`,`y1`],[`a`,`wd32`,`hR`,`3cd4`,`cd2`],[`l`,`x6`,`y2`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`x4`,`t`],[`a`,`wd32`,`hR`,`3cd4`,`cd2`],[`l`,`x3`,`y1`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`x8`,`y2`],[`a`,`wd32`,`hR`,`cd4`,`-10800000`],[`l`,`x7`,`y1`],[`a`,`wd32`,`hR`,`cd4`,`cd2`],[`l`,`r`,`t`],[`l`,`x10`,`y3`],[`l`,`r`,`y4`],[`l`,`x9`,`y4`],[`l`,`x9`,`y5`],[`a`,`wd32`,`hR`,`0`,`cd4`],[`l`,`x3`,`b`],[`a`,`wd32`,`hR`,`cd4`,`cd4`],[`l`,`x2`,`y4`],[`l`,`l`,`y4`],[`l`,`wd8`,`y3`],[`c`],[`m`,`x5`,`hR`],[`l`,`x5`,`y2`],[`m`,`x6`,`y2`],[`l`,`x6`,`hR`],[`m`,`x2`,`y4`],[`l`,`x2`,`y6`],[`m`,`x9`,`y6`],[`l`,`x9`,`y4`]]}]},ribbon2:{adj:[[`adj1`,`val 16667`],[`adj2`,`val 50000`]],gd:[[`a1`,`pin 0 adj1 33333`],[`a2`,`pin 25000 adj2 75000`],[`x10`,`+- r 0 wd8`],[`dx2`,`*/ w a2 200000`],[`x2`,`+- hc 0 dx2`],[`x9`,`+- hc dx2 0`],[`x3`,`+- x2 wd32 0`],[`x8`,`+- x9 0 wd32`],[`x5`,`+- x2 wd8 0`],[`x6`,`+- x9 0 wd8`],[`x4`,`+- x5 0 wd32`],[`x7`,`+- x6 wd32 0`],[`dy1`,`*/ h a1 200000`],[`y1`,`+- b 0 dy1`],[`dy2`,`*/ h a1 100000`],[`y2`,`+- b 0 dy2`],[`y4`,`+- t dy2 0`],[`y3`,`+/ y4 b 2`],[`hR`,`*/ h a1 400000`],[`y6`,`+- b 0 hR`],[`y7`,`+- y1 0 hR`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`b`],[`l`,`x4`,`b`],[`a`,`wd32`,`hR`,`cd4`,`-10800000`],[`l`,`x3`,`y1`],[`a`,`wd32`,`hR`,`cd4`,`cd2`],[`l`,`x8`,`y2`],[`a`,`wd32`,`hR`,`3cd4`,`cd2`],[`l`,`x7`,`y1`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`r`,`b`],[`l`,`x10`,`y3`],[`l`,`r`,`y4`],[`l`,`x9`,`y4`],[`l`,`x9`,`hR`],[`a`,`wd32`,`hR`,`0`,`-5400000`],[`l`,`x3`,`t`],[`a`,`wd32`,`hR`,`3cd4`,`-5400000`],[`l`,`x2`,`y4`],[`l`,`l`,`y4`],[`l`,`wd8`,`y3`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x5`,`y6`],[`a`,`wd32`,`hR`,`0`,`-5400000`],[`l`,`x3`,`y1`],[`a`,`wd32`,`hR`,`cd4`,`cd2`],[`l`,`x5`,`y2`],[`c`],[`m`,`x6`,`y6`],[`a`,`wd32`,`hR`,`cd2`,`cd4`],[`l`,`x8`,`y1`],[`a`,`wd32`,`hR`,`cd4`,`-10800000`],[`l`,`x6`,`y2`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`b`],[`l`,`wd8`,`y3`],[`l`,`l`,`y4`],[`l`,`x2`,`y4`],[`l`,`x2`,`hR`],[`a`,`wd32`,`hR`,`cd2`,`cd4`],[`l`,`x8`,`t`],[`a`,`wd32`,`hR`,`3cd4`,`cd4`],[`l`,`x9`,`y4`],[`l`,`x9`,`y4`],[`l`,`r`,`y4`],[`l`,`x10`,`y3`],[`l`,`r`,`b`],[`l`,`x7`,`b`],[`a`,`wd32`,`hR`,`cd4`,`cd2`],[`l`,`x8`,`y1`],[`a`,`wd32`,`hR`,`cd4`,`-10800000`],[`l`,`x3`,`y2`],[`a`,`wd32`,`hR`,`3cd4`,`-10800000`],[`l`,`x4`,`y1`],[`a`,`wd32`,`hR`,`3cd4`,`cd2`],[`c`],[`m`,`x5`,`y2`],[`l`,`x5`,`y6`],[`m`,`x6`,`y6`],[`l`,`x6`,`y2`],[`m`,`x2`,`y7`],[`l`,`x2`,`y4`],[`m`,`x9`,`y4`],[`l`,`x9`,`y7`]]}]},rightarrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 100000 w ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`dx1`,`*/ ss a2 100000`],[`x1`,`+- r 0 dx1`],[`dy1`,`*/ h a1 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc dy1 0`],[`dx2`,`*/ y1 dx1 hd2`],[`x2`,`+- x1 dx2 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y1`],[`l`,`x1`,`y1`],[`l`,`x1`,`t`],[`l`,`r`,`vc`],[`l`,`x1`,`b`],[`l`,`x1`,`y2`],[`l`,`l`,`y2`],[`c`]]}]},rightarrowcallout:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 64977`]],gd:[[`maxAdj2`,`*/ 50000 h ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`*/ 100000 w ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`q2`,`*/ a3 ss w`],[`maxAdj4`,`+- 100000 0 q2`],[`a4`,`pin 0 adj4 maxAdj4`],[`dy1`,`*/ ss a2 100000`],[`dy2`,`*/ ss a1 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`],[`y4`,`+- vc dy1 0`],[`dx3`,`*/ ss a3 100000`],[`x3`,`+- r 0 dx3`],[`x2`,`*/ w a4 100000`],[`x1`,`*/ x2 1 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x2`,`t`],[`l`,`x2`,`y2`],[`l`,`x3`,`y2`],[`l`,`x3`,`y1`],[`l`,`r`,`vc`],[`l`,`x3`,`y4`],[`l`,`x3`,`y3`],[`l`,`x2`,`y3`],[`l`,`x2`,`b`],[`l`,`l`,`b`],[`c`]]}]},rightbrace:{adj:[[`adj1`,`val 8333`],[`adj2`,`val 50000`]],gd:[[`a2`,`pin 0 adj2 100000`],[`q1`,`+- 100000 0 a2`],[`q2`,`min q1 a2`],[`q3`,`*/ q2 1 2`],[`maxAdj1`,`*/ q3 h ss`],[`a1`,`pin 0 adj1 maxAdj1`],[`y1`,`*/ ss a1 100000`],[`y3`,`*/ h a2 100000`],[`y2`,`+- y3 0 y1`],[`y4`,`+- b 0 y1`],[`dx1`,`cos wd2 2700000`],[`dy1`,`sin y1 2700000`],[`ir`,`+- l dx1 0`],[`it`,`+- y1 0 dy1`],[`ib`,`+- b dy1 y1`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`a`,`wd2`,`y1`,`3cd4`,`cd4`],[`l`,`hc`,`y2`],[`a`,`wd2`,`y1`,`cd2`,`-5400000`],[`a`,`wd2`,`y1`,`3cd4`,`-5400000`],[`l`,`hc`,`y4`],[`a`,`wd2`,`y1`,`0`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`a`,`wd2`,`y1`,`3cd4`,`cd4`],[`l`,`hc`,`y2`],[`a`,`wd2`,`y1`,`cd2`,`-5400000`],[`a`,`wd2`,`y1`,`3cd4`,`-5400000`],[`l`,`hc`,`y4`],[`a`,`wd2`,`y1`,`0`,`cd4`]]}]},rightbracket:{adj:[[`adj`,`val 8333`]],gd:[[`maxAdj`,`*/ 50000 h ss`],[`a`,`pin 0 adj maxAdj`],[`y1`,`*/ ss a 100000`],[`y2`,`+- b 0 y1`],[`dx1`,`cos w 2700000`],[`dy1`,`sin y1 2700000`],[`ir`,`+- l dx1 0`],[`it`,`+- y1 0 dy1`],[`ib`,`+- b dy1 y1`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`a`,`w`,`y1`,`3cd4`,`cd4`],[`l`,`r`,`y2`],[`a`,`w`,`y1`,`0`,`cd4`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`a`,`w`,`y1`,`3cd4`,`cd4`],[`l`,`r`,`y2`],[`a`,`w`,`y1`,`0`,`cd4`]]}]},round1rect:{adj:[[`adj`,`val 16667`]],gd:[[`a`,`pin 0 adj 50000`],[`dx1`,`*/ ss a 100000`],[`x1`,`+- r 0 dx1`],[`idx`,`*/ dx1 29289 100000`],[`ir`,`+- r 0 idx`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`a`,`dx1`,`dx1`,`3cd4`,`cd4`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},round2diagrect:{adj:[[`adj1`,`val 16667`],[`adj2`,`val 0`]],gd:[[`a1`,`pin 0 adj1 50000`],[`a2`,`pin 0 adj2 50000`],[`x1`,`*/ ss a1 100000`],[`y1`,`+- b 0 x1`],[`a`,`*/ ss a2 100000`],[`x2`,`+- r 0 a`],[`y2`,`+- b 0 a`],[`dx1`,`*/ x1 29289 100000`],[`dx2`,`*/ a 29289 100000`],[`d`,`+- dx1 0 dx2`],[`dx`,`?: d dx1 dx2`],[`ir`,`+- r 0 dx`],[`ib`,`+- b 0 dx`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`t`],[`l`,`x2`,`t`],[`a`,`a`,`a`,`3cd4`,`cd4`],[`l`,`r`,`y1`],[`a`,`x1`,`x1`,`0`,`cd4`],[`l`,`a`,`b`],[`a`,`a`,`a`,`cd4`,`cd4`],[`l`,`l`,`x1`],[`a`,`x1`,`x1`,`cd2`,`cd4`],[`c`]]}]},round2samerect:{adj:[[`adj1`,`val 16667`],[`adj2`,`val 0`]],gd:[[`a1`,`pin 0 adj1 50000`],[`a2`,`pin 0 adj2 50000`],[`tx1`,`*/ ss a1 100000`],[`tx2`,`+- r 0 tx1`],[`bx1`,`*/ ss a2 100000`],[`bx2`,`+- r 0 bx1`],[`by1`,`+- b 0 bx1`],[`d`,`+- tx1 0 bx1`],[`tdx`,`*/ tx1 29289 100000`],[`bdx`,`*/ bx1 29289 100000`],[`il`,`?: d tdx bdx`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 bdx`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`tx1`,`t`],[`l`,`tx2`,`t`],[`a`,`tx1`,`tx1`,`3cd4`,`cd4`],[`l`,`r`,`by1`],[`a`,`bx1`,`bx1`,`0`,`cd4`],[`l`,`bx1`,`b`],[`a`,`bx1`,`bx1`,`cd4`,`cd4`],[`l`,`l`,`tx1`],[`a`,`tx1`,`tx1`,`cd2`,`cd4`],[`c`]]}]},roundrect:{adj:[[`adj`,`val 16667`]],gd:[[`a`,`pin 0 adj 50000`],[`x1`,`*/ ss a 100000`],[`x2`,`+- r 0 x1`],[`y2`,`+- b 0 x1`],[`il`,`*/ x1 29289 100000`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`x1`],[`a`,`x1`,`x1`,`cd2`,`cd4`],[`l`,`x2`,`t`],[`a`,`x1`,`x1`,`3cd4`,`cd4`],[`l`,`r`,`y2`],[`a`,`x1`,`x1`,`0`,`cd4`],[`l`,`x1`,`b`],[`a`,`x1`,`x1`,`cd4`,`cd4`],[`c`]]}]},rttriangle:{adj:[],gd:[[`it`,`*/ h 7 12`],[`ir`,`*/ w 7 12`],[`ib`,`*/ h 11 12`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`l`,`t`],[`l`,`r`,`b`],[`c`]]}]},smileyface:{adj:[[`adj`,`val 4653`]],gd:[[`a`,`pin -4653 adj 4653`],[`x1`,`*/ w 4969 21699`],[`x2`,`*/ w 6215 21600`],[`x3`,`*/ w 13135 21600`],[`x4`,`*/ w 16640 21600`],[`y1`,`*/ h 7570 21600`],[`y3`,`*/ h 16515 21600`],[`dy2`,`*/ h a 100000`],[`y2`,`+- y3 0 dy2`],[`y4`,`+- y3 dy2 0`],[`dy3`,`*/ h a 50000`],[`y5`,`+- y4 dy3 0`],[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`],[`wR`,`*/ w 1125 21600`],[`hR`,`*/ h 1125 21600`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`21600000`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x2`,`y1`],[`a`,`wR`,`hR`,`cd2`,`21600000`],[`m`,`x3`,`y1`],[`a`,`wR`,`hR`,`cd2`,`21600000`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`x1`,`y2`],[`Q`,`hc`,`y5`,`x4`,`y2`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`21600000`],[`c`]]}]},snip1rect:{adj:[[`adj`,`val 16667`]],gd:[[`a`,`pin 0 adj 50000`],[`dx1`,`*/ ss a 100000`],[`x1`,`+- r 0 dx1`],[`it`,`*/ dx1 1 2`],[`ir`,`+/ x1 r 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`l`,`r`,`dx1`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},snip2diagrect:{adj:[[`adj1`,`val 0`],[`adj2`,`val 16667`]],gd:[[`a1`,`pin 0 adj1 50000`],[`a2`,`pin 0 adj2 50000`],[`lx1`,`*/ ss a1 100000`],[`lx2`,`+- r 0 lx1`],[`ly1`,`+- b 0 lx1`],[`rx1`,`*/ ss a2 100000`],[`rx2`,`+- r 0 rx1`],[`ry1`,`+- b 0 rx1`],[`d`,`+- lx1 0 rx1`],[`dx`,`?: d lx1 rx1`],[`il`,`*/ dx 1 2`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`lx1`,`t`],[`l`,`rx2`,`t`],[`l`,`r`,`rx1`],[`l`,`r`,`ly1`],[`l`,`lx2`,`b`],[`l`,`rx1`,`b`],[`l`,`l`,`ry1`],[`l`,`l`,`lx1`],[`c`]]}]},snip2samerect:{adj:[[`adj1`,`val 16667`],[`adj2`,`val 0`]],gd:[[`a1`,`pin 0 adj1 50000`],[`a2`,`pin 0 adj2 50000`],[`tx1`,`*/ ss a1 100000`],[`tx2`,`+- r 0 tx1`],[`bx1`,`*/ ss a2 100000`],[`bx2`,`+- r 0 bx1`],[`by1`,`+- b 0 bx1`],[`d`,`+- tx1 0 bx1`],[`dx`,`?: d tx1 bx1`],[`il`,`*/ dx 1 2`],[`ir`,`+- r 0 il`],[`it`,`*/ tx1 1 2`],[`ib`,`+/ by1 b 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`tx1`,`t`],[`l`,`tx2`,`t`],[`l`,`r`,`tx1`],[`l`,`r`,`by1`],[`l`,`bx2`,`b`],[`l`,`bx1`,`b`],[`l`,`l`,`by1`],[`l`,`l`,`tx1`],[`c`]]}]},sniproundrect:{adj:[[`adj1`,`val 16667`],[`adj2`,`val 16667`]],gd:[[`a1`,`pin 0 adj1 50000`],[`a2`,`pin 0 adj2 50000`],[`x1`,`*/ ss a1 100000`],[`dx2`,`*/ ss a2 100000`],[`x2`,`+- r 0 dx2`],[`il`,`*/ x1 29289 100000`],[`ir`,`+/ x2 r 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`t`],[`l`,`x2`,`t`],[`l`,`r`,`dx2`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`l`,`l`,`x1`],[`a`,`x1`,`x1`,`cd2`,`cd4`],[`c`]]}]},squaretabs:{adj:[],gd:[[`md`,`mod w h 0`],[`dx`,`*/ 1 md 20`],[`y1`,`+- 0 b dx`],[`x1`,`+- 0 r dx`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`dx`,`t`],[`l`,`dx`,`dx`],[`l`,`l`,`dx`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y1`],[`l`,`dx`,`y1`],[`l`,`dx`,`b`],[`l`,`l`,`b`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`t`],[`l`,`r`,`t`],[`l`,`r`,`dx`],[`l`,`x1`,`dx`],[`c`]]},{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`l`,`r`,`y1`],[`l`,`r`,`b`],[`l`,`x1`,`b`],[`c`]]}]},star10:{adj:[[`adj`,`val 42533`],[`hf`,`val 105146`]],gd:[[`a`,`pin 0 adj 50000`],[`swd2`,`*/ wd2 hf 100000`],[`dx1`,`*/ swd2 95106 100000`],[`dx2`,`*/ swd2 58779 100000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`dy1`,`*/ hd2 80902 100000`],[`dy2`,`*/ hd2 30902 100000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`],[`y4`,`+- vc dy1 0`],[`iwd2`,`*/ swd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx1`,`*/ iwd2 80902 100000`],[`sdx2`,`*/ iwd2 30902 100000`],[`sdy1`,`*/ ihd2 95106 100000`],[`sdy2`,`*/ ihd2 58779 100000`],[`sx1`,`+- hc 0 iwd2`],[`sx2`,`+- hc 0 sdx1`],[`sx3`,`+- hc 0 sdx2`],[`sx4`,`+- hc sdx2 0`],[`sx5`,`+- hc sdx1 0`],[`sx6`,`+- hc iwd2 0`],[`sy1`,`+- vc 0 sdy1`],[`sy2`,`+- vc 0 sdy2`],[`sy3`,`+- vc sdy2 0`],[`sy4`,`+- vc sdy1 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y2`],[`l`,`sx2`,`sy2`],[`l`,`x2`,`y1`],[`l`,`sx3`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx4`,`sy1`],[`l`,`x3`,`y1`],[`l`,`sx5`,`sy2`],[`l`,`x4`,`y2`],[`l`,`sx6`,`vc`],[`l`,`x4`,`y3`],[`l`,`sx5`,`sy3`],[`l`,`x3`,`y4`],[`l`,`sx4`,`sy4`],[`l`,`hc`,`b`],[`l`,`sx3`,`sy4`],[`l`,`x2`,`y4`],[`l`,`sx2`,`sy3`],[`l`,`x1`,`y3`],[`l`,`sx1`,`vc`],[`c`]]}]},star12:{adj:[[`adj`,`val 37500`]],gd:[[`a`,`pin 0 adj 50000`],[`dx1`,`cos wd2 1800000`],[`dy1`,`sin hd2 3600000`],[`x1`,`+- hc 0 dx1`],[`x3`,`*/ w 3 4`],[`x4`,`+- hc dx1 0`],[`y1`,`+- vc 0 dy1`],[`y3`,`*/ h 3 4`],[`y4`,`+- vc dy1 0`],[`iwd2`,`*/ wd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx1`,`cos iwd2 900000`],[`sdx2`,`cos iwd2 2700000`],[`sdx3`,`cos iwd2 4500000`],[`sdy1`,`sin ihd2 4500000`],[`sdy2`,`sin ihd2 2700000`],[`sdy3`,`sin ihd2 900000`],[`sx1`,`+- hc 0 sdx1`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc 0 sdx3`],[`sx4`,`+- hc sdx3 0`],[`sx5`,`+- hc sdx2 0`],[`sx6`,`+- hc sdx1 0`],[`sy1`,`+- vc 0 sdy1`],[`sy2`,`+- vc 0 sdy2`],[`sy3`,`+- vc 0 sdy3`],[`sy4`,`+- vc sdy3 0`],[`sy5`,`+- vc sdy2 0`],[`sy6`,`+- vc sdy1 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`sx1`,`sy3`],[`l`,`x1`,`hd4`],[`l`,`sx2`,`sy2`],[`l`,`wd4`,`y1`],[`l`,`sx3`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx4`,`sy1`],[`l`,`x3`,`y1`],[`l`,`sx5`,`sy2`],[`l`,`x4`,`hd4`],[`l`,`sx6`,`sy3`],[`l`,`r`,`vc`],[`l`,`sx6`,`sy4`],[`l`,`x4`,`y3`],[`l`,`sx5`,`sy5`],[`l`,`x3`,`y4`],[`l`,`sx4`,`sy6`],[`l`,`hc`,`b`],[`l`,`sx3`,`sy6`],[`l`,`wd4`,`y4`],[`l`,`sx2`,`sy5`],[`l`,`x1`,`y3`],[`l`,`sx1`,`sy4`],[`c`]]}]},star16:{adj:[[`adj`,`val 37500`]],gd:[[`a`,`pin 0 adj 50000`],[`dx1`,`*/ wd2 92388 100000`],[`dx2`,`*/ wd2 70711 100000`],[`dx3`,`*/ wd2 38268 100000`],[`dy1`,`*/ hd2 92388 100000`],[`dy2`,`*/ hd2 70711 100000`],[`dy3`,`*/ hd2 38268 100000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc 0 dx3`],[`x4`,`+- hc dx3 0`],[`x5`,`+- hc dx2 0`],[`x6`,`+- hc dx1 0`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc 0 dy3`],[`y4`,`+- vc dy3 0`],[`y5`,`+- vc dy2 0`],[`y6`,`+- vc dy1 0`],[`iwd2`,`*/ wd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx1`,`*/ iwd2 98079 100000`],[`sdx2`,`*/ iwd2 83147 100000`],[`sdx3`,`*/ iwd2 55557 100000`],[`sdx4`,`*/ iwd2 19509 100000`],[`sdy1`,`*/ ihd2 98079 100000`],[`sdy2`,`*/ ihd2 83147 100000`],[`sdy3`,`*/ ihd2 55557 100000`],[`sdy4`,`*/ ihd2 19509 100000`],[`sx1`,`+- hc 0 sdx1`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc 0 sdx3`],[`sx4`,`+- hc 0 sdx4`],[`sx5`,`+- hc sdx4 0`],[`sx6`,`+- hc sdx3 0`],[`sx7`,`+- hc sdx2 0`],[`sx8`,`+- hc sdx1 0`],[`sy1`,`+- vc 0 sdy1`],[`sy2`,`+- vc 0 sdy2`],[`sy3`,`+- vc 0 sdy3`],[`sy4`,`+- vc 0 sdy4`],[`sy5`,`+- vc sdy4 0`],[`sy6`,`+- vc sdy3 0`],[`sy7`,`+- vc sdy2 0`],[`sy8`,`+- vc sdy1 0`],[`idx`,`cos iwd2 2700000`],[`idy`,`sin ihd2 2700000`],[`il`,`+- hc 0 idx`],[`it`,`+- vc 0 idy`],[`ir`,`+- hc idx 0`],[`ib`,`+- vc idy 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`sx1`,`sy4`],[`l`,`x1`,`y3`],[`l`,`sx2`,`sy3`],[`l`,`x2`,`y2`],[`l`,`sx3`,`sy2`],[`l`,`x3`,`y1`],[`l`,`sx4`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx5`,`sy1`],[`l`,`x4`,`y1`],[`l`,`sx6`,`sy2`],[`l`,`x5`,`y2`],[`l`,`sx7`,`sy3`],[`l`,`x6`,`y3`],[`l`,`sx8`,`sy4`],[`l`,`r`,`vc`],[`l`,`sx8`,`sy5`],[`l`,`x6`,`y4`],[`l`,`sx7`,`sy6`],[`l`,`x5`,`y5`],[`l`,`sx6`,`sy7`],[`l`,`x4`,`y6`],[`l`,`sx5`,`sy8`],[`l`,`hc`,`b`],[`l`,`sx4`,`sy8`],[`l`,`x3`,`y6`],[`l`,`sx3`,`sy7`],[`l`,`x2`,`y5`],[`l`,`sx2`,`sy6`],[`l`,`x1`,`y4`],[`l`,`sx1`,`sy5`],[`c`]]}]},star24:{adj:[[`adj`,`val 37500`]],gd:[[`a`,`pin 0 adj 50000`],[`dx1`,`cos wd2 900000`],[`dx2`,`cos wd2 1800000`],[`dx3`,`cos wd2 2700000`],[`dx4`,`val wd4`],[`dx5`,`cos wd2 4500000`],[`dy1`,`sin hd2 4500000`],[`dy2`,`sin hd2 3600000`],[`dy3`,`sin hd2 2700000`],[`dy4`,`val hd4`],[`dy5`,`sin hd2 900000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc 0 dx3`],[`x4`,`+- hc 0 dx4`],[`x5`,`+- hc 0 dx5`],[`x6`,`+- hc dx5 0`],[`x7`,`+- hc dx4 0`],[`x8`,`+- hc dx3 0`],[`x9`,`+- hc dx2 0`],[`x10`,`+- hc dx1 0`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc 0 dy3`],[`y4`,`+- vc 0 dy4`],[`y5`,`+- vc 0 dy5`],[`y6`,`+- vc dy5 0`],[`y7`,`+- vc dy4 0`],[`y8`,`+- vc dy3 0`],[`y9`,`+- vc dy2 0`],[`y10`,`+- vc dy1 0`],[`iwd2`,`*/ wd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx1`,`*/ iwd2 99144 100000`],[`sdx2`,`*/ iwd2 92388 100000`],[`sdx3`,`*/ iwd2 79335 100000`],[`sdx4`,`*/ iwd2 60876 100000`],[`sdx5`,`*/ iwd2 38268 100000`],[`sdx6`,`*/ iwd2 13053 100000`],[`sdy1`,`*/ ihd2 99144 100000`],[`sdy2`,`*/ ihd2 92388 100000`],[`sdy3`,`*/ ihd2 79335 100000`],[`sdy4`,`*/ ihd2 60876 100000`],[`sdy5`,`*/ ihd2 38268 100000`],[`sdy6`,`*/ ihd2 13053 100000`],[`sx1`,`+- hc 0 sdx1`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc 0 sdx3`],[`sx4`,`+- hc 0 sdx4`],[`sx5`,`+- hc 0 sdx5`],[`sx6`,`+- hc 0 sdx6`],[`sx7`,`+- hc sdx6 0`],[`sx8`,`+- hc sdx5 0`],[`sx9`,`+- hc sdx4 0`],[`sx10`,`+- hc sdx3 0`],[`sx11`,`+- hc sdx2 0`],[`sx12`,`+- hc sdx1 0`],[`sy1`,`+- vc 0 sdy1`],[`sy2`,`+- vc 0 sdy2`],[`sy3`,`+- vc 0 sdy3`],[`sy4`,`+- vc 0 sdy4`],[`sy5`,`+- vc 0 sdy5`],[`sy6`,`+- vc 0 sdy6`],[`sy7`,`+- vc sdy6 0`],[`sy8`,`+- vc sdy5 0`],[`sy9`,`+- vc sdy4 0`],[`sy10`,`+- vc sdy3 0`],[`sy11`,`+- vc sdy2 0`],[`sy12`,`+- vc sdy1 0`],[`idx`,`cos iwd2 2700000`],[`idy`,`sin ihd2 2700000`],[`il`,`+- hc 0 idx`],[`it`,`+- vc 0 idy`],[`ir`,`+- hc idx 0`],[`ib`,`+- vc idy 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`sx1`,`sy6`],[`l`,`x1`,`y5`],[`l`,`sx2`,`sy5`],[`l`,`x2`,`y4`],[`l`,`sx3`,`sy4`],[`l`,`x3`,`y3`],[`l`,`sx4`,`sy3`],[`l`,`x4`,`y2`],[`l`,`sx5`,`sy2`],[`l`,`x5`,`y1`],[`l`,`sx6`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx7`,`sy1`],[`l`,`x6`,`y1`],[`l`,`sx8`,`sy2`],[`l`,`x7`,`y2`],[`l`,`sx9`,`sy3`],[`l`,`x8`,`y3`],[`l`,`sx10`,`sy4`],[`l`,`x9`,`y4`],[`l`,`sx11`,`sy5`],[`l`,`x10`,`y5`],[`l`,`sx12`,`sy6`],[`l`,`r`,`vc`],[`l`,`sx12`,`sy7`],[`l`,`x10`,`y6`],[`l`,`sx11`,`sy8`],[`l`,`x9`,`y7`],[`l`,`sx10`,`sy9`],[`l`,`x8`,`y8`],[`l`,`sx9`,`sy10`],[`l`,`x7`,`y9`],[`l`,`sx8`,`sy11`],[`l`,`x6`,`y10`],[`l`,`sx7`,`sy12`],[`l`,`hc`,`b`],[`l`,`sx6`,`sy12`],[`l`,`x5`,`y10`],[`l`,`sx5`,`sy11`],[`l`,`x4`,`y9`],[`l`,`sx4`,`sy10`],[`l`,`x3`,`y8`],[`l`,`sx3`,`sy9`],[`l`,`x2`,`y7`],[`l`,`sx2`,`sy8`],[`l`,`x1`,`y6`],[`l`,`sx1`,`sy7`],[`c`]]}]},star32:{adj:[[`adj`,`val 37500`]],gd:[[`a`,`pin 0 adj 50000`],[`dx1`,`*/ wd2 98079 100000`],[`dx2`,`*/ wd2 92388 100000`],[`dx3`,`*/ wd2 83147 100000`],[`dx4`,`cos wd2 2700000`],[`dx5`,`*/ wd2 55557 100000`],[`dx6`,`*/ wd2 38268 100000`],[`dx7`,`*/ wd2 19509 100000`],[`dy1`,`*/ hd2 98079 100000`],[`dy2`,`*/ hd2 92388 100000`],[`dy3`,`*/ hd2 83147 100000`],[`dy4`,`sin hd2 2700000`],[`dy5`,`*/ hd2 55557 100000`],[`dy6`,`*/ hd2 38268 100000`],[`dy7`,`*/ hd2 19509 100000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc 0 dx3`],[`x4`,`+- hc 0 dx4`],[`x5`,`+- hc 0 dx5`],[`x6`,`+- hc 0 dx6`],[`x7`,`+- hc 0 dx7`],[`x8`,`+- hc dx7 0`],[`x9`,`+- hc dx6 0`],[`x10`,`+- hc dx5 0`],[`x11`,`+- hc dx4 0`],[`x12`,`+- hc dx3 0`],[`x13`,`+- hc dx2 0`],[`x14`,`+- hc dx1 0`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc 0 dy3`],[`y4`,`+- vc 0 dy4`],[`y5`,`+- vc 0 dy5`],[`y6`,`+- vc 0 dy6`],[`y7`,`+- vc 0 dy7`],[`y8`,`+- vc dy7 0`],[`y9`,`+- vc dy6 0`],[`y10`,`+- vc dy5 0`],[`y11`,`+- vc dy4 0`],[`y12`,`+- vc dy3 0`],[`y13`,`+- vc dy2 0`],[`y14`,`+- vc dy1 0`],[`iwd2`,`*/ wd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx1`,`*/ iwd2 99518 100000`],[`sdx2`,`*/ iwd2 95694 100000`],[`sdx3`,`*/ iwd2 88192 100000`],[`sdx4`,`*/ iwd2 77301 100000`],[`sdx5`,`*/ iwd2 63439 100000`],[`sdx6`,`*/ iwd2 47140 100000`],[`sdx7`,`*/ iwd2 29028 100000`],[`sdx8`,`*/ iwd2 9802 100000`],[`sdy1`,`*/ ihd2 99518 100000`],[`sdy2`,`*/ ihd2 95694 100000`],[`sdy3`,`*/ ihd2 88192 100000`],[`sdy4`,`*/ ihd2 77301 100000`],[`sdy5`,`*/ ihd2 63439 100000`],[`sdy6`,`*/ ihd2 47140 100000`],[`sdy7`,`*/ ihd2 29028 100000`],[`sdy8`,`*/ ihd2 9802 100000`],[`sx1`,`+- hc 0 sdx1`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc 0 sdx3`],[`sx4`,`+- hc 0 sdx4`],[`sx5`,`+- hc 0 sdx5`],[`sx6`,`+- hc 0 sdx6`],[`sx7`,`+- hc 0 sdx7`],[`sx8`,`+- hc 0 sdx8`],[`sx9`,`+- hc sdx8 0`],[`sx10`,`+- hc sdx7 0`],[`sx11`,`+- hc sdx6 0`],[`sx12`,`+- hc sdx5 0`],[`sx13`,`+- hc sdx4 0`],[`sx14`,`+- hc sdx3 0`],[`sx15`,`+- hc sdx2 0`],[`sx16`,`+- hc sdx1 0`],[`sy1`,`+- vc 0 sdy1`],[`sy2`,`+- vc 0 sdy2`],[`sy3`,`+- vc 0 sdy3`],[`sy4`,`+- vc 0 sdy4`],[`sy5`,`+- vc 0 sdy5`],[`sy6`,`+- vc 0 sdy6`],[`sy7`,`+- vc 0 sdy7`],[`sy8`,`+- vc 0 sdy8`],[`sy9`,`+- vc sdy8 0`],[`sy10`,`+- vc sdy7 0`],[`sy11`,`+- vc sdy6 0`],[`sy12`,`+- vc sdy5 0`],[`sy13`,`+- vc sdy4 0`],[`sy14`,`+- vc sdy3 0`],[`sy15`,`+- vc sdy2 0`],[`sy16`,`+- vc sdy1 0`],[`idx`,`cos iwd2 2700000`],[`idy`,`sin ihd2 2700000`],[`il`,`+- hc 0 idx`],[`it`,`+- vc 0 idy`],[`ir`,`+- hc idx 0`],[`ib`,`+- vc idy 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`sx1`,`sy8`],[`l`,`x1`,`y7`],[`l`,`sx2`,`sy7`],[`l`,`x2`,`y6`],[`l`,`sx3`,`sy6`],[`l`,`x3`,`y5`],[`l`,`sx4`,`sy5`],[`l`,`x4`,`y4`],[`l`,`sx5`,`sy4`],[`l`,`x5`,`y3`],[`l`,`sx6`,`sy3`],[`l`,`x6`,`y2`],[`l`,`sx7`,`sy2`],[`l`,`x7`,`y1`],[`l`,`sx8`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx9`,`sy1`],[`l`,`x8`,`y1`],[`l`,`sx10`,`sy2`],[`l`,`x9`,`y2`],[`l`,`sx11`,`sy3`],[`l`,`x10`,`y3`],[`l`,`sx12`,`sy4`],[`l`,`x11`,`y4`],[`l`,`sx13`,`sy5`],[`l`,`x12`,`y5`],[`l`,`sx14`,`sy6`],[`l`,`x13`,`y6`],[`l`,`sx15`,`sy7`],[`l`,`x14`,`y7`],[`l`,`sx16`,`sy8`],[`l`,`r`,`vc`],[`l`,`sx16`,`sy9`],[`l`,`x14`,`y8`],[`l`,`sx15`,`sy10`],[`l`,`x13`,`y9`],[`l`,`sx14`,`sy11`],[`l`,`x12`,`y10`],[`l`,`sx13`,`sy12`],[`l`,`x11`,`y11`],[`l`,`sx12`,`sy13`],[`l`,`x10`,`y12`],[`l`,`sx11`,`sy14`],[`l`,`x9`,`y13`],[`l`,`sx10`,`sy15`],[`l`,`x8`,`y14`],[`l`,`sx9`,`sy16`],[`l`,`hc`,`b`],[`l`,`sx8`,`sy16`],[`l`,`x7`,`y14`],[`l`,`sx7`,`sy15`],[`l`,`x6`,`y13`],[`l`,`sx6`,`sy14`],[`l`,`x5`,`y12`],[`l`,`sx5`,`sy13`],[`l`,`x4`,`y11`],[`l`,`sx4`,`sy12`],[`l`,`x3`,`y10`],[`l`,`sx3`,`sy11`],[`l`,`x2`,`y9`],[`l`,`sx2`,`sy10`],[`l`,`x1`,`y8`],[`l`,`sx1`,`sy9`],[`c`]]}]},star4:{adj:[[`adj`,`val 12500`]],gd:[[`a`,`pin 0 adj 50000`],[`iwd2`,`*/ wd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx`,`cos iwd2 2700000`],[`sdy`,`sin ihd2 2700000`],[`sx1`,`+- hc 0 sdx`],[`sx2`,`+- hc sdx 0`],[`sy1`,`+- vc 0 sdy`],[`sy2`,`+- vc sdy 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`sx1`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx2`,`sy1`],[`l`,`r`,`vc`],[`l`,`sx2`,`sy2`],[`l`,`hc`,`b`],[`l`,`sx1`,`sy2`],[`c`]]}]},star5:{adj:[[`adj`,`val 19098`],[`hf`,`val 105146`],[`vf`,`val 110557`]],gd:[[`a`,`pin 0 adj 50000`],[`swd2`,`*/ wd2 hf 100000`],[`shd2`,`*/ hd2 vf 100000`],[`svc`,`*/ vc vf 100000`],[`dx1`,`cos swd2 1080000`],[`dx2`,`cos swd2 18360000`],[`dy1`,`sin shd2 1080000`],[`dy2`,`sin shd2 18360000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`y1`,`+- svc 0 dy1`],[`y2`,`+- svc 0 dy2`],[`iwd2`,`*/ swd2 a 50000`],[`ihd2`,`*/ shd2 a 50000`],[`sdx1`,`cos iwd2 20520000`],[`sdx2`,`cos iwd2 3240000`],[`sdy1`,`sin ihd2 3240000`],[`sdy2`,`sin ihd2 20520000`],[`sx1`,`+- hc 0 sdx1`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc sdx2 0`],[`sx4`,`+- hc sdx1 0`],[`sy1`,`+- svc 0 sdy1`],[`sy2`,`+- svc 0 sdy2`],[`sy3`,`+- svc ihd2 0`],[`yAdj`,`+- svc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y1`],[`l`,`sx2`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx3`,`sy1`],[`l`,`x4`,`y1`],[`l`,`sx4`,`sy2`],[`l`,`x3`,`y2`],[`l`,`hc`,`sy3`],[`l`,`x2`,`y2`],[`l`,`sx1`,`sy2`],[`c`]]}]},star6:{adj:[[`adj`,`val 28868`],[`hf`,`val 115470`]],gd:[[`a`,`pin 0 adj 50000`],[`swd2`,`*/ wd2 hf 100000`],[`dx1`,`cos swd2 1800000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc dx1 0`],[`y2`,`+- vc hd4 0`],[`iwd2`,`*/ swd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx2`,`*/ iwd2 1 2`],[`sx1`,`+- hc 0 iwd2`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc sdx2 0`],[`sx4`,`+- hc iwd2 0`],[`sdy1`,`sin ihd2 3600000`],[`sy1`,`+- vc 0 sdy1`],[`sy2`,`+- vc sdy1 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`hd4`],[`l`,`sx2`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx3`,`sy1`],[`l`,`x2`,`hd4`],[`l`,`sx4`,`vc`],[`l`,`x2`,`y2`],[`l`,`sx3`,`sy2`],[`l`,`hc`,`b`],[`l`,`sx2`,`sy2`],[`l`,`x1`,`y2`],[`l`,`sx1`,`vc`],[`c`]]}]},star7:{adj:[[`adj`,`val 34601`],[`hf`,`val 102572`],[`vf`,`val 105210`]],gd:[[`a`,`pin 0 adj 50000`],[`swd2`,`*/ wd2 hf 100000`],[`shd2`,`*/ hd2 vf 100000`],[`svc`,`*/ vc vf 100000`],[`dx1`,`*/ swd2 97493 100000`],[`dx2`,`*/ swd2 78183 100000`],[`dx3`,`*/ swd2 43388 100000`],[`dy1`,`*/ shd2 62349 100000`],[`dy2`,`*/ shd2 22252 100000`],[`dy3`,`*/ shd2 90097 100000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc 0 dx3`],[`x4`,`+- hc dx3 0`],[`x5`,`+- hc dx2 0`],[`x6`,`+- hc dx1 0`],[`y1`,`+- svc 0 dy1`],[`y2`,`+- svc dy2 0`],[`y3`,`+- svc dy3 0`],[`iwd2`,`*/ swd2 a 50000`],[`ihd2`,`*/ shd2 a 50000`],[`sdx1`,`*/ iwd2 97493 100000`],[`sdx2`,`*/ iwd2 78183 100000`],[`sdx3`,`*/ iwd2 43388 100000`],[`sx1`,`+- hc 0 sdx1`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc 0 sdx3`],[`sx4`,`+- hc sdx3 0`],[`sx5`,`+- hc sdx2 0`],[`sx6`,`+- hc sdx1 0`],[`sdy1`,`*/ ihd2 90097 100000`],[`sdy2`,`*/ ihd2 22252 100000`],[`sdy3`,`*/ ihd2 62349 100000`],[`sy1`,`+- svc 0 sdy1`],[`sy2`,`+- svc 0 sdy2`],[`sy3`,`+- svc sdy3 0`],[`sy4`,`+- svc ihd2 0`],[`yAdj`,`+- svc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x1`,`y2`],[`l`,`sx1`,`sy2`],[`l`,`x2`,`y1`],[`l`,`sx3`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx4`,`sy1`],[`l`,`x5`,`y1`],[`l`,`sx6`,`sy2`],[`l`,`x6`,`y2`],[`l`,`sx5`,`sy3`],[`l`,`x4`,`y3`],[`l`,`hc`,`sy4`],[`l`,`x3`,`y3`],[`l`,`sx2`,`sy3`],[`c`]]}]},star8:{adj:[[`adj`,`val 37500`]],gd:[[`a`,`pin 0 adj 50000`],[`dx1`,`cos wd2 2700000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc dx1 0`],[`dy1`,`sin hd2 2700000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc dy1 0`],[`iwd2`,`*/ wd2 a 50000`],[`ihd2`,`*/ hd2 a 50000`],[`sdx1`,`*/ iwd2 92388 100000`],[`sdx2`,`*/ iwd2 38268 100000`],[`sdy1`,`*/ ihd2 92388 100000`],[`sdy2`,`*/ ihd2 38268 100000`],[`sx1`,`+- hc 0 sdx1`],[`sx2`,`+- hc 0 sdx2`],[`sx3`,`+- hc sdx2 0`],[`sx4`,`+- hc sdx1 0`],[`sy1`,`+- vc 0 sdy1`],[`sy2`,`+- vc 0 sdy2`],[`sy3`,`+- vc sdy2 0`],[`sy4`,`+- vc sdy1 0`],[`yAdj`,`+- vc 0 ihd2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`l`,`sx1`,`sy2`],[`l`,`x1`,`y1`],[`l`,`sx2`,`sy1`],[`l`,`hc`,`t`],[`l`,`sx3`,`sy1`],[`l`,`x2`,`y1`],[`l`,`sx4`,`sy2`],[`l`,`r`,`vc`],[`l`,`sx4`,`sy3`],[`l`,`x2`,`y2`],[`l`,`sx3`,`sy4`],[`l`,`hc`,`b`],[`l`,`sx2`,`sy4`],[`l`,`x1`,`y2`],[`l`,`sx1`,`sy3`],[`c`]]}]},straightconnector1:{adj:[],gd:[],paths:[{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`r`,`b`]]}]},stripedrightarrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 84375 w ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`x4`,`*/ ss 5 32`],[`dx5`,`*/ ss a2 100000`],[`x5`,`+- r 0 dx5`],[`dy1`,`*/ h a1 200000`],[`y1`,`+- vc 0 dy1`],[`y2`,`+- vc dy1 0`],[`dx6`,`*/ dy1 dx5 hd2`],[`x6`,`+- r 0 dx6`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y1`],[`l`,`ssd32`,`y1`],[`l`,`ssd32`,`y2`],[`l`,`l`,`y2`],[`c`],[`m`,`ssd16`,`y1`],[`l`,`ssd8`,`y1`],[`l`,`ssd8`,`y2`],[`l`,`ssd16`,`y2`],[`c`],[`m`,`x4`,`y1`],[`l`,`x5`,`y1`],[`l`,`x5`,`t`],[`l`,`r`,`vc`],[`l`,`x5`,`b`],[`l`,`x5`,`y2`],[`l`,`x4`,`y2`],[`c`]]}]},sun:{adj:[[`adj`,`val 25000`]],gd:[[`a`,`pin 12500 adj 46875`],[`g0`,`+- 50000 0 a`],[`g1`,`*/ g0 30274 32768`],[`g2`,`*/ g0 12540 32768`],[`g3`,`+- g1 50000 0`],[`g4`,`+- g2 50000 0`],[`g5`,`+- 50000 0 g1`],[`g6`,`+- 50000 0 g2`],[`g7`,`*/ g0 23170 32768`],[`g8`,`+- 50000 g7 0`],[`g9`,`+- 50000 0 g7`],[`g10`,`*/ g5 3 4`],[`g11`,`*/ g6 3 4`],[`g12`,`+- g10 3662 0`],[`g13`,`+- g11 3662 0`],[`g14`,`+- g11 12500 0`],[`g15`,`+- 100000 0 g10`],[`g16`,`+- 100000 0 g12`],[`g17`,`+- 100000 0 g13`],[`g18`,`+- 100000 0 g14`],[`ox1`,`*/ w 18436 21600`],[`oy1`,`*/ h 3163 21600`],[`ox2`,`*/ w 3163 21600`],[`oy2`,`*/ h 18436 21600`],[`x8`,`*/ w g8 100000`],[`x9`,`*/ w g9 100000`],[`x10`,`*/ w g10 100000`],[`x12`,`*/ w g12 100000`],[`x13`,`*/ w g13 100000`],[`x14`,`*/ w g14 100000`],[`x15`,`*/ w g15 100000`],[`x16`,`*/ w g16 100000`],[`x17`,`*/ w g17 100000`],[`x18`,`*/ w g18 100000`],[`x19`,`*/ w a 100000`],[`wR`,`*/ w g0 100000`],[`hR`,`*/ h g0 100000`],[`y8`,`*/ h g8 100000`],[`y9`,`*/ h g9 100000`],[`y10`,`*/ h g10 100000`],[`y12`,`*/ h g12 100000`],[`y13`,`*/ h g13 100000`],[`y14`,`*/ h g14 100000`],[`y15`,`*/ h g15 100000`],[`y16`,`*/ h g16 100000`],[`y17`,`*/ h g17 100000`],[`y18`,`*/ h g18 100000`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`r`,`vc`],[`l`,`x15`,`y18`],[`l`,`x15`,`y14`],[`c`],[`m`,`ox1`,`oy1`],[`l`,`x16`,`y13`],[`l`,`x17`,`y12`],[`c`],[`m`,`hc`,`t`],[`l`,`x18`,`y10`],[`l`,`x14`,`y10`],[`c`],[`m`,`ox2`,`oy1`],[`l`,`x13`,`y12`],[`l`,`x12`,`y13`],[`c`],[`m`,`l`,`vc`],[`l`,`x10`,`y14`],[`l`,`x10`,`y18`],[`c`],[`m`,`ox2`,`oy2`],[`l`,`x12`,`y17`],[`l`,`x13`,`y16`],[`c`],[`m`,`hc`,`b`],[`l`,`x14`,`y15`],[`l`,`x18`,`y15`],[`c`],[`m`,`ox1`,`oy2`],[`l`,`x17`,`y16`],[`l`,`x16`,`y17`],[`c`],[`m`,`x19`,`vc`],[`a`,`wR`,`hR`,`cd2`,`21600000`],[`c`]]}]},swoosharrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 16667`]],gd:[[`a1`,`pin 1 adj1 75000`],[`maxAdj2`,`*/ 70000 w ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`ad1`,`*/ h a1 100000`],[`ad2`,`*/ ss a2 100000`],[`xB`,`+- r 0 ad2`],[`yB`,`+- t ssd8 0`],[`alfa`,`*/ cd4 1 14`],[`dx0`,`tan ssd8 alfa`],[`xC`,`+- xB 0 dx0`],[`dx1`,`tan ad1 alfa`],[`yF`,`+- yB ad1 0`],[`xF`,`+- xB dx1 0`],[`xE`,`+- xF dx0 0`],[`yE`,`+- yF ssd8 0`],[`dy2`,`+- yE 0 t`],[`dy22`,`*/ dy2 1 2`],[`dy3`,`*/ h 1 20`],[`yD`,`+- t dy22 dy3`],[`dy4`,`*/ hd6 1 1`],[`yP1`,`+- hd6 dy4 0`],[`xP1`,`val wd6`],[`dy5`,`*/ hd6 1 2`],[`yP2`,`+- yF dy5 0`],[`xP2`,`val wd4`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`Q`,`xP1`,`yP1`,`xB`,`yB`],[`l`,`xC`,`t`],[`l`,`r`,`yD`],[`l`,`xE`,`yE`],[`l`,`xF`,`yF`],[`Q`,`xP2`,`yP2`,`l`,`b`],[`c`]]}]},teardrop:{adj:[[`adj`,`val 100000`]],gd:[[`a`,`pin 0 adj 200000`],[`r2`,`sqrt 2`],[`tw`,`*/ wd2 r2 1`],[`th`,`*/ hd2 r2 1`],[`sw`,`*/ tw a 100000`],[`sh`,`*/ th a 100000`],[`dx1`,`cos sw 2700000`],[`dy1`,`sin sh 2700000`],[`x1`,`+- hc dx1 0`],[`y1`,`+- vc 0 dy1`],[`x2`,`+/ hc x1 2`],[`y2`,`+/ vc y1 2`],[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`vc`],[`a`,`wd2`,`hd2`,`cd2`,`cd4`],[`Q`,`x2`,`t`,`x1`,`y1`],[`Q`,`r`,`y2`,`r`,`vc`],[`a`,`wd2`,`hd2`,`0`,`cd4`],[`a`,`wd2`,`hd2`,`cd4`,`cd4`],[`c`]]}]},trapezoid:{adj:[[`adj`,`val 25000`]],gd:[[`maxAdj`,`*/ 50000 w ss`],[`a`,`pin 0 adj maxAdj`],[`x1`,`*/ ss a 200000`],[`x2`,`*/ ss a 100000`],[`x3`,`+- r 0 x2`],[`x4`,`+- r 0 x1`],[`il`,`*/ wd3 a maxAdj`],[`it`,`*/ hd3 a maxAdj`],[`ir`,`+- r 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`x2`,`t`],[`l`,`x3`,`t`],[`l`,`r`,`b`],[`c`]]}]},triangle:{adj:[[`adj`,`val 50000`]],gd:[[`a`,`pin 0 adj 100000`],[`x1`,`*/ w a 200000`],[`x2`,`*/ w a 100000`],[`x3`,`+- x1 wd2 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`x2`,`t`],[`l`,`r`,`b`],[`c`]]}]},uparrowcallout:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 64977`]],gd:[[`maxAdj2`,`*/ 50000 w ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`*/ 100000 h ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`q2`,`*/ a3 ss h`],[`maxAdj4`,`+- 100000 0 q2`],[`a4`,`pin 0 adj4 maxAdj4`],[`dx1`,`*/ ss a2 100000`],[`dx2`,`*/ ss a1 200000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`y1`,`*/ ss a3 100000`],[`dy2`,`*/ h a4 100000`],[`y2`,`+- b 0 dy2`],[`y3`,`+/ y2 b 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`y1`],[`l`,`x1`,`y1`],[`l`,`hc`,`t`],[`l`,`x4`,`y1`],[`l`,`x3`,`y1`],[`l`,`x3`,`y2`],[`l`,`r`,`y2`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]},updownarrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 50000 h ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`y2`,`*/ ss a2 100000`],[`y3`,`+- b 0 y2`],[`dx1`,`*/ w a1 200000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc dx1 0`],[`dy1`,`*/ x1 y2 wd2`],[`y1`,`+- y2 0 dy1`],[`y4`,`+- y3 dy1 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y2`],[`l`,`hc`,`t`],[`l`,`r`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`y3`],[`l`,`r`,`y3`],[`l`,`hc`,`b`],[`l`,`l`,`y3`],[`l`,`x1`,`y3`],[`l`,`x1`,`y2`],[`c`]]}]},uparrow:{adj:[[`adj1`,`val 50000`],[`adj2`,`val 50000`]],gd:[[`maxAdj2`,`*/ 100000 h ss`],[`a1`,`pin 0 adj1 100000`],[`a2`,`pin 0 adj2 maxAdj2`],[`dy2`,`*/ ss a2 100000`],[`y2`,`+- t dy2 0`],[`dx1`,`*/ w a1 200000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc dx1 0`],[`dy1`,`*/ x1 dy2 wd2`],[`y1`,`+- y2 0 dy1`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y2`],[`l`,`hc`,`t`],[`l`,`r`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`b`],[`l`,`x1`,`b`],[`l`,`x1`,`y2`],[`c`]]}]},updownarrowcallout:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 48123`]],gd:[[`maxAdj2`,`*/ 50000 w ss`],[`a2`,`pin 0 adj2 maxAdj2`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`maxAdj3`,`*/ 50000 h ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`q2`,`*/ a3 ss hd2`],[`maxAdj4`,`+- 100000 0 q2`],[`a4`,`pin 0 adj4 maxAdj4`],[`dx1`,`*/ ss a2 100000`],[`dx2`,`*/ ss a1 200000`],[`x1`,`+- hc 0 dx1`],[`x2`,`+- hc 0 dx2`],[`x3`,`+- hc dx2 0`],[`x4`,`+- hc dx1 0`],[`y1`,`*/ ss a3 100000`],[`y4`,`+- b 0 y1`],[`dy2`,`*/ h a4 200000`],[`y2`,`+- vc 0 dy2`],[`y3`,`+- vc dy2 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`y2`],[`l`,`x2`,`y2`],[`l`,`x2`,`y1`],[`l`,`x1`,`y1`],[`l`,`hc`,`t`],[`l`,`x4`,`y1`],[`l`,`x3`,`y1`],[`l`,`x3`,`y2`],[`l`,`r`,`y2`],[`l`,`r`,`y3`],[`l`,`x3`,`y3`],[`l`,`x3`,`y4`],[`l`,`x4`,`y4`],[`l`,`hc`,`b`],[`l`,`x1`,`y4`],[`l`,`x2`,`y4`],[`l`,`x2`,`y3`],[`l`,`l`,`y3`],[`c`]]}]},uturnarrow:{adj:[[`adj1`,`val 25000`],[`adj2`,`val 25000`],[`adj3`,`val 25000`],[`adj4`,`val 43750`],[`adj5`,`val 75000`]],gd:[[`a2`,`pin 0 adj2 25000`],[`maxAdj1`,`*/ a2 2 1`],[`a1`,`pin 0 adj1 maxAdj1`],[`q2`,`*/ a1 ss h`],[`q3`,`+- 100000 0 q2`],[`maxAdj3`,`*/ q3 h ss`],[`a3`,`pin 0 adj3 maxAdj3`],[`q1`,`+- a3 a1 0`],[`minAdj5`,`*/ q1 ss h`],[`a5`,`pin minAdj5 adj5 100000`],[`th`,`*/ ss a1 100000`],[`aw2`,`*/ ss a2 100000`],[`th2`,`*/ th 1 2`],[`dh2`,`+- aw2 0 th2`],[`y5`,`*/ h a5 100000`],[`ah`,`*/ ss a3 100000`],[`y4`,`+- y5 0 ah`],[`x9`,`+- r 0 dh2`],[`bw`,`*/ x9 1 2`],[`bs`,`min bw y4`],[`maxAdj4`,`*/ bs 100000 ss`],[`a4`,`pin 0 adj4 maxAdj4`],[`bd`,`*/ ss a4 100000`],[`bd3`,`+- bd 0 th`],[`bd2`,`max bd3 0`],[`x3`,`+- th bd2 0`],[`x8`,`+- r 0 aw2`],[`x6`,`+- x8 0 aw2`],[`x7`,`+- x6 dh2 0`],[`x4`,`+- x9 0 bd`],[`x5`,`+- x7 0 bd2`],[`cx`,`+/ th x7 2`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`b`],[`l`,`l`,`bd`],[`a`,`bd`,`bd`,`cd2`,`cd4`],[`l`,`x4`,`t`],[`a`,`bd`,`bd`,`3cd4`,`cd4`],[`l`,`x9`,`y4`],[`l`,`r`,`y4`],[`l`,`x8`,`y5`],[`l`,`x6`,`y4`],[`l`,`x7`,`y4`],[`l`,`x7`,`x3`],[`a`,`bd2`,`bd2`,`0`,`-5400000`],[`l`,`x3`,`th`],[`a`,`bd2`,`bd2`,`3cd4`,`-5400000`],[`l`,`th`,`b`],[`c`]]}]},verticalscroll:{adj:[[`adj`,`val 12500`]],gd:[[`a`,`pin 0 adj 25000`],[`ch`,`*/ ss a 100000`],[`ch2`,`*/ ch 1 2`],[`ch4`,`*/ ch 1 4`],[`x3`,`+- ch ch2 0`],[`x4`,`+- ch ch 0`],[`x6`,`+- r 0 ch`],[`x7`,`+- r 0 ch2`],[`x5`,`+- x6 0 ch2`],[`y3`,`+- b 0 ch`],[`y4`,`+- b 0 ch2`]],paths:[{w:null,h:null,fill:null,stroke:!1,extrusionOk:!1,cmds:[[`m`,`ch2`,`b`],[`a`,`ch2`,`ch2`,`cd4`,`-5400000`],[`l`,`ch2`,`y4`],[`a`,`ch4`,`ch4`,`cd4`,`-10800000`],[`l`,`ch`,`y3`],[`l`,`ch`,`ch2`],[`a`,`ch2`,`ch2`,`cd2`,`cd4`],[`l`,`x7`,`t`],[`a`,`ch2`,`ch2`,`3cd4`,`cd2`],[`l`,`x6`,`ch`],[`l`,`x6`,`y4`],[`a`,`ch2`,`ch2`,`0`,`cd4`],[`c`],[`m`,`x4`,`ch2`],[`a`,`ch2`,`ch2`,`0`,`cd4`],[`a`,`ch4`,`ch4`,`cd4`,`cd2`],[`c`]]},{w:null,h:null,fill:`darkenLess`,stroke:!1,extrusionOk:!1,cmds:[[`m`,`x4`,`ch2`],[`a`,`ch2`,`ch2`,`0`,`cd4`],[`a`,`ch4`,`ch4`,`cd4`,`cd2`],[`c`],[`m`,`ch`,`y4`],[`a`,`ch2`,`ch2`,`0`,`3cd4`],[`a`,`ch4`,`ch4`,`3cd4`,`cd2`],[`c`]]},{w:null,h:null,fill:`none`,stroke:!0,extrusionOk:!1,cmds:[[`m`,`ch`,`y3`],[`l`,`ch`,`ch2`],[`a`,`ch2`,`ch2`,`cd2`,`cd4`],[`l`,`x7`,`t`],[`a`,`ch2`,`ch2`,`3cd4`,`cd2`],[`l`,`x6`,`ch`],[`l`,`x6`,`y4`],[`a`,`ch2`,`ch2`,`0`,`cd4`],[`l`,`ch2`,`b`],[`a`,`ch2`,`ch2`,`cd4`,`cd2`],[`c`],[`m`,`x3`,`t`],[`a`,`ch2`,`ch2`,`3cd4`,`cd2`],[`a`,`ch4`,`ch4`,`cd4`,`cd2`],[`l`,`x4`,`ch2`],[`m`,`x6`,`ch`],[`l`,`x3`,`ch`],[`m`,`ch2`,`y3`],[`a`,`ch4`,`ch4`,`3cd4`,`cd2`],[`l`,`ch`,`y4`],[`m`,`ch2`,`b`],[`a`,`ch2`,`ch2`,`cd4`,`-5400000`],[`l`,`ch`,`y3`]]}]},wave:{adj:[[`adj1`,`val 12500`],[`adj2`,`val 0`]],gd:[[`a1`,`pin 0 adj1 20000`],[`a2`,`pin -10000 adj2 10000`],[`y1`,`*/ h a1 100000`],[`dy2`,`*/ y1 10 3`],[`y2`,`+- y1 0 dy2`],[`y3`,`+- y1 dy2 0`],[`y4`,`+- b 0 y1`],[`y5`,`+- y4 0 dy2`],[`y6`,`+- y4 dy2 0`],[`dx1`,`*/ w a2 100000`],[`of2`,`*/ w a2 50000`],[`x1`,`abs dx1`],[`dx2`,`?: of2 0 of2`],[`x2`,`+- l 0 dx2`],[`dx5`,`?: of2 of2 0`],[`x5`,`+- r 0 dx5`],[`dx3`,`+/ dx2 x5 3`],[`x3`,`+- x2 dx3 0`],[`x4`,`+/ x3 x5 2`],[`x6`,`+- l dx5 0`],[`x10`,`+- r dx2 0`],[`x7`,`+- x6 dx3 0`],[`x8`,`+/ x7 x10 2`],[`x9`,`+- r 0 x1`],[`xAdj`,`+- hc dx1 0`],[`xAdj2`,`+- hc 0 dx1`],[`il`,`max x2 x6`],[`ir`,`min x5 x10`],[`it`,`*/ h a1 50000`],[`ib`,`+- b 0 it`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`x2`,`y1`],[`C`,`x3`,`y2`,`x4`,`y3`,`x5`,`y1`],[`l`,`x10`,`y4`],[`C`,`x8`,`y6`,`x7`,`y5`,`x6`,`y4`],[`c`]]}]},wedgeellipsecallout:{adj:[[`adj1`,`val -20833`],[`adj2`,`val 62500`]],gd:[[`dxPos`,`*/ w adj1 100000`],[`dyPos`,`*/ h adj2 100000`],[`xPos`,`+- hc dxPos 0`],[`yPos`,`+- vc dyPos 0`],[`sdx`,`*/ dxPos h 1`],[`sdy`,`*/ dyPos w 1`],[`pang`,`at2 sdx sdy`],[`stAng`,`+- pang 660000 0`],[`enAng`,`+- pang 0 660000`],[`dx1`,`cos wd2 stAng`],[`dy1`,`sin hd2 stAng`],[`x1`,`+- hc dx1 0`],[`y1`,`+- vc dy1 0`],[`dx2`,`cos wd2 enAng`],[`dy2`,`sin hd2 enAng`],[`x2`,`+- hc dx2 0`],[`y2`,`+- vc dy2 0`],[`stAng1`,`at2 dx1 dy1`],[`enAng1`,`at2 dx2 dy2`],[`swAng1`,`+- enAng1 0 stAng1`],[`swAng2`,`+- swAng1 21600000 0`],[`swAng`,`?: swAng1 swAng1 swAng2`],[`idx`,`cos wd2 2700000`],[`idy`,`sin hd2 2700000`],[`il`,`+- hc 0 idx`],[`ir`,`+- hc idx 0`],[`it`,`+- vc 0 idy`],[`ib`,`+- vc idy 0`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`xPos`,`yPos`],[`l`,`x1`,`y1`],[`a`,`wd2`,`hd2`,`stAng1`,`swAng`],[`c`]]}]},wedgerectcallout:{adj:[[`adj1`,`val -20833`],[`adj2`,`val 62500`]],gd:[[`dxPos`,`*/ w adj1 100000`],[`dyPos`,`*/ h adj2 100000`],[`xPos`,`+- hc dxPos 0`],[`yPos`,`+- vc dyPos 0`],[`dx`,`+- xPos 0 hc`],[`dy`,`+- yPos 0 vc`],[`dq`,`*/ dxPos h w`],[`ady`,`abs dyPos`],[`adq`,`abs dq`],[`dz`,`+- ady 0 adq`],[`xg1`,`?: dxPos 7 2`],[`xg2`,`?: dxPos 10 5`],[`x1`,`*/ w xg1 12`],[`x2`,`*/ w xg2 12`],[`yg1`,`?: dyPos 7 2`],[`yg2`,`?: dyPos 10 5`],[`y1`,`*/ h yg1 12`],[`y2`,`*/ h yg2 12`],[`t1`,`?: dxPos l xPos`],[`xl`,`?: dz l t1`],[`t2`,`?: dyPos x1 xPos`],[`xt`,`?: dz t2 x1`],[`t3`,`?: dxPos xPos r`],[`xr`,`?: dz r t3`],[`t4`,`?: dyPos xPos x1`],[`xb`,`?: dz t4 x1`],[`t5`,`?: dxPos y1 yPos`],[`yl`,`?: dz y1 t5`],[`t6`,`?: dyPos t yPos`],[`yt`,`?: dz t6 t`],[`t7`,`?: dxPos yPos y1`],[`yr`,`?: dz y1 t7`],[`t8`,`?: dyPos yPos b`],[`yb`,`?: dz t8 b`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`t`],[`l`,`x1`,`t`],[`l`,`xt`,`yt`],[`l`,`x2`,`t`],[`l`,`r`,`t`],[`l`,`r`,`y1`],[`l`,`xr`,`yr`],[`l`,`r`,`y2`],[`l`,`r`,`b`],[`l`,`x2`,`b`],[`l`,`xb`,`yb`],[`l`,`x1`,`b`],[`l`,`l`,`b`],[`l`,`l`,`y2`],[`l`,`xl`,`yl`],[`l`,`l`,`y1`],[`c`]]}]},wedgeroundrectcallout:{adj:[[`adj1`,`val -20833`],[`adj2`,`val 62500`],[`adj3`,`val 16667`]],gd:[[`dxPos`,`*/ w adj1 100000`],[`dyPos`,`*/ h adj2 100000`],[`xPos`,`+- hc dxPos 0`],[`yPos`,`+- vc dyPos 0`],[`dq`,`*/ dxPos h w`],[`ady`,`abs dyPos`],[`adq`,`abs dq`],[`dz`,`+- ady 0 adq`],[`xg1`,`?: dxPos 7 2`],[`xg2`,`?: dxPos 10 5`],[`x1`,`*/ w xg1 12`],[`x2`,`*/ w xg2 12`],[`yg1`,`?: dyPos 7 2`],[`yg2`,`?: dyPos 10 5`],[`y1`,`*/ h yg1 12`],[`y2`,`*/ h yg2 12`],[`t1`,`?: dxPos l xPos`],[`xl`,`?: dz l t1`],[`t2`,`?: dyPos x1 xPos`],[`xt`,`?: dz t2 x1`],[`t3`,`?: dxPos xPos r`],[`xr`,`?: dz r t3`],[`t4`,`?: dyPos xPos x1`],[`xb`,`?: dz t4 x1`],[`t5`,`?: dxPos y1 yPos`],[`yl`,`?: dz y1 t5`],[`t6`,`?: dyPos t yPos`],[`yt`,`?: dz t6 t`],[`t7`,`?: dxPos yPos y1`],[`yr`,`?: dz y1 t7`],[`t8`,`?: dyPos yPos b`],[`yb`,`?: dz t8 b`],[`u1`,`*/ ss adj3 100000`],[`u2`,`+- r 0 u1`],[`v2`,`+- b 0 u1`],[`il`,`*/ u1 29289 100000`],[`ir`,`+- r 0 il`],[`ib`,`+- b 0 il`]],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!0,cmds:[[`m`,`l`,`u1`],[`a`,`u1`,`u1`,`cd2`,`cd4`],[`l`,`x1`,`t`],[`l`,`xt`,`yt`],[`l`,`x2`,`t`],[`l`,`u2`,`t`],[`a`,`u1`,`u1`,`3cd4`,`cd4`],[`l`,`r`,`y1`],[`l`,`xr`,`yr`],[`l`,`r`,`y2`],[`l`,`r`,`v2`],[`a`,`u1`,`u1`,`0`,`cd4`],[`l`,`x2`,`b`],[`l`,`xb`,`yb`],[`l`,`x1`,`b`],[`l`,`u1`,`b`],[`a`,`u1`,`u1`,`cd4`,`cd4`],[`l`,`l`,`y2`],[`l`,`xl`,`yl`],[`l`,`l`,`y1`],[`c`]]}]}};const Un=216e5,Wn=Math.PI*2/Un;function Gn(e){let t=e.trim().split(/\\s+/);return{op:t[0],argTokens:t.slice(1)}}function Kn(e,t,n){let{w:r,h:i,adj:a}=e,o=Math.min(r,i),s=Math.max(r,i),c=Object.create(null);Object.assign(c,{w:r,h:i,l:0,t:0,r,b:i,hc:r/2,vc:i/2,wd2:r/2,wd3:r/3,wd4:r/4,wd5:r/5,wd6:r/6,wd8:r/8,wd10:r/10,wd12:r/12,wd16:r/16,wd32:r/32,hd2:i/2,hd3:i/3,hd4:i/4,hd5:i/5,hd6:i/6,hd8:i/8,hd10:i/10,hd12:i/12,hd16:i/16,hd32:i/32,ss:o,ssd2:o/2,ssd4:o/4,ssd6:o/6,ssd8:o/8,ssd16:o/16,ssd32:o/32,ls:s,lsd2:s/2,lsd4:s/4,lsd6:s/6,lsd8:s/8,lsd16:s/16,lsd32:s/32,cd:Un,cd2:Un/2,cd4:Un/4,cd8:Un/8,\"3cd4\":3*Un/4,\"3cd8\":3*Un/8,\"5cd8\":5*Un/8,\"7cd8\":7*Un/8}),t.forEach(([e,t],n)=>{let r=a[n];c[e]=typeof r==`number`?r:u(t),e===`adj`&&(c.adj1=c.adj),e===`adj1`&&(c.adj=c.adj1)});for(let[e,t]of n)c[e]=u(t);return{v:e=>{if(e in c)return c[e];throw Error(`preset-shape: unknown name \"${e}\"`)},fmla:u,resolve:l};function l(e){if(e in c)return c[e];let t=Number(e);if(Number.isFinite(t))return t;throw Error(`preset-shape: cannot resolve \"${e}\"`)}function u(e){let t=e.argTokens.map(l);return d(e.op,t,e)}function d(e,t,n){switch(e){case`val`:return t[0];case`*/`:return t[0]*t[1]/t[2];case`+-`:return t[0]+t[1]-t[2];case`+/`:return(t[0]+t[1])/t[2];case`?:`:return t[0]>0?t[1]:t[2];case`abs`:return Math.abs(t[0]);case`min`:return Math.min(t[0],t[1]);case`max`:return Math.max(t[0],t[1]);case`pin`:return t[1]<t[0]?t[0]:t[1]>t[2]?t[2]:t[1];case`sqrt`:return Math.sqrt(Math.max(0,t[0]));case`mod`:return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);case`sin`:return t[0]*Math.sin(t[1]*Wn);case`cos`:return t[0]*Math.cos(t[1]*Wn);case`tan`:return t[0]*Math.tan(t[1]*Wn);case`at2`:return Math.atan2(t[1],t[0])/Wn;case`cat2`:return t[0]*Math.cos(Math.atan2(t[2],t[1]));case`sat2`:return t[0]*Math.sin(Math.atan2(t[2],t[1]));default:throw Error(`preset-shape: unknown operator \"${e}\" in \"${[n.op,...n.argTokens].join(` `)}\"`)}}}const qn=Math.PI*2/216e5;function Jn(e,t,n,r,i,a,o){let s=t.w==null?1:a/t.w,c=t.h==null?1:o/t.h,l=e=>r+e*s,u=e=>i+e*c,d=0,f=0;for(let r of t.cmds)switch(r[0]){case`m`:{let t=l(n.resolve(r[1])),i=u(n.resolve(r[2]));e.moveTo(t,i),d=t,f=i;break}case`l`:{let t=l(n.resolve(r[1])),i=u(n.resolve(r[2]));e.lineTo(t,i),d=t,f=i;break}case`C`:{let t=l(n.resolve(r[1])),i=u(n.resolve(r[2])),a=l(n.resolve(r[3])),o=u(n.resolve(r[4])),s=l(n.resolve(r[5])),c=u(n.resolve(r[6]));e.bezierCurveTo(t,i,a,o,s,c),d=s,f=c;break}case`Q`:{let t=l(n.resolve(r[1])),i=u(n.resolve(r[2])),a=l(n.resolve(r[3])),o=u(n.resolve(r[4]));e.quadraticCurveTo(t,i,a,o),d=a,f=o;break}case`a`:{let t=n.resolve(r[1]),i=n.resolve(r[2]),a=t*s,o=i*c,l=n.resolve(r[3])*qn,u=n.resolve(r[4])*qn,p=Math.PI*2,m=e=>Math.atan2(t*Math.sin(e),i*Math.cos(e)),h=m(l),g=Math.trunc(u/p),_=u-g*p,v=m(l+_)-h;_>0&&v<0?v+=p:_<0&&v>0&&(v-=p);let y=h+v+g*p,b=d-a*Math.cos(h),x=f-o*Math.sin(h);Math.abs(a)>1e-6&&Math.abs(o)>1e-6&&(e.ellipse(b,x,Math.abs(a),Math.abs(o),0,h,y,u<0),d=b+a*Math.cos(y),f=x+o*Math.sin(y));break}case`c`:e.closePath();break}}const Yn=Hn,Xn=new WeakMap;function Zn(e){let t=Xn.get(e);return t||(t={adj:e.adj.map(([e,t])=>[e,Gn(t)]),gd:e.gd.map(([e,t])=>[e,Gn(t)])},Xn.set(e,t)),t}function Qn(e,t,n,r){let i=Zn(e);return Kn({w:t,h:n,adj:r},i.adj,i.gd)}function $n(e){return e.toLowerCase()in Yn}function er(e,t,n,r,i,a,o=[]){let s=Yn[t.toLowerCase()];if(!s)return!1;let c=Qn(s,i,a,o);for(let t of s.paths)Jn(e,t,c,n,r,i,a);return!0}const tr={wedgeroundrectcallout:`roundrect`,wedgeellipsecallout:`ellipse`,wedgerectcallout:null},nr={adj:[],gd:[],paths:[{w:null,h:null,fill:null,stroke:!0,extrusionOk:!1,cmds:[[`m`,`l`,`t`],[`l`,`r`,`t`],[`l`,`r`,`b`],[`l`,`l`,`b`],[`c`]]}]};function rr(e,t,n){let r=e[n];if(typeof r==`number`)return r;let i=t.adj[n];return i&&Number(i[1].replace(/^val\\s+/,``))||0}function ir(e,t,n,r,i,a,o,s,c,l,u){let d=t.toLowerCase(),f=Yn[d];if(!f)return!1;if(d in tr){let e=rr(o,f,0),t=rr(o,f,1),n=i/2+i*e/1e5,r=a/2+a*t/1e5;if(n>=0&&n<=i&&r>=0&&r<=a){let e=tr[d];e===`roundrect`?(f=Yn.roundrect,o=[rr(o,Yn[d],2)]):e&&Yn[e]?(f=Yn[e],o=[]):(f=nr,o=[])}}let p=Qn(f,i,a,o),m=!1,h=f.paths.length-1;for(let t=0;t<f.paths.length;t++){let o=f.paths[t];e.beginPath(),Jn(e,o,p,n,r,i,a);let d=o.fill;if(d!==`none`&&s!=null){e.save(),e.fillStyle=s,e.fill();let t=or(d);t&&(e.fillStyle=t,e.fill()),e.restore(),m||=(l(),!0)}if(o.stroke&&c){let e=t===h&&(o.fill===`none`||o.fill==null);u?.skipTrailingStroke&&e||c()}}return!0}function ar(e,t,n,r,i,a){let o=Yn[e.toLowerCase()];if(!o||o.paths.length===0)return null;let s=o.paths[o.paths.length-1],c=Qn(o,r,i,a),l=s.w==null?1:r/s.w,u=s.h==null?1:i/s.h,d=e=>t+e*l,f=e=>n+e*u,p=0,m=0,h=0,g=0,_=0,v=0,y=!1,b=0,x=0,S=[];for(let e of s.cmds)switch(e[0]){case`m`:h=d(c.resolve(e[1])),g=f(c.resolve(e[2])),p=h,m=g,S.push({x:h,y:g});break;case`l`:{let t=d(c.resolve(e[1])),n=f(c.resolve(e[2]));y||=(_=t-h,v=n-g,!0),b=t-h,x=n-g,h=t,g=n,S.push({x:h,y:g});break}case`C`:{let t=d(c.resolve(e[1])),n=f(c.resolve(e[2])),r=d(c.resolve(e[3])),i=f(c.resolve(e[4])),a=d(c.resolve(e[5])),o=f(c.resolve(e[6]));y||=(_=t-h,v=n-g,!0),b=a-r,x=o-i,h=a,g=o,S.push({x:h,y:g});break}}let C=Math.atan2(v,_)+Math.PI;return{start:{x:p,y:m,angle:C},end:{x:h,y:g,angle:Math.atan2(x,b)},vertices:S}}function or(e){switch(e){case`lighten`:return`rgba(255,255,255,0.30)`;case`lightenLess`:return`rgba(255,255,255,0.15)`;case`darken`:return`rgba(0,0,0,0.30)`;case`darkenLess`:return`rgba(0,0,0,0.15)`;default:return null}}function sr(e,t,n,r,i,a,o,s=-Math.PI/2){let c=a*2;for(let l=0;l<c;l++){let c=s+l*Math.PI/a,u=l%2==0?1:o,d=t+r*u*Math.cos(c),f=n+i*u*Math.sin(c);l===0?e.moveTo(d,f):e.lineTo(d,f)}e.closePath()}function cr(e,t,n,r,i,a,o=-Math.PI/2){for(let s=0;s<a;s++){let c=o+s*2*Math.PI/a,l=t+r*Math.cos(c),u=n+i*Math.sin(c);s===0?e.moveTo(l,u):e.lineTo(l,u)}e.closePath()}function lr(e,t,n,r,i,a,o){let s=e=>Math.atan2(r*Math.sin(e),i*Math.cos(e)),c=s(a),l=s(a+o),u=t-r*Math.cos(c),d=n-i*Math.sin(c);return e.ellipse(u,d,Math.abs(r),Math.abs(i),0,c,l,o<0),{x:u+r*Math.cos(l),y:d+i*Math.sin(l)}}const ur={oval:`ellipse`,rtriangle:`rttriangle`,roundrectangle:`roundrect`,flowchartsumingjunction:`flowchartsummingjunction`},dr=new Set(`ellipse.rttriangle.triangle.diamond.trapezoid.roundrect.snip1rect.frame.irregularseal1.irregularseal2.star4.star8.star12.star16.star24.star32.line.straightconnector1.callout1.bordercallout1.leftuparrow.quadarrowcallout.mathequal.mathplus.mathminus.flowchartdecision.flowchartmanualinput.flowchartconnector.flowchartinputoutput.flowchartmerge.flowchartextract.flowchartpreparation.flowchartcollate`.split(`.`)),fr=new Set([`accentcallout1`,`accentbordercallout1`,`flowchartpredefinedprocess`,`flowchartsort`,`flowchartinternalstorage`,`flowchartsummingjunction`]),pr=new Set([`round2samerect`,`round2diagrect`,`dodecagon`,`star10`]);function mr(e,t,n,r,i,a,o=null,s=null,c=null,l=null){let u=n+i/2,d=r+a/2;{let u=t.toLowerCase(),d=ur[u]??u;if((dr.has(d)||fr.has(d)||pr.has(d))&&er(e,d,n,r,i,a,[o,s,c,l]))return}switch(t.toLowerCase()){case`parallelogram`:{let t=i*Math.min(.5,(o??25e3)/1e5);e.moveTo(n+t,r),e.lineTo(n+i,r),e.lineTo(n+i-t,r+a),e.lineTo(n,r+a),e.closePath();break}case`pentagon`:cr(e,u,d,i/2,a/2,5);break;case`hexagon`:cr(e,u,d,i/2,a/2,6,0);break;case`heptagon`:cr(e,u,d,i/2,a/2,7);break;case`octagon`:cr(e,u,d,i/2,a/2,8,-Math.PI/8);break;case`decagon`:cr(e,u,d,i/2,a/2,10);break;case`star5`:case`star`:sr(e,u,d,i/2,a/2,5,(o??19098)/5e4);break;case`star6`:sr(e,u,d,i/2,a/2,6,(o??28868)/5e4,0);break;case`star7`:sr(e,u,d,i/2,a/2,7,(o??34142)/5e4);break;case`rightarrow`:{let t=a*Math.min(1,(o??5e4)/1e5),c=i*Math.min(1,(s??5e4)/1e5),l=r+(a-t)/2;e.moveTo(n,l),e.lineTo(n+i-c,l),e.lineTo(n+i-c,r),e.lineTo(n+i,d),e.lineTo(n+i-c,r+a),e.lineTo(n+i-c,l+t),e.lineTo(n,l+t),e.closePath();break}case`leftarrow`:{let t=a*Math.min(1,(o??5e4)/1e5),c=i*Math.min(1,(s??5e4)/1e5),l=r+(a-t)/2;e.moveTo(n+i,l),e.lineTo(n+c,l),e.lineTo(n+c,r),e.lineTo(n,d),e.lineTo(n+c,r+a),e.lineTo(n+c,l+t),e.lineTo(n+i,l+t),e.closePath();break}case`uparrow`:{let t=i*Math.min(1,(o??5e4)/1e5),c=a*Math.min(1,(s??5e4)/1e5),l=n+(i-t)/2;e.moveTo(u,r),e.lineTo(n+i,r+c),e.lineTo(l+t,r+c),e.lineTo(l+t,r+a),e.lineTo(l,r+a),e.lineTo(l,r+c),e.lineTo(n,r+c),e.closePath();break}case`downarrow`:{let t=i*Math.min(1,(o??5e4)/1e5),c=a*Math.min(1,(s??5e4)/1e5),l=n+(i-t)/2;e.moveTo(u,r+a),e.lineTo(n+i,r+a-c),e.lineTo(l+t,r+a-c),e.lineTo(l+t,r),e.lineTo(l,r),e.lineTo(l,r+a-c),e.lineTo(n,r+a-c),e.closePath();break}case`leftrightarrow`:{let t=a*Math.min(1,(o??5e4)/1e5),c=i*Math.min(.5,(s??25e3)/1e5),l=r+(a-t)/2;e.moveTo(n,d),e.lineTo(n+c,r),e.lineTo(n+c,l),e.lineTo(n+i-c,l),e.lineTo(n+i-c,r),e.lineTo(n+i,d),e.lineTo(n+i-c,r+a),e.lineTo(n+i-c,l+t),e.lineTo(n+c,l+t),e.lineTo(n+c,r+a),e.closePath();break}case`updownarrow`:{let t=i*Math.min(1,(o??5e4)/1e5),c=a*Math.min(.5,(s??25e3)/1e5),l=n+(i-t)/2;e.moveTo(u,r),e.lineTo(n+i,r+c),e.lineTo(l+t,r+c),e.lineTo(l+t,r+a-c),e.lineTo(n+i,r+a-c),e.lineTo(u,r+a),e.lineTo(n,r+a-c),e.lineTo(l,r+a-c),e.lineTo(l,r+c),e.lineTo(n,r+c),e.closePath();break}case`notchedrightarrow`:{let t=a*Math.min(1,(o??5e4)/1e5),c=i*Math.min(1,(s??35e3)/1e5),l=r+(a-t)/2,u=c*.43;e.moveTo(n,l),e.lineTo(n+i-c,l),e.lineTo(n+i-c,r),e.lineTo(n+i,d),e.lineTo(n+i-c,r+a),e.lineTo(n+i-c,l+t),e.lineTo(n,l+t),e.lineTo(n+u,d),e.closePath();break}case`chevron`:{let t=i*Math.min(1,Math.max(0,(o??5e4)/1e5));e.moveTo(n,r),e.lineTo(n+t,r),e.lineTo(n+i,d),e.lineTo(n+t,r+a),e.lineTo(n,r+a),t>0&&e.lineTo(n+t,d),e.closePath();break}case`homeplate`:{let t=a*.4;e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a-t),e.lineTo(u,r+a),e.lineTo(n,r+a-t),e.closePath();break}case`leftbracket`:{let t=Math.min(a*Math.min(5e4,Math.max(0,o??8333))/1e5,a/2);e.moveTo(n+i,r),e.quadraticCurveTo(n,r,n,r+t),a-2*t>.5&&e.lineTo(n,r+a-t),e.quadraticCurveTo(n,r+a,n+i,r+a);break}case`rightbracket`:{let t=Math.min(a*Math.min(5e4,Math.max(0,o??8333))/1e5,a/2);e.moveTo(n,r),e.quadraticCurveTo(n+i,r,n+i,r+t),a-2*t>.5&&e.lineTo(n+i,r+a-t),e.quadraticCurveTo(n+i,r+a,n,r+a);break}case`leftbrace`:{let t=d,o=i*.45;e.moveTo(n+i,r),e.bezierCurveTo(n+i-o,r,n+i-o,t-a*.08,n,t),e.bezierCurveTo(n+i-o,t+a*.08,n+i-o,r+a,n+i,r+a);break}case`rightbrace`:{let t=d,o=i*.45;e.moveTo(n,r),e.bezierCurveTo(n+o,r,n+o,t-a*.08,n+i,t),e.bezierCurveTo(n+o,t+a*.08,n+o,r+a,n,r+a);break}case`wedgerectcallout`:{e.rect(n,r,i,a*.8);let t=n+i*.2,o=r+a;e.moveTo(n+i*.1,r+a*.8),e.lineTo(t,o),e.lineTo(n+i*.3,r+a*.8),e.closePath();break}case`wedgeellipsecallout`:{let t=(o??-2e4)/1e5*i,n=(s??12e4)/1e5*a,r=u+t,c=d+n;e.ellipse(u,d,i/2,a/2,0,0,Math.PI*2);let l=Math.atan2(n,t),f=Math.PI/10,p=i/2,m=a/2,h=u+p*Math.cos(l-f),g=d+m*Math.sin(l-f),_=u+p*Math.cos(l+f),v=d+m*Math.sin(l+f);e.moveTo(h,g),e.lineTo(r,c),e.lineTo(_,v),e.closePath();break}case`cloudcallout`:{let t=Math.min(i,a)*.22,n=[[u-i*.25,r+a*.35],[u-i*.1,r+a*.15],[u+i*.1,r+a*.1],[u+i*.28,r+a*.2],[u+i*.35,r+a*.4]];e.moveTo(n[0][0]-t,n[0][1]);for(let[r,i]of n)e.arc(r,i,t,Math.PI,0);e.arc(u,r+a*.65,i*.45,0,Math.PI),e.closePath();let c=u+(o??-2e4)/1e5*i,l=d+(s??12e4)/1e5*a;e.moveTo(u+i*.05,r+a*.8),e.arc(c,l,Math.min(i,a)*.07,0,Math.PI*2);break}case`bentconnector2`:case`bentconnector3`:case`bentconnector4`:case`bentconnector5`:case`curvedconnector2`:case`curvedconnector3`:case`curvedconnector4`:case`curvedconnector5`:e.moveTo(n,r),e.lineTo(n+i,r+a);break;case`heart`:e.moveTo(u,r+a*.32),e.bezierCurveTo(u,r,n+i*.05,r,n,r+a*.3),e.bezierCurveTo(n,r+a*.68,u-i*.05,r+a*.78,u,r+a),e.bezierCurveTo(u+i*.05,r+a*.78,n+i,r+a*.68,n+i,r+a*.3),e.bezierCurveTo(n+i-i*.05,r,u,r,u,r+a*.32);break;case`donut`:{let t=i/2,n=a/2,r=Math.min(t,n)*(o??25e3)/1e5,s=t-r,c=n-r;e.ellipse(u,d,t,n,0,0,Math.PI*2,!1),e.moveTo(u+s,d),e.ellipse(u,d,s,c,0,0,Math.PI*2,!0);break}case`nosmoking`:case`nosmokingsign`:{let t=(o??18750)/1e5,n=i/2,r=a/2,s=n*(1-2*t),c=r*(1-2*t);e.ellipse(u,d,n,r,0,0,Math.PI*2,!1),e.moveTo(u+s,d),e.ellipse(u,d,s,c,0,0,Math.PI*2,!0),e.moveTo(u+s,d),e.ellipse(u,d,s,c,0,0,Math.PI/2,!1),e.lineTo(u-s,d),e.ellipse(u,d,s,c,0,Math.PI,3*Math.PI/2,!1),e.closePath();break}case`pie`:{let t=(o??0)/216e5*Math.PI*2,n=(s??162e5)/216e5*Math.PI*2;e.moveTo(u,d),e.arc(u,d,Math.min(i,a)/2,t,n),e.closePath();break}case`cloud`:{let t=a*.28;e.arc(n+i*.25,r+a*.55,t,Math.PI,Math.PI*1.8),e.arc(n+i*.45,r+a*.35,t*1.1,Math.PI*1.3,Math.PI*1.9),e.arc(n+i*.65,r+a*.4,t,Math.PI*1.5,Math.PI*2),e.arc(n+i*.8,r+a*.6,t*.9,Math.PI*1.6,Math.PI*.1),e.arc(n+i*.55,r+a*.75,t,0,Math.PI*.7),e.arc(n+i*.25,r+a*.7,t*.9,0,Math.PI),e.closePath();break}case`funnel`:e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(u+i*.15,r+a),e.lineTo(u-i*.15,r+a),e.closePath();break;case`smileyface`:{e.ellipse(u,d,i/2,a/2,0,0,Math.PI*2),e.closePath();let t=i*.05,n=a*.05,r=d-a*.12;e.moveTo(u-i*.2+t,r),e.ellipse(u-i*.2,r,t,n,0,0,Math.PI*2),e.moveTo(u+i*.2+t,r),e.ellipse(u+i*.2,r,t,n,0,0,Math.PI*2),e.moveTo(u-i*.25,d+a*.05),e.quadraticCurveTo(u,d+a*.3,u+i*.25,d+a*.05);break}case`document`:case`foldedcorner`:{let t=Math.min(i,a)*.15;e.moveTo(n,r),e.lineTo(n+i-t,r),e.lineTo(n+i,r+t),e.lineTo(n+i,r+a),e.lineTo(n,r+a),e.closePath(),e.moveTo(n+i-t,r),e.lineTo(n+i-t,r+t),e.lineTo(n+i,r+t);break}case`snip2samerect`:{let t=Math.min(i,a)*Math.min(5e4,Math.max(0,o??16667))/1e5;e.moveTo(n,r),e.lineTo(n+i-t,r),e.lineTo(n+i,r+t),e.lineTo(n+i,r+a),e.lineTo(n+t,r+a),e.lineTo(n,r+a-t),e.closePath();break}case`snip2diagrect`:{let t=Math.min(i,a)*Math.min(5e4,Math.max(0,o??16667))/1e5;e.moveTo(n+t,r),e.lineTo(n+i-t,r),e.lineTo(n+i,r+t),e.lineTo(n+i,r+a-t),e.lineTo(n+i-t,r+a),e.lineTo(n+t,r+a),e.lineTo(n,r+a-t),e.lineTo(n,r+t),e.closePath();break}case`sniproundrect`:{let t=Math.min(i,a)*Math.min(5e4,Math.max(0,o??16667))/1e5;e.moveTo(n+t,r),e.lineTo(n+i-t,r),e.lineTo(n+i,r+t),e.lineTo(n+i,r+a),e.lineTo(n,r+a),e.quadraticCurveTo(n,r,n+t,r),e.closePath();break}case`round1rect`:{let t=Math.min(i,a)*Math.min(5e4,Math.max(0,o??16667))/1e5;e.moveTo(n+t,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a),e.lineTo(n,r+a),e.lineTo(n,r+t),e.quadraticCurveTo(n,r,n+t,r),e.closePath();break}case`plaque`:{let t=Math.min(i,a)*.25;e.moveTo(n+t,r),e.lineTo(n+i-t,r),e.quadraticCurveTo(n+i,r,n+i,r+t),e.lineTo(n+i,r+a-t),e.quadraticCurveTo(n+i,r+a,n+i-t,r+a),e.lineTo(n+t,r+a),e.quadraticCurveTo(n,r+a,n,r+a-t),e.lineTo(n,r+t),e.quadraticCurveTo(n,r,n+t,r),e.closePath();break}case`can`:{let t=a*.1;e.ellipse(u,r+t,i/2,t,0,0,Math.PI*2),e.moveTo(n,r+t),e.lineTo(n,r+a-t),e.ellipse(u,r+a-t,i/2,t,0,Math.PI,2*Math.PI),e.lineTo(n+i,r+t);break}case`cube`:{let t=Math.min(i,a)*.2;e.moveTo(n+t,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a-t),e.lineTo(n+i-t,r+a),e.lineTo(n,r+a),e.lineTo(n,r+t),e.closePath(),e.moveTo(n+t,r),e.lineTo(n+t,r+t),e.lineTo(n+i-t,r+t),e.moveTo(n+t,r+t),e.lineTo(n,r+t);break}case`bevel`:{let t=Math.min(i,a)*.1;e.rect(n,r,i,a),e.moveTo(n,r),e.lineTo(n+t,r+t),e.lineTo(n+i-t,r+t),e.lineTo(n+i,r),e.moveTo(n+i-t,r+t),e.lineTo(n+i-t,r+a-t),e.lineTo(n+i,r+a),e.moveTo(n+i-t,r+a-t),e.lineTo(n+t,r+a-t),e.lineTo(n,r+a),e.moveTo(n+t,r+a-t),e.lineTo(n+t,r+t);break}case`halfframe`:{let t=Math.min(i,a)*.25;e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(n+i,r+t),e.lineTo(n+t,r+t),e.lineTo(n+t,r+a),e.lineTo(n,r+a),e.closePath();break}case`corner`:{let t=Math.min(i,a)*.25;e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(n+i,r+t),e.lineTo(n+t,r+t),e.lineTo(n+t,r+a),e.lineTo(n,r+a),e.closePath();break}case`flowchartalternateprocess`:case`flowchartprocess`:{let t=Math.min(i,a)*Math.min(5e4,Math.max(0,o??16667))/1e5;e.roundRect(n,r,i,a,[{x:t,y:t}]);break}case`flowchartterminator`:{let t=Math.min(i,a)/2;e.roundRect(n,r,i,a,[{x:t,y:t}]);break}case`flowchartdocument`:{let t=a*.1;e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a-t),e.bezierCurveTo(n+i*.75,r+a,n+i*.25,r+a-t*2,n,r+a-t),e.closePath();break}case`moon`:e.arc(u,d,Math.min(i,a)/2,-Math.PI/2,Math.PI/2),e.arc(u-i*.2,d,Math.min(i,a)/2,Math.PI/2,-Math.PI/2,!0),e.closePath();break;case`arc`:{let t=216e5,n=(o??162e5)/t*Math.PI*2,r=(s??54e5)/t*Math.PI*2;e.ellipse(u,d,i/2,a/2,0,n,n+r,r<0);break}case`mathmultiply`:{let t=Math.min(i,a)*Math.min(51965,Math.max(0,o??23520))/1e5,s=Math.atan2(a,i),c=Math.sin(s),l=Math.cos(s),u=t/2*c,d=t/2*l;e.moveTo(n+u,r-d),e.lineTo(n-u,r+d),e.lineTo(n+i-u,r+a+d),e.lineTo(n+i+u,r+a-d),e.closePath(),e.moveTo(n+i-u,r-d),e.lineTo(n+i+u,r+d),e.lineTo(n+u,r+a+d),e.lineTo(n-u,r+a-d),e.closePath();break}case`mathdivide`:{let t=Math.min(36745,Math.max(1e3,o??23520)),n=(73490+-t)/4,l=36745*i/a,f=Math.min(Math.min(n,l),Math.max(1e3,c??11760)),p=73490+4*f-t,m=Math.min(p,Math.max(0,s??5880)),h=a*t/2e5,g=a*m/1e5,_=a*f/1e5,v=i*73490/2e5,y=d-h,b=d+h,x=y-(g+_)-_,S=r+a-x,C=u-v,w=u+v;e.rect(C,y,w-C,b-y),e.moveTo(u+_,x+_),e.arc(u,x+_,_,0,Math.PI*2),e.moveTo(u+_,S-_),e.arc(u,S-_,_,0,Math.PI*2);break}case`quadarrow`:{let t=i*(o??23e3)/1e5,c=i*(s??3e4)/1e5,l=n+(i-t)/2,f=r+(a-t)/2;e.moveTo(u,r),e.lineTo(n+i-c,r+c),e.lineTo(n+i-c,f),e.lineTo(l+t,f),e.lineTo(l+t,r+c),e.lineTo(n+c,r+c),e.lineTo(n+i,d),e.lineTo(n+i-c,r+a-c),e.lineTo(l+t,r+a-c),e.lineTo(l+t,f+t),e.lineTo(n+i-c,f+t),e.lineTo(n+i-c,r+a-c),e.lineTo(u,r+a),e.lineTo(n+c,r+a-c),e.lineTo(n+c,f+t),e.lineTo(l,f+t),e.lineTo(l,r+a-c),e.lineTo(n,d),e.lineTo(n+c,r+c),e.lineTo(l,r+c),e.lineTo(l,f),e.lineTo(n+c,f),e.closePath();break}case`wave`:{let t=a*(o??12500)/1e5,s=r+t,c=r+a-t;e.moveTo(n,s),e.bezierCurveTo(n+i*.25,r,n+i*.25,r+t*2,n+i*.5,s),e.bezierCurveTo(n+i*.75,r+t*2,n+i*.75,r,n+i,s),e.lineTo(n+i,c),e.bezierCurveTo(n+i*.75,r+a,n+i*.75,r+a-t*2,n+i*.5,c),e.bezierCurveTo(n+i*.25,r+a-t*2,n+i*.25,r+a,n,c),e.closePath();break}case`doublewave`:{let t=a*(o??6250)/1e5,s=r+t,c=r+a-t;e.moveTo(n,s),e.bezierCurveTo(n+i*.25,r,n+i*.25,r+t*2,n+i*.5,s),e.bezierCurveTo(n+i*.75,r+t*2,n+i*.75,r,n+i,s),e.lineTo(n+i,c),e.bezierCurveTo(n+i*.75,r+a,n+i*.75,r+a-t*2,n+i*.5,c),e.bezierCurveTo(n+i*.25,r+a-t*2,n+i*.25,r+a,n,c),e.closePath();break}case`sun`:{let t=Math.min(i,a)/2,n=t*((o??25e3)/1e5+.5),r=Math.min(n,t*.9),s=Math.PI/16;for(let n=0;n<8;n++){let i=n/8*Math.PI*2;e.moveTo(u+r*Math.cos(i-s),d+r*Math.sin(i-s)),e.lineTo(u+t*Math.cos(i),d+t*Math.sin(i)),e.lineTo(u+r*Math.cos(i+s),d+r*Math.sin(i+s)),e.closePath()}e.moveTo(u+r,d),e.arc(u,d,r,0,Math.PI*2);break}case`lightningbolt`:e.moveTo(u+i*.1,r),e.lineTo(n,d-a*.05),e.lineTo(u+i*.05,d-a*.05),e.lineTo(u-i*.1,r+a),e.lineTo(n+i,d+a*.05),e.lineTo(u-i*.05,d+a*.05),e.closePath();break;case`bracketpair`:{let t=a*Math.min(5e4,Math.max(0,o??8333))/1e5;e.moveTo(n+i*.4,r),e.quadraticCurveTo(n,r,n,r+t),a-2*t>0&&e.lineTo(n,r+a-t),e.quadraticCurveTo(n,r+a,n+i*.4,r+a),e.moveTo(n+i*.6,r),e.quadraticCurveTo(n+i,r,n+i,r+t),a-2*t>0&&e.lineTo(n+i,r+a-t),e.quadraticCurveTo(n+i,r+a,n+i*.6,r+a);break}case`bracepair`:{let t=i*.2;e.moveTo(n+i*.4,r),e.bezierCurveTo(n+i*.4-t,r,n+i*.4-t,d-a*.08,n,d),e.bezierCurveTo(n+i*.4-t,d+a*.08,n+i*.4-t,r+a,n+i*.4,r+a),e.moveTo(n+i*.6,r),e.bezierCurveTo(n+i*.6+t,r,n+i*.6+t,d-a*.08,n+i,d),e.bezierCurveTo(n+i*.6+t,d+a*.08,n+i*.6+t,r+a,n+i*.6,r+a);break}case`chord`:{let t=(o??27e5)/216e5*Math.PI*2,n=(s??162e5)/216e5*Math.PI*2;e.ellipse(u,d,i/2,a/2,0,t,n),e.closePath();break}case`blockarc`:{let t=Math.min(i,a)/2,n=o??108e5,r=s??0,l=t*(1-(c??25e3)/1e5),f=n/216e5*Math.PI*2,p=r/216e5*Math.PI*2;e.arc(u,d,t,f,p,!1),e.arc(u,d,l,p,f,!0),e.closePath();break}case`teardrop`:{let t=Math.min(i,a)*.4,o=n+t,s=r+a-t;e.arc(o,s,t,0,Math.PI*2*.75),e.bezierCurveTo(o-t*.1,s-t,n+i-t,r+t,n+i,r),e.bezierCurveTo(n+i-t*.2,r+t*.5,o+t,s-t*1.1,o+t,s),e.closePath();break}case`diagstripe`:{let t=a*(o??5e4)/1e5*i/a;e.moveTo(n+t,r),e.lineTo(n+i,r),e.lineTo(n+i-t,r+a),e.lineTo(n,r+a),e.closePath();break}case`wedgeroundrectcallout`:{let t=Math.min(i,a)*.1;e.roundRect(n,r,i,a*.85,t),e.moveTo(n+i*.1,r+a*.85),e.lineTo(n+i*.2,r+a),e.lineTo(n+i*.3,r+a*.85),e.closePath();break}case`rightarrowcallout`:{let t=a*(o??5e4)/1e5,c=i*(s??5e4)/1e5,l=r+(a-t)/2;e.rect(n,l,c,t),e.moveTo(n+c,r),e.lineTo(n+i,d),e.lineTo(n+c,r+a),e.closePath();break}case`leftarrowcallout`:{let t=a*(o??5e4)/1e5,c=i*(s??5e4)/1e5,l=r+(a-t)/2;e.rect(n+i-c,l,c,t),e.moveTo(n+i-c,r),e.lineTo(n,d),e.lineTo(n+i-c,r+a),e.closePath();break}case`uparrowcallout`:{let t=i*(o??5e4)/1e5,c=a*(s??5e4)/1e5,l=n+(i-t)/2;e.rect(l,r+c,t,a-c),e.moveTo(n,r+c),e.lineTo(u,r),e.lineTo(n+i,r+c),e.closePath();break}case`downarrowcallout`:{let t=i*(o??5e4)/1e5,c=a*(s??5e4)/1e5,l=n+(i-t)/2;e.rect(l,r,t,a-c),e.moveTo(n,r+a-c),e.lineTo(u,r+a),e.lineTo(n+i,r+a-c),e.closePath();break}case`leftrightarrowcallout`:{let t=a*(o??5e4)/1e5,c=i*(s??25e3)/1e5,l=r+(a-t)/2;e.rect(n+c,l,i-2*c,t),e.moveTo(n+c,r),e.lineTo(n,d),e.lineTo(n+c,r+a),e.closePath(),e.moveTo(n+i-c,r),e.lineTo(n+i,d),e.lineTo(n+i-c,r+a),e.closePath();break}case`leftrightuparrow`:{let t=i*(o??25e3)/1e5,c=a*(s??3e4)/1e5,l=n+(i-t)/2;e.moveTo(u,r),e.lineTo(n+i,r+c),e.lineTo(l+t,r+c),e.lineTo(l+t,r+a),e.lineTo(l,r+a),e.lineTo(l,r+c),e.lineTo(n,r+c),e.closePath();break}case`uturnarrow`:{let t=i*(o??25e3)/1e5,s=(i-t)/2,c=Math.max(0,s-t),l=n+t+s,u=r+t+s,d=t*2,f=r+a-t*2.5;e.moveTo(n,r+a),e.lineTo(n,u),e.arc(l,u,s,Math.PI,0),e.lineTo(n+i,f),e.lineTo(n+i+(d-t)/2,f),e.lineTo(l+t/2,r+a),e.lineTo(n+i-(d-t)/2-t,f),e.lineTo(n+i-t,f),e.lineTo(n+i-t,u),e.arc(l,u,c,0,Math.PI,!0),e.lineTo(n+t,r+a),e.closePath();break}case`bentarrow`:case`bentuparrow`:{let t=Math.min(i,a)*.25;e.moveTo(n,d-t/2),e.lineTo(n+i-t*2,d-t/2),e.lineTo(n+i-t*2,r+t),e.lineTo(n+i,d),e.lineTo(n+i-t*2,r+a-t),e.lineTo(n+i-t*2,d+t/2),e.lineTo(n,d+t/2),e.closePath();break}case`plus`:{let t=Math.min(i,a)*(o??25e3)/1e5;e.rect(u-t,r,2*t,a),e.rect(n,d-t,i,2*t);break}case`mathnotequal`:{let t=Math.min(5e4,Math.max(0,o??23520)),n=Math.min(66e5,Math.max(42e5,s??66e5)),l=Math.min(1e5-2*t,Math.max(0,c??11760)),f=a*t/1e5,p=a*l/2e5,m=i*73490/2e5,h=a/2,g=(n/6e4-90)*Math.PI/180,_=h*Math.tan(g),v=Math.hypot(_,h)*f/h;e.rect(u-m,d-p-f,2*m,f),e.rect(u-m,d+p,2*m,f),e.moveTo(u+_-v/2,r),e.lineTo(u+_+v/2,r),e.lineTo(u-_+v/2,r+a),e.lineTo(u-_-v/2,r+a),e.closePath();break}case`flowchartdelay`:{let t=a/2;e.moveTo(n,r),e.lineTo(n+i-t,r),e.arc(n+i-t,d,t,-Math.PI/2,Math.PI/2),e.lineTo(n,r+a),e.closePath();break}case`flowchartdisplay`:{let t=i*.2,o=i*.15;e.moveTo(n+t,r),e.lineTo(n+i-o,r),e.arc(n+i-o,d,a/2,-Math.PI/2,Math.PI/2),e.lineTo(n+t,r+a),e.lineTo(n,d),e.closePath();break}case`flowchartpunchedcard`:{let t=i*.2;e.moveTo(n+t,r),e.lineTo(n+i,r),e.lineTo(n+i-t,r+a),e.lineTo(n,r+a),e.closePath();break}case`flowchartoffpageconnector`:{let t=a*.3;e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a-t),e.lineTo(u,r+a),e.lineTo(n,r+a-t),e.closePath();break}case`flowchartonlinestorage`:case`flowchartmanuallabel`:case`flowchartpuncheddisk`:e.rect(n,r,i,a);break;case`horizontalscroll`:{let t=Math.min(i,a)*.15;e.roundRect(n+t,r,i-t,a,t),e.moveTo(n+t,r+t*2),e.arc(n+t,r+t,t,Math.PI/2,Math.PI*2.5);break}case`verticalscroll`:{let t=Math.min(i,a)*.15;e.roundRect(n,r+t,i,a-t,t),e.moveTo(n+t*2,r+t),e.arc(n+t,r+t,t,0,Math.PI*2);break}case`ribbon`:{let t=Math.min(33333,Math.max(0,o??16667)),c=i*Math.min(75e3,Math.max(25e3,s??5e4))/2e5,l=i/8,u=i/32,d=i/2-c,f=i/2+c,p=d+u,m=f-u,h=d+l,g=f-l,_=h-u,v=g+u,y=i-l,b=a*t/2e5,x=a*t/1e5,S=a-x,C=S/2;e.moveTo(n,r),e.lineTo(n+_,r),e.lineTo(n+p,r+b),e.lineTo(n+m,r+x),e.lineTo(n+v,r+b),e.lineTo(n+i,r),e.lineTo(n+y,r+C),e.lineTo(n+i,r+S),e.lineTo(n+f,r+S),e.lineTo(n+f,r+a),e.lineTo(n+p,r+a),e.lineTo(n+d,r+S),e.lineTo(n,r+S),e.lineTo(n+l,r+C),e.closePath();break}case`ribbon2`:{let t=Math.min(33333,Math.max(0,o??16667)),c=i*Math.min(75e3,Math.max(25e3,s??5e4))/2e5,l=i/8,u=i/32,d=i/2-c,f=i/2+c,p=d+u,m=f-u,h=d+l,g=f-l,_=h-u,v=g+u,y=i-l,b=a*t/2e5,x=a*t/1e5,S=a-b,C=a-x,w=x,T=(w+a)/2;e.moveTo(n,r+a),e.lineTo(n+_,r+a),e.lineTo(n+p,r+S),e.lineTo(n+m,r+C),e.lineTo(n+v,r+S),e.lineTo(n+i,r+a),e.lineTo(n+y,r+T),e.lineTo(n+i,r+w),e.lineTo(n+f,r+w),e.lineTo(n+f,r),e.lineTo(n+p,r),e.lineTo(n+d,r+w),e.lineTo(n,r+w),e.lineTo(n+l,r+T),e.closePath();break}case`ellipseribbon`:{let t=Math.min(1e5,Math.max(0,o??25e3)),l=Math.min(75e3,Math.max(25e3,s??5e4)),u=Math.max(0,t-(1e5-t)/2),d=Math.min(t,Math.max(u,c??12500)),f=i/8,p=i*l/2e5,m=i/2-p,h=m+f,g=i-h,_=i-m,v=i-f,y=a*d/1e5,b=4*y/i,x=b*(h-h*h/i),S=h/2,C=b*S,w=i-S,T=a*t/1e5,E=T-y,D=b*(m-m*m/i),O=D+E,k=y+E-O+y+E,A=a-T,j=(y*14/16+A)/2,M=D+A,N=O+A,ee=m/2,te=b*ee+A,P=i-ee,ne=k+A;e.moveTo(n,r),e.quadraticCurveTo(n+S,r+C,n+h,r+x),e.lineTo(n+m,r+O),e.quadraticCurveTo(n+i/2,r+k,n+_,r+O),e.lineTo(n+g,r+x),e.quadraticCurveTo(n+w,r+C,n+i,r),e.lineTo(n+v,r+j),e.lineTo(n+i,r+A),e.quadraticCurveTo(n+P,r+te,n+_,r+M),e.lineTo(n+_,r+N),e.quadraticCurveTo(n+i/2,r+ne,n+m,r+N),e.lineTo(n+m,r+M),e.quadraticCurveTo(n+ee,r+te,n,r+A),e.lineTo(n+f,r+j),e.closePath();break}case`ellipseribbon2`:{let t=Math.min(1e5,Math.max(0,o??25e3)),l=Math.min(75e3,Math.max(25e3,s??5e4)),u=Math.max(0,t-(1e5-t)/2),d=Math.min(t,Math.max(u,c??12500)),f=i/8,p=i*l/2e5,m=i/2-p,h=m+f,g=i-h,_=i-m,v=i-f,y=a*d/1e5,b=4*y/i,x=a-b*(h-h*h/i),S=h/2,C=a-b*S,w=i-S,T=a*t/1e5,E=T-y,D=b*(m-m*m/i),O=D+E,k=a-O,A=y+E-O+y+E,j=a-A,M=a-T,N=a-(y*14/16+M)/2,ee=a-(D+M),te=a-(O+M),P=m/2,ne=a-(b*P+M),F=i-P,I=a-(A+M);e.moveTo(n,r+a),e.quadraticCurveTo(n+S,r+C,n+h,r+x),e.lineTo(n+m,r+k),e.quadraticCurveTo(n+i/2,r+j,n+_,r+k),e.lineTo(n+g,r+x),e.quadraticCurveTo(n+w,r+C,n+i,r+a),e.lineTo(n+v,r+N),e.lineTo(n+i,r+T),e.quadraticCurveTo(n+F,r+ne,n+_,r+ee),e.lineTo(n+_,r+te),e.quadraticCurveTo(n+i/2,r+I,n+m,r+te),e.lineTo(n+m,r+ee),e.quadraticCurveTo(n+P,r+ne,n,r+T),e.lineTo(n+f,r+N),e.closePath();break}case`circulararrow`:{let t=(s??0)/6e4*Math.PI/180,n=(o??162e5)/6e4*Math.PI/180,r=(c??5e4)/1e5,l=Math.min(i,a)/2,f=l*(1-r),p=(l+f)/2,m=l-f,h=t+n;e.arc(u,d,l,t,h,!1),e.arc(u,d,f,h,t,!0),e.closePath();let g=Math.sin(h),_=-Math.cos(h),v=m*1.5,y=u+p*Math.cos(h)+v*g,b=d+p*Math.sin(h)+v*_;e.moveTo(y,b),e.lineTo(u+l*Math.cos(h),d+l*Math.sin(h)),e.lineTo(u+f*Math.cos(h),d+f*Math.sin(h)),e.closePath();break}case`curvedrightarrow`:{let t=Math.min(i,a),l=a/2,u=5e4*a/t,d=Math.min(u,Math.max(0,s??5e4)),f=t*Math.min(d,Math.max(0,o??25e3))/1e5,p=t*d/1e5,m=l-(f+p)/4,h=(2*m)**2-f**2,g=1e5*(Math.sqrt(Math.max(0,h))*i/(2*m))/t,_=t*Math.min(g,Math.max(0,c??25e3))/1e5,v=Math.sqrt(Math.max(0,i*i-_*_))*m/i,y=m+f,b=m+v,x=y+v,S=(p-f)/2,C=b-S,w=x+S,T=a-p/2,E=i-_,D=Math.atan2(_,v),O=-D,k=Math.PI-D;e.moveTo(n,r+m),lr(e,n,r+m,i,m,Math.PI,O),e.lineTo(n+E,r+C),e.lineTo(n+i,r+T),e.lineTo(n+E,r+w),e.lineTo(n+E,r+x),lr(e,n+E,r+x,i,m,k,D),e.closePath();break}case`curvedleftarrow`:{let t=Math.min(i,a),l=a/2,u=5e4*a/t,d=Math.min(u,Math.max(0,s??5e4)),f=t*Math.min(d,Math.max(0,o??25e3))/1e5,p=t*d/1e5,m=l-(f+p)/4,h=(2*m)**2-f**2,g=Math.sqrt(Math.max(0,h))*i/(2*m),_=1e5*g/t,v=t*Math.min(_,Math.max(0,c??25e3))/1e5,y=Math.sqrt(Math.max(0,i*i-v*v))*m/i,b=m+f,x=m+y,S=b+y,C=(p-f)/2,w=x-C,T=S+C,E=a-p/2,D=v,O=Math.atan2(v,y),k=f/2,A=Math.atan2(k,g),j=A-O,M=O-A,N=-A;e.moveTo(n,r+E),e.lineTo(n+D,r+w),e.lineTo(n+D,r+x);let ee=lr(e,n+D,r+x,i,m,O,j);lr(e,ee.x,ee.y,i,m,N,M),e.lineTo(n+D,r+T),e.closePath();break}case`curveduparrow`:{let t=Math.min(i,a),l=i/2,u=5e4*i/t,d=Math.min(u,Math.max(0,s??5e4)),f=t*Math.min(1e5,Math.max(0,o??25e3))/1e5,p=t*d/1e5,m=l-(f+p)/4,h=(2*m)**2-f**2,g=Math.sqrt(Math.max(0,h))*a/(2*m),_=1e5*g/t,v=t*Math.min(_,Math.max(0,c??25e3))/1e5,y=Math.sqrt(Math.max(0,a*a-v*v))*m/a,b=m+f,x=m+y,S=b+y,C=(p-f)/2,w=x-C,T=S+C,E=i-p/2,D=v,O=Math.atan2(v,y),k=f/2,A=Math.atan2(k,g),j=A-O,M=O-A,N=Math.PI/2-O,ee=Math.PI/2-A;e.moveTo(n+E,r),e.lineTo(n+T,r+D),e.lineTo(n+S,r+D);let te=lr(e,n+S,r+D,m,a,N,M);lr(e,te.x,te.y,m,a,ee,j),e.lineTo(n+w,r+D),e.closePath();break}case`curveddownarrow`:{let t=Math.min(i,a),l=i/2,u=5e4*i/t,d=Math.min(u,Math.max(0,s??5e4)),f=t*Math.min(1e5,Math.max(0,o??25e3))/1e5,p=t*d/1e5,m=l-(f+p)/4,h=(2*m)**2-f**2,g=Math.sqrt(Math.max(0,h))*a/(2*m),_=1e5*g/t,v=t*Math.min(_,Math.max(0,c??25e3))/1e5,y=Math.sqrt(Math.max(0,a*a-v*v))*m/a,b=m+f,x=m+y,S=b+y,C=(p-f)/2,w=x-C,T=S+C,E=i-p/2,D=a-v,O=Math.atan2(v,y),k=f/2,A=Math.atan2(k,g),j=3*Math.PI/2+O;3*Math.PI/2-A,A-Math.PI/2,Math.PI/2-A,e.moveTo(n+E,r+a),e.lineTo(n+w,r+D),e.lineTo(n+x,r+D),lr(e,n+x,r+D,m,a,j,-O),e.lineTo(n+b,r),lr(e,n+b,r,m,a,3*Math.PI/2,O),e.lineTo(n+T,r+D),e.closePath();break}case`stripedrightarrow`:{let t=Math.min(i,a),c=t/32,l=t/16,u=t/8,f=t*(o??5e4)/1e5,p=i*(s??5e4)/1e5,m=d-f/2,h=d+f/2,g=n+i-p;e.rect(n,m,c,f),e.rect(n+l,m,l,f),e.rect(n+u,m,u,f),e.moveTo(g,m),e.lineTo(g,r),e.lineTo(n+i,d),e.lineTo(g,r+a),e.lineTo(g,h),e.lineTo(n+u*2,h),e.lineTo(n+u*2,m),e.closePath();break}case`flowchartmagneticdisk`:{let t=a*.15;e.moveTo(n,r+t),e.ellipse(u,r+t,i/2,t,0,Math.PI,0),e.lineTo(n+i,r+a-t),e.ellipse(u,r+a-t,i/2,t,0,0,Math.PI),e.lineTo(n,r+t),e.closePath(),e.moveTo(n+i,r+t),e.ellipse(u,r+t,i/2,t,0,0,Math.PI);break}case`flowchartmagneticdrum`:{let t=i*.15;e.moveTo(n+t,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a),e.lineTo(n+t,r+a),e.ellipse(n+t,d,t,a/2,0,Math.PI/2,-Math.PI/2,!0),e.closePath(),e.moveTo(n+i,r),e.ellipse(n+i,d,t,a/2,0,-Math.PI/2,Math.PI/2);break}case`flowchartmagnetictape`:{let t=Math.min(i,a)/2,n=u+t*.5;e.moveTo(u,r+a),e.arc(u,d,t,Math.PI/2,Math.PI/2+Math.PI*2*.875),e.lineTo(n,d+t*.5),e.lineTo(n,r+a),e.closePath();break}case`flowchartpunchedtape`:{let t=a*.12;e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a-t),e.bezierCurveTo(n+i*.75,r+a,n+i*.25,r+a-t*2,n,r+a-t),e.closePath(),e.moveTo(n,r+t),e.bezierCurveTo(n+i*.25,r,n+i*.75,r+t*2,n+i,r+t);break}case`flowchartmanualoperation`:{let t=i*.15;e.moveTo(n+t,r),e.lineTo(n+i-t,r),e.lineTo(n+i,r+a),e.lineTo(n,r+a),e.closePath();break}case`flowchartmultidocument`:{let t=a*.1,o=i*.04;e.rect(n+o*2,r-a*.08,i-o*2,a*.1),e.rect(n+o,r-a*.04,i-o,a*.06),e.moveTo(n,r),e.lineTo(n+i,r),e.lineTo(n+i,r+a-t),e.bezierCurveTo(n+i*.75,r+a,n+i*.25,r+a-t*2,n,r+a-t),e.closePath();break}case`rttriangle`:e.moveTo(n,r),e.lineTo(n,r+a),e.lineTo(n+i,r+a),e.closePath();break;default:e.rect(n,r,i,a);break}}function hr(e,t,n){let r=Math.max(.5,t.width*n),i=e.w===`sm`?4:e.w===`lg`?8:6,a=e.len===`sm`?4:e.len===`lg`?8:6;return{lw:r,halfW:r*i/2,len:r*a}}const gr=new Set([`triangle`,`stealth`,`diamond`,`oval`]);function _r(e,t,n){return gr.has(e.type)?hr(e,t,n).len:0}function vr(e,t,n){if(n<=0)return{x:e.x,y:e.y};let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i);if(a<1e-9)return{x:e.x,y:e.y};let o=Math.min(n,a)/a;return{x:e.x+r*o,y:e.y+i*o}}function yr(e,t,n,r,i,a,o){if(i.type===`none`)return;let{lw:s,halfW:c,len:l}=hr(i,a,o),u=ot(a.color);switch(e.save(),e.translate(t,n),e.rotate(r),e.fillStyle=u,e.strokeStyle=u,e.lineWidth=s,e.setLineDash([]),e.beginPath(),i.type){case`triangle`:case`stealth`:e.moveTo(0,0),e.lineTo(-l,-c),e.lineTo(-l,c),e.closePath(),e.fill();break;case`arrow`:e.moveTo(0,0),e.lineTo(-l,-c),e.moveTo(0,0),e.lineTo(-l,c),e.stroke();break;case`diamond`:e.moveTo(0,0),e.lineTo(-l/2,-c),e.lineTo(-l,0),e.lineTo(-l/2,c),e.closePath(),e.fill();break;case`oval`:e.ellipse(-l/2,0,l/2,c,0,0,Math.PI*2),e.fill();break}e.restore()}const br=new Set([`line`,`straightconnector1`,`bentconnector2`,`bentconnector3`,`bentconnector4`,`bentconnector5`,`curvedconnector2`,`curvedconnector3`,`curvedconnector4`,`curvedconnector5`]),xr=new Set([`callout1`,`callout2`,`callout3`,`bordercallout1`,`bordercallout2`,`bordercallout3`,`accentcallout1`,`accentcallout2`,`accentcallout3`,`accentbordercallout1`,`accentbordercallout2`,`accentbordercallout3`]);function Sr(e){return xr.has(e)||e===`line`||e===`straightconnector1`||e.startsWith(`bentconnector`)}function Cr(e,t,n,r){if(ft(e,t,n),t.fill){let n=lt(t.fill,e,r.x,r.y,r.w,r.h);n&&(e.strokeStyle=n)}}function wr(e,t,n,r){let i=t.stroke;if(!i||!br.has(n)&&!xr.has(n))return;let{x:a,y:o,w:s,h:c}=t.rect,l=ar(n,a,o,s,c,[...t.geometry.kind===`preset`?t.geometry.adjustments:[]]);if(l){if(Sr(n)&&l.vertices.length>=2&&(i.headEnd||i.tailEnd)){let n=l.vertices.map(e=>({x:e.x,y:e.y}));i.tailEnd&&(n[n.length-1]=vr(n[n.length-1],n[n.length-2],_r(i.tailEnd,i,r))),i.headEnd&&(n[0]=vr(n[0],n[1],_r(i.headEnd,i,r))),Cr(e,i,r,t.rect),e.beginPath(),e.moveTo(n[0].x,n[0].y);for(let t=1;t<n.length;t++)e.lineTo(n[t].x,n[t].y);e.stroke()}i.tailEnd&&yr(e,l.end.x,l.end.y,l.end.angle,i.tailEnd,i,r),i.headEnd&&yr(e,l.start.x,l.start.y,l.start.angle,i.headEnd,i,r)}}function Tr(e,t,n){if(t.geometry.kind!==`custom`)return;let r=t.stroke;if(!r||!r.headEnd&&!r.tailEnd)return;let i=Vn(t.geometry.subpaths),{x:a,y:o,w:s,h:c}=t.rect;i.start&&r.headEnd&&yr(e,a+i.start.x*s,o+i.start.y*c,Math.atan2(i.start.dy*c,i.start.dx*s),r.headEnd,r,n),i.end&&r.tailEnd&&yr(e,a+i.end.x*s,o+i.end.y*c,Math.atan2(i.end.dy*c,i.end.dx*s),r.tailEnd,r,n)}function Er(e,t,n){let{x:r,y:i,w:a,h:o}=t.rect,{rotationDeg:s,flipH:c,flipV:l}=t.transform;e.save();try{(s!==0||c||l)&&(e.translate(r+a/2,i+o/2),s!==0&&e.rotate(s*Math.PI/180),e.scale(c?-1:1,l?-1:1),e.translate(-(r+a/2),-(i+o/2)));let u=lt(t.fill,e,r,i,a,o),d=t.stroke,f=d?()=>{Cr(e,d,n,t.rect),e.stroke()}:null;if(t.geometry.kind===`preset`){let s=t.geometry.name.toLowerCase(),c=[...t.geometry.adjustments],l=Sr(s)&&!!(d?.headEnd||d?.tailEnd);$n(s)&&ir(e,s,r,i,a,o,c,u,f,()=>{},l?{skipTrailingStroke:!0}:void 0)||(e.beginPath(),mr(e,s,r,i,a,o,c[0],c[1],c[2],c[3]),u&&s!==`arc`&&(e.fillStyle=u,s===`donut`||s===`smileyface`||s===`frame`?e.fill(`evenodd`):e.fill()),f&&f()),wr(e,t,s,n)}else e.beginPath(),Mn(e,t.geometry.subpaths,r,i,a,o),u&&(e.fillStyle=u,e.fill()),f&&f(),Tr(e,t,n)}finally{e.restore()}}const Dr=new WeakMap;function Or(e){let t=Dr.get(e);return t||(t={imgs:new Map,urls:new Map},Dr.set(e,t)),t}function kr(e,t){e.imgs.delete(t);let n=e.urls.get(t);n&&(URL.revokeObjectURL(n),e.urls.delete(t))}function Ar(e,t){let n=Or(t),r=n.imgs.get(e);if(r)return n.imgs.delete(e),n.imgs.set(e,r),r;let i=(async()=>{let r=await t(e,`image/svg+xml`),i=URL.createObjectURL(r);n.urls.set(e,i);let a=new Image;return await new Promise((t,n)=>{a.onload=()=>{typeof a.decode==`function`?a.decode().then(()=>t()).catch(()=>t()):t()},a.onerror=()=>n(Error(`svg load failed: ${e}`)),a.src=i}),a})();if(i.catch(()=>kr(n,e)),n.imgs.set(e,i),n.imgs.size>256){let e=n.imgs.keys().next().value;kr(n,e)}return i}function jr(e){let t=Dr.get(e);if(t){for(let e of t.urls.values())URL.revokeObjectURL(e);t.urls.clear(),t.imgs.clear(),Dr.delete(e)}}const Mr=32767;function Nr(e,t,n,r,i){if(n<40||t+40>e.byteLength)return null;let a=e.getUint32(t,!0);if(a<40)return null;let o=e.getInt32(t+4,!0),s=e.getInt32(t+8,!0),c=e.getUint16(t+14,!0);if(e.getUint32(t+16,!0)!==0)return null;let l=s<0,u=Math.abs(o),d=Math.abs(s);if(u<=0||d<=0||u>Mr||d>Mr||u*d>67108864)return null;let f=new Uint8ClampedArray(u*d*4),p=u*c+31>>5<<2>>>0;if(r+p*d>r+i+p&&r+p*d>e.byteLength)return null;let m=null;if(c<=8){let n=e.getUint32(t+32,!0);n===0&&(n=1<<c);let r=t+a;m=[];for(let t=0;t<n;t++){let n=r+t*4;if(n+4>e.byteLength)break;let i=e.getUint8(n),a=e.getUint8(n+1),o=e.getUint8(n+2);m.push(o<<16|a<<8|i)}}let h=(e,t,n,r,i,a)=>{let o=(e*u+t)*4;f[o]=n,f[o+1]=r,f[o+2]=i,f[o+3]=a},g=!1;for(let t=0;t<d;t++){let n=l?t:d-1-t,i=t,a=r+n*p;if(a+p>e.byteLength)break;if(c===32)for(let t=0;t<u;t++){let n=a+t*4,r=e.getUint8(n),o=e.getUint8(n+1),s=e.getUint8(n+2),c=e.getUint8(n+3);c!==0&&(g=!0),h(i,t,s,o,r,c)}else if(c===24){for(let t=0;t<u;t++){let n=a+t*3;h(i,t,e.getUint8(n+2),e.getUint8(n+1),e.getUint8(n),255)}g=!0}else if(c===8&&m){for(let t=0;t<u;t++){let n=e.getUint8(a+t),r=m[n]??0;h(i,t,r>>16&255,r>>8&255,r&255,255)}g=!0}else if(c===4&&m){for(let t=0;t<u;t++){let n=e.getUint8(a+(t>>1)),r=t&1?n&15:n>>4&15,o=m[r]??0;h(i,t,o>>16&255,o>>8&255,o&255,255)}g=!0}else if(c===1&&m){for(let t=0;t<u;t++){let n=e.getUint8(a+(t>>3))>>7-(t&7)&1,r=m[n]??0;h(i,t,r>>16&255,r>>8&255,r&255,255)}g=!0}else return null}if(c===32&&!g)for(let e=3;e<f.length;e+=4)f[e]=255;return{width:u,height:d,data:f}}function Pr(e,t,n){if(n<40||t+40>e.byteLength)return null;let r=e.getUint32(t,!0);if(r<40)return null;let i=e.getUint16(t+14,!0),a=0;if(i<=8){let n=e.getUint32(t+32,!0);n===0&&(n=1<<i),a=n}else a=e.getUint32(t+32,!0);let o=r+a*4,s=t+o,c=n-o;return c<=0?null:Nr(e,t,o,s,c)}function Fr(e,t,n,r,i,a){try{let o=Xe(t.width,t.height);if(!o)return!1;let s=o.getContext(`2d`);if(!s)return!1;let c=s.createImageData(t.width,t.height);c.data.set(t.data),s.putImageData(c,0,0);let l=Math.min(n,i),u=Math.min(r,a),d=Math.abs(i-n),f=Math.abs(a-r);return e.drawImage(o,l,u,d,f),!0}catch{return!1}}const q={HEADER:1,POLYBEZIER:2,POLYGON:3,POLYLINE:4,POLYBEZIERTO:5,POLYLINETO:6,POLYPOLYLINE:7,POLYPOLYGON:8,SETWINDOWEXTEX:9,SETWINDOWORGEX:10,SETVIEWPORTEXTEX:11,SETVIEWPORTORGEX:12,EOF:14,SETMAPMODE:17,SETPOLYFILLMODE:19,SETBKMODE:18,SETTEXTALIGN:22,SETTEXTCOLOR:24,MOVETOEX:27,SCALEVIEWPORTEXTEX:31,SCALEWINDOWEXTEX:32,SAVEDC:33,RESTOREDC:34,SETWORLDTRANSFORM:35,MODIFYWORLDTRANSFORM:36,SELECTOBJECT:37,CREATEPEN:38,CREATEBRUSHINDIRECT:39,DELETEOBJECT:40,ELLIPSE:42,RECTANGLE:43,LINETO:54,BEGINPATH:59,ENDPATH:60,CLOSEFIGURE:61,SELECTCLIPPATH:67,EXTCREATEFONTINDIRECTW:82,EXTTEXTOUTW:84,POLYBEZIER16:85,POLYGON16:86,POLYLINE16:87,POLYBEZIERTO16:88,POLYLINETO16:89,POLYPOLYLINE16:90,POLYPOLYGON16:91,CREATEMONOBRUSH:93,CREATEDIBPATTERNBRUSHPT:94,EXTCREATEPEN:95,BITBLT:76,STRETCHDIBITS:81},Ir={WHITE_BRUSH:2147483648,LTGRAY_BRUSH:2147483649,GRAY_BRUSH:2147483650,DKGRAY_BRUSH:2147483651,BLACK_BRUSH:2147483652,NULL_BRUSH:2147483653,WHITE_PEN:2147483654,BLACK_PEN:2147483655,NULL_PEN:2147483656,DC_BRUSH:2147483666,DC_PEN:2147483662},Lr={TEXT:1,LOMETRIC:2,HIMETRIC:3,LOENGLISH:4,HIENGLISH:5,TWIPS:6,ISOTROPIC:7,ANISOTROPIC:8},Rr=()=>({m11:1,m12:0,m21:0,m22:1,dx:0,dy:0});function zr(e,t){return{m11:e.m11*t.m11+e.m21*t.m12,m12:e.m12*t.m11+e.m22*t.m12,m21:e.m11*t.m21+e.m21*t.m22,m22:e.m12*t.m21+e.m22*t.m22,dx:e.m11*t.dx+e.m21*t.dy+e.dx,dy:e.m12*t.dx+e.m22*t.dy+e.dy}}var Br=class{p;constructor(e,t,n){this.dv=e,this.end=n,this.p=t}get pos(){return this.p}set pos(e){this.p=e}get remaining(){return this.end-this.p}i16(){let e=this.dv.getInt16(this.p,!0);return this.p+=2,e}i32(){let e=this.dv.getInt32(this.p,!0);return this.p+=4,e}u32(){let e=this.dv.getUint32(this.p,!0);return this.p+=4,e}f32(){let e=this.dv.getFloat32(this.p,!0);return this.p+=4,e}xform(){return{m11:this.f32(),m12:this.f32(),m21:this.f32(),m22:this.f32(),dx:this.f32(),dy:this.f32()}}skip(e){this.p+=e}};function Vr(e,t,n){return e.wt.m11*t+e.wt.m21*n+e.wt.dx}function Hr(e,t,n){return e.wt.m12*t+e.wt.m22*n+e.wt.dy}function Ur(e){return e.winExtX===0?1:e.vpExtX/e.winExtX}function Wr(e){return e.winExtY===0?1:e.vpExtY/e.winExtY}function Gr(e){return Math.min(Math.abs(Ur(e)),Math.abs(Wr(e)))}function Kr(e){return e.mapMode===Lr.ISOTROPIC?Ur(e)<0?-Gr(e):Gr(e):Ur(e)}function qr(e){return e.mapMode===Lr.ISOTROPIC?Wr(e)<0?-Gr(e):Gr(e):Wr(e)}function Jr(e,t){return(t-e.winOrgX)*Kr(e)+e.vpOrgX}function Yr(e,t){return(t-e.winOrgY)*qr(e)+e.vpOrgY}function Xr(e,t,n){let r=Jr(e,Vr(e,t,n)),i=Yr(e,Hr(e,t,n));return[(r-e.left)*e.W/e.boundsW,(i-e.top)*e.H/e.boundsH]}function Zr(e){return(Math.hypot(e.wt.m11,e.wt.m12)+Math.hypot(e.wt.m21,e.wt.m22))/2}function Qr(e){return(Math.abs(Kr(e))+Math.abs(qr(e)))/2}function $r(e){return(e.W/e.boundsW+e.H/e.boundsH)/2}function ei(e){return Math.hypot(e.wt.m21,e.wt.m22)}function ti(e){return e.H/e.boundsH}function ni(e,t){let n=t*Zr(e)*Qr(e)*$r(e);return Math.max(.75,n)}function ri(e,t){if(e.mapMode=t,t===Lr.TEXT){e.winOrgX=0,e.winOrgY=0,e.vpOrgX=0,e.vpOrgY=0,e.winExtX=1,e.winExtY=1,e.vpExtX=1,e.vpExtY=1;return}if(t===Lr.ANISOTROPIC||t===Lr.ISOTROPIC||e.devPxPerMmX<=0||e.devPxPerMmY<=0)return;let n=25.4,r=t===Lr.LOMETRIC?.1:t===Lr.HIMETRIC?.01:t===Lr.LOENGLISH?.01*n:t===Lr.HIENGLISH?.001*n:t===Lr.TWIPS?n/1440:0;r<=0||(e.winOrgX=0,e.winOrgY=0,e.vpOrgX=0,e.vpOrgY=0,e.winExtX=1,e.winExtY=1,e.vpExtX=r*e.devPxPerMmX,e.vpExtY=-(r*e.devPxPerMmY))}const ii={[Ir.WHITE_BRUSH]:{kind:`brush`,fill:`#ffffff`},[Ir.LTGRAY_BRUSH]:{kind:`brush`,fill:`#c0c0c0`},[Ir.GRAY_BRUSH]:{kind:`brush`,fill:`#808080`},[Ir.DKGRAY_BRUSH]:{kind:`brush`,fill:`#404040`},[Ir.BLACK_BRUSH]:{kind:`brush`,fill:`#000000`},[Ir.NULL_BRUSH]:{kind:`brush`,fill:null}},ai={[Ir.WHITE_PEN]:{kind:`pen`,stroke:`#ffffff`,width:1},[Ir.BLACK_PEN]:{kind:`pen`,stroke:`#000000`,width:1},[Ir.NULL_PEN]:{kind:`pen`,stroke:null,width:1},[Ir.DC_PEN]:{kind:`pen`,stroke:`#000000`,width:1}};function oi(e,t){let n=ii[t];if(n){e.curBrush=n;return}let r=ai[t];if(r){e.curPen=r;return}t===Ir.DC_BRUSH&&(e.curBrush=e.curBrush??{kind:`brush`,fill:`#000000`})}function si(e){let t=0,n=0,r=0,i=0;for(let a=0;a<e.data.length;a+=4)e.data[a+3]!==0&&(t+=e.data[a],n+=e.data[a+1],r+=e.data[a+2],i++);if(i===0)return`#808080`;let a=e=>Math.round(e/i).toString(16).padStart(2,`0`);return`#${a(t)}${a(n)}${a(r)}`}const ci=e=>[e.i16(),e.i16()],li=e=>[e.i32(),e.i32()];function ui(e,t,n){t.skip(16);let r=t.u32();if(r<2||r>1048576||!e.curPen||e.curPen.stroke==null)return;let{ctx:i}=e;i.beginPath();let a=0,o=0;for(let s=0;s<r&&!(t.remaining<4);s++){let[r,c]=n(t),[l,u]=Xr(e,r,c);s===0?i.moveTo(l,u):i.lineTo(l,u),a=r,o=c}i.strokeStyle=e.curPen.stroke,i.lineWidth=ni(e,e.curPen.width),i.stroke(),e.drew=!0,e.curX=a,e.curY=o}function di(e,t,n){t.skip(16);let r=t.u32();if(r<1||r>1048576)return;let{ctx:i}=e,a=e.curPen!=null&&e.curPen.stroke!=null;if(a){i.beginPath();let[t,n]=Xr(e,e.curX,e.curY);i.moveTo(t,n)}for(let o=0;o<r&&!(t.remaining<4);o++){let[r,o]=n(t);if(a){let[t,n]=Xr(e,r,o);i.lineTo(t,n)}e.curX=r,e.curY=o}a&&e.curPen&&(i.strokeStyle=e.curPen.stroke,i.lineWidth=ni(e,e.curPen.width),i.stroke(),e.drew=!0)}function fi(e,t,n){t.skip(16);let r=t.u32();if(r<2||r>1048576)return;let{ctx:i}=e;e.inPath||i.beginPath();let a=!1;for(let o=0;o<r&&!(t.remaining<4);o++){let[r,o]=n(t),[s,c]=Xr(e,r,o);a?i.lineTo(s,c):(i.moveTo(s,c),a=!0)}a&&(i.closePath(),!e.inPath&&(e.curBrush&&e.curBrush.fill!=null&&(i.fillStyle=e.curBrush.fill,i.fill(e.fillRule),e.drew=!0),e.curPen&&e.curPen.stroke!=null&&(i.strokeStyle=e.curPen.stroke,i.lineWidth=ni(e,e.curPen.width),i.stroke(),e.drew=!0)))}function pi(e,t,n,r){t.skip(16);let i=t.u32();if(i<1||i>1048576)return;let a=[];for(let e=0;e<i&&!(t.remaining<4);e++)a.push(n(t));if(a.length<(r?3:4)){a.length&&(e.curX=a[a.length-1][0],e.curY=a[a.length-1][1]);return}let o=e.curPen!=null&&e.curPen.stroke!=null,{ctx:s}=e;if(o){s.beginPath();let t=r?Xr(e,e.curX,e.curY):Xr(e,a[0][0],a[0][1]);s.moveTo(t[0],t[1])}let c=+!r;for(;c+2<a.length+ +!!r;c+=3){let t=a[c],n=a[c+1],r=a[c+2];if(!t||!n||!r)break;if(o){let i=Xr(e,t[0],t[1]),a=Xr(e,n[0],n[1]),o=Xr(e,r[0],r[1]);s.bezierCurveTo(i[0],i[1],a[0],a[1],o[0],o[1])}e.curX=r[0],e.curY=r[1]}o&&e.curPen&&(s.strokeStyle=e.curPen.stroke,s.lineWidth=ni(e,e.curPen.width),s.stroke(),e.drew=!0)}function mi(e,t,n,r){t.skip(16);let i=t.u32(),a=t.u32();if(i<=0||i>65536||a<=0||a>2097152)return;let o=[];for(let e=0;e<i;e++){if(t.remaining<4)return;o.push(t.u32())}let{ctx:s}=e;e.inPath||s.beginPath();let c=!1;for(let i of o){if(i<2){for(let e=0;e<i&&t.remaining>=4;e++)n(t);continue}for(let r=0;r<i&&!(t.remaining<4);r++){let[i,a]=n(t),[o,c]=Xr(e,i,a);r===0?s.moveTo(o,c):s.lineTo(o,c)}r&&s.closePath(),c=!0}!c||e.inPath||(r&&e.curBrush&&e.curBrush.fill!=null&&(s.fillStyle=e.curBrush.fill,s.fill(e.fillRule),e.drew=!0),e.curPen&&e.curPen.stroke!=null&&(s.strokeStyle=e.curPen.stroke,s.lineWidth=ni(e,e.curPen.width),s.stroke(),e.drew=!0))}function hi(e,t,n,r,i){let{ctx:a}=e,o=Xr(e,t,n),s=Xr(e,r,n),c=Xr(e,r,i),l=Xr(e,t,i);e.inPath||a.beginPath(),a.moveTo(o[0],o[1]),a.lineTo(s[0],s[1]),a.lineTo(c[0],c[1]),a.lineTo(l[0],l[1]),a.closePath(),!e.inPath&&(e.curBrush&&e.curBrush.fill!=null&&(a.fillStyle=e.curBrush.fill,a.fill(e.fillRule),e.drew=!0),e.curPen&&e.curPen.stroke!=null&&(a.strokeStyle=e.curPen.stroke,a.lineWidth=ni(e,e.curPen.width),a.stroke(),e.drew=!0))}function gi(e){let t=e.u32(),n=e.u32(),r=e.i32();e.i32();let i=e.u32();return[t,{kind:`pen`,stroke:(n&255)==5?null:Ui(i),width:Math.abs(r)}]}function _i(e){let t=e.u32();e.skip(16);let n=e.u32(),r=e.u32();e.u32();let i=e.u32();return[t,{kind:`pen`,stroke:(n&255)==5?null:Ui(i),width:Math.abs(r)}]}function vi(e){let t=e.u32(),n=e.u32(),r=e.u32();return e.u32(),[t,{kind:`brush`,fill:n===1?null:Ui(r)}]}function yi(e,t,n){let r=e.u32();e.u32();let i=e.u32(),a=e.u32(),o=e.u32(),s=e.u32(),c=`#808080`;try{let e=Nr(t,n+i,a,n+o,s);e&&(c=si(e))}catch{}return[r,{kind:`brush`,fill:c}]}function bi(e,t,n){let r=e.u32(),i=n+12,a=t.getInt32(i,!0),o=t.getInt32(i+8,!0),s=t.getInt32(i+16,!0),c=t.getUint8(i+20),l=``;for(let e=0;e<32;e++){let n=i+28+e*2;if(n+2>t.byteLength)break;let r=t.getUint16(n,!0);if(r===0)break;l+=String.fromCharCode(r)}return[r,{kind:`font`,height:Math.abs(a),weight:s,italic:c!==0,face:l,escapement:o}]}function xi(e,t,n,r){t.skip(16),t.u32(),t.f32(),t.f32();let i=t.i32(),a=t.i32(),o=t.u32(),s=t.u32();if(t.u32(),o<=0||o>65536)return;let c=``;for(let e=0;e<o;e++){let t=r+s+e*2;if(t+2>n.byteLength)break;c+=String.fromCharCode(n.getUint16(t,!0))}if(c.length===0)return;let l=e.curFont,u=Math.abs(l?.height??0)*ei(e)*Math.abs(qr(e))*ti(e);if(!Number.isFinite(u)||u<1)return;let{ctx:d}=e,[f,p]=Xr(e,i,a);d.fillStyle=e.textColor;let m=l&&l.weight>=700?`bold `:``;d.font=`${l?.italic?`italic `:``}${m}${u}px ${l?.face||`sans-serif`}`;let h=e.textAlign&6;d.textAlign=h===2?`right`:h===6?`center`:`left`,d.textBaseline=(e.textAlign&24)==24?`alphabetic`:`top`;let g=l?.escapement??0;try{if(g!==0){d.save();try{d.translate(f,p),d.rotate(-g/10*(Math.PI/180)),d.fillText(c,0,0)}finally{d.restore()}}else d.fillText(c,f,p);e.drew=!0}catch{}}function Si(e,t,n,r,i,a,o,s,c,l,u){if(i===0||o===0)return;let d=Nr(t,n+r,i,n+a,o);if(!d)return;let[f,p]=Xr(e,s,c),[m,h]=Xr(e,l,u);Fr(e.ctx,d,f,p,m,h)&&(e.drew=!0)}function Ci(e,t,n,r){t.skip(16);let i=t.i32(),a=t.i32(),o=t.i32(),s=t.i32();t.u32(),t.i32(),t.i32(),t.skip(24),t.u32(),t.u32(),Si(e,n,r,t.u32(),t.u32(),t.u32(),t.u32(),i,a,i+o,a+s)}function wi(e,t,n,r){t.skip(16);let i=t.i32(),a=t.i32();t.i32(),t.i32(),t.i32(),t.i32();let o=t.u32(),s=t.u32(),c=t.u32(),l=t.u32();t.u32(),t.u32();let u=t.i32(),d=t.i32();Si(e,n,r,o,s,c,l,i,a,i+u,a+d)}function Ti(e,t,n,r){if(!Vi(e)||n<=0||r<=0)return!1;let i=new DataView(e.buffer,e.byteOffset,e.byteLength),a={ctx:t,W:n,H:r,left:0,top:0,boundsW:n,boundsH:r,wt:Rr(),mapMode:Lr.TEXT,winOrgX:0,winOrgY:0,winExtX:1,winExtY:1,vpOrgX:0,vpOrgY:0,vpExtX:1,vpExtY:1,devPxPerMmX:0,devPxPerMmY:0,objects:new Map,curPen:null,curBrush:null,curFont:null,textColor:`#000000`,bkMode:1,textAlign:0,fillRule:`nonzero`,curX:0,curY:0,stack:[],drew:!1,inPath:!1},o=0;for(;o+8<=e.length;){let n=i.getUint32(o,!0),r=i.getUint32(o+4,!0);if(r<8||r&3)break;let s=o+r;if(s>e.length||n===q.EOF)break;let c=new Br(i,o+8,s);try{switch(n){case q.HEADER:{let e=i.getInt32(o+8,!0),t=i.getInt32(o+12,!0),n=i.getInt32(o+16,!0),r=i.getInt32(o+20,!0);if(a.left=e,a.top=t,a.boundsW=Math.max(1,n-e),a.boundsH=Math.max(1,r-t),s>=o+88){let e=i.getInt32(o+24,!0),t=i.getInt32(o+28,!0),n=i.getInt32(o+32,!0),r=i.getInt32(o+36,!0),s=i.getInt32(o+72,!0),c=i.getInt32(o+76,!0),l=i.getInt32(o+80,!0),u=i.getInt32(o+84,!0),d=n-e,f=r-t;if(d>0&&f>0&&s>0&&c>0&&l>0&&u>0){let n=s/(l*100),r=c/(u*100);a.left=e*n,a.top=t*r,a.boundsW=Math.max(1,d*n),a.boundsH=Math.max(1,f*r),a.devPxPerMmX=s/l,a.devPxPerMmY=c/u}}break}case q.SETWORLDTRANSFORM:a.wt=c.xform();break;case q.MODIFYWORLDTRANSFORM:{let e=c.xform(),t=c.u32();t===1?a.wt=Rr():t===2?a.wt=zr(e,a.wt):t===3?a.wt=zr(a.wt,e):t===4&&(a.wt=e);break}case q.SETMAPMODE:ri(a,c.u32());break;case q.SETWINDOWORGEX:a.winOrgX=c.i32(),a.winOrgY=c.i32();break;case q.SETWINDOWEXTEX:{let e=c.i32(),t=c.i32();e!==0&&(a.winExtX=e),t!==0&&(a.winExtY=t);break}case q.SETVIEWPORTORGEX:a.vpOrgX=c.i32(),a.vpOrgY=c.i32();break;case q.SETVIEWPORTEXTEX:{let e=c.i32(),t=c.i32();e!==0&&(a.vpExtX=e),t!==0&&(a.vpExtY=t);break}case q.SCALEWINDOWEXTEX:{let e=c.i32(),t=c.i32(),n=c.i32(),r=c.i32();t!==0&&(a.winExtX=a.winExtX*e/t),r!==0&&(a.winExtY=a.winExtY*n/r);break}case q.SCALEVIEWPORTEXTEX:{let e=c.i32(),t=c.i32(),n=c.i32(),r=c.i32();t!==0&&(a.vpExtX=a.vpExtX*e/t),r!==0&&(a.vpExtY=a.vpExtY*n/r);break}case q.SAVEDC:a.ctx.save(),a.stack.push({wt:{...a.wt},mapMode:a.mapMode,winOrgX:a.winOrgX,winOrgY:a.winOrgY,winExtX:a.winExtX,winExtY:a.winExtY,vpOrgX:a.vpOrgX,vpOrgY:a.vpOrgY,vpExtX:a.vpExtX,vpExtY:a.vpExtY,curPen:a.curPen,curBrush:a.curBrush,curFont:a.curFont,textColor:a.textColor,bkMode:a.bkMode,textAlign:a.textAlign,fillRule:a.fillRule,curX:a.curX,curY:a.curY});break;case q.RESTOREDC:{let e=c.i32(),t=Math.min(Math.abs(e)||1,a.stack.length),n;for(let e=0;e<t;e++)n=a.stack.pop(),a.ctx.restore();n&&(a.wt=n.wt,a.mapMode=n.mapMode,a.winOrgX=n.winOrgX,a.winOrgY=n.winOrgY,a.winExtX=n.winExtX,a.winExtY=n.winExtY,a.vpOrgX=n.vpOrgX,a.vpOrgY=n.vpOrgY,a.vpExtX=n.vpExtX,a.vpExtY=n.vpExtY,a.curPen=n.curPen,a.curBrush=n.curBrush,a.curFont=n.curFont,a.textColor=n.textColor,a.bkMode=n.bkMode,a.textAlign=n.textAlign,a.fillRule=n.fillRule,a.curX=n.curX,a.curY=n.curY);break}case q.BEGINPATH:a.ctx.beginPath(),a.inPath=!0;break;case q.CLOSEFIGURE:a.inPath&&a.ctx.closePath();break;case q.ENDPATH:a.inPath=!1;break;case q.SELECTCLIPPATH:try{a.ctx.clip(a.fillRule)}catch{}break;case q.SELECTOBJECT:{let e=c.u32();if(e&2147483648)oi(a,e>>>0);else{let t=a.objects.get(e);t?.kind===`pen`?a.curPen=t:t?.kind===`brush`?a.curBrush=t:t?.kind===`font`&&(a.curFont=t)}break}case q.DELETEOBJECT:{let e=c.u32(),t=a.objects.get(e);t&&(t===a.curPen&&(a.curPen=null),t===a.curBrush&&(a.curBrush=null),t===a.curFont&&(a.curFont=null),a.objects.delete(e));break}case q.CREATEPEN:{let[e,t]=gi(c);a.objects.set(e,t);break}case q.EXTCREATEPEN:{let[e,t]=_i(c);a.objects.set(e,t);break}case q.CREATEBRUSHINDIRECT:{let[e,t]=vi(c);a.objects.set(e,t);break}case q.CREATEMONOBRUSH:case q.CREATEDIBPATTERNBRUSHPT:{let[e,t]=yi(c,i,o);a.objects.set(e,t);break}case q.EXTCREATEFONTINDIRECTW:{let[e,t]=bi(c,i,o);a.objects.set(e,t);break}case q.POLYLINE16:ui(a,c,ci);break;case q.POLYLINE:ui(a,c,li);break;case q.POLYLINETO16:di(a,c,ci);break;case q.POLYLINETO:di(a,c,li);break;case q.POLYGON16:fi(a,c,ci);break;case q.POLYGON:fi(a,c,li);break;case q.POLYBEZIER16:pi(a,c,ci,!1);break;case q.POLYBEZIER:pi(a,c,li,!1);break;case q.POLYBEZIERTO16:pi(a,c,ci,!0);break;case q.POLYBEZIERTO:pi(a,c,li,!0);break;case q.POLYPOLYGON16:mi(a,c,ci,!0);break;case q.POLYPOLYGON:mi(a,c,li,!0);break;case q.POLYPOLYLINE16:mi(a,c,ci,!1);break;case q.POLYPOLYLINE:mi(a,c,li,!1);break;case q.MOVETOEX:a.curX=c.i32(),a.curY=c.i32();break;case q.LINETO:{let e=c.i32(),n=c.i32();if(a.curPen&&a.curPen.stroke!=null){let[r,i]=Xr(a,a.curX,a.curY),[o,s]=Xr(a,e,n);t.beginPath(),t.moveTo(r,i),t.lineTo(o,s),t.strokeStyle=a.curPen.stroke,t.lineWidth=ni(a,a.curPen.width),t.stroke(),a.drew=!0}a.curX=e,a.curY=n;break}case q.RECTANGLE:hi(a,c.i32(),c.i32(),c.i32(),c.i32());break;case q.ELLIPSE:{let e=c.i32(),n=c.i32(),r=c.i32(),i=c.i32(),[o,s]=[(e+r)/2,(n+i)/2],[l,u]=Xr(a,o,s),[d]=Xr(a,r,s),[,f]=Xr(a,o,i),p=Math.abs(d-l),m=Math.abs(f-u);t.beginPath(),t.ellipse(l,u,p,m,0,0,Math.PI*2),a.curBrush&&a.curBrush.fill!=null&&(t.fillStyle=a.curBrush.fill,t.fill(a.fillRule),a.drew=!0),a.curPen&&a.curPen.stroke!=null&&(t.strokeStyle=a.curPen.stroke,t.lineWidth=ni(a,a.curPen.width),t.stroke(),a.drew=!0);break}case q.SETPOLYFILLMODE:a.fillRule=c.u32()===1?`evenodd`:`nonzero`;break;case q.SETTEXTCOLOR:a.textColor=Ui(c.u32());break;case q.SETTEXTALIGN:a.textAlign=c.u32();break;case q.SETBKMODE:a.bkMode=c.u32();break;case q.EXTTEXTOUTW:xi(a,c,i,o);break;case q.BITBLT:Ci(a,c,i,o);break;case q.STRETCHDIBITS:wi(a,c,i,o);break;default:break}}catch{}o=s}return a.drew}async function Ei(e,t,n){if(!Vi(e)||t<=0||n<=0)return null;let r=Xe(t,n);if(!r)return null;let i=r.getContext(`2d`);return!i||(i.lineJoin=`round`,i.lineCap=`round`,!Ti(e,i,t,n))?null:createImageBitmap(r)}function Di(e,t){return e[t]<<8|e[t+1]}function Oi(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function ki(e,t){return e[t]|e[t+1]<<8}function Ai(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24|0}function ji(e){let t=e.length;return t>=24&&e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71&&e[4]===13&&e[5]===10&&e[6]===26&&e[7]===10?e[12]===73&&e[13]===72&&e[14]===68&&e[15]===82?{width:Oi(e,16),height:Oi(e,20)}:null:t>=10&&e[0]===71&&e[1]===73&&e[2]===70&&e[3]===56&&(e[4]===55||e[4]===57)&&e[5]===97?{width:ki(e,6),height:ki(e,8)}:t>=26&&e[0]===66&&e[1]===77?Mi(e,14)===12?{width:ki(e,18),height:ki(e,20)}:{width:Math.abs(Ai(e,18)),height:Math.abs(Ai(e,22))}:t>=16&&e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80?Ni(e):t>=4&&e[0]===255&&e[1]===216?Pi(e):null}function Mi(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function Ni(e){let t=e.length,n=e[12],r=e[13],i=e[14],a=e[15];if(n===86&&r===80&&i===56&&a===32)return t<30?null:{width:ki(e,26)&16383,height:ki(e,28)&16383};if(n===86&&r===80&&i===56&&a===76){if(t<25||e[20]!==47)return null;let n=Mi(e,21);return{width:(n&16383)+1,height:(n>>>14&16383)+1}}return n===86&&r===80&&i===56&&a===88?t<30?null:{width:(e[24]|e[25]<<8|e[26]<<16)+1,height:(e[27]|e[28]<<8|e[29]<<16)+1}:null}function Pi(e){let t=e.length,n=2;for(;n+1<t;){if(e[n]!==255){n+=1;continue}let r=e[n+1];if(r===255){n+=1;continue}if(r===216||r===1||r>=208&&r<=215){n+=2;continue}if(r===217||n+3>=t)return null;let i=Di(e,n+2);if(r>=192&&r<=207&&r!==196&&r!==200&&r!==204){if(n+8>=t)return null;let r=Di(e,n+5);return{width:Di(e,n+7),height:r}}if(i<2)return null;n+=2+i}return null}function Fi(e){let{width:t,height:n}=e;return!Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0||t>32767||n>32767?!0:t*n>67108864}function Ii(e){let t=ji(e);return t!==null&&Fi(t)}const Li={EOF:0,SETBKMODE:258,SETTEXTALIGN:302,SETTEXTCOLOR:521,SETPOLYFILLMODE:262,SETWINDOWORG:523,SETWINDOWEXT:524,SELECTOBJECT:301,DELETEOBJECT:496,TEXTOUT:1313,POLYGON:804,POLYLINE:805,POLYPOLYGON:1336,RECTANGLE:1051,CREATEPENINDIRECT:762,CREATEFONTINDIRECT:763,CREATEBRUSHINDIRECT:764,DIBBITBLT:2368,DIBSTRETCHBLT:2881,STRETCHDIBITS:3907},Ri=2596720087;function zi(e,t){if(e.length<t+18)return!1;let n=e[t]|e[t+1]<<8,r=e[t+2]|e[t+3]<<8;return(n===1||n===2)&&r===9}function Bi(e){return e.length<4?!1:(e[0]|e[1]<<8|e[2]<<16|e[3]<<24)>>>0===Ri?!0:zi(e,0)}function Vi(e){if(e.length<44)return!1;let t=new DataView(e.buffer,e.byteOffset,e.byteLength);return t.getUint32(0,!0)===1&&t.getUint32(40,!0)===1179469088}function Hi(e){return e===`image/wmf`||e===`image/emf`}function Ui(e){let t=e&255,n=e>>>8&255,r=e>>>16&255,i=e=>e.toString(16).padStart(2,`0`);return`#${i(t)}${i(n)}${i(r)}`}function Wi(e,t){for(let n=0;n<e.length;n++)if(e[n]==null){e[n]=t;return}e.push(t)}var Gi=class{p=0;constructor(e,t,n){this.b=e,this.end=n,this.p=t}get remaining(){return this.end-this.p}i16(){let e=this.u16();return e>=32768?e-65536:e}u16(){let e=this.b[this.p]|this.b[this.p+1]<<8;return this.p+=2,e}u8(){return this.b[this.p++]}u32(){let e=(this.b[this.p]|this.b[this.p+1]<<8|this.b[this.p+2]<<16|this.b[this.p+3]<<24)>>>0;return this.p+=4,e}bytes(e){let t=Math.min(this.p+Math.max(0,e),this.end),n=this.b.subarray(this.p,t);return this.p=t,n}skip(e){this.p=Math.min(this.p+Math.max(0,e),this.end)}};function Ki(e,t){return(t-e.orgX)*(e.W/e.extX)}function qi(e,t){return(t-e.orgY)*(e.H/e.extY)}function Ji(e,t){let n=t*Math.abs(e.W/e.extX);return n>=1?n:1}const Yi=.001;function Xi(e,t,n){return Math.abs(e-t)<=Yi||Math.abs(e-n)<=Yi}function Zi(e,t,n){let r=[],i=n?t.length:t.length-1;for(let n=0;n<i;n++){let i=t[n],a=t[(n+1)%t.length],o=Math.abs(i[0]-a[0])<=Yi&&Xi(i[0],0,e.W)&&Xi(a[0],0,e.W),s=Math.abs(i[1]-a[1])<=Yi&&Xi(i[1],0,e.H)&&Xi(a[1],0,e.H);o||s||r.push([i,a])}return r}function Qi(e,t,n){if(!e.curPen||e.curPen.stroke==null||t.length<2)return;let{ctx:r}=e;if(r.strokeStyle=e.curPen.stroke,r.lineWidth=Ji(e,e.curPen.width),!e.suppressBoundaryFrame){r.beginPath(),r.moveTo(t[0][0],t[0][1]);for(let e=1;e<t.length;e++)r.lineTo(t[e][0],t[e][1]);n&&r.closePath(),r.stroke(),e.drew=!0;return}let i=Zi(e,t,n);if(i.length===0)return;r.beginPath();let a=null;for(let[e,t]of i)(!a||a[0]!==e[0]||a[1]!==e[1])&&r.moveTo(e[0],e[1]),r.lineTo(t[0],t[1]),a=t;r.stroke(),e.drew=!0}function $i(e,t,n){let r=[];for(let i=0;i<n&&!(t.remaining<4);i++){let n=t.i16(),i=t.i16();r.push([Ki(e,n),qi(e,i)])}return r}function ea(e,t){t.length<2||!e.curPen||e.curPen.stroke==null||Qi(e,t,!1)}function ta(e,t){if(t.length<2)return;let{ctx:n}=e;if(e.curBrush&&e.curBrush.fill!=null){n.beginPath(),n.moveTo(t[0][0],t[0][1]);for(let e=1;e<t.length;e++)n.lineTo(t[e][0],t[e][1]);n.closePath(),n.fillStyle=e.curBrush.fill,n.fill(e.fillRule),e.drew=!0}Qi(e,t,!0)}function na(e,t){let n=t.u16();if(n<=0||n>65536)return;let r=[];for(let e=0;e<n;e++){if(t.remaining<2)return;r.push(t.u16())}let{ctx:i}=e;i.beginPath();let a=!1;for(let n of r){if(n<2){for(let e=0;e<n&&t.remaining>=4;e++)t.i16(),t.i16();continue}let r=$i(e,t,n);if(!(r.length<2)){i.moveTo(r[0][0],r[0][1]);for(let e=1;e<r.length;e++)i.lineTo(r[e][0],r[e][1]);i.closePath(),a=!0}}a&&(e.curBrush&&e.curBrush.fill!=null&&(i.fillStyle=e.curBrush.fill,i.fill(e.fillRule),e.drew=!0),e.curPen&&e.curPen.stroke!=null&&(i.strokeStyle=e.curPen.stroke,i.lineWidth=Ji(e,e.curPen.width),i.stroke(),e.drew=!0))}function ra(e){let t=e.u16(),n=e.i16();e.i16();let r=e.u32();return{kind:`pen`,stroke:(t&255)==5?null:Ui(r),width:Math.abs(n)}}function ia(e){let t=e.u16(),n=e.u32();return e.u16(),{kind:`brush`,fill:t===1?null:Ui(n)}}function aa(e){let t=e.indexOf(0),n=t>=0?e.subarray(0,t):e;if(n.length===0)return``;try{return new TextDecoder(`shift_jis`).decode(n)}catch{return String.fromCharCode(...n)}}function oa(e){let t=Math.abs(e.i16());e.i16(),e.i16(),e.i16();let n=e.i16(),r=e.u8()!==0;return e.u8(),e.u8(),e.u8(),e.u8(),e.u8(),e.u8(),e.u8(),{kind:`font`,height:t,weight:n,italic:r,face:aa(e.bytes(Math.min(32,e.remaining)))}}function sa(e,t,n,r){if(t.length===0)return;let i=e.curFont,a=i?.height||12,o=Math.abs(qi(e,e.orgY+a)-qi(e,e.orgY));if(!Number.isFinite(o)||o<1)return;let{ctx:s}=e;try{s.fillStyle=e.textColor;let a=i&&i.weight>=700?`bold `:``;s.font=`${i?.italic?`italic `:``}${a}${o}px ${i?.face||`sans-serif`}`;let c=e.textAlign&6;s.textAlign=c===2?`right`:c===6?`center`:`left`,s.textBaseline=(e.textAlign&24)==24?`alphabetic`:`top`,s.fillText(t,Ki(e,n),qi(e,r)),e.drew=!0}catch{}}function ca(e,t,n,r,i=!1){if(!Bi(e))return!1;let a=0;(e.length>=4?(e[0]|e[1]<<8|e[2]<<16|e[3]<<24)>>>0:0)===Ri&&(a=22);let o=a+18;if(o>e.length)return!1;let s={ctx:t,W:n,H:r,orgX:0,orgY:0,extX:n||1,extY:r||1,haveExt:!1,objects:[],curPen:null,curBrush:null,curFont:null,textColor:`#000000`,textAlign:0,fillRule:`nonzero`,drew:!1,suppressBoundaryFrame:i},c=new DataView(e.buffer,e.byteOffset,e.byteLength);for(;o+6<=e.length;){let t=c.getUint32(o,!0),n=c.getUint16(o+4,!0);if(t<3)break;let r=t*2,i=o+r;if(i>e.length||n===Li.EOF)break;let a=o+6,l=new Gi(e,a,i);switch(n){case Li.SETWINDOWORG:s.orgY=l.i16(),s.orgX=l.i16();break;case Li.SETWINDOWEXT:{let e=l.i16(),t=l.i16();s.extY=e||1,s.extX=t||1,s.haveExt=!0;break}case Li.SETPOLYFILLMODE:s.fillRule=l.u16()===1?`evenodd`:`nonzero`;break;case Li.SETTEXTCOLOR:s.textColor=Ui(l.u32());break;case Li.SETTEXTALIGN:s.textAlign=l.u16();break;case Li.CREATEPENINDIRECT:Wi(s.objects,ra(l));break;case Li.CREATEBRUSHINDIRECT:Wi(s.objects,ia(l));break;case Li.CREATEFONTINDIRECT:Wi(s.objects,oa(l));break;case Li.SELECTOBJECT:{let e=l.u16(),t=s.objects[e];t?.kind===`pen`?s.curPen=t:t?.kind===`brush`?s.curBrush=t:t?.kind===`font`&&(s.curFont=t);break}case Li.DELETEOBJECT:{let e=l.u16(),t=s.objects[e];t&&(t===s.curPen&&(s.curPen=null),t===s.curBrush&&(s.curBrush=null),t===s.curFont&&(s.curFont=null),s.objects[e]=null);break}case Li.POLYLINE:ea(s,$i(s,l,l.i16()));break;case Li.POLYGON:ta(s,$i(s,l,l.i16()));break;case Li.POLYPOLYGON:na(s,l);break;case Li.RECTANGLE:{let e=l.i16(),t=l.i16(),n=l.i16(),r=l.i16();ta(s,[[Ki(s,r),qi(s,n)],[Ki(s,t),qi(s,n)],[Ki(s,t),qi(s,e)],[Ki(s,r),qi(s,e)]]);break}case Li.TEXTOUT:{let e=l.u16(),t=aa(l.bytes(e));e%2!=0&&l.skip(1);let n=l.i16();sa(s,t,l.i16(),n);break}case Li.STRETCHDIBITS:{l.u32(),l.i16(),l.i16(),l.i16(),l.i16(),l.u16();let e=l.i16(),t=l.i16(),n=l.i16(),r=l.i16(),o=a+22,u=Pr(c,o,i-o);if(u){let i=Ki(s,r),a=qi(s,n),o=Ki(s,r+t),c=qi(s,n+e);Fr(s.ctx,u,i,a,o,c)&&(s.drew=!0)}break}case Li.DIBSTRETCHBLT:case Li.DIBBITBLT:case Li.SETBKMODE:break;default:break}o=i}return s.drew}function la(e,t){let n=e>0?e:300,r=t>0?t:300,i=e=>Math.max(1,Math.min(2e3,Math.round(e)));return{w:i(n*2),h:i(r*2)}}async function ua(e,t,n,r=!1){if(!Bi(e)||t<=0||n<=0)return null;let i=Xe(t,n);if(!i)return null;let a=i.getContext(`2d`);return!a||(a.lineJoin=`round`,a.lineCap=`round`,!ca(e,a,t,n,r))?null:createImageBitmap(i)}async function da(e,t={}){let{widthPt:n=0,heightPt:r=0,suppressBoundaryFrame:i=!1}=t,a=new Uint8Array(await e.slice(0,64*1024).arrayBuffer());if(Bi(a)){let{w:t,h:a}=la(n,r);return ua(new Uint8Array(await e.arrayBuffer()),t,a,i)}if(Vi(a)){let{w:t,h:i}=la(n,r);return Ei(new Uint8Array(await e.arrayBuffer()),t,i)}return Ii(a)?null:createImageBitmap(e)}const fa=new WeakMap;function pa(e){let t=fa.get(e);return t||(t=new Map,fa.set(e,t)),t}const ma=new WeakMap,ha=new WeakSet;function ga(e){!e||ha.has(e)||(ha.add(e),e.close())}function _a(e){let t=ma.get(e);t||(t={count:0,deferred:[]},ma.set(e,t));let n=t;n.count++;let r=!1;return()=>{if(!r&&(r=!0,n.count--,!(n.count>0))){for(let e of n.deferred)e.then(e=>ga(e)).catch(()=>{});n.deferred=[],ma.delete(e)}}}function va(e,t){let n=ma.get(e);if(n&&n.count>0){n.deferred.push(t);return}t.then(e=>ga(e)).catch(()=>{})}function ya(e,t,n,r={}){let{widthPt:i=0,heightPt:a=0,suppressBoundaryFrame:o=!1}=r,s=pa(n),c=s.get(e);if(c)return s.delete(e),s.set(e,c),c.promise;let l=n(e,t).then(e=>da(e,{widthPt:i,heightPt:a,suppressBoundaryFrame:o})),u={promise:l};if(l.then(e=>{u.bitmap=e}).catch(()=>{}),l.catch(()=>s.delete(e)),s.set(e,u),s.size>256){let e=s.keys().next().value,t=s.get(e);s.delete(e),t&&va(n,t.promise)}return l}function ba(e){let t=fa.get(e);if(t){for(let n of t.values())va(e,n.promise);t.clear(),fa.delete(e)}}function xa(e){let t=e;return{w:t.naturalWidth||(typeof t.width==`number`?t.width:0)||0,h:t.naturalHeight||(typeof t.height==`number`?t.height:0)||0}}function Sa(e,t){if(!t||!(t.l||t.t||t.r||t.b))return null;let{w:n,h:r}=xa(e);if(n<=0||r<=0)return null;let i=e=>Math.max(0,Math.min(1,e)),a=i(t.l)*n,o=i(t.t)*r;return{sx:a,sy:o,sw:Math.max(1,n-a-i(t.r)*n),sh:Math.max(1,r-o-i(t.b)*r)}}function Ca(e,t,n,r,i,a,o){let s=Sa(t,n);s?e.drawImage(t,s.sx,s.sy,s.sw,s.sh,r,i,a,o):e.drawImage(t,r,i,a,o)}function wa(e,t,n,r){if(!t||!Hi(e))return{widthPt:n,heightPt:r};let i=Math.max(.01,1-t.l-t.r),a=Math.max(.01,1-t.t-t.b);return{widthPt:n/i,heightPt:r/a}}function Ta(e){return/^[0-9a-fA-F]{6}$/.test(e)?[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]:null}function Ea(e,t,n){return(.299*e+.587*t+.114*n)/255}function Da(e,t,n){let r=Ta(t),i=Ta(n);if(!r||!i)return e;let[a,o,s]=r,[c,l,u]=i,d=e.data;for(let e=0;e<d.length;e+=4){if(d[e+3]===0)continue;let t=Ea(d[e],d[e+1],d[e+2]);d[e]=Math.round(a+(c-a)*t),d[e+1]=Math.round(o+(l-o)*t),d[e+2]=Math.round(s+(u-s)*t)}return e}const Oa=(e,t)=>typeof OffscreenCanvas>`u`?null:new OffscreenCanvas(e,t);async function ka(e,t,n){let{width:r,height:i}=n;if(r<=0||i<=0||typeof createImageBitmap>`u`)return e;let a=(n.offscreenFactory??Oa)(r,i);if(!a)return e;let o=a.getContext(`2d`);if(!o)return e;o.drawImage(e,0,0);let s;try{s=o.getImageData(0,0,r,i)}catch{return e}return Da(s,t.clr1,t.clr2),o.putImageData(s,0,0),createImageBitmap(a)}function Aa(e){return e.svgImagePath!=null&&e.srcRect==null}function ja(e){return typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement}function Ma(e=1){return typeof window<`u`&&window.devicePixelRatio||e}function Na(e,t,n){let r=Math.round(t*n)%2==1?.5:0,i=e*n;return(Math.round(i-r)+r)/n-e}const Pa=32767;function Fa(e,t){let n=Number.isFinite(e)&&e>0?Math.max(1,Math.round(e)):1,r=Number.isFinite(t)&&t>0?Math.max(1,Math.round(t)):1,i=Math.min(1,Pa/n,Pa/r),a=n*r,o=a>16777216?Math.sqrt(16777216/a):1,s=Math.min(i,o);return s>=1?{width:n,height:r,scale:1,clamped:!1}:{width:Math.max(1,Math.floor(n*s)),height:Math.max(1,Math.floor(r*s)),scale:s,clamped:!0}}function Ia(e,t){let n=Math.max(1,Math.round(e*t/3)),r=Math.max(1,Math.round(e*t/3));return{railDev:n,gapDev:r,spanDev:2*n+r}}function La(e){if(!e.startsWith(`data:`))return null;let t=e.indexOf(`,`);if(t===-1)return null;let n=atob(e.slice(t+1)),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}var Ra=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function za(e){let t=globalThis.WebAssembly?.RuntimeError;if(t&&e instanceof t||e instanceof RangeError)return!0;if(e instanceof Error){let t=e.name;if(t===`RuntimeError`||t===`CompileError`||t===`LinkError`)return!0}return!1}var Ba=class{_init;_opts;_wasmInput=null;_initPromise=null;_poisoned=!1;_archive=null;constructor(e,t={}){this._init=e,this._opts=t}setWasmUrl(e){this._wasmInput=e,this._poisoned=!1,this._initPromise=this._init(e)}get archive(){return this._archive}setArchive(e){this._freeArchive(),this._archive=e}disposeArchive(){this._freeArchive()}_freeArchive(){this._archive!=null&&this._opts.freeArchive&&this._opts.freeArchive(this._archive),this._archive=null}get poisoned(){return this._poisoned}async ensureReady(){if(this._poisoned){if(this._wasmInput===null)throw Error(`WasmParserHost: setWasmUrl was never called`);let e=(this._opts.reinit??this._init)(this._wasmInput);this._initPromise=e,await e,this._poisoned=!1;return}if(this._initPromise===null)throw Error(`WasmParserHost: setWasmUrl was never called`);await this._initPromise}run(e){try{return e()}catch(e){throw za(e)?(this._poison(),new Ra(`WASM parser trapped and was recycled: ${e instanceof Error?e.message:String(e)}`)):e}}poison(){this._poison()}_poison(){if(this._poisoned=!0,this._initPromise=null,this._archive!=null&&this._opts.freeArchive)try{this._opts.freeArchive(this._archive)}catch{}this._archive=null}};const Va=[`L`,`R`,`AL`,`EN`,`ES`,`ET`,`AN`,`CS`,`NSM`,`BN`,`B`,`S`,`WS`,`ON`,`LRE`,`LRO`,`RLE`,`RLO`,`PDF`,`LRI`,`RLI`,`FSI`,`PDI`],Ha=[0,9,10,11,12,13,14,28,31,32,33,35,38,43,44,45,46,48,58,59,65,91,97,123,127,133,134,160,161,162,166,170,171,173,174,176,178,180,181,182,185,186,187,192,215,216,247,248,697,699,706,720,722,736,741,750,751,768,880,884,886,894,895,900,902,903,904,1014,1015,1155,1162,1418,1419,1421,1423,1424,1425,1470,1471,1472,1473,1475,1476,1478,1479,1480,1536,1542,1544,1545,1547,1548,1549,1550,1552,1563,1611,1632,1642,1643,1645,1648,1649,1750,1757,1758,1759,1765,1767,1769,1770,1774,1776,1786,1809,1810,1840,1867,1958,1969,1984,2027,2036,2038,2042,2045,2046,2070,2074,2075,2084,2085,2088,2089,2094,2137,2140,2144,2192,2194,2199,2208,2250,2274,2275,2307,2362,2363,2364,2365,2369,2377,2381,2382,2385,2392,2402,2404,2433,2434,2492,2493,2497,2501,2509,2510,2530,2532,2546,2548,2555,2556,2558,2559,2561,2563,2620,2621,2625,2627,2631,2633,2635,2638,2641,2642,2672,2674,2677,2678,2689,2691,2748,2749,2753,2758,2759,2761,2765,2766,2786,2788,2801,2802,2810,2816,2817,2818,2876,2877,2879,2880,2881,2885,2893,2894,2901,2903,2914,2916,2946,2947,3008,3009,3021,3022,3059,3065,3066,3067,3072,3073,3076,3077,3132,3133,3134,3137,3142,3145,3146,3150,3157,3159,3170,3172,3192,3199,3201,3202,3260,3261,3276,3278,3298,3300,3328,3330,3387,3389,3393,3397,3405,3406,3426,3428,3457,3458,3530,3531,3538,3541,3542,3543,3633,3634,3636,3643,3647,3648,3655,3663,3761,3762,3764,3773,3784,3791,3864,3866,3893,3894,3895,3896,3897,3898,3902,3953,3967,3968,3973,3974,3976,3981,3992,3993,4029,4038,4039,4141,4145,4146,4152,4153,4155,4157,4159,4184,4186,4190,4193,4209,4213,4226,4227,4229,4231,4237,4238,4253,4254,4957,4960,5008,5018,5120,5121,5760,5761,5787,5789,5906,5909,5938,5940,5970,5972,6002,6004,6068,6070,6071,6078,6086,6087,6089,6100,6107,6108,6109,6110,6128,6138,6144,6155,6158,6159,6160,6277,6279,6313,6314,6432,6435,6439,6441,6450,6451,6457,6460,6464,6465,6468,6470,6622,6656,6679,6681,6683,6684,6742,6743,6744,6751,6752,6753,6754,6755,6757,6765,6771,6781,6783,6784,6832,6878,6880,6892,6912,6916,6964,6965,6966,6971,6972,6973,6978,6979,7019,7028,7040,7042,7074,7078,7080,7082,7083,7086,7142,7143,7144,7146,7149,7150,7151,7154,7212,7220,7222,7224,7376,7379,7380,7393,7394,7401,7405,7406,7412,7413,7416,7418,7616,7680,8125,8126,8127,8130,8141,8144,8157,8160,8173,8176,8189,8191,8192,8203,8206,8207,8208,8232,8233,8234,8235,8236,8237,8238,8239,8240,8245,8260,8261,8287,8288,8294,8295,8296,8297,8298,8304,8305,8308,8314,8316,8319,8320,8330,8332,8335,8352,8400,8433,8448,8450,8451,8455,8456,8458,8468,8469,8470,8473,8478,8484,8485,8486,8487,8488,8489,8490,8494,8495,8506,8508,8512,8517,8522,8526,8528,8544,8585,8588,8592,8722,8723,8724,9014,9083,9109,9110,9258,9280,9291,9312,9352,9372,9450,9900,9901,10240,10496,11124,11126,11264,11493,11499,11503,11506,11513,11520,11647,11648,11744,11776,11870,11904,11930,11931,12020,12032,12246,12272,12288,12289,12293,12296,12321,12330,12334,12336,12337,12342,12344,12349,12352,12441,12443,12445,12448,12449,12539,12540,12736,12774,12783,12784,12829,12831,12880,12896,12924,12927,12977,12992,13004,13008,13175,13179,13278,13280,13311,13312,19904,19968,42128,42183,42509,42512,42607,42611,42612,42622,42624,42654,42656,42736,42738,42752,42786,42888,42889,43010,43011,43014,43015,43019,43020,43045,43047,43048,43052,43053,43064,43066,43124,43128,43204,43206,43232,43250,43263,43264,43302,43310,43335,43346,43392,43395,43443,43444,43446,43450,43452,43454,43493,43494,43561,43567,43569,43571,43573,43575,43587,43588,43596,43597,43644,43645,43696,43697,43698,43701,43703,43705,43710,43712,43713,43714,43756,43758,43766,43767,43882,43884,44005,44006,44008,44009,44013,44014,64285,64286,64287,64297,64298,64336,64451,64467,64830,64848,64912,64914,64968,64976,65008,65021,65024,65040,65050,65056,65072,65104,65105,65106,65107,65108,65109,65110,65119,65120,65122,65124,65127,65128,65129,65131,65132,65136,65279,65280,65281,65283,65286,65291,65292,65293,65294,65296,65306,65307,65313,65339,65345,65371,65382,65504,65506,65509,65511,65512,65519,65520,65529,65534,65536,65793,65794,65856,65933,65936,65949,65952,65953,66045,66046,66272,66273,66300,66422,66427,67584,67871,67872,68097,68100,68101,68103,68108,68112,68152,68155,68159,68160,68325,68327,68409,68416,68864,68900,68904,68912,68922,68928,68938,68969,68974,68975,69216,69247,69291,69293,69312,69328,69337,69370,69376,69424,69446,69457,69488,69506,69510,69632,69633,69634,69688,69703,69714,69734,69744,69745,69747,69749,69759,69762,69811,69815,69817,69819,69826,69827,69888,69891,69927,69932,69933,69941,70003,70004,70016,70018,70070,70079,70089,70093,70095,70096,70191,70194,70196,70197,70198,70200,70206,70207,70209,70210,70367,70368,70371,70379,70400,70402,70459,70461,70464,70465,70502,70509,70512,70517,70587,70593,70606,70607,70608,70609,70610,70611,70625,70627,70712,70720,70722,70725,70726,70727,70750,70751,70835,70841,70842,70843,70847,70849,70850,70852,71090,71094,71100,71102,71103,71105,71132,71134,71219,71227,71229,71230,71231,71233,71264,71277,71339,71340,71341,71342,71344,71350,71351,71352,71453,71454,71455,71456,71458,71462,71463,71468,71727,71736,71737,71739,71995,71997,71998,71999,72003,72004,72148,72152,72154,72156,72160,72161,72193,72199,72201,72203,72243,72249,72251,72255,72263,72264,72273,72279,72281,72284,72330,72343,72344,72346,72544,72545,72546,72549,72550,72551,72752,72759,72760,72766,72850,72872,72874,72881,72882,72884,72885,72887,73009,73015,73018,73019,73020,73022,73023,73030,73031,73032,73104,73106,73109,73110,73111,73112,73459,73461,73472,73474,73526,73531,73536,73537,73538,73539,73562,73563,73685,73693,73697,73714,78912,78913,78919,78934,90398,90410,90413,90416,92912,92917,92976,92983,94031,94032,94095,94099,94178,94179,94180,94181,113821,113823,113824,113828,117760,117974,118e3,118010,118013,118016,118452,118458,118481,118496,118513,118528,118574,118576,118599,119143,119146,119155,119163,119171,119173,119180,119210,119214,119273,119275,119296,119362,119365,119366,119552,119639,120513,120514,120539,120540,120571,120572,120597,120598,120629,120630,120655,120656,120687,120688,120713,120714,120745,120746,120771,120772,120782,120832,121344,121399,121403,121453,121461,121462,121476,121477,121499,121504,121505,121520,122880,122887,122888,122905,122907,122914,122915,122917,122918,122923,123023,123024,123184,123191,123566,123567,123628,123632,123647,123648,124140,124144,124398,124400,124643,124644,124646,124647,124654,124656,124661,124662,124928,125136,125143,125252,125259,126064,126144,126208,126288,126464,126704,126706,126720,126976,127020,127024,127124,127136,127151,127153,127168,127169,127184,127185,127222,127232,127243,127248,127279,127280,127338,127344,127405,127406,127584,127590,127744,128729,128732,128749,128752,128765,128768,128986,128992,129004,129008,129009,129024,129036,129040,129096,129104,129114,129120,129160,129168,129198,129200,129212,129216,129218,129232,129241,129280,129624,129632,129646,129648,129661,129664,129675,129678,129735,129736,129737,129741,129757,129759,129771,129775,129785,129792,129939,129940,130032,130042,130043,131070,131072,196606,196608,262142,262144,327678,327680,393214,393216,458750,458752,524286,524288,589822,589824,655358,655360,720894,720896,786430,786432,851966,851968,917502,917760,918e3,921600,983038,983040,1048574,1048576,1114110],Ua=[9,11,10,11,12,10,9,10,11,12,13,5,13,4,7,4,7,3,7,13,0,13,0,13,9,10,9,7,13,5,13,0,13,9,13,5,3,13,0,13,3,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,8,0,13,0,13,0,13,0,13,0,13,0,8,0,13,0,13,5,1,8,1,8,1,8,1,8,1,8,1,6,13,2,5,2,7,2,13,8,2,8,6,5,6,2,8,2,8,6,13,8,2,8,13,8,2,3,2,8,2,8,2,8,2,1,8,1,13,1,8,1,8,1,8,1,8,1,8,1,8,1,2,6,2,8,2,8,6,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,5,0,5,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,5,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,5,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,5,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,0,13,0,12,0,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,5,0,8,0,13,0,13,8,9,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,0,13,0,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,0,13,0,13,0,13,0,13,0,13,0,12,9,0,1,13,12,10,14,16,18,15,17,7,5,13,7,13,12,9,19,20,21,22,9,3,0,3,4,13,0,3,4,13,0,5,8,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,5,0,13,0,13,0,13,0,13,0,13,0,13,4,5,13,0,13,0,13,0,13,0,13,3,0,13,0,13,0,13,0,13,0,13,0,8,0,13,0,8,0,8,13,0,13,0,13,0,13,0,13,12,13,0,13,0,8,0,13,0,13,0,13,0,8,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,8,13,8,13,0,8,0,8,0,13,0,13,0,8,0,8,0,8,0,8,0,13,8,0,5,0,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,0,8,0,8,0,8,0,1,8,1,4,1,2,13,2,13,2,13,2,13,9,2,13,8,13,0,8,13,7,13,7,0,13,7,13,5,13,4,13,0,13,5,13,0,2,9,0,13,5,13,4,7,4,7,3,7,13,0,13,0,13,0,5,13,5,0,13,0,9,13,9,0,13,0,13,0,13,0,13,0,8,0,8,3,0,8,0,1,13,1,8,1,8,1,8,1,8,1,8,1,8,1,13,1,2,8,2,6,2,6,1,8,13,1,6,1,8,1,2,13,2,8,1,2,8,2,1,8,1,0,8,0,8,0,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,5,13,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,13,0,8,0,8,0,9,0,13,0,3,13,0,13,0,13,0,13,0,8,0,8,0,8,0,9,8,0,8,0,8,0,13,0,13,8,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,3,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,5,0,8,0,8,0,8,0,8,0,8,0,8,0,1,8,1,8,1,2,1,2,1,2,13,2,1,13,0,13,0,13,0,13,0,13,0,13,0,3,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,3,13,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,8,9,0,9,0,9,0,9],Wa=[40,41,41,40,60,62,62,60,91,93,93,91,123,125,125,123,171,187,187,171,3898,3899,3899,3898,3900,3901,3901,3900,5787,5788,5788,5787,8249,8250,8250,8249,8261,8262,8262,8261,8317,8318,8318,8317,8333,8334,8334,8333,8712,8715,8713,8716,8714,8717,8715,8712,8716,8713,8717,8714,8725,10741,8735,11262,8736,10659,8737,10651,8738,10656,8740,10990,8764,8765,8765,8764,8771,8909,8773,8780,8780,8773,8786,8787,8787,8786,8788,8789,8789,8788,8804,8805,8805,8804,8806,8807,8807,8806,8808,8809,8809,8808,8810,8811,8811,8810,8814,8815,8815,8814,8816,8817,8817,8816,8818,8819,8819,8818,8820,8821,8821,8820,8822,8823,8823,8822,8824,8825,8825,8824,8826,8827,8827,8826,8828,8829,8829,8828,8830,8831,8831,8830,8832,8833,8833,8832,8834,8835,8835,8834,8836,8837,8837,8836,8838,8839,8839,8838,8840,8841,8841,8840,8842,8843,8843,8842,8847,8848,8848,8847,8849,8850,8850,8849,8856,10680,8866,8867,8867,8866,8870,10974,8872,10980,8873,10979,8875,10981,8880,8881,8881,8880,8882,8883,8883,8882,8884,8885,8885,8884,8886,8887,8887,8886,8888,10204,8905,8906,8906,8905,8907,8908,8908,8907,8909,8771,8912,8913,8913,8912,8918,8919,8919,8918,8920,8921,8921,8920,8922,8923,8923,8922,8924,8925,8925,8924,8926,8927,8927,8926,8928,8929,8929,8928,8930,8931,8931,8930,8932,8933,8933,8932,8934,8935,8935,8934,8936,8937,8937,8936,8938,8939,8939,8938,8940,8941,8941,8940,8944,8945,8945,8944,8946,8954,8947,8955,8948,8956,8950,8957,8951,8958,8954,8946,8955,8947,8956,8948,8957,8950,8958,8951,8968,8969,8969,8968,8970,8971,8971,8970,9001,9002,9002,9001,10088,10089,10089,10088,10090,10091,10091,10090,10092,10093,10093,10092,10094,10095,10095,10094,10096,10097,10097,10096,10098,10099,10099,10098,10100,10101,10101,10100,10179,10180,10180,10179,10181,10182,10182,10181,10184,10185,10185,10184,10187,10189,10189,10187,10197,10198,10198,10197,10204,8888,10205,10206,10206,10205,10210,10211,10211,10210,10212,10213,10213,10212,10214,10215,10215,10214,10216,10217,10217,10216,10218,10219,10219,10218,10220,10221,10221,10220,10222,10223,10223,10222,10627,10628,10628,10627,10629,10630,10630,10629,10631,10632,10632,10631,10633,10634,10634,10633,10635,10636,10636,10635,10637,10640,10638,10639,10639,10638,10640,10637,10641,10642,10642,10641,10643,10644,10644,10643,10645,10646,10646,10645,10647,10648,10648,10647,10651,8737,10656,8738,10659,8736,10660,10661,10661,10660,10664,10665,10665,10664,10666,10667,10667,10666,10668,10669,10669,10668,10670,10671,10671,10670,10680,8856,10688,10689,10689,10688,10692,10693,10693,10692,10703,10704,10704,10703,10705,10706,10706,10705,10708,10709,10709,10708,10712,10713,10713,10712,10714,10715,10715,10714,10728,10729,10729,10728,10741,8725,10744,10745,10745,10744,10748,10749,10749,10748,10795,10796,10796,10795,10797,10798,10798,10797,10804,10805,10805,10804,10812,10813,10813,10812,10852,10853,10853,10852,10873,10874,10874,10873,10875,10876,10876,10875,10877,10878,10878,10877,10879,10880,10880,10879,10881,10882,10882,10881,10883,10884,10884,10883,10885,10886,10886,10885,10887,10888,10888,10887,10889,10890,10890,10889,10891,10892,10892,10891,10893,10894,10894,10893,10895,10896,10896,10895,10897,10898,10898,10897,10899,10900,10900,10899,10901,10902,10902,10901,10903,10904,10904,10903,10905,10906,10906,10905,10907,10908,10908,10907,10909,10910,10910,10909,10911,10912,10912,10911,10913,10914,10914,10913,10918,10919,10919,10918,10920,10921,10921,10920,10922,10923,10923,10922,10924,10925,10925,10924,10927,10928,10928,10927,10929,10930,10930,10929,10931,10932,10932,10931,10933,10934,10934,10933,10935,10936,10936,10935,10937,10938,10938,10937,10939,10940,10940,10939,10941,10942,10942,10941,10943,10944,10944,10943,10945,10946,10946,10945,10947,10948,10948,10947,10949,10950,10950,10949,10951,10952,10952,10951,10953,10954,10954,10953,10955,10956,10956,10955,10957,10958,10958,10957,10959,10960,10960,10959,10961,10962,10962,10961,10963,10964,10964,10963,10965,10966,10966,10965,10974,8870,10979,8873,10980,8872,10981,8875,10988,10989,10989,10988,10990,8740,10999,11e3,11e3,10999,11001,11002,11002,11001,11262,8735,11778,11779,11779,11778,11780,11781,11781,11780,11785,11786,11786,11785,11788,11789,11789,11788,11804,11805,11805,11804,11808,11809,11809,11808,11810,11811,11811,11810,11812,11813,11813,11812,11814,11815,11815,11814,11816,11817,11817,11816,11861,11862,11862,11861,11863,11864,11864,11863,11865,11866,11866,11865,11867,11868,11868,11867,12296,12297,12297,12296,12298,12299,12299,12298,12300,12301,12301,12300,12302,12303,12303,12302,12304,12305,12305,12304,12308,12309,12309,12308,12310,12311,12311,12310,12312,12313,12313,12312,12314,12315,12315,12314,65113,65114,65114,65113,65115,65116,65116,65115,65117,65118,65118,65117,65124,65125,65125,65124,65288,65289,65289,65288,65308,65310,65310,65308,65339,65341,65341,65339,65371,65373,65373,65371,65375,65376,65376,65375,65378,65379,65379,65378],Ga=[40,41,0,41,40,1,91,93,0,93,91,1,123,125,0,125,123,1,3898,3899,0,3899,3898,1,3900,3901,0,3901,3900,1,5787,5788,0,5788,5787,1,8261,8262,0,8262,8261,1,8317,8318,0,8318,8317,1,8333,8334,0,8334,8333,1,8968,8969,0,8969,8968,1,8970,8971,0,8971,8970,1,9001,9002,0,9002,9001,1,10088,10089,0,10089,10088,1,10090,10091,0,10091,10090,1,10092,10093,0,10093,10092,1,10094,10095,0,10095,10094,1,10096,10097,0,10097,10096,1,10098,10099,0,10099,10098,1,10100,10101,0,10101,10100,1,10181,10182,0,10182,10181,1,10214,10215,0,10215,10214,1,10216,10217,0,10217,10216,1,10218,10219,0,10219,10218,1,10220,10221,0,10221,10220,1,10222,10223,0,10223,10222,1,10627,10628,0,10628,10627,1,10629,10630,0,10630,10629,1,10631,10632,0,10632,10631,1,10633,10634,0,10634,10633,1,10635,10636,0,10636,10635,1,10637,10640,0,10638,10639,1,10639,10638,0,10640,10637,1,10641,10642,0,10642,10641,1,10643,10644,0,10644,10643,1,10645,10646,0,10646,10645,1,10647,10648,0,10648,10647,1,10712,10713,0,10713,10712,1,10714,10715,0,10715,10714,1,10748,10749,0,10749,10748,1,11810,11811,0,11811,11810,1,11812,11813,0,11813,11812,1,11814,11815,0,11815,11814,1,11816,11817,0,11817,11816,1,11861,11862,0,11862,11861,1,11863,11864,0,11864,11863,1,11865,11866,0,11866,11865,1,11867,11868,0,11868,11867,1,12296,12297,0,12297,12296,1,12298,12299,0,12299,12298,1,12300,12301,0,12301,12300,1,12302,12303,0,12303,12302,1,12304,12305,0,12305,12304,1,12308,12309,0,12309,12308,1,12310,12311,0,12311,12310,1,12312,12313,0,12313,12312,1,12314,12315,0,12315,12314,1,65113,65114,0,65114,65113,1,65115,65116,0,65116,65115,1,65117,65118,0,65118,65117,1,65288,65289,0,65289,65288,1,65339,65341,0,65341,65339,1,65371,65373,0,65373,65371,1,65375,65376,0,65376,65375,1,65378,65379,0,65379,65378,1];function Ka(e){let t=0,n=Ha.length-1;for(;t<n;){let r=t+n+1>>1;Ha[r]<=e?t=r:n=r-1}return Ua[t]}function qa(e){return Va[Ka(e)]}const Ja=(()=>{let e=new Map;for(let t=0;t<Wa.length;t+=2)e.set(Wa[t],Wa[t+1]);return e})();function Ya(e){return Ja.get(e)??null}const Xa=(()=>{let e=new Map;for(let t=0;t<Ga.length;t+=3)e.set(Ga[t],{pair:Ga[t+1],type:Ga[t+2]===0?`o`:`c`});return e})();function Za(e){return Xa.get(e)??null}const Qa=e=>e===`RLE`||e===`LRE`||e===`RLO`||e===`LRO`||e===`PDF`||e===`BN`,$a=e=>e===`LRI`||e===`RLI`||e===`FSI`,eo=e=>e===`B`||e===`S`||e===`WS`||e===`ON`||e===`FSI`||e===`LRI`||e===`RLI`||e===`PDI`,to=e=>e&1?e+2:e+1,no=e=>e&1?e+1:e+2;function ro(e,t,n){let r=0;for(let i=t;i<n;i++){let t=e[i];if($a(t))r++;else if(t===`PDI`)r>0&&r--;else if(r===0){if(t===`L`)return 0;if(t===`R`||t===`AL`)return 1}}return 0}function io(e){let t=e.length,n=new Int32Array(t).fill(t),r=new Int32Array(t).fill(-1),i=[];for(let a=0;a<t;a++){let t=e[a];if($a(t))i.push(a);else if(t===`PDI`&&i.length){let e=i.pop();n[e]=a,r[a]=e}}return{pdiOf:n,initOf:r}}function ao(e,t,n){let r=e.length,i=Array(r).fill(t),a=e.slice(),o=[{level:t,override:`neutral`,isolate:!1}],s=0,c=0,l=0,u=()=>o[o.length-1];for(let d=0;d<r;d++){let r=e[d];switch(r){case`RLE`:case`LRE`:case`RLO`:case`LRO`:{i[d]=u().level;let e=r===`RLE`||r===`RLO`?to(u().level):no(u().level);e<=125&&s===0&&c===0?o.push({level:e,override:r===`RLO`?`R`:r===`LRO`?`L`:`neutral`,isolate:!1}):s===0&&c++;break}case`RLI`:case`LRI`:case`FSI`:{i[d]=u().level;let t=u().override;t!==`neutral`&&(a[d]=t);let f;f=r===`RLI`?`R`:r===`LRI`?`L`:ro(e,d+1,n[d])===1?`R`:`L`;let p=f===`R`?to(u().level):no(u().level);p<=125&&s===0&&c===0?(l++,o.push({level:p,override:`neutral`,isolate:!0})):s++;break}case`PDI`:if(s>0)s--;else if(l>0){for(c=0;!u().isolate;)o.pop();o.pop(),l--}{i[d]=u().level;let e=u().override;e!==`neutral`&&(a[d]=e)}break;case`PDF`:i[d]=u().level,s>0||(c>0?c--:!u().isolate&&o.length>=2&&o.pop());break;case`B`:o.length=1,s=0,c=0,l=0,i[d]=t;break;case`BN`:i[d]=u().level;break;default:{i[d]=u().level;let e=u().override;e!==`neutral`&&(a[d]=e);break}}}return{levels:i,types:a}}function oo(e){return e===9001?12296:e===9002?12297:e}function so(e,t,n,r,i,a){let o=e.length,s=[];for(let e=0;e<o;e++)n[e]||s.push(e);let c=[];for(let e=0;e<s.length;e++){let n=s[e];e===0||t[n]!==t[s[e-1]]?c.push([n]):c[c.length-1].push(n)}let l=new Map;for(let e of c)l.set(e[0],e);let u=e=>e&1?`R`:`L`,d=[];for(let s of c){let c=s[0];if(e[c]===`PDI`&&a[c]!==-1)continue;let f=[],p=s;for(;;){for(let e of p)f.push(e);let t=p[p.length-1];if($a(e[t])&&i[t]!==o){let e=l.get(i[t]);if(e){p=e;continue}}break}let m=t[f[0]],h=r;for(let e=f[0]-1;e>=0;e--)if(!n[e]){h=t[e];break}let g=u(Math.max(m,h)),_=f[f.length-1],v=r;if(!($a(e[_])&&i[_]===o)){for(let e=_+1;e<o;e++)if(!n[e]){v=t[e];break}}let y=u(Math.max(m,v));d.push({indices:f,level:m,sos:g,eos:y})}return d}const co=e=>e===`L`?`L`:e===`R`||e===`EN`||e===`AN`?`R`:null;function lo(e,t,n,r,i){let a=e.indices,o=a.length,{sos:s,eos:c,level:l}=e;for(let e=0;e<o;e++){let t=a[e];if(r[t]===`NSM`)if(e===0)r[t]=s;else{let n=r[a[e-1]];r[t]=n===`LRI`||n===`RLI`||n===`FSI`||n===`PDI`?`ON`:n}}{let e=s;for(let t=0;t<o;t++){let n=r[a[t]];n===`R`||n===`L`||n===`AL`?e=n:n===`EN`&&e===`AL`&&(r[a[t]]=`AN`)}}for(let e=0;e<o;e++)r[a[e]]===`AL`&&(r[a[e]]=`R`);for(let e=1;e<o-1;e++){let t=r[a[e]],n=r[a[e-1]],i=r[a[e+1]];t===`ES`&&n===`EN`&&i===`EN`||t===`CS`&&n===`EN`&&i===`EN`?r[a[e]]=`EN`:t===`CS`&&n===`AN`&&i===`AN`&&(r[a[e]]=`AN`)}for(let e=0;e<o;e++){if(r[a[e]]!==`ET`)continue;let t=e;for(;t<o&&r[a[t]]===`ET`;)t++;let n=e>0?r[a[e-1]]:s,i=t<o?r[a[t]]:c;if(n===`EN`||i===`EN`)for(let n=e;n<t;n++)r[a[n]]=`EN`;e=t-1}for(let e=0;e<o;e++){let t=r[a[e]];(t===`ES`||t===`ET`||t===`CS`)&&(r[a[e]]=`ON`)}{let e=s;for(let t=0;t<o;t++){let n=r[a[t]];n===`R`||n===`L`?e=n:n===`EN`&&e===`L`&&(r[a[t]]=`L`)}}let u=l&1?`R`:`L`,d=u===`R`?`L`:`R`,f=[];{let e=[];outer:for(let n=0;n<o;n++){let i=a[n];if(r[i]!==`ON`)continue;let o=Za(t[i]);if(o)if(o.type===`o`){if(e.length===63)break outer;e.push({expect:oo(o.pair),pos:n})}else{let r=oo(t[i]);for(let t=e.length-1;t>=0;t--)if(e[t].expect===r){f.push({open:e[t].pos,close:n}),e.length=t;break}}}f.sort((e,t)=>e.open-t.open)}let p=(e,t)=>{for(let i=e+1;i<o&&n[a[i]]===`NSM`;i++)r[a[i]]=t};for(let{open:e,close:t}of f){let n=!1,i=!1;for(let o=e+1;o<t;o++){let e=co(r[a[o]]);e===u?n=!0:e===d&&(i=!0)}let o=null;if(n)o=u;else if(i){let t=s;for(let n=e-1;n>=0;n--){let e=co(r[a[n]]);if(e){t=e;break}}o=t===d?d:u}o&&(r[a[e]]=o,r[a[t]]=o,p(e,o),p(t,o))}for(let e=0;e<o;e++){if(!eo(r[a[e]]))continue;let t=e;for(;t<o&&eo(r[a[t]]);)t++;let n=e>0?co(r[a[e-1]]):s,i=t<o?co(r[a[t]]):c;if(n&&i&&n===i)for(let i=e;i<t;i++)r[a[i]]=n;e=t-1}for(let e=0;e<o;e++)eo(r[a[e]])&&(r[a[e]]=u);for(let e=0;e<o;e++){let t=a[e],n=r[t];l&1?(n===`L`||n===`EN`||n===`AN`)&&(i[t]+=1):n===`R`?i[t]+=1:(n===`AN`||n===`EN`)&&(i[t]+=2)}}function uo(e,t,n){let r=e.length,i=Array(r);for(let t=0;t<r;t++)i[t]=n?.[t]??qa(e[t]);let a=t===`rtl`?1:t===`ltr`?0:ro(i,0,r),{pdiOf:o,initOf:s}=io(i),{levels:c,types:l}=ao(i,a,o),u=Array(r);for(let e=0;e<r;e++)u[e]=Qa(i[e]);let d=so(i,c,u,a,o,s),f=l.slice();for(let t of d)lo(t,e,i,f,c);let p=e=>{let t=i[e];return t===`WS`||$a(t)||t===`PDI`||u[e]};for(let e=0;e<r;e++){let t=i[e];if(t===`B`||t===`S`){c[e]=a;for(let t=e-1;t>=0&&p(t);t--)u[t]||(c[t]=a)}}for(let e=r-1;e>=0&&p(e);e--)u[e]||(c[e]=a);for(let e=0;e<r;e++)u[e]&&(c[e]=-1);return{levels:c,paragraphLevel:a}}function fo(e,t,n){let r=[];for(let i=t;i<n;i++){let t=e[i];t>=0&&t<=126&&r.push(i)}if(r.length===0)return r;let i=0,a=127;for(let t of r){let n=e[t];n>i&&(i=n),n&1&&n<a&&(a=n)}for(let t=i;t>=a;t--){let n=0;for(;n<r.length;)if(e[r[n]]>=t){let i=n+1;for(;i<r.length&&e[r[i]]>=t;)i++;for(let e=n,t=i-1;e<t;e++,t--){let n=r[e];r[e]=r[t],r[t]=n}n=i}else n++}return r}function po(e){let t=[],n=[],r=[];for(let i=0;i<e.length;){let a=e.codePointAt(i),o=a>65535?2:1;t.push(a),n.push(o),r.push(i),i+=o}return{cps:t,units:n,starts:r}}var mo=class{computeLevels(e,t,n){let{cps:r,units:i,starts:a}=po(e),{levels:o,paragraphLevel:s}=uo(r,t,n?r.map((e,t)=>n[a[t]]??null):void 0),c=new Uint8Array(e.length),l=0;for(let e=0;e<o.length;e++){let t=o[e]===-1?255:o[e];for(let n=0;n<i[e];n++)c[l++]=t}return{levels:c,paragraphLevel:s}}reorderVisual(e,t,n){return fo(e,t,n)}getMirror(e){return Ya(e)}};function ho(){return new mo}let go=null;function _o(){return go===null&&(go=ho()),go}const vo=/[\\u0590-\\u08FF\\uFB1D-\\uFDFF\\uFE70-\\uFEFF\\u200F\\u202B\\u202E\\u2067]|[\\u{10800}-\\u{10FFF}\\u{1E800}-\\u{1EFFF}]/u;function yo(e){return vo.test(e)}function bo(e,t,n){let r=n.length,i=new Uint8Array(r);for(let a=0;a<r;a++){let r=e[n[a]];i[a]=r===255?t:r}return{order:_o().reorderVisual(i,0,r),segLevels:i}}function xo(e){let t=new Set;for(let n of e)t.add(n.codePointAt(0));return t}function So(e){return{enabled:e?.kinsoku!==!1,lineStartForbidden:xo(e?.noLineBreaksBefore??`”’)〕]}〉》」』】〙〗〟⦆»、。,.・:;/?!‐ー゠–〜~ぁぃぅぇぉっゃゅょゎゕゖァィゥェォッャュョヮヵヶㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ゝゞヽヾ゛゜%‰℃°′″。」、・ー゙゚!),.:;?]}⦆`),lineEndForbidden:xo(e?.noLineBreaksAfter??`“‘(〔[{〈《「『【〘〖〝⦅«$¥#£¢([{⦅`)}}const Co=So();function wo(e,t,n,r=1){if(!n.enabled||t<=0||t>=e.length)return t;let i=t=>t<e.length&&n.lineStartForbidden.has(e[t].codePointAt(0)),a=t=>t>=0&&n.lineEndForbidden.has(e[t].codePointAt(0)),o=t;for(;o>r&&(i(o)||a(o-1));)o--;return o<=r&&(i(o)||a(o-1))?t:o}function To(e,t,n){if(!t.enabled)return 0;let r=e.length-n;for(let n=1;n<=r;n++){let r=e[e.length-n];if(/\\s/.test(r)||t.lineStartForbidden.has(r.codePointAt(0)))continue;let i=e[e.length-n-1];if(!(i&&t.lineEndForbidden.has(i.codePointAt(0))))return n}return 0}function Eo(e){return e>=12288&&e<=40959||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65280&&e<=65519}const Do=`BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB.CL.CP.EB.EM.EX.H2.H3.HL.HH.HY.ID.IN.IS.JL.JT.JV.NS.NU.OP.PO.PR.QU.RI.SY.VF.VI`.split(`.`),Oo=[0,9,10,11,13,14,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,58,60,63,64,91,92,93,94,123,124,125,126,127,133,134,160,161,162,163,166,171,172,173,174,176,177,178,180,181,187,188,191,192,712,713,716,717,735,736,768,860,867,880,894,895,1155,1162,1417,1418,1419,1423,1424,1425,1470,1471,1472,1473,1475,1476,1478,1479,1480,1488,1515,1519,1523,1536,1542,1545,1548,1550,1552,1563,1564,1565,1568,1611,1632,1642,1643,1645,1648,1649,1748,1749,1750,1757,1758,1759,1765,1767,1769,1770,1774,1776,1786,1809,1810,1840,1867,1958,1969,1984,1994,2027,2036,2040,2041,2042,2045,2046,2048,2070,2074,2075,2084,2085,2088,2089,2094,2137,2140,2192,2194,2199,2208,2250,2274,2275,2308,2362,2365,2366,2384,2385,2392,2402,2404,2406,2416,2433,2436,2492,2493,2494,2501,2503,2505,2507,2510,2519,2520,2530,2532,2534,2544,2546,2548,2553,2554,2555,2556,2558,2559,2561,2564,2620,2621,2622,2627,2631,2633,2635,2638,2641,2642,2662,2672,2674,2677,2678,2689,2692,2748,2749,2750,2758,2759,2762,2763,2766,2786,2788,2790,2800,2801,2802,2810,2816,2817,2820,2876,2877,2878,2885,2887,2889,2891,2894,2901,2904,2914,2916,2918,2928,2946,2947,3006,3011,3014,3017,3018,3022,3031,3032,3046,3056,3065,3066,3072,3077,3132,3133,3134,3141,3142,3145,3146,3150,3157,3159,3170,3172,3174,3184,3191,3192,3201,3204,3205,3260,3261,3262,3269,3270,3273,3274,3278,3285,3287,3298,3300,3302,3312,3315,3316,3328,3332,3387,3389,3390,3397,3398,3401,3402,3406,3415,3416,3426,3428,3430,3440,3449,3450,3457,3460,3530,3531,3535,3541,3542,3543,3544,3552,3558,3568,3570,3572,3633,3634,3636,3643,3647,3648,3655,3663,3664,3674,3676,3761,3762,3764,3773,3784,3791,3792,3802,3841,3845,3846,3848,3849,3851,3852,3853,3858,3859,3860,3861,3864,3866,3872,3882,3892,3893,3894,3895,3896,3897,3898,3899,3900,3901,3902,3904,3953,3967,3968,3973,3974,3976,3981,3992,3993,4029,4030,4032,4038,4039,4048,4050,4051,4052,4057,4059,4139,4159,4160,4170,4172,4182,4186,4190,4193,4194,4197,4199,4206,4209,4213,4226,4238,4239,4240,4250,4254,4352,4448,4520,4608,4957,4960,4961,4962,5120,5121,5760,5761,5787,5788,5789,5867,5870,5906,5910,5938,5941,5943,5970,5972,6002,6004,6068,6100,6102,6103,6104,6105,6106,6107,6108,6109,6110,6112,6122,6146,6148,6150,6151,6152,6154,6155,6158,6159,6160,6170,6277,6279,6313,6314,6432,6444,6448,6460,6468,6470,6480,6608,6619,6679,6684,6741,6751,6752,6781,6783,6784,6794,6800,6810,6832,6878,6880,6891,6892,6912,6917,6964,6980,6981,6989,6990,6992,7002,7004,7005,7009,7019,7028,7037,7040,7043,7073,7086,7088,7098,7104,7142,7154,7156,7204,7224,7227,7232,7242,7248,7258,7294,7296,7376,7379,7380,7401,7405,7406,7412,7413,7415,7418,7616,7629,7630,7676,7677,7680,8189,8190,8192,8199,8200,8203,8204,8205,8206,8208,8209,8210,8212,8213,8216,8218,8219,8222,8223,8224,8228,8231,8232,8234,8239,8240,8248,8249,8251,8252,8254,8260,8261,8262,8263,8266,8278,8279,8280,8284,8285,8288,8289,8294,8304,8317,8318,8319,8333,8334,8335,8352,8359,8360,8374,8375,8379,8380,8382,8383,8384,8385,8400,8433,8451,8452,8457,8458,8470,8471,8722,8724,8943,8944,8968,8969,8970,8971,8972,8986,8988,9001,9002,9003,9200,9204,9728,9732,9748,9750,9752,9753,9754,9757,9758,9760,9785,9788,9832,9833,9855,9856,9917,9929,9933,9934,9935,9938,9939,9941,9944,9946,9948,9949,9951,9954,9962,9963,9969,9974,9975,9977,9978,9979,9981,9989,9992,9994,9998,10075,10081,10082,10084,10085,10088,10089,10090,10091,10092,10093,10094,10095,10096,10097,10098,10099,10100,10101,10102,10181,10182,10183,10214,10215,10216,10217,10218,10219,10220,10221,10222,10223,10224,10240,10241,10627,10628,10629,10630,10631,10632,10633,10634,10635,10636,10637,10638,10639,10640,10641,10642,10643,10644,10645,10646,10647,10648,10649,10712,10713,10714,10715,10716,10748,10749,10750,11503,11506,11513,11514,11517,11518,11519,11520,11632,11633,11647,11648,11744,11776,11790,11798,11799,11800,11801,11802,11804,11806,11808,11810,11811,11812,11813,11814,11815,11816,11817,11818,11822,11823,11824,11826,11827,11829,11834,11836,11839,11840,11841,11842,11843,11851,11852,11853,11854,11856,11859,11861,11862,11863,11864,11865,11866,11867,11868,11869,11870,11904,11930,11931,12020,12032,12246,12272,12288,12289,12291,12293,12294,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,12306,12308,12309,12310,12311,12312,12313,12314,12315,12316,12317,12318,12320,12330,12336,12341,12342,12347,12349,12352,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12387,12388,12419,12420,12421,12422,12423,12424,12430,12431,12437,12439,12441,12443,12447,12448,12450,12451,12452,12453,12454,12455,12456,12457,12458,12483,12484,12515,12516,12517,12518,12519,12520,12526,12527,12533,12535,12539,12543,12544,12549,12592,12593,12687,12688,12774,12783,12784,12800,12831,12832,12872,12880,19904,19968,40981,40982,42125,42128,42183,42238,42240,42509,42510,42511,42512,42528,42538,42607,42611,42612,42622,42654,42656,42736,42738,42739,42744,43010,43011,43014,43015,43019,43020,43043,43048,43052,43053,43064,43065,43124,43126,43128,43136,43138,43188,43206,43214,43216,43226,43232,43250,43260,43261,43263,43264,43274,43302,43310,43312,43335,43348,43360,43389,43392,43396,43443,43456,43457,43463,43466,43470,43471,43472,43482,43486,43488,43493,43494,43504,43514,43520,43561,43575,43584,43587,43588,43596,43598,43600,43610,43612,43613,43616,43643,43646,43696,43697,43698,43701,43703,43705,43710,43712,43713,43714,43755,43760,43762,43765,43767,44003,44011,44012,44014,44016,44026,44032,44033,44060,44061,44088,44089,44116,44117,44144,44145,44172,44173,44200,44201,44228,44229,44256,44257,44284,44285,44312,44313,44340,44341,44368,44369,44396,44397,44424,44425,44452,44453,44480,44481,44508,44509,44536,44537,44564,44565,44592,44593,44620,44621,44648,44649,44676,44677,44704,44705,44732,44733,44760,44761,44788,44789,44816,44817,44844,44845,44872,44873,44900,44901,44928,44929,44956,44957,44984,44985,45012,45013,45040,45041,45068,45069,45096,45097,45124,45125,45152,45153,45180,45181,45208,45209,45236,45237,45264,45265,45292,45293,45320,45321,45348,45349,45376,45377,45404,45405,45432,45433,45460,45461,45488,45489,45516,45517,45544,45545,45572,45573,45600,45601,45628,45629,45656,45657,45684,45685,45712,45713,45740,45741,45768,45769,45796,45797,45824,45825,45852,45853,45880,45881,45908,45909,45936,45937,45964,45965,45992,45993,46020,46021,46048,46049,46076,46077,46104,46105,46132,46133,46160,46161,46188,46189,46216,46217,46244,46245,46272,46273,46300,46301,46328,46329,46356,46357,46384,46385,46412,46413,46440,46441,46468,46469,46496,46497,46524,46525,46552,46553,46580,46581,46608,46609,46636,46637,46664,46665,46692,46693,46720,46721,46748,46749,46776,46777,46804,46805,46832,46833,46860,46861,46888,46889,46916,46917,46944,46945,46972,46973,47e3,47001,47028,47029,47056,47057,47084,47085,47112,47113,47140,47141,47168,47169,47196,47197,47224,47225,47252,47253,47280,47281,47308,47309,47336,47337,47364,47365,47392,47393,47420,47421,47448,47449,47476,47477,47504,47505,47532,47533,47560,47561,47588,47589,47616,47617,47644,47645,47672,47673,47700,47701,47728,47729,47756,47757,47784,47785,47812,47813,47840,47841,47868,47869,47896,47897,47924,47925,47952,47953,47980,47981,48008,48009,48036,48037,48064,48065,48092,48093,48120,48121,48148,48149,48176,48177,48204,48205,48232,48233,48260,48261,48288,48289,48316,48317,48344,48345,48372,48373,48400,48401,48428,48429,48456,48457,48484,48485,48512,48513,48540,48541,48568,48569,48596,48597,48624,48625,48652,48653,48680,48681,48708,48709,48736,48737,48764,48765,48792,48793,48820,48821,48848,48849,48876,48877,48904,48905,48932,48933,48960,48961,48988,48989,49016,49017,49044,49045,49072,49073,49100,49101,49128,49129,49156,49157,49184,49185,49212,49213,49240,49241,49268,49269,49296,49297,49324,49325,49352,49353,49380,49381,49408,49409,49436,49437,49464,49465,49492,49493,49520,49521,49548,49549,49576,49577,49604,49605,49632,49633,49660,49661,49688,49689,49716,49717,49744,49745,49772,49773,49800,49801,49828,49829,49856,49857,49884,49885,49912,49913,49940,49941,49968,49969,49996,49997,50024,50025,50052,50053,50080,50081,50108,50109,50136,50137,50164,50165,50192,50193,50220,50221,50248,50249,50276,50277,50304,50305,50332,50333,50360,50361,50388,50389,50416,50417,50444,50445,50472,50473,50500,50501,50528,50529,50556,50557,50584,50585,50612,50613,50640,50641,50668,50669,50696,50697,50724,50725,50752,50753,50780,50781,50808,50809,50836,50837,50864,50865,50892,50893,50920,50921,50948,50949,50976,50977,51004,51005,51032,51033,51060,51061,51088,51089,51116,51117,51144,51145,51172,51173,51200,51201,51228,51229,51256,51257,51284,51285,51312,51313,51340,51341,51368,51369,51396,51397,51424,51425,51452,51453,51480,51481,51508,51509,51536,51537,51564,51565,51592,51593,51620,51621,51648,51649,51676,51677,51704,51705,51732,51733,51760,51761,51788,51789,51816,51817,51844,51845,51872,51873,51900,51901,51928,51929,51956,51957,51984,51985,52012,52013,52040,52041,52068,52069,52096,52097,52124,52125,52152,52153,52180,52181,52208,52209,52236,52237,52264,52265,52292,52293,52320,52321,52348,52349,52376,52377,52404,52405,52432,52433,52460,52461,52488,52489,52516,52517,52544,52545,52572,52573,52600,52601,52628,52629,52656,52657,52684,52685,52712,52713,52740,52741,52768,52769,52796,52797,52824,52825,52852,52853,52880,52881,52908,52909,52936,52937,52964,52965,52992,52993,53020,53021,53048,53049,53076,53077,53104,53105,53132,53133,53160,53161,53188,53189,53216,53217,53244,53245,53272,53273,53300,53301,53328,53329,53356,53357,53384,53385,53412,53413,53440,53441,53468,53469,53496,53497,53524,53525,53552,53553,53580,53581,53608,53609,53636,53637,53664,53665,53692,53693,53720,53721,53748,53749,53776,53777,53804,53805,53832,53833,53860,53861,53888,53889,53916,53917,53944,53945,53972,53973,54e3,54001,54028,54029,54056,54057,54084,54085,54112,54113,54140,54141,54168,54169,54196,54197,54224,54225,54252,54253,54280,54281,54308,54309,54336,54337,54364,54365,54392,54393,54420,54421,54448,54449,54476,54477,54504,54505,54532,54533,54560,54561,54588,54589,54616,54617,54644,54645,54672,54673,54700,54701,54728,54729,54756,54757,54784,54785,54812,54813,54840,54841,54868,54869,54896,54897,54924,54925,54952,54953,54980,54981,55008,55009,55036,55037,55064,55065,55092,55093,55120,55121,55148,55149,55176,55177,55204,55216,55239,55243,55292,63744,64256,64285,64286,64287,64297,64298,64311,64312,64317,64318,64319,64320,64322,64323,64325,64326,64336,64830,64831,64832,65020,65021,65024,65040,65043,65045,65047,65048,65049,65050,65056,65057,65058,65059,65060,65061,65062,65064,65065,65066,65067,65068,65069,65071,65072,65077,65078,65079,65080,65081,65082,65083,65084,65085,65086,65087,65088,65089,65090,65091,65092,65093,65095,65096,65097,65104,65105,65106,65107,65108,65110,65112,65113,65114,65115,65116,65117,65118,65119,65127,65128,65129,65130,65131,65132,65279,65280,65281,65282,65284,65285,65286,65288,65289,65290,65292,65293,65294,65295,65306,65308,65311,65312,65339,65340,65341,65342,65371,65372,65373,65374,65375,65376,65378,65379,65381,65382,65383,65393,65438,65440,65471,65474,65480,65482,65488,65490,65496,65498,65501,65504,65505,65506,65509,65511,65529,65532,65533,65792,65795,66045,66046,66272,66273,66422,66427,66463,66464,66512,66513,66720,66730,67671,67672,67871,67872,68097,68100,68101,68103,68108,68112,68152,68155,68159,68160,68176,68184,68325,68327,68336,68342,68343,68409,68416,68900,68904,68912,68922,68928,68938,68969,68974,68975,69291,69293,69294,69328,69329,69370,69376,69446,69457,69506,69510,69632,69635,69637,69688,69702,69703,69705,69710,69714,69734,69744,69745,69747,69749,69750,69759,69760,69763,69808,69819,69821,69822,69826,69827,69837,69838,69872,69882,69888,69891,69927,69941,69942,69952,69956,69957,69959,70003,70004,70005,70006,70016,70019,70067,70081,70085,70087,70088,70089,70093,70094,70096,70106,70107,70108,70109,70112,70188,70200,70202,70203,70205,70206,70207,70209,70210,70313,70314,70367,70379,70384,70394,70400,70404,70405,70413,70415,70417,70419,70441,70442,70449,70450,70452,70453,70458,70459,70461,70462,70469,70471,70473,70475,70477,70478,70480,70481,70487,70488,70493,70494,70496,70498,70500,70502,70509,70512,70517,70528,70538,70539,70540,70542,70543,70544,70546,70582,70583,70584,70593,70594,70595,70597,70598,70599,70603,70604,70608,70609,70610,70611,70614,70615,70617,70625,70627,70709,70727,70731,70735,70736,70746,70748,70750,70751,70832,70852,70864,70874,71087,71094,71096,71105,71106,71108,71110,71113,71128,71132,71134,71216,71233,71235,71248,71258,71264,71277,71339,71352,71360,71370,71376,71396,71453,71468,71472,71482,71484,71487,71724,71739,71904,71914,71936,71943,71945,71946,71948,71956,71957,71959,71960,71984,71990,71991,71993,71995,71998,71999,72e3,72001,72002,72004,72007,72016,72026,72145,72152,72154,72161,72162,72163,72164,72165,72193,72203,72243,72250,72251,72255,72256,72257,72261,72262,72263,72264,72273,72284,72330,72346,72349,72350,72353,72355,72448,72458,72544,72552,72688,72698,72751,72759,72760,72768,72769,72774,72784,72794,72816,72817,72818,72850,72872,72873,72887,73009,73015,73018,73019,73020,73022,73023,73030,73031,73032,73040,73050,73098,73103,73104,73106,73107,73112,73120,73130,73184,73194,73440,73458,73459,73463,73465,73472,73474,73475,73476,73489,73490,73524,73531,73534,73538,73539,73541,73552,73562,73563,73693,73697,73727,73728,74864,74869,78424,78427,78430,78466,78467,78470,78471,78472,78473,78474,78713,78714,78716,78895,78896,78903,78904,78905,78908,78909,78910,78911,78912,78913,78919,78934,83406,83407,83408,90368,90398,90416,90426,92768,92778,92782,92784,92864,92874,92912,92917,92918,92976,92983,92986,92996,92997,93008,93018,93550,93552,93562,93847,93849,94031,94032,94033,94088,94095,94099,94176,94180,94181,94192,94194,94196,94199,94208,101120,101632,101663,101760,101875,110592,110883,110898,110899,110928,110931,110933,110934,110948,110952,110960,111356,113821,113823,113824,113828,118e3,118010,118528,118574,118576,118599,119141,119146,119149,119171,119173,119180,119210,119214,119362,119365,120782,120832,121344,121399,121403,121453,121461,121462,121476,121477,121479,121483,121499,121504,121505,121520,122880,122887,122888,122905,122907,122914,122915,122917,122918,122923,123023,123024,123184,123191,123200,123210,123566,123567,123628,123632,123642,123647,123648,124140,124144,124154,124398,124400,124401,124411,124643,124644,124646,124647,124654,124656,124661,124662,125136,125143,125252,125259,125264,125274,125278,125280,126124,126125,126128,126129,126976,127232,127406,127462,127488,127877,127878,127900,127902,127925,127927,127932,127933,127938,127941,127943,127944,127946,127949,127995,128e3,128066,128068,128070,128081,128102,128121,128124,128125,128129,128132,128133,128136,128143,128144,128145,128146,128160,128161,128162,128163,128164,128165,128170,128171,128175,128176,128177,128179,128256,128263,128279,128293,128306,128330,128372,128374,128378,128379,128400,128401,128405,128407,128468,128476,128500,128506,128581,128584,128587,128592,128630,128633,128636,128640,128675,128676,128692,128695,128704,128705,128716,128717,128768,128884,128887,128891,128896,128981,129024,129292,129293,129295,129296,129304,129312,129318,129319,129328,129338,129340,129343,129399,129400,129461,129463,129464,129466,129467,129468,129485,129488,129489,129502,129536,129624,129731,129734,129776,129785,129792,130032,130042,130048,131070,131072,196606,196608,262142,917505,917506,917536,917632,917760,918e3],ko=[1,15,4,0,2,1,6,22,39,11,38,37,11,39,36,19,11,38,30,27,30,41,35,30,11,22,11,36,38,19,11,36,15,18,11,1,5,1,3,36,37,38,11,39,11,15,11,37,38,11,16,11,39,11,36,11,16,11,16,11,16,11,1,3,1,11,30,11,1,11,30,26,11,38,11,1,26,1,11,1,11,1,22,1,11,25,11,25,11,35,11,37,30,11,1,22,1,22,11,1,35,37,35,11,1,11,22,11,1,35,11,1,11,1,11,1,11,35,11,1,11,1,11,1,11,35,11,1,11,30,22,11,1,38,11,1,11,1,11,1,11,1,11,1,11,35,11,1,11,1,35,1,11,1,11,1,11,1,11,1,15,35,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,37,11,37,11,38,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,38,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,1,11,1,11,1,11,1,11,1,11,35,11,38,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,16,11,1,16,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,37,11,1,11,1,11,1,11,1,11,1,11,35,11,1,11,1,11,1,11,38,11,1,11,35,15,11,1,11,1,11,1,11,35,11,16,11,16,3,16,15,3,22,3,11,22,11,1,11,35,11,15,1,11,1,11,1,36,18,36,18,1,11,1,15,1,15,1,11,1,11,1,11,15,11,1,11,16,15,16,11,3,11,1,11,35,15,11,1,11,1,11,1,11,1,11,1,11,1,11,1,35,1,11,31,33,32,11,1,11,15,11,26,11,15,11,36,18,11,15,11,1,11,1,15,11,1,11,1,11,1,15,34,11,15,11,15,38,11,1,11,35,11,22,15,16,11,22,11,1,3,1,35,11,1,11,1,11,1,11,1,11,22,35,11,35,11,1,11,1,11,1,11,1,35,11,35,11,1,11,1,3,11,1,10,1,43,10,11,15,13,15,28,15,28,1,28,15,1,11,1,11,35,11,13,1,42,11,1,11,15,35,11,35,11,15,11,1,11,1,11,1,11,1,11,1,11,1,3,1,3,1,11,16,11,15,3,15,8,1,9,1,26,3,26,14,11,39,36,39,36,39,11,29,15,0,1,3,37,11,39,11,34,11,30,36,18,34,11,15,37,15,11,15,7,11,1,11,36,18,11,36,18,11,38,37,38,37,38,37,38,37,38,37,38,1,11,37,11,37,11,38,11,38,11,29,11,36,18,36,18,11,28,11,36,18,11,28,11,28,11,28,11,28,11,28,20,28,11,28,11,28,11,28,11,28,11,28,11,28,11,28,11,28,11,28,11,28,11,28,11,28,11,28,20,28,11,28,11,28,20,11,39,11,22,28,11,36,18,36,18,36,18,36,18,36,18,36,18,36,18,11,36,18,11,36,18,36,18,36,18,36,18,36,18,11,15,11,36,18,36,18,36,18,36,18,36,18,36,18,36,18,36,18,36,18,36,18,36,18,11,36,18,36,18,11,36,18,11,1,11,22,15,11,22,15,11,15,11,1,11,1,39,15,11,26,36,15,11,39,11,39,36,18,36,18,36,18,36,18,15,22,11,15,11,15,11,14,15,11,26,15,36,15,11,15,11,15,11,22,36,19,36,19,36,19,36,19,26,11,28,11,28,11,28,11,28,15,18,28,34,28,36,18,36,18,36,18,36,18,36,18,28,36,18,36,18,36,18,36,18,34,36,18,28,1,28,1,28,34,28,11,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,11,1,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,34,28,11,28,11,28,11,28,11,28,34,28,11,28,11,28,11,28,34,28,11,28,11,15,11,15,22,15,11,35,11,1,11,1,11,1,11,1,11,15,11,1,11,1,11,1,11,1,11,1,11,37,11,16,22,11,1,11,1,11,15,35,11,1,11,16,11,1,35,11,1,15,11,1,11,31,11,1,10,1,43,28,15,28,11,15,13,11,28,11,1,11,35,11,13,1,11,15,1,15,1,11,13,11,28,15,11,1,11,1,11,1,11,1,11,1,11,1,11,1,15,11,1,11,1,15,1,11,35,11,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,23,24,11,33,11,32,11,28,11,25,1,25,11,25,11,25,11,25,11,25,11,25,11,25,11,18,36,11,37,11,1,18,34,22,36,18,29,11,3,1,3,1,3,1,3,1,3,1,3,1,3,1,28,36,18,36,18,36,18,36,18,36,18,36,18,36,18,36,18,28,36,18,28,18,28,18,11,34,22,28,36,18,36,18,36,18,28,11,28,38,37,28,11,7,11,22,28,38,37,28,36,18,28,18,28,18,28,34,28,22,28,36,28,18,28,36,28,18,28,36,18,36,18,34,28,34,28,34,28,11,28,11,28,11,28,11,28,11,37,38,28,38,11,1,17,11,15,11,1,11,1,11,1,11,15,11,15,11,35,11,15,11,15,11,1,11,1,11,1,11,1,11,1,11,15,11,1,11,15,29,11,15,11,1,11,35,11,35,11,1,26,11,1,26,11,15,11,1,11,1,11,1,11,1,12,10,1,43,15,28,11,28,13,1,10,1,10,11,3,1,11,1,11,35,15,1,11,35,11,35,11,1,11,1,11,35,15,11,1,11,1,11,16,11,1,11,1,11,15,11,15,1,11,1,35,11,16,11,15,11,1,15,11,15,11,1,11,1,11,15,11,1,11,35,11,1,11,10,11,10,11,10,11,10,11,10,11,10,11,1,15,1,11,1,11,1,43,11,13,11,1,11,15,13,10,1,11,1,11,1,11,13,11,13,11,13,11,13,10,11,28,1,11,1,11,1,11,1,11,1,43,12,1,28,11,28,11,1,11,1,11,15,11,35,15,11,1,11,1,11,35,11,1,11,1,16,15,22,11,15,11,1,11,1,15,11,35,11,16,11,1,11,35,11,35,11,1,11,35,11,15,11,1,11,35,11,10,11,10,11,10,11,10,11,10,1,11,1,11,1,43,12,1,12,1,15,11,13,11,1,11,1,11,16,11,1,11,1,11,1,11,1,16,11,15,16,11,1,11,1,11,1,15,11,16,15,11,16,11,1,11,35,11,1,11,1,11,15,11,35,11,16,22,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,1,11,1,11,1,11,35,11,35,11,13,15,1,15,11,1,12,1,10,11,10,1,11,1,43,15,28,13,1,11,37,11,15,11,15,11,36,18,11,18,11,36,18,36,18,11,36,18,11,36,3,36,18,3,36,18,36,18,1,11,1,11,36,18,11,13,1,13,11,35,11,15,11,35,11,1,15,11,1,15,11,15,11,35,11,15,35,11,15,11,1,11,1,11,1,11,34,3,11,1,34,28,11,28,11,28,11,28,11,28,11,34,11,34,11,34,11,34,11,28,11,1,15,1,11,35,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,1,11,1,11,1,11,1,11,15,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,1,11,1,35,11,38,11,1,35,11,1,11,35,11,1,11,1,11,1,11,1,11,1,11,1,11,35,11,36,11,37,11,37,11,28,11,28,40,28,20,28,11,28,11,28,11,28,20,28,20,28,20,28,21,28,20,28,20,28,20,28,20,28,20,28,20,28,20,28,20,28,11,28,11,28,11,28,20,28,11,28,11,28,11,28,11,28,11,28,20,28,20,28,20,28,20,28,11,28,11,28,20,28,20,11,39,34,11,28,20,28,20,28,20,28,20,28,11,28,11,28,11,28,11,20,28,20,28,20,28,20,28,20,28,20,28,20,28,20,28,20,28,20,28,20,28,20,28,11,28,20,28,20,28,11,35,11,28,11,28,11,28,11,1,11,1,11,1,11],Ao=[4352,8361,8986,9001,9193,9200,9203,9725,9748,9776,9800,9855,9866,9875,9889,9898,9917,9924,9934,9940,9962,9970,9973,9978,9981,9989,9994,10024,10060,10062,10067,10071,10133,10160,10175,11035,11088,11093,11904,11931,12032,12272,12353,12441,12549,12593,12688,12783,12832,12880,42128,43360,44032,63744,65040,65072,65108,65128,65281,65474,65482,65490,65498,65504,65512,94176,94192,94208,101631,101760,110576,110581,110589,110592,110898,110928,110933,110948,110960,119552,119648,126980,127183,127374,127377,127488,127504,127552,127568,127584,127744,127789,127799,127870,127904,127951,127968,127988,127992,128064,128066,128255,128331,128336,128378,128405,128420,128507,128640,128716,128720,128725,128732,128747,128756,128992,129008,129292,129340,129351,129648,129664,129678,129736,129741,129759,129775,131072,196608],jo=[4448,8362,8988,9003,9197,9201,9204,9727,9750,9784,9812,9856,9872,9876,9890,9900,9919,9926,9935,9941,9963,9972,9974,9979,9982,9990,9996,10025,10061,10063,10070,10072,10136,10161,10176,11037,11089,11094,11930,12020,12246,12351,12439,12544,12592,12687,12774,12831,12872,42125,42183,43389,55204,64256,65050,65107,65127,65132,65471,65480,65488,65496,65501,65511,65519,94181,94199,101590,101663,101875,110580,110588,110591,110883,110899,110931,110934,110952,111356,119639,119671,126981,127184,127375,127387,127491,127548,127561,127570,127590,127777,127798,127869,127892,127947,127956,127985,127989,128063,128065,128253,128318,128335,128360,128379,128407,128421,128592,128710,128717,128723,128729,128736,128749,128765,129004,129009,129339,129350,129536,129661,129675,129735,129737,129757,129771,129785,196606,262142];function Mo(e){let t=0,n=Oo.length-1;for(;t<n;){let r=t+n+1>>1;Oo[r]<=e?t=r:n=r-1}return Do[ko[t]]}function No(e){let t=0,n=Ao.length-1;if(n<0||e<Ao[0])return!1;for(;t<n;){let r=t+n+1>>1;Ao[r]<=e?t=r:n=r-1}return e<jo[t]}function Po(e,t){let n=Mo(e);if(n===`OP`)return!0;let r=Mo(t),i=n===`AL`||n===`HL`,a=r===`AL`||r===`HL`;return!!(i&&(a||r===`NU`||r===`PR`||r===`PO`)||a&&(n===`NU`||n===`PR`||n===`PO`)||n===`PR`&&(r===`ID`||r===`EB`||r===`EM`)||(n===`ID`||n===`EB`||n===`EM`)&&r===`PO`||n===`NU`&&(r===`NU`||r===`PO`||r===`PR`)||r===`NU`&&(n===`PO`||n===`PR`||n===`HY`||n===`IS`)||(i||n===`NU`)&&r===`OP`&&!No(t)||n===`CP`&&!No(e)&&(a||r===`NU`))}function Fo(e){return e===`my`||e===`bo`}function Io(e){return e>=3584&&e<=3711||e>=3712&&e<=3839||e>=6016&&e<=6143||e>=4096&&e<=4255||e>=43616&&e<=43647||e>=43488&&e<=43519||e>=3840&&e<=4095}function Lo(e){return e===3633||e>=3635&&e<=3642||e>=3655&&e<=3662||e===3761||e>=3763&&e<=3772||e>=3784&&e<=3790||e>=6068&&e<=6099||e===6109}function Ro(e){return e<=3711?`th`:e<=3839?`lo`:e<=4095?`bo`:e<=4255?`my`:e<=6143?`km`:`my`}function zo(e){for(let t of e)if(Io(t.codePointAt(0)))return!0;return!1}function Bo(e){for(let t of e){let e=t.codePointAt(0);if(Io(e))return Fo(Ro(e))}return!1}function Vo(e){let t=!1;for(let n of e){let e=n.codePointAt(0);if(Io(e)){if(Fo(Ro(e)))return!1;t=!0}}return t}const Ho=new Map;function Uo(e){let t=Ho.get(e);if(t!==void 0)return t;let n=null;try{typeof Intl<`u`&&typeof Intl.Segmenter==`function`&&(n=new Intl.Segmenter(e,{granularity:`word`}))}catch{n=null}return Ho.set(e,n),n}function Wo(e){let t=Uo(e);return t?e=>t.segment(e):null}function Go(e){if(!zo(e))return[];let t=[],n=e.length,r=0;for(;r<n;){let i=e.codePointAt(r),a=i>65535?2:1;if(!Io(i)){r+=a;continue}let o=Ro(i),s=Fo(o),c=r+a;for(;c<n;){let t=e.codePointAt(c);if(!Io(t)||Fo(Ro(t))!==s)break;c+=t>65535?2:1}let l=e.slice(r,c);if(s)for(let e of $o(l))t.push(r+e);else{let e=Wo(o);if(e){let n=[];try{for(let t of e(l))t.index>0&&(t.isWordLike??!0)&&n.push(r+t.index);for(let e of n)t.push(e)}catch{}}}r=c}return t}function Ko(e){if(!zo(e))return[];let t=[],n=e.length,r=e.codePointAt(0),i=r>65535?2:1;for(;i<n;){let n=e.codePointAt(i),a=n>65535?2:1;Io(r)!==Io(n)&&!qo(r)&&!qo(n)&&t.push(i),r=n,i+=a}return t}function qo(e){return e===32||e===9||e===10||e===13||e===12288||e===160||e===8199||e===8239||e===8288||e===65279}function Jo(e,t){if(!zo(e))return[];let n=e.length,r=new Set(Go(e)),i=new Set($o(e)),a=e=>{i.has(e)&&r.add(e)};for(let t of Ko(e))a(t);if(t?.cjk){let t=e.codePointAt(0),r=t>65535?2:1;for(;r<n;){let n=e.codePointAt(r);(Eo(n)||Eo(t))&&a(r),t=n,r+=n>65535?2:1}}let o=t?.kinsoku,s=o!=null&&o.enabled!==!1,c=[];for(let t of r)if(!(t<=0||t>=n)){if(s){let n=e.codePointAt(t),r=Yo(e,t);if(r!==void 0&&o.lineEndForbidden.has(r)||o.lineStartForbidden.has(n))continue}c.push(t)}return c.sort((e,t)=>e-t),c}function Yo(e,t){if(t<=0)return;let n=e.charCodeAt(t-1);if(n>=56320&&n<=57343&&t>=2){let n=e.charCodeAt(t-2);if(n>=55296&&n<=56319)return e.codePointAt(t-2)}return n}function Xo(e,t,n,r,i,a=!1){let o=e.length;if(n>=o)return n;if(a){if(i(e.slice(n,o))<=r)return o;let a=0,s=t.length-1,c=n;for(;a<=s;){let l=a+s>>1,u=t[l];u<=n?a=l+1:u>=o?s=l-1:i(e.slice(n,u))<=r?(c=u,a=l+1):s=l-1}return c}let s=n;for(let a of t)a<=n||a>=o||i(e.slice(n,a))<=r&&(s=a);return i(e.slice(n,o))<=r&&(s=o),s}let Zo;function Qo(){if(Zo!==void 0)return Zo;let e=null;try{typeof Intl<`u`&&typeof Intl.Segmenter==`function`&&(e=new Intl.Segmenter(void 0,{granularity:`grapheme`}))}catch{e=null}return Zo=e,e}function $o(e){let t=Qo();if(t)try{let n=[];for(let r of t.segment(e))r.index>0&&n.push(r.index);return n}catch{}let n=[];for(let t=0;t<e.length;){let r=e.codePointAt(t);t+=r>65535?2:1,t<e.length&&n.push(t)}return n}const es=[`U`,`R`,`Tu`,`Tr`],ts=[0,167,168,169,170,174,175,177,178,188,191,215,216,247,248,746,748,4352,4608,5121,5760,6320,6400,8214,8215,8216,8218,8220,8222,8224,8226,8240,8242,8251,8253,8258,8259,8263,8266,8273,8274,8293,8294,8413,8417,8418,8421,8448,8450,8451,8458,8463,8464,8467,8469,8470,8472,8478,8484,8485,8486,8487,8488,8489,8490,8494,8495,8501,8512,8517,8523,8524,8526,8527,8586,8588,8592,8734,8735,8756,8758,8960,8968,8972,8992,8996,9001,9003,9004,9085,9115,9150,9166,9167,9168,9169,9180,9186,9251,9252,9472,9632,9754,9760,10088,10102,10132,11026,11056,11088,11098,11159,11160,11192,11218,11219,11244,11248,11264,11856,11858,11904,12289,12291,12296,12306,12308,12320,12336,12337,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12387,12388,12419,12420,12421,12422,12423,12424,12430,12431,12437,12439,12443,12445,12448,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12483,12484,12515,12516,12517,12518,12519,12520,12526,12527,12533,12535,12540,12541,12583,12584,12724,12728,12731,12732,12784,12800,13055,13144,13179,13184,42192,43360,43392,44032,55296,57344,64256,65040,65056,65072,65097,65104,65107,65112,65113,65119,65123,65127,65136,65281,65282,65288,65290,65292,65293,65294,65295,65306,65308,65311,65312,65339,65340,65341,65342,65343,65344,65371,65377,65504,65507,65508,65512,65520,65529,65532,65534,67968,68e3,71040,71168,72192,72384,77824,83584,94176,101888,110576,110898,110899,110928,110931,110933,110934,110948,110952,111360,118464,118736,118784,119296,119520,119680,120832,121520,126976,127488,127490,129024,129280,129792,131072,196606,196608,262142,983040,1048574,1048576,1114110],ns=[1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,3,1,3,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,3,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,2,0,3,0,3,0,3,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,3,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,3,0,2,0,2,0,2,0,2,0,2,0,2,0,1,0,1,0,1,0,1,0,1,0,1,2,0,1,3,0,1,0,1,2,0,3,0,2,1,2,0,3,1,2,0,3,0,3,0,3,0,3,1,0,3,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,2,0,2,0,2,0,2,0,1,0,1,0,1,0,1,0,1,0,2,0,1,0,1,0,1,0,1,0,1,0,1];function rs(e){let t=0,n=ts.length-1;for(;t<n;){let r=t+n+1>>1;ts[r]<=e?t=r:n=r-1}return ns[t]}function is(e){return es[rs(e)]}function as(e){return os.get(e)??null}const os=new Map([[65292,65040],[12289,65041],[12290,65042]]);function ss(e){return cs.get(e)??null}const cs=new Map([[65288,65077],[65289,65078],[65371,65079],[65373,65080],[12308,65081],[12309,65082],[12304,65083],[12305,65084],[12298,65085],[12299,65086],[12296,65087],[12297,65088],[12300,65089],[12301,65090],[12302,65091],[12303,65092],[12310,65047],[12311,65048]]),ls=new Set([65307]);function us(e){return ls.has(e)}const ds=new WeakMap;function fs(e){let t=e.canvas,n=t?.ownerDocument?.defaultView?.HTMLCanvasElement;return typeof n==`function`&&t instanceof n||typeof HTMLCanvasElement<`u`&&t instanceof HTMLCanvasElement?t:null}function ps(e,t){return e.replace(/(^|\\s)\\d*\\.?\\d+(?:px|pt|pc|in|cm|mm|q|em|rem|%)(?:\\/[^\\s]+)?(?=\\s)/i,`$1${t}`)}function ms(e,t=!0){let n=e.trim();return[...n===``||n.toLowerCase()===`normal`?[]:n.split(`,`).map(e=>e.trim()).filter(e=>!/^([\"'])vert\\1(?:\\s+(?:on|off|\\d+))?$/i.test(e)),`\"vert\" ${+!!t}`].join(`, `)}function hs(e){try{let t=e.ownerDocument?.defaultView,n=t?.getComputedStyle?t.getComputedStyle(e):typeof getComputedStyle==`function`?getComputedStyle(e):null;if(n?.fontFeatureSettings)return n.fontFeatureSettings}catch{}return e.style.fontFeatureSettings}function gs(e,t){if(e.isConnected)return t();let n=e.ownerDocument??(typeof document>`u`?null:document),r=n?.body??n?.documentElement;if(!r)return t();let i=e.parentNode,a=e.nextSibling,o=e.style,s={position:o.position,left:o.left,top:o.top,opacity:o.opacity,pointerEvents:o.pointerEvents};Object.assign(o,{position:`fixed`,left:`-99999px`,top:`0`,opacity:`0`,pointerEvents:`none`}),r.appendChild(e);let c=!1;try{return t()}catch(e){throw c=!0,e}finally{let t;try{if(i){let t=a?.parentNode===i?a:null;i.insertBefore(e,t)}else e.remove()}catch(n){t=n;try{e.remove()}catch{}}finally{Object.assign(o,s)}if(t!==void 0&&!c)throw t}}function _s(e,t){let n=fs(e);return n===null?t():gs(n,t)}function vs(e){let t=ds.get(e);if(t)return t;let n=e.createElement(`canvas`);n.width=256,n.height=256,n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,{position:`fixed`,left:`-99999px`,top:`0`,opacity:`0`,pointerEvents:`none`});let r={canvas:n,cache:new Map,epoch:0},i=()=>{r.epoch+=1,r.cache.clear()};return e.fonts?.addEventListener?.(`loadingdone`,i),e.fonts?.addEventListener?.(`loadingerror`,i),ds.set(e,r),r}function ys(e,t){let{width:n,height:r}=e.canvas,i=e.getImageData(0,0,n,r).data,a=new Uint8ClampedArray(n*r),o=n,s=r,c=-1,l=-1,u=0,d=0,f=0;for(let e=0;e<r;e+=1)for(let t=0;t<n;t+=1){let r=i[(e*n+t)*4+3];a[e*n+t]=r,r!==0&&(o=Math.min(o,t),s=Math.min(s,e),c=Math.max(c,t),l=Math.max(l,e),u+=r,d+=t*r,f+=e*r)}if(c<o||l<s||u===0)return null;let p=e.measureText(t),m=e=>typeof e==`number`&&Number.isFinite(e)?e:0;return{alpha:a,geometry:[o,s,c,l,d/u,f/u],metrics:[m(p.width),m(p.actualBoundingBoxLeft),m(p.actualBoundingBoxRight),m(p.actualBoundingBoxAscent),m(p.actualBoundingBoxDescent)]}}function bs(e,t,n){let r=e.canvas;r.style.fontFeatureSettings=n,e.font=e.font,e.clearRect(0,0,r.width,r.height);let i=String.fromCodePoint(t);return e.fillText(i,r.width/2,r.height/2),ys(e,i)}function xs(e,t){let n=0,r=Math.min(e.length,t.length);for(let i=0;i<r;i+=1)n+=Math.abs(e[i]-t[i]);return n}function Ss(e,t,n,r){let i=(e,t,n,r)=>{let i=Math.max(xs(e,t),xs(n,r));return Math.min(xs(e,n),xs(e,r),xs(t,n),xs(t,r))>i};return i(e.alpha,t.alpha,n.alpha,r.alpha)||i(e.geometry,t.geometry,n.geometry,r.geometry)||i(e.metrics,t.metrics,n.metrics,r.metrics)}function Cs(e,t){let n=fs(e);if(n===null||typeof document>`u`)return!1;let r=n.ownerDocument??document,i=vs(r),a=hs(n),o=`${i.epoch}:${ps(e.font,`<size>`)}:${a}:${t}`,s=i.cache.get(o);if(s!==void 0)return s;let c=!1,l=r.body??r.documentElement;if(!l)return!1;let u=i.canvas.isConnected;u||l.appendChild(i.canvas);let d=i.canvas.getContext(`2d`,{willReadFrequently:!0});if(d!==null){let n=i.canvas.style.fontFeatureSettings;try{d.font=ps(e.font,`200px`),d.fillStyle=`#000`,d.textAlign=`center`,d.textBaseline=`middle`;let n=ms(a,!1),r=ms(a,!0),i=bs(d,t,n),o=bs(d,t,n),s=bs(d,t,r),l=bs(d,t,r);c=i!==null&&o!==null&&s!==null&&l!==null&&Ss(i,o,s,l)}catch{c=!1}finally{i.canvas.style.fontFeatureSettings=n,d.font=d.font,d.clearRect(0,0,i.canvas.width,i.canvas.height),u||i.canvas.remove()}}return i.cache.set(o,c),c}function ws(e,t){let n=e.canvas;return n?.style?_s(e,()=>{let r=n.style,i=r.fontFeatureSettings;r.fontFeatureSettings=ms(hs(n)),e.font=e.font;try{return t()}finally{r.fontFeatureSettings=i,e.font=e.font}}):t()}function Ts(e,t){return ws(e,()=>{let n=e.textAlign,r=e.textBaseline;e.textAlign=`center`,e.textBaseline=`middle`;try{let n=e.measureText(t),r=Number.isFinite(n.width)?Math.max(0,n.width):0,i=typeof n.actualBoundingBoxAscent==`number`&&Number.isFinite(n.actualBoundingBoxAscent)&&typeof n.actualBoundingBoxDescent==`number`&&Number.isFinite(n.actualBoundingBoxDescent);return{advancePx:r,inkBeforePx:i?n.actualBoundingBoxAscent:0,inkAfterPx:i?n.actualBoundingBoxDescent:0,cellAdvancePx:r,originInCellPx:r/2}}finally{e.textAlign=n,e.textBaseline=r}})}const Es=e=>e===32||e===12288;function Ds(e,t,n={}){if(Math.abs(t)<=.5)return null;let r=n.firstContentSi??0,i=n.lastDrawnSi??e.length-1,a=n.minPerGap??-1/0,o=n.isGapChar??Eo,s=n.isWhitespace??Es,c=n.seaClusterGaps??!1,l=[];for(let t=r;t<e.length;t++){let n=e[t];if(n===void 0)continue;if(n.text===void 0){l.push({si:t,off:0,ws:!1});continue}let r=0;for(let e of n.text){let n=e.codePointAt(0);l.push({si:t,off:r,cp:n,ws:s(n)}),r++}}let u=-1,d=-1;for(let e=0;e<l.length;e++)l[e].ws||(u===-1&&(u=e),d=e);if(u===-1||u===d)return null;let f=Array(l.length).fill(!1),p=0;for(let e=u;e<d;e++){let t=l[e];if(t.si===i)continue;if(t.ws){f[e]=!0,p++;continue}let n=l[e+1];if(n.ws)continue;let r=t.cp,a=n.cp;(r!==void 0&&o(r)||a!==void 0&&o(a)||c&&r!==void 0&&a!==void 0&&Io(r)&&Io(a)&&!Lo(a))&&(f[e]=!0,p++)}if(p===0)return null;let m=t/p;t<0&&m<a&&(m=a);let h=new Map;for(let e of l)e.cp!==void 0&&h.set(e.si,(h.get(e.si)??0)+1);let g=new Map;for(let e=0;e<l.length;e++){if(!f[e])continue;let t=l[e],n=g.get(t.si);n||(n={splitBefore:[],trailingGap:!1,internalStretch:0},g.set(t.si,n));let r=h.get(t.si)??0;t.cp===void 0||t.off===r-1?n.trailingGap=!0:(n.splitBefore.push(t.off+1),n.internalStretch+=m)}return{perGap:m,perSeg:g}}const Os=[[1e3,`M`],[900,`CM`],[500,`D`],[400,`CD`],[100,`C`],[90,`XC`],[50,`L`],[40,`XL`],[10,`X`],[9,`IX`],[5,`V`],[4,`IV`],[1,`I`]];function ks(e){let t=``,n=e;for(let[e,r]of Os)for(;n>=e;)t+=r,n-=e;return t}function As(e,t){let n=t.length,r=Math.floor((e-1)/n)+1;return t[(e-1)%n].repeat(r)}const js=Array.from({length:26},(e,t)=>String.fromCharCode(65+t)),Ms=`أ.ب.ت.ث.ج.ح.خ.د.ذ.ر.ز.س.ش.ص.ض.ط.ظ.ع.غ.ف.ق.ك.ل.م.ن.ه.و.ي`.split(`.`),Ns=`أ.ب.ج.د.ه.و.ز.ح.ط.ي.ك.ل.م.ن.س.ع.ف.ص.ق.ر.ش.ت.ث.خ.ذ.ض.غ.ظ`.split(`.`),Ps=[`א`,`ב`,`ג`,`ד`,`ה`,`ו`,`ז`,`ח`,`ט`,`י`,`כ`,`ל`,`מ`,`נ`,`ס`,`ע`,`פ`,`צ`,`ק`,`ר`,`ש`,`ת`],Fs=[...Hs(1072,1080),...Hs(1082,1087),...Hs(1088,1097),`ы`,`э`,`ю`,`я`],Is=[...Hs(1040,1048),...Hs(1050,1055),...Hs(1056,1065),`Ы`,`Э`,`Ю`,`Я`],Ls=[`ก`,`ข`,`ค`,...Hs(3591,3619),`ล`,...Hs(3623,3630)],Rs=[`ㄱ`,`ㄴ`,`ㄷ`,`ㄹ`,`ㅁ`,`ㅂ`,`ㅅ`,`ㅇ`,`ㅈ`,`ㅊ`,`ㅋ`,`ㅌ`,`ㅍ`,`ㅎ`],zs=[`가`,`나`,`다`,`라`,`마`,`바`,`사`,`아`,`자`,`차`,`카`,`타`,`파`,`하`],Bs=Hs(2325,2361),Vs=[...Hs(2309,2324),`अं`,`अः`];function Hs(e,t){let n=[];for(let r=e;r<=t;r++)n.push(String.fromCodePoint(r));return n}const Us=`ア.イ.ウ.エ.オ.カ.キ.ク.ケ.コ.サ.シ.ス.セ.ソ.タ.チ.ツ.テ.ト.ナ.ニ.ヌ.ネ.ノ.ハ.ヒ.フ.ヘ.ホ.マ.ミ.ム.メ.モ.ヤ.ユ.ヨ.ラ.リ.ル.レ.ロ.ワ.ヰ.ヱ.ヲ.ン`.split(`.`),Ws=[...Hs(65393,65436),`ヲ`,`ン`];function Gs(e){return e<=20?String.fromCodePoint(9312+(e-1)):String(e)}function Ks(e,t){return String(e).split(``).map(e=>t[e.charCodeAt(0)-48]).join(``)}const qs=Hs(65296,65305),Js=Hs(3664,3673),Ys=Hs(2406,2415),Xs=[`〇`,`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`],Zs=[`영`,`일`,`이`,`삼`,`사`,`오`,`육`,`칠`,`팔`,`구`],Qs=[`零`,`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`],$s=[`○`,`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`];function ec(e,t){if(e<10)return t[e];if(e<100){let n=Math.floor(e/10),r=e%10,i=n===1?`十`:t[n]+`十`;return r===0?i:i+t[r]}return Ks(e,t)}function tc(e,t){switch(t){case`upperRoman`:return e>=1?ks(e):String(e);case`lowerRoman`:return e>=1?ks(e).toLowerCase():String(e);case`upperLetter`:return e>=1?As(e,js):String(e);case`lowerLetter`:return e>=1?As(e,js).toLowerCase():String(e);case`arabicAlpha`:return e>=1?As(e,Ms):String(e);case`arabicAbjad`:return e>=1?As(e,Ns):String(e);case`russianLower`:return e>=1?As(e,Fs):String(e);case`russianUpper`:return e>=1?As(e,Is):String(e);case`thaiLetters`:return e>=1?As(e,Ls):String(e);case`chosung`:return e>=1?As(e,Rs):String(e);case`ganada`:return e>=1?As(e,zs):String(e);case`hindiVowels`:return e>=1?As(e,Bs):String(e);case`hindiConsonants`:return e>=1?As(e,Vs):String(e);case`aiueoFullWidth`:return e>=1?As(e,Us):String(e);case`aiueo`:return e>=1?As(e,Ws):String(e);case`decimalEnclosedCircle`:return e>=1?Gs(e):String(e);case`hebrew1`:return e>=1?ac(e):String(e);case`hebrew2`:return e>=1?oc(e):String(e);case`hex`:return e>=1?e.toString(16).toUpperCase():String(e);case`numberInDash`:return e>=1?`- ${e} -`:String(e);case`decimalZero`:return e>=1&&e<=9?`0${e}`:String(e);case`decimalFullWidth`:return e>=1?Ks(e,qs):String(e);case`decimalHalfWidth`:return String(e);case`thaiNumbers`:return e>=1?Ks(e,Js):String(e);case`hindiNumbers`:return e>=1?Ks(e,Ys):String(e);case`ideographDigital`:case`japaneseDigitalTenThousand`:return e>=1?Ks(e,Xs):String(e);case`koreanDigital`:return e>=1?Ks(e,Zs):String(e);case`koreanDigital2`:return e>=1?Ks(e,Qs):String(e);case`taiwaneseDigital`:return e>=1?Ks(e,$s):String(e);case`chineseCounting`:return e>=1?ec(e,Xs):String(e);case`taiwaneseCounting`:return e>=1?ec(e,$s):String(e);case`chineseCountingThousand`:return e>=1?hc(e,cc):String(e);case`taiwaneseCountingThousand`:return e>=1?hc(e,lc):String(e);case`chineseLegalSimplified`:return e>=1?hc(e,dc):String(e);case`ideographLegalTraditional`:return e>=1?hc(e,pc):String(e);case`japaneseCounting`:return e>=1?hc(e,sc):String(e);case`japaneseLegal`:return e>=1?hc(e,fc):String(e);case`koreanCounting`:return e>=1?hc(e,uc):String(e);case`koreanLegal`:return e>=1?vc(e):String(e);default:return String(e)}}const nc=[``,`א`,`ב`,`ג`,`ד`,`ה`,`ו`,`ז`,`ח`,`ט`],rc=[``,`י`,`כ`,`ל`,`מ`,`נ`,`ס`,`ע`,`פ`,`צ`],ic=[``,`ק`,`ר`,`ש`,`ת`,`ך`,`ם`,`ן`,`ף`,`ץ`];function ac(e){let t=``,n=e,r=Math.floor(n/1e3);n%=1e3;let i=Math.floor(n/100);if(n%=100,r>0&&(t+=nc[r%10]),t+=ic[i],n===15)return t+`טו`;if(n===16)return t+`טז`;let a=Math.floor(n/10),o=n%10;return t+=rc[a],t+=nc[o],t}function oc(e){let t=Ps.length,n=Math.floor((e-1)/t);return Ps[e-t*n-1]+`ת`.repeat(n)}const sc={digits:Qs,ten:`十`,hundred:`百`,thousand:`千`,myriad:`万`,elideOne:!0,insertZero:!1},cc={...sc,elideOne:!1,insertZero:!0},lc={...cc},uc={digits:[`영`,`일`,`이`,`삼`,`사`,`오`,`육`,`칠`,`팔`,`구`],ten:`십`,hundred:`백`,thousand:`천`,myriad:`만`,elideOne:!0,insertZero:!1},dc={digits:[`零`,`壹`,`贰`,`叁`,`肆`,`伍`,`陆`,`柒`,`捌`,`玖`],ten:`拾`,hundred:`佰`,thousand:`仟`,myriad:`万`,elideOne:!1,insertZero:!0},fc={digits:[`零`,`壱`,`弐`,`参`,`四`,`伍`,`六`,`七`,`八`,`九`],ten:`拾`,hundred:`百`,thousand:`阡`,myriad:`萬`,elideOne:!1,insertZero:!1},pc={digits:[`零`,`壹`,`貳`,`參`,`肆`,`伍`,`陸`,`柒`,`捌`,`玖`],ten:`拾`,hundred:`佰`,thousand:`仟`,myriad:`萬`,elideOne:!1,insertZero:!1};function mc(e,t,n){let r=Math.floor(e/1e3)%10,i=Math.floor(e/100)%10,a=Math.floor(e/10)%10,o=e%10,s=[{digit:r,unit:t.thousand},{digit:i,unit:t.hundred},{digit:a,unit:t.ten},{digit:o,unit:``}],c=``,l=!1,u=!1;for(let{digit:e,unit:r}of s){if(e===0){l&&(u=!0);continue}u&&=(t.insertZero&&(c+=t.digits[0]),!1),n&&e===1&&r?c+=r:c+=t.digits[e]+r,l=!0}return c}function hc(e,t){if(e>=1e8){let n=Math.floor(e/1e8),r=e%1e8,i=hc(n,t)+`億`;return r===0?i:i+(t.insertZero&&r<1e7?t.digits[0]:``)+hc(r,t)}let n=Math.floor(e/1e4),r=e%1e4,i=``;return n>0&&(i+=mc(n,t,t.elideOne)+t.myriad),r>0&&(t.insertZero&&n>0&&r<1e3&&(i+=t.digits[0]),i+=mc(r,t,t.elideOne)),i}const gc=[``,`하나`,`둘`,`셋`,`넷`,`다섯`,`여섯`,`일곱`,`여덟`,`아홉`],_c=[``,`열`,`스물`,`서른`,`마흔`,`쉰`,`예순`,`일흔`,`여든`,`아흔`];function vc(e){if(e>=100)return String(e);let t=Math.floor(e/10),n=e%10;return _c[t]+gc[n]}const yc={Arabic:`decimal`,ArabicDash:`numberInDash`,Hex:`hex`,Roman:`upperRoman`,roman:`lowerRoman`,ALPHABETIC:`upperLetter`,alphabetic:`lowerLetter`,ARABICABJAD:`arabicAbjad`,ARABICALPHA:`arabicAlpha`,HEBREW1:`hebrew1`,HEBREW2:`hebrew2`,HINDIARABIC:`hindiNumbers`,HINDILETTER1:`hindiVowels`,HINDILETTER2:`hindiConsonants`,THAIARABIC:`thaiNumbers`,THAILETTER:`thaiLetters`,CHOSUNG:`chosung`,GANADA:`ganada`,DBCHAR:`decimalFullWidth`,SBCHAR:`decimalHalfWidth`};function bc(e){let t=/\\\\\\*\\s+(\\S+)/g,n;for(;(n=t.exec(e))!==null;){let e=yc[n[1]];if(e)return e}return null}const xc=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],Sc=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Cc=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],wc=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],Tc=e=>e<10?`0${e}`:`${e}`;function Ec(e){let t=/\\\\@\\s*\"([^\"]*)\"/.exec(e);if(t)return t[1];let n=/\\\\@\\s*(\\S+)/.exec(e);return n?n[1]:null}function Dc(e,t){let n=t.getFullYear(),r=t.getMonth(),i=t.getDate(),a=t.getDay(),o=t.getHours(),s=o%12==0?12:o%12,c=t.getMinutes(),l=t.getSeconds(),u=o>=12,d=``,f=0,p=e.length;for(;f<p;){let t=e[f];if(t===`'`){f++;let t=``;for(;f<p;){if(e[f]===`'`){if(e[f+1]===`'`){t+=`'`,f+=2;continue}f++;break}t+=e[f++]}d+=t;continue}if(/[A-Za-z]/.test(t)){let u=f;for(;u<p&&e[u]===t;)u++;let m=e.slice(f,u).length,h=t.toLowerCase(),g=null;if(t===`y`||t===`Y`?g=m>=4?String(n).padStart(4,`0`):Tc(n%100):t===`M`?g=m>=4?xc[r]:m===3?Sc[r]:m===2?Tc(r+1):String(r+1):h===`d`?g=m>=4?Cc[a]:m===3?wc[a]:m===2?Tc(i):String(i):t===`H`?g=m>=2?Tc(o):String(o):t===`h`?g=m>=2?Tc(s):String(s):t===`m`?g=m>=2?Tc(c):String(c):t===`s`?g=m>=2?Tc(l):String(l):(h===`a`||h===`p`)&&(g=null),g!==null){d+=g,f=u;continue}if(!(h===`a`||h===`p`))return null}let m=/^([AaPp])([Mm])?\\/([AaPp])([Mm])?/.exec(e.slice(f));if(m){let e=m[2]!==void 0;d+=e?u?`PM`:`AM`:u?`P`:`A`,f+=m[0].length;continue}d+=t,f++}return d}const Oc=[[e=>e.includes(`meiryo`)||e.includes(`メイリオ`),{asc:2210/2048,desc:1059/2048}],[e=>!e.includes(`ui`)&&(e.includes(`yu mincho`)||e.includes(`yumincho`)||e.includes(`游明朝`)||e.includes(`yu gothic`)||e.includes(`yugothic`)||e.includes(`游ゴシック`)),{asc:1802*1.3/2048,desc:455*1.3/2048,eaOnly:!0}],[e=>e.includes(`sakkal majalla`)||e.includes(`majalla`),{asc:1810/2048,desc:1050/2048}],[e=>e===`times new roman`,{asc:1825/2048,desc:530/2048}],[e=>e===`arial`,{asc:1854/2048,desc:501/2048}]];function kc(e,t){if(!e)return null;let n=e.toLowerCase();for(let[e,r]of Oc)if(e(n)&&(t||!r.eaOnly))return r;return null}function Ac(e,t=!1){let n=kc(e,t);return n===null?null:n.asc+n.desc}function jc(e,t,n=!1){let r=Ac(e,n);return r===null?0:r*t}function Mc(e,t,n,r,i=!1){let a=kc(e,i);if(a===null)return{ascent:n,descent:r};let o=(a.asc+a.desc)*t;return n+r<=o?{ascent:n,descent:r}:{ascent:a.asc*t,descent:a.desc*t}}function Nc(e){return e.trim().toLowerCase()}function Pc(e){return`local(\"${e.replaceAll(`\\\\`,`\\\\\\\\`).replaceAll(`\"`,`\\\\\"`)}\")`}function Fc(e){return`__ooxml_local_${[...e].map(e=>(e.codePointAt(0)??0).toString(16).padStart(6,`0`)).join(``)}`}function Ic(){return typeof OffscreenCanvas<`u`?new OffscreenCanvas(1,1).getContext(`2d`):typeof document<`u`&&document?.createElement?document.createElement(`canvas`).getContext(`2d`):null}async function Lc(e){let t=k();if(!t||typeof FontFace>`u`)return{faces:[],metrics:{}};let n=[],r={},i=new Map;for(let t of e){let e=t.family.trim(),n=t.localNames.map(e=>e.trim()).filter(Boolean);if(!e||n.length===0||t.lineHeightMultiplier!=null&&!(t.lineHeightMultiplier>0))continue;let r=t.weight??400,a=t.style??`normal`;if(!(r>=100&&r<=900)||a!==`normal`&&a!==`italic`)continue;let o=n.map(Pc).join(`, `),s=Nc(e),c=`local-face:${o}:${r}:${a}`,l=i.get(c)??{source:o,requests:[]};l.requests.push({...t,family:e,normalizedFamily:s,source:o,weight:r,style:a}),i.set(c,l)}for(let[e,a]of i){let i=Fc(e),{face:o}=w(e,t,()=>{let e=a.requests[0],n=new FontFace(i,a.source,{weight:String(e.weight),style:e.style});return t.add(n),n});try{if(!await E(o.load())||o.status!==`loaded`)throw Error(`local font load timed out`);let e=!1;for(let t of a.requests){let n;if(t.lineHeightMultiplier!=null){let e=Ic();if(!e)continue;e.font=`${t.style} ${t.weight} 100px \"${i}\"`;let r=e.measureText(`Hg国`),a=r.fontBoundingBoxAscent,o=r.fontBoundingBoxDescent;if(!(Number.isFinite(a)&&Number.isFinite(o)&&a+o>0))continue;n=(a+o)/100*t.lineHeightMultiplier}let a=t.weight===400&&t.style===`normal`?t.normalizedFamily:`${t.normalizedFamily}:${t.weight}:${t.style}`;r[a]={family:i,...n==null?{}:{lineHeightRatio:n},requestedFamily:t.family,weight:t.weight,style:t.style,sourceIdentity:t.source,synthesized:!1},e=!0}if(!e)throw Error(`exact local font route unavailable`);n.push(o)}catch{T([o])}}return{faces:n,metrics:r}}function Rc(e){T(e)}const zc=[{test:e=>e===`georgia`,biasEm:.0105}];function Bc(e){return(e??``).trim().replace(/^[\"']|[\"']$/g,``).replace(/\\s+/g,` `).toLowerCase()}function Vc(e){let t=Bc(e);for(let e of zc)if(e.test(t))return e.biasEm;return 0}function Hc(e){if(e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(Hc).join(`,`)}]`;if(typeof e==`object`){let t=e;return`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${Hc(t[e])}`).join(`,`)}}`}throw TypeError(`Cannot fingerprint ${typeof e}`)}function Uc(e,t){let n=Hc(t);return`${e}:${encodeURIComponent(n)}`}function Wc(e){return`${e.story}:${encodeURIComponent(e.storyInstance)}:${e.path.join(`.`)}`}function Gc(e,t,n){if(t.length===0||n.length===0)throw RangeError(`Body occurrence identity requires a flow domain and fragment start`);return[`body-occurrence`,encodeURIComponent(Wc(e)),encodeURIComponent(t),encodeURIComponent(n)].join(`/`)}function Kc(e,t){return`image:${Wc(e)}:${encodeURIComponent(t)}`}function qc(e,t){return`math:${Wc(e)}:${encodeURIComponent(t)}`}function Jc(e,t){return`anchor:${Wc(e)}:${encodeURIComponent(t)}`}function Yc(e,t,n=new WeakSet,r=new WeakSet){if(e==null||typeof e==`string`||typeof e==`boolean`)return;if(typeof e==`number`){if(!Number.isFinite(e))throw TypeError(`${t} must contain finite numbers`);return}if(typeof e!=`object`||n.has(e))throw TypeError(`${t} must be structured-clone-safe plain data`);if(r.has(e))return;let i=Object.getPrototypeOf(e);if(!Array.isArray(e)&&i!==Object.prototype&&i!==null)throw TypeError(`${t} must be structured-clone-safe plain data`);n.add(e);try{for(let[i,a]of Object.entries(e))Yc(a,`${t}.${i}`,n,r)}finally{n.delete(e)}r.add(e)}function Xc(e,t=new WeakSet){if(typeof e!=`object`||!e||t.has(e))return e;t.add(e);for(let n of Object.values(e))Xc(n,t);return Object.freeze(e)}function Zc(e,t){Yc(e,t);try{return Xc(structuredClone(e))}catch{throw TypeError(`${t} must be structured-clone-safe plain data`)}}function Qc(e){let t=e.__typographyAcquisition;if(t!==void 0)return Zc({sourceText:`text`in e?e.text:e.fallbackText,...t},`DOCX run typography acquisition input`)}function $c(e){let t=e.__paragraphTypographyAcquisition;if(t!==void 0)return Zc(t,`DOCX paragraph typography acquisition input`)}function el(e,t){let n=e.fontFamily??null;return{fontSizePt:t,fonts:{ascii:n,highAnsi:n,eastAsia:e.fontFamilyEastAsia??n,complexScript:n},weight:400,style:`normal`,complexScript:!1}}function tl(e,t={story:`textbox`,storyInstance:`shape`,path:[]},n=el){return Zc((e.textBlocks??[]).map((e,r)=>{let i={story:`textbox`,storyInstance:t.storyInstance,path:[...t.path,r]},a=e.runs?.length?e.runs:[{text:e.text,fontSizePt:e.fontSizePt,color:e.color,fontFamily:e.fontFamily,bold:e.bold,italic:e.italic}],o=e.color??a[0]?.color,s=e.numbering?{...e.numbering,...e.numbering.color==null&&!e.numbering.colorAuto&&o?{color:o}:{}}:null;return{source:i,spacing:{beforePt:e.spaceBefore??0,afterPt:e.spaceAfter??0},runs:a.map(t=>({text:t.text,fontSizePt:t.fontSizePt,...t.color??e.color?{color:`#${t.color??e.color}`}:{},...t.fontFamily||e.fontFamily?{fontFamily:t.fontFamily??e.fontFamily??void 0}:{},...t.fontFamilyEastAsia?{fontFamilyEastAsia:t.fontFamilyEastAsia}:{},bold:t.bold??e.bold??!1,italic:t.italic??e.italic??!1,...t.ruby?{ruby:t.ruby}:{}})),alignment:e.alignment??`left`,indentLeftPt:e.indentLeft??0,indentRightPt:e.indentRight??0,indentFirstPt:e.indentFirst??0,lineSpacing:e.lineSpacingVal==null?null:{value:e.lineSpacingVal,rule:e.lineSpacingRule===`exact`||e.lineSpacingRule===`atLeast`?e.lineSpacingRule:`auto`,explicit:!0},tabStops:(e.tabStops??[]).map(e=>({...e})),...e.bidi===void 0?{}:{bidi:e.bidi},contextualSpacing:e.contextualSpacing??!1,...e.styleId===void 0?{}:{styleId:e.styleId},...s?{numbering:s,numberingMarkerShapeInput:n(s,e.fontSizePt)}:{},...e.imagePath?{image:{imagePath:e.imagePath,mimeType:e.mimeType??`application/octet-stream`,...e.svgImagePath?{svgImagePath:e.svgImagePath}:{},widthPt:e.imageWidthPt??0,heightPt:e.imageHeightPt??0}}:{}}}),`DOCX text box acquisition input`)}function nl(e,t){let n=e<0n?-e:e,r=t<0n?-t:t;for(;r!==0n;)[n,r]=[r,n%r];return n===0n?1n:n}function rl(e,t){if(t===0n)throw RangeError(`Exact length denominator must not be zero`);let n=t<0n?-1n:1n,r=nl(e,t);return Object.freeze({numerator:n*e/r,denominator:n*t/r})}function il(e){let t=/^([+-]?)(?:(\\d+)(?:\\.(\\d*))?|\\.(\\d+))(?:[eE]([+-]?\\d+))?$/.exec(e);if(!t)return null;let n=t[1]===`-`,r=t[2]??``,i=t[3]??t[4]??``,a=Number(t[5]??`0`);if(!Number.isSafeInteger(a))return null;let o=`${r}${i}`,s=0;for(;s<o.length&&o.charCodeAt(s)===48;)s+=1;if(s===o.length)return rl(0n,1n);let c=o.length-1;for(;c>s&&o.charCodeAt(c)===48;)--c;let l=o.slice(s,c+1),u=o.length-1-c,d=a-i.length+u,f=d+l.length-1;if(l.length>768||Math.abs(f)>1100)return null;let p=BigInt(l),m=1n;return d>=0?p*=10n**BigInt(d):m=10n**BigInt(-d),n&&(p=-p),rl(p,m)}function al(e){let t=/^(-?\\d+)\\/([1-9]\\d*)$/.exec(e);if(!t)throw RangeError(`Invalid exact length key: ${e}`);return rl(BigInt(t[1]),BigInt(t[2]))}function ol(e){let t=rl(e.numerator,e.denominator);return`${t.numerator}/${t.denominator}`}function sl(e){let t=il(e);return t?ol(t):null}function cl(e){if(!Number.isFinite(e)||e<0)return null;let t=il(e.toString());return t?ol(t):null}function ll(e,t){let n=e.toString(2).length-t.toString(2).length;return(n>=0?e<t<<BigInt(n):e<<BigInt(-n)<t)&&--n,n}function ul(e,t,n){let r=n>=0?e<<BigInt(n):e,i=n<0?t<<BigInt(-n):t,a=r/i,o=r%i*2n-i;return o>0n||o===0n&&a%2n!=0n?a+1n:a}function dl(e){let t=al(e);if(t.numerator===0n)return 0;let n=t.numerator<0n,r=n?-t.numerator:t.numerator,i=ll(r,t.denominator),a;if(i<-1022){let e=ul(r,t.denominator,1074);a=Number(e)*Number.MIN_VALUE}else{let e=ul(r,t.denominator,52-i);e===1n<<53n&&(e>>=1n,i+=1),a=i>1023?1/0:Number(e)*2**(i-52)}return n?-a:a}function fl(e,t){let n=al(e),r=al(t);return ol(rl(n.numerator*r.denominator+r.numerator*n.denominator,n.denominator*r.denominator))}function pl(e,t){let n=al(e),r=al(t);return ol(rl(n.numerator*r.numerator,n.denominator*r.denominator))}function ml(e,t){let n=al(e),r=al(t);return ol(rl(n.numerator*r.denominator-r.numerator*n.denominator,n.denominator*r.denominator))}function hl(e,t){if(t===0n)throw RangeError(`Exact length divisor must not be zero`);let n=al(e);return ol(rl(n.numerator,n.denominator*t))}function gl(e,t){let n=al(e),r=al(t),i=n.numerator*r.denominator-r.numerator*n.denominator;return i<0n?-1:+(i>0n)}const _l=1e-9;function vl(e,t,n,r){let i=Number.isFinite(e)?Math.max(0,e):0,a=Math.max(0,t),o=a+Math.max(1,n);return{startPt:a===0?i:i/2,endPt:o>=Math.max(0,r)?i:i/2}}function yl(e){return Number.isFinite(e)?Math.max(0,e):0}function bl(e){return e.map(e=>Math.abs(e)<=_l?0:e)}function xl(e){let t=e.gridWidthsPt.length;for(let n of e.rows){for(let e of n.cells)t=Math.max(t,e.columnStart+Math.max(1,e.columnSpan));let e=n.cells.reduce((e,t)=>Math.max(e,t.columnStart+Math.max(1,t.columnSpan)),n.before?.columnSpan??0);t=Math.max(t,e+(n.after?.columnSpan??0))}return t}function Sl(e,t,n){let r=0,i=Math.min(e.length,t+Math.max(1,n));for(let n=Math.max(0,t);n<i;n+=1)r+=e[n]??0;return r}function Cl(e,t){return e?e.kind===`pct`?yl(e.value)*t:yl(e.value):null}function wl(e,t,n,r){let i=Math.max(0,t),a=Math.max(1,Math.min(n,e.length-i));if(a<=0)return;let o=Sl(e,i,a);if(o<=_l){e[i+a-1]=r;return}let s=r/o;for(let t=i;t<i+a;t+=1)e[t]=(e[t]??0)*s}function Tl(e,t,n,r){let i=Math.max(0,t),a=Math.max(1,Math.min(n,e.length-i));if(a<=0)return;let o=Sl(e,i,a);r<=o+_l||(e[i+a-1]+=r-o)}function El(e,t){let n=[];e.before&&e.before.columnSpan>0&&n.push({start:0,span:e.before.columnSpan,preferred:e.before.preferredWidth});for(let t of e.cells)n.push({start:t.columnStart,span:t.columnSpan,preferred:t.preferredWidth});return e.after&&e.after.columnSpan>0&&n.push({start:Math.max(0,t-e.after.columnSpan),span:e.after.columnSpan,preferred:e.after.preferredWidth}),n}function Dl(e,t){let n=Array.from({length:t},(t,n)=>yl(e.gridWidthsPt[n]??0)),r=n.reduce((e,t)=>e+t,0),i=e.tablePreferredWidthPt??(r>0?r:yl(e.availableWidthPt));e.rows.forEach((e,r)=>{for(let a of El(e,t)){let e=Cl(a.preferred,i);e!==null&&(r===0?wl(n,a.start,a.span,e):Tl(n,a.start,a.span,e))}}),e.tablePreferredWidthPt===null&&Ol(n,e.rows);let a=e.tablePreferredWidthPt,o=n.reduce((e,t)=>e+t,0);if(a!==null&&a>=0&&o<=_l&&n.length>0)return n.map(()=>a/n.length);if(a!==null&&a>=0&&o>_l){let e=a/o;return n.map(t=>t*e)}return n}function Ol(e,t){let n=Array(e.length).fill(0);for(let r of t)for(let t of r.cells){if(t.columnSpan!==1||t.preferredWidth?.kind!==`pct`)continue;let r=t.columnStart;r<0||r>=e.length||(n[r]=Math.max(n[r]??0,yl(t.preferredWidth.value)))}let r=e.reduce((e,t)=>e+t,0),i=n.map((t,n)=>t*r>e[n]+_l),a=new Set;for(;i.some(Boolean);){let t=i.map(e=>e?`1`:`0`).join(``);if(a.has(t))return;a.add(t);let o=0,s=0;for(let t=0;t<e.length;t+=1)i[t]?s+=n[t]??0:o+=e[t]??0;if(s>=1-_l)return;r=o/(1-s);let c=n.map((t,n)=>t*r>e[n]+_l);if(c.every((e,t)=>e===i[t])){for(let t=0;t<e.length;t+=1)i[t]&&(e[t]=n[t]*r);return}i=c}}function kl(e,t,n){let r=Array(t).fill(0),i=Array(t).fill(0);for(let n of e)for(let e of n.cells)e.columnSpan!==1||e.columnStart<0||e.columnStart>=t||(r[e.columnStart]=Math.max(r[e.columnStart]??0,yl(e.minContentWidthPt)),i[e.columnStart]=Math.max(i[e.columnStart]??0,yl(e.maxContentWidthPt)));let a=Array(t).fill(!1);for(let o of e)for(let e of o.cells){let o=e.columnStart;if(e.columnSpan!==1||o<0||o>=t||a[o]||e.preferredWidth===null)continue;let s=Cl(e.preferredWidth,n);s!==null&&(i[o]=Math.max(r[o]??0,s),a[o]=!0)}for(let e=0;e<t;e+=1)i[e]=Math.max(r[e]??0,i[e]??0);return{minimums:r,maximums:i}}function Al(e,t,n,r,i){let a=Math.min(e.length,n+r),o=e.map((e,t)=>t).filter(e=>e<n||e>=a),s=o.map(n=>Math.max(0,e[n]-(t[n]??0))),c=s.reduce((e,t)=>e+t,0),l=Math.min(i,c);return l<=_l||c<=_l?0:(o.forEach((t,n)=>{e[t]-=l*((s[n]??0)/c)}),l)}function jl(e,t,n,r){if(r<=_l||n<=0)return;let i=Sl(e,t,n);for(let a=0;a<n;a+=1){let o=t+a,s=i>_l?(e[o]??0)/i:1/n;e[o]+=r*s}}function Ml(e,t,n,r){let i=Math.max(0,r.columnStart),a=Math.max(1,Math.min(r.columnSpan,e.length-i));if(a<=0)return;let o=yl(r.minContentWidthPt),s=Sl(e,i,a);if(o<=s+_l)return;let c=a===1?n[i]??o:Math.max(o,yl(r.maxContentWidthPt));jl(e,i,a,Al(e,t,i,a,Math.max(0,c-s)));let l=Sl(e,i,a);l<o-_l&&jl(e,i,a,o-l)}function Nl(e,t,n,r){let i=e.reduce((e,t)=>e+t,0);if(i<=r+_l||i<=_l)return e;let a=[...e],o=a.map((e,n)=>Math.max(0,e-(t[n]??0))),s=o.reduce((e,t)=>e+t,0),c=Math.min(i-r,s);c>_l&&s>_l&&a.forEach((e,t)=>{a[t]-=c*((o[t]??0)/s)});for(let e of n){if(e.columnSpan<=1)continue;let n=Math.max(0,e.columnStart),r=Math.max(1,Math.min(e.columnSpan,a.length-n)),i=yl(e.minContentWidthPt)-Sl(a,n,r);if(i<=_l)continue;let o=Al(a,t,n,r,i);jl(a,n,r,o),o<i-_l&&jl(a,n,r,i-o)}let l=a.reduce((e,t)=>e+t,0);if(l<=r+_l||l<=_l)return bl(a);let u=Math.max(0,r)/l;return bl(a.map(e=>e*u))}function Pl(e){let t=xl(e);if(t===0)return Object.freeze([]);let n=Dl(e,t);if(e.layout===`fixed`){let t=n.reduce((e,t)=>e+t,0),r=yl(e.availableWidthPt);if(t<=r+_l||t<=_l)return Object.freeze(n);let i=r/t;return Object.freeze(bl(n.map(e=>e*i)))}let r=n.reduce((e,t)=>e+t,0),{minimums:i,maximums:a}=kl(e.rows,t,r),o=e.rows.flatMap(e=>e.cells);o.sort((e,t)=>e.columnSpan-t.columnSpan);for(let e of o)Ml(n,i,a,e);return Object.freeze(Nl(n,i,o,yl(e.availableWidthPt)))}function Fl(e){let t=Pl(e),n=t.map((t,n)=>{let r=t!==e.gridWidthsPt[n];return!r&&e.gridWidthKeys?.[n]===null?null:!r&&e.gridWidthKeys?.[n]!==void 0?e.gridWidthKeys[n]:cl(t)??`0/1`});return Object.freeze({widthsPt:Object.freeze([...t]),widthKeys:Object.freeze(n)})}function Il(e){return Fl(e).widthsPt}function Ll(e,t){let n=(e.smallCaps?Math.max(e.fontSize-2,1):e.fontSize)*t;return e.vertAlign&&(n*=.65),n}const Rl=/[ᄀ-ᇿ⺀-⿟ -〿぀-ヿ㄰-㆏㐀-䶿一-鿿ꥠ-꥿가-퟿豈-﫿＀-￯]/u;function zl(e,t,n){let r=null,i=0;for(let n of t)n.pos>i&&(i=n.pos),n.pos>e&&(r===null||n.pos<r.pos)&&(r=n);let a=null;if(n>0){let t=Math.ceil((Math.max(e,i)+1e-6)/n)*n;t<=e&&(t+=n),a={pos:t,alignment:`left`}}return r&&a?r.pos<=a.pos?r:a:r??a}function Bl(e,t,n){return zl(e,t,n)}function Vl(e,t){let n=t===`vert`||t===`vert270`||t===`eaVert`||t===`mongolianVert`;return{type:`text`,text:e.text,bold:e.bold??!1,italic:e.italic??!1,underline:!1,strikethrough:!1,fontSize:e.fontSizePt,color:e.color??null,fontFamily:e.fontFamily??null,fontFamilyEastAsia:e.fontFamilyEastAsia??null,isLink:!1,background:null,vertAlign:null,hyperlink:null,ruby:e.ruby??void 0,textBoxLineFloor:!0,textBoxVertical:n}}function Hl(e,t={},n={}){if(!e)return`sans-serif`;let r=t[e];return r===`roman`?`serif`:r===`swiss`?`sans-serif`:r===`modern`&&n[e]===`fixed`?`monospace`:`sans-serif`}const Ul=Symbol(`docx.localMetricSnapshot`);function Wl(e={}){if(e[Ul])return e;let t=Object.entries(e).map(([e,t])=>{if(!t.family?.trim())throw TypeError(`Local metric ${e} requires a family`);if(t.lineHeightRatio!==void 0&&(!Number.isFinite(t.lineHeightRatio)||t.lineHeightRatio<0))throw RangeError(`Local metric ${e} lineHeightRatio must be finite and non-negative`);if(t.weight!==void 0&&(!Number.isFinite(t.weight)||t.weight<1||t.weight>1e3))throw RangeError(`Local metric ${e} weight must be finite and between 1 and 1000`);let n={family:t.family,...t.lineHeightRatio===void 0?{}:{lineHeightRatio:t.lineHeightRatio},...t.requestedFamily===void 0?{}:{requestedFamily:t.requestedFamily},...t.weight===void 0?{}:{weight:t.weight},...t.style===void 0?{}:{style:t.style},...t.sourceIdentity===void 0?{}:{sourceIdentity:t.sourceIdentity},...t.synthesized===void 0?{}:{synthesized:t.synthesized}};return[Nc(e),Object.freeze(n)]}).sort(([e],[t])=>e.localeCompare(t)),n=Object.fromEntries(t);return Object.defineProperty(n,Ul,{value:!0}),Object.freeze(n)}const Gl=new Set([161,164,167,168,170,173,175,176,177,178,179,180,182,183,184,185,186,188,189,190,191,215,247]),Kl=new Set([224,225,232,233,234,236,237,242,243,249,250,252]);function ql(e,t,n,r,i){let a=n===`eastAsia`,o=r?.split(/[-_]/,1)[0]?.toLowerCase()===`zh`,s=/^(?:86|88)$/i.test(i?.trim()??``),c=`highAnsi`;return e<=127?c=`ascii`:e<=255?c=a&&(Gl.has(e)||o&&Kl.has(e))?`eastAsia`:`highAnsi`:e>=256&&e<=687?c=a&&(o||s)?`eastAsia`:`highAnsi`:e>=688&&e<=767||e>=768&&e<=879||e>=880&&e<=975||e>=1024&&e<=1279?c=a?`eastAsia`:`highAnsi`:e>=1424&&e<=1983||e>=64285&&e<=65023||e>=65136&&e<=65278?c=`ascii`:e>=4352&&e<=4607||e>=11904&&e<=12031||e>=12032&&e<=12255||e>=12272&&e<=12687||e>=12688&&e<=12703||e>=12800&&e<=19903||e>=19968&&e<=40879||e>=40960&&e<=42127||e>=42128&&e<=42191||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65072&&e<=65103||e>=65104&&e<=65135||e>=65280&&e<=65519||e>=65536&&e<=1114111?c=`eastAsia`:e>=7680&&e<=7935?c=a&&o?`eastAsia`:`highAnsi`:(e>=8192&&e<=10175||e>=57344&&e<=63743||e>=64256&&e<=64284)&&(c=a?`eastAsia`:`highAnsi`),c===`eastAsia`&&a?c:t?`complexScript`:c}function Jl(e,t){return e.themeFontPresence?.[t]??e.themeFonts?.[t]!=null?e.themeFonts?.[t]:e.fonts[t]??(e.themeFontPresence?.ascii??e.themeFonts?.ascii!=null?e.themeFonts?.ascii:e.fonts.ascii)}function Yl(e){let t=Wl(e.localMetrics),n=Object.freeze(Object.fromEntries(Object.entries(e.genericFamilies??{}).map(([e,t])=>[e.trim().toLocaleLowerCase(`en-US`),t]).sort(([e],[t])=>e.localeCompare(t)))),r=Object.freeze(Object.fromEntries(Object.entries(e.eastAsiaFontCharsets??{}).map(([e,t])=>[e.trim().toLocaleLowerCase(`en-US`),t.trim()]).sort(([e],[t])=>e.localeCompare(t)))),i=Uc(`text`,{fonts:e.fonts.fingerprint,measurer:e.measurer.fingerprint,localMetrics:t,eastAsiaFontCharsets:r,genericFamilies:n}),a=t=>{let r=Jl(t,t.slot),i=r?n[r.trim().toLocaleLowerCase(`en-US`)]??t.genericFamily??`sans-serif`:t.genericFamily;return e.fonts.resolve({requestedFamily:r,genericFamily:i,weight:t.weight,style:t.style})},o=new Map,s=t=>{let n=JSON.stringify([t.text,t.fontRoute.familyList,t.fontRoute.scope,t.fontRoute.fingerprint,t.fontSizePt,t.weight,t.style,t.letterSpacingPt,t.kerning??null]),r=o.get(n);if(r)return r;let i=e.measurer.measure(t),a=Object.freeze({...i,...i.inkBounds?{inkBounds:Object.freeze({...i.inkBounds})}:{}});return o.set(n,a),a},c=t=>e.measurer.measure(t).advancePt,l=new Map;return Object.freeze({fingerprint:i,localMetrics:t,resolve:a,shape(e){if(!Number.isFinite(e.fontSizePt)||e.fontSizePt<0)throw RangeError(`fontSizePt must be a finite non-negative number`);let t=JSON.stringify([e.text,e.fontSizePt,[e.fonts.ascii??null,e.fonts.highAnsi??null,e.fonts.eastAsia??null,e.fonts.complexScript??null],[e.themeFonts?.ascii??null,e.themeFonts?.highAnsi??null,e.themeFonts?.eastAsia??null,e.themeFonts?.complexScript??null],[e.themeFontPresence?.ascii??null,e.themeFontPresence?.highAnsi??null,e.themeFontPresence?.eastAsia??null,e.themeFontPresence?.complexScript??null],e.weight??null,e.style??null,e.complexScript??null,e.fontHint??null,e.eastAsiaLanguage??null,e.eastAsiaFontCharset??null,e.genericFamily??null,e.letterSpacingPt??null,e.kerning??null,e.measure??null,e.clusterGeometry??null]),n=l.get(t);if(n)return n;let i=[],o=Object.freeze([...new Set([0,...$o(e.text),e.text.length])].sort((e,t)=>e-t)),u=new Set(o),d=0;for(let t of e.text){let n=d+t.length,a=Jl(e,`eastAsia`),o=e.eastAsiaFontCharset??(a?r[a.trim().toLocaleLowerCase(`en-US`)]:void 0),s=ql(t.codePointAt(0)??0,e.complexScript??!1,e.fontHint,e.eastAsiaLanguage,o),c=i.at(-1);c?.script===s?(c.text+=t,c.end=n):i.push({text:t,start:d,end:n,script:s,breakBefore:u.has(d)}),d=n}let f=i.map(t=>{let n=a({fonts:e.fonts,themeFonts:e.themeFonts,themeFontPresence:e.themeFontPresence,slot:t.script,weight:e.weight,style:e.style,genericFamily:e.genericFamily}),r=e.measure===!1?{advancePt:0,ascentPt:0,descentPt:0}:s({text:t.text,fontRoute:n.route,fontSizePt:e.fontSizePt,weight:n.weight,style:n.style,letterSpacingPt:e.letterSpacingPt??0,kerning:e.kerning});return Object.freeze({...t,...r,font:n,fontRoute:n.route})}),p=f.flatMap(e=>e.font.diagnostics),m=f.length>0&&f.every(e=>e.inkBounds!==void 0)?(()=>{let e=0,t=1/0,n=-1/0,r=0,i=0;for(let a of f){let o=a.inkBounds;t=Math.min(t,e+o.xMinPt),n=Math.max(n,e+o.xMaxPt),r=Math.max(r,o.ascentPt),i=Math.max(i,o.descentPt),e+=a.advancePt}return Object.freeze({xMinPt:t,xMaxPt:n,ascentPt:r,descentPt:i})})():void 0,h=f.reduce((e,t)=>e+t.advancePt,0),g=e.clusterGeometry===!1?void 0:(()=>{let t=new Map([[0,0],[e.text.length,h]]),n=n=>{if(e.measure===!1||n<=0)return 0;let r=t.get(n);if(r!==void 0)return r;let i=0;for(let t of f){if(n>=t.end){i+=t.advancePt;continue}if(n<=t.start)break;i+=c({text:t.text.slice(0,n-t.start),fontRoute:t.fontRoute,fontSizePt:e.fontSizePt,weight:t.font.weight,style:t.font.style,letterSpacingPt:e.letterSpacingPt??0,kerning:e.kerning});break}return t.set(n,i),i};return Object.freeze(o.slice(0,-1).map((e,t)=>{let r=o[t+1]??e,i=n(e);return Object.freeze({range:Object.freeze({start:e,end:r}),offsetPt:i,advancePt:n(r)-i})}))})(),_=Object.freeze({advancePt:h,ascentPt:Math.max(0,...f.map(e=>e.ascentPt)),descentPt:Math.max(0,...f.map(e=>e.descentPt)),...m?{inkBounds:m}:{},...m&&f.every(e=>e.horizontalInkBoundsAreTight===!0)?{horizontalInkBoundsAreTight:!0}:{},spans:Object.freeze(f),graphemeBoundaries:o,...g?{clusters:g}:{},diagnostics:Object.freeze(p)});return l.set(t,_),_}})}function Xl(e,t){let n=[];for(let r=0;r<e.length;){let i=e[r];if(i.fitTextValTwips===void 0){r+=1;continue}let a=r+1;if(i.fitTextId!==void 0)for(;a<e.length&&e[a].fitTextValTwips!==void 0&&e[a].fitTextId===i.fitTextId;)a+=1;let o=0,s=0;for(let t=r;t<a;t+=1){let n=e[t];o+=n.naturalWidthPx*(n.charScale??1),s+=n.charCount}let c=i.fitTextValTwips/20*t,l=s>1?(c-o)/(s-1):0,u=c-o-Math.max(0,s-1)*l;n.push({start:r,end:a,targetPx:c,naturalPx:o,charCount:s,perGapPx:l,trailingPadPx:u}),r=a}return n}function Zl(e){return e<0n?-e:e}function Ql(e,t){let n=Zl(e),r=Zl(t);for(;r!==0n;){let e=n%r;n=r,r=e}return n}function $l(e,t){if(t===0n)throw Error(`Exact rational denominator must be nonzero`);if(e===0n)return Object.freeze({numerator:0n,denominator:1n});let n=t<0n?-1n:1n,r=Ql(e,t);return Object.freeze({numerator:n*e/r,denominator:n*t/r})}function J(e,t){let n=e.numerator*t.denominator-t.numerator*e.denominator;return n<0n?-1:+(n>0n)}function eu(e,t){return $l(e.numerator*t.denominator-t.numerator*e.denominator,e.denominator*t.denominator)}function tu(e,t){return $l(e.numerator*t.denominator+t.numerator*e.denominator,2n*e.denominator*t.denominator)}function nu(e){return`${e.numerator}/${e.denominator}`}const ru=new DataView(new ArrayBuffer(8));function iu(e){if(!Number.isFinite(e))throw Error(`Exact geometry requires a finite binary64 value`);if(e===0)return Object.freeze({coefficient:0n,exponent:0});ru.setFloat64(0,e,!1);let t=ru.getBigUint64(0,!1),n=t>>63n!=0n,r=Number(t>>52n&2047n),i=t&(1n<<52n)-1n,a=r===0?i:1n<<52n|i,o=r===0?-1074:r-1023-52;for(;(a&1n)==0n;)a>>=1n,o+=1;return Object.freeze({coefficient:n?-a:a,exponent:o})}function au(e){return e===0n?0:e.toString(2).length}function ou(e,t,n){let r=n>=0?e:e<<BigInt(-n),i=n>=0?t<<BigInt(n):t;return r<i?-1:+(r>i)}function su(e,t,n){let r=n>=0?e<<BigInt(n):e,i=n>=0?t:t<<BigInt(-n),a=r/i,o=r%i*2n;return(o>i||o===i&&(a&1n)!=0n)&&(a+=1n),a}function cu(e){return ru.setBigUint64(0,e,!1),ru.getFloat64(0,!1)}function lu(e){if(e.numerator===0n)return 0;let t=e.numerator<0n,n=Zl(e.numerator),r=e.denominator,i=au(n)-au(r);ou(n,r,i)<0&&--i;let a=t?1n<<63n:0n;if(i<-1022){let e=su(n,r,1074);return cu(e===0n?a:e>=1n<<52n?a|1n<<52n:a|e)}let o=su(n,r,52-i);if(o===1n<<53n&&(o>>=1n,i+=1),i>1023)return t?-1/0:1/0;let s=BigInt(i+1023)<<52n,c=o-(1n<<52n);return cu(a|s|c)}function uu(e){if(e===1/0)return e;if(Object.is(e,-0)||e===0)return Number.MIN_VALUE;ru.setFloat64(0,e,!1);let t=ru.getBigUint64(0,!1);return cu(e>0?t+1n:t-1n)}function du(e){let t=lu(e);if(t===1/0)return t;if(t===-1/0)return-Number.MAX_VALUE;let n=iu(t);return J(n.exponent>=0?{numerator:n.coefficient<<BigInt(n.exponent),denominator:1n}:{numerator:n.coefficient,denominator:1n<<BigInt(-n.exponent)},e)>=0?t:uu(t)}function fu(e){return-du({numerator:-e.numerator,denominator:e.denominator})}function pu(e){if(!e.points||e.points.length<3||e.points.some(e=>!Number.isFinite(e.xPt)||!Number.isFinite(e.yPt)))throw Error(`Invalid ${e.kind} wrapPolygon for ${e.imageKey}`);if(![e.xLeftPt,e.xRightPt,e.yTopPt,e.yBottomPt].every(Number.isFinite)||e.xRightPt<e.xLeftPt||e.yBottomPt<e.yTopPt)throw Error(`Invalid finite wrap bounds for ${e.imageKey}`)}const mu=new WeakMap;function hu(e,t){return e.x===t.x&&e.y===t.y}function gu(e,t,n,r){return e*r-t*n}function _u(e,t){return t>0n?e>=0n&&e<=t:e<=0n&&e>=t}function vu(e,t){let n=hu(e.from,t.from)||hu(e.from,t.to)?e.from:hu(e.to,t.from)||hu(e.to,t.to)?e.to:null;if(n)return Object.freeze({y:$l(n.y,1n),contact:`shared-endpoint`});let r=e.to.x-e.from.x,i=e.to.y-e.from.y,a=t.to.x-t.from.x,o=t.to.y-t.from.y,s=gu(r,i,a,o);if(s===0n)return null;let c=t.from.x-e.from.x,l=t.from.y-e.from.y,u=gu(c,l,a,o),d=gu(c,l,r,i);return!_u(u,s)||!_u(d,s)?null:Object.freeze({y:$l(e.from.y*s+i*u,s),contact:i===0n||o===0n?`horizontal`:`active-crossing`})}function yu(e,t){return`${e}:${t}`}function bu(e,t,n){let r=new Set;for(let i of t){if(i<0||i>=Math.floor(e.length/2))continue;n();let t=e[i*2],a=e[i*2+1];r.add(yu(t,a))}return r}function xu(e){let t=e=>{if(e.length===0)return null;let n=e[Math.floor(e.length/2)].yTopPt,r=[],i=[],a=[];for(let t of e)t.yBottomPt<=n?r.push(t):t.yTopPt>n?i.push(t):a.push(t);return Object.freeze({centerYPt:n,crossingByTop:Object.freeze(a),crossingByBottom:Object.freeze(a.slice().sort((e,t)=>t.yBottomPt-e.yBottomPt)),below:t(r),above:t(i)})};return t(e.slice().sort((e,t)=>e.yTopPt-t.yTopPt||e.yBottomPt-t.yBottomPt))}function Su(e,t){return lu(t>=0?{numerator:e.numerator<<BigInt(t),denominator:e.denominator}:{numerator:e.numerator,denominator:e.denominator<<BigInt(-t)})}function Cu(e,t){return du(t>=0?{numerator:e.numerator<<BigInt(t),denominator:e.denominator}:{numerator:e.numerator,denominator:e.denominator<<BigInt(-t)})}function wu(e,t){let n=iu(e),r=n.exponent-t;return r>=0?{numerator:n.coefficient<<BigInt(r),denominator:1n}:{numerator:n.coefficient,denominator:1n<<BigInt(-r)}}function Tu(e,t,n){let r=e.dx*n.numerator-e.c*n.denominator,i=t.dx*n.numerator-t.c*n.denominator,a=r*t.dy-i*e.dy;return a<0n?-1:+(a>0n)}function Eu(e){let t=e=>{if(e.length===0)return null;let n=e[Math.floor(e.length/2)].yTop,r=[],i=[],a=[];for(let t of e)J(t.yBottom,n)<=0?r.push(t):J(t.yTop,n)>0?i.push(t):a.push(t);return Object.freeze({centerY:n,crossingByTop:Object.freeze(a),crossingByBottom:Object.freeze(a.slice().sort((e,t)=>J(t.yBottom,e.yBottom))),below:t(r),above:t(i)})};return t(e.slice().sort((e,t)=>J(e.yTop,t.yTop)||J(e.yBottom,t.yBottom)))}function Du(e,t,n,r){if(!(!e||J(n,t)<=0)){if(J(n,e.centerY)<=0){for(let t of e.crossingByTop){if(J(t.yTop,n)>=0)break;r.push(t)}Du(e.below,t,n,r);return}if(J(t,e.centerY)>=0){for(let n of e.crossingByBottom){if(J(n.yBottom,t)<=0)break;r.push(n)}Du(e.above,t,n,r);return}r.push(...e.crossingByTop),Du(e.below,t,n,r),Du(e.above,t,n,r)}}function Ou(e,t,n,r,i){let a=new Map,o=new Map;t.forEach((e,t)=>{if(e.minY===e.maxY)return;let n=nu($l(e.minY,1n)),r=nu($l(e.maxY,1n)),i=a.get(n);i?i.push(t):a.set(n,[t]);let s=o.get(r);s?s.push(t):o.set(r,[t])});let s=new Map;for(let e of i){if(e.contact!==`active-crossing`)continue;let t=nu(e.y),n=s.get(t);n||s.set(t,n=new Set),n.add(e.leftEdge),n.add(e.rightEdge)}let c=[],l=new Set,u=new Map,d=[],f=[],p=0,m=0,h=(t,n,i)=>{for(let a of t){if(n.has(a))continue;let t=u.get(a);if(t&&J(i,t.yTop)>0){let n=Object.freeze({yTop:t.yTop,yBottom:i,leftEdge:t.leftEdge,rightEdge:t.rightEdge});d.push(n);let a=Su(t.yTop,r),o=Su(i,r);o>a&&f.push(Object.freeze({yTopPt:a,yBottomPt:o,left:e[t.leftEdge],right:e[t.rightEdge]}))}u.delete(a)}for(let e of n){if(t.has(e))continue;let n=e.indexOf(`:`);u.set(e,{leftEdge:Number(e.slice(0,n)),rightEdge:Number(e.slice(n+1)),yTop:i})}},g=new Map,_=(e,t)=>{e.add(Math.floor((t-1)/2)),e.add(Math.floor(t/2)),e.add(Math.floor((t+1)/2))},v=e=>bu(c,e,()=>{m+=2}),y=()=>{let e=new Set;for(let t=0;t+1<c.length;t+=2)m+=2,e.add(yu(c[t],c[t+1]));return e};for(let e=0;e<n.length;e+=1){let r=n[e],i=n[e+1],u=i?tu(r,i):r,d=(e,n)=>(p+=1,Tu(t[e],t[n],u)||e-n),f=e=>{let t=0,n=c.length;for(;t<n;){let r=t+n>>>1;d(c[r],e)<=0?t=r+1:n=r}c.splice(t,0,e);for(let e=t;e<c.length;e+=1)g.set(c[e],e)},m=e=>{let t=g.get(e);if(t!==void 0){c.splice(t,1),g.delete(e);for(let e=t;e<c.length;e+=1)g.set(c[e],e)}},b=e=>{let n=[...e].filter(e=>g.has(e)&&J($l(t[e].minY,1n),r)<=0&&J(r,$l(t[e].maxY,1n))<0),i=n.map(e=>g.get(e)).sort((e,t)=>e-t);n.sort(d);for(let e=0;e<i.length;e+=1){let t=i[e],r=n[e];c[t]=r,g.set(r,t)}},x=nu(r),S=o.get(x)??[],C=a.get(x)??[],w=s.get(x)??l;if(S.length===0&&C.length===0&&(w.size===0||i===void 0))continue;let T=S.length>0||C.length>0,E=new Set;if(!T)for(let e of w){let t=g.get(e);t!==void 0&&_(E,t)}let D=T?y():v(E);for(let e of S)m(e);for(let e of C)f(e);if(w.size>0&&i!==void 0&&b(w),c.length%2!=0)throw Error(`Compiled wrapPolygon produced an odd open-slab crossing count`);if(T)h(D,y(),r);else{let e=new Set;for(let t of w){let n=g.get(t);n!==void 0&&_(e,n)}h(D,v(e),r)}}return Object.freeze({spans:Object.freeze(f),exactSpans:Object.freeze(d),orderComparisonCount:p,pairMembershipVisitCount:m})}function ku(e){pu(e);let t=e.points,n=Object.freeze(t.map(e=>Object.freeze({...e}))),r=[...n.flatMap(e=>[e.xPt,e.yPt]),e.xLeftPt,e.xRightPt,e.yTopPt,e.yBottomPt].map(iu).filter(({coefficient:e})=>e!==0n),i=r.length===0?0:Math.min(...r.map(({exponent:e})=>e)),a=e=>{let t=iu(e);return t.coefficient===0n?0n:t.coefficient<<BigInt(t.exponent-i)},o=n.map(e=>Object.freeze({x:a(e.xPt),y:a(e.yPt)})),s=n.map((e,t)=>{let r=n[(t+1)%n.length],i=r.yPt-e.yPt,a=i===0?0:(r.xPt-e.xPt)/i;return Object.freeze({from:e,to:r,minYPt:Math.min(e.yPt,r.yPt),maxYPt:Math.max(e.yPt,r.yPt),slopeXPerY:a,interceptX:i===0?e.xPt:e.xPt-a*e.yPt})}),c=o.map((e,t)=>{let n=o[(t+1)%o.length],r=e.y<=n.y?e:n,i=e.y<=n.y?n:e,a=i.x-r.x,s=i.y-r.y;return Object.freeze({index:t,from:e,to:n,minY:r.y,maxY:i.y,dx:a,dy:s,c:a*r.y-s*r.x})}),l=[];for(let e=0;e<c.length;e+=1)for(let t=e+1;t<c.length;t+=1){let n=vu(c[e],c[t]);n&&l.push(Object.freeze({y:n.y,contact:n.contact,leftEdge:e,rightEdge:t}))}let u=1/0,d=-1/0,f=1/0,p=-1/0;for(let e of n)u=Math.min(u,e.xPt),d=Math.max(d,e.xPt),f=Math.min(f,e.yPt),p=Math.max(p,e.yPt);let m=new Map;for(let e of o){let t=$l(e.y,1n);m.set(nu(t),t)}for(let e of l)m.set(nu(e.y),e.y);let h=Object.freeze([...m.values()].sort(J)),g=Object.freeze([...new Set(h.map(e=>Su(e,i)))].sort((e,t)=>e-t)),_=Ou(s,c,h,i,l),v=$l(o.reduce((e,t)=>t.x<e?t.x:e,o[0].x),1n),y=$l(o.reduce((e,t)=>t.x>e?t.x:e,o[0].x),1n),b=$l(o.reduce((e,t)=>t.y<e?t.y:e,o[0].y),1n),x=$l(o.reduce((e,t)=>t.y>e?t.y:e,o[0].y),1n),S=$l(0n,1n),C=(e,t)=>{let n=eu(e,t);return J(n,S)>0?n:S},w=Object.freeze({scaleExponent:i,edges:Object.freeze(c),eventYs:h,spans:_.exactSpans,spanIndex:Eu(_.exactSpans),polygonLeft:v,polygonRight:y,polygonTop:b,polygonBottom:x,padLeft:C(v,$l(a(e.xLeftPt),1n)),padRight:C($l(a(e.xRightPt),1n),y),padTop:C(b,$l(a(e.yTopPt),1n)),padBottom:C($l(a(e.yBottomPt),1n),x)}),T=Object.freeze({kind:e.kind,edges:Object.freeze(s),eventYPts:g,contourSpans:_.spans,contourSpanIndex:xu(_.spans),intersectionCount:l.length,compileOrderComparisonCount:_.orderComparisonCount,compilePairMembershipVisitCount:_.pairMembershipVisitCount,polygonLeftPt:u,polygonRightPt:d,polygonTopPt:f,polygonBottomPt:p,padLeftPt:Math.max(0,u-e.xLeftPt),padRightPt:Math.max(0,e.xRightPt-d),padTopPt:Math.max(0,f-e.yTopPt),padBottomPt:Math.max(0,e.yBottomPt-p)});return mu.set(T,w),T}function Au(e,t){return{numerator:e.dx*t.numerator-e.c*t.denominator,denominator:e.dy*t.denominator}}function ju(e,t){return e.dx*t.dy===t.dx*e.dy&&e.c*t.dy===t.c*e.dy}function Mu(e){let t=e.filter(e=>J(e.r,e.l)>0).slice().sort((e,t)=>J(e.l,t.l)||J(e.r,t.r)),n=[];for(let e of t){let t=n.at(-1);!t||J(e.l,t.r)>0?n.push({...e}):J(e.r,t.r)>0&&(n[n.length-1]={l:t.l,r:e.r})}return n}function Nu(e,t){return{numerator:e.numerator*t.denominator+t.numerator*e.denominator,denominator:e.denominator*t.denominator}}function Pu(e,t){return{numerator:e.numerator*t.denominator-t.numerator*e.denominator,denominator:e.denominator*t.denominator}}function Fu(e,t,n){let r=mu.get(e);if(!r)throw Error(`Compiled polygon omitted its exact geometry authority`);let i=Pu(t,r.padBottom),a=Nu(n,r.padTop),o=J(r.polygonTop,i)>=0?r.polygonTop:i,s=J(r.polygonBottom,a)<=0?r.polygonBottom:a;if(J(s,o)<=0)return[];let c=[],l=[];Du(r.spanIndex,o,s,l);for(let e of l){let t=J(o,e.yTop)>=0?o:e.yTop,n=J(s,e.yBottom)<=0?s:e.yBottom;if(J(n,t)<=0)continue;let i=r.edges[e.leftEdge],a=r.edges[e.rightEdge];if(ju(i,a))continue;let l=Au(i,t),u=Au(i,n),d=Au(a,t),f=Au(a,n);c.push({l:Pu(J(l,u)<=0?l:u,r.padLeft),r:Nu(J(d,f)>=0?d:f,r.padRight)})}let u=Mu(c);return e.kind===`through`||u.length===0?u:[{l:u[0].l,r:u.at(-1).r}]}function Iu(e,t,n){let r=mu.get(e);if(!r)throw Error(`Compiled polygon omitted its exact geometry authority`);let i=wu(t,r.scaleExponent),a=Nu(i,wu(n,r.scaleExponent)),o=e=>r.scaleExponent>=0?{numerator:e.numerator<<BigInt(r.scaleExponent),denominator:e.denominator}:{numerator:e.numerator,denominator:e.denominator<<BigInt(-r.scaleExponent)};return Object.freeze(Fu(e,i,a).map(e=>Object.freeze({l:o(e.l),r:o(e.r)})))}function Lu(e,t){let n=mu.get(e);if(!n)throw Error(`Compiled polygon omitted its exact geometry authority`);let r=wu(t,n.scaleExponent),i=new Set;for(let e of n.eventYs)i.add(Cu(Nu(e,n.padBottom),n.scaleExponent)),i.add(Cu(Pu(Pu(e,r),n.padTop),n.scaleExponent));return Object.freeze([...i].filter(Number.isFinite).sort((e,t)=>e-t))}function Ru(e,t,n,r){let i=mu.get(e);if(!i)throw Error(`Compiled polygon omitted its exact geometry authority`);let a=tu(wu(n,i.scaleExponent),wu(r,i.scaleExponent)),o=wu(t,i.scaleExponent),s=Pu(a,i.padBottom),c=Nu(o,i.padTop),l=Nu(a,c),u=J(i.polygonTop,s)>=0?i.polygonTop:s,d=J(i.polygonBottom,l)<=0?i.polygonBottom:l,f=[],p=[];Du(i.spanIndex,u,d,p);for(let e of p){let t=J(u,e.yTop)>=0?u:e.yTop;if(J(J(d,e.yBottom)<=0?d:e.yBottom,t)<=0)continue;let n=i.edges[e.leftEdge],r=i.edges[e.rightEdge];if(ju(n,r))continue;let a=J(s,e.yTop)>0,o=J(l,e.yBottom)<0,p=(e,t,n,r)=>{let a=t?n:r,o={numerator:e.dx*a.numerator-e.c*a.denominator,denominator:e.dy*a.denominator};return{slope:t?{numerator:e.dx,denominator:e.dy}:{numerator:0n,denominator:1n},intercept:i.scaleExponent>=0?{numerator:o.numerator<<BigInt(i.scaleExponent),denominator:o.denominator}:{numerator:o.numerator,denominator:o.denominator<<BigInt(-i.scaleExponent)}}},m=p(n,a,{numerator:-i.padBottom.numerator,denominator:i.padBottom.denominator},e.yTop),h=p(n,o,c,e.yBottom),g=p(r,a,{numerator:-i.padBottom.numerator,denominator:i.padBottom.denominator},e.yTop),_=p(r,o,c,e.yBottom),v=n.dx>=0n?m:h,y=r.dx>=0n?_:g,b=Object.freeze({left:Object.freeze({slope:v.slope,intercept:Pu(v.intercept,i.scaleExponent>=0?{numerator:i.padLeft.numerator<<BigInt(i.scaleExponent),denominator:i.padLeft.denominator}:{numerator:i.padLeft.numerator,denominator:i.padLeft.denominator<<BigInt(-i.scaleExponent)})}),right:Object.freeze({slope:y.slope,intercept:Nu(y.intercept,i.scaleExponent>=0?{numerator:i.padRight.numerator<<BigInt(i.scaleExponent),denominator:i.padRight.denominator}:{numerator:i.padRight.numerator,denominator:i.padRight.denominator<<BigInt(-i.scaleExponent)})})});f.push(b)}return Object.freeze(f)}function zu(e,t,n){return e.left<t.right-n&&e.right>t.left+n&&e.top<t.bottom-n&&e.bottom>t.top+n}function Bu(e,t,n){let r=e.right-e.left,i=e.bottom-e.top;if(r<0||i<0)throw RangeError(`Overlap rectangle has negative extent`);let a=e.left,o=e.top;for(let e=0;e<=t.length;e+=1){let s={left:a,right:a+r,top:o,bottom:o+i},c=t.map(e=>({left:e.left,right:e.right,top:e.top,bottom:e.bottom})).filter(e=>zu(s,e,n.overlapEpsilon));if(c.length===0)return Object.freeze({left:a,top:o});if(e===t.length)throw Error(`Axis-aligned overlap resolution did not converge`);let l=Math.max(...c.map(e=>e.right));if(l+r<=n.rightBoundary+n.rightBoundarySlack){a=l;continue}o=Math.max(...c.map(e=>e.bottom))}throw Error(`Axis-aligned overlap resolution did not converge`)}function Vu(e,t){if(e.trim()===``)throw Error(`CompatibilityRule.${t} must not be empty`)}function Y(e){if(Vu(e.id,`id`),Vu(e.description,`description`),!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e.id))throw Error(`CompatibilityRule.id must be a stable kebab-case identifier`);if(e.evidence.kind===`microsoft-note`){if(Vu(e.evidence.reference,`evidence.reference`),!/^\\[MS-[A-Z0-9]+\\] §§?\\d/.test(e.evidence.reference))throw Error(`CompatibilityRule.evidence.reference must identify a Microsoft specification section`)}else if(e.evidence.kind===`regression-test`){if(Vu(e.evidence.reference,`evidence.reference`),!/^packages\\/docx\\/src\\/.+\\.(?:test|spec)\\.tsx?#[^#]+$/.test(e.evidence.reference))throw Error(`CompatibilityRule.evidence.reference must use DOCX path#test-title`)}else if(Vu(e.evidence.syntheticFixtureId,`evidence.syntheticFixtureId`),Vu(e.evidence.application,`evidence.application`),Vu(e.evidence.version,`evidence.version`),Vu(e.evidence.platform,`evidence.platform`),!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e.evidence.syntheticFixtureId))throw Error(`CompatibilityRule.evidence.syntheticFixtureId must be kebab-case`);return Object.freeze(e.evidence),Object.freeze(e)}Y({id:`word-section-btlr-tbrl-page-frame`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/coordinate-space.test.ts#maps Transitional text direction %s to %s`},description:`Issue #988 comment 4950296007 records that, unlike the normative ECMA-376 Part 4 §14.11.7 equivalence to lr, Word uses the tbRl page frame for section-level btLr; this rule covers only the page frame, while glyph orientation is paint-owned.`}),Y({id:`word-square-line-start-one-inch`,evidence:{kind:`regression-test`,reference:`packages/docx/src/float-line-start-one-inch.test.ts#(e) the boundary is identical across scales (absolute pt width)`},description:`Issue #676 records that Word starts a content line beside a square-wrapped object only when the free side gap is at least one inch; tight and through polygon openings and empty paragraph marks are outside this rule.`});const Hu=Y({id:`word-float-different-paragraph-displacement`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/floats.test.ts#keeps observed different-paragraph displacement on exclusion bounds`},description:`Preserve the established Word-compatible policy that an overlap-permitted float is displaced by exclusion geometry from floats anchored in other paragraphs, while same-paragraph floats may overlap.`}),Uu=Y({id:`word-page-anchored-table-collision-deferral`,evidence:{kind:`regression-test`,reference:`packages/docx/src/float-table-page-fit.test.ts#(g) DEFERS a page-anchored floating table when its raw band intersects an existing table float`},description:`Preserve the established Word-compatible pagination behavior that defers an absolute page- or margin-anchored floating table when its authored object band intersects an existing floating-table text-exclusion band on the page.`});Y({id:`word-empty-mark-float-side-gap`,evidence:{kind:`regression-test`,reference:`packages/docx/src/float-line-start-one-inch.test.ts#keeps an anchor-host metric-only line on the paragraph-mark threshold`},description:`An empty or anchor-only paragraph-mark line may start beside a square-wrapped object when the available side gap can hold the paragraph mark em; the one-inch content-line threshold does not apply.`});function Wu(e){return 71.95*e}function Gu(e,t){return e*t}const Ku=.01,qu=.5;function Ju(e,t){return Object.freeze(e===`overlap`?{kind:`word-different-paragraph`,paragraphId:t}:{kind:`none`})}function Yu(e,t){return Object.freeze(e?{kind:`word-different-paragraph`,paragraphId:t}:{kind:`drawingml-normative`})}function Xu(e){let t={occurrenceId:e.occurrenceId,paragraphId:e.paragraphId,bounds:e.bounds,exclusionBounds:e.exclusionBounds};return e.kind===`table`?{...t,kind:`table`,tableOverlap:e.overlap}:{...t,kind:e.kind===`shape`?`drawingml`:`frame`}}function Zu(e,t){let n=e.imageX,r=e.imageY,i=e.imageW,a=e.imageH,o=e.xLeft,s=e.xRight,c=e.yTop,l=e.yBottom,u={occurrenceId:e.anchorOccurrenceId??e.acquisitionOccurrenceId??`display-float:${t}`,paragraphId:e.paraId,bounds:{xPt:n,yPt:r,widthPt:i,heightPt:a},exclusionBounds:{xPt:o,yPt:c,widthPt:s-o,heightPt:l-c}};return e.kind===`table`?{...u,kind:`table`,tableOverlap:e.tableOverlap}:{...u,kind:e.kind===`shape`?`drawingml`:`frame`}}function Qu(e){let t=e.xPt,n=e.yPt,r=e.widthPt,i=e.heightPt;return{left:t,right:t+r,top:n,bottom:n+i}}function $u(e,t,n){return t===0&&n===0?e:Object.freeze({xPt:e.xPt+t,yPt:e.yPt+n,widthPt:e.widthPt,heightPt:e.heightPt})}function ed(e,t,n,r){return Object.freeze({bounds:$u(e.bounds,t,n),exclusionBounds:$u(e.exclusionBounds,t,n),displacement:Object.freeze({xPt:t,yPt:n}),appliedCompatibilityRuleIds:Object.freeze([...r])})}function td(e,t){let n=e.bounds.xPt-e.exclusionBounds.xPt,r=e.bounds.yPt-e.exclusionBounds.yPt,i=e.exclusionBounds.xPt+e.exclusionBounds.widthPt-e.bounds.xPt-e.bounds.widthPt,a=e.exclusionBounds.yPt+e.exclusionBounds.heightPt-e.bounds.yPt-e.bounds.heightPt,o=Qu(t.exclusionBounds);return{left:o.left-i,right:o.right+n,top:o.top-a,bottom:o.bottom+r}}function nd(e,t,n=e.rightBoundaryPt){let r=Qu(e.moving.bounds);return t.length===0?Object.freeze({left:r.left,top:r.top}):Bu(r,t,{overlapEpsilon:e.overlapEpsilonPt??0,rightBoundary:n,rightBoundarySlack:e.rightBoundarySlackPt??0})}function rd(e){let{moving:t,avoidance:n}=e,r=e.blockers.flatMap(e=>t.kind===`table`&&e.kind===`table`&&(t.tableOverlap===`never`||e.tableOverlap===`never`)||n.kind===`drawingml-normative`&&e.kind===`drawingml`?[Qu(e.bounds)]:[]),i=n.kind===`word-different-paragraph`?e.blockers.flatMap(e=>e.paragraphId===n.paragraphId?[]:[td(t,e)]):[],a=t.exclusionBounds.xPt+t.exclusionBounds.widthPt-t.bounds.xPt-t.bounds.widthPt,o=n.kind===`word-different-paragraph`?e.rightBoundaryPt-a:e.rightBoundaryPt,s=nd(e,r,o),c=i.length===0?s:nd(e,[...r,...i],o);return ed(t,c.left-t.bounds.xPt,c.top-t.bounds.yPt,c.left!==s.left||c.top!==s.top?[Hu.id]:[])}function id(e){if(e.inlineEndPt<e.inlineStartPt||e.blockExtentPt<0)throw RangeError(`Block-flow admission received a negative extent`);let t=e.blockers.filter(t=>{let n=t.exclusionBounds;return t.kind===`table`&&e.inlineEndPt-n.xPt>e.overlapEpsilonPt&&n.xPt+n.widthPt-e.inlineStartPt>e.overlapEpsilonPt}),n=e.blockStartPt;for(let r=0;r<=t.length;r+=1){let i=t.filter(t=>{let r=t.exclusionBounds;return n+e.blockExtentPt-r.yPt>e.overlapEpsilonPt&&r.yPt+r.heightPt-n>e.overlapEpsilonPt});if(i.length===0)return Object.freeze({blockStartPt:n});if(r===t.length)throw Error(`Block-flow float admission did not converge`);n=Math.max(...i.map(e=>e.exclusionBounds.yPt+e.exclusionBounds.heightPt))}throw Error(`Block-flow float admission did not converge`)}function ad(e){let t=Qu(e.bounds),n=e.blockers.some(n=>n.kind===`table`&&zu(t,Qu(n.exclusionBounds),e.overlapEpsilonPt));return Object.freeze({defer:n,appliedCompatibilityRuleIds:Object.freeze(n?[Uu.id]:[])})}function X(e){let t=iu(e);return t.exponent>=0?{numerator:t.coefficient<<BigInt(t.exponent),denominator:1n}:{numerator:t.coefficient,denominator:1n<<BigInt(-t.exponent)}}function od(e,t){return{numerator:e.numerator*t.denominator+t.numerator*e.denominator,denominator:e.denominator*t.denominator}}function sd(e,t){return{numerator:e.numerator*t.denominator-t.numerator*e.denominator,denominator:e.denominator*t.denominator}}function cd(e,t){return{numerator:e.numerator*t.numerator,denominator:e.denominator*t.denominator}}function ld(e,t){let n=t.numerator<0n;return{numerator:(n?-e.numerator:e.numerator)*t.denominator,denominator:e.denominator*(n?-t.numerator:t.numerator)}}function ud(e,t){let n=X(e),r=X(t);return lu({numerator:n.numerator*r.denominator+r.numerator*n.denominator,denominator:2n*n.denominator*r.denominator})}function dd(e){switch(e){case`left`:case`right`:case`largest`:case`bothSides`:return e;default:return`bothSides`}}function fd(e){return e===`square`||e===`topAndBottom`||e===`tight`||e===`through`}function pd(e,t,n){return e.xRight>t+.01&&e.xLeft<n-.01}const md=new WeakMap,hd=new WeakMap;function gd(e){return Object.isFrozen(e)&&e.every(e=>Object.isFrozen(e))}function _d(e,t,n,r,i,a){return e.kind===t&&Object.is(e.xLeftPt,n)&&Object.is(e.xRightPt,r)&&Object.is(e.yTopPt,i)&&Object.is(e.yBottomPt,a)}function vd(e,t,n){let r=e.authoredWrap;if(r!==`tight`&&r!==`through`)throw Error(`Polygon compilation requires tight or through wrap`);let i={kind:r,imageKey:e.imageKey,points:e.wrapPolygon,xLeftPt:e.xLeft,xRightPt:e.xRight,yTopPt:e.yTop,yBottomPt:e.yBottom};pu(i);let a=gd(t);if(a){let i=hd.get(t)?.find(t=>_d(t,r,e.xLeft,e.xRight,e.yTop,e.yBottom));if(i)return n&&(n.polygonCacheHitCount+=1),i.compiled}n&&(n.polygonCompileCount+=1);let o=ku(i);if(a){let n=Object.freeze({kind:r,xLeftPt:e.xLeft,xRightPt:e.xRight,yTopPt:e.yTop,yBottomPt:e.yBottom,compiled:o});hd.set(t,Object.freeze([n,...(hd.get(t)??[]).slice(0,3)]))}return o}function yd(e,t){let n=e.map(e=>{let n=e.wrapPolygon;t&&n&&(t.polygonSnapshotPointCount+=n.length);let r=Object.freeze({...e,...n?{wrapPolygon:Object.freeze(n.map(e=>Object.freeze({...e})))}:{}}),i=r.authoredWrap===`tight`||r.authoredWrap===`through`?vd(r,n??[],t):null;return Object.freeze({rect:r,polygon:i,wrapMaximumLeftPt:i?Math.min(r.xLeft,i.polygonLeftPt):r.xLeft,wrapMaximumRightPt:i?Math.max(r.xRight,i.polygonRightPt):r.xRight})}),r=Object.freeze({floats:Object.freeze(n)});return md.set(r,new Map),r}function bd(e,t){let n=dd(e.rect.side);if(n!==`largest`)return n;let r=J(sd(X(e.wrapMaximumLeftPt),X(t.xLeftPt)),sd(X(t.xRightPt),X(e.wrapMaximumRightPt)));return r===0?t.readingDirection===`ltr`?`left`:`right`:r>0?`left`:`right`}function xd(e,t,n,r,i,a){let{rect:o,polygon:s}=e,c=s?Iu(s,t,n):[{l:X(o.xLeft),r:X(o.xRight)}];if(c.length===0)return[];let l=s===null,u=c.reduce((e,t)=>J(t.l,e)<0?t.l:e,c[0].l),d=c.reduce((e,t)=>J(t.r,e)>0?t.r:e,c[0].r);switch(bd(e,a)){case`left`:return[{l:u,r:X(i),leftSquareBoundary:l,rightSquareBoundary:!1}];case`right`:return[{l:X(r),r:d,leftSquareBoundary:!1,rightSquareBoundary:l}];case`bothSides`:return c.map(e=>({...e,leftSquareBoundary:l,rightSquareBoundary:l}))}}function Sd(e,t){let n=md.get(t);if(!n)throw Error(`Prepared float geometry omitted its sweep cache`);let r=n.get(e);if(r)return r;let i=new Set,a=e=>{Number.isFinite(e)&&i.add(e)};for(let{rect:n,polygon:r}of t.floats)if(a(du(sd(X(n.yTop),X(e)))),a(n.yBottom),r)for(let t of Lu(r,e))a(t);let o=Object.freeze([...i].sort((e,t)=>e-t));return n.set(e,o),o}function Cd(e){let t=e.filter(e=>J(e.r,e.l)>0).slice().sort((e,t)=>J(e.l,t.l)||J(e.r,t.r)),n=[];for(let e of t){let t=n.at(-1);if(!t||J(e.l,t.r)>0){n.push({...e});continue}J(e.l,t.l)===0&&(t.leftSquareBoundary=t.leftSquareBoundary&&e.leftSquareBoundary);let r=J(e.r,t.r);r>0?(t.r=e.r,t.rightSquareBoundary=e.rightSquareBoundary):r===0&&(t.rightSquareBoundary=t.rightSquareBoundary&&e.rightSquareBoundary)}return n}function wd(e,t,n,r,i){let a=Cd(e),o=X(t),s=X(n),c=[],l=(e,t,n)=>{let r=J(o,e)>=0?o:e,i=J(s,t)<=0?s:t;J(i,r)>0&&c.push({l:r,r:i,squareConstrained:n})},u=o,d=!1;for(let e of a){if(J(e.r,o)<=0){d=e.rightSquareBoundary;continue}if(J(e.l,s)>=0){l(u,s,d),u=s;break}J(e.l,u)>0&&l(u,e.l,d||e.leftSquareBoundary);let t=J(e.r,u);if(t>0?(u=e.r,d=e.rightSquareBoundary):t===0&&(d&&=e.rightSquareBoundary),J(u,s)>=0)break}J(u,s)<0&&l(u,s,d);let f={numerator:0n,denominator:1n};for(let e of c){let t=sd(e.r,e.l);J(t,f)>0&&(f=t)}for(let e of c){let t=sd(e.r,e.l);if(J(t,f)===0&&J(t,X(Math.max(1,e.squareConstrained?i:r)))>=0)return{l:e.l,r:e.r,squareConstrained:e.squareConstrained}}return null}function Td(e,t,n,r,i,a,o,s,c,l,u){let d=X(e),f=od(d,X(t)),p=e=>X(e);if(a.floats.some(({rect:e})=>e.mode===`topAndBottom`&&pd(e,o,s)&&J(f,p(e.yTop))>0&&J(d,p(e.yBottom))<0))return null;let m=[];for(let i of a.floats){let{rect:a}=i;if(a.mode!==`square`||J(f,p(a.yTop))<=0||J(d,p(a.yBottom))>=0||!pd(a,n,r))continue;let o=xd(i,e,t,n,r,c);o.length!==0&&m.push(...o)}if(m.length===0)return{topY:e,xOffset:0,maxWidth:i};let h=wd(m,n,r,l,u);if(!h)return null;let g={numerator:0n,denominator:1n},_=sd(h.l,X(n)),v=J(_,g)>0?_:g,y=X(n),b=du(v),x=n+b,S=X(x);if(J(S,h.l)<0&&(b=du(sd(X(du(h.l)),y)),x=n+b,S=X(x)),J(S,h.l)<0)throw Error(`Exact float window could not represent a contained start`);let C=X(r),w=J(h.r,C)<=0?h.r:C,T=sd(X(fu(w)),S),E=fu(J(T,g)>0?T:g);if(J(X(x+E),w)>0)throw Error(`Exact float window could not represent a contained end`);return{topY:e,xOffset:b,maxWidth:E}}function Ed(e,t){return od(cd(e.exact.slope,X(t)),e.exact.intercept)}function Dd(e,t){return J(e.exact.slope,t.exact.slope)===0&&J(e.exact.intercept,t.exact.intercept)===0}function Od(e,t,n){return J(Ed(e,n),Ed(t,n))||J(e.exact.slope,t.exact.slope)}function kd(e,t,n){let r=sd(e.slope,t.slope);if(r.numerator===0n)return null;let i=sd(e.intercept,t.intercept);return ld(sd(X(n),i),r)}function Ad(e,t,n,r,i){t===null||J(t,X(n))<=0||J(t,X(r))>=0||(e.push(du(t)),i&&(i.localRootCandidateCount+=1))}function jd(e,t,n,r,i,a){let o=e[0];for(let r of e.slice(1)){let e=Od(r,o,n);(t===`min`&&e<0||t===`max`&&e>0)&&(o=r)}let s=o.square;for(let c of e)if(c!==o){if(Dd(c,o)){s&&=c.square;continue}(t===`min`?J(c.exact.slope,o.exact.slope)<0:J(c.exact.slope,o.exact.slope)>0)&&Ad(i,kd(c.exact,o.exact,0),n,r,a)}return{exact:o.exact,square:s}}function Md(e,t=!1){return{exact:{slope:{numerator:0n,denominator:1n},intercept:X(e)},square:t}}function Nd(e,t,n,r,i,a,o,s,c){let{rect:l,polygon:u}=e,d=X(ud(n,r));if(J(od(d,X(t)),X(l.yTop))<=0||J(d,X(l.yBottom))>=0)return[];let f=u?Ru(u,t,n,r).map(e=>({left:{exact:e.left,square:!1},right:{exact:e.right,square:!1}})):[{left:Md(l.xLeft,!0),right:Md(l.xRight,!0)}];if(f.length===0)return[];let p=jd(f.map(e=>e.left),`min`,n,r,s,c),m=jd(f.map(e=>e.right),`max`,n,r,s,c);switch(u?.kind===`tight`&&(f=[{left:p,right:m}]),bd(e,o)){case`left`:return[{left:p,right:Md(a)}];case`right`:return[{left:Md(i),right:m}];case`bothSides`:return f}}function Pd(e,t,n,r,i){let a=e.slice().sort((e,n)=>Od(e.left,n.left,t)||Od(e.right,n.right,t));for(let e=0;e+1<a.length;e+=1)Ad(r,kd(a[e].left.exact,a[e+1].left.exact,0),t,n,i);let o=[];for(let e of a){let a=o.at(-1);if(!a){o.push(e);continue}if(Ad(r,kd(e.left.exact,a.right.exact,0),t,n,i),Od(e.left,a.right,t)>0){o.push(e);continue}let s=jd([a.right,e.right],`max`,t,n,r,i),c=Dd(a.left,e.left)?{exact:a.left.exact,square:a.left.square&&e.left.square}:a.left;o[o.length-1]={left:c,right:s}}return o}function Fd(e,t,n,r,i,a,o,s,c,l,u,d){let f=X(ud(e,t)),p=od(f,X(n));if(a.floats.some(({rect:e})=>e.mode===`topAndBottom`&&pd(e,o,s)&&J(p,X(e.yTop))>0&&J(f,X(e.yBottom))<0))return null;let m=[],h=[];for(let o of a.floats){let{rect:a}=o;a.mode===`square`&&pd(a,r,i)&&h.push(...Nd(o,n,e,t,r,i,c,m,d))}if(h.length===0)return null;let g=Pd(h,e,t,m,d),_=Md(r),v=Md(i),y=[],b=(n,r,i)=>{let a={slope:sd(r.exact.slope,n.exact.slope),intercept:sd(r.exact.intercept,n.exact.intercept)};y.push({exactWidth:a});let o=Math.max(1,i?u:l);J(od(cd(a.slope,X(e)),a.intercept),X(o))<0&&a.slope.numerator>0n&&Ad(m,kd(r.exact,n.exact,o),e,t,d)},x=_;for(let e of g)b(x,e.left,x.square||e.left.square),x=e.right;b(x,v,x.square);let S=y[0];for(let t of y.slice(1))(J(od(cd(t.exactWidth.slope,X(e)),t.exactWidth.intercept),od(cd(S.exactWidth.slope,X(e)),S.exactWidth.intercept))||J(t.exactWidth.slope,S.exactWidth.slope))>0&&(S=t);if(S)for(let n of y)n===S||J(n.exactWidth.slope,S.exactWidth.slope)<=0||Ad(m,kd(n.exactWidth,S.exactWidth,0),e,t,d);return m.length===0?null:Math.min(...m)}function Id(e,t,n,r,i,a,o=r,s=r+i,c={xLeftPt:r,xRightPt:r+i,readingDirection:`ltr`},l=t,u=null){let d=r,f=r+i,p=Sd(n,a);if(u){u.structuralEventCount=p.length;for(let{polygon:e}of a.floats)e&&(u.compiledIntersectionCount+=e.intersectionCount,u.compiledContourSpanCount+=e.contourSpans.length,u.compileOrderComparisonCount+=e.compileOrderComparisonCount,u.compilePairMembershipVisitCount+=e.compilePairMembershipVisitCount)}let m=e=>(u&&(u.evaluatedYCount+=1),Td(e,n,d,f,i,a,o,s,c,t,l)),h=m(e);if(h)return h;let g=e,_=p.findIndex(e=>e>g);for(;_>=0&&_<p.length;){let e=p[_],r=Fd(g,e,n,d,f,a,o,s,c,t,l,u);if(r!==null){u&&(u.localRootEventCount+=1);let e=m(r);if(e)return e;g=r;continue}let i=m(e);if(i)return i;g=e;do _+=1;while(_<p.length&&p[_]<=g)}throw Error(`Finite float line-window event sweep found no usable terminal Y`)}function Ld(e,t,n,r,i,a,o=r,s=r+i,c={xLeftPt:r,xRightPt:r+i,readingDirection:`ltr`},l=t){return Id(e,t,n,r,i,a,o,s,c,l)}function Rd(e,t,n,r){let i=new Set;for(;;){let a=e;for(let i of t)i.mode===`topAndBottom`&&pd(i,n,r)&&e>=i.yTop&&e<i.yBottom&&(a=Math.max(a,i.yBottom));if(a===e)return e;if(!Number.isFinite(a)||a<e||i.has(a))throw Error(`Top-and-bottom solver violated strictly increasing finite-bottom progress`);i.add(a),e=a}}const zd=Object.freeze({UNSUPPORTED_TEXT_EFFECT:Object.freeze({severity:`warning`,layoutCode:`UNSUPPORTED_FEATURE`,message:`WordprocessingML text effects are not rendered`}),INVALID_TEXT_EFFECT_VALUE:Object.freeze({severity:`warning`,layoutCode:`INVALID_VALUE`,message:`An invalid WordprocessingML text-effect value was ignored`}),MISSING_DRAWING_EXTENT:Object.freeze({severity:`error`,layoutCode:`INVALID_GEOMETRY`,message:`A drawing with a missing required extent was omitted`}),INVALID_DRAWING_EXTENT:Object.freeze({severity:`error`,layoutCode:`INVALID_GEOMETRY`,message:`A drawing with an invalid extent was omitted`}),DEGENERATE_DRAWING_EXTENT:Object.freeze({severity:`warning`,layoutCode:`INVALID_GEOMETRY`,message:`A drawing has a schema-valid zero-area extent`})}),Bd=Object.freeze({code:`INVALID_VALUE`,severity:`warning`,message:`The parser diagnostic contract did not match this renderer build`});function Vd(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Hd(e,t){if(!Array.isArray(e)||!e.every(e=>Number.isSafeInteger(e)&&e>=0))return!1;let[n]=e;return n===void 0||n<t}function Ud(e){return Object.freeze({story:`body`,storyInstance:`body`,path:Object.freeze([...e])})}function Wd(e,t){if(e===void 0)return Object.freeze([]);if(!Array.isArray(e))return Object.freeze([Bd]);let n=[],r=!1;for(let i of e){if(!Vd(i)||typeof i.code!=`string`||!Object.hasOwn(zd,i.code)||i.part!==`word/document.xml`||!Hd(i.path,t)){r=!0;continue}let e=zd[i.code];if(i.severity!==e.severity){r=!0;continue}n.push(Object.freeze({code:e.layoutCode,severity:e.severity,source:Ud(i.path),message:e.message}))}return r&&n.push(Bd),Object.freeze(n)}var Z=class extends Error{code;constructor(e,t){super(`${e}: ${t}`),this.name=`LayoutInvariantError`,this.code=e}},Gd=class extends Z{reason;states;passes;constructor(e,t,n){super(`NON_CONVERGENCE`,e===`cycle`?`repeated exact-state cycle at ${t.at(-1)??`<missing>`}`:`hard exact-state pass limit ${n} reached`),this.name=`ExactConvergenceError`,this.reason=e,this.states=Object.freeze([...t]),this.passes=n}};function Kd(e){let{seedState:t,step:n,stateOf:r,limit:i}=e,a=t===void 0?2:1;if(!Number.isInteger(i)||i<a)throw RangeError(`Exact convergence limit must be an integer >= ${a}`);let o=t===void 0?[]:[t],s=new Set(o),c=null;for(let e=1;e<=i;e+=1){let t=n(c,e),a=r(t),l=o.at(-1);if(o.push(a),l===a)return Object.freeze({value:t,passes:e});if(s.has(a))throw new Gd(`cycle`,o,e);if(s.add(a),e===i)throw new Gd(`limit`,o,e);c=t}throw new Gd(`limit`,o,i)}function qd(e,t,n){if(!Number.isInteger(n)||n<1)throw new Z(`NON_CONVERGENCE`,`limit must be a positive integer`);try{return Kd({seedState:e.fingerprint,step:n=>t(n??e),stateOf:e=>e.fingerprint,limit:n}).value}catch(e){throw e instanceof Gd?new Z(`NON_CONVERGENCE`,e.reason===`cycle`?`repeated geometry fingerprint cycle at ${e.states.at(-1)??`<missing>`}`:`hard iteration limit ${n} reached`):e}}var Jd=class extends Z{reason;states;constructor(e,t){super(`NON_CONVERGENCE`,e===`cycle`?`line wrap measure/resolve cycle did not converge (${t.length} states)`:`line wrap measure/resolve pass limit did not converge (${t.length} states)`),this.name=`LineWrapNonConvergenceError`,this.reason=e,this.states=Object.freeze([...t])}};function Yd(e){return e.map(e=>({...e}))}function Xd(e,t){return JSON.stringify(e.map((e,n)=>({end:e.consumedEnd,topY:e.topY,xOffset:e.xOffset,availableWidth:e.availWidth,probeHeight:t[n],segments:e.segments.map(e=>({source:e.src,...e.text===void 0?{}:{text:e.text}}))})))}function Zd(e,t){try{return Kd({step:n=>{let r=e(n?.probeHeights??null),i=Object.freeze(r.map(t));return Object.freeze({lines:r,probeHeights:i,state:Xd(r,i)})},stateOf:e=>e.state,limit:16}).value.lines}catch(e){throw e instanceof Gd?new Jd(e.reason,e.states):e}}Y({id:`word-east-asian-grid-line-allocation`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/compatibility.test.ts#pins East Asian grid allocation and the untabled Far East metric factor`},description:`For an East Asian single-spaced line on a document grid, preserve the measured whole-cell allocation from the intended face design height and use the established 1.3-times-em fallback only when that design height is unavailable.`}),Y({id:`word-use-fe-layout-inherited-grid-minimum`,evidence:{kind:`office-observation`,syntheticFixtureId:`far-east-hinted-latin-grid-multiple`,application:`Microsoft Word`,version:`16.111.1`,platform:`macOS 26.5.2`},description:`With useFELayout enabled, a Latin line carrying an eastAsia-hinted run participates in Far East grid metrics; inherited automatic spacing keeps the larger of its whole-cell design allocation and one grid pitch multiplied by the inherited spacing value.`}),Y({id:`word-use-fe-layout-empty-mark-grid-allocation`,evidence:{kind:`regression-test`,reference:`packages/docx/src/paragraph-measure.test.ts#applies useFELayout grid-cell allocation to an empty paragraph mark`},description:`With useFELayout enabled, a content-less paragraph mark participates in Far East whole-cell document-grid allocation even when the document contains no literal East Asian text.`}),Y({id:`word-contiguous-underline-geometry`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/paragraph.test.ts#uses one safe baseline for a solid underline spanning adjacent source runs`},description:`Adjacent compatible underlined source runs share one safe baseline and continuous authored cadence while style, color, and thickness boundaries remain distinct.`}),Y({id:`word-grid-at-least-tall-line-unsnapped`,evidence:{kind:`regression-test`,reference:`packages/docx/src/line-box-height.test.ts#does not round tall East Asian content up to an additional grid cell`},description:`An explicitly authored atLeast line on an active document grid keeps the maximum of its natural height, authored minimum, and one pitch instead of rounding tall content to another whole cell.`}),Y({id:`word-degenerate-line-spacing-single`,evidence:{kind:`microsoft-note`,reference:`[MS-DOC] §2.9.146`},description:`Preserve a non-collapsing single-line fallback for exact or automatic line spacing at or below zero, consistent with the native LSPD representation.`}),Y({id:`word-auto-multiple-baseline-pin`,evidence:{kind:`regression-test`,reference:`packages/docx/src/line-spacing-baseline.test.ts#2.0× keeps the baseline at top + ascent (extra 1.0× leading below, NOT centred)`},description:`Paint an automatic line-spacing multiplier at or above one with its glyph baseline pinned inside the single design line and place multiplier leading below it; this is draw-only and does not replace the centered trailing-mark pagination metric.`}),Y({id:`word-mixed-anchor-visible-line-metrics`,evidence:{kind:`regression-test`,reference:`packages/docx/src/anchor-host-metrics.test.ts#reserves host line height without using its zero-ink box for a visible run baseline`},description:`A zero-ink drawing anchor host reserves its line and grid height while visible neighboring glyphs retain their own ascent, descent, and design-line baseline.`}),Y({id:`word-justification-leading-indent-exclusion`,evidence:{kind:`regression-test`,reference:`packages/docx/src/text-distribute.test.ts#forwards (segs, slack, firstContentSi, lastDrawnSi) positionally`},description:`Keep leading whitespace used as a first-line text indent fixed while distributing justified-line slack across content in a left-to-right line.`}),Y({id:`word-justified-candidate-separator-fit`,evidence:{kind:`regression-test`,reference:`packages/docx/src/justify-shrink-overshoot.test.ts#counts a candidate trailing space when the prospective line will justify`},description:`On a full paragraph-width line that will be fully justified, include the candidate word separator in its wrap-fit width; lines narrowed by DrawingML wrap exclusions retain collapsible line-end separator fit behavior.`}),Y({id:`word-overflow-punctuation-language-sets`,evidence:{kind:`microsoft-note`,reference:`[MS-OE376] §2.1.56`},description:`Apply the language-specific punctuation sets documented for Word in [MS-OE376] §2.1.56, and let overflowPunct override kinsoku when both rules affect the same character.`}),Y({id:`word-full-width-character-spacing-scope`,evidence:{kind:`microsoft-note`,reference:`[MS-OE376] §2.1.562`},description:`Interpret ST_CharacterSpacing as applying whitespace compression to full-width punctuation characters. This rule establishes only which characters are eligible; it does not define a universal compression amount.`}),Y({id:`word-japanese-punctuation-compression-cell`,evidence:{kind:`office-observation`,syntheticFixtureId:`japanese-fullwidth-punctuation-compression-cell`,application:`Microsoft Word`,version:`16.111.1`,platform:`macOS 26.5.2`},description:`In the observed Japanese compatibility fixture, compressed full-width punctuation retains at least half of the ideographic cell measured through the selected font route. Tight adjacent glyph ink can require a larger retained extent to prevent collision. This is an Office-observed compression amount, not a normative interpretation of ST_CharacterSpacing.`}),Y({id:`word-ms-mincho-empty-east-asian-mark-height`,evidence:{kind:`office-observation`,syntheticFixtureId:`ms-mincho-empty-east-asian-paragraph-mark`,application:`Microsoft Word`,version:`16.111.1`,platform:`macOS 26.5.2`},description:`In the observed compatibility fixture, an empty 12-point East-Asian paragraph mark routed to MS Mincho occupies a 15.6-point single-line box. Scope this 1.3-em floor to empty East-Asian paragraph marks; ordinary MS Mincho text lines and Latin marks retain their independently measured metrics.`});function Qd(e){let t=Math.max(0,e.punctuationAdvancePt);return Math.min(t,Math.max(0,e.punctuationInkEndPt,e.ideographicCellAdvancePt/2))}const $d={ja:new Set([...`,.’”、。」』】),.]}。、`]),zhHans:new Set([...`!%),.:;>?]}¢°·ˇ’”‰′″℃∶、。〃〉》」』】〗〕〞﹚﹜﹞!"%'),.:;?]}¢`]),zhHant:new Set([...`!),.:;?]}’”′、。〉》」』】〕〞﹚﹜﹞!),.:;?]}`]),ko:new Set([...`!%),.:;?]}¢°’”′″℃〉》」』】〕!%),.:;?]}¢`])},ef=new Set([...$d.ja,...$d.zhHans,...$d.zhHant,...$d.ko]);function tf(e,t){let n=t?.toLowerCase();return n?.startsWith(`ja`)?$d.ja.has(e):n?.startsWith(`ko`)?$d.ko.has(e):n?.startsWith(`zh`)?(/(?:^|-)(?:tw|hk|mo)(?:-|$)|hant/u.test(n)?$d.zhHant:$d.zhHans).has(e):ef.has(e)}function nf(e){return e.lineWillJustify&&e.wrapNarrowed!==!0?e.widthPx:e.widthPx-e.trailingSpacePx}function rf(e){return e.resolvedMeasurementRouteCount===1?e.biasBudgetPx:0}Y({id:`word-ruby-paragraph-uniform-line-advance`,evidence:{kind:`regression-test`,reference:`packages/docx/src/paragraph-measure.test.ts#uses one uniform snapped advance for every line in a ruby paragraph`},description:`Every line in a ruby-bearing paragraph uses the paragraph-wide maximum snapped line advance so its baseline rhythm remains uniform.`}),Y({id:`word-fit-text-inter-character-expansion`,evidence:{kind:`regression-test`,reference:`packages/docx/src/fit-text.test.ts#distributes (val − Σnatural)/(n−1) as the inter-character gap, no trailing gap`},description:`Expand a multi-character fitText region to its authored width by distributing the residual evenly across interior character gaps.`}),Y({id:`word-cjk-both-inter-character-expansion`,evidence:{kind:`regression-test`,reference:`packages/docx/src/text-distribute.test.ts#§17.18.44: fills a wrapped pure-CJK line via inter-CJK pitch (expansion default)`},description:`Treat inter-CJK boundaries as eligible inter-word gaps when expanding a non-final both-justified line that contains no spaces.`}),Y({id:`word-thai-distribute-cluster-policy`,evidence:{kind:`regression-test`,reference:`packages/docx/src/thai-distribute.test.ts#fills non-final lines to the right margin under thaiDistribute`},description:`Expand non-final thaiDistribute lines at Thai grapheme-cluster boundaries while retaining a natural-width final line.`}),Y({id:`word-numeric-decimal-tab-inference`,evidence:{kind:`regression-test`,reference:`packages/docx/src/decimal-tab-autoalign.test.ts#right-aligns numbers of different digit counts at the decimal tab`},description:`Right-align an otherwise tab-less numeric paragraph at its leading decimal tab while leaving non-numeric and no-decimal-tab paragraphs unchanged.`}),Y({id:`word-numbering-marker-overflow-tab-advance`,evidence:{kind:`regression-test`,reference:`packages/docx/src/numbered-marker-tab-advance.test.ts#advances the body past the marker to the next tab stop, not onto indentLeft`},description:`When a numbering marker overruns its hanging-indent budget, advance the body to the next reachable tab stop beyond the marker edge.`}),Y({id:`word-numbering-suffix-coincident-list-tab`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/numbering-marker.test.ts#keeps a suffix tab on the list stop coincident with the marker end`},description:`For the tab synthesized by a numbering suffix, accept an authored numeric list tab coincident with the shaped marker end instead of advancing to the next automatic tab stop.`});function af(e,t){return t.alignment===`num`&&Math.abs(t.pos-e)<=1e-6}Y({id:`word-tab-stop-page-edge-clamp`,evidence:{kind:`regression-test`,reference:`packages/docx/src/rtl-tab-stops.test.ts#pins a page number to the left text margin when the stop is past it`},description:`Clamp content assigned to a tab stop beyond the trailing text edge back onto that edge instead of placing ink outside the page content band.`}),Y({id:`word-dictionary-sea-natural-fit`,evidence:{kind:`regression-test`,reference:`packages/docx/src/sea-justified-fit.test.ts#Rule 1: wraps the paragraph-final Thai word on a thaiDistribute closing line (zero space-shrink)`},description:`Do not admit a dictionary Southeast-Asian word by compressing preceding inter-word spaces when its natural advance exceeds the remaining line width.`}),Y({id:`word-dictionary-sea-atomic-chunk`,evidence:{kind:`regression-test`,reference:`packages/docx/src/sea-justified-fit.test.ts#Rule 2: a no-space chunk that fits a full line moves whole instead of splitting`},description:`Move a glued dictionary Southeast-Asian chunk to a fresh line whole when it fits that full line, using dictionary breaks only when the chunk itself is overlong.`}),Y({id:`word-overlong-token-emergency-break`,evidence:{kind:`regression-test`,reference:`packages/docx/src/run-inline-formatting.test.ts#breaks a no-space token wider than the line at the character level`},description:`Emergency-break a non-CJK token that is wider than an empty line at grapheme-safe character boundaries so it remains inside the content band.`}),Y({id:`word-run-vertical-align-baseline-shift`,evidence:{kind:`regression-test`,reference:`packages/docx/src/run-char-metrics-render.test.ts#w:vertAlign raises superscript, lowers subscript, and leaves ordinary baselines unchanged`},description:`Retain the established run-level baseline displacement for vertically aligned text: superscript rises by 0.35 of its authored font size and subscript falls by 0.15, while the separately authored w:position remains additive.`});function of(e,t){return e===`super`?t*.35:e===`sub`?-t*.15:0}const sf=1.3;function cf(e,t,n){if(!n||!e)return 0;let r=e.trim().toLowerCase();return r===`ms mincho`||r===`ms 明朝`?t*sf:0}function lf(e,t){return t>0?Math.max(1,Math.ceil(e/t)):1}function uf(e,t){return e>0?e:t*sf}function df(e,t,n){return Math.max(e,t*n)}function ff(e,t,n){return Math.max(e,t,n)}function pf(e,t){return(e===`exact`||e===`auto`)&&t<=0}Y({id:`word-neutral-script-attachment`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/compatibility.test.ts#keeps neutral characters attached to the active script slice`},description:`Weak and neutral non-letter characters stay with the active complex-script slice instead of opening additional formatting segments.`}),Y({id:`word-rtl-run-ambiguous-class-override`,evidence:{kind:`regression-test`,reference:`packages/docx/src/bidi-line.test.ts#keeps LTR word order for English text in rtl-marked runs`},description:`Model an rtl-marked run as a higher-level UAX #9 override for punctuation and symbols only, leaving whitespace and strong letters at their ordinary classes.`}),Y({id:`word-rtl-complex-script-european-digits-an`,evidence:{kind:`regression-test`,reference:`packages/docx/src/bidi-line.test.ts#orders an AN-classified date as 2026-02-28`},description:`Classify European digits as Arabic Number within an Arabic or Hebrew complex-script run so UAX #9 preserves the compatible visual ordering of digit groups and separators.`}),Y({id:`word-kashida-final-form-priority`,evidence:{kind:`regression-test`,reference:`packages/docx/src/kashida-priority.test.ts#uses the BaRa join (Beh->Yeh) over the final-letter join in بين`},description:`Apply the measured kashida final-letter priority classes only at a word-final following letter instead of copying the broader Qt final-form conditions.`}),Y({id:`word-vertical-tu-corner-placement`,evidence:{kind:`regression-test`,reference:`packages/docx/src/vertical-text.test.ts#does NOT ink-centre a substituted Tu comma even when ink metrics are present`},description:`Keep a substituted vertical Tu comma or full stop at the font-designed upper-right cell position rather than ink-centering it geometrically.`});const mf=/[\\p{P}\\p{S}]/u;function hf(e){return mf.test(e)}function gf(e,t){return e===t}function _f(e){return e!==null}function vf(e,t,n,r,i,a={}){if(t!=null)return t*n;if(!r?.ruby||!i)throw Error(`Ruby at ${e}pt without hpsRaise requires retained base and guide ink`);if(r.textLayoutService&&r.textShapeRequest){let e=r.textLayoutService.shape({...r.textShapeRequest,text:r.text,fontSizePt:Ll(r,n),measure:!0,clusterGeometry:!1}),t=r.textLayoutService.shape({...r.textShapeRequest,text:r.ruby.text,fontSizePt:r.ruby.fontSizePt*n,measure:!0,clusterGeometry:!1});if(e.inkBounds&&t.inkBounds)return e.inkBounds.ascentPt+t.inkBounds.descentPt}let o=i.font;try{i.font=jf(r.bold,r.italic,Ll(r,n),r.fontFamily,a,r.fontRoute);let t=i.measureText(r.text);i.font=jf(r.bold,r.italic,e*n,r.fontFamily,a,r.fontRoute);let o=i.measureText(r.ruby.text);if(Number.isFinite(t.actualBoundingBoxAscent)&&Number.isFinite(o.actualBoundingBoxDescent))return t.actualBoundingBoxAscent+o.actualBoundingBoxDescent}finally{i.font=o}throw Error(`Ruby without hpsRaise requires retained base and guide ink`)}const yf=new Set([`sakkal majalla`,`traditional arabic`,`simplified arabic`,`arabic typesetting`,`univers next arabic`,`noto naskh arabic`,`noto sans arabic`]),bf=new Set([`sakkal majalla`,`traditional arabic`,`simplified arabic`,`arabic typesetting`,`noto naskh arabic`]);function xf(e){return yf.has(e.toLowerCase())}function Sf(e){return e.map(e=>`\"${e}\"`).join(`, `)}const Cf=[`Noto Naskh Arabic`,`Noto Sans Arabic`];function wf(e){let t=e&&e!==`jp`?B(e,`sans`):[`Noto Sans JP`,`Hiragino Sans`,`Meiryo`,...B(`jp`,`sans`).slice(1)];return e==null?`${Sf([...V,`Arial`,`Helvetica`,`Liberation Sans`,...t,...Cf])}, sans-serif`:`${Sf([...t,...Cf,...V])}, sans-serif`}function Tf(e){let t=e&&e!==`jp`?B(e,`serif`):[`Yu Mincho`,`YuMincho`,`Hiragino Mincho ProN`,`MS Mincho`,`Noto Serif JP`,...B(`jp`,`serif`).slice(1)];return e==null?`${Sf([...H,`Times New Roman`,`Cambria`,`Liberation Serif`,...t,...Cf])}, serif`:`${Sf([...t,...Cf,...H])}, serif`}const Ef=new WeakMap,Df=new WeakMap;function Of(e,t){let n=e??{};return t&&Object.keys(t).length>0&&Df.set(n,t),n}function kf(e,t={}){let n=Ef.get(t)??(()=>{let e=new Map;return Ef.set(t,e),e})(),r=e??`\\0null`,i=n.get(r);if(i!==void 0)return i;let a=Af(e,t,Df.get(t));return n.set(r,a),a}function Af(e,t,n={}){if(!e)return wf(null);let r=`\"${(e=>e.replace(/\"/g,`\\\\\"`))(e)}\"`,i=e.toLowerCase(),a=R(e);if(xf(e))return bf.has(i)?`${r}, \"Noto Naskh Arabic\", \"Noto Sans Arabic\", \"Noto Serif\", \"Noto Sans JP\", \"Hiragino Sans\", serif`:`${r}, \"Noto Sans Arabic\", \"Noto Naskh Arabic\", \"Noto Sans JP\", \"Hiragino Sans\", sans-serif`;let o=t[e];if(o&&o!==`auto`)switch(o){case`roman`:return`${r}, ${Tf(a)}`;case`swiss`:return`${r}, ${wf(a)}`;case`modern`:if(n[e]===`fixed`)return`${r}, \"Courier New\", monospace`;break;default:break}let s=z(e);if(s===`serif`)return`${r}, ${Tf(a)}`;if(s===`mono`)return`${r}, \"Courier New\", monospace`;if(a==null||a===`jp`){if(i.includes(`meiryo`)||e.includes(`メイリオ`))return`${r}, \"Meiryo UI\", \"Meiryo\", ${wf(a)}`;if(e.includes(`游ゴシック`)||/\\byu\\s*gothic\\b/i.test(e)||i.includes(`yugothic`))return`${r}, \"Yu Gothic\", \"YuGothic\", ${wf(a)}`;if(i.includes(`ipa`))return`${r}, \"IPAexGothic\", ${wf(a)}`;if(i.includes(`segoe`))return`${r}, \"Segoe UI\", ${Sf([...Cf,...V])}, sans-serif`}return`${r}, ${wf(a)}`}function jf(e,t,n,r,i={},a){return a?L(a,n,e?700:400,t?`italic`:`normal`):`${t?`italic`:`normal`} ${e?`bold`:`normal`} ${n}px ${kf(r,i)}`}function Mf(e,t,n=!1){return Math.max(jc(e.fontFamily,t,n),(e.resolvedLineHeightRatio??0)*t)}function Nf(e,t,n=!1){return Math.max(jc(e.eaFloorFamily,t,n),(e.resolvedEaFloorLineHeightRatio??0)*t)}function Pf(e){for(let t of e.runs)if(t.type===`text`||t.type===`field`)return t.fontSize;return typeof e.defaultFontSize==`number`?e.defaultFontSize:10}function Ff(e,t=!1){for(let t of e.runs)if(t.type===`text`||t.type===`field`)return t.fontFamily;return t&&e.defaultFontFamilyEastAsia?e.defaultFontFamilyEastAsia:e.defaultFontFamily??null}function If(e,t,n){return jc(Ff(e,n),Pf(e)*t,n)}function Lf(e){let t=0;for(let n of e)Rl.test(n)&&t++;return t}function Rf(e,t){if(t===0||e.length===0)return 0;let n=[...e];return Lf(e)===n.length?n.length*t:0}function zf(e,t){return e.snapToCharacterGrid===!1?0:t}function Bf(e,t){return e.fitTextPerGapPx===void 0?Vf(e)*t:e.fitTextPerGapPx}function Vf(e){return e.charSpacing??0}function Hf(e){return e.punctuationCompressions?.reduce((e,t)=>e+t.adjustmentPt,0)??0}function Uf(e,t,n){let r=e.punctuationCompressions?.filter(e=>e.end>t&&e.end<=n).map(e=>Object.freeze({end:e.end-t,adjustmentPt:e.adjustmentPt}));return r&&r.length>0?Object.freeze(r):void 0}function Wf(e,t){if(!e.textLayoutService||!e.textShapeRequest||t.length===0)return;let n=e.textLayoutService.shape({...e.textShapeRequest,text:t,measure:!0,clusterGeometry:!1});if(n.horizontalInkBoundsAreTight!==!0||!n.inkBounds||!Number.isFinite(n.advancePt)||!Number.isFinite(n.inkBounds.xMinPt)||!Number.isFinite(n.inkBounds.xMaxPt))return;let r=e.charScale??1;return{advancePt:n.advancePt*r,xMinPt:n.inkBounds.xMinPt*r,xMaxPt:n.inkBounds.xMaxPt*r}}function Gf(e){if(!e.textLayoutService||!e.textShapeRequest||e.text.length===0)return;let t=e.textLayoutService.shape({...e.textShapeRequest,text:e.text,measure:!0,clusterGeometry:!0});if(!t.clusters?.length)return;let n=e.charScale??1,r=new Map;for(let e of t.clusters){if(!Number.isFinite(e.advancePt))return;r.set(e.range.end,e.advancePt*n)}return r}function Kf(e){let t,n=new Map;for(let r of e){if(!(`text`in r)||r.verticalRun){t=void 0;continue}let e=r,i=e.punctuationCompressions??[],a=new Map(i.map((e,t)=>[e.end,t])),o=i.length>0?Gf(e):void 0,s=[0,...$o(e.text),e.text.length];for(let r=0;r<s.length-1;r+=1){let i=s[r],c=s[r+1];if(c<=i)continue;let l=a.get(c),u=t||l!==void 0?Wf(e,e.text.slice(i,c)):void 0;if(t&&u){let e=n.get(t.segment)??t.segment.punctuationCompressions.map(e=>({...e})),r=e[t.compressionIndex],i=Math.max(0,t.ink.advancePt+r.adjustmentPt),a=Math.min(0,i-t.contextualAdvancePt),o=Math.min(0,t.ink.xMaxPt-u.xMinPt-t.contextualAdvancePt),s=Math.max(r.adjustmentPt,a,o);s!==r.adjustmentPt&&(e[t.compressionIndex]={end:r.end,adjustmentPt:s},n.set(t.segment,e))}t=l!==void 0&&u?{segment:e,compressionIndex:l,ink:u,contextualAdvancePt:o?.get(c)??u.advancePt}:void 0}}for(let[e,t]of n)e.punctuationCompressions=Object.freeze(t.map(e=>Object.freeze(e)))}function qf(e){return e.charScale??1}function Jf(e,t,n,r,i){return e*r+Rf(t,n)+[...t].length*i}function Yf(e,t,n,r){if(e.fitTextPerGapPx!==void 0){let n=[...e.text].length,r=e.fitTextRegionEnd?Math.max(0,n-1):n;return t*qf(e)+r*e.fitTextPerGapPx+(e.fitTextTrailingPadPx??0)}if(e.tateChuYoko)return e.fontSize*r;let i=zf(e,n);return Jf(t,e.text,i,qf(e),Bf(e,r))+Hf(e)*r}function Xf(e){return!e||!e.linePitchPt||e.linePitchPt<=0?!1:e.type===`lines`||e.type===`linesAndChars`||e.type===`snapToChars`}function Zf(e,t){return lf(e,t)}function Qf(e,t){return uf(e,t)}function $f(e,t,n,r,i,a,o=0,s=!1,c,l){let u=t+n,d=Math.max(u,o),f=Xf(i),p=f?i.linePitchPt*r:0,m=()=>s?a?Math.max(p,Math.ceil(u/p)*p):Zf(c??(o>0?o:l===void 0?p:Qf(0,l)),p)*p:Math.max(u,p),h=e!==null&&e.explicit!==!0;if(!e||pf(e.rule,e.value))return f?m():d;if(e.rule===`auto`){if(f){if(h){let t=m();return s?df(t,p,e.value):t}return Math.max(u,p*e.value)}return d*e.value}if(e.rule===`exact`)return e.value*r;if(e.rule===`atLeast`){let t=f?a||h?m():p:0;return ff(d,e.value*r,t)}return d}function ep(e,t){return{asc:e*t*.8,desc:e*t*.2}}function tp(e,t,n,r,i=!1){return Mc(t,r,e.fontBoundingBoxAscent??e.actualBoundingBoxAscent??n*.8,e.fontBoundingBoxDescent??e.actualBoundingBoxDescent??n*.2,i)}function np(e,t,n,r,i=!1,a,o={},s=e.lineSpacing,c={},l,u){let d=u,f=i||d?.fontHint===`eastAsia`,p=d?.complexScript===!0,m=d?.fontSizePt??Pf(e),h=Ff(e,f),g=h?c[Nc(h)]:void 0,_=g?.family??h,v,y;if(l){let n=d?d.weight>=600:!1,r=d?.style===`italic`,i=d?.fonts.ascii??e.defaultFontFamily??h,a=l.shape({text:f?`あ`:`x`,fontSizePt:m*t,fonts:d?.fonts??{ascii:i,highAnsi:i,eastAsia:e.defaultFontFamilyEastAsia??i,complexScript:i},themeFonts:d?.themeFonts,themeFontPresence:d?.themeFontPresence,weight:n?700:400,style:r?`italic`:`normal`,complexScript:p,fontHint:d?.fontHint,eastAsiaLanguage:d?.eastAsiaLanguage,kerning:d?.kerning,measure:!0}),o=a.spans[0]?.font.resolvedFamily??h;({ascent:v,descent:y}=tp({width:a.advancePt,actualBoundingBoxAscent:a.ascentPt,actualBoundingBoxDescent:a.descentPt,fontBoundingBoxAscent:a.ascentPt,fontBoundingBoxDescent:a.descentPt},o,m*t,m*t,f))}else if(a){let e=a.font;a.font=jf(!1,!1,m*t,_,o);let n=a.measureText(f?`あ`:`x`);a.font=e,{ascent:v,descent:y}=tp(n,_,m*t,m*t,f)}else ({asc:v,desc:y}=ep(m,t));let b=g?.lineHeightRatio==null?If(e,t,f):m*t*g.lineHeightRatio,x=Math.max(b,cf(h,m*t,f)),S=i?Qf(x,m*t):void 0;return{advancePx:$f(s,v,y,t,n,r,x,i,S),ascentPx:v,descentPx:y}}function rp(e,t,n,r,i=!1,a,o={},s=e.lineSpacing,c={},l,u){return np(e,t,n,r,i,a,o,s,c,l,u).advancePx}function ip(e,t,n){return Math.max(0,(e-t+n)/2)}function ap(e,t,n,r,i,a,o,s={},c,l){let u=np(e,1,t,n,r,i,a,o,s,c,l);return ip(u.advancePx,u.ascentPx,u.descentPx)}function op(e){let t=[];for(let n of e){let e=n.toLowerCase()===n&&n.toUpperCase()!==n,r=/\\s/.test(n)?t[t.length-1]?.reduced??!1:e,i=t[t.length-1];i&&i.reduced===r?i.text+=n:t.push({text:n,reduced:r})}return t.length?t:[{text:e,reduced:!1}]}function sp(e,t){for(let n=t-1;n>=0;n--){let t=e[n];if(t.type===`text`||t.type===`field`)return t.fontSize}for(let n=t+1;n<e.length;n++){let t=e[n];if(t.type===`text`||t.type===`field`)return t.fontSize}return 10}function cp(e,t){if(e.fieldType===`page`)return tc(t.displayPageNumber??t.pageIndex+1,bc(e.instruction)??t.pageNumberFormat??`decimal`);if(e.fieldType===`numPages`){let n=bc(e.instruction)??`decimal`;return tc(t.totalPages,n)}if(e.fieldType===`date`||e.fieldType===`time`){let n=Ec(e.instruction);if(n){let e=Dc(n,new Date(t.currentDateMs??Date.now()));if(e!==null)return e}return e.fallbackText}return e.fallbackText}const lp=new Set([`+`,`-`,`−`,`=`,`±`,`×`,`÷`]);function up(e){return lp.has(e)?` ${e} `:e}function dp(e){return e.map(e=>{switch(e.kind){case`run`:return up(e.text);case`fraction`:return`${dp(e.num)}/${dp(e.den)}`;case`sup`:return`${dp(e.base)}^${dp(e.sup??[])}`;case`sub`:return`${dp(e.base)}_${dp(e.sub??[])}`;case`subSup`:return`${dp(e.base)}_${dp(e.sub??[])}^${dp(e.sup??[])}`;case`nary`:return`${e.op}${dp(e.sub??[])}${dp(e.sup??[])}${dp(e.body)}`;case`delimiter`:return`${e.begChar}${e.items.map(dp).join(`,`)}${e.endChar}`;case`radical`:return`${e.index&&e.index.length>0?dp(e.index):``}√${dp(e.radicand)}`;case`limit`:return`${dp(e.base)}${dp(e.lower??[])}${dp(e.upper??[])}`;case`array`:return e.rows.map(e=>e.map(dp).join(` `)).join(` `);case`groupChr`:return`${e.char}${dp(e.base)}`;case`bar`:case`box`:case`borderBox`:return dp(e.base);case`accent`:return`${e.char}${dp(e.base)}`;case`func`:return`${dp(e.name)}(${dp(e.arg)})`;case`group`:return dp(e.items);case`phant`:return e.show?dp(e.base):``;case`sPre`:return`${dp(e.sub)}${dp(e.sup)}${dp(e.base)}`}}).join(``).replace(/[ \\t]{2,}/g,` `)}function fp(e){for(let t=0;t<e.length;){let n=e.codePointAt(t);if(Eo(n))return!0;t+=n>65535?2:1}return!1}const pp=new Set([`、`,`。`,`,`,`.`,`」`,`』`,`】`,`〗`,`)`,`]`,`}`,`!`,`?`]);function mp(e){let t=e.codePointAt(0);return t===void 0?!1:t>=12353&&t<=12438||t>=12445&&t<=12447||t>=12449&&t<=12538||t===12540||t>=12541&&t<=12543||t>=12784&&t<=12799||t>=110576&&t<=110591||t>=110592&&t<=110959}function hp(e,t){switch(t){case`compressPunctuation`:return pp.has(e);case`compressPunctuationAndJapaneseKana`:return pp.has(e)||mp(e);default:return!1}}function gp(e,t){if(e===void 0)return;let n=[];for(let r of e)r>t&&n.push(r-t);return n}function _p(e,t){if(t<=0)return t;let n=t;for(;n<e.length&&e[n]===` `;)n++;return n}function vp(e,t,n,r=0,i=1,a=0,o=!1,s,c){let l=[...t],u=t=>c?.(t)??(()=>{let n=0;if(o){if(!s)throw Error(`Vertical glyph measurement capability is required for vertical text`);n=s.measureRunInkExtra(t)}return Jf(e.measureText(t).width+n,t,r,i,a)})(),d=e=>{let t=e;for(;t>0&&l[t-1]===` `;)t--;let r=l.slice(0,t).join(``);return r.length===0?!0:u(r)<=n},f=0,p=l.length;for(;f<p;){let e=f+p+1>>1;d(e)?f=e:p=e-1}return l.slice(0,f).join(``)}const yp=new Set([`ar`,`fa`,`ur`,`he`,`iw`,`yi`,`ji`,`ps`,`sd`,`ug`,`dv`,`syr`,`ckb`]);function bp(e,t){if(e){let t=e.split(`-`)[0].toLowerCase();if(yp.has(t))return!0}return t}function xp(e){let t=[],n=null,r=``;for(let i of e){let e=Eo(i.codePointAt(0));n===null||e===n?(n=e,r+=i):(t.push({text:r,ea:n}),n=e,r=i)}return r.length>0&&t.push({text:r,ea:n??!1}),t}function Sp(e){let t=e=>e>=48&&e<=57,n=e=>e===`.`||e===`,`||e===`:`||e===`/`||e===`\\xA0`,r=[],i=``,a=null;for(let o=0;o<e.length;o++){let s=e[o],c=t(s.charCodeAt(0));!c&&a===!0&&n(s)&&t(e.charCodeAt(o+1))&&(c=!0),a===null||c===a?i+=s:(r.push(i),i=s),a=c}return i.length>0&&r.push(i),r.length?r:[e]}function Cp(e){let t=[],n=0;for(;n<e.length;){let r=n;for(;r<e.length&&e[r]!==` `;)r++;for(;r<e.length&&e[r]===` `;)r++;r>n&&t.push(e.slice(n,r)),n=r}return t.length?t:[e]}function wp(e){let t=e?.defaultTabStop;return t!=null&&t>0?t:36}function Tp(e){return e===`center`?`center`:e===`right`||e===`end`||e===`decimal`?`trailing`:`leading`}function Ep(e,t,n,r,i){let a=e.length,o=e.map(e=>e.width),s=Array(a).fill(void 0),c=t=>{let n=0;for(let r=t;r<a&&!e[r].isTab;r++)n+=o[r];return n},l=n;for(let n=0;n<a;n++){if(!e[n].isTab){l+=o[n];continue}let a=Bl(l,t,i);if(!a){o[n]=0;continue}let u=c(n+1),d,f=Tp(a.alignment);d=f===`trailing`?a.pos-u:f===`center`?a.pos-u/2:a.pos,d+u>r&&(d=r-u),d<l&&(d=l),o[n]=d-l,s[n]=a.leader,l=d}return e.map((e,t)=>({width:o[t],leader:s[t]}))}function Dp(e,t,n){let r=new Map;for(let t of e){if(t.fitTextRegionIndex===void 0)continue;let e=r.get(t.fitTextRegionIndex)??[];e.push(t),r.set(t.fitTextRegionIndex,e)}for(let e of r.values()){let r=e.find(e=>e.fitTextVal!==void 0);if(!r||r.fitTextVal===void 0)continue;let i=0,a=0;for(let t of e)i+=n(t)*qf(t),a+=[...t.text].length;let o=Xl([{fitTextValTwips:r.fitTextVal,charCount:a,naturalWidthPx:i}],t)[0];o&&e.forEach((t,n)=>{t.fitTextPerGapPx=o.perGapPx,t.fitTextTrailingPadPx=n===e.length-1?o.trailingPadPx:void 0,t.fitTextRegionStart=n===0?!0:void 0,t.fitTextRegionEnd=n===e.length-1?!0:void 0})}}function Op(e,t){let n=[],r=(e,n=400,r=`normal`)=>{if(!e)return;let i=Nc(e),a=t.resolvedLocalFonts;if(!a)return;let o=a[`${i}:${n}:${r}`];if(o)return o;let s=a[i];return n===400&&r===`normal`&&s?s:Object.values(a).find(e=>Nc(e.requestedFamily??``)===i&&(e.weight??400)===n&&(e.style??`normal`)===r)},i=new Map,a=[];for(let[t,n]of e.entries()){if(n.type!==`text`){a.push({charCount:0,naturalWidthPx:0});continue}let e=n.text.split(` `);for(let r=0;r<e.length;r+=1)i.set(`${t}:${r}`,a.length),a.push({fitTextValTwips:n.fitTextVal,fitTextId:n.fitTextId,charCount:[...e[r]].length,naturalWidthPx:0,charScale:n.charScale}),r<e.length-1&&a.push({charCount:0,naturalWidthPx:0})}let o=new Map;Xl(a,1).forEach((e,t)=>{for(let n=e.start;n<e.end;n+=1)o.set(n,t)});let s=(e,a,s,c,l)=>{let u=a,d=!1,f=u.ruby,p=f?{text:f.text,fontSizePt:f.fontSizePt,...f.hpsRaisePt==null?{}:{hpsRaisePt:f.hpsRaisePt}}:void 0,m=u.revision,h=u.rtl===!0?!0:void 0,g=l===void 0?void 0:i.get(`${c}:${l}`),_=g===void 0?void 0:o.get(g),v=u.hyperlink?{kind:`external`,url:u.hyperlink}:u.hyperlinkAnchor?{kind:`internal`,ref:u.hyperlinkAnchor}:void 0,y=u.rtl===!0||u.cs===!0,b=u.fontSizeCs??a.fontSize,x=u.fontFamilyCs??a.fontFamily,S=u.fontFamilyHighAnsi??a.fontFamily,C=u.boldCs??!1,w=u.italicCs??!1,T=u.fontFamilyEastAsia??a.fontFamily,E=(y||u.rtl===!0)&&bp(u.langBidi,u.rtl===!0),D=!0,O=!1,k=(e,i,o,c,l=!1)=>{if(!l&&_===void 0){let n=[0,...$o(e),e.length];if(n.slice(0,-1).map((t,r)=>e.slice(t,n[r+1])).some(e=>hp(e,t.characterSpacingControl))){k(e,i,o,void 0,!0);return}}let f=i?C:a.bold,y=i?w:a.italic,A=f?700:400,j=y?`italic`:`normal`,M=Object.freeze({text:e,fontSizePt:i?b:a.fontSize,fonts:u.fontSlots?.direct??{ascii:a.fontFamily,highAnsi:S,eastAsia:T,complexScript:x},themeFonts:u.fontSlots?.theme,themeFontPresence:u.fontSlots?.themePresent,weight:A,style:j,complexScript:i,fontHint:u.fontHint,eastAsiaLanguage:u.langEastAsia,kerning:u.kerning==null?void 0:(i?b:a.fontSize)>=u.kerning,measure:!1}),N=c?{spans:[c]}:t.layoutServices?.text.shape(M),ee=l?(()=>{let n=[0,...$o(e),e.length],r=[];for(let i=0;i<n.length-1;i+=1){let a=n[i],o=n[i+1],s=e.slice(a,o);if(!hp(s,t.characterSpacingControl))continue;let c=t.layoutServices?.text.shape({...M,text:s,measure:!0,clusterGeometry:!1}),l=(c?.inkBounds&&c.horizontalInkBoundsAreTight===!0?(()=>{let e=Math.max(0,Math.min(c.advancePt,c.advancePt-c.inkBounds.xMaxPt));if(!pp.has(s))return e;let n=c.spans[0]?.fontRoute.fingerprint,r=t.layoutServices?.text.shape({...M,text:` `,fontHint:`eastAsia`,measure:!0,clusterGeometry:!1}),i=r?.spans[0]?.fontRoute.fingerprint,a=r?.advancePt;if(!n||i!==n||a===void 0||!Number.isFinite(a)||a<=0)return 0;let o=Qd({punctuationAdvancePt:c.advancePt,punctuationInkEndPt:c.inkBounds.xMaxPt,ideographicCellAdvancePt:a});return Math.max(0,Math.min(e,c.advancePt-o))})():0)*(u.charScale??1);l>0&&r.push({end:o,adjustmentPt:-l})}return r.length===0?void 0:Object.freeze(r.map(e=>Object.freeze(e)))})():void 0,te=N?.spans.some(e=>e.script===`complexScript`!==i)??!1;if(N&&(N.spans.length>1||te)){for(let e=0;e<N.spans.length;e+=1){let n=N.spans[e],r=n.script===`complexScript`,i=r?x:n.script===`eastAsia`?T:n.script===`highAnsi`?S:a.fontFamily,o=l&&[...n.text].some(e=>hp(e,t.characterSpacingControl));k(n.text,r,i,n,o)}return}let P=N?.spans[0],ne=(e,n)=>{if(!e)return;let r=Object.values(t.layoutServices?.text.localMetrics??{}).filter(t=>Nc(t.family)===Nc(e)&&(t.weight??400)===A&&(t.style??`normal`)===j);return r.find(e=>n&&Nc(e.requestedFamily??``)===Nc(n))??r[0]},F=P?ne(P.font.resolvedFamily,P.font.requestedFamily):r(o,A,j),I=t.layoutServices?.text.resolve({fonts:M.fonts,themeFonts:M.themeFonts,themeFontPresence:M.themeFontPresence,slot:`eastAsia`,weight:A,style:j}),L=I?ne(I.resolvedFamily,I.requestedFamily):r(T,A,j),R=F??(o?t.resolvedLocalFonts?.[Nc(o)]:void 0),z=L??(T?t.resolvedLocalFonts?.[Nc(T)]:void 0);n.push({text:e,...t.useFeLayout&&u.fontHint===`eastAsia`?{metricEastAsian:!0}:{},bold:f,italic:y,underline:a.underline,underlineStyle:u.underlineStyle,underlineColor:u.underlineColor,strikethrough:a.strikethrough,fontSize:i?b:a.fontSize,color:a.color,fontFamily:P?.font.resolvedFamily??F?.family??o,fontRoute:P?.fontRoute,resolvedLineHeightRatio:R?.lineHeightRatio,vertAlign:s,measuredWidth:0,textLayoutService:t.layoutServices?.text,textShapeRequest:M,breakBefore:P?.breakBefore??c?.breakBefore??!0,smallCaps:d,joinPrev:O||c?.breakBefore===!1?!0:void 0,doubleStrikethrough:a.doubleStrikethrough??!1,highlight:a.highlight??null,emphasisMark:a.emphasisMark,background:a.background??null,colorAuto:u.colorAuto??!1,border:u.border??null,ruby:D?p:void 0,revision:m,rtl:h,digitsAsAN:E?!0:void 0,eaFloorFamily:I?.resolvedFamily??L?.family??T,eaFloorRoute:I?.route,resolvedEaFloorLineHeightRatio:z?.lineHeightRatio,textBoxLineFloor:u.textBoxLineFloor,textBoxVertical:u.textBoxVertical,hyperlink:v,snapToCharacterGrid:u.snapToGrid!==!1,charSpacing:u.charSpacing,punctuationCompressions:ee,eastAsiaLanguage:u.langEastAsia,charScale:u.charScale,fitTextVal:_===void 0?void 0:u.fitTextVal,fitTextId:_===void 0?void 0:u.fitTextId,fitTextRegionIndex:_,fitTextRunIndex:_===void 0?void 0:g,position:u.position,kerning:u.kerning,tateChuYoko:t.verticalCJK&&u.eastAsianVert===!0?!0:void 0,tateChuYokoCompress:t.verticalCJK&&u.eastAsianVert===!0&&u.eastAsianVertCompress===!0?!0:void 0,verticalRun:t.verticalCJK&&u.eastAsianVert!==!0?!0:void 0}),D=!1,O=!1},A=(e,t)=>{let n=t===`cs`,r=t===`cs`?x:t===`ea`?T:a.fontFamily;if(de(r)){for(let t of W(e,r))k(t.text,n,t.mapped?null:r);return}k(e,n,r)},j=e=>{if(t.layoutServices?.text){k(e,!1,a.fontFamily);return}for(let t of xp(e))A(t.text,t.ea?`ea`:`latin`)},M=a.smallCaps?op(e):[{text:e,reduced:!1}],N=``;for(let e of M){d=e.reduced,O=N.length>0&&!/\\s$/.test(N),N=e.text;let t=a.allCaps||a.smallCaps?e.text.toUpperCase():e.text;for(let e of Cp(t))if(y)if(E)for(let t of Sp(e))A(t,`cs`);else A(e,`cs`);else j(e)}};for(let[i,a]of e.entries()){let o=n.length;if(a.type===`text`){let e=a,r=e.noteRef?e.noteRef.id?t.noteNumbers?.get(`${e.noteRef.kind}:${e.noteRef.id}`):t.noteReferenceNumber:void 0;if(e.noteRef){let t=r==null?e.text||``:String(r);t.length>0&&s(t,e,e.vertAlign??`super`,i,0);for(let e=o;e<n.length;e+=1)n[e].sourceRunIndex=i;continue}let c=e.text.split(` `);for(let t=0;t<c.length;t++)c[t].length>0&&s(c[t],e,e.vertAlign,i,t),t<c.length-1&&n.push({isTab:!0,fontSize:e.fontSize,measuredWidth:0,bold:e.bold,italic:e.italic})}else if(a.type===`image`){let e=a;n.push({imagePath:e.imagePath,mimeType:e.mimeType,widthPt:e.widthPt,heightPt:e.heightPt,rotation:e.rotation,flipH:e.flipH,flipV:e.flipV,anchor:e.anchor??!1,anchorXPt:e.anchorXPt??0,anchorYPt:e.anchorYPt??0,anchorXFromMargin:e.anchorXFromMargin??!1,anchorYFromPara:e.anchorYFromPara??!1,colorReplaceFrom:e.colorReplaceFrom,duotone:e.duotone,alpha:e.alpha,srcRect:e.srcRect??void 0,measuredWidth:0})}else if(a.type===`chart`){let e=a;n.push({imagePath:``,mimeType:``,widthPt:e.widthPt,heightPt:e.heightPt,anchor:e.anchor??!1,anchorXPt:e.anchorXPt??0,anchorYPt:e.anchorYPt??0,anchorXFromMargin:e.anchorXFromMargin??!1,anchorYFromPara:e.anchorYFromPara??!1,chart:e.chart,measuredWidth:0})}else if(a.type===`unavailableDrawing`){let e=`anchorAcquisitionInput`in a?a.anchorAcquisitionInput:void 0;n.push({imagePath:``,mimeType:``,widthPt:a.widthPt,heightPt:a.heightPt,anchor:e!==void 0,anchorXPt:0,anchorYPt:0,anchorXFromMargin:!1,anchorYFromPara:!1,unavailableResourceKind:a.resourceKind,measuredWidth:0})}else if(a.type===`break`){if(a.breakType===`line`){let t=sp(e,e.indexOf(a));n.push({lineBreak:!0,fontSize:t,measuredWidth:0})}}else if(a.type===`field`){let e=a,n=cp(e,t);n&&s(n,e,e.vertAlign,i)}else if(a.type===`math`){let r=a.fontSize||sp(e,e.indexOf(a)),i=a.resourceKey;if(t.layoutServices&&!i)throw Error(`Service-backed math layout requires a normalized structural resource key`);let o=i?t.layoutServices?.math.resolve(i):void 0;n.push({mathNodes:a.nodes,mathResourceKey:i??``,mathMetadata:o,display:a.display,fontSize:r,color:null,fallbackText:dp(a.nodes),measuredWidth:0,mathAscent:0,mathDescent:0,jc:a.jc})}else if(a.type===`ptab`)n.push({isTab:!0,fontSize:a.fontSize||sp(e,e.indexOf(a)),measuredWidth:0,leader:a.leader,ptab:{alignment:a.alignment,relativeTo:a.relativeTo}});else if(a.type===`anchorHost`){let e=a.fontFamilyEastAsia!=null,i=a.bold??!1,o=a.italic??!1,s=a.fontFamilyEastAsia??a.fontFamily??null,c=i?700:400,l=o?`italic`:`normal`,u=r(s,c,l),d=r(a.fontFamilyEastAsia??null,c,l),f=u??(s?t.resolvedLocalFonts?.[Nc(s)]:void 0),p=d??(a.fontFamilyEastAsia?t.resolvedLocalFonts?.[Nc(a.fontFamilyEastAsia)]:void 0);n.push({text:``,metricOnly:!0,...e?{metricEastAsian:!0}:{},bold:i,italic:o,underline:!1,strikethrough:!1,fontSize:a.fontSize,color:null,fontFamily:u?.family??s,resolvedLineHeightRatio:f?.lineHeightRatio,vertAlign:null,measuredWidth:0,eaFloorFamily:d?.family??a.fontFamilyEastAsia??null,resolvedEaFloorLineHeightRatio:p?.lineHeightRatio,snapToCharacterGrid:!1})}for(let e=o;e<n.length;e+=1)n[e].sourceRunIndex=i}for(let e=1;e<n.length;e++){let t=n[e];if(!(`text`in t)||t.joinPrev)continue;let r=t.text.codePointAt(0);if(r===void 0||!Co.lineStartForbidden.has(r))continue;let i=n[e-1];!(`text`in i)||/\\s$/.test(i.text)||(t.joinPrev=!0)}for(let e=1;e<n.length;e++){let t=n[e];if(!(`text`in t)||t.joinPrev||t.text.length===0)continue;let r=n[e-1];if(!(`text`in r)||r.text.length===0||/\\s$/u.test(r.text)||/^\\s/u.test(t.text))continue;let i=[...r.text].at(-1),a=[...t.text][0],o=i?.codePointAt(0),s=a?.codePointAt(0);o===void 0||s===void 0||o===8203||s===8203||zo(r.text)||zo(t.text)||fp(r.text)||fp(t.text)||Po(o,s)&&(t.joinPrev=!0)}let c=new Set;for(let e of n)!(`text`in e)||e.fitTextRegionIndex===void 0||(c.has(e.fitTextRegionIndex)?e.joinPrev=!0:(e.fitTextRegionStart=!0,c.add(e.fitTextRegionIndex)));return Kf(n),n}function kp(e,t,n,r,i,a=[],o,s={},c=0,l=Co,u=0,d=36,f=n,p=!1,m=!1,h=!1,g,_=`bounded`,v,y=!1,b){if(b===void 0){let b=(b,x)=>kp(e,Yd(t),n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,{probeHeights:b,preparedFloatWrap:x});if(!o||_===`intrinsic`)return b(null);let x=o.lineWindow?void 0:yd(o.floats);return Zd(e=>b(e,x),e=>o.lineBoxH(e.ascent,e.descent,e.hasRuby,e.intendedSingle,e.eastAsian,e.gridCountSingle))}let{probeHeights:x,preparedFloatWrap:S}=b,C=[],w=[],T=0,E=0,D=0,O=new Set,k=0,A=0,j=0,M=0,N=0,ee=0,te=0,P=0,ne=!1,F=!0,I=n,L=0,R=o?.startPageY??0,z=()=>Wu(i),B=t.length>0&&t.every(e=>`text`in e&&e.metricOnly===!0||`imagePath`in e&&!!e.anchor),V=(e=0)=>{if(D=0,O.clear(),L=0,I=n,!o)return;let t=x?.[C.length];if(t===void 0)return;let r={xLeftPt:o.referenceXPt??o.paraX,xRightPt:(o.referenceXPt??o.paraX)+(o.referenceWidthPt??n),readingDirection:o.readingDirection??(p?`rtl`:`ltr`)};if(o.lineWindow){let r=o.lineWindow({topYPt:R,minimumStartWidthPt:1,squareMinimumStartWidthPt:e,probeHeightPt:t,paragraphXPt:o.paraX,maximumWidthPt:n,columnXPt:o.columnXPt,columnWidthPt:o.columnWidthPt});R=r.topYPt,L=r.xOffsetPt,I=r.maximumWidthPt}else{let i=Ld(R,1,t,o.paraX,n,S??yd(o.floats),o.columnXPt,o.columnXPt+o.columnWidthPt,r,e);R=i.topY,L=i.xOffset,I=i.maxWidth}},H=()=>_===`intrinsic`?1/0:I-(F?r:0),U=p?a.map(e=>({pos:e.pos*i,alignment:e.alignment,leader:e.leader})):[],re=d*i,ie=()=>{if(!p||!w.some(e=>`isTab`in e))return;let e=Ep(w.map(e=>({isTab:`isTab`in e,width:e.measuredWidth})),U,f-(L+I)+(F?r:0),f+c,re),t=0;for(let n=0;n<w.length;n++){let r=w[n];`isTab`in r&&(t+=e[n].width-r.measuredWidth,r.measuredWidth=e[n].width,r.leader=e[n].leader)}T+=t},ae=!1,oe=!1,se=!1,ce=(e,t=!1,n)=>{ie();let r=e===void 0?k||10:Math.max(k,e),a=A>0||j>0,s=a?A:r*i*.8,c=a?j:r*i*.2,l=ne?ee:s,u=ne?te:c,d=ne?P:M,f=N||(oe?Qf(M,r*i):s+c);C.push({segments:w,height:r,ascent:s,descent:c,visibleAscent:l,visibleDescent:u,visibleIntendedSingle:d,intendedSingle:M,gridCountSingle:f,xOffset:L,availWidth:I,topY:o?R:void 0,hasRuby:ae,eastAsian:oe,endsWithBreak:t,consumedEnd:n??K[0]?.src??ye}),o&&(R+=o.lineBoxH(s,c,ae,M,oe,f)),w=[],T=0,E=0,D=0,O.clear(),k=0,A=0,j=0,M=0,N=0,ee=0,te=0,P=0,ne=!1,ae=!1,oe=!1,se=!1,F=!1,V(z())},le=(e,t=e.text)=>Vc(e.fontFamily)*Ll(e,i)*qf(e)*[...t].length,ue=e=>{let t=e.bold?700:400,n=e.italic?`italic`:`normal`;return e.fontRoute?`${e.fontRoute.fingerprint}|${t}|${n}`:`implicit|${jf(e.bold,e.italic,1,e.fontFamily,s)}`},de=(e,t,n=t.text)=>{/\\S/.test(n)&&e.add(ue(t))},W=e=>{let t=O.size;for(let n of e)O.has(n)||(t+=1);return t},G=(e,t,n,r,a,o=0)=>{w.push(e),T+=t,E+=o,`text`in e&&(D+=le(e),de(O,e)),n>k&&(k=n),r>A&&(A=r),a>j&&(j=a);let s=!(`text`in e)||e.metricOnly!==!0;s&&(ne=!0,r>ee&&(ee=r),a>te&&(te=a));let c=0;if(!(`isTab`in e)&&!(`imagePath`in e)&&!(`mathNodes`in e)){let t=e;t.ruby&&(ae=!0),t.seaBreaks!==void 0&&Vo(t.text)&&(se=!0);let n=t.metricEastAsian===!0||Rl.test(t.text);!oe&&n&&(oe=!0);let r=t.smallCaps&&!t.vertAlign?t.fontSize*i:fe(t),a=n&&!t.ruby,o=t.textBoxLineFloor&&t.ruby?0:Math.max(Mf(t,r,a),t.textBoxLineFloor?Nf(t,r,a):0);o>M&&(M=o),s&&o>P&&(P=o),a&&(c=Qf(o,r))}else `isTab`in e||(c=r+a);c>N&&(N=c)},fe=e=>Ll(e,i),pe=null,me=t=>{t!==pe&&(e.font=t,pe=t)},he=t=>{if(t.kerning==null)return null;let n=e.fontKerning;return e.fontKerning=t.fontSize>=t.kerning?`normal`:`none`,n},ge=t=>{t!=null&&(e.fontKerning=t)},_e=(t,n=!1)=>{if(t.textLayoutService&&t.textShapeRequest){let e=t.textLayoutService.shape({...t.textShapeRequest,text:t.text,fontSizePt:fe(t),measure:!0,clusterGeometry:n});return n&&(t.shapedClusters=e.clusters,t.selectedFaceInkBounds=e.inkBounds??{xMinPt:0,xMaxPt:e.advancePt,ascentPt:e.ascentPt,descentPt:e.descentPt}),{width:e.advancePt,actualBoundingBoxAscent:e.ascentPt,actualBoundingBoxDescent:e.descentPt,fontBoundingBoxAscent:e.ascentPt,fontBoundingBoxDescent:e.descentPt}}me(jf(t.bold,t.italic,fe(t),t.fontFamily,s,t.fontRoute));let r=he(t),i=e.measureText(t.text);return ge(r),i},ve=(e,t)=>{if(!e.verticalRun)return 0;if(!v)throw Error(`Vertical glyph measurement capability is required for vertical text`);me(jf(e.bold,e.italic,fe(e),e.fontFamily,s,e.fontRoute));let n=he(e);try{return v.measureRunInkExtra(t)}finally{ge(n)}},ye={segIndex:t.length,charOffset:0},be=t.map((e,t)=>(e.src={segIndex:t,charOffset:0},`text`in e&&zo(e.text)&&(e.seaBreaks=Jo(e.text,{cjk:!0,kinsoku:l})),e)),K;if(!g)K=be;else if(g.segIndex>=be.length)K=[];else{let e=be[g.segIndex];if(g.charOffset>0)if(!(`text`in e)||g.charOffset>e.text.length)K=[];else{let t=e.text.slice(g.charOffset);K=t?[{...e,text:t,measuredWidth:0,src:{...g},punctuationCompressions:Uf(e,g.charOffset,e.text.length),seaBreaks:gp(e.seaBreaks,g.charOffset)},...be.slice(g.segIndex+1)]:be.slice(g.segIndex+1)}else K=be.slice(g.segIndex)}Dp(K.filter(e=>`text`in e),i,e=>_e(e).width+ve(e,e.text));let xe=e=>Yf(e,_e(e).width+ve(e,e.text),u,i),Se=(t,n,r=!1)=>{let a=r?t.text.length-n.length:0,o={...t,text:n,punctuationCompressions:Uf(t,Math.max(0,a),Math.max(0,a)+n.length)};if(t.textLayoutService&&t.textShapeRequest)return Yf(o,t.textLayoutService.shape({...t.textShapeRequest,text:n,fontSizePt:fe(t),measure:!0,clusterGeometry:!1}).advancePt+ve(t,n),u,i);me(jf(t.bold,t.italic,fe(t),t.fontFamily,s,t.fontRoute));let c=he(t),l=e.measureText(n).width;return ge(c),Yf(o,l+ve(t,n),u,i)},Ce=e=>`isTab`in e?e.measuredWidth||0:`imagePath`in e?e.widthPt*i:`mathNodes`in e?e.measuredWidth||0:`lineBreak`in e?0:xe(e),we=null;for(V(B?o?.paragraphMarkLineStartWidth??z():z());K.length>0;){let t=K.shift();if(`lineBreak`in t){ce(t.fontSize,!0),we=t.fontSize;continue}if(we=null,`isTab`in t){if(p&&!t.ptab){t.measuredWidth=0,G(t,0,t.fontSize,t.fontSize*i*.8,t.fontSize*i*.2);continue}let e=T+(F?r:0);if(t.ptab){t.resolvedAlignment=t.ptab.alignment;let r=t.ptab.relativeTo===`indent`?0:-c,a=t.ptab.relativeTo===`indent`?n:f,o=t.ptab.alignment===`left`?r:t.ptab.alignment===`center`?(r+a)/2:a,s=0;for(let e of K){if(`isTab`in e||`lineBreak`in e)break;s+=Ce(e)}let l=t.ptab.alignment===`center`?.5:+(t.ptab.alignment===`right`),d=o-e-s*l;if(d<=0){if(w.length>0){ce(void 0,!1,t.src),K.unshift(t);continue}d=0}if(t.measuredWidth=d,G(t,d,t.fontSize,t.fontSize*i*.8,t.fontSize*i*.2),t.ptab.alignment!==`left`)for(;K.length>0;){let e=K[0];if(`isTab`in e||`lineBreak`in e)break;if(K.shift(),`imagePath`in e){let t=e.widthPt*i;e.measuredWidth=t,G(e,t,e.heightPt,e.heightPt*i,0)}else if(`mathNodes`in e)G(e,e.measuredWidth||0,e.fontSize,e.mathAscent||0,e.mathDescent||0);else{let t=_e(e),n=Yf(e,t.width+ve(e,e.text),u,i);e.measuredWidth=n;let r=t.fontBoundingBoxAscent??t.actualBoundingBoxAscent??e.fontSize*i*.8,a=t.fontBoundingBoxDescent??t.actualBoundingBoxDescent??e.fontSize*i*.2;G(e,n,e.fontSize,r,a)}}continue}let o=zl(e+c,a.map(e=>({pos:e.pos*i,alignment:e.alignment,leader:e.leader})),d*i);t.resolvedAlignment=o?.alignment??`left`;let s=o?o.pos-c:e,l=o?Tp(o.alignment):`leading`;if(o&&l!==`leading`){let n=s;t.leader=o.leader;let r=0;for(let e of K){if(`isTab`in e||`lineBreak`in e)break;r+=Ce(e)}let a=l===`center`?.5:1,c=n-e-r*a;for(c<=0&&(c=t.fontSize*i*.25),t.measuredWidth=c,G(t,c,t.fontSize,t.fontSize*i*.8,t.fontSize*i*.2);K.length>0;){let e=K[0];if(`isTab`in e||`lineBreak`in e)break;if(K.shift(),`imagePath`in e){let t=e.widthPt*i;e.measuredWidth=t,G(e,t,e.heightPt,e.heightPt*i,0)}else if(`mathNodes`in e)G(e,e.measuredWidth||0,e.fontSize,e.mathAscent||0,e.mathDescent||0);else{let t=_e(e),n=Yf(e,t.width+ve(e,e.text),u,i);e.measuredWidth=n;let r=t.fontBoundingBoxAscent??t.actualBoundingBoxAscent??e.fontSize*i*.8,a=t.fontBoundingBoxDescent??t.actualBoundingBoxDescent??e.fontSize*i*.2;G(e,n,e.fontSize,r,a)}}continue}let m=s-e;if(o&&(t.leader=o.leader),m<=0){ce(void 0,!1,t.src),K.unshift(t);continue}if(T+m>H()&&w.length>0){ce(void 0,!1,t.src),K.unshift(t);continue}t.measuredWidth=m,G(t,m,t.fontSize,t.fontSize*i*.8,t.fontSize*i*.2);continue}if(`imagePath`in t){if(t.anchor){t.measuredWidth=0;continue}let e=t.widthPt*i,n=t.heightPt,r=t.heightPt*i;t.measuredWidth=e,w.length>0&&T+e>H()&&ce(void 0,!1,t.src),G(t,e,n,r,0);continue}if(`mathNodes`in t){let n=t.mathMetadata;if(!n||n.available===!1){let n=t.fontSize*i;me(jf(!1,!1,n,null,s));let r=e.measureText(t.fallbackText),a=r.width,o=r.fontBoundingBoxAscent??r.actualBoundingBoxAscent??n*.8,c=r.fontBoundingBoxDescent??r.actualBoundingBoxDescent??n*.2;t.measuredWidth=a,t.mathAscent=o,t.mathDescent=c,w.length>0&&T+a>H()&&ce(void 0,!1,t.src),G(t,a,t.fontSize,Math.max(o,n*.8),Math.max(c,n*.2));continue}let r=t.fontSize*i,a=n.widthEm*r,o=n.ascentEm*r,c=n.descentEm*r;t.measuredWidth=a,t.mathAscent=o,t.mathDescent=c;let l=Math.max(o,r*.8),u=Math.max(c,r*.2);w.length>0&&T+a>H()&&ce(void 0,!1,t.src),G(t,a,t.fontSize,l,u);continue}let o=t,g=_e(o),_=Yf(o,g.width+ve(o,o.text),u,i),b=o.fontSize,x=o.fontSize*i,S=g,C=fe(o);if(o.smallCaps&&!o.vertAlign&&C!==x){if(o.textLayoutService&&o.textShapeRequest){let e=o.textLayoutService.shape({...o.textShapeRequest,text:o.text||`X`,fontSizePt:x,measure:!0,clusterGeometry:!1});S={width:e.advancePt,actualBoundingBoxAscent:e.ascentPt,actualBoundingBoxDescent:e.descentPt,fontBoundingBoxAscent:e.ascentPt,fontBoundingBoxDescent:e.descentPt}}else{let t=e.font;e.font=jf(o.bold,o.italic,x,o.fontFamily,s,o.fontRoute),S=e.measureText(o.text||`X`),e.font=t}C=x}let O=tp(S,o.fontFamily,x,C,(o.metricEastAsian===!0||Rl.test(o.text))&&!o.ruby),k=O.ascent,A=O.descent;if(o.ruby&&(!o.textBoxLineFloor||o.textBoxVertical)&&(k+=vf(o.ruby.fontSizePt,o.ruby.hpsRaisePt,i,o,e,s)),o.fitTextRegionIndex!==void 0){if(o.fitTextRegionStart){let e=_;for(let t of K){if(!(`text`in t)||t.fitTextRegionIndex!==o.fitTextRegionIndex)break;e+=xe(t)}w.length>0&&T+e>H()&&ce(void 0,!1,o.src)}o.measuredWidth=_,G(o,_,b,k,A);continue}let j=o.text.replace(/ +$/,``),M=o.text.endsWith(` `)?_-Se(o,j):0,N=e=>{let t=e===void 0||`lineBreak`in e;return m&&(!t||h)},ee=(e,t,r)=>nf({widthPx:e,trailingSpacePx:t,lineWillJustify:N(r),wrapNarrowed:I!==n||L!==0}),te=ee(_,M,K[0]),P=o.seaBreaks!==void 0&&Vo(o.text),ne=new Set;de(ne,o,j);let R=(e,t,n)=>N(e)?rf({biasBudgetPx:t,resolvedMeasurementRouteCount:W(n)}):se||P?0:E*.25;if(!o.joinPrev&&w.length>0&&K[0]?.joinPrev&&!fp(o.text)&&!(o.seaBreaks&&o.seaBreaks.length>0)){let e=_,t=M,n=0,r=D,i=new Set(ne),a=o,s=o.text,c=(e,t=e.text)=>{r+=le(a,s),a=e,s=t};for(;n<K.length&&K[n].joinPrev;n++){let r=K[n];if(fp(r.text)){let n=[...r.text],a=0;for(;a<n.length&&Co.lineStartForbidden.has(n[a].codePointAt(0));)a++;if(a<n.length){let o=n.slice(0,a).join(``),s=Se(r,o);e+=s,o.length>0&&(c(r,o),de(i,r,o)),t=0;break}}let a=xe(r);e+=a,c(r),de(i,r);let o=r.text.replace(/ +$/,``);t=r.text.endsWith(` `)?a-Se(r,o):0}r+=le(a,s.replace(/ +$/,``)),T+ee(e,t,K[n])>H()+R(K[n],r,i)&&ce(void 0,!1,o.src)}if(P&&w.length>0&&(()=>{let e=w[w.length-1];return!(`text`in e)||e.text.endsWith(` `)})()){let e=_,t=M,n=0,r=D+le(o,j),i=new Set(ne);if(!o.text.endsWith(` `))for(;n<K.length;n++){let a=K[n];if(!(`text`in a)||a.seaBreaks===void 0||!Vo(a.text))break;let o=a,s=xe(o),c=o.text.replace(/ +$/,``);if(e+=s,t=o.text.endsWith(` `)?s-Se(o,c):0,r+=le(o,c),de(i,o,c),o.text.endsWith(` `)){n++;break}}let a=ee(e,t,K[n]);T+a>H()+R(K[n],r,i)&&a<=I&&ce(void 0,!1,o.src)}let z=R(K[0],D+le(o,j),ne),B=[...j],V=B.at(-1),U=B.slice(0,-1).join(``),re=y&&V!==void 0&&(w.length>0||U.length>0)&&tf(V,o.eastAsiaLanguage)&&T+Se(o,U)<=H()+z;if(T+te<=H()+z)o.measuredWidth=_,G(o,_,b,k,A,M);else if(re)o.measuredWidth=_,G(o,_,b,k,A,M);else if(fp(o.text)&&o.seaBreaks===void 0){let t=H()-T;me(jf(o.bold,o.italic,fe(o),o.fontFamily,s,o.fontRoute));let n=he(o),r=``;try{r=t>0?vp(e,o.text,t,zf(o,u),qf(o),Bf(o,i),o.verticalRun===!0,v,e=>Se(o,e)):``}finally{ge(n)}let a=[...o.text],c=[...r].length,d=w.length>0?0:1,f=_p(a,(y&&c<a.length&&(w.length>0||c>0)&&tf(a[c],o.eastAsiaLanguage)?c+1:null)??wo(a,c,l,d)),p=a.slice(0,f).join(``);if(p.length>0){let e=Se(o,p);G({...o,text:p,measuredWidth:e,punctuationCompressions:Uf(o,0,p.length)},e,b,k,A);let t=o.text.slice(p.length);t&&K.unshift({...o,text:t,punctuationCompressions:Uf(o,p.length,o.text.length),measuredWidth:0,src:{segIndex:o.src.segIndex,charOffset:o.src.charOffset+p.length}})}else if(w.length>0){let e=null,t=o.text.codePointAt(0),n=w[w.length-1];if(t!==void 0&&l.lineStartForbidden.has(t)&&`text`in n){let t=n,r=[...t.text],i=To(r,l,w.length>1?0:1);if(i>0){let n=r.slice(0,r.length-i).join(``),a=r.slice(r.length-i).join(``);if(e={...t,text:a,punctuationCompressions:Uf(t,n.length,t.text.length),measuredWidth:Se(t,a,!0),src:{segIndex:t.src.segIndex,charOffset:t.src.charOffset+n.length}},n){let e=Se(t,n);T-=t.measuredWidth-e,w[w.length-1]={...t,text:n,measuredWidth:e,punctuationCompressions:Uf(t,0,n.length)}}else T-=t.measuredWidth,w.pop()}}ce(void 0,!1,e?.src??o.src),K.unshift(o),e&&K.unshift(e)}else{let e=[...o.text],t=e.length>0?_p(e,1):0,n=e.slice(0,t).join(``);if(n){let e=Se(o,n);G({...o,text:n,measuredWidth:e,punctuationCompressions:Uf(o,0,n.length)},e,b,k,A);let t=o.text.slice(n.length);t&&K.unshift({...o,text:t,punctuationCompressions:Uf(o,n.length,o.text.length),measuredWidth:0,src:{segIndex:o.src.segIndex,charOffset:o.src.charOffset+n.length}})}}}else if(o.seaBreaks!==void 0){let e=H()-T,t=e=>Se(o,e),n=Bo(o.text),r=Xo(o.text,o.seaBreaks,0,e,t,n);if(r>0){let e=o.text.slice(0,r),t=Se(o,e);G({...o,text:e,measuredWidth:t,punctuationCompressions:Uf(o,0,e.length)},t,b,k,A);let n=o.text.slice(r);n&&K.unshift({...o,text:n,punctuationCompressions:Uf(o,r,o.text.length),measuredWidth:0,src:{segIndex:o.src.segIndex,charOffset:o.src.charOffset+r},seaBreaks:gp(o.seaBreaks,r)})}else if(w.length>0){let e=null,t=o.text.codePointAt(0),n=w[w.length-1];if(t!==void 0&&l.lineStartForbidden.has(t)&&`text`in n){let t=n,r=[...t.text],i=To(r,l,w.length>1?0:1);if(i>0){let n=r.slice(0,r.length-i).join(``),a=r.slice(r.length-i).join(``);if(e={...t,text:a,punctuationCompressions:Uf(t,n.length,t.text.length),measuredWidth:Se(t,a,!0),src:{segIndex:t.src.segIndex,charOffset:t.src.charOffset+n.length},seaBreaks:gp(t.seaBreaks,n.length)},n){let e=Se(t,n);T-=t.measuredWidth-e,w[w.length-1]={...t,text:n,measuredWidth:e,punctuationCompressions:Uf(t,0,n.length)}}else T-=t.measuredWidth,w.pop()}}ce(void 0,!1,e?.src??o.src),K.unshift(o),e&&K.unshift(e)}else{let r=o.seaBreaks[0]??o.text.length,i=o.text.slice(0,r),a=$o(i),s=Xo(i,a,0,e,t,n);s<=0&&(s=a.length>0?a[0]:i.length);let c=o.text.slice(0,s),l=Se(o,c);G({...o,text:c,measuredWidth:l,punctuationCompressions:Uf(o,0,c.length)},l,b,k,A);let u=o.text.slice(s);u&&K.unshift({...o,text:u,punctuationCompressions:Uf(o,s,o.text.length),measuredWidth:0,src:{segIndex:o.src.segIndex,charOffset:o.src.charOffset+s},seaBreaks:gp(o.seaBreaks,s)})}}else if(w.length===0){let t=H();me(jf(o.bold,o.italic,fe(o),o.fontFamily,s,o.fontRoute));let n=he(o),r=0;try{r=t>0?vp(e,o.text,t,zf(o,u),qf(o),Bf(o,i),o.verticalRun===!0,v,e=>Se(o,e)).length:0}finally{ge(n)}let a=[0,...$o(o.text),o.text.length],c=a.filter(e=>e<=r).at(-1)??0;for(c<=0&&(c=a[1]??o.text.length);o.text.startsWith(` `,c);)c+=1;if(c>=o.text.length)o.measuredWidth=_,G(o,_,b,k,A);else{let e=o.text.slice(0,c),t=Se(o,e);G({...o,text:e,measuredWidth:t,punctuationCompressions:Uf(o,0,e.length)},t,b,k,A),K.unshift({...o,text:o.text.slice(c),punctuationCompressions:Uf(o,c,o.text.length),measuredWidth:0,src:{segIndex:o.src.segIndex,charOffset:o.src.charOffset+e.length}})}}else{if(o.joinPrev){o.measuredWidth=_,G(o,_,b,k,A,M);continue}ce(void 0,!1,o.src),K.unshift(o)}}if(w.length>0?ce():we!==null&&ce(we),_===`bounded`)for(let e of C)for(let t of e.segments)!(`text`in t)||t.metricOnly||t.text.length===0||(t.shapedClusters=void 0,t.textLayoutService&&t.textShapeRequest&&_e(t,!0));return C}const Ap=e=>{let t=e.text;return typeof t==`string`?t:void 0},jp=e=>e.rtl===!0,Mp=e=>e.digitsAsAN===!0,Np=e=>`isTab`in e;function Pp(e){for(let t of e){if(jp(t))return!0;let e=Ap(t);if(e!==void 0&&yo(e))return!0}return!1}function Fp(e,t){let n=e.length;if(n===0)return{order:[],rtl:[]};let r=``,i=Array(n),a=Array(n),o,s=()=>{for(o||=[];o.length<r.length;)o.push(null);return o};for(let t=0;t<n;t++){let n=Ap(e[t])??``;if(i[t]=r.length,r+=n.length>0?n:``,a[t]=r.length,Np(e[t]))s()[i[t]]=`S`;else if(n.length>0&&(Mp(e[t])||jp(e[t]))){let n=s(),o=Mp(e[t]),c=jp(e[t]);for(let e=i[t];e<a[t];e++){let t=r.charCodeAt(e);o&&t>=48&&t<=57?n[e]=`AN`:c&&hf(r[e])&&(n[e]=`R`)}}}if(o)for(;o.length<r.length;)o.push(null);let{levels:c,paragraphLevel:l}=_o().computeLevels(r,t?`rtl`:`ltr`,o),u=Array(n),d=Array(n);for(let e=0;e<n;e++){let t=a[e];for(;t>i[e]&&r[t-1]===` `;)t--;let n=!1;for(let r=i[e];r<t;r++){let e=c[r];if(e!==255&&(e&1)==1){n=!0;break}}u[e]=n,d[e]=i[e];for(let r=i[e];r<t;r++){let t=c[r];if(t!==255&&(t&1)==1===n){d[e]=r;break}}}let{order:f}=bo(c,l,d);return{order:f,rtl:u}}function Ip(e,t){switch(e){case`center`:return`center`;case`both`:case`justify`:case`distribute`:case`lowKashida`:case`mediumKashida`:case`highKashida`:case`thaiDistribute`:return`justify`;case`end`:case`right`:return t?`left`:`right`;case`start`:case`left`:case void 0:default:return t?`right`:`left`}}function Lp(e){switch(e){case`both`:case`justify`:case`distribute`:case`lowKashida`:case`mediumKashida`:case`highKashida`:case`thaiDistribute`:return!0;default:return!1}}function Rp(e){return e===`distribute`}function zp(e){let t=e.leadingIndentPt+e.authoredFirstIndentPt+e.markerShiftPt;return{startPt:t,endPt:t+e.markerWidthPt}}function Bp(e){let t=e.authoredFirstIndentPt+e.markerShiftPt;return e.baseRtl?e.alignedLeadingEdgePt-t-e.markerWidthPt:e.alignedLeadingEdgePt+t}function Vp(e,t){let{numbering:n,markerInput:r,service:i}=t,a=n!=null&&(n.text!==``||n.picBulletImagePath!=null)&&(!e.baseRtl||(n?.suff||`tab`)===`tab`&&t.authoredFirstIndentPt<0);if(!n||!r||!i||!a)return e;let o=Wp(n,r,{authoredFirstIndentPt:t.authoredFirstIndentPt,physicalIndentLeftPt:e.physicalIndentLeftPt,tabStops:t.tabStops,defaultTabPt:t.defaultTabPt??e.defaultTabPt},i,t.clusterGeometry??!0);return{...e,firstIndentPt:o.bodyOffsetPt,numberingMarkerGeometry:o}}function Hp(e,t,n,r,i=!0){return r?{shape:r.shape({text:t,fontSizePt:e.fontSizePt*n,fonts:e.fonts,themeFonts:e.themeFonts,themeFontPresence:e.themeFontPresence,weight:e.weight,style:e.style,complexScript:e.complexScript,fontHint:e.fontHint,eastAsiaLanguage:e.eastAsiaLanguage,kerning:e.kerning,measure:!0,clusterGeometry:i}),fontSizePx:e.fontSizePt*n}:null}function Up(e,t,n){return t.find(t=>af(e,t))??zl(e,[...t],n)}function Wp(e,t,n,r,i=!0){let a=e.picBulletImagePath?``:ue(e.text,e.fontFamily??null),o=a?Hp(t,a,1,r,i)?.shape??null:null,s=e.picBulletImagePath?e.picBulletWidthPt??t.fontSizePt:o?.advancePt??0,c=e.jc===`right`?-s:e.jc===`center`?-s/2:0,l=n.authoredFirstIndentPt+c+s,u=e.suff||`tab`,d=l;if(u===`space`)d+=Hp(t,` `,1,r,i)?.shape.advancePt??0;else if(u===`tab`&&(d=0,l>0)){let e=Up(n.physicalIndentLeftPt+l,n.tabStops,n.defaultTabPt);d=e?e.pos-n.physicalIndentLeftPt:l}return{bodyOffsetPt:d,markerText:a,markerWidthPt:s,markerShiftPt:c,shape:o}}function Gp(e,t,n){let r=0,i=0;for(let t of e.content){let e=t.type===`paragraph`?n.paragraph(t):n.nestedTable(t);r=Math.max(r,e.minWidthPt),i=Math.max(i,e.maxWidthPt)}let a=Math.max(0,t.left)+Math.max(0,t.right);return{minWidthPt:r+a,maxWidthPt:Math.max(r,i)+a}}function Kp(e){let t=e.textShapeRequest,n=e=>e?[e.ascii??null,e.highAnsi??null,e.eastAsia??null,e.complexScript??null]:null;return Uc(`paragraph-intrinsic-text`,[e.textLayoutService?.fingerprint??null,t?[n(t.fonts),n(t.themeFonts),t.themeFontPresence?[t.themeFontPresence.ascii??!1,t.themeFontPresence.highAnsi??!1,t.themeFontPresence.eastAsia??!1,t.themeFontPresence.complexScript??!1]:null,t.fontHint??null,t.fontSizePt,t.weight??null,t.style??null,t.complexScript??!1,t.eastAsiaLanguage??null,t.eastAsiaFontCharset??null,t.genericFamily??null,t.letterSpacingPt??null,t.kerning??null]:null,e.bold,e.italic,Ll(e,1),e.fontFamily,e.fontRoute??null,e.charScale??1,e.charSpacing??0,e.fitTextPerGapPx??null,e.fitTextTrailingPadPx??null,e.fitTextRegionIndex??null,e.snapToCharacterGrid!==!1,e.tateChuYoko??!1,e.tateChuYoko?e.sourceRunIndex??null:null,e.ruby?[e.sourceRunIndex??null,e.ruby.text,e.ruby.fontSizePt,e.ruby.hpsRaisePt??null]:null,e.verticalRun??!1])}function qp(e){let t=[];for(let n of e){let e=t.at(-1);if(e&&`text`in e&&`text`in n&&Kp(e)===Kp(n)){let r=e.text.length,i=e.text+n.text,a=[...e.punctuationCompressions??[],...(n.punctuationCompressions??[]).map(e=>({end:r+e.end,adjustmentPt:e.adjustmentPt}))];t[t.length-1]={...e,text:i,punctuationCompressions:a.length>0?a:void 0,textShapeRequest:e.textShapeRequest?{...e.textShapeRequest,text:i}:void 0};continue}t.push({...n})}return t}function Jp(e,t,n,r,i,a){let o=0;for(let s of e){let e=Math.max(n,s.start),c=Math.min(r,s.end);if(e>=c)continue;let l=t.slice(e,c),u=e-s.start,d=c-s.start,f={...s.segment,text:l,punctuationCompressions:Uf(s.segment,u,d)};if(f.textLayoutService&&f.textShapeRequest){let e=f.textLayoutService.shape({...f.textShapeRequest,text:l,fontSizePt:Ll(f,1),measure:!0,clusterGeometry:!1});o+=Yf(f,e.advancePt,a,1);continue}i.context.font=jf(f.bold,f.italic,Ll(f,1),f.fontFamily,i.fontFamilyClasses,f.fontRoute),o+=Yf(f,i.context.measureText(l).width,a,1)}return o}function Yp(e,t,n){let r=t.characterGrid.active?t.characterGrid.deltaPt:0,i=0;for(let a=0;a<e.length;a+=1){let o=e[a];if(!(`text`in o)||o.text.length===0)continue;let s=[],c=``,l=e=>{let t=c.length;c+=e.text,s.push({segment:e,start:t,end:c.length})};for(l(o);a+1<e.length;){let t=e[a+1];if(!(`text`in t)||t.joinPrev!==!0)break;l(t),a+=1}let u=0;for(let e of Cp(c)){let a=e.replace(/\\s+$/u,``),o=u,l=u+a.length;if(u+=e.length,!a)continue;if(!fp(a)){i=Math.max(i,Jp(s,c,o,l,n,r));continue}let d=[0,...$o(a),a.length],f=[];for(let e=1;e<d.length;e+=1)f.push({text:a.slice(d[e-1],d[e]),start:o+d[e-1],end:o+d[e]});let p=[],m=f[0];for(let e=1;e<f.length;e+=1){let n=[...m.text].at(-1)?.codePointAt(0),r=f[e].text.codePointAt(0);n!==void 0&&r!==void 0&&!t.kinsoku.lineEndForbidden.has(n)&&!t.kinsoku.lineStartForbidden.has(r)?(p.push(m),m=f[e]):m={text:m.text+f[e].text,start:m.start,end:f[e].end}}m&&p.push(m);for(let e of p)i=Math.max(i,Jp(s,c,e.start,e.end,n,r))}}return i}function Xp(e,t,n){let r=(n.baseRtl?n.physicalIndentRightPt:n.physicalIndentLeftPt)+(t===0?n.firstIndentPt:0)+e.xOffset;return{startPt:r,endPt:r+e.segments.reduce((e,t)=>e+t.measuredWidth,0)}}function Zp(e,t,n,r,i,a){if(!Number.isFinite(n)||n<0)throw RangeError(`maximumWidthPt must be finite and non-negative`);if(n===0)return{minWidthPt:0,maxWidthPt:0};let o=qp(Op(e.runs,i)),s=Math.max(1,n-t.physicalIndentLeftPt-t.physicalIndentRightPt),c=o.length===0?[]:kp(r.context,o,s,t.firstIndentPt,1,[...t.tabStops],void 0,r.fontFamilyClasses,t.physicalIndentLeftPt,t.kinsoku,t.characterGrid.active?t.characterGrid.deltaPt:0,t.defaultTabPt,s+t.physicalIndentRightPt,t.baseRtl,t.isJustified,t.stretchLastLine,void 0,`intrinsic`,i.verticalGlyphMeasurement,t.overflowPunct!==!1),l=t.baseRtl?t.physicalIndentLeftPt:t.physicalIndentRightPt,u=0,d=0;c.forEach((e,n)=>{let r=Xp(e,n,t);u=Math.min(u,r.startPt),d=Math.max(d,r.endPt)});let f=a?zp({leadingIndentPt:t.baseRtl?t.physicalIndentRightPt:t.physicalIndentLeftPt,authoredFirstIndentPt:e.indentFirst,markerShiftPt:a.markerShiftPt,markerWidthPt:a.markerWidthPt}):void 0;f&&(u=Math.min(u,f.startPt),d=Math.max(d,f.endPt));let p=Math.min(n,Math.max(0,d-u+l)),m=Yp(o,t,r);for(let e of c){let t=0,n=e.segments.reduce((e,t)=>e+t.measuredWidth,0);for(let r of e.segments)t+=r.measuredWidth,`imagePath`in r&&!r.anchor||`mathNodes`in r?m=Math.max(m,r.measuredWidth):`isTab`in r&&(m=Math.max(m,r.resolvedAlignment===`left`?t:n))}let h=t.baseRtl?t.physicalIndentRightPt:t.physicalIndentLeftPt,g=h,_=Math.min(0,g),v=Math.max(0,g+m),y=h+t.firstIndentPt;return _=Math.min(_,y),v=Math.max(v,y+m),f&&(_=Math.min(_,f.startPt),v=Math.max(v,f.endPt)),{minWidthPt:Math.min(n,Math.max(0,v-_+l)),maxWidthPt:p}}function Qp(e,t){if(!e||t?.suppressBottom)return 0;let n=e.bottom;return!n||n.style===`none`?0:(n.space??0)+(n.width??0)/2}function $p(e){return e==null||e.style===`none`?null:e}function em(e,t){let n=$p(e),r=$p(t);return n==null||r==null?n==null&&r==null:n.style===r.style&&n.width===r.width&&(n.space??0)===(r.space??0)&&(n.color??null)===(r.color??null)}function tm(e,t){return!e||!t?!1:em(e.top,t.top)&&em(e.bottom,t.bottom)&&em(e.left,t.left)&&em(e.right,t.right)&&em(e.between,t.between)}function nm(e){return e?[e.top,e.right,e.bottom,e.left,e.between].some(e=>e!=null&&e.style!==`none`):!1}function rm(e,t){return!e||!t||e.framePr||t.framePr?!1:nm(e.borders)&&nm(t.borders)&&tm(e.borders,t.borders)}function im(e,t,n,r=!1){let i=(e,t)=>r?!!e&&!!t&&!!e.framePr&&!!t.framePr&&nm(e.borders)&&nm(t.borders)&&tm(e.borders,t.borders):rm(e,t),a=i(e,t),o=i(t,n),s=t.borders?.between;return Object.freeze({top:a?s&&s.style!==`none`?`between`:`none`:`top`,bottom:o?`none`:`bottom`})}function am(e,t,n,r,i,a){return Zp(e,t,n,r,i,a).maxWidthPt}function om(e){let t=e;return Uc(`w:framePr`,[t.dropCap,t.lines,t.wrap,t.hAnchor,t.vAnchor,t.hRule,t.hSpace,t.vSpace,t.w??null,t.h??null,t.x??null,t.y??null,t.xAlign??null,t.yAlign??null,t.__anchorLock===!0])}function sm(e){let t=new WeakMap;for(let n=0;n<e.length;){let r=e[n];if(r?.type!==`paragraph`||!r.framePr){n+=1;continue}let i=om(r.framePr),a=[r],o=[n],s=n+1;for(;s<e.length;){let t=e[s];if(t?.type!==`paragraph`||!t.framePr||om(t.framePr)!==i)break;a.push(t),o.push(s),s+=1}let c=Object.freeze({id:`${i}:${n}`,owner:r,members:Object.freeze(a),sourceIndices:Object.freeze(o),framePr:r.framePr});for(let e of a)t.set(e,c);n=s}return t}const cm=new WeakMap,lm=new WeakMap;function um(e){let t=sm(e);for(let n=0;n<e.length;n+=1){let r=e[n];if(r.type!==`paragraph`)continue;let i=t.get(r);i&&cm.set(r,i);let a=e[n-1],o=e[n+1],s=a?.type===`paragraph`&&t.get(a)===i?a:null,c=o?.type===`paragraph`&&t.get(o)===i?o:null;lm.set(r,im(i?s:a?.type===`paragraph`?a:null,r,i?c:o?.type===`paragraph`?o:null,i!==void 0))}}const dm=e=>cm.get(e),fm=e=>lm.get(e);function pm(e){return{story:e.story,containers:[...e.containers,{kind:`tableCell`}],lineNumberingEligible:!1}}function mm(e){return e.runs.some(e=>e.type===`text`&&!!e.ruby)}function hm(e){return e.runs.some(e=>e.type===`text`&&Rl.test(e.text))}function gm(e){for(let t of e){if(t.type===`paragraph`){if(hm(t))return!0;continue}if(t.type===`table`){for(let e of t.rows)for(let t of e.cells)if(gm(t.content))return!0}}return!1}function _m(e){return um(e.body),{kinsoku:So(e.settings),defaultTabPt:wp(e.settings),characterSpacingControl:e.settings?.characterSpacingControl,mathDefJc:e.settings?.mathDefJc,documentHasEastAsianText:gm(e.body),compat:{adjustLineHeightInTable:e.settings?.adjustLineHeightInTable??!1,useFeLayout:e.settings?.useFeLayout??!1,balanceSingleByteDoubleByteWidth:e.settings?.balanceSingleByteDoubleByteWidth??!1}}}function vm(e){let t=e.pageWidth-e.marginLeft-e.marginRight,n=e.columns;if(!n||n.count<=1)return[{xPt:e.marginLeft,wPt:Math.max(1,t)}];if(!n.equalWidth&&n.cols.length>0){let t=[],r=e.marginLeft;for(let e of n.cols)t.push({xPt:r,wPt:Math.max(1,e.widthPt)}),r+=e.widthPt+e.spacePt;return t}let r=Math.max(1,(t-(n.count-1)*n.spacePt)/n.count);return Array.from({length:n.count},(t,i)=>({xPt:e.marginLeft+i*(r+n.spacePt),wPt:r}))}function ym(e){switch(e){case`lines`:case`linesAndChars`:case`snapToChars`:return e;default:return`none`}}function bm(e){return e===`lines`||e===`linesAndChars`||e===`snapToChars`}function xm(e){return e===`linesAndChars`||e===`snapToChars`}function Sm(e,t){return{geometry:{pageWidth:t.pageWidth,pageHeight:t.pageHeight,marginTop:t.marginTop,marginRight:t.marginRight,marginBottom:t.marginBottom,marginLeft:t.marginLeft,headerDistance:t.headerDistance,footerDistance:t.footerDistance},columns:vm(t),columnSeparator:t.columns?.sep===!0,grid:{kind:ym(t.docGridType),linePitchPt:t.docGridLinePitch??null,charSpacePt:t.docGridCharSpace==null?null:t.docGridCharSpace/4096},textDirection:t.textDirection??`lrTb`,sectionBidi:!1,verticalAlignment:t.vAlign??`top`,lineNumbering:t.lineNumbering??void 0}}function Cm(e){return e.containers.some(e=>e.kind===`tableCell`)}function wm(e,t,n,r){let i=bm(t.grid.kind)&&t.grid.linePitchPt!=null&&t.grid.linePitchPt>0&&r.snapToGrid!==!1&&r.lineSpacing?.rule!==`exact`&&(!Cm(n)||e.compat.adjustLineHeightInTable),a=xm(t.grid.kind)&&t.grid.charSpacePt!=null,o=r.bidi===!0,s=r.numbering,c=s!=null&&(s.text!==``||s.picBulletImagePath!=null),l=o&&c&&(s.suff||`tab`)===`tab`&&r.indentFirst<0;return{lineGrid:{active:i,pitchPt:i?t.grid.linePitchPt:null},characterGrid:{active:a,deltaPt:a?t.grid.charSpacePt??0:0},physicalIndentLeftPt:o?r.indentRight:r.indentLeft,physicalIndentRightPt:o?r.indentLeft:r.indentRight,firstIndentPt:l?0:r.indentFirst,lineSpacing:r.lineSpacing,spaceBeforePt:r.spaceBefore,spaceAfterPt:r.spaceAfter,baseRtl:o,isJustified:Lp(r.alignment),stretchLastLine:Rp(r.alignment),tabStops:[...r.tabStops],hasRuby:mm(r),hasEastAsianText:hm(r),kinsoku:e.kinsoku,defaultTabPt:e.defaultTabPt,overflowPunct:r.overflowPunct!==!1,mathDefJc:e.mathDefJc}}Y({id:`word-default-line-number-distance`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/compatibility.test.ts#uses Word's observed 18pt line-number distance only when omitted`},description:`ECMA-376 §17.6.8 leaves an omitted line-number distance implementation-defined. Preserve Word-compatible 18pt placement only when the authored distance is absent.`}),Y({id:`word-continuous-section-page-number-restart`,evidence:{kind:`regression-test`,reference:`packages/docx/src/page-number-field-render.test.ts#restarts a spilling continuous section after its shared first page`},description:`Issue #804 records that Word anchors a continuous section page-number restart to the section first appearance on the shared physical page, so its next owned page advances from that appearance.`}),Y({id:`word-trailing-empty-mark-baseline-admission`,evidence:{kind:`regression-test`,reference:`packages/docx/src/paginate-trailing-empty-mark-fit.test.ts#KEEPS an inkless empty paragraph on the page when ink-bearing content follows and only its below-baseline whitespace overflows`},description:`At the unreserved physical body edge, Word admits an undecorated non-terminal empty paragraph mark by its baseline when later ink follows in the same flow.`}),Y({id:`word-book-fold-gutter-right-edge`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §§2.1.389, 2.1.391`},description:`For book-fold printing Word places the automatic gutter at the right-margin bisector edge, including reverse book-fold mode.`});function Tm(e){return e??18}function Em(e,t,n){return e+t-n}function Dm(e){return!e.hasContinuationBoundary&&e.inkless&&e.undecorated&&!e.keepNext&&e.markReservePt===0&&e.pageBottomIsUnreserved&&e.physicalRegionBottomIsActive&&e.hasFollowingInk?e.markBelowBaselinePt:0}function Om(){return`right`}function km(e){if(e.sectionOccurrenceId.length===0)throw RangeError(`Section occurrence id must not be empty`);if(e.columns.length===0)throw RangeError(`A page-flow section requires at least one column`);return Object.freeze({sectionOccurrenceId:e.sectionOccurrenceId,geometry:Object.freeze({...e.geometry}),columns:Object.freeze(e.columns.map(e=>Object.freeze({...e}))),textDirection:e.textDirection,sectionBidi:e.sectionBidi??!1,grid:Object.freeze(e.grid??{kind:`none`,linePitchPt:null,charSpacePt:null})})}function Am(e){return Mm(e.geometry.marginTop)}function jm(e){return e.geometry.pageHeight-Mm(e.geometry.marginBottom)}function Mm(e){return Math.abs(e)}function Nm(e){return{pageWidth:e.pageHeight,pageHeight:e.pageWidth,marginLeft:e.marginTop,marginTop:e.marginRight,marginRight:e.marginBottom,marginBottom:e.marginLeft,headerDistance:e.headerDistance,footerDistance:e.footerDistance}}function Pm(e){return{pageWidth:e.pageHeight,pageHeight:e.pageWidth,marginTop:e.marginLeft,marginRight:e.marginTop,marginBottom:e.marginRight,marginLeft:e.marginBottom,headerDistance:e.headerDistance,footerDistance:e.footerDistance}}function Fm(e){return e===`tbRl`||e===`tbRlV`||e===`tbLrV`||e===`btLr`}function Im(e,t){if(!Number.isInteger(t)||t<0)throw RangeError(`Physical page index must be a non-negative integer`);let{pageWidth:n,pageHeight:r}=e.physicalGeometry,{marginTop:i,marginRight:a,marginBottom:o,marginLeft:s}=e.physicalGeometry,c=e.bookFoldPrinting||e.bookFoldRevPrinting;return c?(n/=2,Om()===`right`&&(a+=e.gutterPt)):e.printTwoOnOne?(r/=2,i+=e.gutterPt):e.gutterAtTop&&!e.mirrorMargins?i+=e.gutterPt:e.rtlGutter?a+=e.gutterPt:s+=e.gutterPt,!c&&!e.printTwoOnOne&&e.mirrorMargins&&t%2==1&&([s,a]=[a,s]),{...e.physicalGeometry,pageWidth:n,pageHeight:r,marginTop:i,marginRight:a,marginBottom:o,marginLeft:s}}function Lm(e,t,n){let r=Im(t,n),i=Fm(t.textDirection)?Nm(r):r;return Object.freeze({...e,geometry:Object.freeze(i),columns:Object.freeze(vm({...i,titlePage:!1,evenAndOddHeaders:!1,columns:t.columns}).map(e=>Object.freeze(e)))})}function Rm(e){return{pageWidth:e.pageWidth,pageHeight:e.pageHeight,marginTop:e.marginTop,marginRight:e.marginRight,marginBottom:e.marginBottom,marginLeft:e.marginLeft,headerDistance:e.headerDistance,footerDistance:e.footerDistance}}function zm(e,t=!1){let n=e.docGridType===`lines`||e.docGridType===`linesAndChars`||e.docGridType===`snapToChars`?e.docGridType:`none`;return Object.freeze({geometry:Object.freeze(Rm(e)),columns:Object.freeze(vm(e).map(e=>Object.freeze(e))),columnSeparator:e.columns?.sep===!0,grid:Object.freeze({kind:n,linePitchPt:e.docGridLinePitch??null,charSpacePt:e.docGridCharSpace==null?null:e.docGridCharSpace/4096}),textDirection:e.textDirection??`lrTb`,sectionBidi:t,verticalAlignment:e.vAlign??`top`,...e.lineNumbering===null||e.lineNumbering===void 0?{}:{lineNumbering:Object.freeze({...e.lineNumbering})}})}function Bm(e){if(!Number.isInteger(e.bodyLength)||e.bodyLength<0||e.occurrences.length===0)throw RangeError(`A body section index requires a non-negative length and occurrences`);let t=Array(e.bodyLength+1),n=0;e.occurrences.forEach((r,i)=>{let a=i===e.occurrences.length-1;if(r.ordinal!==i||r.startBodyIndex!==n||r.endBodyIndex!==(a?e.bodyLength-1:r.markerBodyIndex)||r.final!==a||(a?r.markerBodyIndex!==null:r.markerBodyIndex===null))throw RangeError(`Invalid section occurrence ${i}`);for(let e=r.startBodyIndex;e<=r.endBodyIndex;e+=1)t[e]=i;n=r.endBodyIndex+1});let r=e.occurrences.length-1;t[e.bodyLength]=r;let i=Object.freeze([...e.occurrences]),a=Object.freeze(t);return Object.freeze({occurrences:i,sectionAtBodyIndex(e){if(!Number.isInteger(e)||e<0||e>=a.length)throw RangeError(`Body index ${e} is outside the retained section index`);return i[a[e]]}})}function Vm(e,t){let n=t[0].logicalTotalRows,r=0;for(let i of t){if(i.logicalTotalRows!==n||!Number.isInteger(i.rowCount)||i.rowCount<0||i.logicalRowOffset!==r)throw Error(`Parser-owned adjacent table sequence ${e} is inconsistent`);r+=i.rowCount}if(r!==n)throw Error(`Parser-owned adjacent table sequence ${e} is incomplete`)}function Hm(e){let t=[],n=null,r=[],i=()=>{r.length>0&&Vm(n,r),r.length===1?t.push(Object.freeze({kind:`body-element`,element:r[0].element})):r.length>1&&t.push(Object.freeze({kind:`adjacent-table-group`,logicalSequenceId:n,tables:Object.freeze(r.map(e=>e.element))})),n=null,r=[]};for(let{element:a,table:o}of e){if(a.type===`table`&&o!==null){r.length>0&&n!==o.logicalSequenceId&&i(),n=o.logicalSequenceId,r.push(Object.freeze({element:a,logicalRowOffset:o.logicalRowOffset,logicalTotalRows:o.logicalTotalRows,rowCount:o.rowCount}));continue}i(),t.push(Object.freeze({kind:`body-element`,element:a}))}return i(),Object.freeze(t)}Y({id:`word-terminal-column-break`,evidence:{kind:`regression-test`,reference:`packages/docx/src/pagination.test.ts#ignores a terminal last-column break before a hard page boundary`},description:`The established pagination regression contract does not materialize a column transition when no body flow content occurs before the next forced page or non-continuous section boundary.`}),Y({id:`word-pre-break-anchor-paragraph`,evidence:{kind:`regression-test`,reference:`packages/docx/src/pagination.test.ts#does not push an anchor-only pre-break paragraph to a new page just for its empty mark`},description:`The established pagination regression contract keeps an anchor-only paragraph immediately before an authored page break in the pre-break flow region without charging its otherwise visible paragraph mark.`}),Y({id:`word-pre-break-inline-drawing-group`,evidence:{kind:`regression-test`,reference:`packages/docx/src/pagination.test.ts#moves a preceding image with its pre-break callout when the pair only fits fresh`},description:`The established pagination regression contract relocates a preceding inline DrawingML resource with an immediately following host-owned anchor paragraph before an authored page break when the pair fits only in a fresh flow region.`}),Y({id:`word-continuous-section-mark-spacing`,evidence:{kind:`regression-test`,reference:`packages/docx/src/body-layout-input.test.ts#projects mutually exclusive collapsed-mark and drop-previous-after roles`},description:`The retained body input projects the established continuous-section empty-mark spacing behavior into one mutually exclusive role before pagination.`}),Y({id:`word-contextual-spacing-per-side`,evidence:{kind:`regression-test`,reference:`packages/docx/src/contextual-spacing-body-paint.test.ts#paints the adjudicated six-case gap table`},description:`For same-style adjacent paragraphs, contextualSpacing removes only the contribution owned by each toggling side; a current-only toggle preserves the previous paragraph spaceAfter contribution.`}),Y({id:`word-empty-keep-next-bridge`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/body-paginator-production.test.ts#bridges an undecorated empty keepNext mark through the following paragraph`},description:`Word print pagination treats an undecorated empty keep-with-next paragraph as a bridge: the following paragraph is admitted completely with the first indivisible content of its successor.`}),Y({id:`word-automatic-keep-next-start-spacing`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/body-paginator-production.test.ts#suppresses leading spacing when a keepNext unit moves to an automatic page`},description:`When automatic overflow relocates a keep-with-next unit to a fresh physical page, suppress the leading paragraph space-before for that grouped relocation without changing ordinary overflow or authored-break spacing.`}),Y({id:`word-trailing-space-after-fit-admission`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/paragraph-pagination.test.ts#admits final visible content when only authored spaceAfter crosses the region edge`},description:`Admit the final visible paragraph content at a flow-region edge when only its authored trailing space crosses the edge, while retaining that space for placement and paint.`}),Y({id:`word-vertical-rl-final-line-baseline-admission`,evidence:{kind:`office-observation`,syntheticFixtureId:`vertical-rl-final-line-baseline-admission`,application:`Microsoft Word`,version:`16.111.1`,platform:`macOS 26.5.2`},description:`In a vertical-rl section, Word admits the final visible text column when its transformed baseline and retained visible ink remain inside the block-end edge even if the complete logical line box crosses that edge. The complete retained advance remains authoritative after admission.`});function Um(e){return Math.max(0,e.advancePt-Math.min(e.authoredSpaceAfterPt,e.retainedSpaceAfterPt))}function Wm(e){return e.origin.yPt+(e.inkBounds?.descentPt??0)}function Gm(e){if(e.kind===`resource`||e.kind===`drawing`)return e.bounds.yPt+e.bounds.heightPt;if(e.kind===`anchor-host`)return null;if(e.kind===`tab`){let t=e.leaderGlyphs??[];return t.length>0?Math.max(...t.map(Wm)):null}let t=e.paintOps??[],n=t.length>0?t.map(t=>e.origin.yPt+t.offset.yPt+(t.blockAxisInkBounds?.endPt??t.inkBounds?.descentPt??0)):[e.origin.yPt];for(let t of e.decorations){let e=t.widthPt/2;n.push(t.from.yPt+e,t.to.yPt+e);for(let r of t.path??[])n.push(r.yPt+e)}for(let t of e.highlightFragments??[])n.push(t.rect.yPt+t.rect.heightPt);for(let t of e.runBorderFragments??[]){let e=t.widthPt/2;n.push(t.from.yPt+e,t.to.yPt+e)}for(let t of e.emphasis?.glyphs??[])n.push(Wm(t));for(let t of e.ruby?.paintOps??[])n.push(Wm(t));for(let t of e.emphasis?.paths??[]){let e=t.stroke===null?0:t.strokeWidthPt/2;for(let r of t.points)n.push(r.yPt+e)}return Math.max(...n)}function Km(e){if(e.writingMode!==`vertical-rl`||e.logicalLineBoxExtentPt<=e.availableBlockExtentPt)return e.logicalLineBoxExtentPt;let t=e.paragraph.lines.at(-1);if(!t||t.placements.some(e=>e.kind===`text`&&(e.paintOps??[]).some(e=>e.glyphOrientation!==void 0&&e.blockAxisInkBounds===void 0)))return e.logicalLineBoxExtentPt;let n=t.placements.flatMap(e=>{let t=Gm(e);return t===null?[]:[t]});if(n.length===0||e.paragraph.shading)return e.logicalLineBoxExtentPt;for(let t of e.paragraph.borders){let e=t.widthPt/2;n.push(t.from.yPt+e,t.to.yPt+e)}if(e.paragraph.paragraphMark&&!e.paragraph.paragraphMark.hidden){let t=e.paragraph.paragraphMark.bounds;n.push(t.yPt+t.heightPt)}return Math.max(0,Math.max(...n)-e.paragraph.flowBounds.yPt)}function qm(e){return e.keepNext&&e.inkless&&e.undecoratedMark}function Jm(e,t){let n=e[t];if(n?.kind!==`body-block`||n.block.kind!==`paragraph`)return;let r=e[t+1],i=e[t+2],a=n.block.inkless===!0&&r?.kind===`begin-section`&&r.section.startType===`continuous`;return a&&n.block.spaceBeforePt===0?`collapse-mark`:a?`suppress-before`:n.block.inkless===!0&&r?.kind===`body-block`&&r.block.kind===`paragraph`&&r.block.inkless===!0&&r.block.spaceBeforePt===0&&i?.kind===`begin-section`&&i.section.startType===`continuous`?`drop-previous-after`:void 0}function Ym(e){return e.drawings.length>0&&e.lines.every(e=>e.placements.every(e=>e.kind===`drawing`||e.kind===`anchor-host`))}function Xm(e){return e.lines.some(e=>e.placements.some(e=>e.kind===`resource`&&(e.resourceKind===`image`||e.resourceKind===`chart`)&&e.bounds!==void 0&&e.bounds.widthPt>0&&e.bounds.heightPt>0))}function Zm(e,t){if(!Ym(e))return null;let n=e.drawings.filter(e=>e.anchorLayer?.verticalOwnership===`host`&&Number.isFinite(e.flowBounds.xPt)&&Number.isFinite(e.flowBounds.yPt)&&Number.isFinite(e.flowBounds.widthPt)&&Number.isFinite(e.flowBounds.heightPt)&&e.flowBounds.widthPt>0&&e.flowBounds.heightPt>0);if(n.length!==e.drawings.length)return null;let r=Math.max(...n.map(e=>e.flowBounds.yPt+e.flowBounds.heightPt));return Math.max(0,r-t)}function Qm(e){if(!Ym(e))return null;let{paragraphMark:t,...n}=e;return Object.freeze({...n,advancePt:0,flowBounds:Object.freeze({...e.flowBounds,heightPt:0})})}function $m(e){let t=new Set,n=!1;for(let r=e.length-1;r>=0;--r){let i=e[r];if(i.kind===`body-block`){n=i.block.kind!==`paragraph`||!i.block.pageBreakBefore;continue}if(i.kind===`adjacent-table-group`){n=!0;continue}if(i.kind===`authored-break`){i.break===`column`?n&&t.add(r):n=!1;continue}i.kind===`begin-section`&&i.section.startType!==`continuous`&&(n=!1)}return t}function eh(e){switch(e){case`continuous`:case`nextColumn`:case`nextPage`:case`oddPage`:case`evenPage`:return e;default:return`nextPage`}}function th(e,t,n){let r=n===null?null:`section:${n}`,i=n=>e[n]===null?null:{story:t,storyInstance:r===null?n:`${r}:${n}`,path:[]};return Object.freeze({default:i(`default`),first:i(`first`),even:i(`even`)})}function nh(e){return{...e.geometry,titlePage:e.titlePage,evenAndOddHeaders:!1,sectionStart:e.startType,columns:e.columns,textDirection:e.textDirection,docGridType:e.docGridType,docGridLinePitch:e.docGridLinePitch,docGridCharSpace:e.docGridCharSpace,pageNumType:e.pageNumType,vAlign:e.vAlign,lineNumbering:e.lineNumbering}}function rh(e,t){let n=e.markerBodyIndex;return Object.freeze({sectionOccurrenceId:e.sectionOccurrenceId,source:Object.freeze(n===null?{story:`body`,storyInstance:`body`,path:Object.freeze([])}:{story:`body`,storyInstance:`body`,path:Object.freeze([n])}),startType:eh(e.startType),context:Object.freeze(zm(nh(e),e.sectionBidi)),pageNumbering:Object.freeze({start:e.pageNumType?.start??null,format:e.pageNumType?.fmt??null}),titlePage:e.titlePage,evenAndOddHeaders:t.evenAndOddHeaders,headers:th(e.headers,`header`,n),footers:th(e.footers,`footer`,n),pageBordersAuthored:e.pageBordersAuthored,pageBorders:e.pageBorders,pageLayout:Object.freeze({physicalGeometry:Object.freeze({...e.geometry}),columns:e.columns,textDirection:e.textDirection??`lrTb`,gutterPt:e.gutterPt,rtlGutter:e.rtlGutter,...t.pageLayoutSettings})})}function ih(e){let t=new Map(e.sectionIndex.occurrences.map(t=>[t.sectionOccurrenceId,rh(t,e)])),n=e.sectionIndex.occurrences[0];if(!n)throw Error(`DOCX body requires a final section owner`);let r=t.get(n.sectionOccurrenceId),i=e.sequence.map(e=>{if(e.kind!==`begin-section`)return e;let n=t.get(e.section.sectionOccurrenceId);if(!n)throw Error(`Missing body section owner: ${e.section.sectionOccurrenceId}`);return Object.freeze({...e,section:n})});return Zc({source:{story:`body`,storyInstance:`body`,path:[]},initialSection:r,sequence:i.map((e,t)=>{if(e.kind!==`body-block`||e.block.kind!==`paragraph`)return e;let n=Jm(i,t);return n===void 0?e:Object.freeze({...e,block:Object.freeze({...e.block,continuousSectionRole:n})})}),parserDiagnostics:e.parserDiagnostics??[],endnoteIds:e.endnoteIds??[],noteLayoutSettings:e.noteLayoutSettings},`DOCX body layout input`)}function ah(e){return!(e.runs??[]).some(e=>e.type===`text`?e.text.length>0:!0)}Y({id:`word-exact-row-height-bottom-padding`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.180(d)`},description:`Word adds the largest bottom cell margin to an exact trHeight instead of treating that margin as part of the authored height.`}),Y({id:`word-table-border-layer-cascade`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.169`},description:`During per-side border acquisition, none falls through to a lower-precedence layer while nil remains authored and blocks fallback only on that side.`}),Y({id:`word-spaced-cell-inside-border-conflict`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §§2.1.136, 2.1.138`},description:`With non-zero cell spacing, Word retains the narrow conditional tcBorders insideH/insideV conflict against the corresponding table inside border.`}),Y({id:`word-table-indent-all-alignments`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.155`},description:`Word applies tblInd as a signed leading-edge translation for every table alignment, reversing the translation for bidi visual order.`}),Y({id:`word-exact-row-vertical-clip-only`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/table.test.ts#clips an overflowing merged owner when every row in its span is exact`},description:`Preserve the established exact-row overflow behavior that clips the owned vertical interval without clipping nested table ink horizontally to the cell box.`}),Y({id:`word-over-page-cant-split-clip`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.120`},description:`Word starts an over-page cantSplit row on a fresh page and clips its overflow instead of synthesizing a row continuation.`}),Y({id:`word-positioned-table-adjacency-exclusion`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.149(a)`},description:`Word excludes effectively positioned tables from the logical adjacent-table sequence before retained layout consumes the parser-owned sequence identity.`}),Y({id:`word-table-border-weight-precedence`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.169`},description:`Use the documented Word border numbers for shared-cell conflict weight and force dotted and dashed borders to a complete weight of one.`}),Y({id:`word-omitted-row-height-rule-at-least`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.180`},description:`Treat an omitted trHeight hRule as atLeast while retaining an explicitly authored auto rule as authored input.`}),Y({id:`word-authored-auto-row-height-floor`,evidence:{kind:`regression-test`,reference:`packages/docx/src/table-row-height.test.ts#auto with @val — @val is honored as a lower bound`},description:`Preserve the established legacy-model behavior that an auto row with an authored height value uses that value as a lower bound.`}),Y({id:`word-effective-floating-table-positioning`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §2.1.162`},description:`Use parser-retained effective positioning status rather than lexical tblpPr presence to decide whether a table leaves ordinary flow.`}),Y({id:`word-table-cell-spacing-scope-shadow`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §§2.1.152, 2.1.153, 2.1.154`},description:`At each table-cell-spacing precedence scope, pct, auto, and nil resolve to zero and shadow lower scopes instead of being treated as absent.`}),Y({id:`word-table-margin-scope-shadow`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §§2.1.116, 2.1.125, 2.1.146, 2.1.177`},description:`Preserve the documented scope-specific treatment of non-dxa table cell margins: leading/trailing defaults may resolve to zero while cell/exception and nil top/bottom values remain ignored.`}),Y({id:`word-first-row-table-exception-scope`,evidence:{kind:`microsoft-note`,reference:`[MS-OI29500] §§2.1.156, 2.1.158, 2.1.167`},description:`Apply the supported first-row table-property exception facts at table scope, including authored preferred-width shadowing.`}),Y({id:`word-trailing-structural-cell-marker`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/compatibility.test.ts#drops only an empty trailing paragraph after a non-paragraph cell block`},description:`Exclude the required empty trailing cell paragraph from row-height and vertical-alignment measurements when it follows a visible non-paragraph block.`}),Y({id:`word-cell-vertical-alignment-ink-block`,evidence:{kind:`regression-test`,reference:`packages/docx/src/cell-valign-leading-spacing.test.ts#inked block is vertically centred in the cell (midpoint = cell midpoint)`},description:`Center or bottom-align the visible cell ink block without charging the first paragraph spaceBefore or final paragraph spaceAfter at the cell edges.`}),Y({id:`word-vertical-merge-terminal-border`,evidence:{kind:`regression-test`,reference:`packages/docx/src/cell-border-conflict-render.test.ts#uses the final continuation cell border at the bottom of a vertical merge`},description:`Resolve the bottom edge of a vertically merged cell from its terminal continuation cell before applying shared-edge conflict rules.`}),Y({id:`word-vertical-section-upright-block-table`,evidence:{kind:`regression-test`,reference:`packages/docx/src/vertical-table-upright.test.ts#the table advances the flow by its PHYSICAL WIDTH; body text stays vertical`},description:`Paint a block table in an upright physical frame within a vertical section and charge its physical width as the body-flow advance.`});function oh(e,t){return Math.max(0,e??0)+Math.max(0,...t)}function sh(e){return e!=null&&e!==`none`}function ch(e,t,n){return n?e-t:e+t}function lh(e){return e.spacingPt>0&&!sh(e.directStyle)&&sh(e.conditionalInsideStyle)}function uh(e,t){return Object.freeze({xPt:t.xPt,yPt:e.yPt,widthPt:t.widthPt,heightPt:e.heightPt})}function dh(e){return e.compatibility===`word`&&e.availableHeightPt+e.epsilonPt>=e.freshPageHeightPt}const fh=Object.freeze([`single`,`thick`,`double`,`dotted`,`dashed`,`dotDash`,`dotDotDash`,`triple`,`thinThickSmallGap`,`thickThinSmallGap`,`thinThickThinSmallGap`,`thinThickMediumGap`,`thickThinMediumGap`,`thinThickThinMediumGap`,`thinThickLargeGap`,`thickThinLargeGap`,`thinThickThinLargeGap`,`wave`,`doubleWave`,`dashSmallGap`,`dashDotStroked`,`threeDEmboss`,`threeDEngrave`,`outset`,`inset`]),ph=Object.freeze({single:1,thick:2,double:3,dotDash:8,dotDotDash:9,triple:10,thinThickSmallGap:11,thickThinSmallGap:12,thinThickThinSmallGap:13,thinThickMediumGap:14,thickThinMediumGap:15,thinThickThinMediumGap:16,thinThickLargeGap:17,thickThinLargeGap:18,thinThickThinLargeGap:19,wave:20,doubleWave:21,dashSmallGap:22,dashDotStroked:23,threeDEmboss:24,threeDEngrave:25,outset:26,inset:27});function mh(e,t){return e===`dotted`||e===`dashed`?1:Math.max(0,t)*8*(ph[e]??0)}function hh(e,t){return t?e:`atLeast`}function gh(e,t){return e===`pct`||e===`auto`||e===`nil`?0:t}function _h(e){return e.kind===`dxa`?e.dxaValuePt:e.scope===`cell`||e.scope===`exception`?null:(e.edge===`start`||e.edge===`end`)&&(e.kind===`pct`||e.kind===`auto`||e.kind===`nil`)?0:null}const vh=new WeakMap;function yh(e){return vh.get(e)??[]}function bh(e){let t=yh(e);if(t.length===0)return e.runs;let n=[],r=0;for(let i=0;i<=e.runs.length;i+=1){for(;t[r]?.publicRunIndex===i;)n.push(t[r].run),r+=1;i<e.runs.length&&n.push(e.runs[i])}return n}function xh(e){return yh(e).length>0}function Sh(e){let t=e.__pageLayoutSettings;return Zc({mirrorMargins:t?.mirrorMargins===!0,gutterAtTop:t?.gutterAtTop===!0,bookFoldPrinting:t?.bookFoldPrinting===!0,bookFoldRevPrinting:t?.bookFoldRevPrinting===!0,printTwoOnOne:t?.printTwoOnOne===!0},`DOCX page layout settings input`)}function Ch(e){let t=e.__noteLayoutSettings;return Zc({footnotePosition:t?.footnotePosition??`pageBottom`,endnotePosition:t?.endnotePosition??`docEnd`},`DOCX note layout settings input`)}function wh(e){return Object.freeze(e?Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`number`)):{})}function Th(e){return Object.freeze({...e,pageGeometry:wh(e.pageGeometry)})}const Eh=new WeakMap,Dh=new WeakMap,Oh=new WeakMap,kh=new WeakMap;function Ah(e){let t=Oh.get(e);if(t)return t;let n=Zc({table:e.__tableLayout??null,rows:e.rows.map(e=>({row:e.__tableRowLayout??null,cells:e.cells.map(e=>e.__tableCellLayout??null)}))},`DOCX table acquisition input`);return Oh.set(e,n),n}function jh(e){return Kh(e).ordinaryFlow}function Mh(e){return Kh(e).positioning===null?null:e.tblpPr??null}function Nh(e){return{leftFromTextPt:e.leftFromText,rightFromTextPt:e.rightFromText,topFromTextPt:e.topFromText,bottomFromTextPt:e.bottomFromText,horzAnchor:e.horzAnchor,horzSpecified:e.horzSpecified,vertAnchor:e.vertAnchor,xPt:e.tblpX,yPt:e.tblpY,...e.tblpXSpec==null?{}:{xAlign:e.tblpXSpec},...e.tblpYSpec==null?{}:{yAlign:e.tblpYSpec}}}function Ph(e,t){if(e===null)return null;let n=e.trim(),r=t&&n.endsWith(`%`)?n.slice(0,-1):n;if(r.length===0)return null;let i=Number(r);return Number.isFinite(i)?i:null}function Fh(e){return e.value?.trim().endsWith(`%`)?`pct`:e.kind??`dxa`}function Ih(e){if(!e)return null;let t=e.value?.trim()??``,n=Fh(e);if(n===`dxa`){let t=Ph(e.value??`0`,!1);return t===null?null:{kind:`dxa`,value:t/20}}if(n!==`pct`)return null;let r=Ph(e.value??`0`,!0);return r===null?null:{kind:`pct`,value:t.endsWith(`%`)?r/100:r/5e3}}function Lh(e){let t=Ih(e);return t?.kind===`dxa`?t.value:null}function Rh(e){let t=Ph(e??null,!1);return t===null?null:t/20}function zh(e){return e===`exact`||e===`atLeast`?e:`auto`}function Bh(e){return{rule:hh(zh(e.rule),e.ruleAuthored),valuePt:Rh(e.value)}}function Vh(e){if(e.rowHeight===null||!Number.isFinite(e.rowHeight))return null;let t=zh(e.rowHeightRule);return{rule:t===`auto`?`atLeast`:t,valuePt:e.rowHeight}}function Hh(...e){for(let t of e){if(!t)continue;let e=gh(Fh(t),Lh(t));if(e!==null)return e}return null}function Uh(e,t,n){if(!e)return null;let r=Fh(e);return _h({kind:r,dxaValuePt:r===`dxa`?Rh(e.value??`0`):null,scope:t,edge:n})}function Wh(e,t,n,r,i,a,o){let s=e.bidiVisual===!0,c=(e,t)=>{let n=t===`left`?s?`end`:`start`:s?`start`:`end`;return{width:e?.[t]??e?.[n],edge:n}},l=(e,...t)=>{for(let n of t){let t=Uh(n.width,n.scope,n.edge??e);if(t!==null)return t}return null},u=c(r,`left`),d=c(i,`left`),f=c(a,`left`),p=c(o,`left`),m=c(r,`right`),h=c(i,`right`),g=c(a,`right`),_=c(o,`right`),v=e=>!n&&e!=null&&Number.isFinite(e)?e:null;return{top:l(`top`,{width:r?.top,scope:`cell`})??v(t.marginTop)??l(`top`,{width:i?.top,scope:`exception`},{width:a?.top,scope:`table`},{width:o?.top,scope:`style`})??e.cellMarginTop,bottom:l(`bottom`,{width:r?.bottom,scope:`cell`})??v(t.marginBottom)??l(`bottom`,{width:i?.bottom,scope:`exception`},{width:a?.bottom,scope:`table`},{width:o?.bottom,scope:`style`})??e.cellMarginBottom,left:l(u.edge,{...u,scope:`cell`})??v(t.marginLeft)??l(d.edge,{...d,scope:`exception`},{...f,scope:`table`},{...p,scope:`style`})??e.cellMarginLeft,right:l(m.edge,{...m,scope:`cell`})??v(t.marginRight)??l(h.edge,{...h,scope:`exception`},{...g,scope:`table`},{..._,scope:`style`})??e.cellMarginRight}}function Gh(e){if(!e)return null;let t=e.indent?Fh(e.indent):null;return{preferredWidthAuthored:e.preferredWidth!=null,preferredWidth:Ih(e.preferredWidth),layout:e.layout?.kind===`fixed`||e.layout?.kind===`autofit`?e.layout.kind:null,justification:e.justification,indentAuthored:e.indent!=null&&(t===`dxa`||t===`nil`),indentPt:t===`nil`?0:Lh(e.indent),borders:e.borders}}function Kh(e){let t=kh.get(e);if(t)return t;let n=Ah(e),r=n.table?.ordinaryFlow??e.tblpPr==null,i=e.rows.map((t,r)=>{let i=n.rows[r]?.row??null,a=i?.exception??null;return{height:i?.height?Bh(i.height):Vh(t),cantSplit:t.cantSplit===!0,repeatedHeader:t.isHeader===!0,cellSpacingPt:Hh(i?.cellSpacing,a?.cellSpacing,n.table?.cellSpacing,i?.styleCellSpacing)??0,justification:i?.justification??a?.justification??null,exception:Gh(a),cells:t.cells.map((t,o)=>({marginsPt:Wh(e,t,n.rows[r]?.cells[o]!==null&&n.rows[r]?.cells[o]!==void 0,n.rows[r]?.cells[o]?.margins,a?.cellMargins,n.table?.cellMargins,i?.styleCellMargins)}))}}),a=Zc({effectiveStyleId:n.table?.effectiveStyleId??null,ordinaryFlow:r,logicalSequenceId:n.table?.logicalSequenceId??null,logicalRowOffset:n.table?.logicalRowOffset??0,logicalTotalRows:n.table?.logicalTotalRows??0,positioning:r||e.tblpPr==null?null:Nh(e.tblpPr),rows:i,firstRowException:i[0]?.exception??null},`DOCX table format input`);return kh.set(e,a),a}function qh(e){return Object.freeze(e.map(e=>{if(e.type!==`table`)return Object.freeze({element:e,table:null});let t=Kh(e);return t.logicalSequenceId==null?Object.freeze({element:e,table:null}):Object.freeze({element:e,table:Object.freeze({logicalSequenceId:t.logicalSequenceId,logicalRowOffset:t.logicalRowOffset??0,logicalTotalRows:t.logicalTotalRows??0,rowCount:e.rows.length})})}))}const Jh=e=>Object.freeze({story:`body`,storyInstance:`body`,path:Object.freeze([e])}),Yh=new Set([`paragraph`,`line`,`character`]);function Xh(e,t,n){if(e.type!==`shape`&&e.type!==`image`&&e.type!==`chart`||vg(e)!==void 0||!fd(e.wrapMode)||e.type!==`shape`&&!e.anchor||e.widthPt<=0||e.heightPt<=0)return null;let r=e.anchorXRelativeFrom??(e.anchorXFromMargin?`margin`:`page`),i=e.anchorYRelativeFrom??(e.anchorYFromPara?`paragraph`:`page`),a=`${t.story}:${t.storyInstance}:${t.path.join(`.`)}`;return Object.freeze({occurrenceId:e.type===`shape`?`public-shape:${a}:${n}`:`public-anchor:${a}:${n}`,pageOwned:!Yh.has(r)&&!Yh.has(i)})}function Zh(e,t){let n=new Set([`paragraph`,`line`,`character`]),r=Object.freeze([...new Set(bh(e).flatMap((e,r)=>{let i=e;if(e.type!==`shape`&&e.type!==`image`&&e.type!==`chart`&&i.type!==`unavailableDrawing`)return[];let a=vg(i);if(!a){let e=i.type===`unavailableDrawing`?null:Xh(i,t,r);return e?.pageOwned?[e.occurrenceId]:[]}return a.horizontal.relativeFromStatus!==`valid`||a.vertical.relativeFromStatus!==`valid`||a.horizontal.relativeFrom===null||a.vertical.relativeFrom===null||a.wrap.kind===`none`||n.has(a.horizontal.relativeFrom)||n.has(a.vertical.relativeFrom)?[]:[Jc(t,a.occurrenceId)]}))]);return Object.freeze({kind:`paragraph`,source:t,pageBreakBefore:e.pageBreakBefore===!0,keepLines:e.keepLines===!0,keepNext:e.keepNext===!0,widowControl:e.widowControl!==!1,spaceBeforePt:e.spaceBefore??0,spaceAfterPt:e.spaceAfter??0,contextualSpacing:e.contextualSpacing===!0,styleId:e.styleId??null,inkless:!xh(e)&&ah(e),...r.length===0?{}:{pageOwnedAnchorOccurrenceIds:r}})}function Qh(e){return Object.freeze({kind:`table`,source:e})}function $h(e,t){let n=0;return Object.freeze(Hm(qh(e)).map(e=>{if(e.kind===`adjacent-table-group`){let t=n;return n+=e.tables.length,Object.freeze({kind:`adjacent-table-group`,logicalSequenceId:e.logicalSequenceId,source:Jh(t),tables:Object.freeze(e.tables.map((e,n)=>Object.freeze({...Qh(Jh(t+n)),rowCount:e.rows.length})))})}let r=e.element,i=n,a=Jh(i);if(n+=1,r.type===`paragraph`)return r.markVanish===!0&&!xh(r)&&ah(r)?Object.freeze({kind:`consume-source`,source:a,reason:`hidden-paragraph`}):Object.freeze({kind:`body-block`,block:Zh(r,a)});if(r.type===`table`)return Object.freeze({kind:`body-block`,block:Qh(a)});if(r.type===`pageBreak`||r.type===`columnBreak`)return Object.freeze({kind:`authored-break`,source:a,break:r.type===`pageBreak`?`page`:`column`,...r.type===`pageBreak`&&r.parity!==void 0?{parity:r.parity}:{},...r.type===`pageBreak`&&r.sameParagraphAsPrevious===!0?{sameSourceParagraphAsPrevious:!0}:{}});if(r.type===`sectionBreak`)return Object.freeze({kind:`begin-section`,source:a,section:t(i)});throw Error(`Unsupported body layout source at ${i}`)}))}function eg(e){return e.widthPt==null?e.widthPct==null?null:{kind:`pct`,value:e.widthPct/5e3}:{kind:`dxa`,value:e.widthPt}}function tg(e,t,n,r){let i=r?.preferredWidth??null;if(r?.preferredWidthAuthored)return i?.kind===`dxa`?i.value>0?i.value:null:i?.kind===`pct`&&i.value>0?i.value*n:null;let a=Ih(t.table?.preferredWidth);return a?.kind===`dxa`?a.value>0?a.value:null:a?.kind===`pct`?a.value>0?a.value*n:null:e.widthPt!=null&&e.widthPt>0?e.widthPt:e.widthPct!=null&&e.widthPct>0?e.widthPct/5e3*n:null}const ng=Object.freeze({pt:`1/1`,in:`72/1`,cm:`3600/127`,mm:`360/127`,pc:`12/1`,pi:`12/1`});function rg(e){let t=e.replace(/[\\u0009\\u000a\\u000d\\u0020]+/g,` `).replace(/^ | $/g,``),n=/^([+-]?)([0-9]+)$/.exec(t);if(!n)return null;let[,r,i]=n;if(r===`-`&&/[1-9]/.test(i))return null;let a=i.replace(/^0+/,``)||`0`;return a.length>20||a.length===20&&a>`18446744073709551615`?null:t}function ig(e){let t=dl(e);return Number.isFinite(t)?{key:e,widthPt:t}:og}function ag(e,t){let n=Number(e);if(!Number.isFinite(n))return og;let r=cl(n),i=r===null?0:dl(pl(r,t));return Number.isFinite(i)?{key:null,widthPt:i}:og}const og={key:`0/1`,widthPt:0};function sg(e){if(e==null)return og;let t=rg(e);if(t!==null){let e=sl(t);return e===null?og:ig(hl(e,20n))}let n=/^([0-9]+(?:\\.[0-9]+)?)(mm|cm|in|pt|pc|pi)$/.exec(e);if(!n)return og;let r=ng[n[2]],i=sl(n[1]);return i===null?ag(n[1],r):ig(pl(i,r))}function cg(e,t){let n=t.table?.grid;if(!n){let t=e.colWidths.map(e=>Number.isFinite(e)&&e>=0?{widthPt:e,key:cl(e)??`0/1`}:og);return{widthsPt:t.map(e=>e.widthPt),widthKeys:t.map(e=>e.key)}}let r=Math.max(n.requiredColumnCount,n.columns.length),i=Array.from({length:r},(e,t)=>sg(n.columns[t]?.width??null));return{widthsPt:i.map(e=>e.widthPt),widthKeys:i.map(e=>e.key)}}function lg(e,t){let n=Ih(e);return n?.kind===`pct`?{kind:`dxa`,value:Math.max(0,n.value)*Math.max(0,t)}:n}function ug(e,t,n,r=t){let i=Ah(e),a=Kh(e),{widthsPt:o,widthKeys:s}=cg(e,i),c=a.firstRowException?.layout===`fixed`?`fixed`:i.table?.layout?.kind??e.layout,l=i.table?.grid.authored?i.table.grid.columns.length:null,u=e.rows.map(e=>{let t=Math.max(0,e.gridBefore??0);return l!==null&&t>l?0:t}),d=Math.max(l??0,i.table?.grid.requiredColumnCount??0,...e.rows.map((e,t)=>(u[t]??0)+e.cells.reduce((e,t)=>e+Math.max(1,t.colSpan),0)));return{layout:c===`fixed`?`fixed`:`autofit`,availableWidthPt:Math.max(0,r),gridWidthsPt:o,gridWidthKeys:s,tablePreferredWidthPt:tg(e,i,t,a.firstRowException),rows:e.rows.map((e,r)=>{let s=i.rows[r],f=u[r]??0,p=Math.max(0,e.gridAfter??0),m=f+e.cells.reduce((e,t)=>e+Math.max(1,t.colSpan),0),h=l!==null&&m+p>d?0:p,g=f;return{before:f>0?{columnSpan:f,preferredWidth:lg(s?.row?.beforeWidth,t)}:null,after:h>0?{columnSpan:h,preferredWidth:lg(s?.row?.afterWidth,t)}:null,cells:e.cells.map((e,t)=>{let i=s?.cells[t]??null,l=Math.max(1,e.colSpan),u=c===`fixed`?{minWidthPt:0,maxWidthPt:0}:n(e),d=vl(a.rows[r]?.cellSpacingPt??0,g,l,o.length),f=d.startPt+d.endPt,p={columnStart:g,columnSpan:l,preferredWidth:Ih(i?.preferredWidth)??eg(e),minContentWidthPt:Math.max(0,u.minWidthPt)+f,maxContentWidthPt:Math.max(u.minWidthPt,u.maxWidthPt)+f};return g+=l,p})}})}}function dg(e,t,n){if(!t||typeof t!=`object`)return;let r=Dh.get(e);r||(r=new WeakMap,Dh.set(e,r)),r.set(t,n)}function fg(e){let t=new Map,n=0;e.body.forEach((e,r)=>{if(e.type!==`sectionBreak`)return;let i=e.__sectionPlacement;t.set(r,Zc({sectionId:i?.sectionId??`section:${n}`,sectionBidi:i?.sectionBidi===!0,vAlign:i?.vAlign??null,lineNumbering:i?.lineNumbering??null,docGridType:i?.docGridType??null,docGridLinePitch:i?.docGridLinePitch??null,docGridCharSpace:i?.docGridCharSpace??null,gutterPt:i?.gutterPt??null,rtlGutter:i?.rtlGutter??null,pageBordersAuthored:i?.pageBordersAuthored??!1,pageBorders:i?.pageBorders??null,pageGeometry:i?.pageGeometry??e.geom??{}},`DOCX ending-section placement input`)),n+=1});let r=e.section?.__sectionPlacement;return Object.freeze({endingSections:t,finalSection:Zc({sectionId:r?.sectionId??`section:${n}`,sectionBidi:r?.sectionBidi===!0,vAlign:r?.vAlign??e.section?.vAlign??null,lineNumbering:r?.lineNumbering??e.section?.lineNumbering??null,docGridType:r?.docGridType??e.section?.docGridType??null,docGridLinePitch:r?.docGridLinePitch??e.section?.docGridLinePitch??null,docGridCharSpace:r?.docGridCharSpace??e.section?.docGridCharSpace??null,gutterPt:r?.gutterPt??null,rtlGutter:r?.rtlGutter??null,pageBordersAuthored:r?.pageBordersAuthored??e.section?.pageBorders!=null,pageBorders:r?.pageBorders??e.section?.pageBorders??null,pageGeometry:r?.pageGeometry??(e.section?Rm(e.section):{})},`DOCX final-section placement input`)})}const pg=Object.freeze({default:null,first:null,even:null});function mg(e){let t=[],n=fg(e),r=0;e.body.forEach((e,i)=>{if(e.type!==`sectionBreak`)return;let a=n.endingSections.get(i)??n.finalSection,o=t.length;t.push({sectionOccurrenceId:a.sectionId,ordinal:o,startBodyIndex:r,endBodyIndex:i,markerBodyIndex:i,final:!1,startType:e.kind??`nextPage`,columns:e.columns??null,authoredGeometry:wh(a.pageGeometry),textDirection:e.textDirection??null,pageNumType:e.pageNumType??null,headers:e.headers??pg,footers:e.footers??pg,titlePage:e.titlePage??!1,sectionBidi:a.sectionBidi,vAlign:a.vAlign,lineNumbering:a.lineNumbering,docGridType:a.docGridType,docGridLinePitch:a.docGridLinePitch,docGridCharSpace:a.docGridCharSpace,authoredGutterPt:a.gutterPt,rtlGutter:a.rtlGutter===!0,pageBordersAuthored:a.pageBordersAuthored,pageBorders:a.pageBorders,placement:Th(a)}),r=i+1});let i=n.finalSection;t.push({sectionOccurrenceId:i.sectionId,ordinal:t.length,startBodyIndex:r,endBodyIndex:e.body.length-1,markerBodyIndex:null,final:!0,startType:e.section.sectionStart??`nextPage`,columns:e.section.columns??null,authoredGeometry:i.pageGeometry==null?Rm(e.section):wh(i.pageGeometry),textDirection:e.section.textDirection??null,pageNumType:e.section.pageNumType??null,headers:e.headers??pg,footers:e.footers??pg,titlePage:e.section.titlePage,sectionBidi:i.sectionBidi,vAlign:i.vAlign,lineNumbering:i.lineNumbering,docGridType:i.docGridType,docGridLinePitch:i.docGridLinePitch,docGridCharSpace:i.docGridCharSpace,authoredGutterPt:i.gutterPt,rtlGutter:i.rtlGutter===!0,pageBordersAuthored:i.pageBordersAuthored,pageBorders:i.pageBorders,placement:Th(i)});let a=Array(t.length),o=Rm(e.section),s=null,c=null;for(let e=t.length-1;e>=0;--e){let n=t[e],r=n.startType===`continuous`&&s!==null?s:o,i=n.authoredGeometry,l={pageWidth:i.pageWidth??r.pageWidth,pageHeight:i.pageHeight??r.pageHeight,marginTop:i.marginTop??r.marginTop,marginRight:i.marginRight??r.marginRight,marginBottom:i.marginBottom??r.marginBottom,marginLeft:i.marginLeft??r.marginLeft,headerDistance:i.headerDistance??r.headerDistance,footerDistance:i.footerDistance??r.footerDistance},u=n.authoredGutterPt??(n.startType===`continuous`?c:null)??0,{authoredGeometry:d,authoredGutterPt:f,...p}=n;a[e]={...p,geometry:l,gutterPt:u},s=l,c=u}return Zc({bodyLength:e.body.length,occurrences:a},`DOCX body section index input`)}function hg(e){let t=mg(e),n=new Map;for(let e of t.occurrences)e.startBodyIndex!==0&&n.set(e.startBodyIndex-1,e);let r=$h(e.body,e=>{let t=n.get(e);if(!t)throw Error(`Missing incoming body section at ${e}`);return Object.freeze({sectionOccurrenceId:t.sectionOccurrenceId,startType:t.startType})});return Zc({sectionIndex:t,evenAndOddHeaders:e.section.evenAndOddHeaders,endnoteIds:(e.endnotes??[]).map(e=>e.id),noteLayoutSettings:Ch(e),pageLayoutSettings:Sh(e),parserDiagnostics:Wd(e.diagnostics,e.body.length),sequence:r},`DOCX body layout acquisition input`)}function gg(e){let t=e.textPath;if(t)return Zc({string:t.string,...t.fontFamily===void 0?{}:{fontFamily:t.fontFamily},bold:t.bold??!1,italic:t.italic??!1,...t.textPathOk===void 0?{}:{textPathOk:t.textPathOk},...t.on===void 0?{}:{on:t.on},...t.fitShape===void 0?{}:{fitShape:t.fitShape},...t.fitPath===void 0?{}:{fitPath:t.fitPath},...t.trim===void 0?{}:{trim:t.trim},...t.xScale===void 0?{}:{xScale:t.xScale},...t.fontSizePt===void 0?{}:{fontSizePt:t.fontSizePt}},`DOCX VML text path acquisition input`)}function _g(e){let t=e.textBoxContent;if(t!==void 0)return Zc(t,`DOCX text box content acquisition input`)}function vg(e){let t=e.__anchorAcquisition;if(t!==void 0)return Zc(t,`DOCX anchor acquisition input`)}function yg(e,t){let n=wg(e).fontFacts,r=n?.rtl===!0||n?.cs===!0,i=r?n?.fontSizeCs??n?.fontSize??t:n?.fontSize??t,a=n?.fontFamily??e.fontFamily??null,o={ascii:a,highAnsi:n?.fontFamilyHighAnsi??a,eastAsia:n?.fontFamilyEastAsia??e.fontFamilyEastAsia??a,complexScript:n?.fontFamilyCs??a},s=n?.fontSlots;return Object.freeze({fontSizePt:i,fonts:Object.freeze({...s?.direct??o}),themeFonts:s?.theme?Object.freeze({...s.theme}):void 0,themeFontPresence:s?.themePresent?Object.freeze({...s.themePresent}):void 0,weight:(r?n?.boldCs??!1:n?.bold??!1)?700:400,style:(r?n?.italicCs??!1:n?.italic??!1)?`italic`:`normal`,complexScript:r,fontHint:n?.fontHint,eastAsiaLanguage:n?.langEastAsia,kerning:n?.kerning==null?void 0:i>=n.kerning})}function bg(e,t){let n=_g(e);return n===void 0?Zc({kind:`compatibility`,source:t,paragraphs:tl(e,t,yg)},`DOCX public text box acquisition input`):Zc({kind:`complete`,source:t,blocks:n},`DOCX complete text box acquisition input`)}function xg(e){let t=Tg(e).paragraphMarkFontFacts;if(!t)return;let n=t.rtl===!0||t.cs===!0,r=e.runs.find(e=>e.type===`text`||e.type===`field`)?.fontSize??e.defaultFontSize??10,i=n?t.fontSizeCs??t.fontSize??r:t.fontSize??r,a=t.fontFamily??e.defaultFontFamily??null,o={ascii:a,highAnsi:t.fontFamilyHighAnsi??a,eastAsia:t.fontFamilyEastAsia??e.defaultFontFamilyEastAsia??a,complexScript:t.fontFamilyCs??a};return Object.freeze({fontSizePt:i,fonts:Object.freeze({...t.fontSlots?.direct??o}),themeFonts:t.fontSlots?.theme?Object.freeze({...t.fontSlots.theme}):void 0,themeFontPresence:t.fontSlots?.themePresent?Object.freeze({...t.fontSlots.themePresent}):void 0,weight:(n?t.boldCs??!1:t.bold??!1)?700:400,style:(n?t.italicCs??!1:t.italic??!1)?`italic`:`normal`,complexScript:n,fontHint:t.fontHint,eastAsiaLanguage:t.langEastAsia,kerning:t.kerning==null?void 0:i>=t.kerning})}function Sg(e,t){let{layoutLines:n,lineSlice:r,__paragraphTypographyAcquisition:i,__complexFieldBoundaries:a,...o}=e,s=$c(e),c=e.__complexFieldBoundaries?.map(e=>({occurrenceKey:[`complex-field`,t.story,t.storyInstance,t.path.slice(0,-1).join(`.`),String(e.occurrenceId)].join(`:`),boundary:e.boundary,runIndex:e.runIndex,fieldType:e.fieldType,instruction:e.instruction,...e.hyperlinkAnchor===void 0?{}:{hyperlinkAnchor:e.hyperlinkAnchor}})),l=structuredClone(o),u=yh(e),d=[];if(u.length===0)l.runs.forEach((t,n)=>{d.push({run:t,originalRun:e.runs[n]})});else{let t=0;for(let n=0;n<=l.runs.length;n+=1){for(;u[t]?.publicRunIndex===n;){let e=u[t].run;d.push({run:structuredClone(e),originalRun:e}),t+=1}n<l.runs.length&&d.push({run:l.runs[n],originalRun:e.runs[n]})}}let f=d.map(({run:e,originalRun:n},r)=>{let i=e;if(i.type===`unavailableDrawing`){let e=vg(n),r=e===void 0?void 0:Zc({...e,occurrenceId:Jc(t,e.occurrenceId)},`DOCX scoped unavailable drawing anchor acquisition input`),{__anchorAcquisition:a,...o}=i;return Object.freeze({...o,...r===void 0?{}:{anchorAcquisitionInput:r}})}if(e.type===`math`){let n=Object.freeze({...t,path:Object.freeze([...t.path,r])}),i=e;return Object.freeze({...e,source:i.source??n,resourceKey:i.resourceKey??qc(n,e.display?`display`:`inline`)})}if(e.type===`anchorHost`){let{__anchorOccurrenceId:n,...r}=e;return Object.freeze({...r,...n===void 0?{}:{anchorOccurrenceId:Jc(t,n)}})}if(e.type===`shape`||e.type===`image`||e.type===`chart`){let i=vg(n),a=i===void 0?void 0:Zc({...i,occurrenceId:Jc(t,i.occurrenceId)},`DOCX scoped anchor acquisition input`),{__anchorAcquisition:o,...s}=e;if(e.type!==`shape`)return Object.freeze({...s,...a===void 0?{}:{anchorAcquisitionInput:a}});let c=n,l=gg(c),u=Object.freeze({...t,path:Object.freeze([...t.path,r])}),d=bg(c,{story:`textbox`,storyInstance:`${u.story}:${u.storyInstance}:${u.path.join(`.`)}`,path:[]});return Object.freeze({...s,...l===void 0?{}:{vmlTextPathInput:l},...(d.kind===`complete`?d.blocks.length:d.paragraphs.length)===0?{}:{textBoxInput:d},...a===void 0?{}:{anchorAcquisitionInput:a}})}if(e.type===`text`||e.type===`field`){let t=Qc(n),{__typographyAcquisition:r,...i}=e;return Object.freeze({...i,...t===void 0?{}:{typographyInput:t}})}return Object.freeze({...e})});return Xc({...l,runs:f,...c?.length?{complexFieldBoundaries:c}:{},numberingMarkerShapeInput:e.numbering?yg(e.numbering,e.runs.find(e=>e.type===`text`||e.type===`field`)?.fontSize??e.defaultFontSize??10):void 0,paragraphMarkShapeInput:xg(e),...s===void 0?{}:{typographyInput:s}})}function Cg(e){let t=[],n=(e,i,a,o)=>{if(e.type===`paragraph`){let r=!1,s=[],c=[],l=e.runs.some(e=>e.type===`unavailableDrawing`);bh(e).forEach((e,u)=>{if(e.type===`unavailableDrawing`){c.push(Object.freeze({publicRunIndex:s.length,run:Zc(e,`DOCX unavailable drawing parser sidecar`)})),l&&(r=!0);return}if(e.type===`math`){r=!0;let n=Object.freeze({story:i,storyInstance:a,path:Object.freeze([...o,u])}),c=qc(n,e.display?`display`:`inline`);t.push(Object.freeze({nodes:e.nodes,display:e.display,source:n,resourceKey:c})),s.push(Object.freeze({...e,source:n,resourceKey:c}));return}if(e.type!==`shape`){s.push(e);return}let d=e.textBoxContent;if(d===void 0){s.push(e);return}let f={story:i,storyInstance:a,path:[...o,u]},p=`${f.story}:${f.storyInstance}:${f.path.join(`.`)}`,m=!1,h=d.map((e,t)=>{if(e.type===`unsupportedTextBoxBlock`)return e;let r=n(e,`textbox`,p,[t]);return r!==e&&(m=!0),r});if(!m){s.push(e);return}r=!0,s.push({...e,textBoxContent:h})});let u=r?{...e,runs:s}:e;return c.length>0&&vh.set(u,Object.freeze(c)),u}if(e.type===`table`){let t=!1,n=e.rows.map((e,n)=>{let s=!1,c=e.cells.map((e,t)=>{let c=r(e.content,i,a,[...o,n,t]);return c===e.content?e:(s=!0,{...e,content:c})});return s?(t=!0,{...e,cells:c}):e});return t?{...e,rows:n}:e}if(e.type!==`sectionBreak`)return e;let s=o.at(-1)??0,c=!1,l=(e,t)=>{if(!e)return e;let n=e;for(let i of[`default`,`first`,`even`]){let a=e[i];if(!a)continue;let o=r(a.body,t,`section:${s}:${i}`);o!==a.body&&(n===e&&(n={...e}),n[i]={...a,body:o},c=!0)}return n},u=l(e.headers,`header`),d=l(e.footers,`footer`);return c?{...e,headers:u,footers:d}:e},r=(e,t,r,i=[])=>{let a=!1,o=e.map((e,o)=>{let s=n(e,t,r,[...i,o]);return s!==e&&(a=!0),s});return a?o:e},i=(e,t)=>{let n=e;for(let i of[`default`,`first`,`even`]){let a=e[i];if(!a)continue;let o=r(a.body,t,i);o!==a.body&&(n===e&&(n={...e}),n[i]={...a,body:o})}return n},a=r(e.body,`body`,`body`),o=i(e.headers,`header`),s=i(e.footers,`footer`),c=(e,t)=>{if(!e)return e;let n=!1,i=e.map(e=>{let i=r(e.content,t,e.id);return i===e.content?e:(n=!0,{...e,content:i})});return n?i:e},l=c(e.footnotes,`footnote`),u=c(e.endnotes,`endnote`),d=a!==e.body||o!==e.headers||s!==e.footers||l!==e.footnotes||u!==e.endnotes?{...e,body:a,headers:o,footers:s,footnotes:l,endnotes:u}:e,f=fg(d);Eh.set(d,f),dg(d.body,d.section,f);let p,m=()=>p??=hg(d),h=Og();return Object.freeze({document:d,mathOccurrences:Object.freeze(t),fontFamilyCharsets:Object.freeze({...Eg(d).fontFamilyCharsets??{}}),get bodyLayoutInput(){return ih(m())},bodyModelGateway:Object.freeze({acquisitionInputs:h,get bodySectionIndex(){return m().sectionIndex},effectiveTablePositioning:Mh,publicAnchorBridge:Xh})})}function wg(e){return e}function Tg(e){return e}function Eg(e){return e}const Dg=Object.freeze({numberingMarkerShapeInput:yg,paragraphMarkShapeInput:xg,tableFormatInput:Kh,tableColumnLayoutInput:ug,tableParticipatesInOrdinaryFlow:jh,paragraphAcquisitionInput:Sg});function Og(){let e=new WeakMap,t=(t,n)=>{let r=e.get(t);r||(r=new Map,e.set(t,r));let i=Wc(n),a=r.get(i);if(a)return a;let o=Sg(t,n);return r.set(i,o),o};return Object.freeze({...Dg,paragraphAcquisitionInput:t})}function kg(e){return Cg(e)}function Ag(e){return[...Cg(e).mathOccurrences]}function jg(e,t){if(!Number.isFinite(e)||e<0)throw RangeError(`${t} must be finite and non-negative`);return e}function Mg(e){let t=[...e].map(e=>Object.freeze({resourceKey:e.resourceKey,widthPt:jg(e.widthPt,`widthPt`),heightPt:jg(e.heightPt,`heightPt`),mimeType:e.mimeType})).sort((e,t)=>e.resourceKey.localeCompare(t.resourceKey)),n=new Map(t.map(({resourceKey:e,...t})=>[e,Object.freeze(t)]));if(n.size!==t.length)throw Error(`Duplicate image resource key`);return Object.freeze({fingerprint:Uc(`images`,t),resolve(e){let t=n.get(e);if(!t)throw Error(`Unknown image resource: ${e}`);return t}})}function Ng(e){let t=[...e].map(e=>Object.freeze({resourceKey:e.resourceKey,widthEm:jg(e.widthEm,`widthEm`),ascentEm:jg(e.ascentEm,`ascentEm`),descentEm:jg(e.descentEm,`descentEm`),diagnostics:Object.freeze(e.diagnostics.map(e=>Object.freeze({...e}))),...e.available===!1?{available:!1}:{}})).sort((e,t)=>e.resourceKey.localeCompare(t.resourceKey)),n=new Map(t.map(e=>[e.resourceKey,e]));if(n.size!==t.length)throw Error(`Duplicate math resource key`);return Object.freeze({fingerprint:Uc(`math`,t),resolve(e){let t=n.get(e);if(!t)throw Error(`Unknown math resource: ${e}`);return t}})}function Pg(e,t,n){let r=[],i=(e,t,n,i,a)=>{r.push({resourceKey:Kc(e,t),widthPt:i,heightPt:a,mimeType:n})},a=(e,t)=>{if(e.type===`image`){i(t,e.imagePath,e.mimeType,e.widthPt,e.heightPt);return}e.type===`shape`&&e.textBlocks?.forEach((e,n)=>{!e.imagePath||!e.mimeType||e.imageWidthPt==null||e.imageHeightPt==null||i({story:`textbox`,storyInstance:`${t.story}:${t.storyInstance}:${t.path.join(`.`)}`,path:[n,0]},e.imagePath,e.mimeType,e.imageWidthPt,e.imageHeightPt)})},o=(e,t,n,r)=>{e.rows.forEach((e,i)=>e.cells.forEach((e,a)=>{s(e.content,t,n,[...r,i,a])}))},s=(e,r,c,l=[])=>{e.forEach((e,u)=>{let d=[...l,u];if(e.type===`paragraph`){let o=e.numbering;if(o?.picBulletImagePath&&o.picBulletMimeType){let n=t?.(e),a=o.picBulletWidthPt??n?.widthPt,s=o.picBulletHeightPt??n?.heightPt;a!=null&&s!=null&&i({story:r,storyInstance:c,path:d},o.picBulletImagePath,o.picBulletMimeType,a,s)}let s={story:r,storyInstance:c,path:d};(n?.paragraphAcquisitionInput(e,s).runs??e.runs).forEach((e,t)=>{(e.type===`image`||e.type===`shape`)&&a(e,{...s,path:[...d,t]})})}else e.type===`table`&&o(e,r,c,d);if(e.type===`sectionBreak`)for(let t of[`default`,`first`,`even`]){let n=e.headers?.[t],r=e.footers?.[t];n&&s(n.body,`header`,`section:${u}:${t}`),r&&s(r.body,`footer`,`section:${u}:${t}`)}})};s(e.body,`body`,`body`);for(let t of[`default`,`first`,`even`]){let n=e.headers[t],r=e.footers[t];n&&s(n.body,`header`,t),r&&s(r.body,`footer`,t)}for(let t of e.footnotes??[])s(t.content,`footnote`,t.id);for(let t of e.endnotes??[])s(t.content,`endnote`,t.id);return r}function Fg(e){let t=new Map(e),n=Object.freeze([...t.keys()].sort());return Object.freeze({keys:n,resolve(e){let n=t.get(e);if(n===void 0)throw Error(`Unknown runtime resource: ${e}`);return n}})}const Ig=new WeakMap,Lg=new WeakMap,Rg=new WeakMap,zg=new WeakMap,Bg=new WeakMap,Vg=new WeakMap;function Hg(){let e=new WeakMap,t=new WeakMap,n=1;return Object.freeze({objectIdentity(t){let r=e.get(t);return r===void 0&&(r=n,n+=1,e.set(t,r)),r},get(e,n){return t.get(e)?.get(n)},set(e,n,r){let i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}})}function Ug(e,t){let n=[e.text,e.images,e.math],r=new Set(n.flatMap(e=>{let t=Lg.get(e);return t?[t]:[]}));if(r.size>1)throw Error(`Layout services combine foreign runtime owners`);let i=r.values().next().value,a=n.filter(e=>!Lg.has(e));if(i&&a.length>1)throw Error(`Layout services are missing service lineage for multiple components`);if(!i&&!t)return;let o=i??{};for(let e of n){let t=Lg.get(e);if(t&&t!==o)throw Error(`Layout services combine foreign runtime owners`);Lg.set(e,o)}return o}function Wg(e,t){let n=Ug(e,!0);if(Rg.has(n))throw Error(`Body layout kernel is already attached`);Rg.set(n,t)}function Gg(e){let t=Ug(e,!1);return t?Rg.get(t):void 0}function Kg(e,t){let n=Ug(e,!0);if(zg.has(n))throw Error(`Vertical glyph measurement service is already attached`);zg.set(n,t)}function qg(e){let t=Ug(e,!1),n=t?zg.get(t):void 0;if(!n)throw Error(`Vertical glyph measurement service is not attached`);return n}function Jg(e,t){if(Bg.has(e))throw Error(`Layout variant store is already attached`);Bg.set(e,t)}function Yg(e){return Bg.get(e)}function Xg(e,t,n=t.keys()){if(Ig.has(e))throw Error(`Private resource lookup is already attached`);let r=new Set(t.keys()),i=new Set(n),a=[...i].filter(e=>!r.has(e)).sort(),o=[...r].filter(e=>!i.has(e)).sort();if(a.length>0||o.length>0)throw Error(`Runtime resource membership mismatch: missing [${a.join(`, `)}]; extra [${o.join(`, `)}]`);Ig.set(e,Fg(t))}function Zg(e){return Ig.get(e)}const Qg=new WeakMap,$g=new WeakMap;function e_(e,t={}){let n=Object.freeze({...e,...t}),r=Gg(e);if(!r)throw Error(`Body layout kernel is not attached to the supplied services`);if(Gg(n)!==r)throw Error(`Layout service view did not retain its body layout kernel owner`);let i=Ig.get(e);i&&Ig.set(n,i);let a=Qg.get(e);a&&Qg.set(n,a);let o=Vg.get(e);return o&&Vg.set(n,o),n}function t_(e){let t=e_(e);return Vg.set(t,Hg()),t}function n_(e){return Vg.get(e)}function r_(e,t){if(!Number.isInteger(t.totalPages)||t.totalPages<1)throw RangeError(`Field acquisition totalPages must be a positive integer`);let n=e_(e);return $g.set(n,Object.freeze({...t})),n}function i_(e){return $g.get(e)??Object.freeze({totalPages:1})}function a_(e,t){if(Qg.has(e))throw Error(`Paint resource registry is already attached`);Qg.set(e,t)}function o_(e){let t=Qg.get(e);if(!t)throw Error(`Paint resource registry is not attached`);return t}const s_=[`background`,`behindText`,`header`,`body`,`notes`,`front`,`footer`],c_=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0});function l_(e){return Object.freeze({kind:`clip`,clip:e})}function u_(e,t){return Object.freeze({kind:`transform`,transform:Object.freeze({...c_,e,f:t})})}function d_(e,t){if(!t.textBoxIds?.length)return Object.freeze([]);let n=new Map(e.textBoxes.map(e=>[e.id,e]));return Object.freeze(t.textBoxIds.flatMap(e=>{let t=n.get(e);return t?[t]:[]}))}function f_(e,t,n,r,i){if(e.kind===`drawing`){if(!e.anchorLayer)return;i.push(Object.freeze({drawing:e,textBoxes:Object.freeze([]),frames:Object.freeze([...n]),layoutTranslationPt:Object.freeze({...r}),encounterOrder:i.length,root:t}));return}if(e.kind!==`textbox`){if(e.kind===`note`){let a=e.story.clipBounds?Object.freeze([...n,l_(e.story.clipBounds)]):n;for(let n of e.story.blocks)f_(n,t,a,r,i);return}if(e.kind===`paragraph`){let a=e.clipBounds?Object.freeze([...n,l_(e.clipBounds)]):n;for(let n of e.drawings)n.anchorLayer&&i.push(Object.freeze({drawing:n,owner:e,textBoxes:d_(e,n),frames:Object.freeze([...a]),layoutTranslationPt:Object.freeze({...r}),encounterOrder:i.length,root:t}));return}h_(e,t,n,r,i)}}function p_(e,t,n,r,i,a){let o=t.xPt-e.flowBounds.xPt,s=t.yPt-e.flowBounds.yPt;f_(e,n,Object.freeze([...r,u_(o,s)]),Object.freeze({xPt:i.xPt+o,yPt:i.yPt+s}),a)}function m_(e,t,n,r,i){p_(e.child,{xPt:e.xPt-r.xPt,yPt:e.yPt-r.yPt},t,n,r,i)}function h_(e,t,n,r,i){let a=e.clipBounds?Object.freeze([...n,l_(e.clipBounds)]):n;for(let n of e.rows)for(let e of n.cells){let n=`visualMergeOwnership`in e&&e.visualMergeOwnership===`continuation`;if(e.verticalMerge===`continue`&&!n)continue;let o=e.clipBounds?Object.freeze([...a,l_(e.clipBounds)]):a;for(let n of e.blocks)p_(n.layout,{xPt:e.contentBounds.xPt+(n.layout.kind===`table`?n.layout.flowBounds.xPt:0),yPt:e.flowBounds.yPt+n.offsetPt+(n.layout.kind===`table`?n.layout.flowBounds.yPt:0)},t,o,r,i)}for(let n of e.resolvedFloatingTables??[])m_(n,t,a,r,i)}function g_(e){let t=e.drawing.anchorLayer;return Object.freeze({kind:`drawing`,layer:t.behindDoc?`behindText`:`front`,sourceLayer:e.root.layer,rootNodeId:e.root.node.id,coordinateSpace:e.root.coordinateSpace,flowDomainId:e.root.node.flowDomainId,node:e.drawing,...e.owner?{ownerNodeId:e.owner.id}:{},textBoxes:e.textBoxes,frames:e.frames,layoutTranslationPt:e.layoutTranslationPt})}function __(e,t){return Object.freeze({kind:`node`,layer:e.layer,sourceLayer:e.layer,rootNodeId:e.node.id,coordinateSpace:e.coordinateSpace,flowDomainId:e.node.flowDomainId,node:e.node,omitAnchoredDrawings:t})}function v_(e,t){return e.drawing.anchorLayer.relativeHeight-t.drawing.anchorLayer.relativeHeight||e.drawing.anchorLayer.sourceOrder-t.drawing.anchorLayer.sourceOrder||e.encounterOrder-t.encounterOrder}function y_(e){let t=[];for(let n of e)f_(n.node,n,Object.freeze([]),Object.freeze({xPt:0,yPt:0}),t);let n=t.filter(({drawing:e})=>e.anchorLayer.behindDoc).sort(v_).map(g_),r=t.filter(({drawing:e})=>!e.anchorLayer.behindDoc).sort(v_).map(g_),i=new Set(t.map(({root:e})=>e.node)),a=e.flatMap(e=>e.node.kind===`drawing`&&e.node.anchorLayer?[]:[__(e,i.has(e.node))]);return Object.freeze([...n,...a,...r])}function b_(e,t){return t.has(e)||(t.add(e),e.kind===`drawing`)?!1:e.kind===`paragraph`?e.lines.some(e=>e.placements.some(e=>e.kind===`text`&&e.paintOps?.some(e=>e.verticalFeature===!0)===!0))||e.textBoxes.some(e=>b_(e,t)):e.kind===`textbox`||e.kind===`note`?e.story.blocks.some(e=>b_(e,t)):e.rows.some(e=>e.cells.some(e=>e.blocks.some(e=>b_(e.layout,t))))||(e.resolvedFloatingTables??[]).some(e=>b_(e.child,t))}function x_(e){let t=Object.freeze(e.map(({layer:e,node:t,coordinateSpace:n})=>Object.freeze({layer:e,node:t,coordinateSpace:n??`section-logical`}))),n=new Map(s_.map(e=>[e,[]]));for(let e of t)n.get(e.layer).push(e.node);let r=[];for(let e=0;e<t.length;){let n=t[e].layer,i=e+1;for(;t[i]?.layer===n;)i+=1;let a=t.slice(e,i);n===`header`||n===`body`||n===`notes`||n===`footer`?r.push(...y_(a)):r.push(...a.map(e=>__(e,!1))),e=i}let i=new Set;return Object.freeze({roots:t,paintOrder:Object.freeze(r),capabilities:Object.freeze({requiresElementBackedVerticalGlyphPaint:t.some(({node:e})=>b_(e,i))}),background:Object.freeze(n.get(`background`)),behindText:Object.freeze(n.get(`behindText`)),header:Object.freeze(n.get(`header`)),body:Object.freeze(n.get(`body`)),notes:Object.freeze(n.get(`notes`)),front:Object.freeze(n.get(`front`)),footer:Object.freeze(n.get(`footer`))})}var S_=class extends Error{constructor(e){super(e),this.name=`PageGraphError`}};const C_=x_;function w_(e,t,n){let r=new Map(n.map(e=>[e.id,e]));if(r.size!==n.length||n.length!==e[t].length)throw new S_(`Replacement ${t} layer must preserve unique paint node identities`);return C_(e.roots.map(e=>{if(e.layer!==t)return e;let n=r.get(e.node.id);if(!n)throw new S_(`Missing replacement paint node ${e.node.id}`);return{...e,node:n}}))}function T_(e){return e.layers.roots}function E_(e){let t=!1,n=!1;for(let r of e.layers.roots)if(r.layer===`body`){if(n)throw new S_(`Paint sequence must contain one contiguous body paint run; re-entered at ${r.node.id}`);t=!0}else t&&(n=!0);let r=new Map;for(let t of e.layers.roots){if(r.has(t.node.id))throw new S_(`Duplicate paint node ${t.node.id}`);r.set(t.node.id,t)}let i=new Map;for(let t of s_)for(let n of e.layers[t]){if(i.has(n.id))throw new S_(`Duplicate semantic page node ${n.id}`);i.set(n.id,{layer:t,node:n})}if(i.size!==r.size)throw new S_(`Semantic page layers do not match retained roots`);for(let[e,t]of r){let n=i.get(e);if(!n||n.layer!==t.layer||n.node!==t.node)throw new S_(`Paint root ${e} is not the retained ${t.layer} node`)}let a=new Set,o=new Set;for(let t of e.layers.paintOrder){let e=r.get(t.rootNodeId);if(!e)throw new S_(`Missing paint root ${t.rootNodeId}`);if(e.layer!==t.sourceLayer)throw new S_(`Paint root ${t.rootNodeId} belongs to ${e.layer}, not ${t.sourceLayer}`);if(a.add(t.rootNodeId),t.kind===`node`){if(t.node!==e.node||t.node.id!==t.rootNodeId)throw new S_(`Paint root ${t.rootNodeId} is not the retained ${t.sourceLayer} node`);continue}if(!t.node.anchorLayer)throw new S_(`Drawing paint entry ${t.node.id} is not anchored`);if(o.has(t.node.id))throw new S_(`Duplicate drawing paint reference ${t.node.id}`);o.add(t.node.id)}if(a.size!==r.size)throw new S_(`Missing paint-order reference for ${[...r.keys()].find(e=>!a.has(e))??`<unknown>`}`);return e.layers.roots.map(({node:e})=>e)}const D_=Object.freeze({story:`body`,storyInstance:`parse-error`,path:Object.freeze([])});function O_(e,t,n,r,i){let a=e.trim().split(/\\s+/).filter(Boolean),o=[],s=``,c=e=>r.shape({text:e,fontSizePt:n,fonts:{},genericFamily:`sans-serif`}).advancePt,l=e=>{let n=[0,...$o(e),e.length].filter((e,t,n)=>t===0||e!==n[t-1]),r=n.length-1;for(;r>0&&c(`${e.slice(0,n[r])}…`)>t;)--r;return`${e.slice(0,n[r]??0)}…`},u=()=>{o.length===0?o.push(l(``)):o[o.length-1]=l(o[o.length-1])},d=e=>{let n=[0,...$o(e),e.length].filter((e,t,n)=>t===0||e!==n[t-1]),r=0;for(;r<n.length-1;){if(o.length>=i)return u(),!0;let a=r+1;for(;a<n.length&&c(e.slice(n[r],n[a]))<=t;)a+=1;let s=Math.max(r+1,a-1),d=e.slice(n[r],n[s]);if(o.length>=i-1&&s<n.length-1)return o.push(l(d)),!0;o.push(d),r=s}return!1};for(let e=0;e<a.length;e+=1){let n=a[e],r=s?`${s} ${n}`:n,l=c(r);if(s&&l>t){if(o.push(s),s=``,o.length>=i){u();break}if(c(n)>t){if(d(n))break}else s=n}else if(!s&&l>t){if(d(n))break}else s=r;if(e<a.length-1&&o.length>=i&&!s){u();break}}return s&&o.length<i&&o.push(s),o}function k_(e,t,n){if(!(t.widthPt>0&&t.heightPt>0))throw RangeError(`Error page size must be positive`);let r=Math.max(18,Math.min(t.widthPt,t.heightPt)*.06),i={xPt:r,yPt:r,widthPt:t.widthPt-r*2,heightPt:t.heightPt-r*2},a=Math.max(8,Math.min(t.widthPt,t.heightPt)*.02),o=n.resolve({fonts:{},slot:`ascii`,genericFamily:`sans-serif`}).route,s=O_(e,t.widthPt-r*4,a,n,4),c=a*1.4,l=[{kind:`fill-rect`,rect:{xPt:0,yPt:0,widthPt:t.widthPt,heightPt:t.heightPt},fill:`#ffffff`},{kind:`stroke-rect`,rect:i,stroke:`#c8ccd2`,lineWidthPt:1,dashPt:[6,5]},{kind:`text`,rect:{xPt:0,yPt:t.heightPt*.27,widthPt:t.widthPt,heightPt:36},text:`⚠`,fill:`#b23b3b`,fontRoute:o,fontSizePt:28,fontWeight:400,fontStyle:`normal`,align:`center`,baseline:`middle`},{kind:`text`,rect:{xPt:r*2,yPt:t.heightPt*.4,widthPt:t.widthPt-r*4,heightPt:24},text:`This document could not be displayed`,fill:`#333333`,fontRoute:o,fontSizePt:13,fontWeight:600,fontStyle:`normal`,align:`center`,baseline:`middle`},...s.map((e,n)=>({kind:`text`,rect:{xPt:r*2,yPt:t.heightPt*.5+c*n,widthPt:t.widthPt-r*4,heightPt:c},text:e,fill:`#666666`,fontRoute:o,fontSizePt:a,fontWeight:400,fontStyle:`normal`,align:`center`,baseline:`middle`}))],u={kind:`drawing`,id:`parse-error-page`,source:D_,flowDomainId:`parse-error`,flowBounds:i,inkBounds:i,advancePt:i.heightPt,ordinaryFlow:!1,commands:l},d={geometry:{pageWidth:t.widthPt,pageHeight:t.heightPt,marginTop:r,marginRight:r,marginBottom:r,marginLeft:r,headerDistance:0,footerDistance:0},columns:[{xPt:r,wPt:i.widthPt}],columnSeparator:!1,grid:{kind:`none`,linePitchPt:null,charSpacePt:null},textDirection:`lrTb`,verticalAlignment:`top`};return{pages:[{pageIndex:0,geometry:{xPt:0,yPt:0,widthPt:t.widthPt,heightPt:t.heightPt,contentTopPt:r,contentBottomPt:t.heightPt-r},flowDomains:[{id:`parse-error`,kind:`body`,logicalBounds:i,physicalBounds:i}],section:d,sectionOccurrenceId:`parse-error-section`,pageBorder:null,parityBlank:!1,bookmarkStarts:[],pageNumber:{displayNumber:1,format:`decimal`,sectionOccurrenceId:`parse-error-section`},columnSeparators:[],sectionRegions:[{id:`parse-error-region`,sectionOccurrenceId:`parse-error-section`,coordinateSpace:{writingMode:`horizontal-tb`,logicalToPhysical:{a:1,b:0,c:0,d:1,e:0,f:0},physicalToLogical:{a:1,b:0,c:0,d:1,e:0,f:0}},blockStartPt:r,blockEndPt:t.heightPt-r,columnFlowDirection:`ltr`,columnIndexes:[0],flowDomainIds:[`parse-error`],section:d}],layers:C_([{layer:`body`,node:u}]),readingOrder:[u.id]}],diagnostics:[{code:`UNSUPPORTED_FEATURE`,severity:`error`,source:D_,message:e}]}}function A_(e,t){let n=e==null?t:typeof e==`number`?e:e.getTime();if(!Number.isFinite(n))throw RangeError(`currentDate must resolve to finite epoch milliseconds`);return Object.freeze({currentDateMs:n})}function j_(e){return A_(e.currentDate,e.defaultCurrentDateMs)}function M_(e,t){return Uc(`layout`,{currentDateMs:e.currentDateMs,text:t.text.fingerprint,images:t.images.fingerprint,math:t.math.fingerprint,verticalGlyphs:t.verticalGlyphFingerprint??null})}function N_(e){switch(e){case`tb`:case`tbV`:case`lrTb`:case`lrTbV`:return`horizontal-tb`;case`rl`:case`rlV`:case`tbRl`:case`tbRlV`:return`vertical-rl`;case`btLr`:return`vertical-rl`;case`lr`:case`lrV`:case`tbLrV`:return`vertical-lr`;default:throw RangeError(`Unsupported Transitional text direction ${JSON.stringify(e)}`)}}function P_(e){if(!Number.isFinite(e.widthPt)||!Number.isFinite(e.heightPt)||e.widthPt<=0||e.heightPt<=0)throw RangeError(`Physical page extents must be positive and finite`)}function F_(e){if(!Number.isFinite(e.xPt)||!Number.isFinite(e.yPt))throw RangeError(`Point coordinates must be finite`)}function I_(e){if(![e.a,e.b,e.c,e.d,e.e,e.f].every(Number.isFinite))throw RangeError(`Matrix coefficients must be finite`)}function L_(e){if(F_(e),!Number.isFinite(e.widthPt)||!Number.isFinite(e.heightPt)||e.widthPt<0||e.heightPt<0)throw RangeError(`Rectangle extents must be finite and non-negative`)}function R_(e,t){switch(P_(e),t){case`horizontal-tb`:return{widthPt:e.widthPt,heightPt:e.heightPt};case`vertical-rl`:case`vertical-lr`:return{widthPt:e.heightPt,heightPt:e.widthPt};default:throw RangeError(`Unsupported writing mode ${String(t)}`)}}function z_(e,t){switch(P_(e),t){case`horizontal-tb`:return{widthPt:e.widthPt,heightPt:e.heightPt};case`vertical-rl`:case`vertical-lr`:return{widthPt:e.heightPt,heightPt:e.widthPt};default:throw RangeError(`Unsupported writing mode ${String(t)}`)}}function B_(e,t){switch(P_(t),e){case`horizontal-tb`:return{a:1,b:0,c:0,d:1,e:0,f:0};case`vertical-rl`:return{a:0,b:1,c:-1,d:0,e:t.widthPt,f:0};case`vertical-lr`:return{a:0,b:1,c:1,d:0,e:0,f:0};default:throw RangeError(`Unsupported writing mode ${String(e)}`)}}function V_(e,t){switch(P_(t),e){case`horizontal-tb`:return{a:1,b:0,c:0,d:1,e:0,f:0};case`vertical-rl`:return{a:0,b:-1,c:1,d:0,e:0,f:t.widthPt};case`vertical-lr`:return{a:0,b:1,c:1,d:0,e:0,f:0};default:throw RangeError(`Unsupported writing mode ${String(e)}`)}}function H_(e,t){return I_(e),F_(t),{xPt:e.a*t.xPt+e.c*t.yPt+e.e,yPt:e.b*t.xPt+e.d*t.yPt+e.f}}function U_(e,t){L_(t);let n=[H_(e,t),H_(e,{xPt:t.xPt+t.widthPt,yPt:t.yPt}),H_(e,{xPt:t.xPt,yPt:t.yPt+t.heightPt}),H_(e,{xPt:t.xPt+t.widthPt,yPt:t.yPt+t.heightPt})],r=n.map(({xPt:e})=>e),i=n.map(({yPt:e})=>e),a=Math.min(...r),o=Math.min(...i);return{xPt:a,yPt:o,widthPt:Math.max(...r)-a,heightPt:Math.max(...i)-o}}function W_(e,t){I_(e);let n=H_(e,{xPt:0,yPt:0}),r={top:{xPt:0,yPt:-1},right:{xPt:1,yPt:0},bottom:{xPt:0,yPt:1},left:{xPt:-1,yPt:0}},i={},a=new Set;for(let o of[`top`,`right`,`bottom`,`left`]){let s=H_(e,r[o]),c=s.xPt-n.xPt,l=s.yPt-n.yPt,u=l===0&&c!==0?c>0?`right`:`left`:c===0&&l!==0?l>0?`bottom`:`top`:null;if(u===null||a.has(u))throw RangeError(`Edge transforms require a non-degenerate axis-aligned matrix`);i[u]=t[o],a.add(u)}if(a.size!==4)throw RangeError(`Edge transform must map every physical edge exactly once`);return i}function G_(e,t){return{writingMode:e,logicalToPhysical:B_(e,t),physicalToLogical:V_(e,t)}}function K_(e){return Object.freeze(e)}function q_(e){let t=[];for(let n of e){let{columns:e,columnSeparator:r}=n.section;if(!r||e.length<2||n.blockEndPt<=n.blockStartPt)continue;let i=new Set(n.columnIndexes),a=n.columnFlowDirection===`rtl`?e.map((e,t)=>t).reverse():e.map((e,t)=>t);for(let r=0;r<a.length-1;r+=1){let o=a[r];if(!i.has(o))continue;let s=a[r+1],c=Math.min(o,s),l=Math.max(o,s),u=e[c],d=e[l],f=(u.xPt+u.wPt+d.xPt)/2;t.push(Object.freeze({start:K_(H_(n.coordinateSpace.logicalToPhysical,{xPt:f,yPt:n.blockStartPt})),end:K_(H_(n.coordinateSpace.logicalToPhysical,{xPt:f,yPt:n.blockEndPt}))}))}}return Object.freeze(t)}function J_(e,t){let n=nt(e,t);return Object.freeze({authoredStyle:e,style:e===`double`?`double`:n.length>0?`dashed`:e.includes(`wave`)?`wavy`:`solid`,dashPatternPt:Object.freeze(n)})}function Y_(e,t){switch(e.display){case`firstPage`:return t;case`notFirstPage`:return!t;default:return!0}}function X_(e){return e!==void 0&&/^[0-9a-fA-F]{6}$/.test(e)?`#${e}`:`#000000`}function Z_(e){return e!==void 0&&Number.isFinite(e.space)?e.space:0}function Q_(e,t,n,r){let i=Number.isFinite(e.width)?e.width:.5;return Object.freeze({edge:t,from:Object.freeze(n),to:Object.freeze(r),color:X_(e.color),widthPt:i,...J_(e.style,i)})}function $_(e,t,n,r){if(!e||!Y_(e,r))return null;let{geometry:i}=t,a=e.offsetFrom===`text`,o=a?i.marginLeft:0,s=a?i.pageWidth-i.marginRight:i.pageWidth,c=a?Mm(i.marginTop):0,l=a?i.pageHeight-Mm(i.marginBottom):i.pageHeight,u=c+Z_(e.top),d=l-Z_(e.bottom),f=o+Z_(e.left),p=s-Z_(e.right),m=[];if(e.top&&m.push(Q_(e.top,`top`,{xPt:f,yPt:u},{xPt:p,yPt:u})),e.bottom&&m.push(Q_(e.bottom,`bottom`,{xPt:f,yPt:d},{xPt:p,yPt:d})),e.left&&m.push(Q_(e.left,`left`,{xPt:f,yPt:u},{xPt:f,yPt:d})),e.right&&m.push(Q_(e.right,`right`,{xPt:p,yPt:u},{xPt:p,yPt:d})),m.length===0)return null;let h=G_(N_(t.textDirection),n);return Object.freeze({zOrder:e.zOrder===`back`?`back`:`front`,logicalToPhysical:Object.freeze({...h.logicalToPhysical}),segments:Object.freeze(m)})}function ev(e,t,n){return`page:${e}:region:${encodeURIComponent(t)}:column:${n}`}function tv(e){return nv(e),{xPt:0,yPt:0,widthPt:e.widthPt,heightPt:e.heightPt,contentTopPt:e.contentTopPt,contentBottomPt:e.contentBottomPt}}function nv(e){if(!Number.isFinite(e.widthPt)||!Number.isFinite(e.heightPt)||!Number.isFinite(e.contentTopPt)||!Number.isFinite(e.contentBottomPt)||e.widthPt<=0||e.heightPt<=0||e.contentTopPt<0||e.contentTopPt>e.contentBottomPt||e.contentBottomPt>e.heightPt)throw RangeError(`Effective page edges must satisfy 0 <= contentTopPt <= contentBottomPt <= heightPt`)}function rv(e,t){if(e.length===0)throw RangeError(`${t} must not be empty`)}function iv(e,t){if(e&&t===void 0)throw RangeError(`Page-border finalization requires explicit section-owned page identity`);return t??!1}function av(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&e.xPt===r.xPt&&e.wPt===r.wPt})}function ov(e,t){return e===t||e!==void 0&&t!==void 0&&e.start===t.start&&e.countBy===t.countBy&&e.distance===t.distance&&e.restart===t.restart}function sv(e,t){return e.geometry.pageWidth===t.geometry.pageWidth&&e.geometry.pageHeight===t.geometry.pageHeight&&e.geometry.marginTop===t.geometry.marginTop&&e.geometry.marginRight===t.geometry.marginRight&&e.geometry.marginBottom===t.geometry.marginBottom&&e.geometry.marginLeft===t.geometry.marginLeft&&e.geometry.headerDistance===t.geometry.headerDistance&&e.geometry.footerDistance===t.geometry.footerDistance&&av(e.columns,t.columns)&&e.columnSeparator===t.columnSeparator&&e.textDirection===t.textDirection&&e.sectionBidi===!0==(t.sectionBidi===!0)&&e.grid.kind===t.grid.kind&&e.grid.linePitchPt===t.grid.linePitchPt&&e.grid.charSpacePt===t.grid.charSpacePt&&e.verticalAlignment===t.verticalAlignment&&ov(e.lineNumbering,t.lineNumbering)}function cv(e){if(N_(e.section.textDirection)!==e.writingMode)throw RangeError(`Section region writing mode must agree with its section text direction`);let t=e.section.sectionBidi===!0?`rtl`:`ltr`;if(e.columnFlowDirection!==void 0&&e.columnFlowDirection!==t)throw RangeError(`Section region column flow direction must agree with sectPr bidi`);let n=e.columnIndexes??e.section.columns.map((e,t)=>t);if(e.columns.length!==n.length||n.some((t,r)=>!Number.isInteger(t)||t<0||t>=e.section.columns.length||r>0&&t<=n[r-1])||e.columns.some((t,r)=>{let i=e.section.columns[n[r]];return i===void 0||t.inlineStartPt!==i.xPt||t.inlineExtentPt!==i.wPt}))throw RangeError(`Section region columns must equal its normalized section columns`)}function lv(e){if(!Number.isInteger(e)||e<0)throw RangeError(`Layout page index must be a non-negative integer`)}function uv(e,t,n){let r=[],i=[],a=new Map,o=new Set,s=new Set,c,l=[];for(let u of n){if(rv(u.id,`Section region id`),rv(u.sectionOccurrenceId,`Section occurrence id`),o.has(u.id)||s.has(u.sectionOccurrenceId))throw RangeError(`Section region and occurrence identities must be unique`);if(o.add(u.id),s.add(u.sectionOccurrenceId),c!==void 0&&c!==u.writingMode)throw RangeError(`One physical page cannot mix writing modes`);c=u.writingMode,cv(u);let n=z_({widthPt:u.section.geometry.pageWidth,heightPt:u.section.geometry.pageHeight},u.writingMode);if(n.widthPt!==t.widthPt||n.heightPt!==t.heightPt)throw RangeError(`Section regions on one physical page must use the same page box: expected ${n.widthPt}x${n.heightPt}, got ${t.widthPt}x${t.heightPt}`);let d=R_(t,u.writingMode),f=d.widthPt,p=d.heightPt;if(!Number.isFinite(u.blockStartPt)||!Number.isFinite(u.blockEndPt)||u.blockStartPt<0||u.blockEndPt<u.blockStartPt||u.blockEndPt>p)throw RangeError(`Section regions must be inside the logical page`);if(u.columns.length===0)throw RangeError(`Section region must contain a column`);let m=u.columnIndexes??u.section.columns.map((e,t)=>t),h=0,g=G_(u.writingMode,t),_=u.columns.map((t,n)=>{let r=m[n];if(!Number.isFinite(t.inlineStartPt)||!Number.isFinite(t.inlineExtentPt)||t.inlineStartPt<0||t.inlineExtentPt<=0||t.inlineStartPt+t.inlineExtentPt>f||t.inlineStartPt<h)throw RangeError(`Columns must be ordered, disjoint, and inside the logical page`);h=t.inlineStartPt+t.inlineExtentPt;let o=ev(e,u.id,r);if(a.has(o))throw RangeError(`Duplicate flow domain ${o}`);let s={xPt:t.inlineStartPt,yPt:u.blockStartPt,widthPt:t.inlineExtentPt,heightPt:u.blockEndPt-u.blockStartPt},c=U_(g.logicalToPhysical,s);if(l.some(e=>c.xPt<e.xPt+e.widthPt&&e.xPt<c.xPt+c.widthPt&&c.yPt<e.yPt+e.heightPt&&e.yPt<c.yPt+c.heightPt))throw RangeError(`Section flow domains on one page must be physically disjoint`);return l.push(c),i.push({id:o,kind:`body`,logicalBounds:s,physicalBounds:c}),a.set(o,u.sectionOccurrenceId),o});r.push({id:u.id,sectionOccurrenceId:u.sectionOccurrenceId,coordinateSpace:g,blockStartPt:u.blockStartPt,blockEndPt:u.blockEndPt,columnFlowDirection:u.columnFlowDirection??(u.section.sectionBidi===!0?`rtl`:`ltr`),columnIndexes:Object.freeze([...m]),flowDomainIds:_,section:u.section})}return{regions:r,domains:i,sectionByDomain:a}}function dv(e,t){if(e.kind===`paragraph`){t(e),e.drawings.forEach(e=>dv(e,t)),e.textBoxes.forEach(e=>dv(e,t));return}if(e.kind===`table`){fv(e,t);return}e.kind===`textbox`&&pv(e,t)}function fv(e,t){for(let n of e.rows)for(let e of n.cells)for(let n of e.blocks)dv(n.layout,t)}function pv(e,t){e.story.blocks.forEach(e=>dv(e,t))}function mv(e,t,n){let r=[],i=new Set;for(let a of e){let e=n.get(a.flowDomainId)??t;dv(a,t=>{for(let n of t.bookmarkStarts??[])!n||i.has(n)||(i.add(n),r.push({name:n,nodeId:t.id,sectionOccurrenceId:e}))})}return r}function hv(e){lv(e.pageIndex),rv(e.sectionOccurrenceId,`Page-start section occurrence id`);let{regions:t,domains:n,sectionByDomain:r}=uv(e.pageIndex,e.physicalPage,e.sectionRegions),i=e.sectionRegions[0],a=i?.pageBorders??e.pageBorders;if(i!==void 0&&(e.sectionOccurrenceId!==i.sectionOccurrenceId||!sv(e.section,i.section)))throw RangeError(`Page-start section context must equal the first section region`);return{pageIndex:e.pageIndex,geometry:tv(e.physicalPage),flowDomains:n,section:e.section,sectionOccurrenceId:e.sectionOccurrenceId,parityBlank:!1,bookmarkStarts:mv(e.paint.map(({node:e})=>e),e.sectionOccurrenceId,r),pageNumber:e.pageNumber,sectionRegions:t,columnSeparators:q_(t),pageBorder:$_(a,e.section,e.physicalPage,iv(a,e.firstSectionOwnedPage)),layers:C_(e.paint),readingOrder:e.readingOrder.map(e=>e.id)}}function gv(e){return lv(e.pageIndex),rv(e.sectionOccurrenceId,`Page-start section occurrence id`),nv(e.physicalPage),Object.freeze({...e,sectionRegions:Object.freeze([]),paint:Object.freeze([]),readingOrder:Object.freeze([])})}function _v(e,t){return Object.freeze({...e,sectionRegions:Object.freeze([...e.sectionRegions,t])})}function vv(e,t,n){return Object.freeze({...e,paint:Object.freeze([...e.paint,t]),readingOrder:n?Object.freeze([...e.readingOrder,t.node]):e.readingOrder})}function yv(e,t,n){return hv({...e,pageNumber:t,firstSectionOwnedPage:n})}function bv(e){return lv(e.pageIndex),rv(e.sectionOccurrenceId,`Page-start section occurrence id`),{pageIndex:e.pageIndex,geometry:tv(e.physicalPage),flowDomains:[],section:e.section,sectionOccurrenceId:e.sectionOccurrenceId,parityBlank:!0,bookmarkStarts:[],pageNumber:e.pageNumber,sectionRegions:[],columnSeparators:[],pageBorder:$_(e.pageBorders,e.section,e.physicalPage,iv(e.pageBorders,e.firstSectionOwnedPage)),layers:C_([]),readingOrder:[]}}function xv(e){if(e.length===0)return null;let t=Math.min(...e.map(e=>e.xPt)),n=Math.min(...e.map(e=>e.yPt)),r=Math.max(...e.map(e=>e.xPt+e.widthPt)),i=Math.max(...e.map(e=>e.yPt+e.heightPt));return{xPt:t,yPt:n,widthPt:r-t,heightPt:i-n}}const Sv={FLOW_OVERLAP:!0,BOTTOM_MARGIN_INVASION:!0,FLOW_DOMAIN_INVASION:!0,INVALID_REFERENCE:!0,INVALID_GEOMETRY:!0,INVALID_VALUE:!0,MISSING_RESOURCE:!0,NON_CONVERGENCE:!0,UNSUPPORTED_FEATURE:!0},Cv={body:!0,header:!0,footer:!0,footnote:!0,endnote:!0,textbox:!0},wv=new Set(Object.keys(Sv)),Tv=new Set(Object.keys(Cv));function Ev(e,t,n=new WeakSet){if(!(e===null||typeof e==`string`||typeof e==`boolean`)){if(typeof e==`number`){if(!Number.isFinite(e))throw new Z(`INVALID_GEOMETRY`,`${t} is not finite`);return}if(typeof e!=`object`)throw new Z(`INVALID_GEOMETRY`,`${t} contains ${typeof e}`);if(n.has(e))throw new Z(`INVALID_GEOMETRY`,`${t} contains a cycle`);n.add(e);try{if(Array.isArray(e)){let r=0;for(let i of Reflect.ownKeys(e)){if(i===`length`)continue;if(typeof i!=`string`)throw new Z(`INVALID_GEOMETRY`,`${t} has a symbol key`);let a=Number(i);if(!Number.isInteger(a)||a<0||String(a)!==i||a>=e.length)throw new Z(`INVALID_GEOMETRY`,`${t}.${i} is not an array index`);let o=Object.getOwnPropertyDescriptor(e,i);if(!o?.enumerable||!(`value`in o))throw new Z(`INVALID_GEOMETRY`,`${t}[${i}] is not plain data`);Ev(o.value,`${t}[${i}]`,n),r+=1}if(r!==e.length)throw new Z(`INVALID_GEOMETRY`,`${t} is sparse`);return}let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)throw new Z(`INVALID_GEOMETRY`,`${t} is not a plain record`);for(let r of Reflect.ownKeys(e)){if(typeof r!=`string`)throw new Z(`INVALID_GEOMETRY`,`${t} has a symbol key`);let i=Object.getOwnPropertyDescriptor(e,r);if(!i?.enumerable||!(`value`in i))throw new Z(`INVALID_GEOMETRY`,`${t}.${r} is not plain data`);Ev(i.value,`${t}.${r}`,n)}}finally{n.delete(e)}}}function Dv(e,t){if(!Number.isFinite(e))throw new Z(`INVALID_GEOMETRY`,`${t} is not finite`)}function Ov(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function kv(e,t){if(!Ov(e))throw new Z(`INVALID_GEOMETRY`,`${t} is not a point`);Dv(e.xPt,`${t}.xPt`),Dv(e.yPt,`${t}.yPt`)}function Av(e,t){if(kv(e,t),Dv(e.widthPt,`${t}.widthPt`),Dv(e.heightPt,`${t}.heightPt`),e.widthPt<0||e.heightPt<0)throw new Z(`INVALID_GEOMETRY`,`${t} has a negative extent`)}function jv(e,t){if(!Ov(e))throw new Z(`INVALID_GEOMETRY`,`${t} is not a matrix`);for(let n of[`a`,`b`,`c`,`d`,`e`,`f`])Dv(e[n],`${t}.${n}`)}function Mv(e,t){if(e!==`horizontal-tb`&&e!==`vertical-rl`&&e!==`vertical-lr`)throw new Z(`INVALID_GEOMETRY`,`${t} is unsupported`)}function Nv(e,t){if(!Ov(e))throw new Z(`INVALID_GEOMETRY`,`${t} is not a coordinate space`);Mv(e.writingMode,`${t}.writingMode`),jv(e.logicalToPhysical,`${t}.logicalToPhysical`),jv(e.physicalToLogical,`${t}.physicalToLogical`)}function Pv(e,t){let{plan:n}=e;if(Ev(n,`${t}.plan`),Dv(n.rect.x,`${t}.plan.rect.x`),Dv(n.rect.y,`${t}.plan.rect.y`),Dv(n.rect.w,`${t}.plan.rect.w`),Dv(n.rect.h,`${t}.plan.rect.h`),n.rect.w<0||n.rect.h<0)throw new Z(`INVALID_GEOMETRY`,`${t}.plan.rect has a negative extent`);if(Dv(n.transform.rotationDeg,`${t}.plan.transform.rotationDeg`),n.geometry.kind===`preset`){if(n.geometry.name.length===0)throw new Z(`INVALID_GEOMETRY`,`${t}.plan.geometry.name is empty`);n.geometry.adjustments.forEach((e,n)=>{e!==null&&Dv(e,`${t}.plan.geometry.adjustments[${n}]`)})}else n.geometry.subpaths.forEach((e,n)=>{e.forEach((e,r)=>{if(e.cmd.length===0)throw new Z(`INVALID_GEOMETRY`,`${t}.plan.geometry.subpaths[${n}][${r}].cmd is empty`)})});if(n.stroke&&(Dv(n.stroke.width,`${t}.plan.stroke.width`),n.stroke.width<0))throw new Z(`INVALID_GEOMETRY`,`${t}.plan.stroke.width is negative`)}function Fv(e,t){if(e<=t)return!0;let n=2**-52*Math.max(1,Math.abs(e),Math.abs(t));return e-t<=n}function Iv(e,t){return e<t&&!Fv(t,e)}function Lv(e,t){return Iv(e.xPt,t.xPt+t.widthPt)&&Iv(t.xPt,e.xPt+e.widthPt)&&Iv(e.yPt,t.yPt+t.heightPt)&&Iv(t.yPt,e.yPt+e.heightPt)}function Rv(e,t){return Fv(e.xPt,t.xPt)&&Fv(e.yPt,t.yPt)&&Fv(t.xPt+t.widthPt,e.xPt+e.widthPt)&&Fv(t.yPt+t.heightPt,e.yPt+e.heightPt)}function zv(e,t){return Fv(e.xPt,t.xPt)&&Fv(t.xPt+t.widthPt,e.xPt+e.widthPt)}function Bv(e,t,n){return Fv(e,n.yPt)&&Fv(n.yPt+n.heightPt,t)}function Vv(e,t){return Fv(e.yPt,t.yPt)&&Fv(t.yPt+t.heightPt,e.yPt+e.heightPt)}function Hv(e,t){return e.xPt===t.xPt&&e.yPt===t.yPt&&e.widthPt===t.widthPt&&e.heightPt===t.heightPt}function Uv(e,t){return e.a===t.a&&e.b===t.b&&e.c===t.c&&e.d===t.d&&e.e===t.e&&e.f===t.f}function Wv(e,t){let n=e.pageBorder;if(n===null)return;if(n.zOrder!==`front`&&n.zOrder!==`back`)throw new Z(`INVALID_REFERENCE`,`${t}.zOrder is invalid`);jv(n.logicalToPhysical,`${t}.logicalToPhysical`);let r=G_(N_(e.section.textDirection),e.geometry).logicalToPhysical;if(!Uv(n.logicalToPhysical,r))throw new Z(`INVALID_GEOMETRY`,`${t}.logicalToPhysical contradicts the page-start section`);if(!Array.isArray(n.segments)||n.segments.length===0)throw new Z(`INVALID_GEOMETRY`,`${t}.segments is empty`);n.segments.forEach((e,n)=>{let r=`${t}.segments[${n}]`;if(kv(e.from,`${r}.from`),kv(e.to,`${r}.to`),Dv(e.widthPt,`${r}.widthPt`),e.from.xPt!==e.to.xPt&&e.from.yPt!==e.to.yPt)throw new Z(`INVALID_GEOMETRY`,`${r} is not an axis-aligned page edge`);if(!/^#[0-9a-fA-F]{6}$/.test(e.color))throw new Z(`INVALID_REFERENCE`,`${r}.color is invalid`)})}function Gv(e,t,n){if(n.has(e))throw new Z(`INVALID_REFERENCE`,`duplicate retained node id ${e}`);n.add(e),t.add(e)}function Kv(e,t,n){if(Gv(e.id,t,n),e.kind===`paragraph`){e.drawings.forEach(e=>Kv(e,t,n)),e.textBoxes.forEach(e=>Kv(e,t,n));return}if(e.kind===`table`){e.rows.forEach(e=>{Gv(e.id,t,n),e.cells.forEach(e=>{Gv(e.id,t,n),e.blocks.forEach(e=>Kv(e.layout,t,n))})});return}if(e.kind===`note`){e.story.blocks.forEach(e=>Kv(e,t,n));return}e.kind===`textbox`&&e.story.blocks.forEach(e=>Kv(e,t,n))}function qv(e,t){if(e.kind===`paragraph`){let n=xv(e.drawings.filter(e=>e.anchorLayer?.cellContainment===!0).map(e=>e.flowBounds));if(e.cellContainmentBounds&&Av(e.cellContainmentBounds,`${t}.cellContainmentBounds`),n===null!=(e.cellContainmentBounds===void 0)||n&&e.cellContainmentBounds&&!Hv(n,e.cellContainmentBounds))throw new Z(`INVALID_GEOMETRY`,`${t}.cellContainmentBounds does not match its retained layoutInCell drawings`);let r=new Set;(e.anchorCollisions??[]).forEach((e,n)=>{let i=`${t}.anchorCollisions[${n}]`;if(e.occurrenceId.length===0||r.has(e.occurrenceId))throw new Z(`INVALID_REFERENCE`,`${i}.occurrenceId is empty or duplicated`);if(r.add(e.occurrenceId),Av(e.bounds,`${i}.bounds`),e.horizontalOwnership!==`page`&&e.horizontalOwnership!==`host`||e.verticalOwnership!==`page`&&e.verticalOwnership!==`host`)throw new Z(`INVALID_REFERENCE`,`${i} has invalid axis ownership`)}),e.textBoxes.forEach((e,n)=>qv(e,`${t}.textBoxes[${n}]`));return}if(e.kind===`table`){e.rows.forEach((e,n)=>e.cells.forEach((e,r)=>e.blocks.forEach((e,i)=>qv(e.layout,`${t}.rows[${n}].cells[${r}].blocks[${i}]`))));return}e.kind===`textbox`&&e.story.blocks.forEach((e,n)=>qv(e,`${t}.story.blocks[${n}]`))}function Jv(e,t){if(e.orientation===`upright-physical`&&!e.transform)throw new Z(`INVALID_GEOMETRY`,`${t} upright physical drawing is missing its logical transform`);if(e.transform)for(let n of[`a`,`b`,`c`,`d`,`e`,`f`])Dv(e.transform[n],`${t}.transform.${n}`);e.clip?.kind===`rect`&&Av(e.clip.rect,`${t}.clip.rect`),e.clip?.kind===`polygon`&&e.clip.points.forEach((e,n)=>kv(e,`${t}.clip.points[${n}]`)),e.commands.forEach((e,n)=>{let r=`${t}.commands[${n}]`;if(e.kind!==`noop`){if(e.kind===`drawingml-shape`){Pv(e,r);return}if(Av(e.rect,`${r}.rect`),e.kind===`stroke-rect`&&(Dv(e.lineWidthPt,`${r}.lineWidthPt`),e.dashPt.forEach((e,t)=>Dv(e,`${r}.dashPt[${t}]`))),e.kind===`text`&&(Dv(e.fontSizePt,`${r}.fontSizePt`),Dv(e.fontWeight,`${r}.fontWeight`)),e.kind===`watermark-text`){if(Av(e.sourceBounds,`${r}.sourceBounds`),e.sourceBounds.widthPt<=0||e.sourceBounds.heightPt<=0)throw new Z(`INVALID_GEOMETRY`,`${r}.sourceBounds must have positive extents`);if(Dv(e.opacity,`${r}.opacity`),Dv(e.rotationDeg,`${r}.rotationDeg`),Dv(e.fontSizePt,`${r}.fontSizePt`),e.opacity<0||e.opacity>1||e.fontSizePt<=0)throw new Z(`INVALID_GEOMETRY`,`${r} has invalid textPath paint metrics`);e.spans.forEach((e,t)=>{Dv(e.advancePt,`${r}.spans[${t}].advancePt`),Dv(e.fontWeight,`${r}.spans[${t}].fontWeight`)})}}})}function Yv(e){Ev(e,`layout`),e.diagnostics.forEach((e,t)=>{let n=`diagnostics[${t}]`;if(!wv.has(e.code))throw new Z(`INVALID_REFERENCE`,`${n}.code is unknown`);if(e.severity!==`warning`&&e.severity!==`error`)throw new Z(`INVALID_REFERENCE`,`${n}.severity is unknown`);if(typeof e.message!=`string`||e.message.length===0)throw new Z(`INVALID_REFERENCE`,`${n}.message is empty`);if(e.source!==void 0&&(!Tv.has(e.source.story)||typeof e.source.storyInstance!=`string`||e.source.storyInstance.length===0||!Array.isArray(e.source.path)||e.source.path.some(e=>!Number.isSafeInteger(e)||e<0)))throw new Z(`INVALID_REFERENCE`,`${n}.source is invalid`)});let t=new Set;e.pages.forEach((e,n)=>{if(!Number.isInteger(e.pageIndex)||e.pageIndex!==n)throw new Z(`INVALID_REFERENCE`,`pages[${n}] has invalid page index ${e.pageIndex}`);if(Av(e.geometry,`pages[${n}].geometry`),Dv(e.geometry.contentTopPt,`pages[${n}].geometry.contentTopPt`),Dv(e.geometry.contentBottomPt,`pages[${n}].geometry.contentBottomPt`),e.geometry.widthPt<=0||e.geometry.heightPt<=0||e.geometry.contentTopPt<0||e.geometry.contentTopPt>e.geometry.contentBottomPt||e.geometry.contentBottomPt>e.geometry.heightPt)throw new Z(`INVALID_GEOMETRY`,`pages[${n}] has invalid effective page edges`);Wv(e,`pages[${n}].pageBorder`);let r=new Map;if(e.flowDomains.forEach((e,t)=>{if(Av(e.logicalBounds,`pages[${n}].flowDomains[${t}].logicalBounds`),Av(e.physicalBounds,`pages[${n}].flowDomains[${t}].physicalBounds`),r.has(e.id))throw new Z(`INVALID_REFERENCE`,`duplicate flow domain ${e.id}`);r.set(e.id,e)}),e.parityBlank&&(e.flowDomains.length>0||(e.sectionRegions?.length??0)>0||(e.columnSeparators?.length??0)>0||T_(e).length>0||e.layers.roots.length>0||e.readingOrder.length>0||(e.bookmarkStarts?.length??0)>0))throw new Z(`INVALID_REFERENCE`,`pages[${n}] parity blank retains page content`);let i=new Set;if(e.sectionOccurrenceId!==void 0){if(e.sectionOccurrenceId.length===0)throw new Z(`INVALID_REFERENCE`,`pages[${n}] has an empty section occurrence id`);i.add(e.sectionOccurrenceId)}let a=new Map;if(e.sectionRegions){let t=new Set,o=new Set,s=new Map,c=[],l;if(e.sectionRegions.forEach((u,d)=>{let f=`pages[${n}].sectionRegions[${d}]`;if(u.id.length===0||t.has(u.id))throw new Z(`INVALID_REFERENCE`,`${f} has an invalid region id`);if(t.add(u.id),u.sectionOccurrenceId.length===0)throw new Z(`INVALID_REFERENCE`,`${f} has an empty section occurrence id`);if(o.has(u.sectionOccurrenceId))throw new Z(`INVALID_REFERENCE`,`${f} has a duplicate section occurrence id`);o.add(u.sectionOccurrenceId),i.add(u.sectionOccurrenceId),Nv(u.coordinateSpace,`${f}.coordinateSpace`);let p=u.coordinateSpace.writingMode;if(l!==void 0&&l!==p)throw new Z(`INVALID_GEOMETRY`,`${f} mixes coordinate systems on one physical page`);l=p;let m;try{m=N_(u.section.textDirection)}catch(e){throw new Z(`INVALID_GEOMETRY`,`${f}.section.textDirection is unsupported: ${e.message}`)}if(p!==m)throw new Z(`INVALID_GEOMETRY`,`${f} writing mode contradicts its section text direction`);let h=R_(e.geometry,p),g=z_({widthPt:u.section.geometry.pageWidth,heightPt:u.section.geometry.pageHeight},p);if(g.widthPt!==e.geometry.widthPt||g.heightPt!==e.geometry.heightPt)throw new Z(`INVALID_GEOMETRY`,`${f} section geometry does not match the upright physical page`);if(Dv(u.blockStartPt,`${f}.blockStartPt`),Dv(u.blockEndPt,`${f}.blockEndPt`),u.columnFlowDirection!==`ltr`&&u.columnFlowDirection!==`rtl`)throw new Z(`INVALID_GEOMETRY`,`${f} has an invalid column flow direction`);let _=u.section.sectionBidi===!0?`rtl`:`ltr`;if(u.columnFlowDirection!==_)throw new Z(`INVALID_GEOMETRY`,`${f} column flow direction contradicts its section bidi`);if(u.blockStartPt<0||u.blockEndPt<u.blockStartPt||u.blockEndPt>h.heightPt)throw new Z(`INVALID_GEOMETRY`,`${f} has an invalid block interval`);let v=G_(u.coordinateSpace.writingMode,e.geometry);if(!Uv(u.coordinateSpace.logicalToPhysical,v.logicalToPhysical)||!Uv(u.coordinateSpace.physicalToLogical,v.physicalToLogical))throw new Z(`INVALID_GEOMETRY`,`${f} has an invalid coordinate transform`);let y=u.columnIndexes;if(u.flowDomainIds.length!==y.length||y.some((e,t)=>!Number.isInteger(e)||e<0||e>=u.section.columns.length||t>0&&e<=y[t-1]))throw new Z(`INVALID_GEOMETRY`,`${f} columns contradict its section`);let b=0;u.flowDomainIds.forEach((t,n)=>{let i=r.get(t);if(!i)throw new Z(`INVALID_REFERENCE`,`${f} references missing flow domain ${t}`);if(i.kind!==`body`)throw new Z(`INVALID_REFERENCE`,`${f} owns non-body flow domain ${t}`);s.set(t,(s.get(t)??0)+1),a.set(t,u);let o=i.logicalBounds,l=u.section.columns[y[n]];if(o.widthPt<=0||o.heightPt<0||o.yPt!==u.blockStartPt||o.heightPt!==u.blockEndPt-u.blockStartPt||o.xPt<0||o.xPt<b||o.xPt+o.widthPt>h.widthPt||l===void 0||o.xPt!==l.xPt||o.widthPt!==l.wPt)throw new Z(`INVALID_GEOMETRY`,`${t} is not the section column's non-negative logical region`);if(b=o.xPt+o.widthPt,!Hv(U_(u.coordinateSpace.logicalToPhysical,i.logicalBounds),i.physicalBounds))throw new Z(`INVALID_GEOMETRY`,`${t} physical bounds do not match its section region transform`);if(!Rv(e.geometry,i.physicalBounds))throw new Z(`INVALID_GEOMETRY`,`${t} physical bounds leave the upright physical page`);if(c.some(e=>e.regionId!==u.id&&Lv(e.bounds,i.physicalBounds)))throw new Z(`INVALID_GEOMETRY`,`${t} overlaps a body flow domain owned by another section region`);c.push({regionId:u.id,bounds:i.physicalBounds})})}),e.flowDomains.filter(e=>e.kind===`body`).forEach(e=>{if(s.get(e.id)!==1)throw new Z(`INVALID_REFERENCE`,`${e.id} has invalid section region ownership`)}),!e.parityBlank&&e.sectionRegions.length>0){let t=e.sectionRegions[0];if(e.sectionOccurrenceId!==t.sectionOccurrenceId)throw new Z(`INVALID_REFERENCE`,`pages[${n}] page-start section occurrence does not match its first region`);if(!sv(e.section,t.section))throw new Z(`INVALID_GEOMETRY`,`pages[${n}] page-start section facts do not match its first region`)}}let o=q_(e.sectionRegions??[]);if(!Array.isArray(e.columnSeparators)||e.columnSeparators.length!==o.length||e.columnSeparators.some((e,t)=>{let n=o[t];return n===void 0||e.start.xPt!==n.start.xPt||e.start.yPt!==n.start.yPt||e.end.xPt!==n.end.xPt||e.end.yPt!==n.end.yPt}))throw new Z(`INVALID_GEOMETRY`,`pages[${n}].columnSeparators contradict the retained section regions`);let s=new Map(e.sectionRegions.map(e=>[e.id,e]));for(let t of e.flowDomains){if(t.kind!==`footnote`&&t.kind!==`endnote`)continue;let n=t.sectionRegionId?s.get(t.sectionRegionId):e.sectionRegions[0];if(!n)throw new Z(`INVALID_REFERENCE`,`${t.id} references missing page story region ${t.sectionRegionId??`<default>`}`);if(!Hv(U_(n.coordinateSpace.logicalToPhysical,t.logicalBounds),t.physicalBounds))throw new Z(`INVALID_GEOMETRY`,`${t.id} physical bounds do not match the page story transform`);a.set(t.id,n)}for(let t of e.flowDomains)if(!a.has(t.id)&&!Hv(t.logicalBounds,t.physicalBounds))throw new Z(`INVALID_GEOMETRY`,`${t.id} has unequal logical and physical bounds without a section region`);if(e.pageNumber){if(Dv(e.pageNumber.displayNumber,`pages[${n}].pageNumber.displayNumber`),!Number.isInteger(e.pageNumber.displayNumber))throw new Z(`INVALID_GEOMETRY`,`pages[${n}] page number is not an integer`);if(e.pageNumber.format.length===0||!i.has(e.pageNumber.sectionOccurrenceId))throw new Z(`INVALID_REFERENCE`,`pages[${n}] has an invalid page number section owner`)}let c=[];try{E_(e)}catch(e){throw e instanceof S_?new Z(`INVALID_REFERENCE`,e.message):e}let l=new Map,u=new Set;T_(e).forEach(({node:e},i)=>{let o=`pages[${n}].nodes[${i}]`;l.set(e.id,e),Kv(e,u,t),qv(e,o),Av(e.flowBounds,`${o}.flowBounds`),Av(e.inkBounds,`${o}.inkBounds`),e.clipBounds&&Av(e.clipBounds,`${o}.clipBounds`),Dv(e.advancePt,`${o}.advancePt`),e.kind===`drawing`&&Jv(e,o);let s=r.get(e.flowDomainId);if(!s)throw new Z(`INVALID_REFERENCE`,`${e.id} references missing flow domain ${e.flowDomainId}`);if(e.ordinaryFlow&&s.kind===`body`&&s.logicalBounds.heightPt===0)throw new Z(`FLOW_DOMAIN_INVASION`,`${e.id} claims ordinary flow in an empty body domain`);if(!e.ordinaryFlow)return;let d=s.kind===`body`?a.get(s.id):void 0;if(s.kind===`body`){if(!d)throw new Z(`INVALID_REFERENCE`,`${e.id} references a body flow domain without a section region`);if(e.flowBounds.yPt+e.flowBounds.heightPt>d.blockEndPt)throw new Z(`BOTTOM_MARGIN_INVASION`,`${e.id} crosses logical block end`)}if(!(d?Bv(d.blockStartPt,d.blockEndPt,e.flowBounds)&&(e.kind===`table`||zv(s.logicalBounds,e.flowBounds)):e.kind===`table`?Vv(s.logicalBounds,e.flowBounds):Rv(s.logicalBounds,e.flowBounds)))throw new Z(`FLOW_DOMAIN_INVASION`,`${e.id} crosses flow domain ${s.id}`);c.push(e)});let d=new Set;if(e.readingOrder.forEach(e=>{if(!l.has(e)||d.has(e))throw new Z(`INVALID_REFERENCE`,`invalid reading-order reference ${e}`);d.add(e)}),e.bookmarkStarts!==void 0){let t=new Map([...a].map(([e,t])=>[e,t.sectionOccurrenceId])),r=mv(E_(e),e.sectionOccurrenceId??``,t),o=r.every(e=>e.sectionOccurrenceId.length>0&&i.has(e.sectionOccurrenceId)),s=e.bookmarkStarts.length===r.length&&e.bookmarkStarts.every((e,t)=>{let n=r[t];return n!==void 0&&e.name===n.name&&e.nodeId===n.nodeId&&e.sectionOccurrenceId===n.sectionOccurrenceId});if(!o||!s)throw new Z(`INVALID_REFERENCE`,`pages[${n}] bookmark metadata does not match its retained graph (invalid bookmark node or ownership)`)}for(let e=0;e<c.length;e+=1)for(let t=e+1;t<c.length;t+=1){let n=c[e],i=c[t];if(!n||!i)continue;let a=r.get(n.flowDomainId),o=r.get(i.flowDomainId),s=n.flowDomainId===i.flowDomainId,l=a?.kind===`body`&&(o?.kind===`footnote`||o?.kind===`endnote`)||o?.kind===`body`&&(a?.kind===`footnote`||a?.kind===`endnote`),u=a?.id!==o?.id&&(a?.kind===`footnote`||a?.kind===`endnote`)&&(o?.kind===`footnote`||o?.kind===`endnote`);if((s||l||u)&&Lv(n.flowBounds,i.flowBounds))throw new Z(`FLOW_OVERLAP`,`${n.id} overlaps ${i.id}`)}})}function Xv(e){try{Yv(e)}catch(e){throw e instanceof Z?e:e instanceof TypeError||e instanceof RangeError?new Z(`INVALID_GEOMETRY`,e.message):e}}function Zv(e,t){if(typeof e!=`object`||!e||t.has(e))return e;t.add(e);for(let n of Object.values(e))Zv(n,t);return Object.freeze(e)}const Qv=new WeakSet,$v=new WeakSet;function ey(e){if(Qv.has(e))return e;let t=Zv(e,new WeakSet);return Qv.add(t),t}function ty(e){return Qv.has(e)?e:(Ev(e,`layout`),ey(e))}function ny(e){if($v.has(e))return e;Xv(e);let t=ey(e);return $v.add(t),t}function ry(e,t){if(!Number.isInteger(t)||t<0||t>=e.pages.length)throw RangeError(`Page index ${t} out of range (count: ${e.pages.length})`);return e.pages[t]}var iy=class{#e;#t;#n=new Map;#r;#i;#a=null;constructor(e,t,n){this.#e=e,this.#r=Object.freeze({...t}),this.#i=M_(this.#r,this.#e),this.#t=n}get defaultLayout(){return this.layoutFor(this.#r)}layoutFor(e){return this.select(e).layout}select(e){let t=Object.isFrozen(e)?e:Object.freeze({...e}),n=M_(t,this.#e),r=this.#n.get(n);return r||(r=ty(this.#t(t)),n!==this.#i&&(this.#a!==null&&this.#a!==n&&this.#n.delete(this.#a),this.#a=n),this.#n.set(n,r)),Object.freeze({key:n,options:t,layout:r})}selectPage(e,t){let n=this.select(e);return Object.freeze({...n,page:ry(n.layout,t)})}isDefault(e){return M_(e,this.#e)===this.#i}};function ay({model:e,services:t,defaultCurrentDateMs:n,buildLayout:r}){let i=j_({defaultCurrentDateMs:n}),a=e.parseError===void 0?null:k_(e.parseError,{widthPt:e.section.pageWidth,heightPt:e.section.pageHeight},t.text),o=new iy(t,i,a===null?r:()=>a);return Jg(t,o),Object.freeze({store:o,defaultOptions:i})}function oy(e,t,n){let r=Yg(e);if(!r)throw Error(`Document layout variant store is not attached to the supplied services`);return r.selectPage(j_(t),n)}function sy(e,t){return Object.freeze({a:e.a*t.a+e.c*t.b,b:e.b*t.a+e.d*t.b,c:e.a*t.c+e.c*t.d,d:e.b*t.c+e.d*t.d,e:e.a*t.e+e.c*t.f+e.e,f:e.b*t.e+e.d*t.f+e.f})}function cy(e){return Object.freeze({a:e,b:0,c:0,d:e,e:0,f:0})}function ly(e,t){return Object.freeze({a:1,b:0,c:0,d:1,e,f:t})}function uy(e,t){return{xPt:e.a*t.xPt+e.c*t.yPt+e.e,yPt:e.b*t.xPt+e.d*t.yPt+e.f}}function dy(e,t){let n=e.a*e.d-e.b*e.c;if(!Number.isFinite(n)||n===0)return null;let r=t.xPt-e.e,i=t.yPt-e.f,a={xPt:(e.d*r-e.c*i)/n,yPt:(-e.b*r+e.a*i)/n};return Number.isFinite(a.xPt)&&Number.isFinite(a.yPt)?a:null}function fy(e,t){let n=e.a*e.d-e.b*e.c;if(!Number.isFinite(n)||n===0)return null;let r={xPt:(e.d*t.xPt-e.c*t.yPt)/n,yPt:(-e.b*t.xPt+e.a*t.yPt)/n};return Number.isFinite(r.xPt)&&Number.isFinite(r.yPt)?r:null}const py=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0});function my(e){let t=new Map(e.sectionRegions.map(e=>[e.id,e])),n=new Map;for(let t of e.sectionRegions)for(let e of t.flowDomainIds)n.set(e,t);for(let r of e.flowDomains){if(r.kind!==`footnote`&&r.kind!==`endnote`)continue;let i=r.sectionRegionId?t.get(r.sectionRegionId):e.sectionRegions[0];if(!i)throw Error(`${r.id} references missing page story region ${r.sectionRegionId??`<default>`}`);n.set(r.id,i)}return n}function hy(e,t){return t.coordinateSpace===`upright-physical`?py:e.get(t.node.flowDomainId)?.coordinateSpace.logicalToPhysical??py}function gy(e,t){let n=e.rootPointToPage.get(t.rootNodeId);if(!n)throw Error(`Drawing entry ${t.node.id} references missing root ${t.rootNodeId}`);let r=n;for(let e of t.frames)e.kind===`transform`&&(r=sy(r,e.transform));return r}function _y(e,t,n){let r=t.xPt-e.flowBounds.xPt,i=t.yPt-e.flowBounds.yPt;return{pointToPage:sy(n.pointToPage,ly(r,i)),layoutTranslationPt:{xPt:n.layoutTranslationPt.xPt+r,yPt:n.layoutTranslationPt.yPt+i},rootNodeId:n.rootNodeId}}function vy(e,t){return(t.textBoxIds??[]).flatMap(t=>{let n=e.get(t);return n?[n]:[]})}function yy(e,t,n){if(n.emittedTextBoxes.has(e.id))return;n.emittedTextBoxes.add(e.id);let r={...t,pointToPage:sy(t.pointToPage,e.transform)};for(let t of e.story.blocks)wy(t,r,n)}function by(e,t,n,r){let i=vy(e,t);if(i.length===0)return;let a=xy(t,n,r);for(let e of i)yy(e,a,r)}function xy(e,t,n){let r=n.drawingEntries.get(e.id),i=t;r&&r.rootNodeId===t.rootNodeId&&(i={pointToPage:gy(n,r),layoutTranslationPt:r.layoutTranslationPt,rootNodeId:r.rootNodeId});let a=i.layoutTranslationPt,o=e.anchorLayer?.horizontalOwnership===`page`?-a.xPt:0,s=e.anchorLayer?.verticalOwnership===`page`?-a.yPt:0,c=o===0&&s===0?i:{...i,pointToPage:sy(i.pointToPage,ly(o,s))};if(e.orientation===`upright-physical`){if(!e.transform)throw Error(`Upright physical drawing ${e.id} is missing its logical transform`);c={...c,pointToPage:sy(c.pointToPage,e.transform)}}return c}function Sy(e,t,n){for(let r of e.lines)for(let i of r.placements)i.kind===`text`&&n.runs.push(Object.freeze({placement:i,pointToPage:t.pointToPage,...e.paragraphId===void 0?{}:{paragraphId:e.paragraphId}}));let r=new Map(e.textBoxes.map(e=>[e.id,e])),i=new Set,a=e.drawings.map((e,t)=>{let n=e.source.path.at(-1);if(n===void 0||!Number.isSafeInteger(n)||n<0)throw Error(`Drawing ${e.id} has no retained paragraph run index`);return{drawing:e,index:t,runIndex:n}}).sort((e,t)=>e.runIndex-t.runIndex||e.index-t.index);for(let{drawing:e}of a){for(let t of e.textBoxIds??[])i.add(t);by(r,e,t,n)}for(let r of e.textBoxes)i.has(r.id)||yy(r,t,n)}function Cy(e,t,n){for(let r of e.rows)for(let e of r.cells){let r=`visualMergeOwnership`in e&&e.visualMergeOwnership===`continuation`;if(!(e.verticalMerge===`continue`&&!r))for(let r of e.blocks){let i=r.layout;wy(i,_y(i,{xPt:e.contentBounds.xPt+(i.kind===`table`?i.flowBounds.xPt:0),yPt:e.flowBounds.yPt+r.offsetPt+(i.kind===`table`?i.flowBounds.yPt:0)},t),n)}}for(let r of e.resolvedFloatingTables??[])wy(r.child,_y(r.child,{xPt:r.xPt-t.layoutTranslationPt.xPt,yPt:r.yPt-t.layoutTranslationPt.yPt},t),n)}function wy(e,t,n){switch(e.kind){case`paragraph`:Sy(e,t,n);return;case`table`:Cy(e,t,n);return;case`note`:for(let r of e.story.blocks)wy(r,t,n);return;case`textbox`:yy(e,t,n);return;case`drawing`:{let r=n.drawingEntries.get(e.id),i=xy(e,t,n);for(let e of r?.textBoxes??[])yy(e,i,n);return}default:throw Error(`Unknown text-index node: ${String(e)}`)}}function Ty(e,t){let n=e.pages[t];if(!n)throw RangeError(`Page index ${t} is out of range`);let r=new Map(n.layers.roots.map(e=>[e.node.id,e])),i=my(n),a=new Map(n.layers.roots.map(e=>[e.node.id,hy(i,e)])),o=new Map;for(let e of n.layers.paintOrder)e.kind===`drawing`&&o.set(e.node.id,e);let s={drawingEntries:o,rootPointToPage:a,emittedTextBoxes:new Set,runs:[]};for(let e of n.readingOrder){let t=r.get(e);if(!t)throw Error(`Reading-order node ${e} is not a page root`);let n=a.get(e);if(!n)throw Error(`Reading-order node ${e} has no page projection`);wy(t.node,{pointToPage:n,layoutTranslationPt:{xPt:0,yPt:0},rootNodeId:t.node.id},s)}return Object.freeze(s.runs)}function Ey(e){let t=Math.hypot(e.a,e.b),n=Math.hypot(e.c,e.d),r=e.a/t,i=e.b/t,a=e.c/n,o=e.d/n;if(!(r===1&&i===0&&a===0&&o===1))return r===0&&i===1&&a===-1&&o===0?`rotate(90deg)`:r===0&&i===-1&&a===1&&o===0?`rotate(-90deg)`:`matrix(${r}, ${i}, ${a}, ${o}, 0, 0)`}function Dy(e,t){let{placement:n}=e,r=uy(t,n.bounds),i=Math.hypot(t.a,t.b),a=Math.hypot(t.c,t.d),o=Ey(t),s=n.paintOps[0]?.letterSpacingPt??0;return{...e.paragraphId===void 0?{}:{paragraphId:e.paragraphId},text:n.text,x:r.xPt,y:r.yPt,w:n.bounds.widthPt*i,h:n.bounds.heightPt*a,fontSize:n.fontSizePt*a,font:L(n.fontRoute,n.fontSizePt*a,n.fontWeight,n.fontStyle),...s===0?{}:{letterSpacingPx:s*i},...o?{transform:o}:{},...n.hyperlink?{hyperlink:n.hyperlink}:{},...n.tateChuYoko?{eastAsianVert:!0}:{}}}function Oy(e,t,n){if(!Number.isFinite(n.scale)||n.scale<=0)throw RangeError(`Text projection scale must be positive: ${n.scale}`);let r=cy(n.scale);return Ty(e,t).map(e=>Dy(e,sy(r,e.pointToPage)))}function ky(e,t,n){let r=oy(e,{currentDate:n.currentDate,defaultCurrentDateMs:n.defaultCurrentDateMs},t),i=(n.width??r.page.geometry.widthPt*1.3333333333333333)/r.page.geometry.widthPt;return Oy(r.layout,t,{scale:i})}function Ay(e,t,n){return`${e}${t?`|clr:${t}`:``}${n?`|duo:${n.clr1}:${n.clr2}`:``}`}const jy=new WeakMap;function My(e){let t=jy.get(e);return t||(t=new Map,jy.set(e,t)),t}function Ny(e){let t=jy.get(e);if(t){for(let n of t.values())va(e,n);t.clear(),jy.delete(e)}}async function Py(e,t){let n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16),a=new OffscreenCanvas(e.width,e.height),o=a.getContext(`2d`);if(!o)throw Error(`2D canvas is unavailable for image color replacement`);o.drawImage(e,0,0);let s=o.getImageData(0,0,e.width,e.height);for(let e=0;e<s.data.length;e+=4)s.data[e]===n&&s.data[e+1]===r&&s.data[e+2]===i&&(s.data[e+3]=0);return o.putImageData(s,0,0),createImageBitmap(a)}async function Fy(e,t,n,r,i=0,a=0,o){let s=await ya(e,t,r,{widthPt:i,heightPt:a,suppressBoundaryFrame:!0});if(!s)return null;if(!n&&!o)return s;let c=My(r),l=Ay(e,n,o),u=c.get(l);return u||(u=(async()=>{let e=s;if(n&&(e=await Py(e,n)),o){let{w:t,h:n}=xa(e);t>0&&n>0&&(e=await ka(e,o,{width:t,height:n}))}return e})(),u.catch(()=>c.delete(l)),u.then(e=>{e===s&&c.delete(l)}).catch(()=>{}),c.set(l,u)),u}function Iy(e){let t=new Map,n=e.filter(e=>e.kind===`image`||e.kind===`picture-bullet`).sort((e,t)=>(e.documentOrder??2**53-1)-(t.documentOrder??2**53-1));for(let e of n){let n=wa(e.mimeType,e.srcRect,e.intrinsicSize.widthPt,e.intrinsicSize.heightPt),r={imagePath:e.partPath,mimeType:e.mimeType,...e.svgImagePath===void 0?{}:{svgImagePath:e.svgImagePath},...e.colorReplaceFrom===void 0?{}:{colorReplaceFrom:e.colorReplaceFrom},...e.duotone===void 0?{}:{duotone:e.duotone},widthPt:n.widthPt,heightPt:n.heightPt,hasCrop:e.srcRect!=null},i=Ay(r.imagePath,r.colorReplaceFrom,r.duotone),a=t.get(i);a?(a.widthPt=Math.max(a.widthPt,r.widthPt),a.heightPt=Math.max(a.heightPt,r.heightPt),a.hasCrop||=r.hasCrop):t.set(i,r)}return[...t.values()]}async function Ly(e,t){if(!t)return new Map;let n=await Promise.all(Iy(e).map(async e=>{let n=e.mimeType===`image/svg+xml`,r={svgImagePath:e.svgImagePath,srcRect:e.hasCrop||null},i;if(Aa(r))try{i=await Ar(r.svgImagePath,t)}catch(r){let a=n?await Ar(e.imagePath,t):await Fy(e.imagePath,e.mimeType,e.colorReplaceFrom,t,e.widthPt,e.heightPt,e.duotone);if(!a)throw r;i=a}else i=n?await Ar(e.imagePath,t):await Fy(e.imagePath,e.mimeType,e.colorReplaceFrom,t,e.widthPt,e.heightPt,e.duotone);return i==null?null:[Ay(e.imagePath,e.colorReplaceFrom,e.duotone),i]}));return new Map(n.filter(e=>e!==null))}function Ry(e,t){return Math.round(e*t)/t}function zy(e,t,n){let r=e*t;return(n%2==0?Math.round(r):Math.round(r-.5)+.5)/t}function By(e,t,n){let r=t*n,i=Math.max(1,Math.round(.5*t)),a=Math.max(1,Math.round(i*n)),o=a/r;if(e.start.xPt===e.end.xPt){let t=zy(e.start.xPt,r,a);return{segment:{start:{xPt:t,yPt:Ry(e.start.yPt,r)},end:{xPt:t,yPt:Ry(e.end.yPt,r)}},widthPt:o}}if(e.start.yPt===e.end.yPt){let t=zy(e.start.yPt,r,a);return{segment:{start:{xPt:Ry(e.start.xPt,r),yPt:t},end:{xPt:Ry(e.end.xPt,r),yPt:t}},widthPt:o}}return{segment:e,widthPt:o}}function Vy(e,t,n,r,i){if(r!==`upright-physical`){i.resources.paint(e,t,n,i.ctx);return}let{ctx:a}=i;a.save(),a.translate(n.xPt+n.widthPt/2,n.yPt+n.heightPt/2),a.rotate(-Math.PI/2),i.resources.paint(e,t,{xPt:-n.heightPt/2,yPt:-n.widthPt/2,widthPt:n.heightPt,heightPt:n.widthPt},a),a.restore()}function Hy(e,t){for(let n of e.commands){if(n.kind===`noop`)continue;if(n.kind===`drawingml-shape`){Er(t.ctx,n.plan,1);continue}if(n.kind===`resource`){if(!t.resources)throw Error(`Missing retained resource painter for ${n.resourceKey}`);Vy(n.resourceKey,n.resourceKind,n.rect,n.orientation,t);continue}if(n.kind===`fill-rect`){t.ctx.fillStyle=n.fill,t.ctx.fillRect(n.rect.xPt,n.rect.yPt,n.rect.widthPt,n.rect.heightPt);continue}if(n.kind===`stroke-rect`){t.ctx.strokeStyle=n.stroke,t.ctx.lineWidth=n.lineWidthPt,t.ctx.setLineDash([...n.dashPt]),t.ctx.strokeRect(n.rect.xPt,n.rect.yPt,n.rect.widthPt,n.rect.heightPt),t.ctx.setLineDash([]);continue}if(n.kind===`watermark-text`){let e=lt(n.fill,t.ctx,n.rect.xPt,n.rect.yPt,n.rect.widthPt,n.rect.heightPt);if(e===null)continue;t.ctx.save();let r=n.rect.xPt+n.rect.widthPt/2,i=n.rect.yPt+n.rect.heightPt/2;t.ctx.translate(r,i),n.rotationDeg!==0&&t.ctx.rotate(n.rotationDeg*Math.PI/180),n.fitShape?(t.ctx.scale(n.rect.widthPt/n.sourceBounds.widthPt,n.rect.heightPt/n.sourceBounds.heightPt),t.ctx.translate(-(n.sourceBounds.xPt+n.sourceBounds.widthPt/2),-(n.sourceBounds.yPt+n.sourceBounds.heightPt/2))):t.ctx.translate(n.rect.xPt-r-n.sourceBounds.xPt,n.rect.yPt-i-n.sourceBounds.yPt),t.ctx.globalAlpha*=n.opacity,t.ctx.fillStyle=e,t.ctx.textAlign=`left`,t.ctx.textBaseline=`alphabetic`;let a=0;for(let e of n.spans)t.ctx.font=L(e.fontRoute,n.fontSizePt,e.fontWeight,e.fontStyle),t.ctx.fillText(e.text,a,0),a+=e.advancePt;t.ctx.restore();continue}t.ctx.fillStyle=n.fill,t.ctx.font=L(n.fontRoute,n.fontSizePt,n.fontWeight,n.fontStyle),t.ctx.textAlign=n.align===`start`?`left`:n.align===`end`?`right`:`center`,t.ctx.textBaseline=n.baseline;let e=n.align===`start`?n.rect.xPt:n.align===`end`?n.rect.xPt+n.rect.widthPt:n.rect.xPt+n.rect.widthPt/2,r=n.baseline===`top`?n.rect.yPt:n.baseline===`bottom`?n.rect.yPt+n.rect.heightPt:n.rect.yPt+n.rect.heightPt/2;t.ctx.fillText(n.text,e,r)}}function Uy(e){return 1/e.dpr}function Wy(e,t,n=0){let r=n/t.scale,i=r>e.widthPt?{...e,widthPt:r,...typeof e.authoredStyle==`string`?{dashPatternPt:Object.freeze(nt(e.authoredStyle,r))}:{}}:e,{ctx:a}=t;a.strokeStyle=i.color,a.lineWidth=i.widthPt,a.setLineDash(`dashPatternPt`in i&&i.dashPatternPt?[...i.dashPatternPt]:[]),a.beginPath();let o=`path`in i&&i.path?.length?i.path:[i.from,i.to],s=o.length===2&&(o[0].xPt===o[1].xPt||o[0].yPt===o[1].yPt),c=s&&o[0].yPt===o[1].yPt,l=s&&o[0].xPt===o[1].xPt,u=t.pointToCss??cy(t.scale),d=o.map(e=>uy(u,e)),f=s?o[1].xPt-o[0].xPt:0,p=s?o[1].yPt-o[0].yPt:0,m=u.a*f+u.c*p,h=u.b*f+u.d*p,g=s&&h===0,_=s&&m===0,v=c?Math.hypot(u.c,u.d):l?Math.hypot(u.a,u.b):0;if(i.style===`double`&&s&&v>0){if(a.fillStyle=i.color,g||_){let e=(e,t,n,r)=>{let i=[{xPt:e,yPt:t},{xPt:e+n,yPt:t},{xPt:e,yPt:t+r},{xPt:e+n,yPt:t+r}].map(e=>dy(u,e));if(i.some(e=>e===null))return;let o=i.filter(e=>e!==null),s=o.map(e=>e.xPt),c=o.map(e=>e.yPt);a.fillRect(Math.min(...s),Math.min(...c),Math.max(...s)-Math.min(...s),Math.max(...c)-Math.min(...c))},{railDev:n,gapDev:r,spanDev:o}=Ia(i.widthPt*v,t.dpr),s=n/t.dpr;if(g){let i=Math.round(d[0].yPt*t.dpr-o/2),a=Math.min(d[0].xPt,d[1].xPt),c=Math.abs(d[1].xPt-d[0].xPt);e(a,i/t.dpr,c,s),e(a,(i+n+r)/t.dpr,c,s)}else{let i=Math.round(d[0].xPt*t.dpr-o/2),a=Math.min(d[0].yPt,d[1].yPt),c=Math.abs(d[1].yPt-d[0].yPt);e(i/t.dpr,a,s,c),e((i+n+r)/t.dpr,a,s,c)}}else{let{railDev:e,gapDev:n,spanDev:r}=Ia(i.widthPt*v,t.dpr),s=e/t.dpr/v,l=n/t.dpr/v,u=r/t.dpr/v;if(c){let e=Math.min(o[0].xPt,o[1].xPt),t=Math.abs(o[1].xPt-o[0].xPt);a.fillRect(e,o[0].yPt-u/2,t,s),a.fillRect(e,o[0].yPt-u/2+s+l,t,s)}else{let e=Math.min(o[0].yPt,o[1].yPt),t=Math.abs(o[1].yPt-o[0].yPt);a.fillRect(o[0].xPt-u/2,e,s,t),a.fillRect(o[0].xPt-u/2+s+l,e,s,t)}}a.setLineDash([]);return}let y=fy(u,_&&v>0?{xPt:Na(d[0].xPt,i.widthPt*v,t.dpr),yPt:0}:g&&v>0?{xPt:0,yPt:Na(d[0].yPt,i.widthPt*v,t.dpr)}:{xPt:0,yPt:0})??{xPt:0,yPt:0},b=o[0];a.moveTo(b.xPt+y.xPt,b.yPt+y.yPt);for(let e of o.slice(1))a.lineTo(e.xPt+y.xPt,e.yPt+y.yPt);let x=i.style===`wavy`&&o.length>2;x&&(a.save(),a.lineJoin=`bevel`),a.stroke(),x&&a.restore(),a.setLineDash([])}function Gy(e,t){return n=>()=>{e.save();try{t(),n()}finally{e.restore()}}}function Ky(e,t){let n=t.pointToCss??cy(t.scale);if(n.b!==0||n.c!==0)return e;let r=[{xPt:e.xPt,yPt:e.yPt},{xPt:e.xPt+e.widthPt,yPt:e.yPt},{xPt:e.xPt,yPt:e.yPt+e.heightPt},{xPt:e.xPt+e.widthPt,yPt:e.yPt+e.heightPt}].map(e=>uy(n,e)),i=r.map(e=>e.xPt),a=r.map(e=>e.yPt),o=Math.floor(Math.min(...i)*t.dpr)/t.dpr,s=Math.floor(Math.min(...a)*t.dpr)/t.dpr,c=Math.ceil(Math.max(...i)*t.dpr)/t.dpr,l=Math.ceil(Math.max(...a)*t.dpr)/t.dpr,u=[{xPt:o,yPt:s},{xPt:c,yPt:s},{xPt:o,yPt:l},{xPt:c,yPt:l}].map(e=>dy(n,e));if(u.some(e=>e===null))return e;let d=u.filter(e=>e!==null),f=d.map(e=>e.xPt),p=d.map(e=>e.yPt);return{xPt:Math.min(...f),yPt:Math.min(...p),widthPt:Math.max(...f)-Math.min(...f),heightPt:Math.max(...p)-Math.min(...p)}}function qy(e,t,n,r=!0){let i=t.xPt-e.flowBounds.xPt,a=t.yPt-e.flowBounds.yPt,o=n.layoutTranslationPt??{xPt:0,yPt:0},s=sy(n.pointToCss??cy(n.scale),ly(i,a)),c=Gy(n.ctx,()=>n.ctx.translate(i,a)),l={...n,pointToCss:s,layoutTranslationPt:{xPt:o.xPt+i,yPt:o.yPt+a}};c(()=>{e.kind===`paragraph`?ub(e,l):Zy(e,l,e.resolvedFloatingTables??[],r)})()}function Jy(e,t){let n=Uy(t);for(let r of e.borders)Wy(r,t,n)}function Yy(e,t,n){let r=t.xPt-e.flowBounds.xPt,i=t.yPt-e.flowBounds.yPt,a=n.layoutTranslationPt??{xPt:0,yPt:0},o=sy(n.pointToCss??cy(n.scale),ly(r,i)),s=Gy(n.ctx,()=>n.ctx.translate(r,i)),c={...n,pointToCss:o,layoutTranslationPt:{xPt:a.xPt+r,yPt:a.yPt+i}};s(()=>{let t=()=>Jy(e,c);if(!e.clipBounds){t();return}Gy(n.ctx,()=>{n.ctx.beginPath(),n.ctx.rect(e.clipBounds.xPt,e.clipBounds.yPt,e.clipBounds.widthPt,e.clipBounds.heightPt),n.ctx.clip()})(t)()})()}function Xy(e,t,n,r){for(let n of e.rows)for(let e of n.cells){let n=`visualMergeOwnership`in e&&e.visualMergeOwnership===`continuation`;if(e.verticalMerge===`continue`&&!n)continue;e.background&&(t.ctx.fillStyle=e.background.color,t.ctx.fillRect(e.flowBounds.xPt,e.flowBounds.yPt,e.flowBounds.widthPt,e.flowBounds.heightPt));let r=(t,n=!0)=>{for(let r of e.blocks)qy(r.layout,{xPt:e.contentBounds.xPt+(r.layout.kind===`table`?r.layout.flowBounds.xPt:0),yPt:e.flowBounds.yPt+r.offsetPt+(r.layout.kind===`table`?r.layout.flowBounds.yPt:0)},t,r.layout.kind!==`table`||n)};if(!e.clipBounds){r(t);continue}if(Gy(t.ctx,()=>{t.ctx.beginPath(),t.ctx.rect(e.clipBounds.xPt,e.clipBounds.yPt,e.clipBounds.widthPt,e.clipBounds.heightPt),t.ctx.clip()})(()=>r(t,!1))(),e.blocks.some(e=>e.layout.kind===`table`)){let n=Ky(e.clipBounds,t);Gy(t.ctx,()=>{t.ctx.beginPath(),t.ctx.rect(n.xPt,n.yPt,n.widthPt,n.heightPt),t.ctx.clip()})(()=>{for(let n of e.blocks)n.layout.kind===`table`&&Yy(n.layout,{xPt:e.contentBounds.xPt+n.layout.flowBounds.xPt,yPt:e.flowBounds.yPt+n.offsetPt+n.layout.flowBounds.yPt},t)})()}}$y(n,t),r&&Jy(e,t)}function Zy(e,t,n,r){if(!e.clipBounds){Xy(e,t,n,r);return}let i=e.clipBounds;Gy(t.ctx,()=>{t.ctx.beginPath(),t.ctx.rect(i.xPt,i.yPt,i.widthPt,i.heightPt),t.ctx.clip()})(()=>Xy(e,t,n,r))()}function Qy(e,t,n){Zy(e,t,n??e.resolvedFloatingTables??[],!0)}function $y(e,t){let n=t.layoutTranslationPt??{xPt:0,yPt:0};for(let r of e)qy(r.child,{xPt:r.xPt-n.xPt,yPt:r.yPt-n.yPt},t)}function eb(e,t){let n=e.transform;if(n){n.call(e,t.a,t.b,t.c,t.d,t.e,t.f);return}if(e.translate(t.e,t.f),t.a===0&&t.b===1&&t.c===-1&&t.d===0)e.rotate(Math.PI/2);else if(t.a===0&&t.b===-1&&t.c===1&&t.d===0)e.rotate(-Math.PI/2);else if(t.b===0&&t.c===0)e.scale(t.a,t.d);else throw Error(`Canvas context cannot apply the retained point-space transform`)}function tb(e){if(e.text.length!==e.range.end-e.range.start)throw Error(`UTF-16 text range is inconsistent`);if(e.clusters.length===0)throw Error(`Retained glyph slices are incomplete (clusters)`);let t=e.range.start;for(let n of e.clusters){let{advancePt:r,offset:i,range:a}=n;if(!Number.isFinite(r)||!Number.isFinite(i.xPt)||!Number.isFinite(i.yPt)||a.start!==t||a.end<=a.start||a.end>e.range.end)throw Error(`Retained glyph slices are incomplete (cluster range ${t}:${a.start}-${a.end}/${e.range.end}; advance ${r}; offset ${i.xPt},${i.yPt})`);t=a.end}if(t!==e.range.end)throw Error(`Retained glyph slices are incomplete (cluster end ${t}/${e.range.end})`);if(e.paintOps.length===0)throw Error(`Retained glyph slices are incomplete (paint ops)`);let n=e.range.start;for(let t of e.paintOps){let r=t.sourceMapping!==`kashida`&&t.text.length!==t.range.end-t.range.start,i=!Number.isFinite(t.offset.xPt)||!Number.isFinite(t.offset.yPt)||t.glyphOffsetPt!==void 0&&(!Number.isFinite(t.glyphOffsetPt.xPt)||!Number.isFinite(t.glyphOffsetPt.yPt))||t.blockAxisInkBounds!==void 0&&(!Number.isFinite(t.blockAxisInkBounds.startPt)||!Number.isFinite(t.blockAxisInkBounds.endPt)||t.blockAxisInkBounds.endPt<t.blockAxisInkBounds.startPt)||!Number.isFinite(t.letterSpacingPt)||!Number.isFinite(t.scaleX)||t.scaleX<=0||t.scaleY!==void 0&&(!Number.isFinite(t.scaleY)||t.scaleY<=0),a=t.range.start!==n||t.range.end<=t.range.start||t.range.end>e.range.end;if(r||i||a)throw Error(`Retained glyph slices are incomplete (${r?`text`:i?`geometry`:`range ${n}:${t.range.start}-${t.range.end}/${e.range.end}`})`);n=t.range.end}let r=e.text.slice(n-e.range.start);if(r!==``&&!/^\\s+$/u.test(r))throw Error(`Retained glyph slices are incomplete (paint end ${n}/${e.range.end})`)}function nb(e,t){return e.kind===`explicit`?e.color:e.kind===`auto`?ct(e.background??`#FFFFFF`):t.defaultTextColor??`#000000`}function rb(e,t){return nb(e.color,t)}function ib(e,t,n=!1){let{ctx:r}=t;r.fillStyle=nb(e.color,t),r.font=L(e.fontRoute,e.fontSizePt,e.fontWeight,e.fontStyle),n?(r.save(),r.translate(e.origin.xPt,e.origin.yPt),r.rotate(-Math.PI/2),r.fillText(e.text,0,0),r.restore()):r.fillText(e.text,e.origin.xPt,e.origin.yPt)}function ab(e,t){let{ctx:n}=t;if(n.beginPath(),e.points.length>0){let t=e.points[0];n.moveTo(t.xPt,t.yPt);for(let t of e.points.slice(1))n.lineTo(t.xPt,t.yPt)}e.stroke!==null&&(n.strokeStyle=e.stroke,n.lineWidth=e.strokeWidthPt,n.stroke()),e.fill!==null&&(n.fillStyle=e.fill,n.fill())}function ob(e,t){let n=new Map(e.textBoxes.map(e=>[e.id,e]));return(t.textBoxIds??[]).flatMap(e=>{let t=n.get(e);return t?[t]:[]})}function sb(e,t,n){let r=n.layoutTranslationPt,i=e.anchorLayer?.horizontalOwnership===`page`?-(r?.xPt??0):0,a=e.anchorLayer?.verticalOwnership===`page`?-(r?.yPt??0):0;(i!==0||a!==0)&&(n.ctx.save(),n.ctx.translate(i,a));let o=n=>{Hy(e,n);for(let e of t)db(e,{...n,omitAnchoredDrawings:!1})};try{if(e.orientation===`upright-physical`){if(!e.transform)throw Error(`Upright physical drawing requires its retained logical transform`);let t=sy(n.pointToCss??cy(n.scale),e.transform);Gy(n.ctx,()=>{eb(n.ctx,e.transform)})(()=>o({...n,pointToCss:t}))()}else o(n)}finally{(i!==0||a!==0)&&n.ctx.restore()}}function cb(e,t,n){sb(t,ob(e,t),n)}function lb(e,t){let{ctx:n}=t,r=new Set(e.drawings.flatMap(e=>e.textBoxIds??[])),i=n=>cb(e,n,t),a=e.drawings.filter(e=>e.anchorLayer?.behindDoc===!0).sort((e,t)=>e.anchorLayer.relativeHeight-t.anchorLayer.relativeHeight||e.anchorLayer.sourceOrder-t.anchorLayer.sourceOrder);if(!t.omitAnchoredDrawings)for(let e of a)i(e);for(let t of e.lineNumbers??[])for(let e of t.paintOps)n.fillStyle=e.color,n.font=e.font,n.textAlign=e.textAlign,n.textBaseline=`alphabetic`,n.fillText(e.text,e.origin.xPt,e.origin.yPt);e.shading&&(n.fillStyle=e.shading.color,n.fillRect(e.inkBounds.xPt,e.inkBounds.yPt,e.inkBounds.widthPt,e.inkBounds.heightPt));for(let r of e.lines)for(let e of r.placements){if(e.kind===`resource`){if(!t.resources)throw Error(`Missing retained resource painter for ${e.resourceKey}`);if(t.textBoxVerticalMode){let r=t.textBoxVerticalMode===`vert270`?Math.PI/2:-Math.PI/2;n.save(),n.translate(e.bounds.xPt+e.bounds.widthPt/2,e.bounds.yPt+e.bounds.heightPt/2),n.rotate(r),Vy(e.resourceKey,e.resourceKind,{xPt:-e.bounds.heightPt/2,yPt:-e.bounds.widthPt/2,widthPt:e.bounds.heightPt,heightPt:e.bounds.widthPt},e.orientation,t),n.restore()}else Vy(e.resourceKey,e.resourceKind,e.bounds,e.orientation,t);continue}if(e.kind===`tab`){if(e.leader!==`none`){if(!e.leaderGlyphs)throw Error(`Retained tab leader geometry is missing`);for(let n of e.leaderGlyphs)ib(n,t)}continue}if(e.kind!==`text`)continue;if(tb(e),e.unsupportedGeometry?.length)throw Error(`Unsupported retained typography geometry: ${e.unsupportedGeometry.join(`, `)}`);if(e.highlightFragments)for(let t of e.highlightFragments)n.fillStyle=t.color,n.fillRect(t.rect.xPt,t.rect.yPt,t.rect.widthPt,t.rect.heightPt);else (e.background||e.highlight)&&(n.fillStyle=e.highlight??e.background??`#000000`,n.fillRect(e.bounds.xPt,e.bounds.yPt,e.bounds.widthPt,e.bounds.heightPt));n.fillStyle=rb(e,t),n.font=L(e.fontRoute,e.fontSizePt,e.fontWeight,e.fontStyle),n.textAlign=`left`,n.textBaseline=`alphabetic`;let r=n.letterSpacing,i=n.fontKerning;for(let t of e.paintOps){n.direction=t.direction,n.fontKerning=t.kerning;let r=e.origin.xPt+t.offset.xPt,i=e.origin.yPt+t.offset.yPt,a=t.glyphOffsetPt?.xPt??0,o=t.glyphOffsetPt?.yPt??0;if(t.glyphOrientation===`upright`){n.save(),n.translate(r,i),n.rotate(-Math.PI/2),(t.scaleX!==1||t.scaleY!==void 0)&&(t.writingMode===`vertical-rl`?n.scale(1,t.scaleX):n.scale(t.scaleX,t.scaleY??1)),n.textAlign=`center`,n.textBaseline=`middle`,n.letterSpacing=`${t.letterSpacingPt}px`;let e=()=>n.fillText(t.text,a,o);t.verticalFeature?ws(n,e):e(),n.restore()}else t.glyphOrientation===`rotate`?(n.save(),n.translate(r,i),t.scaleX!==1&&n.scale(t.scaleX,1),n.textAlign=`center`,n.textBaseline=`middle`,n.letterSpacing=`${t.letterSpacingPt/t.scaleX}px`,n.fillText(t.text,a,o),n.restore()):t.scaleX===1?(n.letterSpacing=`${t.letterSpacingPt}px`,n.fillText(t.text,r+a,i+o)):(n.save(),n.translate(r+a,i+o),n.scale(t.scaleX,1),n.letterSpacing=`${t.letterSpacingPt/t.scaleX}px`,n.fillText(t.text,0,0),n.restore())}if(n.letterSpacing=r,n.fontKerning=i,e.ruby){let n=t.textBoxVerticalMode===`eaVert`||t.textBoxVerticalMode===`mongolianVert`;for(let r of e.ruby.paintOps)ib(r,t,n)}for(let n of e.emphasis?.glyphs??[])ib(n,t);for(let n of e.emphasis?.paths??[])ab(n,t);for(let n of e.decorations)Wy(n,t);for(let n of e.runBorderFragments??[])Wy(n,t)}let o=Uy(t);for(let n of e.borders)Wy(n,t,o);for(let t of e.drawings.filter(e=>!e.anchorLayer))i(t);let s=e.drawings.filter(e=>e.anchorLayer&&!e.anchorLayer.behindDoc).sort((e,t)=>e.anchorLayer.relativeHeight-t.anchorLayer.relativeHeight||e.anchorLayer.sourceOrder-t.anchorLayer.sourceOrder);if(!t.omitAnchoredDrawings)for(let e of s)i(e);for(let n of e.textBoxes)r.has(n.id)||db(n,{...t,omitAnchoredDrawings:!1})}function ub(e,t){if(!e.clipBounds){lb(e,t);return}let n=e.clipBounds;Gy(t.ctx,()=>{t.ctx.beginPath(),t.ctx.rect(n.xPt,n.yPt,n.widthPt,n.heightPt),t.ctx.clip()})(()=>lb(e,t))()}function db(e,t){let n=t=>{for(let n of e.story.blocks)if(n.kind===`paragraph`)ub(n,t);else if(n.kind===`table`)Qy(n,t,n.resolvedFloatingTables??[]);else throw Error(`Text-box story contains unsupported retained node: ${n.kind}`)},r=sy(t.pointToCss??cy(t.scale),e.transform),i=e.transform.a!==1||e.transform.b!==0||e.transform.c!==0||e.transform.d!==1||e.transform.e!==0||e.transform.f!==0,a=Gy(t.ctx,()=>{i&&(e.verticalMode?(t.ctx.translate(e.transform.e,e.transform.f),t.ctx.rotate(e.verticalMode===`vert270`?-Math.PI/2:Math.PI/2)):t.ctx.transform(e.transform.a,e.transform.b,e.transform.c,e.transform.d,e.transform.e,e.transform.f))}),o=e.clipBounds?Gy(t.ctx,()=>{t.ctx.beginPath(),t.ctx.rect(e.clipBounds.xPt,e.clipBounds.yPt,e.clipBounds.widthPt,e.clipBounds.heightPt),t.ctx.clip()}):null,s=t.documentDefaultTextColor??t.defaultTextColor??`#000000`,c={...t,pointToCss:r,documentDefaultTextColor:s,defaultTextColor:e.defaultTextColor??s,...e.verticalMode?{textBoxVerticalMode:e.verticalMode}:{}};a(()=>{o?o(()=>n(c))():n(c)})()}function fb(e,t){let n=sy(t.pointToCss??cy(t.scale),e.logicalToPhysical),r={...t,pointToCss:n};Gy(t.ctx,()=>{eb(t.ctx,e.logicalToPhysical)})(()=>{for(let t of e.segments)Wy(t,r,.5)})()}const pb=Object.freeze({paint(e,t){throw Error(`Missing retained resource painter for ${e}: expected ${t}`)}});function mb(e,t){return Object.freeze({paint(n,r,i,a){switch(r){case`image`:t.image(e.resolve(n,r),i,a);return;case`chart`:t.chart(e.resolve(n,r),i,a);return;case`math`:t.math(e.resolve(n,r),i,a);return;case`picture-bullet`:t[`picture-bullet`](e.resolve(n,r),i,a);return;default:throw Error(`Unknown retained resource kind: ${String(r)}`)}}})}function hb(e,t){switch(e.kind){case`drawing`:Hy(e,t);return;case`paragraph`:ub(e,t);return;case`table`:Qy(e,t,e.resolvedFloatingTables??[]);return;case`note`:{e.separator.forEach(e=>Wy(e,t));let n=()=>e.story.blocks.forEach(e=>hb(e,t));if(!e.story.clipBounds){n();return}let r=e.story.clipBounds;t.ctx.save();try{t.ctx.beginPath(),t.ctx.rect(r.xPt,r.yPt,r.widthPt,r.heightPt),t.ctx.clip(),n()}finally{t.ctx.restore()}return}case`textbox`:throw Error(`Unsupported page paint node kind: ${e.kind}`);default:throw Error(`Unknown page paint node kind: ${String(e)}`)}}function gb(e,t){let n=e.columnSeparators;if(n.length===0)return;let{ctx:r}=t;r.save(),r.strokeStyle=`#000000`;for(let e of n){let n=By(e,t.scale,t.dpr);r.lineWidth=n.widthPt,r.beginPath(),r.moveTo(n.segment.start.xPt,n.segment.start.yPt),r.lineTo(n.segment.end.xPt,n.segment.end.yPt),r.stroke()}r.restore()}function _b(e,t,n,r){let i=n.get(e.flowDomainId),a=e.coordinateSpace===`upright-physical`?void 0:i?.coordinateSpace.logicalToPhysical,o=Gy(t.ctx,()=>{a&&(a.a!==1||a.b!==0||a.c!==0||a.d!==1||a.e!==0||a.f!==0)&&eb(t.ctx,a)}),s={...t,...a?{pointToCss:{a:a.a*t.scale,b:a.b*t.scale,c:a.c*t.scale,d:a.d*t.scale,e:a.e*t.scale,f:a.f*t.scale}}:{}};o(()=>r(s))()}function vb(e,t){if(e.kind===`transform`){let n=t.transform;if(n)n.call(t,e.transform.a,e.transform.b,e.transform.c,e.transform.d,e.transform.e,e.transform.f);else if(e.transform.a===1&&e.transform.b===0&&e.transform.c===0&&e.transform.d===1)t.translate(e.transform.e,e.transform.f);else throw Error(`Canvas context cannot apply the retained page paint transform`);return}t.beginPath(),t.rect(e.clip.xPt,e.clip.yPt,e.clip.widthPt,e.clip.heightPt),t.clip()}function yb(e,t){let n=t.pointToCss??cy(t.scale);for(let t of e.frames)t.kind===`transform`&&(n=sy(n,t.transform));let r={...t,pointToCss:n,layoutTranslationPt:e.layoutTranslationPt,omitAnchoredDrawings:!1},i=0;try{for(let n of e.frames)t.ctx.save(),i+=1,vb(n,t.ctx);sb(e.node,e.textBoxes,r)}finally{for(;i>0;)t.ctx.restore(),--i}}function bb(e,t){let n=new Map(e.sectionRegions.flatMap(e=>e.flowDomainIds.map(t=>[t,e]))),r=new Map(e.sectionRegions.map(e=>[e.id,e]));for(let t of e.flowDomains)if(t.kind===`footnote`||t.kind===`endnote`){let i=t.sectionRegionId?r.get(t.sectionRegionId):e.sectionRegions[0];if(!i)throw Error(`${t.id} references missing page story region ${t.sectionRegionId??`<default>`}`);n.set(t.id,i)}let i=e.layers.paintOrder,a=i.findIndex(e=>e.sourceLayer!==`background`&&e.sourceLayer!==`behindText`&&e.sourceLayer!==`header`),o=a===-1?i.length:a,s=e=>{for(let r of e)_b(r,t,n,e=>{r.kind===`drawing`?yb(r,e):hb(r.node,{...e,omitAnchoredDrawings:r.omitAnchoredDrawings})})};e.pageBorder?.zOrder===`back`&&fb(e.pageBorder,t),s(i.slice(0,o)),gb(e,t),s(i.slice(o)),e.pageBorder?.zOrder!==`back`&&e.pageBorder&&fb(e.pageBorder,t)}async function xb(e,t,n,r,i=pb){let a=e.pages[t];if(!a)throw RangeError(`Page ${t} is outside the layout`);let o=n.getContext(`2d`);if(!o)throw Error(`Canvas 2D context is unavailable`);let s=r.scale*r.dpr;n.width=Math.ceil(a.geometry.widthPt*s),n.height=Math.ceil(a.geometry.heightPt*s),o.save();try{o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,n.width,n.height),o.setTransform(s,0,0,s,0,0),bb(a,{ctx:o,scale:r.scale,dpr:r.dpr,resources:i})}finally{o.restore()}}function Sb(e,t){if(typeof e!=`string`||e.trim().length===0)throw TypeError(`${t} must be a non-empty string`)}function Cb(e){return Sb(e,`unavailable paint resource reason`),Object.freeze({status:`unavailable`,reason:e})}function wb(e){return typeof e==`object`&&!!e&&e.status===`unavailable`&&typeof e.reason==`string`&&e.reason.trim().length>0}function Tb(e){typeof e!=`object`||!e||e.status!==`unavailable`||Sb(e.reason,`unavailable paint resource reason`)}function Eb(e,t){let n=new Map;for(let r of t){if(n.has(r.resourceKey))throw Error(`Duplicate paint resource handle: ${r.resourceKey}`);Tb(r.handle),e.resolve(r.resourceKey,r.kind),n.set(r.resourceKey,Object.freeze({kind:r.kind,handle:r.handle}))}let r=Object.freeze([...n.keys()].sort());return Object.freeze({keys:r,resolve(t,r){let i=e.resolve(t,r),a=n.get(t);if(!a)throw Error(`Missing paint resource handle for ${t}: expected ${r}`);if(a.kind!==r)throw Error(`Paint resource kind mismatch for ${t}: expected ${r}, got ${a.kind}`);return Object.freeze({descriptor:i,handle:a.handle})}})}function Db(e,t){return Eb(e,e.descriptors.map(e=>{if(e.kind===`chart`)return{resourceKey:e.resourceKey,kind:e.kind,handle:null};let n=t(e);if(n==null)throw Error(`Missing ${e.kind} paint handle for ${e.resourceKey}`);return{resourceKey:e.resourceKey,kind:e.kind,handle:n}}))}function Ob(e){if(!wb(e.handle)){if(e.handle===void 0||e.handle===null)throw Error(`Missing ${e.descriptor.kind} drawable for ${e.descriptor.resourceKey}`);return e.handle}}function kb(e,t,n){let r=e.descriptor,i=Ob(e);if(!i)return;let a=(e,a)=>{Ca(n,i,r.srcRect,e,a,t.widthPt,t.heightPt)},o=r.alpha!==void 0&&r.alpha<1;o&&(n.save(),n.globalAlpha*=r.alpha);let s=r.rotation??0;s===0&&!r.flipH&&!r.flipV?a(t.xPt,t.yPt):(n.save(),n.translate(t.xPt+t.widthPt/2,t.yPt+t.heightPt/2),n.rotate(s*Math.PI/180),n.scale(r.flipH?-1:1,r.flipV?-1:1),a(-t.widthPt/2,-t.heightPt/2),n.restore()),o&&n.restore()}function Ab(e,t,n){let r=Ob(e);r&&n.drawImage(r,t.xPt,t.yPt,t.widthPt,t.heightPt)}const jb=Object.freeze({image(e,t,n){kb(e,t,n)},chart(e,t,n){jn(n,e.descriptor.model,{x:t.xPt,y:t.yPt,w:t.widthPt,h:t.heightPt},1)},math(e,t,n){Ab(e,t,n)},\"picture-bullet\"(e,t,n){Ab(e,t,n)}}),Mb=new WeakMap;function Nb(e,t){return(t??e.geometry.widthPt*1.3333333333333333)/e.geometry.widthPt}function Pb(e){if(ja(e))return e.ownerDocument??(typeof document>`u`?null:document);let t=e.ownerDocument,n=t?.defaultView?.HTMLCanvasElement;return n&&e instanceof n?t:null}function Fb(e){return Pb(e)!==null}function Ib(e,t){let n=Pb(e);if(!t||n&&e.isConnected)return{canvas:e};let r=n??(typeof document>`u`?void 0:document);if(!r)throw Error(`OpenType vertical glyph paint requires an element-backed document surface`);let i=r.body??r.documentElement;if(!i)throw Error(`OpenType vertical glyph paint requires an attached document surface`);let a=r.createElement(`canvas`);return a.setAttribute(`aria-hidden`,`true`),Object.assign(a.style,{position:`fixed`,left:`-99999px`,top:`0`,opacity:`0`,pointerEvents:`none`}),i.appendChild(a),{canvas:a,release:()=>a.remove()}}async function Lb(e,t,n,r){let i=r.fetchImage?_a(r.fetchImage):void 0,a;try{let i=(Mb.get(n)??0)+1;Mb.set(n,i);let o=()=>Mb.get(n)!==i,s=r.dpr??Ma(),c=Ib(n,!r.parseError&&t.layers.capabilities.requiresElementBackedVerticalGlyphPaint),l=c.canvas;a=c.release;let u=l.getContext(`2d`);if(!u)throw Error(`2D canvas is unavailable for DOCX paint`);let d=Nb(t,r.width),f=t.geometry.widthPt*d,p=t.geometry.heightPt*d,m=Fa(f*s,p*s),h=m.clamped?s*m.scale:s;if(n.width=m.width,n.height=m.height,l!==n&&(l.width=m.width,l.height=m.height),Fb(n)&&(n.style.width=`${f}px`,n.style.height=`${p}px`,n.style.display||(n.style.display=`block`)),Fb(l)&&l!==n&&(l.style.width=`${f}px`,l.style.height=`${p}px`),u.scale(h,h),u.fillStyle=`#ffffff`,u.fillRect(0,0,f,p),r.parseError){await xb(e,0,n,{scale:d,dpr:h});return}let g;try{g=await Ly(r.registry.descriptors,r.fetchImage)}catch(e){if(o())return;throw e}if(o())return;let _=mb(Db(r.registry,e=>{if(e.kind===`math`)return r.privateResources?.keys.includes(e.resourceKey)?r.privateResources.resolve(e.resourceKey):Cb(`optional math renderer unavailable`);if(e.kind===`image`||e.kind===`picture-bullet`)return g.get(Ay(e.partPath,e.colorReplaceFrom,e.duotone))??Cb(r.fetchImage?`unsupported image format produced no drawable output`:`image byte source unavailable`)}),jb);u.save();try{u.scale(d,d),bb(t,{ctx:u,scale:d,dpr:h,resources:_,documentDefaultTextColor:r.defaultTextColor??`#000000`,defaultTextColor:r.defaultTextColor??`#000000`,showTrackChanges:r.showTrackChanges??!0})}finally{u.restore()}if(l!==n){if(o())return;let e=n.getContext(`2d`);if(!e)throw Error(`2D canvas is unavailable for DOCX paint projection`);e.drawImage(l,0,0)}if(r.onTextRun)for(let e of r.textRuns)r.onTextRun(e)}finally{a?.(),i?.()}}var Rb=class extends Error{code=`NOTE_CAPACITY_EXCEEDED`;constructor(e,t,n){super(`${e} story exceeds ${n} on page ${t}`),this.kind=e,this.pageIndex=t,this.containerId=n,this.name=`NoteCapacityExceededError`}};function zb(e){return Object.freeze({...e,pages:Object.freeze([...e.pages])})}function Bb(e){let{kind:t,region:n,...r}=e,i=gv(r);if(n&&(i=_v(i,n)),t===`content`&&i.sectionRegions.length===0)throw RangeError(`A content page draft requires an initial section region`);if(t===`parity-blank`&&i.sectionRegions.length!==0)throw RangeError(`A parity blank cannot retain a section region`);return Object.freeze({kind:t,accumulator:i})}function Vb(e,t){if(t.kind!==`content`||t.accumulator.pageIndex!==e.pageIndex)throw Error(`The initial body page must be owned by the active flow`);return zb({flow:e,pages:[t],footnoteReservePt:0,balanceTargetPt:null})}function Hb(e,t){if(t!==null&&(!Number.isFinite(t)||t<0))throw RangeError(`A body balance target must be finite and non-negative`);return zb({...e,balanceTargetPt:t})}function Ub(e,t){if(!Number.isFinite(t)||t<0)throw RangeError(`A footnote reserve increment must be finite and non-negative`);return t===0?e:zb({...e,footnoteReservePt:e.footnoteReservePt+t})}function Wb(e,t,n){let r=[...e.pages],i=t.state,a=!1;for(let e of t.events){if(e.type===`place`)throw Error(`Occurrence acceptance owns place events`);if(e.type!==`next-column`){if(e.type===`next-page`){if(e.parityBlank)r.push(n.openParityBlankPage(e));else{let a=n.openContentPage(e,t.state);r.push(a.page),i=a.flow}a=!0;continue}if(!a){let t=r.at(-1);if(!t||t.kind!==`content`)throw Error(`A continuous section requires an active content page`);r[r.length-1]=n.openSamePageSectionRegion(t,e,i)}}}let o=r.at(-1);if(!o||o.kind!==`content`||o.accumulator.pageIndex!==i.pageIndex)throw Error(`A page transition must end on the active content page`);return zb({...e,flow:i,pages:r,footnoteReservePt:a?0:e.footnoteReservePt,balanceTargetPt:a?null:e.balanceTargetPt})}function Gb(e){if(e.length===0)return null;let t=Math.min(...e.map(e=>e.xPt)),n=Math.min(...e.map(e=>e.yPt)),r=Math.max(...e.map(e=>e.xPt+e.widthPt)),i=Math.max(...e.map(e=>e.yPt+e.heightPt));return{xPt:t,yPt:n,widthPt:r-t,heightPt:i-n}}function Kb(e){return{x:!e.horzSpecified||e.horzAnchor!==`page`&&e.horzAnchor!==`margin`,y:e.vertAnchor!==`page`&&e.vertAnchor!==`margin`}}function qb(e,t){return{...e,xPt:e.xPt+t.xPt,yPt:e.yPt+t.yPt}}function Q(e,t){return{...e,xPt:e.xPt+t.xPt,yPt:e.yPt+t.yPt}}function Jb(e,t){return{...e,from:qb(e.from,t),to:qb(e.to,t)}}function Yb(e,t){return e.kind===`rect`?{...e,rect:Q(e.rect,t)}:{...e,points:e.points.map(e=>qb(e,t))}}function Xb(e,t){return e.kind===`noop`?e:e.kind===`drawingml-shape`?{...e,plan:{...e.plan,rect:{...e.plan.rect,x:e.plan.rect.x+t.xPt,y:e.plan.rect.y+t.yPt}}}:{...e,rect:Q(e.rect,t)}}function Zb(e,t){let n=e.orientation===`upright-physical`?{xPt:0,yPt:0}:t;return{...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:Q(e.clipBounds,t)}:{},...e.transform?{transform:{...e.transform,e:e.transform.e+t.xPt,f:e.transform.f+t.yPt}}:{},...e.clip?{clip:Yb(e.clip,t)}:{},commands:e.commands.map(e=>Xb(e,n))}}function Qb(e,t,n){let r=`${t.xPt}\\u0000${t.yPt}`,i=n.drawingMemo.get(e);if(i){if(i.key!==r)throw Error(`incompatible projection ownership`);return i.value}let a=Zb(e,t);return n.drawingMemo.set(e,{key:r,value:a}),a}function $b(e,t,n){return e.kind===`text`?{...e,origin:qb(e.origin,t),bounds:Q(e.bounds,t),decorations:e.decorations.map(e=>({...e,from:qb(e.from,t),to:qb(e.to,t),...e.path?{path:e.path.map(e=>qb(e,t))}:{}})),...e.highlightFragments?{highlightFragments:e.highlightFragments.map(e=>({...e,rect:Q(e.rect,t)}))}:{},...e.ruby?{ruby:{...e.ruby,paintOps:e.ruby.paintOps.map(e=>({...e,origin:qb(e.origin,t)}))}}:{},...e.emphasis?{emphasis:{...e.emphasis,...e.emphasis.glyphs?{glyphs:e.emphasis.glyphs.map(e=>({...e,origin:qb(e.origin,t)}))}:{},...e.emphasis.paths?{paths:e.emphasis.paths.map(e=>({...e,points:e.points.map(e=>qb(e,t))}))}:{}}}:{},...e.runBorderFragments?{runBorderFragments:e.runBorderFragments.map(e=>Jb(e,t))}:{}}:e.kind===`anchor-host`?{...e,bounds:Q(e.bounds,t),baselinePt:e.baselinePt+t.yPt}:e.kind===`drawing`?{...e,bounds:Q(e.bounds,n?.get(e.drawingId)??t)}:e.kind===`tab`&&e.leaderGlyphs?{...e,...e.bounds?{bounds:Q(e.bounds,t)}:{},leaderGlyphs:e.leaderGlyphs.map(e=>({...e,origin:qb(e.origin,t)}))}:e.bounds?{...e,bounds:Q(e.bounds,t)}:e}function ex(e,t,n){return{...e,bounds:Q(e.bounds,t),baselinePt:e.baselinePt+t.yPt,placements:e.placements.map(e=>$b(e,t,n))}}function tx(e,t){let n=e.axes[t];return n.status===`resolved`&&[`page`,`margin`,`leftMargin`,`rightMargin`,`topMargin`,`bottomMargin`].includes(n.referenceFrame)}function nx(e,t){let n=tx(e,`horizontal`)?0:t.xPt,r=tx(e,`vertical`)?0:t.yPt,i={xPt:n,yPt:r},a={horizontal:e.axes.horizontal.status===`resolved`?{...e.axes.horizontal,baseStartPt:e.axes.horizontal.baseStartPt+n,baseEndPt:e.axes.horizontal.baseEndPt+n,resolvedOriginPt:e.axes.horizontal.resolvedOriginPt+n}:e.axes.horizontal,vertical:e.axes.vertical.status===`resolved`?{...e.axes.vertical,baseStartPt:e.axes.vertical.baseStartPt+r,baseEndPt:e.axes.vertical.baseEndPt+r,resolvedOriginPt:e.axes.vertical.resolvedOriginPt+r}:e.axes.vertical};return e.status===`unsupported`?{...e,axes:a}:{...e,axes:a,geometry:{...e.geometry,objectFrame:Q(e.geometry.objectFrame,i),inkBounds:Q(e.geometry.inkBounds,i),wrapBounds:e.geometry.wrapBounds?Q(e.geometry.wrapBounds,i):null,wrap:{...e.geometry.wrap,polygon:e.geometry.wrap.polygon?{...e.geometry.wrap.polygon,points:e.geometry.wrap.polygon.points.map(e=>qb(e,i))}:null}}}}function rx(e,t){return ix(e,t,{memo:new WeakMap,drawingMemo:new WeakMap})}function ix(e,t,n){let r=`${t.xPt}\\u0000${t.yPt}`,i=n.memo.get(e);if(i){if(i.key!==r)throw Error(`incompatible projection ownership`);return i.value}let a=new Map(e.drawings.flatMap(e=>e.anchorLayer?[[e.anchorLayer.occurrenceId,e.anchorLayer]]:[])),o=new Map,s=new Map;for(let n of e.drawings){let e={xPt:n.anchorLayer?.horizontalOwnership===`page`?0:t.xPt,yPt:n.anchorLayer?.verticalOwnership===`page`?0:t.yPt};s.set(n.id,e),n.textBoxIds?.forEach(t=>o.set(t,n.orientation===`upright-physical`?{xPt:0,yPt:0}:e))}let c=e.drawings.map(e=>Qb(e,s.get(e.id)??t,n)),l=Gb(c.filter(e=>e.anchorLayer?.cellContainment===!0).map(e=>e.flowBounds)),u={...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:Q(e.clipBounds,t)}:{},lines:e.lines.map(e=>ex(e,t,s)),borders:e.borders.map(e=>Jb(e,t)),drawings:c,...l?{cellContainmentBounds:l}:{},textBoxes:e.textBoxes.map(e=>ox(e,o.get(e.id)??t,n)),exclusions:e.exclusions.map(e=>{let n=e.anchorOccurrenceId?a.get(e.anchorOccurrenceId):void 0,r={xPt:n?.horizontalOwnership===`page`?0:t.xPt,yPt:e.verticalOwnership===`page`||n?.verticalOwnership===`page`?0:t.yPt};return{...e,bounds:Q(e.bounds,r),polygon:e.polygon.map(e=>qb(e,r))}}),...e.anchorCollisions?{anchorCollisions:e.anchorCollisions.map(e=>({...e,bounds:Q(e.bounds,{xPt:e.horizontalOwnership===`page`?0:t.xPt,yPt:e.verticalOwnership===`page`?0:t.yPt})}))}:{},...e.anchorFrames?{anchorFrames:e.anchorFrames.map(e=>nx(e,t))}:{},...e.paragraphMark?{paragraphMark:{...e.paragraphMark,bounds:Q(e.paragraphMark.bounds,t)}}:{},...e.lineNumbers?{lineNumbers:e.lineNumbers.map(e=>({...e,bounds:Q(e.bounds,t),paintOps:e.paintOps.map(e=>({...e,origin:qb(e.origin,t)}))}))}:{}};return n.memo.set(e,{key:r,value:u}),u}function ax(e,t){return ox(e,t,{memo:new WeakMap,drawingMemo:new WeakMap})}function ox(e,t,n){let r=e.verticalMode===void 0;return{...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:r?Q(e.clipBounds,t):e.clipBounds}:{},...e.contentBounds?{contentBounds:r?Q(e.contentBounds,t):e.contentBounds}:{},transform:r?e.transform:{...e.transform,e:e.transform.e+t.xPt,f:e.transform.f+t.yPt},story:r?{...e.story,flowBounds:Q(e.story.flowBounds,t),inkBounds:Q(e.story.inkBounds,t),...e.story.clipBounds?{clipBounds:Q(e.story.clipBounds,t)}:{},blocks:e.story.blocks.map(e=>{if(e.kind===`paragraph`)return ix(e,t,n);if(e.kind===`table`)return cx(e,t);throw Error(`Text-box story contains unsupported retained node: ${e.kind}`)})}:e.story}}function sx(e,t){return rx(e,t)}function cx(e,t){return{...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:Q(e.clipBounds,t)}:{},borders:e.borders.map(e=>Jb(e,t)),rows:e.rows.map(e=>({...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:Q(e.clipBounds,t)}:{},cells:e.cells.map(e=>({...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:Q(e.clipBounds,t)}:{},contentBounds:Q(e.contentBounds,t),blocks:e.blocks}))}))}}function lx(e,t){return`${e}/occurrence/${encodeURIComponent(t).replaceAll(`%3A`,`:`)}`}function ux(e){if(!Number.isFinite(e.xPt)||!Number.isFinite(e.yPt))throw RangeError(`body occurrence translation must be finite`)}function dx(e){if(e.occurrenceId.length===0)throw RangeError(`occurrenceId must not be empty`);if(e.destination.flowDomainId.length===0)throw RangeError(`flowDomainId must not be empty`);ux(e.destination.translation)}function fx(e,t){let n=Kb(e.positioning);return{xPt:n.x?t.xPt:0,yPt:n.y?t.yPt:0}}function px(e){let t=new WeakSet,n=new WeakSet,r=e=>{if(t.has(e))throw TypeError(`body occurrence layout graph must be acyclic`);if(!n.has(e)){if(t.add(e),e.kind===`paragraph`)for(let t of e.textBoxes)for(let e of t.story.blocks)(e.kind===`paragraph`||e.kind===`table`)&&r(e);else{for(let t of e.rows)for(let e of t.cells)for(let t of e.blocks)r(t.layout);for(let t of e.floatingTables??[])r(t.child);for(let t of e.resolvedFloatingTables??[])r(t.source.child),r(t.child)}t.delete(e),n.add(e)}};r(e)}function mx(e,t){px(e);let n=new WeakMap,r=new WeakMap,i=e=>`${e.xPt}\\u0000${e.yPt}`,a=(e,t)=>{let n=i(t),a=r.get(e);if(a){if(a.key!==n)throw Error(`incompatible projection ownership`);return a.value}let o=sx(e,t),s=Object.freeze({...o,...e.sectionFlowOwnership===void 0?{}:{sectionFlowOwnership:e.sectionFlowOwnership}});return r.set(e,{key:n,value:s}),s},o=(e,t)=>{let r=i(t),a=n.get(e);if(a){if(a.key!==r)throw Error(`incompatible projection ownership`);return a.value}let s={...cx(e,t),...e.sectionFlowOwnership===void 0?{}:{sectionFlowOwnership:e.sectionFlowOwnership}};n.set(e,{key:r,value:s});let c=new Map,l=new Set;for(let n of e.resolvedFloatingTables??[]){let r=e.resolvedFloatingTableCoordinateSpace!==void 0;c.set(n.source,r?{xPt:0,yPt:0}:fx(n.source,t)),r&&l.add(n.source)}let u=new Map,d=e=>{let n=u.get(e);if(n)return n;let r=c.get(e)??t,i=l.has(e)?{xPt:0,yPt:0}:t,a={...e,anchorBounds:Q(e.anchorBounds,i),...e.columnBounds?{columnBounds:Q(e.columnBounds,i)}:{},child:o(e.child,r)};return u.set(e,a),a},f=(e.floatingTables??[]).map(d),p=(e.resolvedFloatingTables??[]).map(e=>{let n=d(e.source),r=c.get(e.source)??fx(e.source,t);return{...e,xPt:e.xPt+r.xPt,yPt:e.yPt+r.yPt,bounds:Q(e.bounds,r),exclusionBounds:Q(e.exclusionBounds,r),child:n.child,source:n}});return(e.floatingTables||e.resolvedFloatingTables)&&Object.assign(s,{floatingTables:f,resolvedFloatingTables:p}),s};return e.kind===`paragraph`?a(e,t):o(e,t)}function hx(e,t){return ux(t),mx(e,t)}function gx(e,t){dx(t);let n=mx(e,t.destination.translation),r=encodeURIComponent(t.occurrenceId),i=new WeakMap,a=new WeakMap,o=new WeakMap,s=new Map,c=new Map,l=e=>`${t.occurrenceId}/node/${encodeURIComponent(e)}`,u=e=>`${t.occurrenceId}/anchor/${encodeURIComponent(e)}`,d=e=>lx(t.occurrenceId,e),f=(e,n)=>`${t.destination.flowDomainId}/occurrence/${r}/${e}/${encodeURIComponent(n)}`,p=e=>e.kind===`drawing`?{...e,drawingId:l(e.drawingId)}:e.kind===`anchor-host`&&e.anchorOccurrenceId?{...e,anchorOccurrenceId:u(e.anchorOccurrenceId)}:e,m=(e,t)=>{let n=o.get(e);if(n){if(n.domain!==t)throw Error(`incompatible projection ownership`);return n.value}if(e.anchorLayer){let t=s.get(e.anchorLayer.occurrenceId);if(t&&t!==e)throw Error(`duplicate anchor occurrence owner`);s.set(e.anchorLayer.occurrenceId,e)}let r={...e,id:l(e.id),flowDomainId:t,...e.textBoxIds?{textBoxIds:e.textBoxIds.map(l)}:{},...e.anchorLayer?{anchorLayer:{...e.anchorLayer,occurrenceId:u(e.anchorLayer.occurrenceId),acquisitionOccurrenceId:e.anchorLayer.acquisitionOccurrenceId??e.anchorLayer.occurrenceId}}:{}};return o.set(e,{domain:t,value:r}),r},h=e=>{let t=f(`textbox`,e.id);return{...e,id:l(e.id),flowDomainId:t,story:{...e.story,blocks:e.story.blocks.map(e=>{if(e.kind===`paragraph`)return g(e,t);if(e.kind===`table`)return b(e,t);throw Error(`Text-box story contains unsupported retained node: ${e.kind}`)})}}},g=(e,t)=>{let n=a.get(e);if(n){if(n.domain!==t)throw Error(`incompatible projection ownership`);return n.value}let r={...e,id:l(e.id),flowDomainId:t,lines:e.lines.map(e=>({...e,placements:e.placements.map(p)})),drawings:e.drawings.map(e=>m(e,t)),textBoxes:e.textBoxes.map(h),exclusions:e.exclusions.map(e=>({...e,id:e.verticalOwnership===`page`&&!e.anchorOccurrenceId?e.id:l(e.id),...e.anchorOccurrenceId?{anchorOccurrenceId:u(e.anchorOccurrenceId)}:{}})),...e.anchorCollisions?{anchorCollisions:e.anchorCollisions.map(e=>({...e,occurrenceId:u(e.occurrenceId)}))}:{},...e.anchorFrames?{anchorFrames:e.anchorFrames.map(e=>({...e,occurrenceId:u(e.occurrenceId)}))}:{}};return a.set(e,{domain:t,value:r}),r},_=e=>{let t=f(`cell`,e.id);return{...e,id:l(e.id),flowDomainId:t,blocks:e.blocks.map(e=>({...e,layout:x(e.layout,t)}))}},v=(e,t)=>({...e,id:l(e.id),flowDomainId:t,...`occurrenceId`in e&&typeof e.occurrenceId==`string`?{occurrenceId:d(e.occurrenceId)}:{},cells:e.cells.map(_)}),y=e=>{let t=f(`cell`,e.hostCellId);return{...e,occurrenceId:d(e.occurrenceId),hostCellId:l(e.hostCellId),tableId:l(e.tableId),child:b(e.child,t)}},b=(e,t)=>{let n=i.get(e);if(n){if(n.domain!==t)throw Error(`incompatible projection ownership`);return n.value}let r={...e,id:l(e.id),flowDomainId:t,rows:e.rows.map(e=>v(e,t))};i.set(e,{domain:t,value:r});let a=new Map,o=e=>{let t=a.get(e);if(t)return t;let n=c.get(e.occurrenceId);if(n&&n!==e)throw Error(`duplicate floating placement occurrence owner`);c.set(e.occurrenceId,e);let r=y(e);return a.set(e,r),r},s=(e.floatingTables??[]).map(o),u=(e.resolvedFloatingTables??[]).map(e=>{let t=o(e.source);return{...e,occurrenceId:d(e.occurrenceId),child:t.child,source:t}});return(e.floatingTables||e.resolvedFloatingTables)&&Object.assign(r,{floatingTables:s,resolvedFloatingTables:u}),r};function x(e,t){return e.kind===`paragraph`?g(e,t):b(e,t)}let S=Zc(x(n,t.destination.flowDomainId),`DOCX body occurrence projection`);if(S.kind!==`table`||e.kind!==`table`)return S;let C=Object.isFrozen(e.columnWidthsPt)?e.columnWidthsPt:Object.freeze([...e.columnWidthsPt]);return Object.freeze({...S,columnWidthsPt:C})}var _x=class extends Error{code=`NEXT_COLUMN_DESTINATION_UNAVAILABLE`;constructor(e,t,n,r){super(`nextColumn requires a following column on the current page, but column ${e+1} is unavailable (outgoing columns: ${t}, incoming columns: ${n}, reason: ${r})`),this.outgoingColumnIndex=e,this.outgoingColumnCount=t,this.incomingColumnCount=n,this.reason=r,this.name=`UnsupportedPageFlowTransitionError`}};function vx(e,t){return e.sectionBidi?[...t].reverse():[...t]}function yx(e){let t=vx(e.section,e.columnSubset);return t[t.indexOf(e.columnIndex)+1]}function bx(e,t={}){let n=Am(e),r=jm(e),i=t.pageContentStartBlockPt??n,a=t.pageContentEndBlockPt??r,o=t.regionStartBlockPt??i,s=t.regionEndBlockPt??a,c=t.cursorBlockPt??o,l=t.deepestColumnBlockPt??c,u=t.pageIndex??0,d=Object.freeze([...t.columnSubset??e.columns.map((e,t)=>t)]),f=vx(e,d),p=t.columnIndex??f[0]??-1;if(!Number.isInteger(u)||u<0)throw RangeError(`Page index must be a non-negative integer`);if(!Number.isInteger(p)||p<0||p>=e.columns.length)throw RangeError(`Column index must identify a column in the active section`);if(d.length===0||d.some((t,n)=>!Number.isInteger(t)||t<0||t>=e.columns.length||n>0&&t<=d[n-1])||!d.includes(p))throw RangeError(`Column subset must be ordered, unique, and contain the active column`);if(![i,a,o,s,c,l].every(Number.isFinite))throw RangeError(`Page-flow cursors and bounds must be finite`);if(i>o||o>s||s>a||o>c||c>s||c>l)throw RangeError(`Page-flow bounds must contain the region and live cursor`);return Object.freeze({pageIndex:u,columnIndex:p,pageHasContent:t.pageHasContent??!1,cursorBlockPt:c,pageContentStartBlockPt:i,pageContentEndBlockPt:a,regionStartBlockPt:o,regionEndBlockPt:s,columnSubset:d,deepestColumnBlockPt:l,section:e})}function xx(e,t){return Object.freeze({state:e,events:Object.freeze(t.map(e=>Object.freeze({...e})))})}function Sx(e,t,n){if(!Number.isFinite(n)||n<0)throw RangeError(`A flow node charge must be a finite non-negative value`);let r=e.cursorBlockPt,i=r+n;return xx(Object.freeze({...e,pageHasContent:!0,cursorBlockPt:i,deepestColumnBlockPt:Math.max(e.deepestColumnBlockPt,i)}),[{type:`place`,node:t,blockStartPt:r,blockEndPt:i}])}function Cx(e,t){let n=Math.max(e.deepestColumnBlockPt,e.cursorBlockPt),r=yx(e);if(r!==void 0)return xx(Object.freeze({...e,columnIndex:r,cursorBlockPt:e.regionStartBlockPt,deepestColumnBlockPt:n}),[{type:`next-column`}]);let i=e.pageIndex+1;return xx(bx(e.section,{pageIndex:i}),[{type:`next-page`,reason:t,pageIndex:i,sectionOccurrenceId:e.section.sectionOccurrenceId,parityBlank:!1}])}function wx(e,t){return e.kind===t.kind&&e.linePitchPt===t.linePitchPt&&e.charSpacePt===t.charSpacePt}function Tx(e,t){return e.xPt===t.xPt&&e.yPt===t.yPt&&e.widthPt===t.widthPt&&e.heightPt===t.heightPt}function Ex(e,t){return e.xPt<t.xPt+t.widthPt&&t.xPt<e.xPt+e.widthPt&&e.yPt<t.yPt+t.heightPt&&t.yPt<e.yPt+e.heightPt}function Dx(e,t,n){let r=n=>{throw new _x(e.columnIndex,e.section.columns.length,t.columns.length,n)},i=N_(e.section.textDirection),a=N_(t.textDirection);i!==a&&r(`writing-mode`);let o=z_({widthPt:e.section.geometry.pageWidth,heightPt:e.section.geometry.pageHeight},i),s=z_({widthPt:t.geometry.pageWidth,heightPt:t.geometry.pageHeight},a);(o.widthPt!==s.widthPt||o.heightPt!==s.heightPt)&&r(`page-extent`);let c=n.incomingPageContentStartBlockPt??Am(t),l=n.incomingPageContentEndBlockPt??jm(t);(c!==e.pageContentStartBlockPt||l!==e.pageContentEndBlockPt)&&r(`block-band`),wx(e.section.grid,t.grid)||r(`grid`);let u=vx(e.section,e.columnSubset),d=u.indexOf(e.columnIndex),f=u[d+1];if(f===void 0)throw Error(`nextColumn destination resolution requires a same-page successor`);let p=G_(i,o),m=e.section.columns[f],h=U_(p.logicalToPhysical,{xPt:m.xPt,yPt:e.regionStartBlockPt,widthPt:m.wPt,heightPt:e.regionEndBlockPt-e.regionStartBlockPt}),g=t.columns.findIndex(t=>Tx(h,U_(p.logicalToPhysical,{xPt:t.xPt,yPt:e.regionStartBlockPt,widthPt:t.wPt,heightPt:e.regionEndBlockPt-e.regionStartBlockPt})));g<0&&r(`physical-column`);let _=vx(t,t.columns.map((e,t)=>t)),v=_.indexOf(g);v<0&&r(`physical-column`);let y=Object.freeze(_.slice(v).sort((e,t)=>e-t)),b=Object.freeze(u.slice(0,d+1).sort((e,t)=>e-t)),x=(t,n)=>{let r=t.columns[n];return U_(p.logicalToPhysical,{xPt:r.xPt,yPt:e.regionStartBlockPt,widthPt:r.wPt,heightPt:e.regionEndBlockPt-e.regionStartBlockPt})},S=b.map(t=>x(e.section,t));return y.some(e=>{let n=x(t,e);return S.some(e=>Ex(e,n))})&&r(`physical-overlap`),Object.freeze({targetColumnIndex:g,targetColumnOrdinal:v,columnSubset:y,outgoingColumnSubset:b})}function Ox(e,t,n){let r=e.pageIndex+1;return xx(bx(t,{pageIndex:r}),[{type:`next-page`,reason:n,pageIndex:r,sectionOccurrenceId:t.sectionOccurrenceId,parityBlank:!1}])}function kx(e,t){let n=e%2==0;return t===`odd`?n:!n}function Ax(e,t,n,r){let i=e.pageIndex+1,a=[];return r!==void 0&&!kx(i,r)&&(a.push({type:`next-page`,reason:`parity`,pageIndex:i,sectionOccurrenceId:e.section.sectionOccurrenceId,parityBlank:!0}),i+=1),a.push({type:`next-page`,reason:n,pageIndex:i,sectionOccurrenceId:t.sectionOccurrenceId,parityBlank:!1}),xx(bx(t,{pageIndex:i}),a)}function jx(e,t,n){return t===`lastRenderedPageBreak`?xx(e,[]):t===`column`?Cx(e,`explicit-break`):t===`pageBreakBefore`&&!e.pageHasContent&&e.columnIndex===vx(e.section,e.columnSubset)[0]&&e.cursorBlockPt===e.pageContentStartBlockPt?xx(e,[]):t===`page`?Ax(e,e.section,`explicit-break`,n):Ox(e,e.section,`page-break-before`)}function Mx(e,t,n,r={}){if(n===`continuous`&&!r.hasFootnoteReferenceOnCurrentPage){let n=e.section.columns.length>1?Math.max(e.cursorBlockPt,e.deepestColumnBlockPt):e.cursorBlockPt;return xx(bx(t,{pageIndex:e.pageIndex,pageContentStartBlockPt:e.pageContentStartBlockPt,pageContentEndBlockPt:e.pageContentEndBlockPt,cursorBlockPt:n,regionStartBlockPt:n,regionEndBlockPt:e.pageContentEndBlockPt,deepestColumnBlockPt:n,pageHasContent:e.pageHasContent}),[{type:`begin-section`,placement:`same-page-block`,section:t,targetColumnOrdinal:0,columnSubset:t.columns.map((e,t)=>t)}])}if(n===`nextColumn`){if(yx(e)===void 0){let n=Ox(e,t,`section-break`);return xx(n.state,[...n.events,{type:`begin-section`,section:t}])}let n=Dx(e,t,r);return xx(Object.freeze({...e,columnIndex:n.targetColumnIndex,columnSubset:n.columnSubset,cursorBlockPt:e.regionStartBlockPt,deepestColumnBlockPt:Math.max(e.deepestColumnBlockPt,e.cursorBlockPt),section:t}),[{type:`next-column`},{type:`begin-section`,placement:`same-page-column`,section:t,targetColumnOrdinal:n.targetColumnOrdinal,columnSubset:n.columnSubset,outgoingColumnSubset:n.outgoingColumnSubset}])}if(n===`continuous`){let n=Ox(e,t,`section-break`);return xx(n.state,[...n.events,{type:`begin-section`,section:t}])}let i=Ax(e,t,`section-break`,n===`oddPage`?`odd`:n===`evenPage`?`even`:void 0);return xx(i.state,[...i.events,{type:`begin-section`,section:t}])}function Nx(e,t,n,r){let i=e,a=0;for(let o=e+1;o<=t;o++){let e=r(o);if(!(e<=n))break;i=o,a=e}return{end:i,fitValue:a}}function Px(e){return!e.widowControl||e.end>=e.totalLines?{kind:`keep`}:e.totalLines-e.end===1&&e.end-e.start>=2?{kind:`dropLastLine`}:e.start===0&&e.end-e.start===1&&e.canRelocate?{kind:`relocate`}:{kind:`keep`}}function Fx(e,t){let n=e.map(e=>Object.freeze({...e})),r=yd(n);return{lineWindow:({topYPt:e,minimumStartWidthPt:n,squareMinimumStartWidthPt:i,probeHeightPt:a,paragraphXPt:o,maximumWidthPt:s,columnXPt:c,columnWidthPt:l})=>{let u=Ld(e,n,a,o,s,r,c,c+l,t??{xLeftPt:o,xRightPt:o+s,readingDirection:`ltr`},i??n);return{topYPt:u.topY,xOffsetPt:u.xOffset,maximumWidthPt:u.maxWidth}},skipTopAndBottomBands:({yPt:e,columnXPt:t,columnWidthPt:r})=>Rd(e,n,t,t+r)}}function Ix(e){return{type:e.lineGrid.active?`lines`:null,linePitchPt:e.lineGrid.active?e.lineGrid.pitchPt:null,charSpacePt:e.characterGrid.active?e.characterGrid.deltaPt:null}}function Lx(e,t){if(!Xf(t))return e;let n=t.linePitchPt;return n<=0?e:e<=n?n:Math.ceil(e/n)*n}function Rx(e,t,n,r,i,a){let o=Ix(t),s=Math.max(1,n.availableWidthPt-t.physicalIndentLeftPt-t.physicalIndentRightPt),c=n.paragraphXPt+t.physicalIndentLeftPt,l=t.spaceBeforePt,u=t.spaceAfterPt,d=Object.freeze({...n}),f=r.fontFamilyClasses,p=i.documentHasEastAsianText===!0||i.useFeLayout===!0,m=n.startYPt+(n.suppressSpaceBefore?0:l);n.wrap&&(m=n.wrap.skipTopAndBottomBands({yPt:m,columnXPt:n.paragraphXPt,columnWidthPt:n.availableWidthPt}));let h=()=>{let a=m,h=rp(e,1,o,t.hasRuby,p,r.context,f,t.lineSpacing,i.resolvedLocalFonts,i.layoutServices?.text,i.paragraphMarkShapeInput);return n.wrap&&(a=n.wrap.lineWindow({topYPt:a,minimumStartWidthPt:Pf(e),squareMinimumStartWidthPt:Gu(Pf(e),1),probeHeightPt:h,paragraphXPt:c,maximumWidthPt:s,columnXPt:n.paragraphXPt,columnWidthPt:n.availableWidthPt}).topYPt),{lines:[],markOnly:!0,requestedSpaceBeforePt:l,requestedSpaceAfterPt:u,uniformRubyAdvancePt:0,contentStartYPt:a,contentEndYPt:a+h,lastLineBelowBaselinePt:ap(e,o,t.hasRuby,p,r.context,f,t.lineSpacing,i.resolvedLocalFonts,i.layoutServices?.text,i.paragraphMarkShapeInput),placement:d}},g=Op(e.runs,i);if(g.length===0)return h();let _=n.wrap?{startPageY:m,paraX:c,columnXPt:n.paragraphXPt,columnWidthPt:n.availableWidthPt,floats:[],paragraphMarkLineStartWidth:Gu(Pf(e),1),lineWindow:e=>n.wrap.lineWindow(e),lineBoxH:(e,n,r,i,a,s)=>$f(t.lineSpacing,e,n,1,o,t.hasRuby,i??0,t.hasRuby?t.hasEastAsianText:a??!1,s),pageH:n.maximumYPt}:void 0,v=kp(r.context,g,s,a?0:t.firstIndentPt,1,[...t.tabStops],_,f,t.physicalIndentLeftPt,t.kinsoku,t.characterGrid.active?t.characterGrid.deltaPt:0,t.defaultTabPt,s+t.physicalIndentRightPt,t.baseRtl,t.isJustified,t.stretchLastLine,a?.boundary,void 0,i.verticalGlyphMeasurement,t.overflowPunct!==!1);if(v.length===0)return h();let y=t.hasRuby?Lx(Math.max(0,...v.map(e=>$f(t.lineSpacing,e.ascent,e.descent,1,o,!0,e.intendedSingle,t.hasEastAsianText))),o):0;t.hasRuby&&a?.uniformRubyAdvancePt!==void 0&&(y=Math.max(y,a.uniformRubyAdvancePt));let b=[];for(let e of v){let n=e.topY!==void 0&&e.topY>m?e.topY:m,r=t.hasRuby?y:$f(t.lineSpacing,e.ascent,e.descent,1,o,!1,e.intendedSingle,e.eastAsian??!1,e.gridCountSingle);b.push({layout:e,topYPt:n,advancePt:r}),m=n+r}let x=b[b.length-1];return{lines:b,markOnly:!1,requestedSpaceBeforePt:l,requestedSpaceAfterPt:u,uniformRubyAdvancePt:y,contentStartYPt:b[0].topYPt,contentEndYPt:m,lastLineBelowBaselinePt:ip(x.advancePt,x.layout.ascent,x.layout.descent),placement:d}}function zx(e,t,n,r,i=-1/0,a=!0,o=!1){return Ds(e,t,{firstContentSi:n,lastDrawnSi:r,minPerGap:i,seaClusterGaps:o,...a?{}:{isGapChar:()=>!1}})}function Bx(e){if(!e)return 0;let t=0;for(let n of e.perSeg.values())t+=n.splitBefore.length+ +!!n.trailingGap;return e.perGap*t}function Vx(e,t,n,r,i){return t>=0?null:zx(e,t,n,r,-i*.25,!1)}const Hx=[`U`,`C`,`D`,`L`,`R`,`T`],Ux=[0,173,174,768,880,1155,1162,1425,1470,1471,1472,1473,1475,1476,1478,1479,1480,1552,1563,1564,1565,1568,1569,1570,1574,1575,1576,1577,1578,1583,1587,1600,1601,1608,1609,1611,1632,1646,1648,1649,1652,1653,1656,1672,1690,1728,1729,1731,1740,1741,1742,1743,1744,1746,1748,1749,1750,1757,1759,1765,1767,1769,1770,1774,1776,1786,1789,1791,1792,1807,1808,1809,1810,1813,1818,1822,1823,1832,1833,1834,1835,1836,1837,1839,1840,1867,1869,1870,1881,1884,1899,1901,1905,1906,1907,1909,1912,1914,1920,1958,1969,1994,2027,2036,2042,2043,2045,2046,2070,2074,2075,2084,2085,2088,2089,2094,2112,2113,2118,2120,2121,2122,2132,2133,2134,2137,2140,2144,2145,2146,2150,2151,2152,2153,2155,2160,2179,2182,2183,2185,2190,2191,2192,2199,2208,2218,2221,2222,2223,2225,2227,2233,2234,2249,2250,2274,2275,2307,2362,2363,2364,2365,2369,2377,2381,2382,2385,2392,2402,2404,2433,2434,2492,2493,2497,2501,2509,2510,2530,2532,2558,2559,2561,2563,2620,2621,2625,2627,2631,2633,2635,2638,2641,2642,2672,2674,2677,2678,2689,2691,2748,2749,2753,2758,2759,2761,2765,2766,2786,2788,2810,2816,2817,2818,2876,2877,2879,2880,2881,2885,2893,2894,2901,2903,2914,2916,2946,2947,3008,3009,3021,3022,3072,3073,3076,3077,3132,3133,3134,3137,3142,3145,3146,3150,3157,3159,3170,3172,3201,3202,3260,3261,3263,3264,3270,3271,3276,3278,3298,3300,3328,3330,3387,3389,3393,3397,3405,3406,3426,3428,3457,3458,3530,3531,3538,3541,3542,3543,3633,3634,3636,3643,3655,3663,3761,3762,3764,3773,3784,3791,3864,3866,3893,3894,3895,3896,3897,3898,3953,3967,3968,3973,3974,3976,3981,3992,3993,4029,4038,4039,4141,4145,4146,4152,4153,4155,4157,4159,4184,4186,4190,4193,4209,4213,4226,4227,4229,4231,4237,4238,4253,4254,4957,4960,5906,5909,5938,5940,5970,5972,6002,6004,6068,6070,6071,6078,6086,6087,6089,6100,6109,6110,6151,6152,6154,6155,6158,6159,6160,6176,6265,6277,6279,6313,6314,6315,6432,6435,6439,6441,6450,6451,6457,6460,6679,6681,6683,6684,6742,6743,6744,6751,6752,6753,6754,6755,6757,6765,6771,6781,6783,6784,6832,6878,6880,6892,6912,6916,6964,6965,6966,6971,6972,6973,6978,6979,7019,7028,7040,7042,7074,7078,7080,7082,7083,7086,7142,7143,7144,7146,7149,7150,7151,7154,7212,7220,7222,7224,7376,7379,7380,7393,7394,7401,7405,7406,7412,7413,7416,7418,7616,7680,8203,8204,8205,8206,8208,8234,8239,8288,8293,8298,8304,8400,8433,11503,11506,11647,11648,11744,11776,12330,12334,12441,12443,42607,42611,42612,42622,42654,42656,42736,42738,43010,43011,43014,43015,43019,43020,43045,43047,43052,43053,43072,43122,43123,43204,43206,43232,43250,43263,43264,43302,43310,43335,43346,43392,43395,43443,43444,43446,43450,43452,43454,43493,43494,43561,43567,43569,43571,43573,43575,43587,43588,43596,43597,43644,43645,43696,43697,43698,43701,43703,43705,43710,43712,43713,43714,43756,43758,43766,43767,44005,44006,44008,44009,44013,44014,64286,64287,65024,65040,65056,65072,65279,65280,65529,65532,66045,66046,66272,66273,66422,66427,68097,68100,68101,68103,68108,68112,68152,68155,68159,68160,68288,68293,68294,68295,68296,68297,68299,68301,68302,68307,68311,68312,68317,68318,68321,68322,68324,68325,68327,68331,68335,68336,68480,68481,68482,68483,68486,68489,68490,68492,68493,68494,68496,68497,68498,68521,68525,68527,68864,68865,68898,68899,68900,68904,68969,68974,69291,69293,69314,69315,69317,69318,69320,69370,69376,69424,69427,69428,69445,69446,69457,69460,69461,69488,69492,69494,69506,69510,69552,69553,69554,69556,69559,69560,69561,69563,69565,69566,69568,69569,69570,69572,69573,69577,69578,69579,69580,69633,69634,69688,69703,69744,69745,69747,69749,69759,69762,69811,69815,69817,69819,69826,69827,69888,69891,69927,69932,69933,69941,70003,70004,70016,70018,70070,70079,70089,70093,70095,70096,70191,70194,70196,70197,70198,70200,70206,70207,70209,70210,70367,70368,70371,70379,70400,70402,70459,70461,70464,70465,70502,70509,70512,70517,70587,70593,70606,70607,70608,70609,70610,70611,70625,70627,70712,70720,70722,70725,70726,70727,70750,70751,70835,70841,70842,70843,70847,70849,70850,70852,71090,71094,71100,71102,71103,71105,71132,71134,71219,71227,71229,71230,71231,71233,71339,71340,71341,71342,71344,71350,71351,71352,71453,71454,71455,71456,71458,71462,71463,71468,71727,71736,71737,71739,71995,71997,71998,71999,72003,72004,72148,72152,72154,72156,72160,72161,72193,72203,72243,72249,72251,72255,72263,72264,72273,72279,72281,72284,72330,72343,72344,72346,72544,72545,72546,72549,72550,72551,72752,72759,72760,72766,72767,72768,72850,72872,72874,72881,72882,72884,72885,72887,73009,73015,73018,73019,73020,73022,73023,73030,73031,73032,73104,73106,73109,73110,73111,73112,73459,73461,73472,73474,73526,73531,73536,73537,73538,73539,73562,73563,78896,78913,78919,78934,90398,90410,90413,90416,92912,92917,92976,92983,94031,94032,94095,94099,94180,94181,113821,113823,113824,113828,118528,118574,118576,118599,119143,119146,119155,119171,119173,119180,119210,119214,119362,119365,121344,121399,121403,121453,121461,121462,121476,121477,121499,121504,121505,121520,122880,122887,122888,122905,122907,122914,122915,122917,122918,122923,123023,123024,123184,123191,123566,123567,123628,123632,124140,124144,124398,124400,124643,124644,124646,124647,124654,124656,124661,124662,125136,125143,125184,125252,125260,917505,917506,917536,917632,917760,918e3],Wx=[0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,2,0,4,2,4,2,4,2,4,2,1,2,4,2,5,0,2,5,4,0,4,2,4,2,4,2,4,2,4,2,4,2,4,0,4,5,0,5,0,5,0,5,4,0,2,0,2,0,5,4,5,2,4,2,4,2,4,2,4,2,4,2,4,5,0,4,2,4,2,4,2,4,2,4,2,4,2,0,5,0,2,5,0,1,0,5,0,5,0,5,0,5,0,5,0,4,2,4,2,4,2,4,2,4,5,0,2,0,2,0,4,2,4,0,4,1,2,0,2,4,2,0,5,2,4,0,4,2,4,2,4,2,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,2,0,1,5,0,5,0,2,0,5,2,5,2,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,1,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,2,3,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,2,4,0,4,0,4,0,3,4,2,3,2,4,2,4,0,4,5,0,2,4,0,2,4,2,4,2,4,2,4,2,4,2,4,0,4,2,0,3,2,4,2,5,0,5,0,5,0,4,2,0,2,0,5,0,2,4,2,0,5,2,4,0,2,4,2,5,0,2,0,2,4,0,2,4,2,4,2,0,2,4,2,0,4,2,3,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,2,5,0,5,0,5,0,5,0],Gx=[1587,1588,1589,1590,1690,1691,1692,1693,1694,1786,1787,1884,1901,1904,1917,1918,2223],Kx=[1580,1581,1582,1665,1666,1667,1668,1669,1670,1671,1727,1879,1880,1902,1903,1906,1916,2186,2210,2241,2245,2246],qx=[1576,1578,1579,1646,1657,1658,1659,1660,1661,1662,1663,1664,1872,1873,1874,1875,1876,1877,1878,2208,2209,2230,2231,2232,2238,2239,2240],Jx=[1574,1585,1586,1597,1598,1599,1609,1610,1656,1681,1682,1683,1684,1685,1686,1687,1688,1689,1740,1742,1744,1745,1775,1883,1899,1900,1905,1909,1910,1911,2216,2217,2218,2226,2233,2234,69319],Yx=[1570,1571,1573,1575,1591,1592,1595,1596,1603,1604,1649,1650,1651,1653,1695,1705,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1718,1719,1720,1890,1891,1892,1898,1907,1908,1919,2160,2161,2162,2163,2164,2165,2166,2167,2168,2169,2170,2171,2172,2173,2174,2175,2176,2177,2178,2187,2188,2189,2211,2214,2224,2228,2242,2247,2248,69315,69316],Xx=[1572,1593,1594,1601,1602,1608,1647,1654,1655,1696,1697,1698,1699,1700,1701,1702,1703,1704,1732,1733,1734,1735,1736,1737,1738,1739,1743,1788,1885,1886,1887,1888,1889,1912,1913,2212,2213,2219,2227,2229,2243];function Zx(e){let t=0,n=Ux.length-1,r=-1;for(;t<=n;){let i=t+(n-t>>1);Ux[i]<=e?(r=i,t=i+1):n=i-1}return r<0?`U`:Hx[Wx[r]]??`U`}function Qx(e){let t=Zx(e);return t===`D`||t===`L`||t===`C`}function $x(e){let t=Zx(e);return t===`D`||t===`R`||t===`C`}const eS=new Set([1575,1570,1571,1573,1649]),tS=new Set(Gx),nS=new Set(Kx),rS=new Set(qx),iS=new Set(Jx),aS=new Set(Yx),oS=new Set(Xx);var sS=function(e){return e[e.Normal=7]=`Normal`,e[e.Waw=8]=`Waw`,e[e.BaRa=9]=`BaRa`,e[e.Alef=10]=`Alef`,e[e.HahDal=11]=`HahDal`,e[e.Seen=12]=`Seen`,e[e.Kashida=13]=`Kashida`,e}(sS||{});function cS(e){let t=[...e].map(e=>e.codePointAt(0)),n=[],r=t.length>0&&Zx(t[0])!==`T`?0:-1;for(let e=1;e<t.length;e++){let i=t[e];if(Zx(i)!==`T`){if(r>=0){let a=t[r];!(a===1604&&eS.has(i))&&Qx(a)&&$x(i)&&n.push(e)}r=e}}return n}function lS(e,t,n){let r=t-1;for(;r>=0&&Zx(e[r])===`T`;)r--;let i=e[r],a=e[t];return i===1600?sS.Kashida:tS.has(i)?sS.Seen:nS.has(i)?sS.HahDal:gf(t,n)&&aS.has(a)?sS.Alef:rS.has(i)&&iS.has(a)?sS.BaRa:gf(t,n)&&oS.has(a)?sS.Waw:sS.Normal}function uS(e){let t=[...e],n=[];for(let e=0;e<t.length;){for(;e<t.length&&/\\s/u.test(t[e]);)e++;if(e>=t.length)break;let r=e+1;for(;r<t.length&&!/\\s/u.test(t[r]);)r++;let i=t.slice(e,r),a=i.map(e=>e.codePointAt(0)),o=a.length-1;for(;o>=0&&Zx(a[o])===`T`;)o--;let s=-1,c=-1;for(let e of cS(i.join(``))){let t=lS(a,e,o);t>=c&&(s=e,c=t)}s>=0&&n.push({beforeCp:e+s,priority:c}),e=r}return n}function dS(e,t){let n=[...e],r=``;for(let e=0;e<n.length;e++){let i=t.get(e)??0;i>0&&(r+=`ـ`.repeat(i)),r+=n[e]}return r}function fS(e,t,n,r){if(t<=.5)return null;let i=[];for(let t=0;t<e.length;t++){let n=e[t].text;if(n!==void 0)for(let{beforeCp:e,priority:r}of uS(n))i.push({si:t,beforeCp:e,priority:r,textOrder:i.length})}if(i.length===0)return null;i.sort((e,t)=>t.priority-e.priority||e.textOrder-t.textOrder);let a=n===`low`?1:n===`medium`?2:1/0,o=a,s=i.length*64,c=new Map,l=new Map,u=new Map;for(let{si:t}of i){if(u.has(t))continue;let n=r(t,e[t].text);l.set(t,n),u.set(t,n)}let d=t,f=0;for(let t=0;t<o&&d>.5&&f<s;t++){let t=!1;for(let{si:n,beforeCp:o}of i){if(d<=.5||f>=s)break;let i=c.get(n);i||(i=new Map,c.set(n,i));let l=i.get(o)??0;if(l>=a)continue;i.set(o,l+1);let p=r(n,dS(e[n].text,i)),m=p-u.get(n);m>0&&m<=d+1e-6?(u.set(n,p),d-=m,f++,t=!0):l===0?i.delete(o):i.set(o,l)}if(!t)break}let p=new Map;for(let[t,n]of c){let r=[...n.entries()].filter(([,e])=>e>0).sort(([e],[t])=>e-t).map(([e,t])=>({beforeCp:e,count:t}));r.length!==0&&p.set(t,{text:dS(e[t].text,n),insertions:r,advanceDeltaPx:u.get(t)-l.get(t)})}if(p.size===0)return null;let m=[...p.values()].reduce((e,t)=>e+t.advanceDeltaPx,0);return{perSeg:p,appliedPx:m,residualPx:t-m}}function pS(e){return Object.freeze({status:`unsupported`,command:Object.freeze({kind:`noop`}),diagnostics:Object.freeze([Object.freeze({code:`UNSUPPORTED_FEATURE`,severity:`error`,message:e})])})}function mS(e){return e?{type:e.type,w:e.w,len:e.len}:void 0}function hS(e){return!e.stroke||!e.strokeWidth||e.strokeWidth<=0?null:{color:e.stroke,width:e.strokeWidth,...e.strokeDash?{dashStyle:e.strokeDash}:{},...e.strokeCap?{lineCap:e.strokeCap}:{},...mS(e.headEnd)?{headEnd:mS(e.headEnd)}:{},...mS(e.tailEnd)?{tailEnd:mS(e.tailEnd)}:{}}}function gS(e,t,n,r){let i=r!==void 0&&(r.textPathOk!==void 0||r.on!==void 0||r.fitShape!==void 0||r.fitPath!==void 0||r.trim!==void 0||r.xScale!==void 0);if(r!==void 0&&(!i||r.textPathOk===!0&&r.on===!0)){if(r.fitPath===!0)return pS(`VML textPath fitPath=true is not rendered`);if(r.xScale===!0)return pS(`VML textPath xScale=true is not rendered`);if(r.string.trim().length===0)return Object.freeze({status:`planned`,command:Object.freeze({kind:`noop`})});if(!n)throw Error(`Shape textPath acquisition requires TextLayoutService`);let a=i?r.fitShape===!0:!0;if(r.fontSizePt!==void 0&&(!Number.isFinite(r.fontSizePt)||r.fontSizePt<0))throw RangeError(`VML textPath fontSizePt must be finite and non-negative`);if(!a&&r.fontSizePt===void 0)return pS(`VML textPath fitShape=false requires an authored font-size`);if(r.fontSizePt===0)return Object.freeze({status:`planned`,command:Object.freeze({kind:`noop`})});let o=r.fontSizePt??1,s=r.fontFamily??void 0,c=n.shape({text:r.string,fontSizePt:o,fonts:{ascii:s,highAnsi:s,eastAsia:s,complexScript:s},weight:r.bold?700:400,style:r.italic?`italic`:`normal`,measure:!0});if(r.trim===!0&&!c.inkBounds)return pS(`VML textPath trim=true requires glyph ink bounds`);let l=r.trim===!0?c.inkBounds?.xMinPt??0:0,u=r.trim===!0?c.inkBounds?.xMaxPt??0:c.advancePt,d=r.trim===!0?c.inkBounds?.ascentPt??0:c.ascentPt,f=r.trim===!0?c.inkBounds?.descentPt??0:c.descentPt,p={xPt:l,yPt:-d,widthPt:u-l,heightPt:d+f};if(!Number.isFinite(c.advancePt)||Object.values(p).some(e=>!Number.isFinite(e))||c.spans.some(e=>!Number.isFinite(e.advancePt)))throw Error(`Shape textPath acquisition produced non-finite metrics`);return p.widthPt<=0||p.heightPt<=0||c.spans.length===0?pS(`VML textPath produced empty glyph metrics`):Object.freeze({status:`planned`,command:Zc({kind:`watermark-text`,rect:{...t},text:r.string,fill:e.fill?{...e.fill,...e.fill.fillType===`gradient`?{stops:e.fill.stops.map(e=>({...e}))}:{}}:null,opacity:Math.max(0,Math.min(1,e.fillOpacity??1)),rotationDeg:e.rotation??0,fitShape:a,fontSizePt:o,sourceBounds:p,spans:c.spans.map(e=>({text:e.text,advancePt:e.advancePt,fontRoute:e.fontRoute,fontWeight:e.font.weight,fontStyle:e.font.style}))},`VML textPath command`)})}let a={rect:{x:t.xPt,y:t.yPt,w:t.widthPt,h:t.heightPt},geometry:e.presetGeometry?{kind:`preset`,name:e.presetGeometry,adjustments:[...e.adjValues??[]]}:{kind:`custom`,subpaths:e.subpaths.map(e=>e.map(e=>({...e})))},fill:e.fill?{...e.fill,...e.fill.fillType===`gradient`?{stops:e.fill.stops.map(e=>({...e}))}:{}}:null,stroke:hS(e),transform:{rotationDeg:e.rotation??0,flipH:e.flipH??!1,flipV:e.flipV??!1}};return Object.freeze({status:`planned`,command:Zc({kind:`drawingml-shape`,plan:a},`DrawingML shape command`)})}function _S(e){if(!Number.isFinite(e.advancePt)||e.advancePt<=0)throw RangeError(`Tab leader glyph advance must be finite and positive`);let t=Math.floor(e.interval.widthPt/e.advancePt),n=e.interval.widthPt-t*e.advancePt;return Array.from({length:t},(t,r)=>({text:e.glyph,origin:{xPt:e.interval.xPt+n/2+r*e.advancePt,yPt:e.baselinePt},fontRoute:e.fontRoute,fontSizePt:e.fontSizePt,fontWeight:e.fontWeight,fontStyle:e.fontStyle,color:e.color}))}function vS(e){let t;if(e.raisePt!==void 0)t=e.baseOrigin.yPt-e.raisePt;else if(e.baseInkTopPt!==void 0&&e.guideInkBottomFromBaselinePt!==void 0)t=e.baseInkTopPt-e.guideInkBottomFromBaselinePt;else throw Error(`Ruby geometry requires authored w:hpsRaise or retained base/guide ink bounds`);let n=e.baseOrigin.xPt+(e.baseAdvancePt-e.guideAdvancePt)/2;return e.spans.map(e=>({text:e.text,origin:{xPt:n+e.offsetPt,yPt:t},fontRoute:e.fontRoute,fontSizePt:e.fontSizePt,fontWeight:e.fontWeight,fontStyle:e.fontStyle,color:e.color}))}function yS(e){return-(e.inkBounds?.ascentPt??e.ascentPt)}function bS(e){return e.inkBounds?.descentPt??e.descentPt}function xS(e){let t=e.inkBounds?e.inkBounds.ascentPt+e.inkBounds.descentPt:Math.min(e.ascentPt,e.descentPt);if(!Number.isFinite(t)||t<=0)throw Error(`Retained decoration probe requires positive selected-face ink`);return t}function SS(e){return e===`double`||e===`dbl`?`double`:e?.includes(`dot`)?`dotted`:e?.includes(`dash`)?`dashed`:e?.includes(`wave`)?`wavy`:`solid`}function CS(e,t,n){let r=Math.max(0,t.xPt-e.xPt),i=n*2,a=Math.max(1,Math.ceil(r/i));return Array.from({length:a+1},(t,i)=>({xPt:e.xPt+r*i/a,yPt:e.yPt+(i%2==0?-n/2:n/2)}))}function wS(e){let t=[],n=e.origin.xPt+e.advancePt;if(e.underline){let r=xS(e.underline.probe),i=e.origin.yPt+(yS(e.underline.probe)+bS(e.underline.probe))/2,a=e.origin.yPt+bS(e.base)+r/2,o=Math.max(i,a),s=SS(e.underline.authoredStyle),c={kind:`underline`,...e.underline.authoredStyle===void 0?{}:{authoredStyle:e.underline.authoredStyle},color:e.underline.color,widthPt:r};if(s===`double`){let i=o+r*2;t.push({...c,style:`solid`,from:{xPt:e.origin.xPt,yPt:o},to:{xPt:n,yPt:o}},{...c,style:`solid`,from:{xPt:e.origin.xPt,yPt:i},to:{xPt:n,yPt:i}})}else{let i={xPt:e.origin.xPt,yPt:o},a={xPt:n,yPt:o};t.push({...c,style:s,from:i,to:a,...s===`wavy`?{path:CS(i,a,r)}:{},...s===`dotted`?{dashPatternPt:[r,r*2]}:{},...s===`dashed`?{dashPatternPt:[r*4,r*3]}:{}})}}if(e.strike){let r=xS(e.strike.probe);if(e.strike.double&&e.strike.doubleProbe){let i=e.origin.yPt+yS(e.strike.doubleProbe)+r/2,a=e.origin.yPt+bS(e.strike.doubleProbe)-r/2;for(let o of[i,a])t.push({kind:`strikethrough`,color:e.color,widthPt:r,style:`solid`,from:{xPt:e.origin.xPt,yPt:o},to:{xPt:n,yPt:o}})}else{let i=e.origin.yPt+(yS(e.strike.probe)+bS(e.strike.probe))/2;t.push({kind:`strikethrough`,color:e.color,widthPt:r,style:`solid`,from:{xPt:e.origin.xPt,yPt:i},to:{xPt:n,yPt:i}})}}return t}function TS(e){let t=e.mark.inkBounds.xMaxPt-e.mark.inkBounds.xMinPt,n=e.mark.inkBounds.ascentPt+e.mark.inkBounds.descentPt;if(!(t>0)||!(n>0))throw Error(`Retained emphasis glyph requires positive selected-face ink bounds`);let r=[];for(let t of e.clusterInk){if(/^\\s+$/u.test(t.text))continue;let n=e.clusters.find(e=>e.range.start===t.range.start&&e.range.end===t.range.end);if(!n)throw Error(`Retained emphasis cluster ink does not match shaped cluster geometry`);let i=(e.origin.xPt+n.offset.xPt+t.ink.xMinPt*e.scaleX+(e.origin.xPt+n.offset.xPt+t.ink.xMaxPt*e.scaleX))/2-(e.mark.inkBounds.xMinPt+e.mark.inkBounds.xMaxPt)/2,a=e.authored===`underDot`?e.origin.yPt+t.ink.descentPt+e.mark.inkBounds.ascentPt:e.origin.yPt-t.ink.ascentPt-e.mark.inkBounds.descentPt;r.push({text:e.glyph,origin:{xPt:i,yPt:a},fontRoute:e.mark.fontRoute,fontSizePt:e.mark.fontSizePt,fontWeight:e.mark.fontWeight,fontStyle:e.mark.fontStyle,color:e.mark.color,inkBounds:e.mark.inkBounds})}return r}function ES(e,t){return e.val===t.val&&e.color===t.color&&e.widthPt===t.widthPt&&e.spacePt===t.spacePt&&e.themeColor===t.themeColor&&e.themeTint===t.themeTint&&e.themeShade===t.themeShade&&e.shadow===t.shadow&&e.frame===t.frame}function DS(e){let t=[],n=0;for(;n<e.length;){let r=e[n],i=n+1,a=r.bounds.xPt+r.bounds.widthPt+r.trailingSlackPt;for(;i<e.length;){let t=e[i];if(!ES(r.border,t.border)||Math.abs(t.bounds.xPt-a)>1e-6||t.bounds.yPt!==r.bounds.yPt||t.bounds.heightPt!==r.bounds.heightPt)break;a=t.bounds.xPt+t.bounds.widthPt+t.trailingSlackPt,i+=1}let o=r.bounds.xPt-r.border.spacePt,s=r.bounds.yPt-r.border.spacePt,c=a+r.border.spacePt,l=r.bounds.yPt+r.bounds.heightPt+r.border.spacePt,u={color:r.border.color,widthPt:r.border.widthPt,...J_(r.border.val,r.border.widthPt)};t.push({...u,edge:`top`,from:{xPt:o,yPt:s},to:{xPt:c,yPt:s}},{...u,edge:`right`,from:{xPt:c,yPt:s},to:{xPt:c,yPt:l}},{...u,edge:`bottom`,from:{xPt:o,yPt:l},to:{xPt:c,yPt:l}},{...u,edge:`left`,from:{xPt:o,yPt:s},to:{xPt:o,yPt:l}}),n=i}return t}const OS=Y({id:`word-zero-relative-size`,evidence:{kind:`regression-test`,reference:`packages/docx/src/layout/anchor-frame.test.ts#uses wp:extent when Word does not support an exact-zero relative size`},description:`Word 2010 accepts only positive wp14:pctWidth and wp14:pctHeight values under [MS-ODRAWXML] notes 125/126. Preserve an authored zero as acquisition evidence while resolving the object from wp:extent.`});Y({id:`word-vertical-section-physical-drawing-layer`,evidence:{kind:`regression-test`,reference:`packages/docx/src/anchor-vertical-physical.test.ts#lands an upright-section anchor at the recorded physical centroid`},description:`Resolve anchored drawings in an upright vertical section against the physical page frame independently of the rotated text-flow coordinate space.`}),Y({id:`word-page-level-float-prescan`,evidence:{kind:`regression-test`,reference:`packages/docx/src/page-anchor-prescan.test.ts#pre-scan REGISTERS a page-level (relativeFrom=\"margin\") wrap float on an earlier-scanned paragraph`},description:`A wrapping drawing whose vertical reference is page-level participates from page start so source-earlier paragraphs on that page see its exclusion.`}),Y({id:`word-paragraph-anchor-pre-spacing-origin`,evidence:{kind:`regression-test`,reference:`packages/docx/src/anchor-paragraph-spacebefore.test.ts#anchors a wrapSquare paragraph float at the pre-spaceBefore paragraph top`},description:`Resolve a paragraph-relative anchored drawing from the paragraph top before applying the paragraph spaceBefore contribution.`}),Y({id:`word-vertical-section-physical-header-footer`,evidence:{kind:`regression-test`,reference:`packages/docx/src/vertical-header-footer.test.ts#recovers the physical page box + margins from the logical (swapped) section`},description:`Paint a vertical section header and footer in the unrotated physical page frame rather than rotating them with the body text flow.`}),Y({id:`word-frame-auto-wrap-around`,evidence:{kind:`regression-test`,reference:`packages/docx/src/frame-geometry.test.ts#wrap=\"around\" and \"auto\" → square float (auto ≡ around in Word)`},description:`Resolve an authored frame wrap value of auto through the same square side-wrap path as around.`}),Y({id:`word-lower-layer-same-paragraph-anchor-composition`,evidence:{kind:`office-observation`,syntheticFixtureId:`lower-layer-same-paragraph-anchor-composition`,application:`Microsoft Word`,version:`16.111.1`,platform:`macOS 26.5.2`},description:`Word preserves a source-later, lower-z, page-owned drawing at its authored position when it belongs to the same anchor paragraph as already composed higher layers. This is a Word-observed compatibility override to ECMA-376 §20.4.2.3, not a normative OOXML rule.`}),Y({id:`word-textbox-visible-anchor-extent`,evidence:{kind:`office-observation`,syntheticFixtureId:`textbox-visible-anchor-extent`,application:`Microsoft Word`,version:`16.111.1`,platform:`macOS 26.5.2`},description:`For DrawingML middle and bottom text anchoring, derive the positioned extent through the last visible retained block while preserving structural trailing empty paragraphs and terminal paragraph spacing in the complete story.`});function kS(e){return e.shading||e.borders.length>0||e.resources.length>0||e.drawings.length>0||e.textBoxes.length>0||e.lineNumbers?.some(e=>e.paintOps.length>0)?!0:e.lines.some(e=>e.placements.some(e=>e.kind===`text`||e.kind===`resource`||e.kind===`drawing`?!0:e.kind===`tab`&&(e.leaderGlyphs?.length??0)>0))}function AS(e){let t=e.flowBounds.yPt,n;for(let r of e.blocks){if(r.kind===`table`){n=Math.max(n??t,r.flowBounds.yPt+r.advancePt);continue}r.kind!==`paragraph`||!kS(r)||(n=Math.max(n??t,r.flowBounds.yPt+Math.max(0,r.advancePt-r.spacing.afterPt)))}return n===void 0?0:Math.max(0,n-t)}function jS(e){return e===0}function MS(e,t){return e==null?!t:e!==`paragraph`&&e!==`line`&&e!==`character`}function NS(e,t,n){return e===`page`&&t!==null&&n!==void 0&&t<n}const PS=21600;function $(e,t,n){return{code:e,path:t,message:n}}function FS(e){return typeof e==`number`&&Number.isFinite(e)}function IS(e){return FS(e.xPt)&&FS(e.yPt)&&FS(e.widthPt)&&FS(e.heightPt)&&e.widthPt>=0&&e.heightPt>=0}function LS(e){return e.kind===`align`?e.value:e.kind===`offset`?e.valuePt:e.kind===`percent`?e.fraction:null}function RS(e,t,n,r=!1){let i=t[e];return{axis:e,status:`unsupported`,relativeFrom:r?`page`:i.relativeFrom,choiceKind:r?`simple-position`:i.choice.kind,choiceValue:r?e===`horizontal`?t.simplePosition.xPt:t.simplePosition.yPt:LS(i.choice),issueCode:n.code}}function zS(e,t,n,r){let i=n[e];return i===null?{problem:$(`missing-reference-frame`,r,`${e} frame is required`)}:IS(i)?{base:{startPt:t===`horizontal`?i.xPt:i.yPt,endPt:t===`horizontal`?i.xPt+i.widthPt:i.yPt+i.heightPt,referenceFrame:e}}:{problem:$(`invalid-reference-frame`,r,`${e} frame must be finite and non-negative`)}}function BS(e,t,n,r){let i=zS(`page`,t,n,r);if(!i.base)return i;let a=zS(`margin`,t,n,r);if(!a.base)return a;let o=n.page,s=n.margin,c=e===`leftMargin`||e===`rightMargin`;if(c!==(t===`horizontal`))return{problem:$(`unsupported-relative-from`,r,`${e} is not valid for the ${t} axis`)};let l=c?o.xPt:o.yPt,u=c?o.xPt+o.widthPt:o.yPt+o.heightPt,d=c?s.xPt:s.yPt,f=c?s.xPt+s.widthPt:s.yPt+s.heightPt;if(d<l||f>u)return{problem:$(`invalid-reference-frame`,r,`margin frame must be contained by the page frame`)};let p=e===`leftMargin`||e===`topMargin`;return{base:{startPt:p?l:f,endPt:p?d:u,referenceFrame:e}}}function VS(e,t,n,r){if(t===`page`||t===`margin`||e===`horizontal`&&(t===`column`||t===`character`)||e===`vertical`&&(t===`paragraph`||t===`line`))return zS(t,e,n,r);if(e===`horizontal`&&(t===`leftMargin`||t===`rightMargin`)||e===`vertical`&&(t===`topMargin`||t===`bottomMargin`))return BS(t,e,n,r);if(t===`insideMargin`||t===`outsideMargin`){if(n.pageParity===null)return{problem:$(`missing-page-parity`,r,`${t} requires explicit page parity`)};let i=t===`insideMargin`==(n.pageParity===`odd`);return{...BS(e===`horizontal`?i?`leftMargin`:`rightMargin`:i?`topMargin`:`bottomMargin`,e,n,r),parityRequired:!0}}return{problem:$(`unsupported-relative-from`,r,`${t} is not a valid ${e} reference`)}}function HS(e,t,n){let r=t.relativeSize[e],i=e===`horizontal`?`width`:`height`,a=(n=null)=>{let r=e===`horizontal`?t.extent.widthStatus:t.extent.heightStatus,a=e===`horizontal`?t.extent.widthPt:t.extent.heightPt;return r===`missing`?{problem:$(`missing-size`,`extent.${i}`,`${i} is required`)}:r!==`valid`||!FS(a)||a<=0?{problem:$(`invalid-size`,`extent.${i}`,`${i} extent must be finite and positive`)}:{resolved:{valuePt:a,diagnostic:{source:`extent`,valuePt:a,relativeFrom:n?.relativeFrom??null,referenceFrame:null,fraction:n?.fraction??null,...n===null?{}:{compatibilityFallback:OS.id}}}}};if(r===null)return a();let o=`relativeSize.${e}`;if(r.fractionStatus===`missing`||r.fraction===null)return{problem:$(`missing-relative-size-fraction`,`${o}.fraction`,`relative size fraction is required`)};if(r.fractionStatus!==`valid`||!FS(r.fraction))return{problem:$(`invalid-relative-size-fraction`,`${o}.fraction`,`relative size fraction must be finite`)};if(r.fraction<0)return{problem:$(`invalid-relative-size-fraction`,`${o}.fraction`,`relative size fraction must be non-negative`)};if(jS(r.fraction))return a({relativeFrom:r.relativeFrom,fraction:r.fraction});if(r.relativeFromStatus===`missing`||r.relativeFrom===null)return{problem:$(`missing-relative-size-reference`,`${o}.relativeFrom`,`relative size reference is required`)};if(r.relativeFromStatus!==`valid`)return{problem:$(`invalid-relative-size-reference`,`${o}.relativeFrom`,`relative size reference is invalid`)};let s=VS(e,r.relativeFrom,n,`${o}.relativeFrom`);if(!s.base)return{problem:$(s.problem?.code===`missing-reference-frame`?`missing-relative-size-reference`:`invalid-relative-size-reference`,`${o}.relativeFrom`,s.problem?.message??`relative size reference cannot be resolved`)};let c=(s.base.endPt-s.base.startPt)*r.fraction;return!FS(c)||c<0?{problem:$(`invalid-relative-size-fraction`,`${o}.fraction`,`relative size result must be finite and non-negative`)}:{resolved:{valuePt:c,diagnostic:{source:`relative`,valuePt:c,relativeFrom:r.relativeFrom,referenceFrame:s.base.referenceFrame,fraction:r.fraction}}}}function US(e,t,n,r){let i=n[e],a=e;if(i.relativeFromStatus===`missing`||i.relativeFrom===null){let t=$(`missing-relative-from`,`${a}.relativeFrom`,`${e} relativeFrom is required`);return{diagnostic:RS(e,n,t),problem:t}}if(i.relativeFromStatus!==`valid`){let t=$(`invalid-relative-from`,`${a}.relativeFrom`,`${e} relativeFrom is invalid`);return{diagnostic:RS(e,n,t),problem:t}}let o=VS(e,i.relativeFrom,r,`${a}.relativeFrom`);if(!o.base){let t=o.problem;return{diagnostic:RS(e,n,t),problem:t}}let s=i.choice;if(s.kind===`missing`){let t=$(`missing-axis-choice`,`${a}.choice`,`${e} choice is required`);return{diagnostic:RS(e,n,t),problem:t}}if(s.kind===`invalid`){let t=$(`invalid-axis-choice`,`${a}.choice`,`${e} choice is invalid`);return{diagnostic:RS(e,n,t),problem:t}}let c=o.base.endPt-o.base.startPt,l,u;if(s.kind===`offset`){if(!FS(s.valuePt)){let t=$(`invalid-axis-value`,`${a}.choice`,`offset must be finite`);return{diagnostic:RS(e,n,t),problem:t}}l=o.base.startPt+s.valuePt,u=s.valuePt}else if(s.kind===`percent`){if(!FS(s.fraction)){let t=$(`invalid-axis-value`,`${a}.choice`,`percentage must be finite`);return{diagnostic:RS(e,n,t),problem:t}}l=o.base.startPt+c*s.fraction,u=s.fraction}else if(s.kind===`align`){if(!(e===`horizontal`?[`left`,`center`,`right`,`inside`,`outside`].includes(s.value):[`top`,`center`,`bottom`,`inside`,`outside`].includes(s.value))){let t=$(`invalid-axis-value`,`${a}.choice`,`${s.value} is invalid`);return{diagnostic:RS(e,n,t),problem:t}}if((s.value===`inside`||s.value===`outside`)&&r.pageParity===null){let t=$(`missing-page-parity`,`frames.pageParity`,`${s.value} alignment requires explicit page parity`);return{diagnostic:RS(e,n,t),problem:t}}let i=e===`horizontal`?`left`:`top`,d=e===`horizontal`?`right`:`bottom`,f=s.value===`inside`,p=r.pageParity===`odd`,m=s.value===i||f&&p||s.value===`outside`&&!p,h=s.value===d||f&&!p||s.value===`outside`&&p;l=m?o.base.startPt:h?o.base.endPt-t:o.base.startPt+(c-t)/2,u=s.value}else{let t=$(`invalid-axis-choice`,`${a}.choice`,`${e} choice is invalid`);return{diagnostic:RS(e,n,t),problem:t}}if(!FS(l)){let t=$(`invalid-axis-value`,`${a}.choice`,`resolved origin is not finite`);return{diagnostic:RS(e,n,t),problem:t}}return{valuePt:l,diagnostic:{axis:e,status:`resolved`,relativeFrom:i.relativeFrom,referenceFrame:o.base.referenceFrame,choiceKind:s.kind,choiceValue:u,baseStartPt:o.base.startPt,baseEndPt:o.base.endPt,resolvedOriginPt:l,pageParity:s.kind===`align`&&(s.value===`inside`||s.value===`outside`)?r.pageParity:null}}}function WS(e,t,n){let r=e===`horizontal`?n.xPt:n.yPt,i=e===`horizontal`?n.xPt+n.widthPt:n.yPt+n.heightPt,a=r+t;return{valuePt:a,diagnostic:{axis:e,status:`resolved`,relativeFrom:`page`,referenceFrame:`page`,choiceKind:`simple-position`,choiceValue:t,baseStartPt:r,baseEndPt:i,resolvedOriginPt:a,pageParity:null}}}const GS=[`top`,`right`,`bottom`,`left`];function KS(e,t){return e[`${t}Status`]}function qS(e,t){return e[`${t}Pt`]}function JS(e,t,n){let r=GS.some(t=>KS(e,t)!==`missing`);if(!n&&!r)return{values:{topPt:0,rightPt:0,bottomPt:0,leftPt:0}};let i={topPt:0,rightPt:0,bottomPt:0,leftPt:0};for(let n of GS){let r=KS(e,n),a=qS(e,n);if(r!==`valid`||!FS(a))return{problem:$(`invalid-effect-extent`,`${t}.${n}`,`present effectExtent requires four finite edge values`)};i[`${n}Pt`]=a}return{values:i}}function YS(e,t){let n={topPt:0,rightPt:0,bottomPt:0,leftPt:0},r={};for(let i of GS){let a=KS(t,i),o=KS(e,i),s=a===`valid`||a===`invalid`?{status:a,value:qS(t,i),source:`wrap`}:o===`valid`||o===`invalid`?{status:o,value:qS(e,i),source:`anchor`}:{status:`missing`,value:null,source:`implicit-zero`};if(s.status===`invalid`||s.status===`valid`&&(!FS(s.value)||s.value<0))return{problem:$(`invalid-distance`,`${s.source===`wrap`?`wrap.distances`:`anchorDistances`}.${i}`,`wrap distance must be finite and non-negative`)};n[`${i}Pt`]=s.status===`missing`?0:s.value,r[i]=s.source}return{resolved:{values:n,sources:r}}}function XS(e,t){let n={xPt:e.xPt-t.leftPt,yPt:e.yPt-t.topPt,widthPt:e.widthPt+t.leftPt+t.rightPt,heightPt:e.heightPt+t.topPt+t.bottomPt};return IS(n)?n:null}function ZS(e,t){let n=e.wrap.polygon;if(n===null||n.invalidPointCount!==0||n.coordinateSpace.width!==PS||n.coordinateSpace.height!==PS||n.points.length<3)return{problem:$(`invalid-wrap-polygon`,`wrap.polygon`,`tight and through wrapping require a valid fixed 21600 by 21600 polygon`)};let r=[];for(let[e,i]of n.points.entries()){if(!FS(i.x)||!FS(i.y))return{problem:$(`invalid-wrap-polygon`,`wrap.polygon.points.${e}`,`polygon coordinates must be finite`)};r.push({xPt:t.xPt+i.x/PS*t.widthPt,yPt:t.yPt+i.y/PS*t.heightPt})}let i=r.map(e=>e.xPt),a=r.map(e=>e.yPt),o=Math.min(...i),s=Math.max(...i),c=Math.min(...a),l=Math.max(...a);return{polygon:{edited:n.edited,points:r},bounds:{xPt:o,yPt:c,widthPt:s-o,heightPt:l-c}}}function QS(e){return{coordinateSpace:`anchor-frame`,groupApplication:`parser-resolved-child-frame`,group:e===null?null:{childSourceId:e.childSourceId,sourceIndex:e.sourceIndex,sourceCount:e.sourceCount,transformChain:e.transformChain.map(e=>({...e})),childTransform:e.childTransform===null?null:{...e.childTransform},resolvedChildFrame:{...e.resolvedChildFrame}}}}function $S(e){return Zc(e,`anchor frame result`)}function eC(e){let{acquisition:t,frames:n}=e;for(let e of[`relativeHeight`,`behindDoc`,`locked`,`layoutInCell`,`allowOverlap`]){let n=t.behavior[`${e}Status`],r=t.behavior[e];if(n===`valid`&&r!==null)continue;let i=$(n===`missing`?`missing-required-behavior`:`invalid-required-behavior`,`behavior.${e}`,`CT_Anchor requires a ${e} value`);return $S({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:RS(`horizontal`,t,i),vertical:RS(`vertical`,t,i)},issues:[i]})}let r=[],i=HS(`horizontal`,t,n),a=HS(`vertical`,t,n);i.problem&&r.push(i.problem),a.problem&&r.push(a.problem);let o,s,c=i.problem??a.problem;if(c||!i.resolved||!a.resolved){let e=c;o={diagnostic:RS(`horizontal`,t,e)},s={diagnostic:RS(`vertical`,t,e)}}else if(t.simplePosition.status===`invalid`){let e=$(`invalid-simple-position`,`simplePosition.enabled`,`simplePos enablement is invalid`);r.push(e),o={diagnostic:RS(`horizontal`,t,e,!0),problem:e},s={diagnostic:RS(`vertical`,t,e,!0),problem:e}}else if(t.simplePosition.status===`valid`&&t.simplePosition.enabled===!0){let e=zS(`page`,`horizontal`,n,`frames.page`),i=t.simplePosition.xPt,a=t.simplePosition.yPt;if(!e.base||n.page===null||!IS(n.page)){let n=e.problem??$(`invalid-reference-frame`,`frames.page`,`simple positioning requires a valid page frame`);r.push(n),o={diagnostic:RS(`horizontal`,t,n,!0),problem:n},s={diagnostic:RS(`vertical`,t,n,!0),problem:n}}else if(t.simplePosition.xStatus!==`valid`||!FS(i)){let e=t.simplePosition.xStatus===`invalid`,n=$(e?`invalid-simple-position`:`missing-simple-coordinate`,`simplePosition.x`,e?`simple position x is lexically invalid`:`simple position x is required`);r.push(n),o={diagnostic:RS(`horizontal`,t,n,!0),problem:n},s={diagnostic:RS(`vertical`,t,n,!0),problem:n}}else if(t.simplePosition.yStatus!==`valid`||!FS(a)){let e=t.simplePosition.yStatus===`invalid`,n=$(e?`invalid-simple-position`:`missing-simple-coordinate`,`simplePosition.y`,e?`simple position y is lexically invalid`:`simple position y is required`);r.push(n),o={diagnostic:RS(`horizontal`,t,n,!0),problem:n},s={diagnostic:RS(`vertical`,t,n,!0),problem:n}}else o=WS(`horizontal`,i,n.page),s=WS(`vertical`,a,n.page)}else{let e=US(`horizontal`,i.resolved.valuePt,t,n),c=US(`vertical`,a.resolved.valuePt,t,n);o={...e,diagnostic:e.diagnostic},s={...c,diagnostic:c.diagnostic},e.problem&&r.push(e.problem),c.problem&&r.push(c.problem)}if(r.length>0||!i.resolved||!a.resolved||o.valuePt===void 0||s.valuePt===void 0)return $S({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:r});let l={xPt:o.valuePt,yPt:s.valuePt,widthPt:i.resolved.valuePt,heightPt:a.resolved.valuePt},u=JS(t.parentEffectExtent,`parentEffectExtent`,!1);if(u.problem||!u.values){let e=u.problem;return $S({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e]})}let d=XS(l,u.values);if(d===null){let e=$(`invalid-effect-extent`,`parentEffectExtent`,`parent effect extents produce invalid ink bounds`);return $S({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e]})}if(t.wrap.kind===`missing`||t.wrap.kind===`invalid`){let e=$(t.wrap.kind===`missing`?`missing-wrap-kind`:`invalid-wrap-kind`,`wrap.kind`,`exactly one valid wrap kind is required`);return $S({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e]})}let f=YS(t.anchorDistances,t.wrap.distances);if(f.problem||!f.resolved)return $S({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[f.problem]});let p=t.wrap.kind===`square`||t.wrap.kind===`tight`||t.wrap.kind===`through`,m=p&&[`bothSides`,`left`,`right`,`largest`].includes(t.wrap.side??``)?t.wrap.side:null;if(p&&m===null){let e=$(`invalid-wrap-side`,`wrap.side`,`square, tight, and through wrapping require an authored wrap side`);return $S({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e]})}let h=u.values,g=GS.some(e=>KS(t.parentEffectExtent,e)!==`missing`)?`parent`:`none`;if(t.wrap.effectExtent!==null){let e=JS(t.wrap.effectExtent,`wrap.effectExtent`,!0);if(e.problem||!e.values)return $S({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e.problem]});h=e.values,g=`wrap-child`}let _=null,v=null,y=null;if(t.wrap.kind===`tight`||t.wrap.kind===`through`){let e=ZS(t,l);if(e.problem||!e.polygon||!e.bounds)return $S({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e.problem]});_=e.polygon,v={width:21600,height:21600},y=e.bounds,h={topPt:0,rightPt:0,bottomPt:0,leftPt:0},g=`none`}else if(t.wrap.kind!==`none`&&(y=XS(l,h),y===null)){let e=$(`invalid-effect-extent`,`wrap.effectExtent`,`wrapping effect extents produce invalid bounds`);return $S({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e]})}let b=y===null?null:XS(y,f.resolved.values);if(y!==null&&b===null){let e=$(`invalid-distance`,`wrap.distances`,`distances produce invalid bounds`);return $S({status:`unsupported`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[e]})}return $S({status:`resolved`,occurrenceId:t.occurrenceId,axes:{horizontal:o.diagnostic,vertical:s.diagnostic},issues:[],geometry:{objectFrame:l,inkBounds:d,wrapBounds:b,size:{horizontal:i.resolved.diagnostic,vertical:a.resolved.diagnostic},parentEffectExtent:u.values,wrap:{kind:t.wrap.kind,side:m,distances:f.resolved.values,distanceSources:f.resolved.sources,effectExtent:h,effectExtentSource:g,coordinateSpace:v,polygon:_},transform:QS(t.group)}})}function tC(e,t,n,r){if(!e)return r;let i=!!(e.styleId&&e.styleId===t.styleId),a=!!(i&&e.contextualSpacing),o=!!(i&&t.contextualSpacing);return a&&o?0:o?n:a?Math.max(r-n,0):Math.max(n,r)}function nC(e,t,n,r){let i=tC(e,t,n,r),a=i<=n;return{suppressBefore:a,overlap:n+(a?0:r)-i}}function rC(e){return Object.freeze(e.pages.map(e=>Object.freeze({pageIndex:e.pageIndex,displayPageNumber:e.pageNumber.displayNumber,pageNumberFormat:e.pageNumber.format})))}function iC(e){if(e.fieldType===`page`)return`page`;if(/numPages/i.test(e.fieldType)||/NUMPAGES/i.test(e.instruction))return`total-pages`}function aC(e){return e.some(e=>e.type===`paragraph`?e.runs.some(e=>e.type===`field`?iC(e)!==void 0:!1):e.type===`table`?e.rows.some(e=>e.cells.some(e=>aC(e.content))):!1)}function oC(e,t=[],n=[]){return aC(e)||t.some(e=>aC(e.content))||n.some(e=>aC(e))}const sC=new WeakMap;function cC(e){let t=new Set(e.drawings.flatMap(e=>{let t=e.anchorLayer?.acquisitionOccurrenceId??e.anchorLayer?.occurrenceId;return t===void 0?[]:[t]}));return Object.freeze({exclusions:Object.freeze(e.exclusions.filter(e=>!e.id.startsWith(`table-final-frame:`)&&(e.anchorOccurrenceId===void 0||!t.has(e.anchorOccurrenceId)))),collisions:Object.freeze((e.anchorCollisions??[]).filter(e=>!t.has(e.occurrenceId)))})}function lC(e){return new Set((e.anchorFrames??[]).flatMap(e=>e.status===`resolved`?[e.occurrenceId]:[]))}function uC(e){let t=lC(e),n=(e.anchorCollisions??[]).filter(e=>t.has(e.occurrenceId)),r=new Set(n.map(e=>e.occurrenceId));for(let e of t)if(!r.has(e))throw Error(`Paragraph anchor omitted collision geometry: ${e}`);return Object.freeze(n)}function dC(e){let t=lC(e);return Object.freeze(e.exclusions.filter(e=>e.anchorOccurrenceId!==void 0&&t.has(e.anchorOccurrenceId)))}function fC(e){return Object.freeze({flowDomainId:e,collisions:Object.freeze([]),exclusions:Object.freeze([])})}function pC(e,t){let n=sC.get(e);n||(n=new Map,sC.set(e,n));let r=n.get(t);if(r)return r;let i=fC(t);return n.set(t,i),i}function mC(e,t,n){let r=sC.get(e);if(!r||r.get(t.flowDomainId)!==t)throw Error(`Paragraph wrap registry transaction is stale`);r.set(t.flowDomainId,hC(t,n))}function hC(e,t){if(t.flowDomainId!==e.flowDomainId)throw Error(`Paragraph wrap registry cannot cross flow domains`);let n=new Set(e.collisions.map(e=>e.occurrenceId)),r=uC(t);for(let e of r){if(n.has(e.occurrenceId))throw Error(`Paragraph wrap occurrence committed twice: ${e.occurrenceId}`);n.add(e.occurrenceId)}let i=dC(t),a=new Set(r.map(e=>e.occurrenceId)),o=new Set;for(let e of i){let t=e.anchorOccurrenceId;if(t===void 0||!a.has(t))throw Error(`Owned paragraph wrap exclusion omitted its collision occurrence`);if(o.has(t))throw Error(`Paragraph wrap occurrence produced duplicate exclusions: ${t}`);o.add(t)}return Object.freeze({flowDomainId:e.flowDomainId,collisions:Object.freeze([...e.collisions,...r]),exclusions:Object.freeze([...e.exclusions,...i])})}function gC(e,t){if(!Number.isFinite(e)||e<0)throw RangeError(`${t} must be finite and non-negative`);return e}function _C(e){if(!(!e||e.type!==`text`&&e.type!==`field`))return e.typographyInput}function vC(e){switch(e){case`left`:return`left`;case`right`:return`right`;default:return`center`}}function yC(e){return gC(e.measuredWidthPt,`segment.measuredWidthPt`)}function bC(e){return e.map(e=>e.kind===`text`&&!e.fixedPitch?{text:e.text}:{})}function xC(e){return e===`lowKashida`?`low`:e===`mediumKashida`?`medium`:e===`highKashida`?`high`:null}function SC(e,t){if(!e.textLayoutService||!e.textShapeRequest)throw Error(`Kashida acquisition requires the retained TextLayoutService authority`);let n=e.textLayoutService.shape({...e.textShapeRequest,text:t,measure:!0}),r=e.basePaintOps[0]?.scaleX??1,i=e.basePaintOps[0]?.letterSpacingPt??0;return n.advancePt*r+[...t].length*i}function CC(e,t){if(!e)return null;let n=Bx(e),r=new Map,i=0;for(let[n,a]of e.perSeg){let e=t[n],o=a.splitBefore;if(e?.kind===`text`){let t=new Set(e.clusters.slice(1).map(t=>t.range.start-e.range.start)),n=[...e.text],r=[0];for(let e of n)r.push((r.at(-1)??0)+e.length);o=o.filter(e=>t.has(r[e]??-1))}let s=t[n+1],c=a.trailingGap&&!(s?.kind===`text`&&s.breakBefore===!1);i+=o.length+ +!!c,r.set(n,{splitBefore:[...o],trailingGap:c,internalStretch:0})}if(i===0)return null;let a=n/i;for(let e of r.values())e.internalStretch=e.splitBefore.length*a;return{perGap:a,perSeg:r}}function wC(e,t,n){if(!t||t.splitBefore.length===0)return{clusters:e.clusters,paintOps:e.basePaintOps};let r=[...e.text],i=[...t.splitBefore];if(i.some((e,t)=>e<=0||e>=r.length||t>0&&e<=(i[t-1]??0)))throw Error(`Internal paragraph justification contains an invalid code-point cut`);let a=[0];for(let e of r)a.push((a.at(-1)??0)+e.length);let o=i.map(e=>a[e]??-1),s=new Set(e.clusters.map(t=>t.range.start-e.range.start));if(o.some(e=>!s.has(e)))throw Error(`Internal paragraph justification must split at shaped cluster boundaries`);let c=[0,...i,r.length],l=[];for(let t=0;t<c.length-1;t+=1){let r=c[t]??0,i=c[t+1]??r,o=e.range.start+(a[r]??0),s=e.clusters.find(e=>e.range.start===o);if(!s)throw Error(`Internal paragraph justification is missing shaped cluster geometry`);l.push({range:{start:o,end:e.range.start+(a[i]??0)},offset:{xPt:s.offset.xPt+t*n,yPt:s.offset.yPt}})}let u=e.clusters.map(t=>{let r=t.range.start-e.range.start,i=o.filter(e=>e<=r).length;return{...t,offset:{...t.offset,xPt:t.offset.xPt+i*n}}});if(e.basePaintOps.length>1){let t=e.range.start;for(let n of e.basePaintOps){if(n.range.start!==t||n.range.end<=n.range.start)throw Error(`Internal paragraph justification has incomplete retained paint operations`);t=n.range.end}if(t!==e.range.end)throw Error(`Internal paragraph justification has incomplete retained paint operations`);let r=o.map(t=>e.range.start+t),i=[...new Set([e.range.start,e.range.end,...r,...e.basePaintOps.flatMap(e=>[e.range.start,e.range.end])])].sort((e,t)=>e-t),a=[];for(let t=0;t<i.length-1;t+=1){let o=i[t]??e.range.start,s=i[t+1]??o,c=e.basePaintOps.find(e=>e.range.start<=o&&e.range.end>=s);if(!c)throw Error(`Internal paragraph justification lost a retained paint slice`);let l=r.filter(e=>e<=o).length,d=u.find(e=>e.range.start===o);if(!d)throw Error(`Internal paragraph justification is missing retained slice geometry`);a.push({...c,text:c.text.slice(o-c.range.start,s-c.range.start),range:{start:o,end:s},offset:o===c.range.start?{...c.offset,xPt:c.offset.xPt+l*n}:d.offset})}return{clusters:u,paintOps:a}}let d=e.basePaintOps.length===1?e.basePaintOps[0]:void 0;if(!d)throw Error(`Internal paragraph justification requires one contextual paint op`);return i.length===r.length-1&&i.every((e,t)=>e===t+1)?{clusters:u,paintOps:[{...d,letterSpacingPt:d.letterSpacingPt+n}]}:{clusters:u,paintOps:l.map(t=>({...d,text:e.text.slice(t.range.start-e.range.start,t.range.end-e.range.start),range:t.range,offset:t.offset}))}}function TC(e,t){return e.flatMap(e=>{let n=e.text.trimEnd();if(n===``||n.length===e.text.length)return[e];if(e.sourceMapping===`kashida`)return[{...e,text:n}];let r=e.range.start+n.length,i=t.find(e=>e.range.start===r),{inkBounds:a,blockAxisInkBounds:o,...s}=e;return[{...e,text:n,range:{...e.range,end:r}},{...s,text:e.text.slice(n.length),range:{start:r,end:e.range.end},offset:i?.offset??e.offset}]})}function EC(e,t){return e===void 0||t===void 0?e===t:e.length===t.length&&e.every((e,n)=>e===t[n])}function DC(e,t){return e.kind===`underline`&&e.kind===t.kind&&e.authoredStyle===t.authoredStyle&&e.style===t.style&&e.color===t.color&&e.widthPt===t.widthPt&&e.to.xPt===t.from.xPt&&EC(e.dashPatternPt,t.dashPatternPt)}function OC(e,t){let n=Math.max(e.from.yPt,t.from.yPt),r={xPt:e.from.xPt,yPt:n},i={xPt:t.to.xPt,yPt:n},{path:a,...o}=e;return{...o,from:r,to:i,...e.style===`wavy`?{path:CS(r,i,e.widthPt)}:{}}}function kC(e){let t=[];e.forEach((n,r)=>{if(n.kind!==`text`){t=[];return}let i=[],a=[],o=new Set;for(let s of n.decorations){let n=t.filter(e=>!o.has(e)&&DC(e.decoration,s)).sort((e,t)=>Math.abs(e.decoration.from.yPt-s.from.yPt)-Math.abs(t.decoration.from.yPt-s.from.yPt))[0];if(n){o.add(n);let t=e[n.placementIndex];if(!t||t.kind!==`text`)throw Error(`Continuous decoration owner left the retained text line`);let r=[...t.decorations],i=OC(n.decoration,s);r[n.decorationIndex]=i,e[n.placementIndex]={...t,decorations:r},a.push({...n,decoration:i})}else{let e=i.length;i.push(s),a.push({placementIndex:r,decorationIndex:e,decoration:s})}}e[r]={...n,decorations:i},t=a})}function AC(e){let{line:t}=e,n=t.segments,r=e.baseRtl||Pp(n),i=Fp(n.map(e=>e.kind===`tab`?{isTab:!0}:e.kind===`text`?{text:e.text,rtl:e.rtl,digitsAsAN:e.digitsAsAN}:{}),e.baseRtl),a=n.reduce((e,t)=>e+yC(t),0),o=e.paragraphXPt+t.xOffsetPt,s=Math.min(e.availableWidthPt,t.availableWidthPt),c=e.isFirstLine?e.numbering?gC(e.numbering.bodyOffsetPt,`numbering.bodyOffsetPt`):e.firstLineIndentPt??0:0,l=e.baseRtl?0:c,u=(e.baseRtl?s-c:s)-l-a,d=e.isLastLine||t.endsWithBreak,f=e.displayMathJustification===void 0?Ip(e.alignment,e.baseRtl):vC(e.displayMathJustification),p=f===`justify`&&(!d||e.stretchLastLine),m=p?xC(e.alignment):null;if(m&&u>0){let e=fS(n.map(e=>e.kind===`text`?{text:e.text}:{}),u,m,(e,t)=>{let r=n[e];return r?.kind===`text`?SC(r,t):0});e&&(n=n.map((t,n)=>{if(t.kind!==`text`)return t;let r=e.perSeg.get(n);if(!r)return t;let i=t.basePaintOps[0];if(!i)throw Error(`Kashida acquisition requires a contextual text paint operation`);return{...t,measuredWidthPt:t.measuredWidthPt+r.advanceDeltaPx,basePaintOps:[{...i,text:r.text,sourceMapping:`kashida`}]}}),a+=e.appliedPx,u=e.residualPx)}let h=i.order.at(-1)??-1,g=0;if(!r){let e=n.findIndex(e=>e.kind!==`text`||/\\S/.test(e.text));g=e<0?0:e}let _=null,v=0,y=0,b=bC(n);if(p){let i=CC(zx(b,u,g,r?h:n.length,-(t.baselinePt-t.topPt)*.25,u>0,e.alignment===`thaiDistribute`&&u>0),n);_=i?.perSeg??null,v=i?.perGap??0,y=Bx(i)}else if(u<0){let e=CC(Vx(b,u,g,r?h:n.length,t.baselinePt-t.topPt),n);_=e?.perSeg??null,v=e?.perGap??0,y=Bx(e)}let x=a+y,S=u-y,C=f===`right`?S:f===`center`?S/2:f===`justify`&&e.baseRtl&&!p?S:0,w=o+l,T=e.decimalAutoTabPt===void 0?C:Math.max(0,e.paragraphXPt+e.decimalAutoTabPt-x-w),E=w+T,D=[];for(let e of i.order){let r=n[e];if(!r)continue;let a=_?.get(e),o=a?.internalStretch??0,s=yC(r)+o;if(r.kind===`tab`){let e={xPt:E,yPt:t.topPt,widthPt:r.measuredWidthPt,heightPt:t.advancePt};D.push({kind:`tab`,range:r.range,bounds:e,advancePt:r.measuredWidthPt,leader:r.leader,...r.leader===`none`?{}:r.leaderShape?{leaderGlyphs:_S({interval:e,baselinePt:t.baselinePt,...r.leaderShape})}:{}})}else if(r.kind===`resource`)D.push({kind:`resource`,range:r.range,resourceKey:r.resourceKey,resourceKind:r.resourceKind,...r.orientation?{orientation:r.orientation}:{},bounds:{xPt:E,yPt:t.baselinePt+r.topOffsetPt,widthPt:r.widthPt,heightPt:r.heightPt},advancePt:r.measuredWidthPt});else if(r.kind===`unavailable-resource`)D.push({kind:`drawing`,range:r.range,drawingId:r.drawingId,bounds:{xPt:E,yPt:t.baselinePt+r.topOffsetPt,widthPt:r.widthPt,heightPt:r.heightPt},advancePt:r.measuredWidthPt});else if(r.kind===`anchor-host`)D.push({kind:`anchor-host`,range:r.range,bounds:{xPt:E,yPt:t.topPt,widthPt:0,heightPt:t.advancePt},baselinePt:t.baselinePt,...r.sourceMetrics?{sourceMetrics:r.sourceMetrics}:{},...r.anchorOccurrenceId?{anchorOccurrenceId:r.anchorOccurrenceId}:{}});else{let{measuredWidthPt:n,breakBefore:o,rtl:c,digitsAsAN:l,fixedPitch:u,textLayoutService:d,textShapeRequest:f,retainedGeometry:p,direction:m,...h}=r,g=wC(r,a,v),_=i.rtl[e]?`rtl`:`ltr`,y=_===`rtl`?TC(g.paintOps,g.clusters):g.paintOps,b=r.text.trimEnd().length,x=_===`rtl`?(h.fitText?.trailingPadPt??0)+r.clusters.filter(e=>e.range.start>=r.range.start+b).reduce((e,t)=>e+t.advancePt,0):0,S=a?.trailingGap?v:0,C={xPt:E+x,yPt:t.baselinePt},w=g.paintOps[0]?.offset.yPt??0,T={xPt:E,yPt:t.baselinePt+w},O=p?wS({origin:T,advancePt:s+S,base:p.base,color:$C(h.color),...p.underline?{underline:p.underline}:{},...p.strike?{strike:p.strike}:{}}):h.decorations,k=p?.emphasis?{authored:p.emphasis.authored,glyphs:TS({authored:p.emphasis.authored,glyph:p.emphasis.glyph,origin:{xPt:C.xPt,yPt:t.baselinePt+w},clusters:g.clusters,clusterInk:p.emphasis.clusterInk,mark:p.emphasis.mark,scaleX:r.basePaintOps[0]?.scaleX??1})}:void 0,A={...h,kind:`text`,origin:C,bounds:{xPt:E,yPt:t.topPt,widthPt:s,heightPt:t.advancePt},advancePt:s,clusters:g.clusters,paintOps:y.map(e=>({...e,direction:_})),decorations:O,...k?{emphasis:k}:{},direction:_,...S===0?{}:{ownedTrailingSlackPt:S},...h.highlight||h.background?{highlightFragments:[{rect:{xPt:E,yPt:t.topPt,widthPt:s+S,heightPt:t.advancePt},color:h.highlight??h.background}]}:{},...h.ruby?{ruby:{...h.ruby,paintOps:h.ruby.paintOps.map(e=>({...e,origin:{xPt:e.origin.xPt+E+(s-r.measuredWidthPt)/2,yPt:e.origin.yPt+t.baselinePt}}))}}:{}};D.push(A)}E+=s,a?.trailingGap&&(E+=v)}for(let e=0;e<D.length;){let t=D[e];if(t?.kind!==`text`||!t.runBorder){e+=1;continue}let n=e+1;for(;n<D.length;){let e=D[n];if(e?.kind!==`text`||!e.runBorder)break;n+=1}let r=DS(D.slice(e,n).map(e=>({bounds:e.bounds,trailingSlackPt:e.ownedTrailingSlackPt??0,border:e.runBorder})));D[e]={...t,runBorderFragments:r},e=n}return kC(D),Xc({range:t.range,bounds:{xPt:w+T,yPt:t.topPt,widthPt:x,heightPt:t.advancePt},baselinePt:t.baselinePt,advancePt:t.advancePt,placements:D})}function jC(e){let t=e.continuation,n=t?.lineStart??0,r=t?.lineEnd??e.lines.length;if(n<0||r<n||r>e.lines.length)throw RangeError(`Paragraph continuation line range is outside the retained lines`);let i=t?.continuesFromPrevious?0:e.spacing.beforePt;for(let a=n;a<r;a+=1){let r=e.lines[a];if(r){if(a===0&&!t?.continuesFromPrevious)i+=Math.max(0,r.bounds.yPt-(e.flowBounds.yPt+e.spacing.beforePt));else if(a>n){let t=e.lines[a-1];i+=Math.max(0,r.bounds.yPt-((t?.bounds.yPt??r.bounds.yPt)+(t?.advancePt??0)))}i+=gC(r.advancePt,`line.advancePt`)}}return e.lines.length===0&&e.paragraphMark&&(i+=gC(e.paragraphMark.bounds.heightPt,`paragraphMark.heightPt`)),t?.continuesOnNext||(i+=e.spacing.afterPt),i}function MC(e){let t=e.continuation?.lineStart??0,n=e.continuation?.lineEnd??e.lines.length,r=e.lines.slice(t,n),i=e.continuation?jC(e):gC(e.flowBounds.heightPt,`flowBounds.heightPt`);return Xc({kind:`paragraph`,id:e.id,source:e.source,...e.paragraphId===void 0?{}:{paragraphId:e.paragraphId},flowDomainId:e.flowDomainId,ordinaryFlow:e.ordinaryFlow,...e.styleId===void 0?{}:{styleId:e.styleId},...e.bookmarkStarts?.length?{bookmarkStarts:e.bookmarkStarts}:{},flowBounds:{...e.flowBounds,heightPt:i},inkBounds:e.inkBounds,...e.clipBounds?{clipBounds:e.clipBounds}:{},advancePt:i,spacing:e.spacing,contextualSpacing:e.contextualSpacing??!1,lines:r,borders:e.borders,...e.shading?{shading:e.shading}:{},resources:e.resources,drawings:e.drawings,textBoxes:e.textBoxes,events:e.events,exclusions:e.exclusions,...e.cellContainmentBounds?{cellContainmentBounds:e.cellContainmentBounds}:{},...e.anchorCollisions?.length?{anchorCollisions:e.anchorCollisions}:{},...e.anchorFrames?{anchorFrames:e.anchorFrames}:{},...e.paragraphMark?{paragraphMark:e.paragraphMark}:{},...e.continuation?{continuation:e.continuation}:{}})}function NC(e,t){return{...e,path:[...e.path,t]}}function PC(e,t){if(e.status===`planned`)return Object.freeze([]);let n=Object.freeze({...t,path:Object.freeze([...t.path])});return Object.freeze(e.diagnostics.map(e=>Object.freeze({...e,source:n})))}function FC(e){return Uc(`chart-resource`,e)}function IC(e,t){return Uc(`unavailable-drawing`,NC(e,t))}function LC(e,t){return Object.freeze({code:`MISSING_RESOURCE`,severity:`warning`,source:Object.freeze({...t,path:Object.freeze([...t.path])}),message:`Drawing ${e} resource is unavailable`})}function RC(e){return iC(e)||(/^date$/i.test(e.fieldType)?`date`:/^time$/i.test(e.fieldType)?`time`:`document`)}function zC(e){return e.sourceRunIndex}function BC(e){if(!e.textLayoutService||!e.textShapeRequest)return;let t=e.textLayoutService.shape({...e.textShapeRequest,text:e.text,measure:!0});return{ascentPt:t.ascentPt,descentPt:t.descentPt}}const VC=Object.freeze({yellow:`#FFFF00`,cyan:`#00FFFF`,green:`#00FF00`,magenta:`#FF00FF`,blue:`#0000FF`,red:`#FF0000`,darkBlue:`#000080`,darkCyan:`#008080`,darkGreen:`#008000`,darkMagenta:`#800080`,darkRed:`#800000`,darkYellow:`#808000`,darkGray:`#808080`,lightGray:`#C0C0C0`,black:`#000000`,white:`#FFFFFF`});function HC(e){return e.startsWith(`#`)?e:VC[e]??`#FFFF00`}function UC(e){let t=of(e.vertAlign,e.fontSize)+(e.position??0);return t===0?0:-t}function WC(e,t,n,r,i,a,o){let s=zC(e),c=s===void 0?void 0:t.runs[s],l=_C(c);if(e.metricOnly){let t=BC(e);return{kind:`anchor-host`,range:{start:n,end:n},bounds:{xPt:r,yPt:a,widthPt:0,heightPt:o},baselinePt:i,...t?{sourceMetrics:t}:{}}}let u=e.color?{kind:`explicit`,color:`#${e.color}`}:e.colorAuto?{kind:`auto`,...e.background?{background:`#${e.background}`}:{}}:{kind:`default`},d=e.fontRoute??I(e.fontFamily?`\"${e.fontFamily.replaceAll(`\"`,`\\\\\"`)}\"`:`sans-serif`,e.fontFamily?`native`:`generic`),f=e.ruby&&e.textLayoutService&&e.textShapeRequest?e.textLayoutService.shape({...e.textShapeRequest,text:e.text,measure:!0}):void 0,p=e.ruby&&e.textLayoutService&&e.textShapeRequest?e.textLayoutService.shape({...e.textShapeRequest,text:e.ruby.text,fontSizePt:e.ruby.fontSizePt,measure:!0}):void 0,m=e.ruby&&p?(p.clusters??[]).map(t=>{let n=p.spans.find(e=>e.start<=t.range.start&&e.end>=t.range.end)??p.spans[0];if(!n)throw Error(`Ruby shaping produced no selected-face span`);return{text:e.ruby.text.slice(t.range.start,t.range.end),offsetPt:t.offsetPt,fontRoute:n.fontRoute,fontSizePt:e.ruby.fontSizePt,fontWeight:n.font.weight,fontStyle:n.font.style,color:u}}):[],h=l?.ruby?.raisePt.status===`valid`?l.ruby.raisePt.value??void 0:e.ruby?.hpsRaisePt,g=e.ruby&&p?vS({baseOrigin:{xPt:0,yPt:0},baseAdvancePt:e.measuredWidth,guideAdvancePt:p.advancePt,...h===void 0?{}:{raisePt:h},...f?.inkBounds&&p.inkBounds?{baseInkTopPt:-f.inkBounds.ascentPt,guideInkBottomFromBaselinePt:p.inkBounds.descentPt}:{},spans:m}):[],_=UC(e);return{kind:`text`,text:e.text,...s===void 0?{}:{sourceRunIndex:s},...c?.type===`field`?{role:`field-result`,dependency:RC(c)}:{},...c?.type===`text`&&(c.noteRef?.kind===`footnote`||c.noteRef?.kind===`endnote`)?{noteReference:{kind:c.noteRef.kind,id:c.noteRef.id}}:{},range:{start:n,end:n+e.text.length},origin:{xPt:r,yPt:i+_},bounds:{xPt:r,yPt:a,widthPt:e.measuredWidth,heightPt:o},advancePt:e.measuredWidth,clusters:[{range:{start:n,end:n+e.text.length},offset:{xPt:0,yPt:0},advancePt:e.measuredWidth}],color:u,fontRoute:d,fontSizePt:Ll(e,1),fontWeight:e.bold?700:400,fontStyle:e.italic?`italic`:`normal`,direction:e.rtl?`rtl`:`ltr`,...e.verticalRun?{writingMode:`vertical-rl`}:{},...e.charSpacing===void 0?{}:{characterSpacingPt:e.charSpacing},...e.charScale===void 0?{}:{characterScale:e.charScale},...e.fitTextRegionIndex===void 0?{}:{fitText:{regionIndex:e.fitTextRegionIndex,perGapPt:e.fitTextPerGapPx??0,trailingPadPt:e.fitTextTrailingPadPx??0}},...e.kerning===void 0?{}:{kerning:e.fontSize>=e.kerning},...e.position===void 0?{}:{positionPt:e.position},...e.vertAlign?{verticalAlign:e.vertAlign}:{},...e.tateChuYoko?{tateChuYoko:!0}:{},...e.tateChuYokoCompress?{tateChuYokoCompress:!0}:{},...e.ruby&&p?{ruby:{text:e.ruby.text,advancePt:p.advancePt,authored:{...l?.ruby?.align.status===`valid`&&l.ruby.align.value?{align:l.ruby.align.value}:{},...l?.ruby?.baseFontSizePt.status===`valid`&&l.ruby.baseFontSizePt.value!==null?{baseFontSizePt:l.ruby.baseFontSizePt.value}:{},...h===void 0?{}:{raisePt:h},...l?.ruby?.language.status===`valid`&&l.ruby.language.value?{language:l.ruby.language.value}:{}},paintOps:g}}:{},...e.emphasisMark?{emphasisMark:e.emphasisMark}:{},...e.highlight?{highlight:HC(e.highlight)}:{},...e.background?{background:`#${e.background}`}:{},...e.border?{runBorder:{val:l?.border?.val.value??e.border.style,color:e.border.color?`#${e.border.color}`:`#000000`,widthPt:e.border.width,spacePt:e.border.space??0,...l?.border?.themeColor.value?{themeColor:l.border.themeColor.value}:{},...l?.border?.themeTint.value?{themeTint:l.border.themeTint.value}:{},...l?.border?.themeShade.value?{themeShade:l.border.themeShade.value}:{},...l?.border?.shadow.status===`valid`&&l.border.shadow.value!==null?{shadow:l.border.shadow.value}:{},...l?.border?.frame.status===`valid`&&l.border.frame.value!==null?{frame:l.border.frame.value}:{}}}:{},...e.revision?{revision:e.revision}:{},typography:{caps:l?.caps??!1,smallCaps:l?.smallCaps??e.smallCaps===!0,strike:l?.strike??e.strikethrough,doubleStrike:l?.doubleStrike??e.doubleStrikethrough===!0,verticalAlign:l?.verticalAlign??{status:e.vertAlign?`valid`:`missing`,raw:e.vertAlign??null,value:e.vertAlign??null},positionPt:l?.positionPt??{status:e.position===void 0?`missing`:`valid`,raw:e.position===void 0?null:String(e.position*2),value:e.position??null},emphasis:l?.emphasis??{status:e.emphasisMark?`valid`:`missing`,raw:e.emphasisMark??null,value:e.emphasisMark??null},...l?.underline?{underline:l.underline}:{}},decorations:[],paintOps:[{text:e.text,range:{start:n,end:n+e.text.length},offset:{xPt:0,yPt:_},letterSpacingPt:Vf(e),scaleX:e.charScale??1,direction:e.rtl?`rtl`:`ltr`,kerning:e.kerning===void 0?`auto`:e.fontSize>=e.kerning?`normal`:`none`,writingMode:e.verticalRun?`vertical-rl`:`horizontal-tb`}],...e.hyperlink?{hyperlink:e.hyperlink}:{}}}function GC(e,t){let n=e.layout,r=n.visibleAscent??n.ascent,i=r+(n.visibleDescent??n.descent),a=t.lineSpacing?.rule===`auto`&&!t.hasRuby&&!t.lineGrid.active,o=a&&(t.lineSpacing?.value??1)<1,s=a&&!o?Math.max(i,n.visibleIntendedSingle??n.intendedSingle):e.advancePt;return e.topYPt+(s-i)/2+r}function KC(e,t,n){let r=e.numbering;if(!r)return;if(t.numberingMarkerGeometry)return t.numberingMarkerGeometry;let i=e.numberingMarkerShapeInput,a=n.environment.layoutServices?.text;if(!(!i||!a))return Wp(r,i,{authoredFirstIndentPt:e.indentFirst,physicalIndentLeftPt:t.physicalIndentLeftPt,tabStops:e.tabStops,defaultTabPt:t.defaultTabPt},a)}function qC(e,t,n,r,i){return i.bounds.widthPt<=0?t.baseRtl?n+r:n:t.baseRtl?i.bounds.xPt+i.bounds.widthPt+e.bodyOffsetPt:i.bounds.xPt-e.bodyOffsetPt}function JC(e,t,n,r,i,a){if(!e.shape||e.markerText===``)return[];let o=e.shape,s=Bp({baseRtl:n.baseRtl,alignedLeadingEdgePt:qC(e,n,r,i,a),authoredFirstIndentPt:t.indentFirst,markerShiftPt:e.markerShiftPt,markerWidthPt:e.markerWidthPt}),c=-e.markerText.length,l=t.numbering?.color?{kind:`explicit`,color:`#${t.numbering.color}`}:t.numbering?.colorAuto?{kind:`auto`}:t.paragraphMarkColor?{kind:`explicit`,color:`#${t.paragraphMarkColor}`}:{kind:`default`},u=0;return o.spans.map(e=>{let r=u;u+=e.advancePt;let i=o.clusters?o.clusters.filter(t=>t.range.start>=e.start&&t.range.end<=e.end).map(e=>({range:{start:c+e.range.start,end:c+e.range.end},offset:{xPt:e.offsetPt-r,yPt:0},advancePt:e.advancePt})):[{range:{start:c+e.start,end:c+e.end},offset:{xPt:0,yPt:0},advancePt:e.advancePt}],d=s+r;return{kind:`text`,role:`numbering-marker`,text:e.text,range:{start:c+e.start,end:c+e.end},origin:{xPt:d,yPt:a.baselinePt},bounds:{xPt:d,yPt:a.baselinePt-e.ascentPt,widthPt:e.advancePt,heightPt:e.ascentPt+e.descentPt},advancePt:e.advancePt,clusters:i,paintOps:[{text:e.text,range:{start:c+e.start,end:c+e.end},offset:{xPt:0,yPt:0},letterSpacingPt:0,scaleX:1,direction:n.baseRtl?`rtl`:`ltr`,kerning:`auto`,writingMode:`horizontal-tb`}],color:l,fontRoute:e.fontRoute,fontSizePt:t.numberingMarkerShapeInput?.fontSizePt??e.ascentPt+e.descentPt,fontWeight:e.font.weight,fontStyle:e.font.style,direction:n.baseRtl?`rtl`:`ltr`,decorations:[]}})}function YC(e){if(e)return e.startsWith(`#`)?e:`#${e}`}function XC(e,t,n){let r=YC(t),i=YC(n);return e.map(e=>({...e,placements:e.placements.map(e=>{if(e.kind!==`text`)return e;let t=e.background??r??i;return!t||e.color.kind===`explicit`?e:{...e,color:{kind:`auto`,background:t}}})}))}function ZC(e){return e!=null&&e.style!==`none`}function QC(e,t,n,r,i,a,o){let s=n,c=n+r;e.indentFirst<0&&(e.bidi?c-=e.indentFirst:s+=e.indentFirst);for(let e of t.flatMap(e=>e.placements))!(e.kind===`text`&&e.role===`numbering-marker`||e.kind===`resource`&&e.resourceKind===`picture-bullet`)||!e.bounds||(s=Math.min(s,e.bounds.xPt),c=Math.max(c,e.bounds.xPt+e.bounds.widthPt));let l=e.borders,u=o.top===`none`?null:l?.[o.top]??null,d=o.bottom===`none`?null:l?.bottom??null,f=ZC(l?.left??null)?l.left.space??0:0,p=ZC(l?.right??null)?l.right.space??0:0,m=ZC(u)?u.space??0:0,h=ZC(d)?d.space??0:0;return{xPt:s-f,yPt:i-m,widthPt:c-s+f+p,heightPt:a+m+h}}function $C(e){return e.kind===`explicit`?e.color:e.kind===`auto`?ct(e.background??`#FFFFFF`):`#000000`}function ew(e){return e.inkBounds??{xMinPt:0,xMaxPt:e.advancePt,ascentPt:e.ascentPt,descentPt:e.descentPt}}function tw(e){return e===`circle`?`○`:e===`comma`?`﹅`:`•`}function nw(e,t,n){if(!(e.underline||e.strikethrough||e.doubleStrikethrough||e.emphasisMark))return;let r=e.textLayoutService,i=e.textShapeRequest;if(!r||!i)throw Error(`Retained typography geometry requires TextLayoutService`);let a=e=>r.shape({...i,text:e,measure:!0}),o=e=>{let t=a(e),n=t.spans[0];if(!n||t.spans.length!==1||n.start!==0||n.end!==e.length)throw Error(`Retained decoration probe requires one selected-face span`);return{ascentPt:n.ascentPt,descentPt:n.descentPt,...n.inkBounds?{inkBounds:n.inkBounds}:{}}},s=a(e.text),c=$C(n),l=e.underline?{...e.underlineStyle?{authoredStyle:e.underlineStyle}:{},color:e.underlineColor&&e.underlineColor!==`auto`?`#${e.underlineColor}`:c,probe:o(`_`)}:void 0,u=e.strikethrough||e.doubleStrikethrough?{double:e.doubleStrikethrough===!0,probe:o(`-`),...e.doubleStrikethrough?{doubleProbe:o(`=`)}:{}}:void 0,d=e.emphasisMark?(()=>{let r=tw(e.emphasisMark),o=a(r),s=o.spans[0];if(!s)throw Error(`Emphasis shaping produced no selected-face span`);let c=(e.shapedClusters??[]).map(n=>{let r=e.text.slice(n.range.start,n.range.end);return{text:r,range:{start:t+n.range.start,end:t+n.range.end},ink:ew(a(r))}});return{authored:e.emphasisMark,glyph:r,mark:{inkBounds:ew(o),fontRoute:s.fontRoute,fontSizePt:i.fontSizePt,fontWeight:s.font.weight,fontStyle:s.font.style,color:n},clusterInk:c}})():void 0;return{base:s,...l?{underline:l}:{},...u?{strike:u}:{},...d?{emphasis:d}:{}}}function rw(e,t,n,r,i,a){if(e.metricOnly){let t=BC(e);return{kind:`anchor-host`,measuredWidthPt:0,range:{start:n,end:n},...t?{sourceMetrics:t}:{},...i?.type===`anchorHost`&&i.anchorOccurrenceId?{anchorOccurrenceId:i.anchorOccurrenceId}:{}}}let o=WC(e,t,n,0,0,0,0);if(o.kind!==`text`)throw Error(`Visible text segment projected as anchor host`);let s=e.fitTextPerGapPx??Vf(e)+(e.snapToCharacterGrid===!1?0:r),c=e.charScale??1,l=UC(e),u=nw(e,n,o.color),d=e.shapedClusters,f=d?.length&&d[0]?.range.start===0&&d.at(-1)?.range.end===e.text.length&&d.every((e,t)=>t===0||d[t-1]?.range.end===e.range.start)&&d.every(e=>e.range.start<e.range.end&&Number.isFinite(e.offsetPt)&&Number.isFinite(e.advancePt))?d:void 0;if(e.text.length>0&&!f)throw Error(`Visible text acquisition requires complete authoritative grapheme clusters from TextLayoutService`);let p=(f??[]).map((t,r)=>{let i=e.text.slice(0,t.range.start),a=e.text.slice(t.range.start,t.range.end),o=[...i].length,u=[...a].length,d=r===(f?.length??0)-1?e.fitTextTrailingPadPx??0:0,p=e.punctuationCompressions?.filter(e=>e.end<=t.range.start).reduce((e,t)=>e+t.adjustmentPt,0)??0,m=e.punctuationCompressions?.filter(e=>e.end>t.range.start&&e.end<=t.range.end).reduce((e,t)=>e+t.adjustmentPt,0)??0;return{range:{start:n+t.range.start,end:n+t.range.end},offset:{xPt:t.offsetPt*c+o*s+p,yPt:l},advancePt:t.advancePt*c+u*s+d+m}}),{origin:m,bounds:h,advancePt:g,paintOps:_,clusters:v,...y}=o,b=e.tateChuYoko&&e.tateChuYokoCompress?(()=>{if(!e.textLayoutService||!e.textShapeRequest)throw Error(`Tate-chu-yoko compression requires TextLayoutService`);let t=e.textLayoutService.shape({...e.textShapeRequest,text:e.text,fontSizePt:o.fontSizePt,measure:!0,clusterGeometry:!1}),n=t.ascentPt+t.descentPt;return n>o.fontSizePt&&n>0?o.fontSizePt/n:1})():1,x=e.punctuationCompressions?.some(t=>t.end<e.text.length)??!1,S=e.verticalRun?(()=>{if(!a)throw Error(`Vertical glyph planning capability is required for vertical text`);let t=_[0];return a.planRun({text:e.text,font:L(o.fontRoute,o.fontSizePt,o.fontWeight,o.fontStyle),fontKerning:t.kerning,fontSizePt:o.fontSizePt,letterSpacingPt:s,charScale:c,growTrRotateInk:!0,writingMode:t.writingMode}).map(r=>({...t,text:r.text,range:{start:n+r.range.start,end:n+r.range.end},offset:{xPt:r.originPt+(e.punctuationCompressions?.filter(e=>e.end<=r.range.start).reduce((e,t)=>e+t.adjustmentPt,0)??0),yPt:l},letterSpacingPt:s,glyphOrientation:r.orientation,...r.verticalFeature?{verticalFeature:!0}:{},...r.blockAxisInkBounds?{blockAxisInkBounds:r.blockAxisInkBounds}:{},...r.drawOffsetPt.xPt!==0||r.drawOffsetPt.yPt!==0?{glyphOffsetPt:r.drawOffsetPt}:{}}))})():e.tateChuYoko?_.map(t=>({...t,offset:{xPt:t.offset.xPt+e.measuredWidth/2,yPt:t.offset.yPt},glyphOrientation:`upright`,...b===1?{}:{scaleY:b}})):x?(()=>{let t=_[0],r=[];for(let t of p){let i=t.range.end-n,a=e.punctuationCompressions?.find(e=>e.end===i)?.adjustmentPt??null,o=r.at(-1);o&&o.adjustmentPt===a?o.end=t.range.end:r.push({start:t.range.start,end:t.range.end,offset:t.offset,adjustmentPt:a})}return r.map(r=>({...t,text:e.text.slice(r.start-n,r.end-n),range:{start:r.start,end:r.end},offset:r.offset,letterSpacingPt:s+(r.adjustmentPt??0)}))})():_;return{...y,kind:`text`,measuredWidthPt:e.measuredWidth,clusters:p,basePaintOps:S.map(t=>({...t,letterSpacingPt:e.verticalRun&&t.glyphOrientation!==`sideways`?0:x?t.letterSpacingPt:s,...!e.verticalRun&&e.selectedFaceInkBounds?{inkBounds:e.selectedFaceInkBounds}:{},...!e.verticalRun&&e.selectedFaceInkBounds&&t.glyphOrientation===void 0?{blockAxisInkBounds:{startPt:(t.glyphOffsetPt?.yPt??0)-e.selectedFaceInkBounds.ascentPt,endPt:(t.glyphOffsetPt?.yPt??0)+e.selectedFaceInkBounds.descentPt}}:{}})),breakBefore:e.breakBefore!==!1&&!e.joinPrev,rtl:e.rtl,digitsAsAN:e.digitsAsAN,fixedPitch:e.fitTextRegionIndex!==void 0,...u?{retainedGeometry:u}:{},...e.textLayoutService?{textLayoutService:e.textLayoutService}:{},...e.textShapeRequest?{textShapeRequest:e.textShapeRequest}:{}}}function iw(e,t){let n=new Map;for(let e of t.lines)for(let t of e.layout.segments){let e=zC(t);if(e===void 0)continue;let r=`text`in t?t.metricOnly?0:t.text.length:`mathNodes`in t?t.fallbackText.length:+(`isTab`in t||`imagePath`in t);n.set(e,(n.get(e)??0)+r)}let r=e.runs.map((e,t)=>{let r=n.get(t);return r===void 0?e.type===`text`?e.text.length:e.type===`field`?e.fallbackText.length:e.type===`anchorHost`?0:1:r}),i=0;return{runStarts:r.map(e=>{let t=i;return i+=e,t}),runLengths:r}}function aw(e){return`text`in e?e.metricOnly?0:e.text.length:`mathNodes`in e?e.fallbackText.length:1}function ow(e,t,n,r,i,a,o,s,c,l,u=!1){let d=0,f=new Map,p=e.lines.some(e=>e.layout.segments.some(e=>`isTab`in e)),m=t.tabStops?.reduce((e,t)=>!e||t.pos<e.pos?t:e,void 0),h=e.lines.flatMap(e=>e.layout.segments.flatMap(e=>`text`in e&&!e.metricOnly?[e.text]:[])).join(``).trim(),g=!p&&m?.alignment===`decimal`&&h!==``&&/^[+\\-(]?[\\d., ]+\\)?%?$/u.test(h)?m.pos-a.physicalIndentLeftPt:void 0;return e.lines.map((p,m)=>{let h=p.layout,_=GC(p,a),v=1/0,y=d,b=[];for(let e of h.segments){let n=zC(e),r=n===void 0?void 0:t.runs[n],s=aw(e),p=n===void 0?d:(o.runStarts[n]??d)+(f.get(n)??0);if(n!==void 0&&f.set(n,(f.get(n)??0)+s),v=Math.min(v,p),y=Math.max(y,p+s),`isTab`in e){let t=e,n=t.leader??`none`,i;if(n!==`none`){if(!c)throw Error(`Tab leader acquisition requires TextLayoutService`);let e=n===`hyphen`?`-`:n===`underscore`||n===`heavy`?`_`:n===`middleDot`?`·`:`.`,a=r?.type===`text`||r?.type===`field`?r:void 0,o=a,s=c.shape({text:e,fontSizePt:t.fontSize,fonts:o?.fontSlots?.direct??(a?.fontFamily?{ascii:a.fontFamily}:{}),themeFonts:o?.fontSlots?.theme,themeFontPresence:o?.fontSlots?.themePresent,weight:t.bold?700:400,style:t.italic?`italic`:`normal`,measure:!0}),l=s.spans[0];if(!l||!Number.isFinite(s.advancePt)||s.advancePt<=0)throw Error(`Tab leader acquisition produced no shaped glyph advance`);i={glyph:e,advancePt:s.advancePt,fontRoute:l.fontRoute,fontSizePt:t.fontSize,fontWeight:l.font.weight,fontStyle:l.font.style,color:a?.color?{kind:`explicit`,color:`#${a.color}`}:o?.colorAuto?{kind:`auto`}:{kind:`default`}}}b.push({kind:`tab`,range:{start:p,end:p+s},measuredWidthPt:t.measuredWidth,leader:n,fontSizePt:t.fontSize,bold:t.bold,italic:t.italic,...i?{leaderShape:i}:{}})}else if(`imagePath`in e){let t=e;if(t.anchor)continue;let n=zC(e),r=NC(i,n??0);if(t.unavailableResourceKind){b.push({kind:`unavailable-resource`,range:{start:p,end:p+s},resourceKind:t.unavailableResourceKind,measuredWidthPt:t.measuredWidth,widthPt:t.widthPt,heightPt:t.heightPt,topOffsetPt:-t.heightPt,drawingId:IC(i,n??0)}),d=Math.max(d,p+s);continue}let a=t.chart?`chart`:`image`,o=t.chart?FC(r):Kc(r,t.imagePath);b.push({kind:`resource`,range:{start:p,end:p+s},resourceKey:o,resourceKind:a,measuredWidthPt:t.measuredWidth,widthPt:t.widthPt,heightPt:t.heightPt,topOffsetPt:-t.heightPt,...u?{orientation:`upright-physical`}:{}})}else if(`mathNodes`in e){let t=e;b.push({kind:`resource`,range:{start:p,end:p+s},resourceKey:t.mathResourceKey,resourceKind:`math`,measuredWidthPt:t.measuredWidth,widthPt:t.measuredWidth,heightPt:t.mathAscent+t.mathDescent,topOffsetPt:-t.mathAscent})}else b.push(rw(e,t,p,a.characterGrid.active?a.characterGrid.deltaPt:0,r,l));d=Math.max(d,p+s)}let x=h.segments.length===1&&`mathNodes`in(h.segments[0]??{})?h.segments[0]:void 0;return AC({paragraphXPt:n,availableWidthPt:r,alignment:t.alignment,baseRtl:a.baseRtl,isFirstLine:m===0,isLastLine:m===e.lines.length-1,stretchLastLine:a.stretchLastLine,firstLineIndentPt:a.firstIndentPt,...m===0&&s?{numbering:{bodyOffsetPt:s.bodyOffsetPt}}:{},...g===void 0?{}:{decimalAutoTabPt:g},...x?.display?{displayMathJustification:x.jc??a.mathDefJc??`centerGroup`}:{},line:{range:{start:Number.isFinite(v)?v:d,end:y},topPt:p.topYPt,baselinePt:_,advancePt:p.advancePt,xOffsetPt:h.xOffset,availableWidthPt:h.availWidth,endsWithBreak:h.endsWithBreak??!1,segments:b}})})}function sw(e,t){return{start:e.start+t,end:e.end+t}}function cw(e,t){if(!Number.isFinite(t)||t<0)throw RangeError(`Paragraph continuation source range must be finite and non-negative`);let n=e[0];if(!n)return e;let r=t-n.range.start;return r===0?e:e.map(e=>({...e,range:sw(e.range,r),placements:e.placements.map(e=>{let t=sw(e.range,r);return e.kind===`text`?{...e,range:t,clusters:e.clusters.map(e=>({...e,range:sw(e.range,r)})),paintOps:e.paintOps.map(e=>({...e,range:sw(e.range,r)}))}:{...e,range:t}})}))}function lw(e,t,n,r,i){let a=e.contentEndYPt-e.contentStartYPt;return AC({paragraphXPt:n,availableWidthPt:r,alignment:t.alignment,baseRtl:i.baseRtl,isFirstLine:!0,isLastLine:!0,stretchLastLine:i.stretchLastLine,line:{range:{start:0,end:0},topPt:e.contentStartYPt,baselinePt:e.contentEndYPt-e.lastLineBelowBaselinePt,advancePt:a,xOffsetPt:0,availableWidthPt:r,endsWithBreak:!1,segments:[]}})}function uw(e,t){let n=t.anchorFrames,r=e.anchorXRelativeFrom??(e.anchorXFromMargin?`margin`:`page`),i=e.anchorYRelativeFrom??(e.anchorYFromPara?`paragraph`:`page`),a=n?.page,o=n?.margin,s=a&&o?{xPt:a.xPt,yPt:a.yPt,widthPt:Math.max(0,o.xPt-a.xPt),heightPt:a.heightPt}:null,c=a&&o?{xPt:o.xPt+o.widthPt,yPt:a.yPt,widthPt:Math.max(0,a.xPt+a.widthPt-o.xPt-o.widthPt),heightPt:a.heightPt}:null,l=a&&o?{xPt:a.xPt,yPt:a.yPt,widthPt:a.widthPt,heightPt:Math.max(0,o.yPt-a.yPt)}:null,u=a&&o?{xPt:a.xPt,yPt:o.yPt+o.heightPt,widthPt:a.widthPt,heightPt:Math.max(0,a.yPt+a.heightPt-o.yPt-o.heightPt)}:null,d=n?.pageParity===`even`,f=r===`page`?a:r===`column`||r===`character`?n?.column:r===`leftMargin`?s:r===`rightMargin`?c:r===`insideMargin`?d?c:s:r===`outsideMargin`?d?s:c:o,p=i===`paragraph`||i===`line`||i===`character`?{xPt:t.placement.paragraphXPt,yPt:t.placement.startYPt,widthPt:t.placement.availableWidthPt,heightPt:0}:i===`page`?a:i===`column`?n?.column:i===`topMargin`?l:i===`bottomMargin`?u:i===`insideMargin`?d?u:l:i===`outsideMargin`?d?l:u:o;if(!f||!p)return null;let m=e.widthPt,h=e.heightPt,g=e.anchorXPt??0,_=e.anchorYPt??0,v=e.type===`shape`?e.pctPosH:null,y=e.type===`shape`?e.pctPosV:null;return{xPt:v==null?e.anchorXAlign===`center`?f.xPt+(f.widthPt-m)/2:e.anchorXAlign===`right`||e.anchorXAlign===`outside`&&!d||e.anchorXAlign===`inside`&&d?f.xPt+f.widthPt-m:f.xPt+g:f.xPt+f.widthPt*v+g,yPt:y==null?e.anchorYAlign===`center`?p.yPt+(p.heightPt-h)/2:e.anchorYAlign===`bottom`||e.anchorYAlign===`outside`&&!d||e.anchorYAlign===`inside`&&d?p.yPt+p.heightPt-h:p.yPt+_:p.yPt+p.heightPt*y+_,widthPt:m,heightPt:h}}function dw(e,t){return uw(e,t)??{xPt:e.anchorXPt+(e.anchorXFromMargin?t.placement.paragraphXPt:0),yPt:e.anchorYPt+(e.anchorYFromPara?t.placement.startYPt:0),widthPt:e.widthPt,heightPt:e.heightPt}}function fw(e,t,n,r){let i=gS(e,t,n.environment.layoutServices?.text,e.vmlTextPathInput),a=[i.command],o=PC(i,NC(n.source,r));return{kind:`drawing`,id:`${n.id}:drawing:${r}`,source:NC(n.source,r),flowDomainId:n.flowDomainId,flowBounds:t,inkBounds:t,advancePt:0,ordinaryFlow:!1,commands:a,...o.length===0?{}:{diagnostics:o},anchorLayer:{occurrenceId:`public-shape:${n.id}:${r}`,behindDoc:e.behindDoc===!0,relativeHeight:Number.isFinite(e.zOrder)?e.zOrder:r,sourceOrder:r,horizontalOwnership:e.anchorXRelativeFrom===`character`?`host`:`page`,verticalOwnership:e.anchorYRelativeFrom===`paragraph`||e.anchorYRelativeFrom===`line`||e.anchorYRelativeFrom===`character`||!e.anchorYRelativeFrom&&e.anchorYFromPara?`host`:`page`}}}function pw(e,t,n){if(!e.anchor||e.anchorAcquisitionInput)return null;let r=uw(e,t);if(!r)return null;let i=e.anchorYRelativeFrom??(e.anchorYFromPara?`paragraph`:`page`),a=NC(t.source,n);return{kind:`drawing`,id:`${t.id}:public-anchor-drawing:${n}`,source:a,flowDomainId:t.flowDomainId,flowBounds:r,inkBounds:r,advancePt:0,ordinaryFlow:!1,commands:[{kind:`resource`,resourceKind:e.type,resourceKey:e.type===`image`?Kc(a,e.imagePath):FC(a),rect:r,...t.environment.verticalPageFrame?{orientation:`upright-physical`}:{}}],anchorLayer:{occurrenceId:`public-anchor:${t.id}:${n}`,behindDoc:!1,relativeHeight:n,sourceOrder:n,horizontalOwnership:`page`,verticalOwnership:i===`paragraph`?`host`:`page`}}}function mw(e){return(e.type===`image`||e.type===`chart`||e.type===`shape`||e.type===`unavailableDrawing`)&&e.anchorAcquisitionInput!==void 0}function hw(e){return[{xPt:e.xPt,yPt:e.yPt},{xPt:e.xPt+e.widthPt,yPt:e.yPt},{xPt:e.xPt+e.widthPt,yPt:e.yPt+e.heightPt},{xPt:e.xPt,yPt:e.yPt+e.heightPt}]}function gw(e,t,n){let r=t.xPt-e.xPt,i=t.yPt-e.yPt,a=e.xPt+e.widthPt-t.xPt-t.widthPt,o=e.yPt+e.heightPt-t.yPt-t.heightPt;return{xPt:n.xPt-r,yPt:n.yPt-i,widthPt:Math.max(0,n.widthPt+r+a),heightPt:Math.max(0,n.heightPt+i+o)}}function _w(e,t){return{a:t.a,b:t.b,c:t.c,d:t.d,e:e.xPt+e.widthPt/2,f:e.yPt+e.heightPt/2}}function vw(e,t){let n=[dy(t,e),dy(t,{xPt:e.xPt+e.widthPt,yPt:e.yPt}),dy(t,{xPt:e.xPt,yPt:e.yPt+e.heightPt}),dy(t,{xPt:e.xPt+e.widthPt,yPt:e.yPt+e.heightPt})];if(n.some(e=>e===null))throw Error(`Upright drawing transform must be invertible`);let r=n,i=Math.min(...r.map(e=>e.xPt)),a=Math.min(...r.map(e=>e.yPt));return{xPt:i,yPt:a,widthPt:Math.max(...r.map(e=>e.xPt))-i,heightPt:Math.max(...r.map(e=>e.yPt))-a}}function yw(e,t){return U_(t,e)}function bw(e,t){let n=e=>{let n=W_(t,{top:e.topPt,right:e.rightPt,bottom:e.bottomPt,left:e.leftPt});return{topPt:n.top,rightPt:n.right,bottomPt:n.bottom,leftPt:n.left}};return{...e,axes:{horizontal:e.axes.vertical,vertical:e.axes.horizontal},geometry:{...e.geometry,objectFrame:U_(t,e.geometry.objectFrame),inkBounds:U_(t,e.geometry.inkBounds),wrapBounds:e.geometry.wrapBounds?U_(t,e.geometry.wrapBounds):null,size:{horizontal:e.geometry.size.vertical,vertical:e.geometry.size.horizontal},parentEffectExtent:n(e.geometry.parentEffectExtent),wrap:{...e.geometry.wrap,distances:n(e.geometry.wrap.distances),distanceSources:W_(t,e.geometry.wrap.distanceSources),effectExtent:n(e.geometry.wrap.effectExtent),...e.geometry.wrap.polygon?{polygon:{...e.geometry.wrap.polygon,points:e.geometry.wrap.polygon.points.map(e=>H_(t,e))}}:{}}}}}function xw(e,t){let n=e.geometry.objectFrame;if(n.xPt===t.xPt&&n.yPt===t.yPt&&n.widthPt===t.widthPt&&n.heightPt===t.heightPt)return e;let r=n.widthPt===0?1:t.widthPt/n.widthPt,i=n.heightPt===0?1:t.heightPt/n.heightPt,a=e.geometry.wrap.polygon;return{...e,geometry:{...e.geometry,objectFrame:t,inkBounds:gw(e.geometry.inkBounds,n,t),wrapBounds:e.geometry.wrapBounds?gw(e.geometry.wrapBounds,n,t):null,wrap:{...e.geometry.wrap,polygon:a?{...a,points:a.points.map(e=>({xPt:t.xPt+(e.xPt-n.xPt)*r,yPt:t.yPt+(e.yPt-n.yPt)*i}))}:null}}}}function Sw(e,t,n){let r=e.group?.resolvedChildFrame;if(!r)return t;let i=e.extent.widthPt,a=e.extent.heightPt;if(e.extent.widthStatus!==`valid`||e.extent.heightStatus!==`valid`||i===null||a===null||i<=0||a<=0)throw Error(`resolved grouped anchor requires its authored wp:extent`);let o=n===void 0?t:U_(n.logicalToPhysical,t),s=o.widthPt/i,c=o.heightPt/a,l={xPt:o.xPt+r.offsetXPt*s,yPt:o.yPt+r.offsetYPt*c,widthPt:r.widthPt*s,heightPt:r.heightPt*c};return n===void 0?l:U_(n.physicalToLogical,l)}function Cw(e,t,n=!1){let r=e.axes[t];return r.status!==`resolved`||n||r.referenceFrame===`paragraph`||r.referenceFrame===`line`||r.referenceFrame===`character`?`host`:`page`}function ww(e,t,n,r,i,a,o,s,c,l){let u=-1,d;for(let t=0;t<n.length;t+=1){let r=n[t]?.placements.find(t=>t.kind===`anchor-host`&&t.anchorOccurrenceId===e);if(r?.kind===`anchor-host`){u=t,d=r;break}}if(!d||u<0)return null;let f=[...t].sort((e,t)=>(e.run.anchorAcquisitionInput?.group?.sourceIndex??0)-(t.run.anchorAcquisitionInput?.group?.sourceIndex??0)||e.runIndex-t.runIndex),p=f[0];if(!p?.run.anchorAcquisitionInput)return null;let m=n[u],h=i.anchorFrames,g=p.run.anchorAcquisitionInput.behavior,_=g.layoutInCellStatus===`valid`&&g.layoutInCell===!0&&i.anchorCellBounds!==void 0?i.anchorCellBounds:null,v=eC({acquisition:p.run.anchorAcquisitionInput,frames:{page:h?.page?_?{...h.page,..._}:h.page:null,margin:h?.margin?_?{...h.margin,..._}:h.margin:null,column:h?.column?_?{...h.column,..._}:h.column:null,paragraph:{xPt:i.placement.paragraphXPt,yPt:i.placement.startYPt,widthPt:i.placement.availableWidthPt,heightPt:Math.max(0,a)},line:m.bounds,character:d.bounds,pageParity:h?.pageParity??null}});if(v.status!==`resolved`)return{result:v,textBoxes:[],hostLineIndex:u,hostRange:d.range};let y=i.environment.verticalPageFrame&&h?.page?z_(h.page,i.environment.pageWritingMode):void 0,b=y===void 0?void 0:G_(i.environment.pageWritingMode,y),x=y===void 0?v:bw(v,b.physicalToLogical);if(g.behindDocStatus!==`valid`||g.relativeHeightStatus!==`valid`||g.behindDoc===null||g.relativeHeight===null)throw Error(`resolved anchor frame must retain required CT_Anchor behavior`);let S=x.geometry.objectFrame,C=y===void 0?void 0:_w(S,b.physicalToLogical),w=C?{...i.environment,verticalCJK:!1,verticalPageFrame:!1}:i.environment,T=[],E=[],D=[],O=[],k=new Map,A=S;if(p.run.type===`shape`&&p.run.anchorAcquisitionInput.group===null){let t=NC(i.source,p.runIndex),n=C?vw(S,C):S,r=Nw(p.run,n,{id:`${i.id}:anchor-textbox:${e}:${p.runIndex}`,source:t,flowDomainId:i.flowDomainId,context:i.context,measurer:i.measurer,environment:w,input:p.run.textBoxInput,acquireCompleteStory:i.acquireCompleteStory,...C?{coordinateSpace:`upright-physical`}:{}});r&&(k.set(p.runIndex,r),A=C?yw(r.flowBounds,C):r.flowBounds)}let j=xw(x,A);if(g.allowOverlapStatus!==`valid`||g.allowOverlap===null||g.layoutInCellStatus!==`valid`||g.layoutInCell===null)throw Error(`resolved anchor frame must retain overlap and cell behavior`);let M=j.geometry.wrapBounds,N=!g.allowOverlap,ee=g.allowOverlap&&i.ordinaryFlow&&M!==null;if(N||ee){let t=Cw(j,`vertical`,g.layoutInCell&&i.anchorCellBounds!==void 0),n=l.filter(e=>!NS(t,g.relativeHeight,e.relativeHeight)),r=(N?[...c,...n].filter(t=>t.occurrenceId!==e).map(e=>({occurrenceId:e.occurrenceId,bounds:e.bounds})):o.filter(t=>t.anchorOccurrenceId!==e).map(e=>({occurrenceId:e.anchorOccurrenceId??e.id,bounds:e.bounds}))).map(e=>({occurrenceId:e.occurrenceId,kind:`drawingml`,paragraphId:0,bounds:e.bounds,exclusionBounds:e.bounds})),a=i.anchorFrames?.page,s=N&&g.layoutInCell&&i.anchorCellBounds?i.anchorCellBounds.xPt+i.anchorCellBounds.widthPt:a?a.xPt+a.widthPt:1/0,u=rd({moving:{occurrenceId:e,kind:`drawingml`,paragraphId:1,bounds:A,exclusionBounds:M??A},blockers:r,avoidance:N?{kind:`drawingml-normative`}:{kind:`word-different-paragraph`,paragraphId:1},rightBoundaryPt:s}).displacement;if(u.xPt!==0||u.yPt!==0){if(A=Q(A,u),C)C={...C,e:C.e+u.xPt,f:C.f+u.yPt};else{let e=k.get(p.runIndex);e&&k.set(p.runIndex,ax(e,u))}j=xw(x,A)}}for(let{run:t,runIndex:n}of f){let r=NC(i.source,n),a=t.anchorAcquisitionInput,o=Sw(a,A,b),s=C?vw(o,C):o;if(t.type===`image`)T.push({kind:`resource`,resourceKind:`image`,resourceKey:Kc(r,t.imagePath),rect:s});else if(t.type===`chart`)T.push({kind:`resource`,resourceKind:`chart`,resourceKey:FC(r),rect:s});else if(t.type===`unavailableDrawing`)T.push({kind:`noop`}),E.push(LC(t.resourceKind,r));else{let o=a.group?.resolvedChildFrame,c=gS(o?{...t,rotation:o.rotationDeg,flipH:o.flipH,flipV:o.flipV}:t,s,i.environment.layoutServices?.text,t.vmlTextPathInput);T.push(c.command),E.push(...PC(c,r));let l=`${i.id}:anchor-textbox:${e}:${n}`,u=k.get(n)??Nw(t,s,{id:l,source:r,flowDomainId:i.flowDomainId,context:i.context,measurer:i.measurer,environment:w,input:t.textBoxInput,acquireCompleteStory:i.acquireCompleteStory,...C?{coordinateSpace:`upright-physical`}:{}});u&&(D.push(u),O.push(l))}}let te={kind:`drawing`,id:`${i.id}:anchor-drawing:${e}`,source:NC(i.source,p.runIndex),flowDomainId:i.flowDomainId,flowBounds:A,inkBounds:j.geometry.inkBounds,advancePt:0,ordinaryFlow:!1,...C?{orientation:`upright-physical`,transform:C}:{},commands:T,...E.length===0?{}:{diagnostics:Object.freeze(E)},anchorLayer:{occurrenceId:e,behindDoc:g.behindDoc,relativeHeight:g.relativeHeight,sourceOrder:p.runIndex,horizontalOwnership:Cw(j,`horizontal`,g.layoutInCell&&i.anchorCellBounds!==void 0),verticalOwnership:Cw(j,`vertical`,g.layoutInCell&&i.anchorCellBounds!==void 0),...g.layoutInCell&&i.anchorCellBounds?{cellContainment:!0}:{}},...O.length?{textBoxIds:O}:{}},P=j.geometry.wrapBounds,ne=P&&j.geometry.wrap.kind!==`none`?{id:`${i.id}:anchor-exclusion:${e}`,wrap:j.geometry.wrap.kind,...j.geometry.wrap.side?{wrapSide:j.geometry.wrap.side}:{},bounds:P,polygon:j.geometry.wrap.polygon?.points??hw(P),anchorOccurrenceId:e,verticalOwnership:Cw(j,`vertical`,g.layoutInCell&&i.anchorCellBounds!==void 0)}:void 0,F={occurrenceId:e,bounds:A,horizontalOwnership:Cw(j,`horizontal`,g.layoutInCell&&i.anchorCellBounds!==void 0),verticalOwnership:Cw(j,`vertical`,g.layoutInCell&&i.anchorCellBounds!==void 0),...g.relativeHeight===null?{}:{relativeHeight:g.relativeHeight}};return{result:j,drawing:te,exclusion:ne,collision:F,textBoxes:D,...g.layoutInCell&&i.anchorCellBounds?{cellContainmentBounds:A}:{},hostLineIndex:u,hostRange:d.range}}function Tw(e,t){let n=t.bidi===!0,r=t.runs.some(e=>e.type===`text`&&!!e.ruby),i=t.runs.some(e=>e.type===`text`&&Rl.test(e.text));return{...e,physicalIndentLeftPt:n?t.indentRight:t.indentLeft,physicalIndentRightPt:n?t.indentLeft:t.indentRight,firstIndentPt:t.indentFirst,lineSpacing:t.lineSpacing,spaceBeforePt:t.spaceBefore,spaceAfterPt:t.spaceAfter,baseRtl:n,isJustified:Lp(t.alignment),stretchLastLine:Rp(t.alignment),tabStops:[...t.tabStops],hasRuby:r,hasEastAsianText:i}}function Ew(e){return e===`vert`||e===`vert270`||e===`eaVert`||e===`mongolianVert`?e:void 0}function Dw(e,t,n){let r=Math.max(0,t-n);return e===`b`?r:e===`ctr`?r/2:0}function Ow(e,t,n,r){let i=t===`eaVert`||t===`mongolianVert`,a=e.lines.map(e=>{let a=t===`mongolianVert`?e.placements.reduce((t,n)=>n.kind===`text`&&n.ruby?Math.max(t,e.baselinePt-Math.min(e.baselinePt,...n.ruby.paintOps.map(e=>e.origin.yPt))):t,0):0,o=(t===`mongolianVert`?2*n.yPt+n.heightPt-e.baselinePt+r.bottomPt-r.leftPt+a:e.baselinePt)-e.baselinePt,s=e.bounds.yPt+o,c=e.placements.map(e=>{if(e.kind!==`text`)return`bounds`in e&&e.bounds?{...e,bounds:{...e.bounds,yPt:e.bounds.yPt+o}}:e;let t=i?e.clusters.map(t=>{let n=e.text.slice(t.range.start-e.range.start,t.range.end-e.range.start),r=e.paintOps.find(e=>e.range.start<=t.range.start&&e.range.end>=t.range.end)??e.paintOps[0],i=Rl.test(n);return{...r,text:n,range:t.range,offset:i?{xPt:t.offset.xPt+t.advancePt/2,yPt:t.offset.yPt}:t.offset,glyphOrientation:i?`upright`:`sideways`}}):e.paintOps;return $w({...e,paintOps:t},o)});return{...e,bounds:{...e.bounds,yPt:s},baselinePt:e.baselinePt+o,placements:c}});return{...e,lines:a}}function kw(e,t){let n=(e,n)=>e.kind===`paragraph`?Ow(e,t===`mongolianVert`?`eaVert`:t,n,{topPt:0,rightPt:0,bottomPt:0,leftPt:0}):kw(e,t),r={...e,rows:e.rows.map(e=>({...e,cells:e.cells.map(e=>({...e,blocks:e.blocks.map(t=>({...t,layout:n(t.layout,e.contentBounds)}))}))}))},i=new Map,a=e=>{let n=i.get(e);if(n)return n;let r={...e,child:kw(e.child,t)};return i.set(e,r),r},o=e.floatingTables?.map(a),s=e.resolvedFloatingTables?.map(e=>{let t=a(e.source);return{...e,source:t,child:t.child}});return{...r,...o?{floatingTables:o}:{},...s?{resolvedFloatingTables:s}:{}}}function Aw(e,t,n,r){return{...e,blocks:e.blocks.map(e=>{if(e.kind===`paragraph`)return Ow(e,t,n,r);if(e.kind===`table`)return kw(e,t);throw Error(`Text-box story contains unsupported retained node: ${e.kind}`)})}}function jw(e,t,n=!0){if(t===0)return e;let r={xPt:0,yPt:t};return{...e,flowBounds:Q(e.flowBounds,r),inkBounds:Q(e.inkBounds,r),...e.clipBounds?{clipBounds:n?Q(e.clipBounds,r):e.clipBounds}:{},blocks:e.blocks.map(e=>{if(e.kind===`paragraph`)return rx(e,r);if(e.kind===`table`)return Mw(e,r);throw Error(`Text-box story contains unsupported retained node: ${e.kind}`)})}}function Mw(e,t){let n=cx(e,t),r=new Map,i=e=>{let n=r.get(e);if(n)return n;let i={...e,anchorBounds:Q(e.anchorBounds,t),...e.columnBounds?{columnBounds:Q(e.columnBounds,t)}:{},child:Mw(e.child,t)};return r.set(e,i),i},a=e.floatingTables?.map(i),o=e.resolvedFloatingTables?.map(e=>{let n=i(e.source);return{...e,xPt:e.xPt+t.xPt,yPt:e.yPt+t.yPt,bounds:Q(e.bounds,t),exclusionBounds:Q(e.exclusionBounds,t),source:n,child:n.child}});return{...n,...a?{floatingTables:a}:{},...o?{resolvedFloatingTables:o}:{}}}function Nw(e,t,n){let r=n.source,i=n.input??{kind:`compatibility`,source:{story:`textbox`,storyInstance:`${r.story}:${r.storyInstance}:${r.path.join(`.`)}`,path:[]},paragraphs:tl(e,{story:`textbox`,storyInstance:`${r.story}:${r.storyInstance}:${r.path.join(`.`)}`,path:[]})},a=i.source,o=i.kind===`complete`?i.blocks.length:i.paragraphs.length;if(o===0)return;let s=Ew(e.textVert),c=s?{xPt:-t.heightPt/2,yPt:-t.widthPt/2,widthPt:t.heightPt,heightPt:t.widthPt}:t,l=i.kind===`compatibility`?i.paragraphs:Object.freeze([]),u={topPt:e.textInsetT??0,rightPt:e.textInsetR??0,bottomPt:e.textInsetB??0,leftPt:e.textInsetL??0},d={xPt:c.xPt+u.leftPt,yPt:c.yPt+u.topPt,widthPt:Math.max(0,c.widthPt-u.leftPt-u.rightPt),heightPt:Math.max(0,c.heightPt-u.topPt-u.bottomPt)},f;if(i.kind===`complete`){if(!n.acquireCompleteStory)throw Error(`Complete text-box content requires the shared story acquisition adapter`);f=n.acquireCompleteStory({source:a,container:{id:`${n.id}:story`,kind:`textbox`,bounds:d,capacity:`unbounded`},blocks:i.blocks,coordinateSpace:n.coordinateSpace??`section-logical`})}let p=c.yPt+u.topPt,m=null,h=l.map((t,r)=>{let i=t.runs.map(t=>Vl({text:t.text,fontSizePt:t.fontSizePt,color:t.color?.slice(1)??null,fontFamily:t.fontFamily??null,fontFamilyEastAsia:t.fontFamilyEastAsia??null,bold:t.bold,italic:t.italic,ruby:t.ruby},e.textVert)),a=Math.max(0,c.widthPt-u.leftPt-u.rightPt-t.indentLeftPt-t.indentRightPt-Math.max(0,t.indentFirstPt)),o=s?t.image?.heightPt??0:t.image?.widthPt??0,l=s?t.image?.widthPt??0:t.image?.heightPt??0,f=o>a&&o>0?a/o:1,h=t.image?[{type:`image`,imagePath:t.image.imagePath,mimeType:t.image.mimeType,...t.image.svgImagePath?{svgImagePath:t.image.svgImagePath}:{},widthPt:o>0?o*f:a,heightPt:l>0?l*f:a,anchor:!1}]:i,g={alignment:t.alignment,indentLeft:t.indentLeftPt,indentRight:t.indentRightPt,indentFirst:t.indentFirstPt,spaceBefore:t.spacing.beforePt,spaceAfter:t.spacing.afterPt,lineSpacing:t.lineSpacing,numbering:t.numbering??null,numberingMarkerShapeInput:t.numberingMarkerShapeInput,tabStops:[...t.tabStops],bidi:t.bidi,contextualSpacing:t.contextualSpacing,styleId:t.styleId,runs:h},_=Tw(n.context,g),v=tC(m,t,m?.spacing.afterPt??0,t.spacing.beforePt);p+=v;let y=Gw(g,{id:`${n.id}:paragraph:${r}`,source:t.source,flowDomainId:`${n.flowDomainId}:textbox`,ordinaryFlow:!0,context:_,placement:{startYPt:p,paragraphXPt:c.xPt+u.leftPt,availableWidthPt:Math.max(0,c.widthPt-u.leftPt-u.rightPt),maximumYPt:c.yPt+c.heightPt-u.bottomPt,suppressSpaceBefore:!0},measurer:n.measurer,environment:n.environment,exclusions:[]});return p+=y.advancePt-y.spacing.afterPt,m=t,s?Ow(y,s,d,u):y}),g=f?Math.max(0,f.advancePt+u.topPt+u.bottomPt):Math.max(0,p-c.yPt+u.bottomPt),_=e.textAutofit===`sp`&&o>0&&(!s||l.every(e=>e.image===void 0))&&Number.isFinite(g)&&g>0?s?{...t,widthPt:g}:{...t,heightPt:g}:t,v=s?{xPt:-_.heightPt/2,yPt:-_.widthPt/2,widthPt:_.heightPt,heightPt:_.widthPt}:_;if(s&&_.widthPt!==t.widthPt&&s!==`mongolianVert`){let e=v.yPt-c.yPt;h=h.map(t=>tT(t,e))}let y={xPt:v.xPt+u.leftPt,yPt:v.yPt+u.topPt,widthPt:Math.max(0,v.widthPt-u.leftPt-u.rightPt),heightPt:Math.max(0,v.heightPt-u.topPt-u.bottomPt)},b=xv(h.map(e=>e.flowBounds))??{xPt:y.xPt,yPt:y.yPt,widthPt:0,heightPt:0},x=xv(h.map(e=>e.inkBounds))??{xPt:y.xPt,yPt:y.yPt,widthPt:0,heightPt:0},S=f??{story:`textbox`,flowBounds:b,inkBounds:x,clipBounds:y,blocks:h,advancePt:Math.max(0,g-u.topPt-u.bottomPt),diagnostics:[]},C=AS(S);return f&&s&&(S=Aw(jw(S,v.yPt-c.yPt),s,y,u)),S=jw(S,Dw(e.textAnchor,y.heightPt,C),!1),Xc({kind:`textbox`,id:n.id,source:l[0]?.source??a,flowDomainId:`${n.flowDomainId}:textbox`,flowBounds:_,inkBounds:_,...e.defaultTextColor?{defaultTextColor:`#${e.defaultTextColor.replace(/^#/u,``)}`}:{},...e.textAutofit===`none`?{clipBounds:y}:{},advancePt:0,ordinaryFlow:!1,story:S,transform:s?{a:0,b:s===`vert270`?-1:1,c:s===`vert270`?1:-1,d:0,e:_.xPt+_.widthPt/2,f:_.yPt+_.heightPt/2}:{a:1,b:0,c:0,d:1,e:0,f:0},writingMode:e.textVert===`vert270`?`vertical-lr`:e.textVert?`vertical-rl`:`horizontal-tb`,insets:u,contentBounds:v,...s?{verticalMode:s}:{}})}var Pw=class extends Z{reason;states;occurrenceCapacity;constructor(e,t,n){super(`NON_CONVERGENCE`,`parser-owned paragraph anchor reflow did not converge (${e}; ${n} occurrences; ${t.length} states)`),this.name=`ParagraphAnchorReflowNonConvergenceError`,this.reason=e,this.states=Object.freeze([...t]),this.occurrenceCapacity=n}};function Fw(e,t){if(t.length===0)return e.placement;if(e.placement.wrap)throw Error(`Conflicting paragraph wrap authorities: placement.wrap and effective exclusions`);let n=e.anchorFrames?.page,r=Fx(t.map((e,t)=>({kind:`shape`,mode:e.wrap===`topAndBottom`?`topAndBottom`:`square`,authoredWrap:e.wrap,wrapPolygon:e.polygon,imageKey:e.id,imageX:e.bounds.xPt,imageY:e.bounds.yPt,imageW:e.bounds.widthPt,imageH:e.bounds.heightPt,xLeft:e.bounds.xPt,xRight:e.bounds.xPt+e.bounds.widthPt,yTop:e.bounds.yPt,yBottom:e.bounds.yPt+e.bounds.heightPt,side:e.wrapSide??`bothSides`,distLeft:0,distRight:0,distTop:0,distBottom:0,paraId:t})),{xLeftPt:n?.xPt??e.placement.paragraphXPt,xRightPt:n?n.xPt+n.widthPt:e.placement.paragraphXPt+e.placement.availableWidthPt,readingDirection:e.context.baseRtl?`rtl`:`ltr`});return{...e.placement,wrap:r}}function Iw(e,t){let n=new Map;for(let r of e.exclusions){let e=r.anchorOccurrenceId;if(!(!e||!t.has(e))){if(n.has(e))throw Error(`Paragraph anchor occurrence produced duplicate exclusions: ${e}`);n.set(e,r)}}return Object.freeze([...n.values()])}function Lw(e){return Uc(`paragraph-effective-wrap-exclusions`,e.map(e=>({id:e.id,...e.anchorOccurrenceId===void 0?{}:{occurrenceId:e.anchorOccurrenceId},wrap:e.wrap,...e.wrapSide===void 0?{}:{wrapSide:e.wrapSide},bounds:e.bounds,polygon:e.polygon,...e.verticalOwnership===void 0?{}:{verticalOwnership:e.verticalOwnership}})))}function Rw(e){let t=new Set;for(let n of e){let e=n.anchorOccurrenceId;if(e){if(t.has(e))throw Error(`Duplicate external paragraph exclusion occurrence: ${e}`);t.add(e)}}return t}function zw(e,t){let n=Rw(e);return Object.freeze([...e,...t.filter(e=>!e.anchorOccurrenceId||!n.has(e.anchorOccurrenceId))])}function Bw(e,t){let n=new Set;for(let t of e){if(n.has(t.occurrenceId))throw Error(`Duplicate external anchor collision occurrence: ${t.occurrenceId}`);n.add(t.occurrenceId)}return Object.freeze([...e,...t.filter(e=>!n.has(e.occurrenceId))])}function Vw(e,t,n,r){let i=n.environment.layoutServices,a=n.environment.verticalGlyphMeasurement,o=n.anchorFrames,s=t.runs.some(mw),c=t.runs.some(e=>e.type===`shape`&&e.textBoxInput?.kind===`complete`),{wrap:l,...u}=n.placement,d=n.context,f=n.environment;return`paragraph-acquisition-v1:${JSON.stringify([n.id,[n.source.story,n.source.storyInstance,n.source.path],n.flowDomainId,n.ordinaryFlow,[u.startYPt,u.paragraphXPt,u.availableWidthPt,u.maximumYPt,u.suppressSpaceBefore,l?e.objectIdentity(l):null],[d.lineGrid.active,d.lineGrid.pitchPt,d.characterGrid.active,d.characterGrid.deltaPt,d.physicalIndentLeftPt,d.physicalIndentRightPt,d.firstIndentPt,d.lineSpacing?[d.lineSpacing.value,d.lineSpacing.rule,d.lineSpacing.explicit??null]:null,d.spaceBeforePt,d.spaceAfterPt,d.baseRtl,d.isJustified,d.stretchLastLine,d.tabStops.map(e=>[e.pos,e.alignment,e.leader]),d.hasRuby,d.hasEastAsianText,[d.kinsoku.enabled,[...d.kinsoku.lineStartForbidden].sort((e,t)=>e-t),[...d.kinsoku.lineEndForbidden].sort((e,t)=>e-t)],d.defaultTabPt,d.overflowPunct!==!1,d.numberingMarkerGeometry?JSON.stringify(d.numberingMarkerGeometry):null,d.mathDefJc??null],[e.objectIdentity(n.measurer.context),e.objectIdentity(n.measurer.fontFamilyClasses)],[f.pageIndex,f.totalPages,f.displayPageNumber??null,f.pageNumberFormat??null,f.currentDateMs??null,f.noteNumbers?[...f.noteNumbers.entries()].sort(([e],[t])=>e.localeCompare(t)):null,f.noteReferenceNumber??null,f.pageWritingMode,f.verticalCJK??null,f.verticalPageFrame??null,f.documentHasEastAsianText,f.useFeLayout??null,f.characterSpacingControl??null,f.resolvedLocalFonts?e.objectIdentity(f.resolvedLocalFonts):null,i?.text.fingerprint??null,i?.images.fingerprint??null,i?.math.fingerprint??null,i?.verticalGlyphFingerprint??null,a?.fingerprint??null],JSON.stringify(n.exclusions),s?JSON.stringify(n.anchorCollisions??[]):null,r?JSON.stringify(r):null,n.paragraphBorderEdges?[n.paragraphBorderEdges.top,n.paragraphBorderEdges.bottom]:null,n.trailingExtentPt??null,n.containerShading??null,n.continuesFromPrevious??null,n.sourceRangeStart??null,o?[o.page?[o.page.xPt,o.page.yPt,o.page.widthPt,o.page.heightPt]:null,o.margin?[o.margin.xPt,o.margin.yPt,o.margin.widthPt,o.margin.heightPt]:null,o.column?[o.column.xPt,o.column.yPt,o.column.widthPt,o.column.heightPt]:null,o.pageParity]:null,s?JSON.stringify(n.anchorCellBounds??null):null,c&&n.acquireCompleteStory?e.objectIdentity(n.acquireCompleteStory):null])}`}function Hw(e){let t=e.src?Object.freeze({...e.src}):void 0;return`text`in e?Object.freeze({...e,...t?{src:t}:{},...e.shapedClusters?{shapedClusters:Object.freeze(e.shapedClusters.map(e=>Object.freeze({...e,range:Object.freeze({...e.range})})))}:{},...e.selectedFaceInkBounds?{selectedFaceInkBounds:Object.freeze({...e.selectedFaceInkBounds})}:{},...e.ruby?{ruby:Object.freeze({...e.ruby})}:{},...e.border?{border:Object.freeze({...e.border})}:{},...e.revision?{revision:Object.freeze({...e.revision})}:{},...e.hyperlink?{hyperlink:Object.freeze({...e.hyperlink})}:{},...e.seaBreaks?{seaBreaks:Object.freeze([...e.seaBreaks])}:{}}):`imagePath`in e?Object.freeze({...e,...t?{src:t}:{},...e.srcRect?{srcRect:Object.freeze({...e.srcRect})}:{},...e.duotone?{duotone:Object.freeze({...e.duotone})}:{}}):`isTab`in e?Object.freeze({...e,...t?{src:t}:{},...e.ptab?{ptab:Object.freeze({...e.ptab})}:{}}):Object.freeze({...e,...t?{src:t}:{}})}function Uw(e){return Object.freeze({...e,layout:Object.freeze({...e.layout,segments:Object.freeze(e.layout.segments.map(Hw)),...e.layout.consumedEnd?{consumedEnd:Object.freeze({...e.layout.consumedEnd})}:{}})})}function Ww(e,t,n){let r=t.environment.layoutServices?n_(t.environment.layoutServices):void 0,i=r?Vw(r,e,t,n):void 0,a=i===void 0?void 0:r.get(e,i);if(a)return a;let o=Rw(t.exclusions),s=new Set(e.runs.flatMap(e=>mw(e)?[e.anchorAcquisitionInput.occurrenceId]:[]));for(let e of o)s.delete(e);let c=s.size,l=Object.freeze([]),u=zw(t.exclusions,l);try{let a=Kd({seedState:Lw(u),step:r=>{let i=zw(t.exclusions,r?.ownedExclusions??l),a=Rx(e,t.context,Fw(t,i),t.measurer,{...t.environment,paragraphMarkShapeInput:e.paragraphMarkShapeInput},n),o=Yw(e,t,a),c=Iw(o,s),u=Lw(zw(t.exclusions,c));if(Lw(o.exclusions)!==u)throw Error(`Paragraph retained exclusions differ from the measured exclusion authority`);return Object.freeze({measured:a,layout:o,ownedExclusions:c,state:u})},stateOf:e=>e.state,limit:16}).value,o=Object.freeze({...a.measured,lines:Object.freeze(a.measured.lines.map(Uw)),placement:Object.freeze({...a.measured.placement})}),c=Object.freeze({measured:o,layout:a.layout});return i!==void 0&&r.set(e,i,c),c}catch(e){throw e instanceof Gd?new Pw(e.reason,e.states,c):e}}function Gw(e,t){return Ww(e,t).layout}const Kw=new WeakMap;function qw(e){return e===void 0?null:e instanceof Date?{date:e.toISOString()}:e instanceof Set?{set:[...e].map(qw).sort((e,t)=>JSON.stringify(e).localeCompare(JSON.stringify(t)))}:e instanceof Map?{map:[...e.entries()].map(([e,t])=>[qw(e),qw(t)]).sort((e,t)=>JSON.stringify(e[0]).localeCompare(JSON.stringify(t[0])))}:Array.isArray(e)?e.map(qw):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,qw(t)])):e}function Jw(e,t){if(t.contexts.length!==e.members.length||t.inputs.length!==e.members.length||t.borderEdges.length!==e.members.length||t.borderExtentsPt.length!==e.members.length)throw Error(`Frame acquisition metadata must align with every group member`);if(!Number.isFinite(t.maximumWidthPt)||t.maximumWidthPt<0)throw RangeError(`Frame maximumWidthPt must be finite and non-negative`);let n=Kw.get(t.acquisitionSession);n||(n=new Map,Kw.set(t.acquisitionSession,n));let r=Uc(`w:frame-acquisition`,[e.id,t.placementSignature,t.maximumWidthPt,t.environment.pageIndex,t.environment.totalPages,t.environment.displayPageNumber??null,t.environment.pageNumberFormat??null,t.environment.currentDateMs??null,t.environment.documentHasEastAsianText,t.environment.layoutServices?.text.fingerprint??null,t.environment.layoutServices?.images.fingerprint??null,t.environment.layoutServices?.math.fingerprint??null,t.environment.layoutServices?.verticalGlyphFingerprint??null,qw(t.contexts),qw(t.inputs),qw(t.borderEdges),qw(t.borderExtentsPt),t.containerShading??null,qw(t.anchorFrames)]),i=n.get(r);if(i)return i;let a=e.framePr,o=a.w==null?Math.max(0,...e.members.map((e,n)=>am(e,t.contexts[n],t.maximumWidthPt,t.measurer,t.environment,KC(t.inputs[n],t.contexts[n],t)))):Math.max(0,a.w),s=Math.max(1,o),c=(()=>{let n=fC(`body-frame:${e.id}`),r=0,i=null,a=0,o=0,c=[];return e.members.forEach((l,u)=>{let d=t.contexts[u],f=Math.max(tC(i,l,a,d.spaceBeforePt),o),p={startYPt:r+f,paragraphXPt:0,availableWidthPt:s,maximumYPt:1/0,suppressSpaceBefore:!0},m=t.borderExtentsPt[u]??0,h={story:`body`,storyInstance:`body`,path:[e.sourceIndices[u]]},{measured:g,layout:_}=Ww(t.inputs[u],{id:`body-frame:${e.id}:${u}`,source:h,flowDomainId:`body-frame:${e.id}`,ordinaryFlow:!1,context:d,placement:p,measurer:t.measurer,environment:t.environment,exclusions:n.exclusions,anchorCollisions:n.collisions,containerShading:t.containerShading,paragraphBorderEdges:t.borderEdges[u],trailingExtentPt:Math.max(d.spaceAfterPt,m),anchorFrames:t.anchorFrames});n=hC(n,_),c.push({paragraph:l,fragment:_,source:h}),r=g.contentEndYPt,i=l,a=g.requestedSpaceAfterPt,o=m}),{heightPt:Math.max(0,r+Math.max(a,o)),members:c}})(),l=t.place(o,c.heightPt),u=Object.freeze(c.members.map(e=>{let t=rx(e.fragment,{xPt:l.bounds.xPt,yPt:l.bounds.yPt}),n=MC(a.hRule===`exact`&&a.h!=null?{...t,clipBounds:l.bounds}:t),r=Object.freeze({...n,advancePt:0});return Object.freeze({...e,fragment:r})})),d=Object.freeze({box:Object.freeze({bounds:l.bounds,exclusionBounds:l.exclusionBounds,exclusionId:`frame:${e.id}`}),members:u});return n.set(r,d),d}function Yw(e,t,n){let r=t.continuesFromPrevious?{...t.context,firstIndentPt:0}:t.context,i=t.placement.paragraphXPt+r.physicalIndentLeftPt,a=t.placement.availableWidthPt-r.physicalIndentLeftPt-r.physicalIndentRightPt,o=iw(e,n),s=t.continuesFromPrevious?void 0:KC(e,r,t),c=ow(n,e,i,a,t.source,r,o,s,t.environment.layoutServices?.text,t.environment.verticalGlyphMeasurement,t.environment.verticalPageFrame);t.sourceRangeStart!==void 0&&(c=cw(c,t.sourceRangeStart)),s&&n.markOnly&&c.length===0&&(s.markerText!==``||e.numbering?.picBulletImagePath)&&(c=[lw(n,e,i,a,r)]);let l=[],u=[],d=[],f=[],p=[],m=[],h=[],g=e.runs.map((e,t)=>e.type===`break`?{kind:`break`,breakKind:e.breakType,offset:o.runStarts[t]??0}:void 0).filter(e=>e!==void 0),_=new Map;e.runs.forEach((e,t)=>{if(!mw(e))return;let n=_.get(e.anchorAcquisitionInput.occurrenceId)??[];n.push({run:e,runIndex:t}),_.set(e.anchorAcquisitionInput.occurrenceId,n)});for(let[r,i]of _){let a=ww(r,i,c,e,t,n.contentEndYPt-t.placement.startYPt,t.exclusions,p,t.anchorCollisions??[],m);a&&(f.push(a.result),a.cellContainmentBounds&&h.push(a.cellContainmentBounds),a.drawing&&(u.push(a.drawing),d.push(...a.textBoxes),a.exclusion&&p.push(a.exclusion),a.collision&&m.push(a.collision),c[a.hostLineIndex]&&(c=c.map((e,t)=>t===a.hostLineIndex?{...e,placements:[...e.placements,{kind:`drawing`,range:a.hostRange,drawingId:a.drawing.id,bounds:a.drawing.inkBounds,advancePt:0}]}:e))))}if(s&&c[0]){let n=JC(s,e,t.context,i,a,c[0]);n.length>0&&(c=[{...c[0],placements:[...n,...c[0].placements]},...c.slice(1)])}if(e.runs.forEach((e,n)=>{let r=NC(t.source,n);if(e.type===`unavailableDrawing`&&e.anchorAcquisitionInput===void 0){let i=IC(t.source,n),a=c.flatMap(e=>e.placements).find(e=>e.kind===`drawing`&&e.drawingId===i);a?.kind===`drawing`&&u.push({kind:`drawing`,id:i,source:r,flowDomainId:t.flowDomainId,flowBounds:a.bounds,inkBounds:a.bounds,advancePt:0,ordinaryFlow:!1,commands:Object.freeze([{kind:`noop`}]),diagnostics:Object.freeze([LC(e.resourceKind,r)])})}if(e.type===`image`&&l.push({kind:`image`,resourceKey:Kc(r,e.imagePath),intrinsicSize:{widthPt:e.widthPt,heightPt:e.heightPt}}),e.type===`chart`&&l.push({kind:`chart`,resourceKey:FC(r),intrinsicSize:{widthPt:e.widthPt,heightPt:e.heightPt}}),e.type===`math`&&l.push({kind:`math`,resourceKey:e.resourceKey??Uc(`math-resource`,r),intrinsicSize:{widthPt:c.flatMap(e=>e.placements).find(e=>e.kind===`resource`&&e.resourceKind===`math`)?.bounds?.widthPt??0,heightPt:e.fontSize}}),(e.type===`image`||e.type===`chart`)&&!t.continuesFromPrevious){let r=pw(e,t,n);if(r){u.push(r);let e=c[0];e&&(c=[{...e,placements:[...e.placements,{kind:`drawing`,range:{start:o.runStarts[n]??0,end:(o.runStarts[n]??0)+(o.runLengths[n]??1)},drawingId:r.id,bounds:r.inkBounds,advancePt:0}]},...c.slice(1)])}}if(e.type===`shape`&&!e.anchorAcquisitionInput&&!t.continuesFromPrevious){let i=dw(e,t),a=`${t.id}:textbox:${n}`,s=Nw(e,i,{id:a,source:r,flowDomainId:t.flowDomainId,context:t.context,measurer:t.measurer,environment:t.environment,input:e.textBoxInput,acquireCompleteStory:t.acquireCompleteStory}),l=fw(e,s?.flowBounds??i,t,n);s&&(d.push(s),l={...l,textBoxIds:[a]}),u.push(l);let f=c[0];f&&(c=[{...f,placements:[...f.placements,{kind:`drawing`,range:{start:o.runStarts[n]??0,end:(o.runStarts[n]??0)+(o.runLengths[n]??1)},drawingId:l.id,bounds:l.inkBounds,advancePt:0}]},...c.slice(1)])}}),e.numbering?.picBulletImagePath&&!t.continuesFromPrevious&&l.push({kind:`picture-bullet`,resourceKey:Kc(t.source,e.numbering.picBulletImagePath),intrinsicSize:{widthPt:e.numbering.picBulletWidthPt??e.numberingMarkerShapeInput?.fontSizePt??0,heightPt:e.numbering.picBulletHeightPt??e.numberingMarkerShapeInput?.fontSizePt??0}}),e.numbering?.picBulletImagePath&&c[0]&&!t.continuesFromPrevious){if(!s)throw Error(`Picture-bullet acquisition requires resolved marker font geometry`);let n=e.numbering.picBulletWidthPt??s.markerWidthPt,r=e.numbering.picBulletHeightPt??e.numberingMarkerShapeInput?.fontSizePt;if(r===void 0)throw Error(`Picture-bullet acquisition requires resolved marker height`);let o=Bp({baseRtl:t.context.baseRtl,alignedLeadingEdgePt:qC(s,t.context,i,a,c[0]),authoredFirstIndentPt:e.indentFirst,markerShiftPt:s.markerShiftPt,markerWidthPt:n});c=[{...c[0],placements:[{kind:`resource`,resourceKind:`picture-bullet`,range:{start:-1,end:0},resourceKey:Kc(t.source,e.numbering.picBulletImagePath),bounds:{xPt:o,yPt:c[0].baselinePt-r,widthPt:n,heightPt:r},advancePt:0},...c[0].placements]},...c.slice(1)]}c=XC(c,e.shading,t.containerShading);let v=n.contentEndYPt-n.contentStartYPt,y=t.paragraphBorderEdges??{top:`top`,bottom:`bottom`},b=QC(e,c,i,a,n.contentStartYPt,v,y),x=e.borders?[...y.top===`none`?[]:[[y.top,e.borders[y.top]]],[`right`,e.borders.right],...y.bottom===`none`?[]:[[`bottom`,e.borders.bottom]],[`left`,e.borders.left]]:[],S=e.borders?x.flatMap(([e,t])=>{if(!ZC(t))return[];let n=e===`top`||e===`between`||e===`bottom`,r=e===`right`||e===`bottom`,i=n?b.yPt+(r?b.heightPt:0):b.xPt+(r?b.widthPt:0);return[{edge:e,from:n?{xPt:b.xPt,yPt:i}:{xPt:i,yPt:b.yPt},to:n?{xPt:b.xPt+b.widthPt,yPt:i}:{xPt:i,yPt:b.yPt+b.heightPt},color:t.color?`#${t.color}`:`#000000`,widthPt:t.width,...J_(t.style,t.width)}]}):[],C=t.trailingExtentPt??n.requestedSpaceAfterPt,w=xv(h);return MC({kind:`paragraph`,id:t.id,source:t.source,...e.paragraphId===void 0?{}:{paragraphId:e.paragraphId},flowDomainId:t.flowDomainId,ordinaryFlow:t.ordinaryFlow,...e.styleId===void 0?{}:{styleId:e.styleId},...!t.continuesFromPrevious&&e.bookmarks?.length?{bookmarkStarts:e.bookmarks}:{},flowBounds:{xPt:t.placement.paragraphXPt,yPt:t.placement.startYPt,widthPt:t.placement.availableWidthPt,heightPt:n.contentEndYPt-t.placement.startYPt+C},inkBounds:{...e.shading||e.borders?b:{xPt:i,yPt:n.contentStartYPt,widthPt:Math.max(0,...c.map(e=>e.bounds.widthPt)),heightPt:v}},spacing:{beforePt:t.placement.suppressSpaceBefore?0:n.requestedSpaceBeforePt,afterPt:C},contextualSpacing:e.contextualSpacing??!1,lines:c,borders:S,shading:e.shading?{color:`#${e.shading}`}:void 0,resources:l,drawings:u,textBoxes:d,events:g,exclusions:zw(t.exclusions,p),...w?{cellContainmentBounds:w}:{},anchorCollisions:Bw(t.anchorCollisions??[],m),...f.length?{anchorFrames:f}:{},paragraphMark:n.markOnly?{hidden:e.markVanish===!0,bounds:{xPt:i,yPt:n.contentStartYPt,widthPt:0,heightPt:v}}:void 0})}const Xw=(e,t)=>qb(e,{xPt:0,yPt:t}),Zw=(e,t)=>Q(e,{xPt:0,yPt:t}),Qw=(e,t)=>Zb(e,{xPt:0,yPt:t}),$w=(e,t)=>$b(e,{xPt:0,yPt:t}),eT=(e,t)=>ex(e,{xPt:0,yPt:t}),tT=(e,t)=>rx(e,{xPt:0,yPt:t}),nT=(e,t)=>ax(e,{xPt:0,yPt:t});function rT(e,t,n,r){if(!e.shading&&e.borders.length===0)return null;let i=t[0],a=t.at(-1);if(!i||!a)return{box:Zw(e.inkBounds,n),borders:[]};let o=e.inkBounds.yPt,s=o+e.inkBounds.heightPt,c=r.continuesFromPrevious?Math.max(o,i.bounds.yPt):o,l=r.continuesOnNext?Math.min(s,a.bounds.yPt+a.advancePt):s,u={xPt:e.inkBounds.xPt,yPt:c+n,widthPt:e.inkBounds.widthPt,heightPt:Math.max(0,l-c)},d=u.xPt,f=d+u.widthPt,p=u.yPt,m=p+u.heightPt;return{box:u,borders:e.borders.flatMap(e=>(e.edge===`top`||e.edge===`between`)&&r.continuesFromPrevious||e.edge===`bottom`&&r.continuesOnNext?[]:e.edge===`top`||e.edge===`between`?[{...e,from:{xPt:d,yPt:p},to:{xPt:f,yPt:p}}]:e.edge===`bottom`?[{...e,from:{xPt:d,yPt:m},to:{xPt:f,yPt:m}}]:e.edge===`left`?[{...e,from:{xPt:d,yPt:p},to:{xPt:d,yPt:m}}]:e.edge===`right`?[{...e,from:{xPt:f,yPt:p},to:{xPt:f,yPt:m}}]:[{...e,from:Xw(e.from,n),to:Xw(e.to,n)}])}}function iT(e,t,n=`${e.id}:${t.lineStart}-${t.lineEnd}`){let r=e.lines.slice(t.lineStart,t.lineEnd),i=r[0],a=r.at(-1),o=t.continuesFromPrevious&&i?e.flowBounds.yPt-i.bounds.yPt:0,s=o===0?r:r.map(e=>eT(e,o)),c=s[0],l=s.at(-1),u=e.lines.map((e,n)=>n>=t.lineStart&&n<t.lineEnd?s[n-t.lineStart]:e),d=c&&l?{xPt:Math.min(...s.map(e=>e.bounds.xPt)),yPt:c.bounds.yPt,widthPt:Math.max(...s.map(e=>e.bounds.xPt+e.bounds.widthPt))-Math.min(...s.map(e=>e.bounds.xPt)),heightPt:l.bounds.yPt+l.bounds.heightPt-c.bounds.yPt}:e.inkBounds,f=rT(e,r,o,t),p=new Set(r.flatMap(e=>e.placements.flatMap(e=>e.kind===`drawing`?[e.drawingId]:[]))),m=e.drawings.filter(e=>p.has(e.id)).map(e=>e.anchorLayer?.verticalOwnership===`page`?e:Qw(e,o)),h=xv(m.filter(e=>e.anchorLayer?.cellContainment===!0).map(e=>e.flowBounds)),g=new Set(e.drawings.flatMap(e=>{if(e.anchorLayer?.verticalOwnership!==`host`)return[];let t=e.anchorLayer.acquisitionOccurrenceId??e.anchorLayer.occurrenceId;return t===void 0?[]:[t]})),_=new Set(m.flatMap(e=>{if(e.anchorLayer?.verticalOwnership!==`host`)return[];let t=e.anchorLayer.acquisitionOccurrenceId??e.anchorLayer.occurrenceId;return t===void 0?[]:[t]})),v=new Set(r.flatMap(e=>e.placements.flatMap(e=>e.kind===`resource`?[e.resourceKey]:[])));for(let e of m)for(let t of e.commands)t.kind===`resource`&&v.add(t.resourceKey);let y=new Set(m.flatMap(e=>[e.id.replace(`:drawing:`,`:textbox:`),...e.textBoxIds??[]])),b=new Set(m.filter(e=>e.anchorLayer?.verticalOwnership===`page`||e.orientation===`upright-physical`).flatMap(e=>e.textBoxIds??[])),x=new Set(m.map(e=>Uc(`source-occurrence`,e.source))),S=i?.range.start,C=a?.range.end,{bookmarkStarts:w,...T}=e;return MC({...T,kind:`paragraph`,id:n,...!t.continuesFromPrevious&&w?.length?{bookmarkStarts:w}:{},lines:u,flowBounds:{...e.flowBounds,yPt:e.flowBounds.yPt},...e.clipBounds?{clipBounds:Zw(e.clipBounds,o)}:{},spacing:{beforePt:t.continuesFromPrevious?0:e.spacing.beforePt,afterPt:t.continuesOnNext?0:e.spacing.afterPt},inkBounds:f?.box??d,borders:f?.borders??e.borders.map(e=>({...e,from:Xw(e.from,o),to:Xw(e.to,o)})),resources:e.resources.filter(e=>v.has(e.resourceKey)),drawings:m,cellContainmentBounds:h??void 0,textBoxes:e.textBoxes.filter(e=>y.has(e.id)||x.has(Uc(`source-occurrence`,e.source))).map(e=>b.has(e.id)?e:nT(e,o)),events:S===void 0||C===void 0?[]:e.events.filter(e=>e.offset>=S&&(e.offset<C||!t.continuesOnNext&&e.offset===C)),exclusions:e.exclusions.filter(e=>e.verticalOwnership===`page`||e.anchorOccurrenceId===void 0||!g.has(e.anchorOccurrenceId)||_.has(e.anchorOccurrenceId)).map(e=>({...e,bounds:e.verticalOwnership===`page`?e.bounds:Zw(e.bounds,o),polygon:e.verticalOwnership===`page`?e.polygon:e.polygon.map(e=>Xw(e,o))})),anchorCollisions:(e.anchorCollisions??[]).filter(e=>e.verticalOwnership===`page`||!g.has(e.occurrenceId)||_.has(e.occurrenceId)).map(e=>({...e,bounds:e.verticalOwnership===`page`?e.bounds:Zw(e.bounds,o)})),...t.continuesOnNext?{paragraphMark:void 0}:e.paragraphMark?{paragraphMark:{...e.paragraphMark,bounds:Zw(e.paragraphMark.bounds,o)}}:{},continuation:t})}function aT(e,t){return e.segIndex-t.segIndex||e.charOffset-t.charOffset}function oT(e,t,n,r,i,a,o,s,c,l){if(![r,i].every(e=>Number.isFinite(e)&&e>=0))throw RangeError(`Paragraph fragment extents must be finite and non-negative`);if(n.length!==e.lines.length)throw RangeError(`Paragraph source boundaries must align with retained lines`);let u=o.authoredSpaceAfterPt??0;if(!Number.isFinite(u)||u<0)throw RangeError(`Authored paragraph spaceAfter must be finite and non-negative`);let d=e.lines.length,f=n=>iT(e,{lineStart:0,lineEnd:n,continuesFromPrevious:t.boundary!==null,continuesOnNext:n<d}),p=e=>{let t=s?.(e)??0;if(!Number.isFinite(t)||t<0)throw RangeError(`Paragraph page-local reserve must be finite and non-negative`);return t},m=e=>l?.(e)??!0,h=(e,t)=>{if(!t)return e.advancePt;let n=Um({advancePt:e.advancePt,retainedSpaceAfterPt:e.spacing.afterPt,authoredSpaceAfterPt:u});return Km({paragraph:e,writingMode:o.writingMode??`horizontal-tb`,logicalLineBoxExtentPt:n,availableBlockExtentPt:r})};if(d===0){let n=p(e),o=h(e,!0);return a&&(o+n>r||!m(n))&&o+n<=i?{fragment:null,nextCursor:t,requiresFreshFlowRegion:!0,additionalReservePt:0,admittedBlockExtentPt:0}:{fragment:e,nextCursor:null,requiresFreshFlowRegion:!1,additionalReservePt:n,admittedBlockExtentPt:Math.min(e.advancePt,r)}}let g=p(e),_=h(e,!0);if(t.boundary===null&&o.keepLines&&a&&(_+g>r||!m(g))&&_+g<=i)return{fragment:null,nextCursor:t,requiresFreshFlowRegion:!0,additionalReservePt:0,admittedBlockExtentPt:0};let v=Nx(0,d,r,e=>(()=>{let t=f(e),n=p(t);return m(n)?h(t,e===d)+n:r+1})()).end;if(v===0){if(a)return{fragment:null,nextCursor:t,requiresFreshFlowRegion:!0,additionalReservePt:0,admittedBlockExtentPt:0};v=1}for(;;){let e=Px({widowControl:o.widowControl,start:0,end:v,totalLines:d,canRelocate:a});if(e.kind===`relocate`)return{fragment:null,nextCursor:t,requiresFreshFlowRegion:!0,additionalReservePt:0,admittedBlockExtentPt:0};if(e.kind!==`dropLastLine`)break;--v}let y=f(v),b=v<d?n[v-1]:null;if(b!==null&&t.boundary!==null&&aT(b,t.boundary)<=0)throw Error(`Paragraph continuation source boundary did not advance`);return{fragment:y,nextCursor:b===null?null:Object.freeze({boundary:b,sourceRangeStart:y.lines.at(-1).range.end,...c===void 0?{}:{uniformRubyAdvancePt:c}}),requiresFreshFlowRegion:!1,additionalReservePt:p(y),admittedBlockExtentPt:Math.min(y.advancePt,r)}}function sT(e,t){let n=new Map;if(!e)return n;let r=new Set(e.map(e=>e.id));return t.forEach(e=>{r.has(e)&&!n.has(e)&&n.set(e,n.size+1)}),n}function cT(e){let t=new Map;if(!e)return t;for(let n of e)t.set(n.id,n);return t}function lT(e,t){let n=[],r=new Set;for(let i of e)if(i.type===`paragraph`)for(let e of i.runs)e.type!==`text`||e.noteRef?.kind!==t||e.noteRef.id.length===0||r.has(e.noteRef.id)||(r.add(e.noteRef.id),n.push(e.noteRef.id));else if(i.type===`table`)for(let e of i.rows)for(let i of e.cells)for(let e of lT(i.content,t))r.has(e)||(r.add(e),n.push(e));return Object.freeze(n)}function uT(e,t){return Object.freeze([...new Set(e.flatMap(e=>e.placements.flatMap(e=>e.kind===`text`&&e.noteReference?.kind===t?[e.noteReference.id]:[])))])}function dT(e,t){return e.rows.flatMap(e=>e.cells.flatMap(e=>e.blocks.flatMap(e=>fT(e.layout,t))))}function fT(e,t){let n=e.kind===`paragraph`?uT(e.lines,t):dT(e,t);return Object.freeze([...new Set(n)])}function pT(e){return uT(e,`footnote`)}function mT(e){return fT(e,`footnote`)}function hT(e){return fT(e,`endnote`)}function gT(e){if(!Number.isInteger(e.columnCount)||e.columnCount<=0)throw RangeError(`Column count must be a positive integer`);for(let t of e.fragments)if(!Number.isFinite(t.extentPt)||t.extentPt<0)throw RangeError(`Column balance fragment extents must be finite and non-negative`);if(e.fragments.length===0)return Object.freeze({targetPt:0,cutIndexes:Object.freeze([]),transitionExpansions:0});let t=[0],n=[0],r=[];e.fragments.forEach((i,a)=>{t.push(t[a]+i.extentPt);let o=a+1;(i.breakAfter!==`forbidden`||o===e.fragments.length)&&n.push(o),i.breakAfter===`forced`&&o<e.fragments.length&&r.push(o)});let i=Math.min(e.columnCount,n.length-1),a=Array.from({length:i+1},()=>Array(n.length).fill(1/0)),o=Array.from({length:i+1},()=>Array(n.length).fill(-1));a[0][0]=0;let s=0;for(let e=1;e<=i;e+=1){let i=a[e-1],c=a[e],l=i.flatMap((e,t)=>Number.isFinite(e)?[t]:[]),u=0,d=0,f=0,p=0;for(let a=1;a<n.length;a+=1){let m=n[a];for(;d<r.length&&r[d]<m;)f=r[d],d+=1;for(;n[p]<f;)p+=1;for(;u<l.length&&l[u]<p;)u+=1;let h=l[u];if(h===void 0||h>=a)continue;let g=e=>{s+=1;let r=n[e];return Math.max(i[e],t[m]-t[r])},_=h,v=g(_);for(;u+1<l.length;){let e=l[u+1];if(e>=a)break;let t=g(e);if(t>v)break;u+=1,_=e,v=t}c[a]=v,o[e][a]=_}}let c=n.length-1,l=-1,u=1/0;for(let e=1;e<=i;e+=1){let t=a[e][c];t<=u&&(u=t,l=e)}if(l<0||!Number.isFinite(u))throw Error(`Authored column breaks exceed the available column frontier`);let d=[],f=c;for(let e=l;e>0;--e)if(d.push(n[f]),f=o[e][f],f<0)throw Error(`Column balance frontier omitted a predecessor`);return d.reverse(),Object.freeze({targetPt:u,cutIndexes:Object.freeze(d),transitionExpansions:s})}function _T(e){let t=new Map;return e.sequence.forEach((e,n)=>{if(e.kind===`body-block`){let r=e.block;t.set(Wc(r.source),Object.freeze({sequenceIndex:n,keepLines:r.kind===`paragraph`&&r.keepLines,keepNext:r.kind===`paragraph`&&r.keepNext,widowControl:r.kind===`paragraph`&&r.widowControl}));return}e.kind===`adjacent-table-group`&&e.tables.forEach(e=>t.set(Wc(e.source),Object.freeze({sequenceIndex:n,keepLines:!1,keepNext:!1,widowControl:!1})))}),t}function vT(e,t,n){let r=t-e;if(n.length<=1)return Object.freeze([r]);let i=[],a=e;for(let e of n){if(!Number.isFinite(e)||e<a||e>t)return Object.freeze([r]);i.push(e-a),a=e}return i[i.length-1]=i.at(-1)+t-a,Object.freeze(i)}function yT(e,t,n,r){let i=new Set(r.flowDomainIds),a=new Map(n.layers.body.map(e=>[e.id,e])),o=_T(e),s=[];for(let e of t){if(!i.has(e.flowDomainId))continue;let t=a.get(e.nodeId);if(!t||!t.ordinaryFlow)continue;let n=Wc(t.source),r=o.get(n);if(!r)continue;let c=t.kind===`paragraph`&&!r.keepLines&&t.lines.length>1?t.lines.map(e=>e.bounds.yPt+e.advancePt):t.kind===`table`&&t.rows.length>1?t.rows.map(e=>e.flowBounds.yPt+e.advancePt):[e.blockEndPt];vT(e.blockStartPt,e.blockEndPt,c).forEach(e=>s.push({extentPt:e,breakAfter:`allowed`,sequenceIndex:r.sequenceIndex,sourceIdentity:n,paragraphLine:t.kind===`paragraph`&&!r.keepLines&&t.lines.length>0}))}let c=new Map;s.forEach((e,t)=>{let n=c.get(e.sourceIdentity)??[];n.push(t),c.set(e.sourceIdentity,n)});for(let[e,t]of c){let n=o.get(e);if(!n)continue;let r=t.filter(e=>s[e].paragraphLine);n.keepLines&&t.slice(0,-1).forEach(e=>{s[e].breakAfter=`forbidden`});for(let e=0;e+1<r.length;e+=1)Px({widowControl:n.widowControl,start:0,end:e+1,totalLines:r.length,canRelocate:!0}).kind!==`keep`&&(s[r[e]].breakAfter=`forbidden`);n.keepNext&&(s[t.at(-1)].breakAfter=`forbidden`)}let l=e.initialSection.sectionOccurrenceId;return e.sequence.forEach((e,t)=>{if(e.kind===`begin-section`){l=e.section.sectionOccurrenceId;return}if(!(l!==r.sectionOccurrenceId||e.kind!==`authored-break`||e.break!==`column`)){for(let e=s.length-1;e>=0;--e)if(!(s[e].sequenceIndex>=t)){s[e].breakAfter=`forced`;break}}}),Object.freeze(s.map(e=>Object.freeze(e)))}function bT(e,t,n,r,i){let a=yT(e,t,r,i),o=n.get(r.pageIndex)??0;return gT({columnCount:i.flowDomainIds.length,fragments:a}).targetPt+o}function xT(e,t,n,r,i){let a=t,o=e.lines.map((t,o)=>{let s=a++,c=String(s),l=i.measureLineNumberGlyph(c),u=Object.freeze({xPt:e.flowBounds.xPt-r,yPt:t.baselinePt});return Object.freeze({lineIndex:o,counterValue:s,bounds:Object.freeze({xPt:u.xPt-l.widthPt,yPt:u.yPt-l.ascentPt,widthPt:l.widthPt,heightPt:l.ascentPt+l.descentPt}),paintOps:s%n===0?Object.freeze([Object.freeze({kind:`text`,text:c,origin:u,font:l.font??``,color:`#000000`,textAlign:`right`})]):Object.freeze([])})});return Object.freeze({paragraph:Object.freeze({...e,lineNumbers:Object.freeze(o)}),counterEnd:a})}function ST(e,t,n){let r=new Map,i,a=e.pages.map(e=>{if(e.parityBlank)return e;let a=[...e.layers.body];for(let o=0;o<e.sectionRegions.length;o+=1){let s=e.sectionRegions[o],c=new Set(s.flowDomainIds),l=a.flatMap((e,t)=>c.has(e.flowDomainId)?[t]:[]),u=new Map(l.map(e=>[a[e].id,a[e]])),d=n.filter(e=>{let t=u.get(e.nodeId);return c.has(e.flowDomainId)&&e.blockEndPt>e.blockStartPt&&t!==void 0&&(t.ordinaryFlow||t.sectionFlowOwnership===`host-flow`)}),f=d.length===0?s.blockStartPt:Math.min(...d.map(e=>e.blockStartPt)),p=d.length===0?f:Math.max(...d.map(e=>e.blockEndPt)),m=s.blockEndPt,h=Math.max(0,m-s.blockStartPt),g=Math.max(0,p-f),_=s.section.verticalAlignment,v=d.length>0&&g<h?_===`center`?s.blockStartPt+(h-g)/2-f:_===`bottom`?m-g-f:0:0,y=s.section.lineNumbering,b=y?.restart===`newPage`?y.start:y?.restart===`newSection`?r.get(s.sectionOccurrenceId)??y.start:r.get(s.sectionOccurrenceId)??i??y?.start??1;b??=1;for(let e of l){let n=a[e];if(n.kind===`paragraph`&&n.ordinaryFlow&&y){let e=xT(n,b,Math.max(1,y.countBy),Tm(y.distance),t);n=e.paragraph,b=e.counterEnd}v!==0&&(n.ordinaryFlow||n.sectionFlowOwnership===`host-flow`)&&(n.kind===`paragraph`||n.kind===`table`)&&(n=hx(n,{xPt:0,yPt:v})),a[e]=n}y&&(r.set(s.sectionOccurrenceId,b),i=b)}return Object.freeze({...e,layers:w_(e.layers,`body`,a)})});return Object.freeze({...e,pages:Object.freeze(a)})}function CT(e){let t=new Map;for(let n of e)for(let e of n.sectionRegions)t.has(e.sectionOccurrenceId)||t.set(e.sectionOccurrenceId,n.pageIndex);return t}function wT(e,t){let n=e[t];return n?t===0||e[t-1]?.sectionOccurrenceId!==n.sectionOccurrenceId:!1}function TT(e,t){return t.titlePage&&t.firstPageOfSection?e.first:t.evenAndOddHeaders&&t.displayPageNumber%2==0?e.even:e.default}function ET(e,t){if(![e.pageHeight,e.marginTop,e.marginBottom,t.top,t.bottom].every(Number.isFinite))throw RangeError(`Reserved body interval inputs must be finite`);if(e.pageHeight<=0||t.top<0||t.bottom<0)throw RangeError(`Reserved body interval requires a positive page and non-negative reserves`);let n=Math.min(e.pageHeight,Math.abs(e.marginTop)+t.top),r=e.pageHeight-Math.abs(e.marginBottom)-t.bottom;return Object.freeze({blockStartPt:n,blockEndPt:Math.max(n,Math.min(e.pageHeight,r))})}function DT(e,t,n){if(![e,t,n].every(Number.isFinite))throw RangeError(`Header/footer reserve inputs must be finite`);if(e<0)throw RangeError(`Story extent must be non-negative`);return e===0||t<0?0:Math.max(0,e-(t-n))}function OT(e){let t=t=>{let n=Object.freeze(e.measure(t).map(e=>Object.freeze({...e})));return Object.freeze({result:t,reserves:n,pageCount:n.length,fingerprint:Uc(`header-footer-reserve-v1`,{identity:e.identity(t),reserves:n})})},n=t(e.seed);return!e.requiresConvergence&&n.reserves.every(e=>e.top===0&&e.bottom===0)?n:qd(n,n=>t(e.repaginate(n.reserves,n.result)),e.limit??16)}var kT=class extends Z{constructor(e,t){super(`INVALID_GEOMETRY`,`${t} exceeds the available flow capacity`),this.containerId=e,this.layoutId=t,this.name=`FlowCapacityExceededError`}};function AT(e,t){if(e.length===0)return{xPt:t.xPt,yPt:t.yPt,widthPt:0,heightPt:0};let n=Math.min(...e.map(e=>e.xPt)),r=Math.min(...e.map(e=>e.yPt)),i=Math.max(...e.map(e=>e.xPt+e.widthPt)),a=Math.max(...e.map(e=>e.yPt+e.heightPt));return{xPt:n,yPt:r,widthPt:i-n,heightPt:a-r}}function jT(e,t,n){let r=[],i=e.cursor,a=e.container.bounds;if(![a.xPt,a.yPt,a.widthPt,a.heightPt].every(Number.isFinite)||a.widthPt<0||a.heightPt<0)throw new Z(`INVALID_GEOMETRY`,`${e.container.id} has invalid bounds`);let o=e.container.bounds.yPt+e.container.bounds.heightPt,s=e.container.capacity===`unbounded`?2**53-1:o,c=e.container.bounds.xPt+e.container.bounds.widthPt;if(!Number.isFinite(i.xPt)||!Number.isFinite(i.yPt)||i.xPt<a.xPt||i.xPt>c||i.yPt<a.yPt||i.yPt>o)throw new Z(`INVALID_GEOMETRY`,`${e.container.id} has an invalid initial flow cursor`);for(let a of e.blocks){let l={container:e.container,cursor:i,availableBounds:{xPt:e.container.bounds.xPt,yPt:i.yPt,widthPt:e.container.bounds.widthPt,heightPt:Math.max(0,s-i.yPt)}},u=a.kind===`paragraph`?n.layoutParagraph(a,l,t):n.layoutTable(a,l,t);if(u.layout.flowDomainId!==e.container.id)throw new Z(`INVALID_REFERENCE`,`${u.layout.id} belongs to ${u.layout.flowDomainId}, not ${e.container.id}`);if(e.container.capacity!==`unbounded`&&Number.isFinite(u.nextCursor.yPt)&&u.nextCursor.yPt>o)throw new kT(e.container.id,u.layout.id);if(!Number.isFinite(u.nextCursor.xPt)||!Number.isFinite(u.nextCursor.yPt)||u.nextCursor.xPt<e.container.bounds.xPt||u.nextCursor.xPt>c||u.nextCursor.yPt<i.yPt)throw new Z(`INVALID_GEOMETRY`,`${u.layout.id} returned an invalid flow cursor`);r.push(u.layout),i=u.nextCursor}return{source:e.source,container:e.container,blocks:r,nextCursor:i,flowDomainId:e.container.id,flowBounds:AT(r.map(e=>e.flowBounds),e.container.bounds),inkBounds:AT(r.map(e=>e.inkBounds),e.container.bounds),...e.container.capacity===`unbounded`?{}:{clipBounds:e.container.bounds},advancePt:i.yPt-e.cursor.yPt,ordinaryFlow:!0}}const MT=new WeakMap,NT=e=>`type`in e&&e.type===`unsupportedTextBoxBlock`;function PT(e,t){if(MT.has(e))throw Error(`Story block layout algorithms are already attached`);MT.set(e,Object.freeze({...t}))}function FT(e,t){return Object.freeze({...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:Q(e.clipBounds,t)}:{},blocks:Object.freeze(e.blocks.map(e=>{if(e.kind===`paragraph`)return sx(e,t);if(e.kind===`table`)return cx(e,t);throw Error(`Story contains unsupported retained node: ${e.kind}`)}))})}function IT(e,t){return Object.freeze({...e,flowBounds:Q(e.flowBounds,t),inkBounds:Q(e.inkBounds,t),...e.clipBounds?{clipBounds:Q(e.clipBounds,t)}:{},separator:Object.freeze(e.separator.map(e=>Jb(e,t))),story:FT(e.story,t)})}function LT(e,t){for(let t of e.blocks)if(!NT(t)&&(t.source.story!==e.source.story||t.source.storyInstance!==e.source.storyInstance))throw new Z(`INVALID_REFERENCE`,`Story block ${t.source.story}:${t.source.storyInstance} is not owned by ${e.source.story}:${e.source.storyInstance}`);let n=MT.get(t);if(!n)throw Error(`Story block layout algorithms are not attached to the supplied services`);let r=e.blocks.filter(NT),i=jT({blocks:e.blocks.filter(e=>!NT(e)),container:e.container,cursor:{xPt:e.container.bounds.xPt,yPt:e.container.bounds.yPt},source:e.source},t,n);return Object.freeze({story:e.source.story,flowBounds:i.flowBounds,inkBounds:i.inkBounds,...i.clipBounds?{clipBounds:i.clipBounds}:{},blocks:Object.freeze([...i.blocks]),advancePt:i.advancePt,diagnostics:Object.freeze(r.map(t=>Object.freeze({code:`UNSUPPORTED_FEATURE`,severity:`warning`,source:Object.freeze({story:e.source.story,storyInstance:e.source.storyInstance,path:Object.freeze([...t.sourcePath])}),message:`Unsupported text-box block ${t.qName}`})))})}var RT=class extends Error{code=`FOOTNOTE_RESERVE_EXCEEDS_FRESH_PAGE`;constructor(e,t,n){super(`Body footnote admission cannot fit a fresh physical page (reserve: ${e}, charge: ${t}, fresh page: ${n})`),this.reservePt=e,this.admissionChargePt=t,this.freshPageExtentPt=n,this.name=`FootnoteAdmissionOverflowError`}};function zT(e,t){if(t.has(e))return[];t.add(e);let n=e.diagnostics??[];return e.kind===`paragraph`?[...n,...e.drawings.flatMap(e=>zT(e,t)),...e.textBoxes.flatMap(e=>zT(e,t))]:e.kind===`table`?[...n,...e.rows.flatMap(e=>e.cells.flatMap(e=>e.blocks.flatMap(e=>zT(e.layout,t)))),...(e.floatingTables??[]).flatMap(e=>zT(e.child,t)),...(e.resolvedFloatingTables??[]).flatMap(e=>zT(e.child,t))]:e.kind===`textbox`||e.kind===`note`?[...n,...e.story.diagnostics,...e.story.blocks.flatMap(e=>zT(e,t))]:n}function BT(e,t,n){if(e>0&&t>n)throw new RT(e,t,n)}function VT(e){let t=new Set,n=e=>{for(let r of e.resolvedFloatingTables??[])t.add(r.occurrenceId),n(r.child)};return n(e),t}function HT(e,t,n){if(!e.floats)throw Error(`Accepted floating table omitted its float registry delta`);let r=VT(t);return Object.freeze({...e,floats:Object.freeze({...e.floats,entries:Object.freeze(e.floats.entries.map(e=>{let i=r.has(e.occurrenceId)?lx(n,e.occurrenceId):t.ordinaryFlow?null:n;return i===null?e:Object.freeze({...e,occurrenceId:i,exclusionId:i})}))})})}function UT(e,t){let n=new Set(t.drawings.flatMap(e=>{let t=e.anchorLayer?.acquisitionOccurrenceId??e.anchorLayer?.occurrenceId;return t===void 0?[]:[t]})),r=e.floats?.entries.filter(e=>n.has(e.occurrenceId))??[],i=e.drawingCollisions?.entries.filter(e=>n.has(e.occurrenceId))??[];return r.length===0&&i.length===0?null:Object.freeze({...e.floats&&r.length>0?{floats:Object.freeze({...e.floats,entries:Object.freeze(r),nextParagraphId:e.floats.baseNextParagraphId+r.length})}:{},...e.drawingCollisions&&i.length>0?{drawingCollisions:Object.freeze({...e.drawingCollisions,entries:Object.freeze(i)})}:{}})}function WT(e){let t=new Map([[e.initialSection.sectionOccurrenceId,e.initialSection]]);for(let n=0;n<e.sequence.length;n+=1){let r=e.sequence[n];r.kind===`begin-section`&&t.set(r.section.sectionOccurrenceId,r.section)}return t}function GT(e,t){return Lm(e.context,e.pageLayout,t)}function KT(e,t){let n=GT(e,t);return km({sectionOccurrenceId:e.sectionOccurrenceId,geometry:n.geometry,columns:n.columns,textDirection:n.textDirection,sectionBidi:n.sectionBidi===!0,grid:n.grid})}function qT(e,t,n,r=n.blockStartPt,i=GT(e,t).columns.map((e,t)=>t)){let a=GT(e,t);return Object.freeze({id:`page:${t}:section:${encodeURIComponent(e.sectionOccurrenceId)}`,sectionOccurrenceId:e.sectionOccurrenceId,section:a,pageBorders:e.pageBordersAuthored?e.pageBorders:null,writingMode:N_(a.textDirection),blockStartPt:r,blockEndPt:n.blockEndPt,columnFlowDirection:a.sectionBidi===!0?`rtl`:`ltr`,columnIndexes:Object.freeze([...i]),columns:Object.freeze(i.map(e=>{let t=a.columns[e];if(!t)throw Error(`Missing authored section column`);return Object.freeze({inlineStartPt:t.xPt,inlineExtentPt:t.wPt})}))})}function JT(e,t){let n=N_(e.textDirection),r=z_({widthPt:e.geometry.pageWidth,heightPt:e.geometry.pageHeight},n);return Object.freeze(n===`horizontal-tb`?{...r,contentTopPt:t.blockStartPt,contentBottomPt:t.blockEndPt}:{...r,contentTopPt:0,contentBottomPt:r.heightPt})}function YT(e,t,n){return ET(GT(e,t).geometry,n)}function XT(e,t,n){let r=GT(e,t);return Bb({kind:`content`,pageIndex:t,physicalPage:JT(r,n),sectionOccurrenceId:e.sectionOccurrenceId,section:r,region:qT(e,t,n)})}function ZT(e){let t=e.pages.at(-1),n=t?.accumulator.sectionRegions.at(-1);if(!t||t.kind!==`content`||!n)throw Error(`Missing active body region`);return n}function QT(e){let t=ZT(e),n=t.columnIndexes??t.section.columns.map((e,t)=>t),r=(t.columnFlowDirection===`rtl`?[...n].reverse():[...n]).at(-1)===e.flow.columnIndex;return e.balanceTargetPt===null||r?t.blockEndPt:Math.min(t.blockEndPt,t.blockStartPt+e.balanceTargetPt)}function $T(e){let t=ZT(e),n=t.columnIndexes??t.section.columns.map((e,t)=>t),r=t.columns[n.indexOf(e.flow.columnIndex)];if(!r)throw Error(`Missing active body column`);return Object.freeze({pageIndex:e.flow.pageIndex,columnIndex:e.flow.columnIndex,flowDomainId:ev(e.flow.pageIndex,t.id,e.flow.columnIndex),section:t.section,cursorPt:Object.freeze({xPt:r.inlineStartPt,yPt:e.flow.cursorBlockPt}),availableBounds:Object.freeze({xPt:r.inlineStartPt,yPt:e.flow.cursorBlockPt,widthPt:r.inlineExtentPt,heightPt:Math.max(0,QT(e)-e.footnoteReservePt-e.flow.cursorBlockPt)})})}function eE(e,t){let n=t=>{let n=e.get(t);if(!n)throw Error(`Unknown body section ${t}`);return n};return{openContentPage(e){let r=n(e.sectionOccurrenceId),i=t[e.pageIndex]??{top:0,bottom:0},a=YT(r,e.pageIndex,i),o=bx(KT(r,e.pageIndex),{pageIndex:e.pageIndex,pageContentStartBlockPt:a.blockStartPt,pageContentEndBlockPt:a.blockEndPt});return{page:XT(r,e.pageIndex,a),flow:o}},openParityBlankPage(e){let r=n(e.sectionOccurrenceId),i=GT(r,e.pageIndex),a=YT(r,e.pageIndex,t[e.pageIndex]??{top:0,bottom:0});return Bb({kind:`parity-blank`,pageIndex:e.pageIndex,physicalPage:JT(i,a),sectionOccurrenceId:r.sectionOccurrenceId,section:i,pageBorders:r.pageBordersAuthored?r.pageBorders:null})},openSamePageSectionRegion(e,t,r){let i=n(t.section.sectionOccurrenceId),a=e.accumulator.sectionRegions,o=a.at(-1);if(!o||!(`placement`in t))throw Error(`A same-page section requires explicit retained placement`);let s=Object.freeze({blockStartPt:e.accumulator.sectionRegions[0].blockStartPt,blockEndPt:o.blockEndPt}),c=t.placement===`same-page-block`?Object.freeze({...o,blockEndPt:r.regionStartBlockPt}):(()=>{let e=t.outgoingColumnSubset;if(!e||e.length===0)throw Error(`A same-page-column transition requires outgoing column ownership`);return Object.freeze({...o,columnIndexes:Object.freeze([...e]),columns:Object.freeze(e.map(e=>{let t=o.section.columns[e];if(!t)throw Error(`Missing outgoing authored column`);return Object.freeze({inlineStartPt:t.xPt,inlineExtentPt:t.wPt})}))})})(),l=Object.freeze([...a.slice(0,-1),c]);return Object.freeze({...e,accumulator:_v(Object.freeze({...e.accumulator,sectionRegions:l}),qT(i,r.pageIndex,s,r.regionStartBlockPt,t.columnSubset))})}}}function tE(e,t,n,r,i,a,o,s){let c=e.pages.at(-1);if(!c||c.kind!==`content`)throw Error(`Body content requires an active page`);let l=ZT(e),u=l.columnIndexes??l.section.columns.map((e,t)=>t),d=l.columns[u.indexOf(e.flow.columnIndex)],f=ev(e.flow.pageIndex,l.id,e.flow.columnIndex),p=Gc(n,f,i);if(a.has(p))throw Error(`Duplicate body occurrence acceptance: ${p}`);a.add(p);let m=gx(t,{occurrenceId:p,destination:{coordinateSpace:`logical-page-points`,flowDomainId:f,translation:{xPt:s?s.xPt-t.flowBounds.xPt:t.kind===`table`?d.inlineStartPt:d.inlineStartPt-t.flowBounds.xPt,yPt:(s?.yPt??e.flow.cursorBlockPt)-t.flowBounds.yPt}}}),h=s?.sectionFlowOwnership===void 0?m:Object.freeze({...m,sectionFlowOwnership:s.sectionFlowOwnership}),g=s?.yPt??e.flow.cursorBlockPt,_=h.kind===`paragraph`&&h.ordinaryFlow?(()=>{let e=g+h.spacing.beforePt,t=g+r-h.spacing.afterPt;return Object.freeze({...h,flowBounds:Object.freeze({...h.flowBounds,yPt:e,heightPt:Math.max(0,t-e)})})})():h,v=s?.coordinateSpace===`upright-physical`?{..._,ordinaryFlow:!1,flowBounds:Object.freeze({..._.flowBounds,heightPt:r})}:_,y=Sx(e.flow,v,r),b=y.events[0];if(!b||b.type!==`place`)throw Error(`Flow placement did not emit an allocation`);o.push(Object.freeze({nodeId:v.id,flowDomainId:v.flowDomainId,blockStartPt:b.blockStartPt,blockEndPt:b.blockEndPt}));let x=vv(c.accumulator,{layer:`body`,node:v,...s?.coordinateSpace===`upright-physical`?{coordinateSpace:`upright-physical`}:{}},!0),S=[...e.pages];return S[S.length-1]=Object.freeze({...c,accumulator:x}),Object.freeze({...e,flow:y.state,pages:Object.freeze(S)})}function nE(e){return e.boundary===null?`root`:`paragraph:${e.boundary.segIndex}:${e.boundary.charOffset}`}function rE(e,t){for(let n=t;n<e.sequence.length;n+=1){let t=e.sequence[n];if(t.kind===`consume-source`)continue;if(t.kind===`authored-break`){if(t.break!==`lastRenderedPageBreak`)return!1;continue}if(t.kind===`begin-section`){if(t.section.startType!==`continuous`)return!1;continue}let r=t.kind===`adjacent-table-group`?t:t.block;if(r.kind!==`paragraph`)return!0;if(r.pageBreakBefore)return!1;if(r.inkless!==!0)return!0}return!1}function iE(e){return e.paragraphMark!==void 0&&e.lines.length===0&&e.shading===void 0&&e.borders.length===0&&e.resources.length===0&&e.drawings.length===0&&e.textBoxes.length===0}function aE(e){return[e.rowIndex,e.rowFragmentIndex,e.cells.map(e=>[e.blockIndex,e.paragraphLineStart,e.nestedFragmentIndex,e.nestedCursor===null?null:aE(e.nestedCursor)])]}function oE(e){if(e===void 0)return`root`;if(e.kind===`table`)return`table:${JSON.stringify(aE(e.cursor))}`;let t=e.cursor.tableCursor;return`adjacent-table:${e.cursor.tableIndex}:${e.cursor.sourceRowIndex}:${JSON.stringify(t===void 0?null:aE(t))}`}function sE(e,t){let n=e.cursorPt.yPt+t,r=e.availableBounds.yPt+e.availableBounds.heightPt;return Object.freeze({...e,cursorPt:Object.freeze({...e.cursorPt,yPt:n}),availableBounds:Object.freeze({...e.availableBounds,yPt:n,heightPt:Math.max(0,r-n)})})}function cE(e,t){let n=CT(e.pages.map(e=>e.accumulator)),r=0,i=null,a=e.pages.map(e=>{let a=t.get(e.accumulator.sectionOccurrenceId),o=a.sectionOccurrenceId!==i;a.sectionOccurrenceId!==i&&a.pageNumbering.start!==null?r=Em(a.pageNumbering.start,e.accumulator.pageIndex,n.get(a.sectionOccurrenceId)??e.accumulator.pageIndex):r+=1,i=a.sectionOccurrenceId;let s={displayNumber:r,format:a.pageNumbering.format??`decimal`,sectionOccurrenceId:a.sectionOccurrenceId};return e.kind===`parity-blank`?bv({pageIndex:e.accumulator.pageIndex,physicalPage:e.accumulator.physicalPage,sectionOccurrenceId:e.accumulator.sectionOccurrenceId,section:e.accumulator.section,pageBorders:e.accumulator.pageBorders,firstSectionOwnedPage:o,pageNumber:s}):yv(e.accumulator,s,o)}),o=new WeakSet;return{pages:a,diagnostics:a.flatMap(e=>T_(e).flatMap(({node:e})=>zT(e,o)))}}function lE(e,t,n,r,i,a){let o=Gg(t);if(!o)throw Error(`Body layout kernel is not attached to the supplied services`);let s=WT(e),c=new Set,l=[],u=r[0]??{top:0,bottom:0},d=YT(e.initialSection,0,u),f=Vb(bx(KT(e.initialSection,0),{pageContentStartBlockPt:d.blockStartPt,pageContentEndBlockPt:d.blockEndPt}),XT(e.initialSection,0,d)),p=e=>{let t=a.get(e.flow.section.sectionOccurrenceId);return t?.pageIndex===e.flow.pageIndex?t.targetPt:null};f=Hb(f,p(f));let m=eE(s,r),h=null,g=o.openBodyLayoutSession({source:e.source,section:e.initialSection.context,initialLocation:$T(f)},t,n),_=e=>{let t=s.get(e.flow.section.sectionOccurrenceId);if(!t)throw Error(`Unknown body section ${e.flow.section.sectionOccurrenceId}`);let n=e.flow.pageIndex+1,i=YT(t,n,r[n]??{top:0,bottom:0});return i.blockEndPt-i.blockStartPt},v=(t,n)=>{if(i!==null){let e=$T(t);return Object.freeze([...i.values()].filter(t=>t.pageIndex===e.pageIndex&&t.flowDomainId===e.flowDomainId).map(({occurrenceId:e,paragraphSource:t})=>Object.freeze({occurrenceId:e,paragraphSource:t})))}let r=[];for(let t=n;t<e.sequence.length;t+=1){let i=e.sequence[t];if(i.kind===`authored-break`&&i.break!==`column`||i.kind===`begin-section`&&i.section.startType!==`continuous`)break;if(!(i.kind!==`body-block`||i.block.kind!==`paragraph`)){if(t>n&&i.block.pageBreakBefore)break;i.block.pageOwnedAnchorOccurrenceIds?.forEach(e=>r.push(Object.freeze({occurrenceId:e,paragraphSource:i.block.source})))}}return Object.freeze(r)},y=(e,t)=>{let n=v(e,t);if(n.length===0)return;if(!g.prescanPageAnchors)throw Error(`Page-owned anchors require canonical prescan acquisition`);let r=$T(e),i=g.prescanPageAnchors({anchors:n,location:r,availableInlineExtentPt:r.availableBounds.widthPt});i&&g.commitFlowRegistryDelta(i)};y(f,0);let b=(e,t,n=!1)=>{let r=f.flow.pageIndex,i=e.events.some(e=>e.type===`next-page`&&e.reason===`overflow`),a=e.events.some(e=>e.type===`begin-section`&&`placement`in e&&e.placement===`same-page-column`);f=Wb(f,e,m),f=Hb(f,p(f));let o=$T(f);f.flow.pageIndex===r?(g.moveAcquisitionCursor(o),a&&y(f,t)):(h=i&&n?t:null,g.resetPageAcquisition(o),y(f,t))},x=new Map,S=new Map,C=new Map,w=e=>(x.get(e)?.size??0)>0,T=(e,t,n)=>E(n??mT(e),t),E=(e,t)=>{let n=x.get(f.flow.pageIndex)??new Set,r=[...new Set(e)].filter(e=>!n.has(e)),i=$T(f);if(r.length>0&&!g.layoutNotes)throw Error(`Footnote layout requires a note-capable layout session`);let a=r.length===0?Object.freeze([]):g.layoutNotes({kind:`footnote`,referenceIds:Object.freeze(r),pageIndex:f.flow.pageIndex,section:i.section,container:{id:`notes:page:${f.flow.pageIndex}`,kind:`footnote`,bounds:{xPt:i.availableBounds.xPt,yPt:0,widthPt:t,heightPt:i.section.geometry.pageHeight}},firstOnPage:n.size===0});return Object.freeze({ids:Object.freeze(r),layouts:a,reservePt:a.reduce((e,t)=>e+t.advancePt,0)})},D=(e,t,n)=>{let r=x.get(f.flow.pageIndex);r||(r=new Set,x.set(f.flow.pageIndex,r)),e.forEach(e=>r.add(e));let i=C.get(f.flow.pageIndex)??[];i.push(...t),C.set(f.flow.pageIndex,i),S.set(f.flow.pageIndex,(S.get(f.flow.pageIndex)??0)+n),f=Ub(f,n)},O=()=>Math.max(0,QT(f)-f.footnoteReservePt-f.flow.deepestColumnBlockPt),k=e=>e>O(),A=null,j=$m(e.sequence);for(let t=0;t<e.sequence.length;t+=1){let n=e.sequence[t];if(n.kind===`consume-source`)continue;if(n.kind===`authored-break`){if(A=null,n.break===`column`&&!j.has(t))continue;b(jx(f.flow,n.break,n.parity),t+1);continue}if(n.kind===`begin-section`){A=null;let e=N_(ZT(f).section.textDirection),i=N_(GT(n.section,f.flow.pageIndex).textDirection),a=z_({widthPt:ZT(f).section.geometry.pageWidth,heightPt:ZT(f).section.geometry.pageHeight},e),o=GT(n.section,f.flow.pageIndex),s=z_({widthPt:o.geometry.pageWidth,heightPt:o.geometry.pageHeight},i),c=n.section.startType===`continuous`&&(e!==i||a.widthPt!==s.widthPt||a.heightPt!==s.heightPt)?`nextPage`:n.section.startType,l=YT(n.section,f.flow.pageIndex,r[f.flow.pageIndex]??{top:0,bottom:0});b(Mx(f.flow,KT(n.section,f.flow.pageIndex),c,{hasFootnoteReferenceOnCurrentPage:w(f.flow.pageIndex),incomingPageContentStartBlockPt:l.blockStartPt,incomingPageContentEndBlockPt:l.blockEndPt}),t+1);continue}let i=n.kind===`adjacent-table-group`?n:n.block;if(i.kind===`paragraph`){if(i.continuousSectionRole===`collapse-mark`)continue;i.pageBreakBefore&&b(jx(f.flow,`pageBreakBefore`),t);let n=A?.spaceAfterPt??0,a=nC(A,i,n,i.continuousSectionRole===`suppress-before`?0:i.spaceBeforePt),o=i.continuousSectionRole===`drop-previous-after`?n:a.overlap;o>0&&(f=Object.freeze({...f,flow:Object.freeze({...f.flow,cursorBlockPt:Math.max(f.flow.regionStartBlockPt,f.flow.cursorBlockPt-o)})}));let s=Object.freeze({boundary:null});for(;s;){let n=nE(s),o=$T(f),u=g.measureParagraph({input:i,location:o,availableInlineExtentPt:o.availableBounds.widthPt,suppressSpaceBefore:s.boundary!==null||i.continuousSectionRole===`suppress-before`||a.suppressBefore||s.boundary===null&&!f.flow.pageHasContent&&h===t,continuation:s});if(u.placement){let e=T(u.layout,o.availableBounds.widthPt,u.retainedFootnoteReferenceIds),r=u.relocationBlockExtentPt,a=u.placement.sectionFlowOwnership===`page`?e.reservePt:(r??u.blockExtentPt)+e.reservePt,d=_(f),p=k(e.reservePt);if(BT(e.reservePt,a,d),(a>o.availableBounds.heightPt||p)&&a<=d&&f.flow.pageHasContent){b(p?Ox(f.flow,f.flow.section,`overflow`):Cx(f.flow,`overflow`),t);continue}f=tE(f,u.layout,i.source,u.blockExtentPt,n,c,l,u.placement),D(e.ids,e.layouts,e.reservePt),u.flowRegistryDelta&&g.commitFlowRegistryDelta(u.flowRegistryDelta),s=null,g.moveAcquisitionCursor($T(f));continue}if(s.boundary===null&&i.keepNext&&f.flow.pageHasContent){let n=u.blockExtentPt,r=new Set(mT(u.layout)),a=!1,s=qm({keepNext:i.keepNext,inkless:i.inkless===!0,undecoratedMark:iE(u.layout)});for(let i=t+1;i<e.sequence.length;i+=1){let t=e.sequence[i];if(t.kind===`consume-source`)continue;if(t.kind===`authored-break`||t.kind===`begin-section`)break;let c=t.kind===`adjacent-table-group`?t:t.block;if(c.kind===`paragraph`&&c.pageBreakBefore)break;let l=g.measureFollowingBlock({input:c,location:o,availableInlineExtentPt:o.availableBounds.widthPt}),u=c.kind===`paragraph`&&(c.keepNext||s);if(s=!1,n+=u?l.fullExtentPt:l.leadContentExtentPt,(u?l.fullFootnoteReferenceIds:l.leadFootnoteReferenceIds)?.forEach(e=>r.add(e)),!u){a=!0;break}}let c=E([...r],o.availableBounds.widthPt).reservePt,l=n+c;if(a&&l>o.availableBounds.heightPt&&l<=_(f)){b(Cx(f.flow,`overflow`),t,!0);continue}}let d=e.sequence[t+1],p=e.sequence[t+2],m=d?.kind===`body-block`&&d.block.kind===`paragraph`&&p?.kind===`authored-break`&&p.break===`page`&&p.sameSourceParagraphAsPrevious!==!0,v=Xm(u.layout);if(s.boundary===null&&v&&m&&f.flow.pageHasContent){let e=sE(o,u.blockExtentPt),n=g.measureParagraph({input:d.block,location:e,availableInlineExtentPt:e.availableBounds.widthPt,suppressSpaceBefore:!1,continuation:Object.freeze({boundary:null})});g.moveAcquisitionCursor(o);let r=Zm(n.layout,e.cursorPt.yPt);if(r!==null){let e=u.blockExtentPt+r;if(e>o.availableBounds.heightPt&&e<=_(f)){b(Cx(f.flow,`overflow`),t);continue}}}let y=e.sequence[t+1],x=y?.kind===`authored-break`&&y.break===`page`;if(s.boundary===null&&x){let e=Qm(u.layout);if(e!==null){f=tE(f,e,i.source,0,n,c,l),u.flowRegistryDelta&&g.commitFlowRegistryDelta(u.flowRegistryDelta),s=null,g.moveAcquisitionCursor($T(f));continue}}let S=T(u.layout,o.availableBounds.widthPt).reservePt,C=(r[f.flow.pageIndex]?.bottom??0)===0&&f.footnoteReservePt===0,w=QT(f)===ZT(f).blockEndPt,O=Dm({hasContinuationBoundary:s.boundary!==null,inkless:i.inkless===!0,undecorated:iE(u.layout),keepNext:i.keepNext,markReservePt:S,pageBottomIsUnreserved:C,physicalRegionBottomIsActive:w,hasFollowingInk:rE(e,t+1),markBelowBaselinePt:u.markBelowBaselinePt??0}),A=oT(u.layout,s,u.lineEndBoundaries,o.availableBounds.heightPt+O,_(f),f.flow.pageHasContent,{keepLines:i.keepLines,widowControl:i.widowControl,authoredSpaceAfterPt:i.spaceAfterPt,writingMode:ZT(f).writingMode},e=>T(e,o.availableBounds.widthPt).reservePt,u.uniformRubyAdvancePt,e=>!k(e));if(A.requiresFreshFlowRegion){b(Cx(f.flow,`overflow`),t);continue}if(!A.fragment)throw Error(`Paragraph acquisition made no progress`);f=tE(f,A.fragment,i.source,Math.min(A.admittedBlockExtentPt,o.availableBounds.heightPt),n,c,l,u.placement);let j=T(A.fragment,o.availableBounds.widthPt);if(BT(j.reservePt,A.fragment.advancePt+j.reservePt,_(f)),D(j.ids,j.layouts,j.reservePt),u.flowRegistryDelta){let e=UT(u.flowRegistryDelta,A.fragment);e&&g.commitFlowRegistryDelta(e)}s=A.nextCursor,s&&b(Cx(f.flow,`overflow`),t),o=$T(f),g.moveAcquisitionCursor(o)}A=i}else{A=null;let e,n=!1;for(;!n;){let r=oE(e),a=$T(f),o=t=>g.measureTable({input:i,location:a,availableInlineExtentPt:a.availableBounds.widthPt,availableBlockExtentPt:t,freshPageBlockExtentPt:_(f),...e?{cursor:e}:{}}),s=a.availableBounds.heightPt,u=o(s);if(u.retryAtBlockStartPt!==void 0){if(!Number.isFinite(u.retryAtBlockStartPt)||u.retryAtBlockStartPt<=f.flow.cursorBlockPt)throw Error(`Table repositioning must advance the block cursor`);f=Object.freeze({...f,flow:Object.freeze({...f.flow,cursorBlockPt:u.retryAtBlockStartPt})}),g.moveAcquisitionCursor($T(f));continue}let d=u.requiresFreshFlowRegion?Object.freeze({ids:Object.freeze([]),layouts:Object.freeze([]),reservePt:0}):T(u.layout,a.availableBounds.widthPt),p=Object.freeze({reservePt:d.reservePt,chargePt:u.blockExtentPt+d.reservePt}),m=new Set;for(;!u.requiresFreshFlowRegion&&u.blockExtentPt+d.reservePt>a.availableBounds.heightPt;){let e=JSON.stringify({advancePt:u.blockExtentPt,nextCursor:u.nextCursor??null,noteIds:d.ids,reservePt:d.reservePt});if(m.has(e))throw BT(p.reservePt,p.chargePt,_(f)),Error(`Table footnote admission did not converge`);m.add(e),s=Math.max(0,a.availableBounds.heightPt-d.reservePt),u=o(s),d=u.requiresFreshFlowRegion?Object.freeze({ids:Object.freeze([]),layouts:Object.freeze([]),reservePt:0}):T(u.layout,a.availableBounds.widthPt),u.requiresFreshFlowRegion||(p=Object.freeze({reservePt:d.reservePt,chargePt:u.blockExtentPt+d.reservePt}))}if(u.requiresFreshFlowRegion){BT(p.reservePt,p.chargePt,_(f));let n=!f.flow.pageHasContent&&u.nextCursor?.kind===`table`&&u.nextCursor.floatingContinuationFrame===`fresh-text`&&!(e?.kind===`table`&&e.floatingContinuationFrame!==void 0);if(u.nextCursor?.kind===`table`&&u.nextCursor.floatingContinuationFrame!==void 0&&(e=u.nextCursor),n)continue;b(Cx(f.flow,`overflow`),t);continue}if(k(d.reservePt)&&f.flow.pageHasContent){b(Ox(f.flow,f.flow.section,`overflow`),t);continue}f=tE(f,u.layout,i.source,u.blockExtentPt,r,c,l,u.placement),D(d.ids,d.layouts,d.reservePt),u.flowRegistryDelta&&g.commitFlowRegistryDelta(HT(u.flowRegistryDelta,u.layout,Gc(i.source,a.flowDomainId,r))),e=u.nextCursor??void 0,n=e===void 0,e&&b(Cx(f.flow,`overflow`),t)}}g.moveAcquisitionCursor($T(f))}let M=new Set([...S.keys(),...C.keys()]);for(let e of M){let t=S.get(e)??0,n=(C.get(e)??[]).reduce((e,t)=>e+t.advancePt,0);if(t!==n)throw new Z(`INVALID_GEOMETRY`,`Page ${e} footnote reserve ${t} does not equal retained advance ${n}`)}return Object.freeze({layout:cE(f,s),session:g,allocations:Object.freeze(l),footnoteReserveByPage:S,footnoteLayoutsByPage:C})}function uE(e,t){return Object.freeze(e.layout.pages.map((n,r)=>{if(n.parityBlank||N_(n.section.textDirection)!==`horizontal-tb`)return Object.freeze({top:0,bottom:0});let i=t.get(n.sectionOccurrenceId);if(!i)throw Error(`Unknown body section ${n.sectionOccurrenceId}`);let a=Math.max(0,n.section.geometry.pageWidth-Math.abs(n.section.geometry.marginLeft)-Math.abs(n.section.geometry.marginRight)),o=t=>{let o=TT(t===`header`?i.headers:i.footers,{titlePage:i.titlePage,firstPageOfSection:wT(e.layout.pages,r),evenAndOddHeaders:i.evenAndOddHeaders,displayPageNumber:n.pageNumber.displayNumber});if(o===null)return 0;if(!e.session.layoutStory)throw Error(`Header/footer story layout requires a story-capable layout session`);return e.session.layoutStory({source:o,pageIndex:n.pageIndex,section:n.section,container:{id:`story:${t}:page:${n.pageIndex}`,kind:t,bounds:{xPt:Math.abs(n.section.geometry.marginLeft),yPt:0,widthPt:a,heightPt:n.section.geometry.pageHeight}}}).advancePt};return Object.freeze({top:DT(o(`header`),n.section.geometry.marginTop,n.section.geometry.headerDistance),bottom:DT(o(`footer`),n.section.geometry.marginBottom,n.section.geometry.footerDistance)})}))}function dE(e,t,n,r){let i=e.pages.map((i,a)=>{if(i.parityBlank)return i;let o=n.get(i.sectionOccurrenceId);if(!o)throw Error(`Unknown body section ${i.sectionOccurrenceId}`);if(!t.layoutStory){if(!(Object.values(o.headers).some(e=>e!==null)||Object.values(o.footers).some(e=>e!==null)||(r.get(i.pageIndex)?.length??0)>0))return i;throw Error(`Page-story composition requires a story-capable layout session`)}let s=N_(i.section.textDirection)!==`horizontal-tb`,c=s?Pm(i.section.geometry):i.section.geometry,l=Math.abs(c.marginLeft),u=Math.max(0,c.pageWidth-Math.abs(c.marginLeft)-Math.abs(c.marginRight)),d=s?`upright-physical`:`section-logical`,f=s?Object.freeze({...i.section,geometry:Object.freeze({...c}),columns:Object.freeze([Object.freeze({xPt:l,wPt:u})]),textDirection:`lrTb`}):i.section,p=t=>TT(t===`header`?o.headers:o.footers,{titlePage:o.titlePage,firstPageOfSection:wT(e.pages,a),evenAndOddHeaders:o.evenAndOddHeaders,displayPageNumber:i.pageNumber.displayNumber}),m=e=>{let n=p(e);if(n===null)return null;let r=t.layoutStory({source:n,pageIndex:i.pageIndex,section:f,container:{id:`story:${e}:page:${i.pageIndex}`,kind:e,bounds:{xPt:l,yPt:0,widthPt:u,heightPt:c.pageHeight}}});return FT(r,{xPt:0,yPt:(e===`header`?c.headerDistance:c.pageHeight-c.footerDistance-r.advancePt)-r.flowBounds.yPt})},h=m(`header`),g=m(`footer`),_=r.get(i.pageIndex)??[],v=_.reduce((e,t)=>e+t.advancePt,0),y=i.sectionRegions[0],b=(y?.blockEndPt??Math.max(0,i.section.geometry.pageHeight-Math.abs(i.section.geometry.marginBottom)))-v,x=b,S=_.map(e=>{let t=IT(e,{xPt:0,yPt:x-e.flowBounds.yPt});return x+=e.advancePt,t}),C=S.length===0?0:Math.min(...S.map(e=>e.flowBounds.xPt)),w=S.length===0?0:Math.max(...S.map(e=>e.flowBounds.xPt+e.flowBounds.widthPt)),T=Object.freeze({xPt:C,yPt:b,widthPt:w-C,heightPt:v}),E=y?Object.freeze(U_(y.coordinateSpace.logicalToPhysical,T)):T,D=[...h?[Object.freeze({id:`story:header:page:${i.pageIndex}`,kind:`header`,logicalBounds:Object.freeze({xPt:l,yPt:h.flowBounds.yPt,widthPt:u,heightPt:h.advancePt}),physicalBounds:Object.freeze({xPt:l,yPt:h.flowBounds.yPt,widthPt:u,heightPt:h.advancePt})})]:[],...S.length>0?[Object.freeze({id:`notes:page:${i.pageIndex}`,kind:`footnote`,...y?{sectionRegionId:y.id}:{},logicalBounds:T,physicalBounds:E})]:[],...g?[Object.freeze({id:`story:footer:page:${i.pageIndex}`,kind:`footer`,logicalBounds:Object.freeze({xPt:l,yPt:g.flowBounds.yPt,widthPt:u,heightPt:g.advancePt}),physicalBounds:Object.freeze({xPt:l,yPt:g.flowBounds.yPt,widthPt:u,heightPt:g.advancePt})})]:[]],O=i.layers.roots.map(e=>e),k=O.findIndex(e=>e.layer!==`background`&&e.layer!==`behindText`),A=k<0?O.length:k,j=[...O.slice(0,A),...h?.blocks.map(e=>({layer:`header`,node:e,coordinateSpace:d}))??[],...O.slice(A)],M=-1;for(let e=0;e<j.length;e+=1)j[e].layer===`body`&&(M=e);let N=M<0?j.length:M+1,ee=[...j.slice(0,N),...S.map(e=>({layer:`notes`,node:e,coordinateSpace:`section-logical`})),...j.slice(N),...g?.blocks.map(e=>({layer:`footer`,node:e,coordinateSpace:d}))??[]];return Object.freeze({...i,flowDomains:Object.freeze([...i.flowDomains,...D]),layers:C_(ee),readingOrder:Object.freeze([...h?.blocks.map(e=>e.id)??[],...i.readingOrder,...S.map(e=>e.id),...g?.blocks.map(e=>e.id)??[]])})});return Object.freeze({...e,pages:Object.freeze(i)})}function fE(e,t,n){if(n.length===0)return e;let r=-1;for(let t=e.pages.length-1;t>=0;--t)if(!e.pages[t].parityBlank){r=t;break}if(r<0)return e;let i=e.pages[r];if(!t.layoutNotes)return Object.freeze({...e,diagnostics:Object.freeze([...e.diagnostics,Object.freeze({code:`UNSUPPORTED_FEATURE`,severity:`error`,source:Object.freeze({story:`endnote`,storyInstance:n[0],path:Object.freeze([])}),message:`Document-end notes require a note-capable layout session`})])});let a=new Map(i.flowDomains.map(e=>[e.id,e])),o=i.layers.body.filter(e=>e.ordinaryFlow&&a.get(e.flowDomainId)?.kind===`body`).reduce((e,t)=>e===null||t.flowBounds.yPt+t.flowBounds.heightPt>e.flowBounds.yPt+e.flowBounds.heightPt?t:e,null),s=o?a.get(o.flowDomainId):[...i.flowDomains].reverse().find(e=>e.kind===`body`);if(!s)return Object.freeze({...e,diagnostics:Object.freeze([...e.diagnostics,Object.freeze({code:`UNSUPPORTED_FEATURE`,severity:`error`,message:`Document-end notes require a retained body flow domain`})])});let c=i.sectionRegions.find(e=>e.flowDomainIds.includes(s.id))??i.sectionRegions[0],l=o?o.flowBounds.yPt+o.flowBounds.heightPt:s.logicalBounds.yPt,u=i.layers.notes.filter(e=>e.kind===`note`&&e.source.story===`footnote`).reduce((e,t)=>Math.min(e,t.flowBounds.yPt),s.logicalBounds.yPt+s.logicalBounds.heightPt),d=Math.min(s.logicalBounds.yPt+s.logicalBounds.heightPt,u),f=`endnotes:page:${i.pageIndex}`;try{let a=t.layoutNotes({kind:`endnote`,referenceIds:Object.freeze([...n]),pageIndex:i.pageIndex,section:c?.section??i.section,container:{id:f,kind:`endnote`,bounds:{xPt:s.logicalBounds.xPt,yPt:l,widthPt:s.logicalBounds.widthPt,heightPt:Math.max(0,d-l)}},firstOnPage:!0});if(a.length===0)return e;let o=a.reduce((e,t)=>e+t.advancePt,0),u=Object.freeze({xPt:s.logicalBounds.xPt,yPt:l,widthPt:s.logicalBounds.widthPt,heightPt:o}),p=Object.freeze({id:f,kind:`endnote`,...c?{sectionRegionId:c.id}:{},logicalBounds:u,physicalBounds:c?Object.freeze(U_(c.coordinateSpace.logicalToPhysical,u)):u}),m=i.layers.roots.map(e=>e),h=-1;for(let e=0;e<m.length;e+=1)m[e].layer===`body`&&(h=e);h+=1,m.splice(h,0,...a.map(e=>({layer:`notes`,node:e,coordinateSpace:`section-logical`})));let g=new Set(i.layers.body.map(e=>e.id)),_=-1;for(let e=0;e<i.readingOrder.length;e+=1)g.has(i.readingOrder[e])&&(_=e);_+=1;let v=[...i.readingOrder];v.splice(_,0,...a.map(e=>e.id));let y=[...e.pages];return y[r]=Object.freeze({...i,flowDomains:Object.freeze([...i.flowDomains,p]),layers:C_(m),readingOrder:Object.freeze(v)}),Object.freeze({...e,pages:Object.freeze(y)})}catch(t){if(!(t instanceof Rb)||t.kind!==`endnote`||t.pageIndex!==i.pageIndex||t.containerId!==f)throw t;return Object.freeze({...e,diagnostics:Object.freeze([...e.diagnostics,Object.freeze({code:`UNSUPPORTED_FEATURE`,severity:`error`,source:Object.freeze({story:`endnote`,storyInstance:n[0],path:Object.freeze([])}),message:`Document-end notes do not fit the retained terminal flow region: ${t instanceof Error?t.message:String(t)}`})])})}}function pE(e,t,n,r){return Object.freeze({...e,diagnostics:Object.freeze([...e.diagnostics,Object.freeze({code:`UNSUPPORTED_FEATURE`,severity:`error`,message:`Unsupported ${t} position ${JSON.stringify(n)}; retained layout uses the ${r} fallback`})])})}function mE(e){let t=new Map;for(let n of e.pages)for(let e of n.layers.body)if(e.kind===`paragraph`)for(let r of e.drawings){let i=r.anchorLayer;if(!i||i.horizontalOwnership!==`page`||i.verticalOwnership!==`page`)continue;let a=i.acquisitionOccurrenceId??i.occurrenceId;t.set(a,Object.freeze({occurrenceId:a,paragraphSource:e.source,pageIndex:n.pageIndex,flowDomainId:e.flowDomainId}))}return t}function hE(e){return JSON.stringify([...e].sort(([e],[t])=>e.localeCompare(t)))}function gE(e,t,n,r,i){if(!e.sequence.some(e=>e.kind===`body-block`&&e.block.kind===`paragraph`&&(e.block.pageOwnedAnchorOccurrenceIds?.length??0)>0))return lE(e,t,n,r,null,i);try{return Kd({step:a=>{let o=lE(e,t,n,r,a?.plan??null,i);return Object.freeze({pass:o,plan:mE(o.layout)})},stateOf:e=>hE(e.plan),limit:16}).value.pass}catch(e){throw e instanceof Gd?new Z(`NON_CONVERGENCE`,e.reason===`cycle`?`Page-anchor destination acquisition repeated an exact-state cycle`:`Page-anchor destination acquisition reached the operational pass limit 16`):e}}function _E(e){let t=[],n=e.initialSection;for(let r of e.sequence)r.kind===`begin-section`&&(r.section.startType===`continuous`&&t.push(Object.freeze({outgoingSectionOccurrenceId:n.sectionOccurrenceId,incomingSectionOccurrenceId:r.section.sectionOccurrenceId})),n=r.section);return Object.freeze(t)}function vE(e,t,n){for(let r of e.pages)for(let e=0;e+1<r.sectionRegions.length;e+=1){let i=r.sectionRegions[e],a=r.sectionRegions[e+1];if(i.sectionOccurrenceId===t&&a.sectionOccurrenceId===n)return Object.freeze({page:r,outgoing:i})}return null}function yE(e,t,n,r){let i=new Map,a=gE(e,t,n,r,i);for(let o of _E(e)){let s=vE(a.layout,o.outgoingSectionOccurrenceId,o.incomingSectionOccurrenceId);if(s===null||s.outgoing.flowDomainIds.length<2)continue;let c=s.page.pageIndex,l=bT(e,a.allocations,a.footnoteReserveByPage,s.page,s.outgoing),u=new Map(i);u.set(o.outgoingSectionOccurrenceId,Object.freeze({pageIndex:c,targetPt:l})),i=u,a=gE(e,t,n,r,i)}return a}function bE(e,t,n){t=t_(t);let r=WT(e),i=yE(e,t,n,[]),a=OT({seed:i,measure:e=>uE(e,r),repaginate:(r,i)=>{let a=rC(i.layout);return yE(e,r_(t,{totalPages:i.layout.pages.length,resolveDestinationPage:e=>a[e]}),n,r)},identity:e=>rC(e.layout),requiresConvergence:i.session.hasPaginationFields}).result,o=ST(a.layout,a.session,a.allocations),s=e.noteLayoutSettings??Object.freeze({footnotePosition:`pageBottom`,endnotePosition:`docEnd`}),c=dE(o,a.session,r,a.footnoteLayoutsByPage),l=c.pages.some(e=>e.layers.notes.some(e=>e.source.story===`footnote`))&&s.footnotePosition!==`pageBottom`?pE(c,`footnote`,s.footnotePosition,`pageBottom`):c,u=new Set(o.pages.flatMap(e=>e.layers.body.flatMap(e=>e.kind===`paragraph`||e.kind===`table`?hT(e):[]))),d=(e.endnoteIds??[]).filter(e=>u.has(e)),f=fE(l,a.session,d),p=d.length>0&&s.endnotePosition!==`docEnd`?pE(f,`endnote`,s.endnotePosition,`docEnd`):f,m=e.parserDiagnostics??[];return ny(m.length===0?p:Object.freeze({...p,diagnostics:Object.freeze([...m,...p.diagnostics])}))}function xE(e,t,n=A_(void 0,Date.now())){return bE(e,t,n)}function SE(e,t,n){if(Yg(e))return;let{model:r,input:i}=n();ay({model:r,services:e,defaultCurrentDateMs:t,buildLayout:t=>xE(i,e,t)})}function CE(e,t){switch(e){case`margin`:return{left:t.marginLeft,right:t.pageWidth-t.marginRight};case`page`:return{left:0,right:t.pageWidth};default:return{left:t.contentX,right:t.contentX+t.contentW}}}function wE(e,t,n,r){switch(e){case`margin`:return{start:r.marginTop,end:r.pageH-r.marginBottom};case`page`:return{start:0,end:r.pageH};default:return{start:t,end:t+n}}}function TE(e,t,n,r){switch(e){case`center`:return t+(n-t-r)/2;case`right`:case`outside`:return n-r;default:return t}}function EE(e,t,n){switch(e){case`center`:return t.start+(t.end-t.start-n)/2;case`bottom`:case`outside`:return t.end-n;default:return t.start}}function DE(e,t,n){return e+t<=n.end?e:Math.max(n.start,n.end-t)}function OE(e,t,n,r,i,a){let o=e.dropCap===`drop`||e.dropCap===`margin`,s=CE(e.hAnchor,t),c=wE(e.vAnchor,n,i,t),l=e.w==null?r:e.w,u;if(o)u=Math.max(1,e.lines)*a;else{let t=e.h??0;u=e.hRule===`exact`?t:e.hRule===`atLeast`?Math.max(t,i):i}let d;d=e.dropCap===`drop`?s.left:e.dropCap===`margin`?s.left-l:e.xAlign?TE(e.xAlign,s.left,s.right,l):s.left+(e.x??0);let f;f=o?c.start:e.yAlign&&e.vAnchor!==`text`?EE(e.yAlign,c,u):c.start+(e.y??0),(e.vAnchor===`page`||e.vAnchor===`margin`)&&(f=DE(f,u,c));let p=e.wrap===`around`||e.wrap===`auto`?e.hSpace:0,m=e.vSpace;return{x:d,y:f,w:l,h:u,exLeft:d-p,exRight:d+l+p,exTop:f-m,exBottom:f+u+m}}function kE(e,t){if(t.kind===`table`&&t.tableOverlap===void 0)throw Error(`Floating-table transport omitted tblOverlap`);let n=t.x,r=t.y;if(t.avoidOverlap){let i={occurrenceId:`display-moving-float`,paragraphId:t.paraId,bounds:{xPt:n,yPt:r,widthPt:t.w,heightPt:t.h},exclusionBounds:{xPt:n-t.dl,yPt:r-t.dt,widthPt:t.w+t.dl+t.dr,heightPt:t.h+t.dt+t.db}},a=rd({moving:t.kind===`table`?{...i,kind:`table`,tableOverlap:t.tableOverlap}:{...i,kind:t.kind===`frame`?`frame`:`drawingml`},blockers:e.floats.map(Zu),avoidance:t.kind===`table`?Ju(t.tableOverlap,t.paraId):Yu(t.allowOverlap??!0,t.paraId),rightBoundaryPt:e.pageWidth,overlapEpsilonPt:Ku,rightBoundarySlackPt:qu});n=a.bounds.xPt,r=a.bounds.yPt}let i={mode:t.mode,imageKey:t.imageKey,imageX:n,imageY:r,imageW:t.w,imageH:t.h,xLeft:n-t.dl,xRight:n+t.w+t.dr,yTop:r-t.dt,yBottom:r+t.h+t.db,side:t.side,distLeft:t.dl,distRight:t.dr,distTop:t.dt,distBottom:t.db,paraId:t.paraId},a=t.kind===`table`?{...i,kind:`table`,tableOverlap:t.tableOverlap}:{...i,kind:t.kind};return e.floats.push(a),a}function AE(e){return e.xPt+e.widthPt}function jE(e){return e.yPt+e.heightPt}function ME(e,t,n,r){return e===`center`?t+(n-t-r)/2:e===`right`||e===`outside`?n-r:t}function NE(e,t,n,r){return e===`center`?t+(n-t-r)/2:e===`bottom`||e===`outside`?n-r:t}function PE(e,t,n,r,i=!1){let a=e.horzSpecified?e.horzAnchor===`page`?t.page:e.horzAnchor===`margin`?t.margin:t.text:t.text,o=e.vertAnchor===`page`?t.page:e.vertAnchor===`margin`?t.margin:t.text,s=e.xAlign?ME(e.xAlign,a.xPt,AE(a),n):a.xPt+e.xPt,c=e.yAlign&&e.vertAnchor!==`text`?NE(e.yAlign,o.yPt,jE(o),r):o.yPt+e.yPt;return!i&&(e.vertAnchor===`page`||e.vertAnchor===`margin`)&&c+r>jE(o)&&(c=Math.max(o.yPt,jE(o)-r)),Object.freeze({x:s,y:c,w:n,h:r})}function FE(e,t,n,r){return PE(e,t,n,r)}function IE(e,t,n){let r=e.child.columnWidthsPt.reduce((e,t)=>e+t,0),i=e.child.advancePt,a=e.positioning,o=Object.freeze({xPt:t,yPt:n,widthPt:r,heightPt:i}),s=Object.freeze({xPt:t-a.leftFromTextPt,yPt:n-a.topFromTextPt,widthPt:r+a.leftFromTextPt+a.rightFromTextPt,heightPt:i+a.topFromTextPt+a.bottomFromTextPt});return Object.freeze({kind:`resolved-floating-table-placement`,occurrenceId:e.occurrenceId,xPt:t,yPt:n,bounds:o,exclusionBounds:s,overlap:e.overlap,child:e.child,source:e})}function LE(e,t){let n=e.child.columnWidthsPt.reduce((e,t)=>e+t,0),r=e.child.advancePt,i=FE(e.positioning,t,n,r),a=Kb(e.positioning);return IE(e,a.x&&e.acquiredTextOffsetPt?t.text.xPt+e.acquiredTextOffsetPt.xPt:i.x,a.y&&e.acquiredTextOffsetPt?t.text.yPt+e.acquiredTextOffsetPt.yPt:i.y)}function RE(e,t,n){return Object.freeze({coordinateSpace:e.coordinateSpace,flowDomainId:e.flowDomainId,baseEntries:e.entries,baseNextParagraphId:e.nextParagraphId,nextParagraphId:n,entries:Object.freeze([...t])})}function zE(e,t){if(t.coordinateSpace!==e.coordinateSpace||t.flowDomainId!==e.flowDomainId||t.entries!==e.baseEntries||t.nextParagraphId!==e.baseNextParagraphId)throw Error(`Floating table registry delta base/domain mismatch`);let n=new Set(t.entries.map(e=>e.occurrenceId));if(e.entries.some(e=>n.has(e.occurrenceId)))throw Error(`Floating table registry delta was already committed`);if(e.nextParagraphId!==e.baseNextParagraphId+e.entries.length)throw Error(`Floating table registry delta sequence mismatch`)}function BE(e,t,n=`logical-page-points`,r=`logical-page`){let i=new Set;for(let t of e){if(i.has(t.occurrenceId))throw Error(`Duplicate float registry occurrence: ${t.occurrenceId}`);i.add(t.occurrenceId)}return Object.freeze({coordinateSpace:n,flowDomainId:r,base:Object.freeze([...e]),delta:Object.freeze([]),nextParagraphId:t})}function VE(e,t,n){let r=[...n.base,...n.delta],i=r.find(t=>t.occurrenceId===e.occurrenceId);if(i)return Object.freeze({placement:Object.freeze({...IE(e,i.bounds.xPt,i.bounds.yPt),bounds:i.bounds,exclusionBounds:i.exclusionBounds}),transaction:n});let a=LE(e,t),o=rd({moving:{occurrenceId:e.occurrenceId,kind:`table`,tableOverlap:e.overlap,paragraphId:n.nextParagraphId,bounds:a.bounds,exclusionBounds:a.exclusionBounds},blockers:r.filter(e=>e.kind!==`shape`||e.wrap!==void 0).map(Xu),avoidance:Ju(e.overlap,n.nextParagraphId),rightBoundaryPt:AE(t.page),overlapEpsilonPt:Ku,rightBoundarySlackPt:qu}),s=IE(e,o.bounds.xPt,o.bounds.yPt),c=Object.freeze({kind:`table`,occurrenceId:e.occurrenceId,overlap:e.overlap,paragraphId:n.nextParagraphId,bounds:s.bounds,exclusionBounds:s.exclusionBounds});return Object.freeze({placement:s,transaction:Object.freeze({coordinateSpace:n.coordinateSpace,flowDomainId:n.flowDomainId,base:n.base,delta:Object.freeze([...n.delta,c]),nextParagraphId:n.nextParagraphId+1})})}function HE(e,t,n){let r=n.pageWidth,i=n.marginLeft,a=n.marginRight;switch(e??(t?`margin`:`page`)){case`page`:return{start:0,end:r};case`leftMargin`:return{start:0,end:i};case`rightMargin`:return{start:r-a,end:r};case`insideMargin`:return{start:0,end:i};case`outsideMargin`:return{start:r-a,end:r};case`character`:case`column`:return{start:n.contentX,end:n.contentX+n.contentW};default:return{start:i,end:r-a}}}function UE(e,t,n,r){let i=r.marginTop,a=r.marginBottom;switch(e??(t?`paragraph`:`page`)){case`page`:return{start:0,end:r.pageH};case`topMargin`:return{start:0,end:i};case`bottomMargin`:return{start:r.pageH-a,end:r.pageH};case`paragraph`:case`line`:return{start:n,end:r.pageH};default:return{start:i,end:r.pageH-a}}}function WE(e,t,n,r,i,a,o,s){let c=HE(a,t,i);if(o!=null)return c.start+(c.end-c.start)*o+n;if(!e)return c.start+n;let l=c.end-c.start,u=s??r,d=s==null?0:n;switch(e){case`center`:return c.start+(l-u)/2+d;case`right`:case`outside`:return c.end-u+d;default:return c.start+d}}function GE(e,t,n,r,i,a,o,s,c){let l=UE(o,t,i,a);if(s!=null)return l.start+(l.end-l.start)*s+n;if(!e)return l.start+n;let u=l.end-l.start,d=c??r,f=c==null?0:n;switch(e){case`center`:return l.start+(u-d)/2+f;case`bottom`:case`outside`:return l.end-d+f;default:return l.start+f}}function KE(e){return qE(e.textDirection)}function qE(e){return typeof e==`string`&&Fm(e)}function JE(e){return e===`btLr`}function YE(e){return{...e,...Nm(e)}}function XE(e){return{...e,...Pm(e)}}function ZE(e){for(let t of e.body){if(t.type!==`paragraph`)continue;let e=t;if(typeof e.defaultFontSize==`number`)return e.defaultFontSize;for(let t of e.runs)if(t.type===`text`)return t.fontSize}return 10}function QE(e){return{pageIndex:e.pageIndex,totalPages:e.totalPages,displayPageNumber:e.displayPageNumber,pageNumberFormat:e.pageNumberFormat,currentDateMs:e.currentDateMs,noteNumbers:e.noteNumbers,noteReferenceNumber:e.noteReferenceNumber,pageWritingMode:N_(e.sectionLayout.textDirection),verticalCJK:e.verticalCJK&&!e.verticalAllRotated,verticalPageFrame:e.verticalCJK===!0,documentHasEastAsianText:e.docEastAsian,useFeLayout:e.layoutSettings.compat.useFeLayout,characterSpacingControl:e.layoutSettings.characterSpacingControl,resolvedLocalFonts:e.resolvedLocalFonts,layoutServices:e.layoutServices,verticalGlyphMeasurement:e.verticalGlyphMeasurement}}function $E(e,t){return{type:e.sectionLayout.grid.kind===`none`?null:e.sectionLayout.grid.kind,linePitchPt:t.lineGrid.active?t.lineGrid.pitchPt:null,charSpacePt:t.characterGrid.active?t.characterGrid.deltaPt:null}}const eD=Object.freeze({story:`body`,containers:Object.freeze([]),lineNumberingEligible:!0});function tD(e){let t=Math.max(0,e.pageH-e.marginTop-e.marginBottom);return{page:{xPt:0,yPt:0,widthPt:e.pageWidth,heightPt:e.pageH},margin:{xPt:e.marginLeft,yPt:e.marginTop,widthPt:Math.max(0,e.pageWidth-e.marginLeft-e.marginRight),heightPt:t},column:{xPt:e.contentX,yPt:e.marginTop,widthPt:e.contentW,heightPt:t},pageParity:e.pageIndex%2==0?`odd`:`even`}}function nD(e,t,n){return Vp(n,{numbering:t.numbering,...t.numbering?{markerInput:e.acquisitionInputs.numberingMarkerShapeInput(t.numbering,Pf(t))}:{},authoredFirstIndentPt:t.indentFirst,tabStops:t.tabStops,defaultTabPt:e.defaultTabPt,service:e.layoutServices?.text})}function rD(e,t){return nD(e,t,wm(e.layoutSettings,e.sectionLayout,eD,t))}function iD(e,t){return nD(e,t,wm(e.layoutSettings,e.sectionLayout,e.storyContext??eD,t))}function aD(e){return{...e,storyContext:pm(e.storyContext??eD)}}function oD(e,t){let n=e.retainedTablesBySourceIndex?.get(t);if(!n)throw Error(`Table placement requires retained table acquisition`);return n}function sD(e,t){if(t!==e.length-1||t===0)return!1;let n=e[t],r=e[t-1];return n?.type===`paragraph`&&r?.type===`table`&&n.runs.length===0}function cD(e,t){let{cell:n,table:r,cellTotalWidthPt:i,outerState:a,sourcePath:o}=e,s=t.resolveContentWidthPt(n,r,i),c=t.createCellState(a,s,n),l=[];for(let e=0;e<n.content.length;e+=1){let r=n.content[e];if(!r)continue;let i=[...o,e];if(r.type===`paragraph`){let a=n.content[e-1],o=n.content[e+1],u=r,d=t.acquireParagraph(c,u,s,i,im(a?.type===`paragraph`?a:null,u,o?.type===`paragraph`?o:null));l.push(d),t.advanceState(c,d.advancePt);continue}let a=r,u=r;l.push(t.acquireNestedTable(c,a,s,i,{fromPrevious:u.nestedSliceContinuesFromPrevious??!1,onNext:u.nestedSliceContinuesOnNext??!1},(e,n,r,i,a)=>cD({cell:e,table:n,cellTotalWidthPt:r,outerState:i,sourcePath:a},t)))}return l}function lD(e){return mh(e.style,e.width)}function uD(e){let t=fh.indexOf(e);return t===-1?fh.length:t}function dD(e){if(!e)return{r:0,g:0,b:0};let t=e.replace(/^#/,``);return t.length!==6||/[^0-9a-fA-F]/.test(t)?{r:0,g:0,b:0}:{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}function fD(e,t){let n=dD(e),r=dD(t),i=e=>e.r+e.b+2*e.g,a=e=>e.b+2*e.g,o=e=>e.g;for(let e of[i,a,o]){let t=e(n)-e(r);if(t!==0)return t}return 0}function pD(e,t){let n=e=>e&&e.spec.style!==`nil`&&e.spec.style!==`none`?e:null,r=n(e),i=n(t);if(!r&&!i)return null;if(!r)return i;if(!i||r.source===`cell`&&i.source===`table`)return r;if(i.source===`cell`&&r.source===`table`)return i;let a=lD(r.spec),o=lD(i.spec);if(a!==o)return a>o?r:i;let s=uD(r.spec.style),c=uD(i.spec.style);if(s!==c)return s<c?r:i;let l=fD(r.spec.color,i.spec.color);return l===0||l<0?r:i}function mD(...e){for(let t of e)if(t&&sh(t.authoredStyle))return t;return null}function hD(e){return Math.max(0,e.advancePt-e.spacing.beforePt-e.spacing.afterPt)}function gD(e){let t=[],n=0,r=null,i=0,a,o=0,s=null,c=null;for(let l of e){let e=l.layout;if(e.kind===`paragraph`){let u=e.spacing.beforePt,d=e.spacing.afterPt,f=r?tC(r,e,i,u):u,p=l.structuralTrailing?0:hD(e),m=n+(l.structuralTrailing?0:f);if(t.push({layout:e,offsetPt:m,advancePt:p}),l.structuralTrailing||(n=m+p,a??=m,o=Math.max(o,n),r=e,i=d),e.cellContainmentBounds){let t=m+e.cellContainmentBounds.yPt-e.flowBounds.yPt,n=t+e.cellContainmentBounds.heightPt;a=a===void 0?t:Math.min(a,t),o=Math.max(o,n),s=s===null?t:Math.min(s,t),c=c===null?n:Math.max(c,n)}continue}r&&(n+=i);let u=e.advancePt;t.push({layout:e,offsetPt:n,advancePt:u}),a??=n,n+=u,o=n,r=null,i=0}let l=n+(r?i:0),u=a??0;return{blocks:t,flowHeightPt:l,inkTopPt:u,inkHeightPt:Math.max(0,o-u),cellContainmentTopPt:s,cellContainmentBottomPt:c}}function _D(e){let t=e.cellContainmentTopPt??0,n=e.cellContainmentBottomPt??0;return Math.max(e.flowHeightPt,n)-Math.min(0,t)}function vD(e){return _D(gD(e))}function yD(e){return Number.isFinite(e?.cellSpacingPt)?Math.max(0,e?.cellSpacingPt??0):0}function bD(e,t){let n=yD(e[t]),r=yD(e[t-1]),i=yD(e[t+1]);return{topPt:t===0?n:Math.max(r,n)/2,bottomPt:t===e.length-1?n:Math.max(n,i)/2}}function xD(e,t,n){return n.topPt+e.margins.topPt+_D(t)+e.margins.bottomPt+n.bottomPt}function SD(e,t,n,r){let i=t;for(let a=t+1;a<e.length&&e[a]?.cells.find(e=>e.columnStart===n&&e.columnSpan===r&&e.verticalMerge===`continue`);a+=1)i=a;return i}function CD(e){return e.heightRule===`exact`?oh(e.heightPt,e.cells.map(e=>e.margins.bottomPt)):e.heightRule===`atLeast`?Math.max(0,e.heightPt??0):0}function wD(e,t){let n=e.map(e=>CD(e)),r=e.map((n,r)=>Math.max(0,...n.cells.filter(e=>e.verticalMerge!==`continue`).map(n=>{let i=n.verticalMerge===`restart`?SD(e,r,n.columnStart,n.columnSpan):r,a=bD(e,r),o=bD(e,i);return xD(n,t.get(n.id)??gD([]),{topPt:a.topPt,bottomPt:o.bottomPt})})));e.forEach((r,i)=>{let a=bD(e,i);for(let e of r.cells){if(e.verticalMerge!==`none`)continue;let o=xD(e,t.get(e.id)??gD([]),a);r.heightRule!==`exact`&&(n[i]=Math.max(n[i]??0,o))}});let i=[];e.forEach((n,r)=>{for(let a of n.cells)a.verticalMerge===`restart`&&i.push({start:r,end:SD(e,r,a.columnStart,a.columnSpan),requiredPt:xD(a,t.get(a.id)??gD([]),{topPt:bD(e,r).topPt,bottomPt:bD(e,SD(e,r,a.columnStart,a.columnSpan)).bottomPt})})}),i.sort((e,t)=>e.end-t.end||e.start-t.start);for(let t of i){let r=0;for(let e=t.start;e<=t.end;e+=1)r+=n[e]??0;let i=t.requiredPt-r;if(!(i<=0)){for(let r=t.end;r>=t.start;--r)if(e[r]?.heightRule!==`exact`){n[r]=(n[r]??0)+i;break}}}return{heights:n,contentHeights:r}}function TD(e,t){return e?{source:t,spec:{width:e.widthPt,color:e.color,style:e.authoredStyle}}:null}function ED(e,t,n,r,i,a,o,s){let c=(e,t,n,r,i,a,o)=>{let s=mD(e,o?t:null);return s?TD(s,`cell`):TD(o?mD(r,a):mD(n,i),`table`)},l=c(e.borders.top,e.borders.insideH,n?.top??null,n?.insideH??null,t.top,t.insideH,r!==0),u=c(e.borders.bottom,e.borders.insideH,n?.bottom??null,n?.insideH??null,t.bottom,t.insideH,i!==a-1),d=c(e.borders.left,e.borders.insideV,n?.left??null,n?.insideV??null,t.left,t.insideV,e.columnStart!==0),f=c(e.borders.right,e.borders.insideV,n?.right??null,n?.insideV??null,t.right,t.insideV,e.columnStart+e.columnSpan!==o);return s?{top:l,right:d,bottom:u,left:f}:{top:l,right:f,bottom:u,left:d}}function DD(e){return e?{widthPt:e.spec.width,color:e.spec.color??`#000000`,authoredStyle:e.spec.style}:null}function OD(e,t,n){let r=DD(pD(e,t));return r?{border:r,edge:n}:null}function kD(e){let t=e.columnWidthsPt.length,n=[],r=e.rows.map(()=>Array(t).fill(-1));return e.rows.forEach((i,a)=>{for(let o of i.cells){if(o.verticalMerge===`continue`)continue;let i=o.verticalMerge===`restart`?SD(e.rows,a,o.columnStart,o.columnSpan):a,s=n.length;n.push({input:o,rowIndex:a,lastRowIndex:i});let c=Math.min(t,o.columnStart+o.columnSpan);for(let e=a;e<=i;e+=1)for(let t=Math.max(0,o.columnStart);t<c;t+=1)r[e][t]=s}}),{owners:n,occupancy:r}}function AD(e,t){return t.lastRowIndex===t.rowIndex?t.input:e.rows[t.lastRowIndex]?.cells.find(e=>e.columnStart===t.input.columnStart&&e.columnSpan===t.input.columnSpan&&e.verticalMerge===`continue`)??t.input}function jD(e){let t=e.rows.length,n=e.columnWidthsPt.length,{owners:r,occupancy:i}=kD(e),a=(i,a=!1)=>{let o=r[i];if(!o)return null;let s=a?AD(e,o):o.input,c=a&&s!==o.input?o.lastRowIndex:o.rowIndex;return ED(s,e.borders,e.rows[c]?.exceptionBorders??null,o.rowIndex,o.lastRowIndex,t,n,e.bidiVisual)};return{horizontal:Array.from({length:t+1},(e,o)=>Array.from({length:n},(e,n)=>{let s=o>0?i[o-1]?.[n]??-1:-1,c=o<t?i[o]?.[n]??-1:-1;if(s>=0&&s===c)return null;let l=a(c),u=o===0?`top`:o===t?`bottom`:`between`;return{above:{owner:r[s]??null,border:a(s,!0)?.bottom??null},below:{owner:r[c]??null,border:l?.top??null},edge:u}})),vertical:Array.from({length:n+1},(r,o)=>Array.from({length:t},(t,r)=>{let s=o>0?i[r]?.[o-1]??-1:-1,c=o<n?i[r]?.[o]??-1:-1,l=e.bidiVisual?c:s,u=e.bidiVisual?s:c;return l>=0&&l===u?null:OD(a(l)?.right??null,a(u)?.left??null,o===0?e.bidiVisual?`right`:`left`:o===n?e.bidiVisual?`left`:`right`:`between`)})),occupancy:i}}function MD(e,t,n){return{edge:e.edge,from:t,to:n,color:e.border.color,widthPt:e.border.widthPt,...J_(e.border.authoredStyle,e.border.widthPt)}}const ND=Object.freeze({top:null,right:null,bottom:null,left:null,insideH:null,insideV:null});function PD(e){let t=DD(e);return t&&t.authoredStyle!==`nil`&&t.authoredStyle!==`none`?t:null}function FD(e,t,n,r,i){let a=[0];for(let t of e.columnWidthsPt)a.push((a.at(-1)??0)+t);let o=[0];for(let e of r)o.push((o.at(-1)??0)+e);let s=a.at(-1)??0,c=(n,r)=>(t[n]??0)+(e.bidiVisual?s-(a[r]??0):a[r]??0),l=e=>n+(o[e]??0),u=[],d=(e,t,n,r)=>{!e||e.authoredStyle===`nil`||e.authoredStyle===`none`||u.push(MD({border:e,edge:t},n,r))},f=new Set,p=(t,n,r,i)=>{let a=t.owner;if(!a)return;let o=`${n}:${r}:${a.input.id}`;if(f.has(o))return;f.add(o);let s=e.rows[a.rowIndex];if(!s)return;let u=yD(s),p=c(a.rowIndex,a.input.columnStart),m=c(a.rowIndex,Math.min(e.columnWidthsPt.length,a.input.columnStart+a.input.columnSpan)),{startPt:h,endPt:g}=vl(u,a.input.columnStart,a.input.columnSpan,e.columnWidthsPt.length),_=Math.min(p,m)+(e.bidiVisual?g:h),v=Math.max(p,m)-(e.bidiVisual?h:g),y=l(a.rowIndex)+bD(e.rows,a.rowIndex).topPt,b=l(a.lastRowIndex+1)-bD(e.rows,a.lastRowIndex).bottomPt,x=ED(a.input,ND,null,a.rowIndex,a.lastRowIndex,e.rows.length,e.columnWidthsPt.length,e.bidiVisual),S=r===`top`?x.top:x.bottom,C=r===`top`?y:b;d(PD(S),i,{xPt:_,yPt:C},{xPt:v,yPt:C})};return i.horizontal.forEach((n,r)=>{let a=r>0&&yD(e.rows[r-1])>0,o=r<e.rows.length&&yD(e.rows[r])>0;if(a||o){let a=Math.max(yD(e.rows[r-1]),yD(e.rows[r])),u=o?r:r-1,f=t[u]??0,m=r===0?`top`:r===e.rows.length?`bottom`:`between`;r===0||r===e.rows.length?d(mD(r===0?e.rows[0]?.exceptionBorders?.top??null:e.rows.at(-1)?.exceptionBorders?.bottom??null,r===0?e.borders.top:e.borders.bottom),m,{xPt:f,yPt:l(r)},{xPt:f+s,yPt:l(r)}):n.forEach((t,n)=>{let o=i.occupancy[r-1]?.[n]??-1,s=i.occupancy[r]?.[n]??-1;if(!t||!(o!==s&&(o>=0||s>=0))||[{side:t.above,directEdge:`bottom`},{side:t.below,directEdge:`top`}].some(({side:e,directEdge:t})=>{let n=e.owner;return n?lh({spacingPt:a,directStyle:n.input.borders[t]?.authoredStyle,conditionalInsideStyle:n.input.borders.insideH?.authoredStyle}):!1}))return;let f=c(u,n),p=c(u,n+1),h=mD(e.rows[r-1]?.exceptionBorders?.insideH??null,e.borders.insideH),g=mD(e.rows[r]?.exceptionBorders?.insideH??null,e.borders.insideH);d(OD(TD(h,`table`),TD(g,`table`),m)?.border??null,m,{xPt:Math.min(f,p),yPt:l(r)},{xPt:Math.max(f,p),yPt:l(r)})}),n.forEach(e=>{e&&(p(e.above,r,`bottom`,e.edge),p(e.below,r,`top`,e.edge))});return}let f=[],m=new Map;n.forEach(t=>{if(!t)return;let n=(t,n)=>{if(!n.owner||!n.border)return;let r=`${t}:${n.owner.input.id}`;if(m.has(r))return;let i=c(n.owner.rowIndex,n.owner.input.columnStart),a=c(n.owner.rowIndex,Math.min(e.columnWidthsPt.length,n.owner.input.columnStart+n.owner.input.columnSpan));m.set(r,{side:t,border:n.border,leftPt:Math.min(i,a),rightPt:Math.max(i,a)})};n(`above`,t.above),n(`below`,t.below)});let h=[...m.values()],g=[...new Set(h.flatMap(e=>[e.leftPt,e.rightPt]))].sort((e,t)=>e-t),_=r===0?`top`:r===e.rows.length?`bottom`:`between`;for(let e=1;e<g.length;e+=1){let t=g[e-1]??0,n=g[e]??t;if(n<=t)continue;let r=(t+n)/2,i=h.filter(e=>r>e.leftPt&&r<e.rightPt),a=OD(i.find(e=>e.side===`above`)?.border??null,i.find(e=>e.side===`below`)?.border??null,_);a&&f.push({resolved:a,leftPt:t,rightPt:n})}f.sort((e,t)=>e.leftPt-t.leftPt);let v=[];for(let e of f){let t=v.at(-1);t&&t.rightPt===e.leftPt&&t.resolved.edge===e.resolved.edge&&t.resolved.border.widthPt===e.resolved.border.widthPt&&t.resolved.border.color===e.resolved.border.color&&t.resolved.border.authoredStyle===e.resolved.border.authoredStyle?t.rightPt=e.rightPt:v.push({...e})}for(let e of v)u.push(MD(e.resolved,{xPt:e.leftPt,yPt:l(r)},{xPt:e.rightPt,yPt:l(r)}))}),i.vertical.forEach((t,n)=>{t.forEach((t,r)=>{yD(e.rows[r])>0||t&&u.push(MD(t,{xPt:c(r,n),yPt:l(r)},{xPt:c(r,n),yPt:l(r+1)}))})}),e.rows.forEach((n,r)=>{let a=yD(n);if(a<=0)return;let o=l(r),u=l(r+1),f=t[r]??0;d(mD(n.exceptionBorders?.left??null,e.borders.left),`left`,{xPt:f,yPt:o},{xPt:f,yPt:u}),d(mD(n.exceptionBorders?.right??null,e.borders.right),`right`,{xPt:f+s,yPt:o},{xPt:f+s,yPt:u});let p=new Set;for(let e of n.cells)lh({spacingPt:a,directStyle:e.borders.left?.authoredStyle,conditionalInsideStyle:e.borders.insideV?.authoredStyle})&&p.add(e.columnStart),lh({spacingPt:a,directStyle:e.borders.right?.authoredStyle,conditionalInsideStyle:e.borders.insideV?.authoredStyle})&&p.add(e.columnStart+e.columnSpan);for(let t=1;t<e.columnWidthsPt.length;t+=1){let a=i.occupancy[r]?.[t-1]??-1,s=i.occupancy[r]?.[t]??-1;if(!(a!==s&&(a>=0||s>=0)))continue;let l=c(r,t);p.has(t)||d(mD(n.exceptionBorders?.insideV??null,e.borders.insideV),`between`,{xPt:l,yPt:o},{xPt:l,yPt:u})}for(let t of n.cells){if(t.verticalMerge===`continue`)continue;let n=t.verticalMerge===`restart`?SD(e.rows,r,t.columnStart,t.columnSpan):r,i=c(r,t.columnStart),o=c(r,Math.min(e.columnWidthsPt.length,t.columnStart+t.columnSpan)),{startPt:s,endPt:u}=vl(a,t.columnStart,t.columnSpan,e.columnWidthsPt.length),f=Math.min(i,o)+(e.bidiVisual?u:s),p=Math.max(i,o)-(e.bidiVisual?s:u),m=l(r)+bD(e.rows,r).topPt,h=l(n+1)-bD(e.rows,n).bottomPt,g=ED(t,ND,null,r,n,e.rows.length,e.columnWidthsPt.length,e.bidiVisual);d(PD(g.right),`right`,{xPt:p,yPt:m},{xPt:p,yPt:h}),d(PD(g.left),`left`,{xPt:f,yPt:m},{xPt:f,yPt:h})}}),u}function ID(e,t,n,r,i){let a=r.availableBounds,o=e===`center`?a.xPt+(a.widthPt-i)/2:e===`right`?a.xPt+a.widthPt-i:a.xPt;return t===0?o:ch(o,t,n)}function LD(e,t){if(t.length===0)return e;let n=Math.min(e.xPt,...t.map(e=>Math.min(e.from.xPt,e.to.xPt)-e.widthPt/2)),r=Math.min(e.yPt,...t.map(e=>Math.min(e.from.yPt,e.to.yPt)-e.widthPt/2)),i=Math.max(e.xPt+e.widthPt,...t.map(e=>Math.max(e.from.xPt,e.to.xPt)+e.widthPt/2)),a=Math.max(e.yPt+e.heightPt,...t.map(e=>Math.max(e.from.yPt,e.to.yPt)+e.widthPt/2));return{xPt:n,yPt:r,widthPt:i-n,heightPt:a-r}}function RD(e,t){let n=Math.max(e.xPt,t.xPt),r=Math.max(e.yPt,t.yPt),i=Math.min(e.xPt+e.widthPt,t.xPt+t.widthPt),a=Math.min(e.yPt+e.heightPt,t.yPt+t.heightPt);return i>n&&a>r?{xPt:n,yPt:r,widthPt:i-n,heightPt:a-r}:null}function zD(e,t,n){let r=e.layout,i=t+(r.kind===`table`?r.flowBounds.xPt:0),a=n+e.offsetPt+(r.kind===`table`?r.flowBounds.yPt:0),o=i-r.flowBounds.xPt,s=a-r.flowBounds.yPt;return{xPt:r.inkBounds.xPt+o,yPt:r.inkBounds.yPt+s,widthPt:r.inkBounds.widthPt,heightPt:r.inkBounds.heightPt}}function BD(e,t,n){let r=Zc(e,`TableLayoutInput`);if(r.columnWidthsPt.some(e=>!Number.isFinite(e)||e<0))throw TypeError(`TableLayoutInput.columnWidthsPt must contain finite non-negative widths`);let i=new Map;r.rows.forEach(e=>e.cells.forEach(e=>{i.set(e.id,gD(e.verticalMerge===`continue`?[]:e.blocks))}));let a=jD(r),o=wD(r.rows,i),s=o.heights,c=r.columnWidthsPt.reduce((e,t)=>e+t,0),l=s.reduce((e,t)=>e+t,0),u=t.cursor.yPt,d=r.rows.map(e=>ID(e.alignment??r.alignment,Number.isFinite(e.indentPt)?e.indentPt:r.indentPt,r.bidiVisual,t,c)),f=d[0]??ID(r.alignment,r.indentPt,r.bidiVisual,t,c),p=FD(r,d,u,s,a),m=[0];for(let e of r.columnWidthsPt)m.push((m.at(-1)??0)+e);let h=[0];for(let e of s)h.push((h.at(-1)??0)+e);let g=(e,t)=>(d[e]??f)+(r.bidiVisual?c-(m[t]??0):m[t]??0),_=r.rows.map((e,n)=>{let a=u+(h[n]??0),l=s[n]??0,p=d[n]??f,m=bD(r.rows,n),_=yD(e),v=e.cells.map(e=>{let o=e.verticalMerge===`restart`?SD(r.rows,n,e.columnStart,e.columnSpan):n,s=bD(r.rows,o),c=u+(h[o+1]??h[n+1]??0)-s.bottomPt,d=g(n,e.columnStart),f=g(n,Math.min(r.columnWidthsPt.length,e.columnStart+e.columnSpan)),p=Math.min(d,f),v=Math.max(d,f),{startPt:y,endPt:b}=vl(_,e.columnStart,e.columnSpan,r.columnWidthsPt.length),x=p+(r.bidiVisual?b:y),S=v-(r.bidiVisual?y:b),C=Math.max(0,S-x),w=a+m.topPt,T=e.verticalMerge===`restart`?Math.max(0,c-w):Math.max(0,l-m.topPt-m.bottomPt),E=i.get(e.id)??gD([]),D=Math.max(0,T-e.margins.topPt-e.margins.bottomPt),O=e.margins.topPt-Math.min(0,E.inkTopPt),k=E.inkHeightPt>=D?O:e.vAlign===`center`?e.margins.topPt+(D-E.inkHeightPt)/2-E.inkTopPt:e.vAlign===`bottom`?T-e.margins.bottomPt-E.inkHeightPt-E.inkTopPt:O,A={xPt:x+e.margins.leftPt,yPt:w+k,widthPt:Math.max(0,C-e.margins.leftPt-e.margins.rightPt),heightPt:D},j={xPt:x,yPt:w,widthPt:C,heightPt:T},M=e.verticalMerge!==`continue`&&r.rows.slice(n,o+1).every(e=>e.heightRule===`exact`)?uh(j,t.availableBounds):void 0,N=e.verticalMerge===`continue`?[]:E.blocks.map(e=>({...e,offsetPt:k+e.offsetPt})),ee=xv([j,...N.map(e=>zD(e,A.xPt,j.yPt)).map(e=>M?RD(e,M):e).filter(e=>e!==null)])??j;return{kind:`table-cell`,id:e.id,source:e.source,flowDomainId:r.flowDomainId,ordinaryFlow:r.ordinaryFlow,flowBounds:j,inkBounds:ee,...M?{clipBounds:M}:{},contentBounds:A,advancePt:T,verticalMerge:e.verticalMerge,vAlign:e.vAlign,...e.background?{background:e.background}:{},blocks:N}}),y={xPt:p,yPt:a,widthPt:c,heightPt:l},b=xv([y,...v.map(e=>e.inkBounds)])??y;return{kind:`table-row`,id:e.id,source:e.source,flowDomainId:r.flowDomainId,ordinaryFlow:r.ordinaryFlow,flowBounds:y,inkBounds:b,advancePt:l,heightPt:l,contentHeightPt:o.contentHeights[n]??0,...e.repeatedHeader?{repeatedHeader:!0}:{},cells:v}}),v=d.length>0?Math.min(...d):f,y=d.length>0?Math.max(...d.map(e=>e+c)):f+c,b={xPt:v,yPt:u,widthPt:Math.max(0,y-v),heightPt:l},x=xv([b,..._.map(e=>e.inkBounds)])??b;return Zc({layout:{kind:`table`,id:r.id,source:r.source,flowDomainId:r.flowDomainId,ordinaryFlow:r.ordinaryFlow,flowBounds:b,inkBounds:LD(x,p),advancePt:l,columnWidthsPt:r.columnWidthsPt,rows:_,borders:p},nextCursor:{xPt:t.cursor.xPt,yPt:t.cursor.yPt+l}},`TableLayoutResult`)}function VD(e,t){let n=e.findIndex((e,n)=>n>t&&e.type===`paragraph`&&e.framePr==null);if(n<0)throw Error(`A nested floating table requires a following regular paragraph anchor`);return n}function HD(e){if(!e)return null;let t=e.color??`000000`;return Object.freeze({widthPt:e.width,color:t.startsWith(`#`)?t:`#${t}`,authoredStyle:e.style})}function UD(e){return Object.freeze({top:HD(e.top),right:HD(e.right),bottom:HD(e.bottom),left:HD(e.left),insideH:HD(e.insideH),insideV:HD(e.insideV)})}function WD(e,t){if(e===`center`)return`center`;let n=e===`right`||e===`end`;return(t?!n:n)?`right`:`left`}function GD(e){return e.lines.some(e=>e.placements.some(e=>e.kind===`text`&&e.dependency===`page`))}function KD(e,t,n,r,i,a){let o=Array.isArray(i)?{story:`body`,storyInstance:`body`,path:i}:i,s=o.path,c=e=>({story:o.story,storyInstance:o.storyInstance,path:e}),l=a.layoutServices(r);if(!l)throw Error(`Retained table acquisition requires layout services`);let u=o.story===`body`&&o.storyInstance===`body`?`table:${s.join(`.`)}`:`${o.story}:${o.storyInstance}:table:${s.join(`.`)}`,d=a.tableFormat(e),f=e.bidiVisual===!0,p=d.firstRowException,m=p?.indentAuthored?p.indentPt??0:e.tblInd??0,h={},g=[],_=e.rows.map((n,i)=>{let o=d.rows[i],l=Math.max(0,Math.min(t.length,n.gridBefore??0)),p=n.cells.map((n,d)=>{let f=o?.cells[d]?.marginsPt??{top:n.marginTop??e.cellMarginTop,right:n.marginRight??e.cellMarginRight,bottom:n.marginBottom??e.cellMarginBottom,left:n.marginLeft??e.cellMarginLeft},p=l,m=Math.min(Math.max(1,n.colSpan),Math.max(0,t.length-p));l+=m;let _=t.slice(p,p+m).reduce((e,t)=>e+t,0),v=vl(o?.cellSpacingPt??0,p,m,t.length),y=[...s,i,d],b=`${u}:cell:${i}.${d}`,x=n.vMerge===!1?[]:cD({cell:n,table:e,cellTotalWidthPt:_,outerState:r,sourcePath:y},{resolveContentWidthPt:(e,t,n)=>Math.max(0,n-v.startPt-v.endPt-f.left-f.right),createCellState:a.createCellState,acquireParagraph:(e,t,n,r,o)=>a.acquireParagraph(e,t,n,r,`${u}:cell:${i}.${d}`,o,void 0,c(r)),acquireNestedTable:(e,t,r,i)=>{let o=KD(t,a.resolveColumns(t,r,e),r,e,c(i),a);h[o.layout.id]=o;let s=a.tableFormat(t).positioning;if(s){let r=i[i.length-1],c=s,l=t.overlap===`never`?`never`:`overlap`,u=a.registerFloatingTable(e,{child:o.layout,positioning:c,overlap:l}),d={hostCellId:b,sourceBlockIndex:r,anchorBlockIndex:VD(n.content,r),tableId:o.layout.id,overlap:l,positioning:c,...u==null?{}:{acquiredTextOffsetPt:Object.freeze({...u})}};g.push(d)}return o.layout},advanceState:a.advanceState});return{id:b,source:c(y),columnStart:p,columnSpan:m,verticalMerge:n.vMerge===!0?`restart`:n.vMerge===!1?`continue`:`none`,margins:{topPt:f.top,rightPt:f.right,bottomPt:f.bottom,leftPt:f.left},vAlign:n.vAlign,...n.background?{background:{color:n.background.startsWith(`#`)?n.background:`#${n.background}`}}:{},borders:UD(n.borders),blocks:x.flatMap((e,t)=>{let r=n.content[t];return r?.type===`table`&&a.tableFormat(r).ordinaryFlow===!1?[]:[{layout:e,sourceBlockIndex:t,...e.kind===`paragraph`&&GD(e)?{pageDependent:!0}:{},...sD(n.content,t)?{structuralTrailing:!0}:{}}]})}}),_=o?.height?.rule??`auto`;return{id:`${u}:row:${i}`,source:c([...s,i]),logicalRowIndex:i,cantSplit:o?.cantSplit??n.cantSplit===!0,heightPt:o?.height?.valuePt??null,heightRule:_,cellSpacingPt:o?.cellSpacingPt??0,exceptionBorders:o?.exception?.borders?UD(o.exception.borders):null,alignment:WD(o?.justification??e.jc,f),indentPt:m,cells:p,repeatedHeader:o?.repeatedHeader??n.isHeader===!0}}),v=Zc({kind:`table`,id:u,source:c([...s]),flowDomainId:u,ordinaryFlow:d.ordinaryFlow,alignment:WD(e.jc,f),indentPt:m,bidiVisual:f,columnWidthsPt:t,borders:UD(e.borders),rows:_},`RetainedTableAcquisition.input`),y={xPt:0,yPt:0,widthPt:n,heightPt:1},b=BD(v,{container:{id:u,kind:`tableCell`,bounds:y},cursor:{xPt:0,yPt:0},availableBounds:y},l).layout;return Object.freeze({input:v,layout:b,nestedById:Object.freeze(h),floatingTables:Zc(g,`RetainedTableAcquisition.floatingTables`)})}function qD(e,t,n){return t===n?e:Object.freeze({...e,left:e.right,right:e.left})}function JD(e,t,n){let r=qD(e.borders,e.bidiVisual,n),i=t.exceptionBorders==null?null:qD(t.exceptionBorders,e.bidiVisual,n);return i?Object.freeze({top:mD(i.top,r.top),right:mD(i.right,r.right),bottom:mD(i.bottom,r.bottom),left:mD(i.left,r.left),insideH:mD(i.insideH,r.insideH),insideV:mD(i.insideV,r.insideV)}):r}var YD=class{nodes=[Object.freeze({kind:`zero`})];interned=new Map([[`Z`,0]]);intern(e,t){let n=this.interned.get(e);if(n!==void 0)return n;let r=this.nodes.length;return this.nodes.push(Object.freeze(t)),this.interned.set(e,r),r}token(e,t){return this.intern(`T:${e}:${t}`,{kind:`token`})}add(e,t){if(e===0)return t;if(t===0)return e;let n=this.nodes[e],r=this.nodes[t];return n.kind===`sub`&&n.right===t?n.left:r.kind===`sub`&&r.right===e?r.left:this.intern(`A:${e}:${t}`,{kind:`add`,left:e,right:t})}subtract(e,t){if(e===t)return 0;if(t===0)return e;let n=this.nodes[t];return n.kind===`sub`&&n.left===e?n.right:this.intern(`S:${e}:${t}`,{kind:`sub`,left:e,right:t})}divide(e,t){return e===0?0:this.intern(`D:${e}:${t}`,{kind:`div`,value:e,divisor:t})}};function XD(e,t=0){return Object.freeze({position:e,sym:t,identity:`${e}|${t}`})}function ZD(e,t,n){return XD(fl(t.position,n.position),e.add(t.sym,n.sym))}function QD(e,t,n){return XD(ml(t.position,n.position),e.subtract(t.sym,n.sym))}function $D(e,t,n){return XD(hl(t.position,n),e.divide(t.sym,n))}function eO(e,t,n){let r=[XD(`0/1`)];return t.columnWidthsPt.forEach((i,a)=>{let o=t.columnWidthKeys?.[a],s=cl(i)??`0/1`,c=o===null?XD(s,e.token(n,a)):XD(o??s);r.push(ZD(e,r.at(-1),c))}),Object.freeze(r)}function tO(e,t,n,r){let i=QD(e,r,n);return t.alignment===`right`?i:t.alignment===`center`?$D(e,i,2n):XD(`0/1`)}function nO(e,t,n,r,i){return ZD(e,i,r?QD(e,n,t):t)}function rO(e,t){if(e.length===0)throw RangeError(`Adjacent table group id must not be empty`);if(t.length===0)throw RangeError(`Adjacent table group requires at least one table`);if(t.some(e=>!e.ordinaryFlow))throw Error(`An absolutely positioned table cannot join an adjacent table group`);let n=t[0],r=n.bidiVisual,i=new YD,a=XD(`0/1`),o=t.map((e,t)=>eO(i,e,t)),s=o.map(e=>e.at(-1)??a),c=s.reduce((e,t)=>gl(t.position,e.position)>0?t:e,a),l=(e,t,n,a)=>{let o=nO(i,e,t,n,a);return r?QD(i,c,o):o},u=[];t.forEach((e,t)=>{let n=o[t],a=s[t],d=e.bidiVisual!==r;e.rows.forEach(t=>{let r=tO(i,t,a,c),o=n.map(t=>l(t,a,e.bidiVisual,r));u.push({input:e,row:t,groupBoundaries:o,descending:d})})});let d=new Map;for(let e of[a,c])d.set(e.identity,{boundary:e,count:1});for(let e of u){let t=new Map;for(let n of e.groupBoundaries){let e=t.get(n.identity);t.set(n.identity,{boundary:n,count:(e?.count??0)+1})}for(let[e,n]of t){let t=d.get(e);n.count>(t?.count??0)&&d.set(e,n)}}let f=new Map,p=e=>{let t=f.get(e);return t||(t={position:e,identities:new Map,edges:new Map,firstSeen:new Map},f.set(e,t)),t};for(let[e,t]of d)p(t.boundary.position).identities.set(e,t);let m=0;for(let e of u){let t=e.descending?[...e.groupBoundaries].reverse():e.groupBoundaries,n=null,r=null;for(let e of t){let t=p(e.position);if(t.firstSeen.has(e.identity)||t.firstSeen.set(e.identity,m++),n!==e.position&&(n=e.position,r=null),r!==null&&r!==e.identity){let n=t.edges.get(r);n||(n=new Set,t.edges.set(r,n)),n.add(e.identity)}r=e.identity}}for(let e of f.values())for(let t of e.identities.keys())e.firstSeen.has(t)||e.firstSeen.set(t,m++);let h=[...f.values()].sort((e,t)=>gl(e.position,t.position)),g=[],_=new Map;for(let e of h){let t=new Map([...e.identities.keys()].map(e=>[e,0]));for(let n of e.edges.values())for(let e of n)t.set(e,(t.get(e)??0)+1);let n=[],r=t=>{n.push(t);let r=n.length-1;for(;r>0;){let t=Math.floor((r-1)/2);if(e.firstSeen.get(n[t])<=e.firstSeen.get(n[r]))break;[n[t],n[r]]=[n[r],n[t]],r=t}},i=()=>{let t=n[0],r=n.pop();if(n.length>0){n[0]=r;let t=0;for(;;){let r=t*2+1,i=r+1;if(r>=n.length)break;let a=r;if(i<n.length&&e.firstSeen.get(n[i])<e.firstSeen.get(n[r])&&(a=i),e.firstSeen.get(n[t])<=e.firstSeen.get(n[a]))break;[n[t],n[a]]=[n[a],n[t]],t=a}}return t};for(let n of e.identities.keys())t.get(n)===0&&r(n);let a=[];for(;n.length>0;){let n=i();a.push(n);for(let i of e.edges.get(n)??[]){let e=t.get(i)-1;t.set(i,e),e===0&&r(i)}}if(a.length!==e.identities.size)throw Error(`Adjacent table symbolic boundary ordering cycle at ${e.position}`);for(let t of a){let{boundary:n,count:r}=e.identities.get(t);_.set(t,g.length);for(let e=0;e<r;e+=1)g.push(n)}}let v=g.slice(1).map((e,t)=>{let n=g[t];return e.sym===n.sym?ml(e.position,n.position):null}),y=g.slice(1).map((e,t)=>dl(ml(e.position,g[t].position))),b=(e,t)=>{let n=new Map,r=Array(e.length);return e.forEach((e,i)=>{let a=n.get(e.identity)??0;n.set(e.identity,a+1);let o=_.get(e.identity),s=d.get(e.identity).count;r[i]=t?o+(s-1-a):o+a}),r},x=0,S=u.map(e=>{let{input:t,row:n,groupBoundaries:i,descending:a}=e,o=b(i,a),s=o[0],c=o[i.length-1],l=n.cells.map(e=>{let n=o[e.columnStart],i=o[e.columnStart+e.columnSpan];if(n==null||i==null)throw RangeError(`Table cell ${e.id} exceeds its authored grid`);let a=Math.min(n,i),s=Math.max(n,i);if(s<=a)throw Error(`Table cell ${e.id} cannot be mapped into the logical group grid`);let c=qD(e.borders,t.bidiVisual,r);return Object.freeze({...e,columnStart:a,columnSpan:s-a,borders:c})});return Object.freeze({...n,logicalRowIndex:x++,exceptionBorders:null,sourceTableEdges:JD(t,n,r),indentPt:t.bidiVisual===r?n.indentPt:-n.indentPt,sourceOuterColumnStart:Math.min(s,c),sourceOuterColumnEnd:Math.max(s,c),cells:Object.freeze(l)})});return i.nodes.length,Object.freeze({kind:`adjacent-table-group-grid`,id:e,source:n.source,flowDomainId:`${n.flowDomainId}:adjacent-group:${e}`,alignment:n.alignment,indentPt:n.indentPt,bidiVisual:r,columnWidthsPt:Object.freeze(y),columnWidthKeys:Object.freeze(v),rows:Object.freeze(S)})}const iO=1e-4;function aO(){return Object.freeze({blockIndex:0,paragraphLineStart:0,nestedCursor:null,nestedFragmentIndex:0})}function oO(){return Object.freeze({rowIndex:0,rowFragmentIndex:0,cells:Object.freeze([])})}function sO(e){let t=0;for(;e.rows[t]?.repeatedHeader===!0;)t+=1;return t}function cO(e,t){let n=e.layout.rows[t];return n?e.input.rows[t]?.heightRule===`exact`?Math.max(0,n.heightPt):Math.max(0,n.heightPt,n.contentHeightPt):0}function lO(e,t,n,r){if(t===e.input.rows[n])return cO(e,n);let i=BD({...e.input,id:`${e.input.id}:row-occurrence:${r.page.occurrenceId}:${t.logicalRowIndex}`,rows:[t]},r.placement,r.services).layout;return Math.max(0,i.rows[0]?.heightPt??i.advancePt)}function uO(e,t,n,r){return t===e.input.rows[n]?Math.max(0,e.layout.rows[n]?.heightPt??0):lO(e,t,n,r)}function dO(e,t,n,r){let i=BD({...e.input,id:`${e.input.id}:completed-partial:${r.page.occurrenceId}:${t.logicalRowIndex}`,rows:[t,...e.input.rows.slice(n+1)]},r.placement,r.services).layout;return Math.max(0,i.rows[0]?.heightPt??0)}function fO(e){return e.cells.map(e=>e.blocks.map(e=>({kind:`whole`,blockIndex:e.sourceBlockIndex})))}function pO(e,t,n,r){let i=r.reacquirePageDependentBlock;return!i||!t.cells.some(e=>e.blocks.some(e=>e.pageDependent===!0))?t:{...t,cells:t.cells.map((e,a)=>({...e,blocks:e.blocks.map(e=>e.pageDependent===!0?{...e,layout:i({logicalRowIndex:t.logicalRowIndex,logicalCellIndex:a,sourceBlockIndex:e.sourceBlockIndex,ownership:n,page:r.page,acquired:e.layout})}:e)}))}}function mO(e){let t=e.positioning.horzSpecified&&(e.positioning.horzAnchor===`page`||e.positioning.horzAnchor===`margin`),n=e.positioning.vertAnchor===`page`||e.positioning.vertAnchor===`margin`;return t||n}function hO(e,t,n,r,i){return{...t,heightPt:null,heightRule:`auto`,cells:t.cells.map((t,a)=>{let o=n.cells[a]??aO();return{...t,blocks:t.blocks.slice(o.blockIndex).map((n,a)=>{if(a===0&&o.nestedCursor&&n.layout.kind===`table`){let a=e.nestedById[n.layout.id];if(a){let e=DO(a,o.nestedCursor,{...r,availableHeightPt:r.freshPageHeightPt,placement:{...r.placement,availableBounds:{...r.placement.availableBounds,heightPt:r.freshPageHeightPt}}}),s=i.get(t.id);if(e.nextCursor&&s!==void 0&&n.sourceBlockIndex<s)throw Error(`Floating table anchor cannot follow an incomplete nested-table candidate`);if(e.fragment)return{...n,layout:e.fragment}}}return a!==0||o.paragraphLineStart===0||n.layout.kind!==`paragraph`?n:{...n,layout:SO(n.layout,o.paragraphLineStart,n.layout.lines.length)}})}})}}function gO(e,t,n,r,i,a,o,s,c){let l=i.floatingTableFrames,u=i.reacquirePageDependentBlock,d=e.input.rows[t.logicalRowIndex];if(!l||!u||!d)return{row:t,resolved:[],registry:a,nextParagraphId:o};let f=e.floatingTables.filter(e=>d.cells.some(t=>t.id===e.hostCellId)&&c(e));if(f.length===0)return{row:t,resolved:[],registry:a,nextParagraphId:o};let p=new Map;for(let e of f)p.set(e.hostCellId,Math.min(p.get(e.hostCellId)??1/0,e.anchorBlockIndex));let m={...i.placement,cursor:{...i.placement.cursor,yPt:i.placement.cursor.yPt+r}},h=hO(e,t,s,i,p),g=BD({...e.input,id:`${e.input.id}:float-probe:${i.page.occurrenceId}:${t.logicalRowIndex}`,rows:[h]},m,i.services).layout,_=i.finalPlacementTranslationPt??{xPt:0,yPt:0},v=(t,r,a)=>{let o=a.cells.findIndex(e=>e.id===t.hostCellId),s=r.rows[0]?.cells[o],c=a.cells[o]?.blocks.findIndex(e=>e.sourceBlockIndex===t.anchorBlockIndex)??-1,l=c<0?void 0:s?.blocks[c],u=e.nestedById[t.tableId]?.layout;return!s||!l||!u?null:Object.freeze({kind:`floating-table-placement`,occurrenceId:[i.page.occurrenceId,t.hostCellId,t.sourceBlockIndex,t.tableId].join(`:`),ownership:n,physicalPageIndex:i.page.physicalPageIndex,displayPageNumber:i.page.displayPageNumber,...t,columnBounds:Object.freeze({xPt:s.contentBounds.xPt+_.xPt,yPt:s.contentBounds.yPt+_.yPt,widthPt:s.contentBounds.widthPt,heightPt:s.contentBounds.heightPt}),anchorBounds:Object.freeze({xPt:s.contentBounds.xPt+_.xPt,yPt:s.flowBounds.yPt+l.offsetPt+_.yPt,widthPt:l.layout.flowBounds.widthPt,heightPt:l.layout.flowBounds.heightPt}),child:u})},y=n=>{let r=hO(e,n,s,i,p),c=n===t?g:BD({...e.input,id:`${e.input.id}:float-converge:${i.page.occurrenceId}:${t.logicalRowIndex}`,rows:[r]},m,i.services).layout,u=BE(a,o,i.floatingTableRegistry?.coordinateSpace??`logical-page-points`,i.floatingTableRegistry?.flowDomainId??e.input.flowDomainId),d=[];for(let e of f){let t=v(e,c,r);if(!t||i.floatingTableRegistry?.coordinateSpace!==`upright-physical-page-points`&&!mO(t))continue;let n=VE(t,{page:l.page,margin:l.margin,text:{xPt:t.columnBounds?.xPt??t.anchorBounds.xPt,yPt:t.anchorBounds.yPt,widthPt:t.columnBounds?.widthPt??t.anchorBounds.widthPt,heightPt:t.anchorBounds.heightPt}},u);d.push(n.placement),u=n.transaction}return{resolved:Object.freeze(d),transaction:u}},b=e=>({...t,cells:t.cells.map((r,a)=>({...r,blocks:r.blocks.map(o=>{let s=e.filter(e=>e.source.hostCellId===r.id&&e.source.anchorBlockIndex===o.sourceBlockIndex).map(e=>Object.freeze({xPt:e.exclusionBounds.xPt-e.source.anchorBounds.xPt,yPt:e.exclusionBounds.yPt-e.source.anchorBounds.yPt,widthPt:e.exclusionBounds.widthPt,heightPt:e.exclusionBounds.heightPt}));return s.length===0||o.layout.kind!==`paragraph`?o:{...o,layout:u({logicalRowIndex:t.logicalRowIndex,logicalCellIndex:a,sourceBlockIndex:o.sourceBlockIndex,ownership:n,page:i.page,acquired:o.layout,floatingTableExclusions:Object.freeze(s)})}})}))}),x=(e,t)=>JSON.stringify({blocks:e.cells.map(e=>e.blocks.map(e=>({sourceBlockIndex:e.sourceBlockIndex,layout:e.layout}))),placements:t}),S=y(t);if(S.resolved.length===0)return{row:t,resolved:[],registry:a,nextParagraphId:o};try{let e=Kd({seedState:x(t,S.resolved),step:e=>{let t=b(e?.resolution.resolved??S.resolved),n=y(t);return Object.freeze({candidate:t,resolution:n,state:x(t,n.resolved)})},stateOf:e=>e.state,limit:16}).value;return{row:e.candidate,resolved:e.resolution.resolved,registry:Object.freeze([...e.resolution.transaction.base,...e.resolution.transaction.delta]),nextParagraphId:e.resolution.transaction.nextParagraphId}}catch(e){throw e instanceof Gd?new Z(`NON_CONVERGENCE`,`floating table final-frame reflow did not converge (${e.reason}; ${e.states.length} states)`):e}}function _O(e,t,n){let r=e.input.rows[t.logicalRowIndex]?.cells.findIndex(e=>e.id===n.hostCellId)??-1;return r>=0&&(t.ranges[r]?.some(e=>e.blockIndex===n.anchorBlockIndex&&(e.kind===`whole`||e.kind===`paragraph`&&e.lineStart===0||e.kind===`nested-table`&&e.childFragmentIndex===0))??!1)}function vO(e){return`${e.hostCellId}:${e.sourceBlockIndex}:${e.tableId}`}function yO(e,t){return new Set(e.floatingTables.filter(n=>_O(e,t,n)).map(vO))}function bO(e,t){return e.size===t.size&&[...e].every(e=>t.has(e))}function xO(e,t,n=0,r=!1,i=[]){return{input:e,logicalRowIndex:e.logicalRowIndex,fragmentIndex:n,ownership:t,ranges:fO(e),...r?{clipAtPageEnd:!0}:{},...i.length?{resolvedFloatingTables:i}:{}}}function SO(e,t,n){return iT(e,{lineStart:t,lineEnd:n,continuesFromPrevious:t>0,continuesOnNext:n<e.lines.length})}function CO(e,t,n,r,i){let a=null,o=n;for(let s=n+1;s<=e.lines.length;s+=1){let c=SO(e,n,s),l={layout:c,sourceBlockIndex:t};if(vD([...r,l])>i+iO)break;a=c,o=s}return a?{block:{layout:a,sourceBlockIndex:t},range:{kind:`paragraph`,blockIndex:t,lineStart:n,lineEnd:o},lineEnd:o,advancePt:a.advancePt}:{block:null,range:null,lineEnd:n,advancePt:0}}function wO(e,t,n,r,i){if(t.verticalMerge===`continue`)return{input:t,range:[],next:n,complete:!0};let a=[],o=[],s=n.blockIndex,c=n.paragraphLineStart,l=n.nestedCursor,u=n.nestedFragmentIndex;for(;s<t.blocks.length;){let n=t.blocks[s],d=n.layout;if(d.kind===`paragraph`){if(n.structuralTrailing){a.push(n),o.push({kind:`whole`,blockIndex:n.sourceBlockIndex}),s+=1,c=0;continue}if(d.lines.length===0){if(vD([...a,n])>r+iO)break;a.push(n),o.push({kind:`whole`,blockIndex:n.sourceBlockIndex}),s+=1,c=0;continue}let e=CO(d,n.sourceBlockIndex,c,a,r);if(!e.block||!e.range)break;if(a.push({...e.block,...n.structuralTrailing?{structuralTrailing:!0}:{}}),o.push(e.range),e.lineEnd<d.lines.length){c=e.lineEnd;break}s+=1,c=0;continue}let f=e.nestedById[d.id];if(f){let e=Math.max(0,r-vD(a)),t=DO(f,l??oO(),{...i,availableHeightPt:e,placement:{...i.placement,availableBounds:{...i.placement.availableBounds,heightPt:e}}});if(!t.fragment)break;if(a.push({layout:t.fragment,sourceBlockIndex:n.sourceBlockIndex}),o.push({kind:`nested-table`,blockIndex:n.sourceBlockIndex,childFragmentIndex:u}),t.nextCursor){l=t.nextCursor,u+=1;break}s+=1,l=null,u=0;continue}if(vD([...a,n])>r+iO)break;a.push(n),o.push({kind:`whole`,blockIndex:n.sourceBlockIndex}),s+=1}let d=s>=t.blocks.length;return{input:{...t,blocks:a},range:o,next:Object.freeze({blockIndex:s,paragraphLineStart:c,nestedCursor:l,nestedFragmentIndex:u}),complete:d}}function TO(e,t,n,r,i){let a=t.cells.map((e,t)=>n.cells[t]??aO()),o=Math.max(0,...t.cells.map(e=>e.margins.topPt+e.margins.bottomPt)),s=Math.max(0,t.cellSpacingPt)*2,c=Math.max(0,r-o-s),l=t.cells.map((t,n)=>wO(e,t,a[n],c,i));if(!l.some((e,t)=>e.next.blockIndex!==a[t]?.blockIndex||e.next.paragraphLineStart!==a[t]?.paragraphLineStart||e.next.nestedFragmentIndex!==a[t]?.nestedFragmentIndex))return{selected:null,next:n,complete:!1};let u=l.every(e=>e.complete);return u&&n.rowFragmentIndex===0?{selected:xO(t,`source`),next:Object.freeze({rowIndex:n.rowIndex+1,rowFragmentIndex:0,cells:Object.freeze([])}),complete:!0}:{selected:{input:{...t,id:`${t.id}:fragment:${n.rowFragmentIndex}`,heightPt:null,heightRule:`auto`,cells:l.map((e,t)=>({...e.input,id:`${e.input.id}:fragment:${n.rowFragmentIndex}:${t}`}))},logicalRowIndex:t.logicalRowIndex,fragmentIndex:n.rowFragmentIndex,ownership:`source`,ranges:l.map(e=>e.range)},next:Object.freeze({rowIndex:u?n.rowIndex+1:n.rowIndex,rowFragmentIndex:u?0:n.rowFragmentIndex+1,cells:Object.freeze(u?[]:l.map(e=>e.next))}),complete:u}}function EO(e,t,n){let r=BD({...e.input,id:`${e.input.id}:fragment:${n.page.occurrenceId}`,rows:t.map(e=>e.input)},n.placement,n.services).layout,i=r.rows.map((e,r)=>{let i=t[r];return Object.freeze({...e,logicalRowIndex:i.logicalRowIndex,fragmentIndex:i.fragmentIndex,ownership:i.ownership,occurrenceId:n.page.occurrenceId,physicalPageIndex:n.page.physicalPageIndex,displayPageNumber:n.page.displayPageNumber,cells:Object.freeze(e.cells.map((e,n)=>{let a=i.input.cells[n]?.verticalMerge??`none`,o=i.input.cells[n],s=a===`continue`&&t.slice(0,r).some(e=>e.input.cells.some(e=>e.verticalMerge===`restart`&&e.columnStart===o?.columnStart&&e.columnSpan===o?.columnSpan));return Object.freeze({...e,contentRanges:Object.freeze([...i.ranges[n]??[]]),...a===`continue`&&!s?{visualMergeOwnership:`continuation`}:{}})}))})}),a=t.flatMap((t,r)=>{let a=e.input.rows[t.logicalRowIndex];return a?e.floatingTables.flatMap(o=>{let s=a.cells.findIndex(e=>e.id===o.hostCellId);if(s<0||!(t.ranges[s]?.some(e=>e.blockIndex===o.anchorBlockIndex&&(e.kind===`whole`||e.kind===`paragraph`&&e.lineStart===0))??!1))return[];let c=t.input.cells[s],l=i[r]?.cells[s],u=c?.blocks.findIndex(e=>e.sourceBlockIndex===o.anchorBlockIndex)??-1,d=u<0?void 0:l?.blocks[u],f=e.nestedById[o.tableId]?.layout;if(!l||!d||!f)throw Error(`Floating table occurrence references missing retained layout data`);let p=Object.freeze({xPt:l.contentBounds.xPt,yPt:l.flowBounds.yPt+d.offsetPt,widthPt:d.layout.flowBounds.widthPt,heightPt:d.layout.flowBounds.heightPt});return[Object.freeze({kind:`floating-table-placement`,occurrenceId:[n.page.occurrenceId,o.hostCellId,o.sourceBlockIndex,o.tableId].join(`:`),ownership:t.ownership,physicalPageIndex:n.page.physicalPageIndex,displayPageNumber:n.page.displayPageNumber,...o,anchorBounds:p,child:f})]}):[]}),o=Object.freeze(t.flatMap(e=>e.resolvedFloatingTables??[])),s=new Set(o.map(e=>e.occurrenceId)),c=t.some(e=>e.clipAtPageEnd===!0),l=c?Math.min(r.advancePt,n.availableHeightPt):r.advancePt,u=c?{...r.flowBounds,heightPt:l}:r.flowBounds;return Object.freeze({...r,flowBounds:u,...c?{inkBounds:u,clipBounds:u,advancePt:l}:{},columnWidthsPt:e.layout.columnWidthsPt,rows:Object.freeze(i),floatingTables:Object.freeze(a.filter(e=>!s.has(e.occurrenceId))),resolvedFloatingTables:o,...n.floatingTableRegistry?{resolvedFloatingTableCoordinateSpace:n.floatingTableRegistry.coordinateSpace}:{}})}function DO(e,t,n){if(t.rowIndex>=e.input.rows.length)return{fragment:null,nextCursor:null,requiresFreshPage:!1};let r=[],i=n.floatingTableRegistry;if(i&&i.flowDomainId.length===0)throw Error(`Floating table registry coordinate/domain mismatch`);let a=Object.freeze([...i?.entries??[]]),o=i?.nextParagraphId??0,s=Math.max(0,n.availableHeightPt),c=sO(e.input);if(t.rowIndex>=c&&t.rowIndex>0&&c>0)for(let i=0;i<c;i+=1){let c=gO(e,pO(e,e.input.rows[i],`repeated-header`,n),`repeated-header`,n.availableHeightPt-s,n,a,o,oO(),()=>!0),l=c.row,u=lO(e,l,i,n);if(u>s+iO)return{fragment:null,nextCursor:t,requiresFreshPage:!0};r.push(xO(l,`repeated-header`,0,!1,c.resolved)),a=c.registry,o=c.nextParagraphId,s-=u}let l=t,u=t.rowIndex,d=t.rowFragmentIndex===0&&t.cells.length===0&&e.layout.rows.slice(t.rowIndex).reduce((e,t)=>e+Math.max(0,t.heightPt),0)<=s+iO,f=!1;for(;u<e.input.rows.length;){let i=`source`,c=pO(e,e.input.rows[u],i,n),p=u===t.rowIndex?t:Object.freeze({rowIndex:u,rowFragmentIndex:0,cells:Object.freeze([])}),m=u!==t.rowIndex||t.rowFragmentIndex===0,h=m?gO(e,c,i,n.availableHeightPt-s,n,a,o,p,e=>{let t=c.cells.findIndex(t=>t.id===e.hostCellId),n=c.cells[t]?.blocks.findIndex(t=>t.sourceBlockIndex===e.anchorBlockIndex)??-1;if(n<0)return!1;let r=p.cells[t]??aO();return r.blockIndex<n||r.blockIndex===n&&r.paragraphLineStart===0}):{row:c,resolved:Object.freeze([]),registry:a,nextParagraphId:o},g=h.row,_=d||f?uO(e,g,u,n):lO(e,g,u,n);if(m&&_<=s+iO){r.push(xO(g,`source`,0,!1,h.resolved)),a=h.registry,o=h.nextParagraphId,s-=_,u+=1,l=u<e.input.rows.length?Object.freeze({rowIndex:u,rowFragmentIndex:0,cells:Object.freeze([])}):null;continue}if(g.cantSplit){if(r.some(e=>e.ownership===`source`))break;if(_+(n.availableHeightPt-s)<=n.freshPageHeightPt+iO||n.availableHeightPt+iO<n.freshPageHeightPt)return{fragment:null,nextCursor:t,requiresFreshPage:!0};if(dh({compatibility:n.compatibility,availableHeightPt:n.availableHeightPt,freshPageHeightPt:n.freshPageHeightPt,epsilonPt:iO})){r.push(xO(g,`source`,0,!0,h.resolved)),a=h.registry,o=h.nextParagraphId,l=u+1<e.input.rows.length?Object.freeze({rowIndex:u+1,rowFragmentIndex:0,cells:Object.freeze([])}):null;break}}if(n.oversizedRowPolicy===`atomic`&&r.every(e=>e.ownership===`repeated-header`)&&n.availableHeightPt+iO>=n.freshPageHeightPt&&_>n.freshPageHeightPt+iO){r.push(xO(g,`source`,0,!1,h.resolved)),a=h.registry,o=h.nextParagraphId,l=u+1<e.input.rows.length?Object.freeze({rowIndex:u+1,rowFragmentIndex:0,cells:Object.freeze([])}):null;break}let v=TO(e,c,p,s,n),y=null,b=new Set;for(;v.selected;){let t=yO(e,v.selected),r=JSON.stringify([...t].sort());if(b.has(r))throw Error(`Floating table selected ownership did not converge`);b.add(r),y=gO(e,c,i,n.availableHeightPt-s,n,a,o,p,e=>t.has(vO(e)));let l=TO(e,y.row,p,s,n);if(!l.selected){v=l;break}let u=yO(e,l.selected);if(v=l,bO(t,u))break;y=null}if(v.selected&&y===null)throw Error(`Floating table selected ownership did not converge`);if(v.selected){let t=y?.resolved??[];if(t.some(t=>!_O(e,v.selected,t.source)))throw Error(`Floating table transaction included an unowned occurrence`);let i=a.length,c=(y?.registry??a).slice(i);if(r.push({...v.selected,...t.length?{resolvedFloatingTables:Object.freeze(t)}:{}}),a=Object.freeze([...a,...c]),o+=c.length,l=v.next.rowIndex>=e.input.rows.length?null:v.next,v.complete&&v.next.rowIndex<e.input.rows.length){s=Math.max(0,s-dO(e,v.selected.input,u,n)),f=!0,u=v.next.rowIndex;continue}}break}if(r.filter(e=>e.ownership===`source`).length===0){if(!(n.availableHeightPt+iO<n.freshPageHeightPt))throw new Z(`NON_CONVERGENCE`,`Table pagination cannot advance from a fresh page`);return{fragment:null,nextCursor:t,requiresFreshPage:!0}}let p=EO(e,r,n);for(;p.advancePt>n.availableHeightPt+iO;){let t=r.at(-1),i=r.filter(e=>e.ownership===`source`).length;if(!(t?.ownership===`source`&&t.fragmentIndex===0&&t.ranges.every(e=>e.every(e=>e.kind===`whole`)))||i<=1)break;r.pop(),l=Object.freeze({rowIndex:t.logicalRowIndex,rowFragmentIndex:0,cells:Object.freeze([])}),p=EO(e,r,n)}return p.advancePt>n.availableHeightPt+iO&&n.availableHeightPt+iO<n.freshPageHeightPt&&p.advancePt<=n.freshPageHeightPt+iO?{fragment:null,nextCursor:t,requiresFreshPage:!0}:{fragment:p,nextCursor:l,requiresFreshPage:!1,floatingTablePlacements:p.resolvedFloatingTables,...i?{floatingTableRegistryDelta:(()=>{let e=a.slice(i.entries.length).filter(e=>p.resolvedFloatingTables.some(t=>t.occurrenceId===e.occurrenceId));return RE(i,e,i.nextParagraphId+e.length)})()}:{}}}function OO(e,t,n,r){let i=pC(e,n.flowDomainId),a=Ww(t,{...n,exclusions:Object.freeze([...n.exclusions,...i.exclusions,...r?.exclusions??[]]),anchorCollisions:Object.freeze([...n.anchorCollisions??[],...i.collisions,...r?.collisions??[]])});return mC(e,i,a.layout),a}function kO(e,t){return e.flatMap((e,n)=>e.kind===`shape`&&e.anchorOccurrenceId&&e.authoredWrap===void 0?[]:[{id:e.imageKey||`${t}:float:${n}`,wrap:e.authoredWrap??(e.mode===`topAndBottom`?`topAndBottom`:`square`),wrapSide:dd(e.side),bounds:{xPt:e.xLeft,yPt:e.yTop,widthPt:Math.max(0,e.xRight-e.xLeft),heightPt:Math.max(0,e.yBottom-e.yTop)},polygon:e.wrapPolygon??[{xPt:e.xLeft,yPt:e.yTop},{xPt:e.xRight,yPt:e.yTop},{xPt:e.xRight,yPt:e.yBottom},{xPt:e.xLeft,yPt:e.yBottom}],...e.kind===`table`&&!e.anchorOccurrenceId?{verticalOwnership:`page`}:{},...e.anchorOccurrenceId?{anchorOccurrenceId:e.anchorOccurrenceId,verticalOwnership:`page`}:{}}])}function AO(e){return e.flatMap(e=>e.kind!==`shape`||!e.anchorOccurrenceId?[]:[{occurrenceId:e.anchorOccurrenceId,bounds:{xPt:e.imageX,yPt:e.imageY,widthPt:e.imageW,heightPt:e.imageH},horizontalOwnership:`page`,verticalOwnership:`page`}])}function jO(e){if(e.occurrenceId.length===0)throw Error(`DrawingML collision occurrence ID must not be empty`);let{xPt:t,yPt:n,widthPt:r,heightPt:i}=e.bounds;if(![t,n,r,i].every(Number.isFinite)||r<0||i<0)throw Error(`DrawingML collision bounds are invalid: ${e.occurrenceId}`);if(e.horizontalOwnership!==`page`&&e.horizontalOwnership!==`host`||e.verticalOwnership!==`page`&&e.verticalOwnership!==`host`)throw Error(`DrawingML collision ownership is invalid: ${e.occurrenceId}`)}function MO(e){return jO(e),Object.freeze({occurrenceId:e.occurrenceId,bounds:Object.freeze({...e.bounds}),horizontalOwnership:e.horizontalOwnership,verticalOwnership:e.verticalOwnership,...e.relativeHeight===void 0?{}:{relativeHeight:e.relativeHeight}})}function NO(e,t){return Object.freeze({coordinateSpace:t,flowDomainId:e,entries:Object.freeze([])})}function PO(e,t){return Object.freeze({coordinateSpace:e.coordinateSpace,flowDomainId:e.flowDomainId,baseEntries:e.entries,baseEntryCount:e.entries.length,entries:Object.freeze(t.map(MO))})}function FO(e,t){if(t.coordinateSpace!==e.coordinateSpace)throw Error(`DrawingML collision registry coordinate space mismatch`);if(t.flowDomainId!==e.flowDomainId)throw Error(`DrawingML collision registry flow domain mismatch`);if(t.baseEntries!==e.entries||t.baseEntryCount!==e.entries.length)throw Error(`DrawingML collision registry delta is stale`);let n=new Set(e.entries.map(e=>e.occurrenceId));for(let e of t.entries){if(jO(e),n.has(e.occurrenceId))throw Error(`DrawingML collision occurrence committed twice: ${e.occurrenceId}`);n.add(e.occurrenceId)}}function IO(e,t){return FO(e,t),Object.freeze({coordinateSpace:e.coordinateSpace,flowDomainId:e.flowDomainId,entries:Object.freeze([...e.entries,...t.entries])})}function LO(e,t){return MS(e,t)}function RO(e){return fd(e.wrapMode)&&LO(e.anchorYRelativeFrom??null,e.anchorYFromPara??!1)}function zO(e){let t=is(e);return t===`U`||t===`Tu`?`upright`:t===`Tr`?`rotate`:`sideways`}const BO=new Set([65294]);function VO(e){return BO.has(e)?{dx:.4,dy:-.4}:{dx:0,dy:0}}function HO(e){let t=[],n=``,r=null;for(let i of e){let e=zO(i.codePointAt(0)??0);r===null?(r=e,n=i):e===r?n+=i:(t.push({text:n,mode:r}),n=i,r=e)}return n!==``&&r!==null&&t.push({text:n,mode:r}),t}const UO=()=>!1;function WO(e,t,n){let r=e.textBaseline;e.textBaseline=`alphabetic`;let i=e.measureText(t);e.textBaseline=r;let a=i.fontBoundingBoxAscent,o=i.fontBoundingBoxDescent;return typeof a==`number`&&typeof o==`number`&&(a!==0||o!==0)?(a-o)/2:.38*n}function GO(e,t){let n=e.textAlign,r=e.textBaseline;e.textAlign=`center`,e.textBaseline=`middle`;let i=e.measureText(t);e.textAlign=n,e.textBaseline=r;let a=i.actualBoundingBoxAscent,o=i.actualBoundingBoxDescent;return typeof a==`number`&&typeof o==`number`?(a-o)/2:0}function KO(e){return zO(e)===`rotate`&&ss(e)===null&&!us(e)}function qO(e){let t=is(e);return t===`Tu`||t===`Tr`}function JO(e,t){let n=e.textAlign,r=e.textBaseline;e.textAlign=`center`,e.textBaseline=`middle`;let i=e.measureText(t);e.textAlign=n,e.textBaseline=r;let a=i.actualBoundingBoxLeft,o=i.actualBoundingBoxRight;return typeof a!=`number`||typeof o!=`number`||!Number.isFinite(a)||!Number.isFinite(o)?null:{extentPx:a+o,shiftPx:(a-o)/2}}function YO(e,t,n,r,i,a,o){let s=e.textAlign,c=e.textBaseline,l=()=>(e.textAlign=n===`sideways`?`left`:`center`,e.textBaseline=n===`sideways`?`alphabetic`:`middle`,e.measureText(t)),u;try{u=o?ws(e,l):l()}finally{e.textAlign=s,e.textBaseline=c}if(n===`upright`){if(!Number.isFinite(u.actualBoundingBoxLeft)||!Number.isFinite(u.actualBoundingBoxRight))return;let e=u.actualBoundingBoxLeft,t=u.actualBoundingBoxRight,n=a===`vertical-rl`?1:i,o=-(r.xPt-e)*n,s=-(r.xPt+t)*n;return Object.freeze({startPt:Math.min(o,s),endPt:Math.max(o,s)})}if(!Number.isFinite(u.actualBoundingBoxAscent)||!Number.isFinite(u.actualBoundingBoxDescent))return;let d=u.actualBoundingBoxAscent,f=u.actualBoundingBoxDescent,p=r.yPt-d,m=r.yPt+f;return Object.freeze({startPt:Math.min(p,m),endPt:Math.max(p,m)})}function XO(e,t,n,r,i){let a=e.measureText(t).width;if(qO(n)&&r(n)){let n=Ts(e,t);return{naturalPx:n.cellAdvancePx,vert:n,rotateInkShiftPx:0}}if(i&&KO(n)){let n=JO(e,t);if(n!==null&&n.extentPx>a)return{naturalPx:n.extentPx,vert:null,rotateInkShiftPx:n.shiftPx}}return{naturalPx:a,vert:null,rotateInkShiftPx:0}}function ZO(e,t,n,r,i=1,a=!1,o=UO,s=`vertical-rl`){let c=[],l=WO(e,t,n),u=0,d=0;for(let f of HO(t)){if(f.mode===`sideways`){let t=[...f.text].length,n=e.measureText(f.text).width*i+r*t,a={xPt:0,yPt:l},o=YO(e,f.text,`sideways`,a,i,s,!1);c.push({range:{start:d,end:d+f.text.length},text:f.text,orientation:`sideways`,originPt:u,advancePt:n,drawOffsetPt:a,verticalFeature:!1,...o?{blockAxisInkBounds:o}:{}}),u+=n,d+=f.text.length;continue}for(let t of f.text){let l=t.codePointAt(0)??0,f=zO(l),p=f===`rotate`?ss(l):null,m=f===`rotate`&&p===null&&us(l),h=XO(e,t,l,o,a),g=h.naturalPx*i+r,_={start:d,end:d+t.length};if(h.vert!==null){let n={xPt:0,yPt:0},r=YO(e,t,`upright`,n,i,s,!0);c.push({range:_,text:t,orientation:`upright`,originPt:u+h.vert.originInCellPx*i,advancePt:g,drawOffsetPt:n,verticalFeature:!0,...r?{blockAxisInkBounds:r}:{}})}else if(f===`upright`||p!==null||m){let r=p===null?as(l):null,a=p??r,o=a===null?t:String.fromCodePoint(a),d=a===null?VO(l):{dx:0,dy:0},f=_f(r),m=d.dy===0&&!f?GO(e,o)/n:0,h={xPt:d.dx*n,yPt:(m+d.dy)*n},v=YO(e,o,`upright`,h,i,s,!1);c.push({range:_,text:o,orientation:`upright`,originPt:u+g/2,advancePt:g,drawOffsetPt:h,verticalFeature:!1,...v?{blockAxisInkBounds:v}:{}})}else{let n={xPt:0,yPt:0},r=YO(e,t,`rotate`,n,i,s,!1);c.push({range:_,text:t,orientation:`rotate`,originPt:u+g/2+i*h.rotateInkShiftPx,advancePt:g,drawOffsetPt:n,verticalFeature:!1,...r?{blockAxisInkBounds:r}:{}})}u+=g,d+=t.length}}return c}function QO(e,t,n){let r=0;for(let i of HO(t)){if(i.mode===`sideways`){r+=e.measureText(i.text).width;continue}for(let t of i.text){let i=XO(e,t,t.codePointAt(0)??0,n,!0);r+=i.naturalPx}}return r-e.measureText(t).width}function $O(e,t){return QO(e,t,t=>Cs(e,t))}function ek(e,t,n,r,i){return{x:t,y:i-(e+n),w:r,h:n}}function tk(e,t,n,r){let i=r.acquisitionInputs,a=()=>r.bodySectionIndex,o=r.effectiveTablePositioning,s=r.publicAnchorBridge,c=Of(e.fontFamilyClasses,e.fontFamilyPitches),l=(e,t,n)=>`${e}${t?`|clr:${t}`:``}${n?`|duo:${n.clr1}:${n.clr2}`:``}`;function u(e,t,n={},r,a={},o,c){let l=Sm(r,t),u=o;return{ctx:e,verticalGlyphMeasurement:qg(u),acquisitionInputs:i,contentX:t.marginLeft,contentW:t.pageWidth-t.marginLeft-t.marginRight,y:0,pageH:t.pageHeight,pageIndex:0,totalPages:i_(u).totalPages,marginLeft:t.marginLeft,marginRight:t.marginRight,marginTop:Mm(t.marginTop),marginBottom:Mm(t.marginBottom),pageWidth:t.pageWidth,floats:[],floatParaSeq:0,layoutSettings:r,sectionLayout:l,storyContext:eD,docEastAsian:r.documentHasEastAsianText,fontFamilyClasses:n,resolvedLocalFonts:a,layoutServices:u,retainedTableAcquisition:{layoutServices:e=>e.layoutServices,tableFormat:i.tableFormatInput,resolveColumns:m,createCellState:(e,t,n)=>({...aD(e),contentX:0,contentW:t,y:0,containerShading:n.background??e.containerShading,floats:[],floatParaSeq:0,pageAnchorPrescanned:new Set}),acquireParagraph:(e,t,n,r,i,a,o,c)=>{let l=c??{story:`body`,storyInstance:`body`,path:[...r]},u=t.runs.filter((e,t)=>s(e,l,t)!==null);u.length>0&&E({...t,runs:u},e,e.y);let d=iD(e,t),f=OO(e,e.acquisitionInputs.paragraphAcquisitionInput(t,l),{id:`${l.story}:${l.storyInstance}:${l.path.join(`.`)}`,source:l,flowDomainId:i,ordinaryFlow:!0,context:d,placement:{startYPt:e.y,paragraphXPt:0,availableWidthPt:n,maximumYPt:e.pageH,suppressSpaceBefore:!0},measurer:{context:e.ctx,fontFamilyClasses:e.fontFamilyClasses},environment:QE(e),exclusions:kO(e.floats,i),anchorCollisions:AO(e.floats),anchorCellBounds:{xPt:0,yPt:0,widthPt:n,heightPt:e.pageH},containerShading:e.containerShading,...a?{paragraphBorderEdges:a}:{},trailingExtentPt:Math.max(d.spaceAfterPt,a?.bottom===`none`?0:Qp(t.borders)),continuesFromPrevious:!1,anchorFrames:tD(e),acquireCompleteStory:e.acquireCompleteTextBoxStory},o).layout;return t.spaceBefore===0?f:Object.freeze({...f,flowBounds:Object.freeze({...f.flowBounds,heightPt:f.flowBounds.heightPt+t.spaceBefore}),advancePt:f.advancePt+t.spaceBefore,spacing:Object.freeze({...f.spacing,beforePt:t.spaceBefore})})},registerFloatingTable:(e,t)=>{let n=!t.positioning.horzSpecified||t.positioning.horzAnchor!==`page`&&t.positioning.horzAnchor!==`margin`,r=t.positioning.vertAnchor!==`page`&&t.positioning.vertAnchor!==`margin`;if(!n||!r)return null;let i=e.pageH,a={xPt:e.contentX,yPt:e.y,widthPt:e.contentW,heightPt:t.child.advancePt},o=FE(t.positioning,{page:{xPt:0,yPt:0,widthPt:e.pageWidth,heightPt:i},margin:{xPt:e.marginLeft,yPt:e.marginTop,widthPt:Math.max(0,e.pageWidth-e.marginLeft-e.marginRight),heightPt:Math.max(0,i-e.marginTop-e.marginBottom)},text:a},t.child.columnWidthsPt.reduce((e,t)=>e+t,0),t.child.advancePt),s=kE(e,{x:o.x,y:o.y,w:o.w,h:o.h,dl:t.positioning.leftFromTextPt,dr:t.positioning.rightFromTextPt,dt:t.positioning.topFromTextPt,db:t.positioning.bottomFromTextPt,kind:`table`,mode:`square`,side:`bothSides`,imageKey:``,paraId:e.floatParaSeq++,avoidOverlap:!0,tableOverlap:t.overlap});return Object.freeze({xPt:s.imageX-a.xPt,yPt:s.imageY-a.yPt})},advanceState:(e,t)=>{e.y+=t}},retainedTablesBySourceIndex:new Map,currentDateMs:c?.currentDateMs,kinsoku:r.kinsoku,defaultTabPt:r.defaultTabPt,get verticalCJK(){return qE(this.sectionLayout.textDirection)},get verticalAllRotated(){return qE(this.sectionLayout.textDirection)&&JE(this.sectionLayout.textDirection)},verticalPhys:KE(t)?(()=>{let e=XE(t);return{pageWidth:e.pageWidth,pageHeight:e.pageHeight,marginLeft:e.marginLeft,marginRight:e.marginRight,marginTop:Mm(e.marginTop),marginBottom:Mm(e.marginBottom),physicalPageWidthPt:e.pageWidth}})():void 0}}function d(e,t,n){let r=e=>{let t=Object.freeze({top:null,right:null,bottom:null,left:null,insideH:null,insideV:null});return Object.freeze({kind:`table`,id:e.id,source:e.source,flowDomainId:e.flowDomainId,ordinaryFlow:!0,alignment:e.alignment,indentPt:e.indentPt,bidiVisual:e.bidiVisual,columnWidthsPt:e.columnWidthsPt,columnWidthKeys:e.columnWidthKeys,borders:t,rows:Object.freeze(e.rows.map(e=>Object.freeze({...e,exceptionBorders:e.sourceTableEdges})))})},i=t=>{if(t.story!==`body`||t.storyInstance!==`body`||t.path.length!==1)throw Error(`Body acquisition requires a top-level body source`);let n=e.body[t.path[0]];if(!n||n.type!==`paragraph`&&n.type!==`table`)throw Error(`Body source does not identify a flow block: ${t.path.join(`.`)}`);return n},l=t=>{if(t.story!==`body`||t.storyInstance!==`body`||t.path.length===0||(t.path.length-1)%3!=0)throw Error(`Nested body acquisition requires a canonical source path`);let n=e.body[t.path[0]];for(let e=1;e<t.path.length;e+=3){if(!n||n.type!==`table`)throw Error(`Nested body source leaves table ownership: ${t.path.join(`.`)}`);n=n.rows[t.path[e]]?.cells[t.path[e+1]]?.content[t.path[e+2]]}if(!n||n.type!==`paragraph`&&n.type!==`table`)throw Error(`Nested body source does not identify a flow block: ${t.path.join(`.`)}`);return n},d=(e,t,n,r,i,a,o=Object.freeze({boundary:null}),s)=>{let c=fm(t)??{top:`top`,bottom:`bottom`},l=rD(e,t);return Ww(e.acquisitionInputs.paragraphAcquisitionInput(t,n),{id:`${n.story}:${n.storyInstance}:${n.path.join(`.`)}`,source:n,flowDomainId:r.flowDomainId,ordinaryFlow:!0,context:l,placement:{startYPt:e.y,paragraphXPt:r.availableBounds.xPt,availableWidthPt:i,maximumYPt:e.pageH,suppressSpaceBefore:a},measurer:{context:e.ctx,fontFamilyClasses:e.fontFamilyClasses},environment:QE(e),exclusions:kO(e.floats,r.flowDomainId),anchorCollisions:s??AO(e.floats),containerShading:e.containerShading,paragraphBorderEdges:c,trailingExtentPt:Math.max(l.spaceAfterPt,c.bottom===`none`?0:Qp(t.borders)),continuesFromPrevious:o.boundary!==null,...o.sourceRangeStart===void 0?{}:{sourceRangeStart:o.sourceRangeStart},anchorFrames:tD(e),acquireCompleteStory:e.acquireCompleteTextBoxStory},o.boundary===null?void 0:{boundary:o.boundary,...o.uniformRubyAdvancePt===void 0?{}:{uniformRubyAdvancePt:o.uniformRubyAdvancePt}})};return Object.freeze({openBodyLayoutSession(f,_,v){if(!t)throw Error(`Body layout acquisition requires a measurement context`);let y={...e.section,...f.section.geometry,textDirection:f.section.textDirection,vAlign:f.section.verticalAlignment},b=u(t,qE(y.textDirection)?YE(y):y,c,_m(e),n,_,v),x=cT(e.footnotes??[]);b.noteNumbers=new Map([...[...sT(e.footnotes,lT(e.body,`footnote`))].map(([e,t])=>[`footnote:${e}`,t]),...[...sT(e.endnotes,lT(e.body,`endnote`))].map(([e,t])=>[`endnote:${e}`,t])]);let S=new Map;Bm(a()).occurrences.forEach(e=>{let t=e.markerBodyIndex===null?null:`section:${e.markerBodyIndex}`;for(let n of[`default`,`first`,`even`]){let r=t===null?n:`${t}:${n}`,i=e.headers[n],a=e.footers[n];i&&S.set(`header:${r}`,i),a&&S.set(`footer:${r}`,a)}});let C=f.initialLocation,w=e=>`body:page:${e}:registry`,T=Object.freeze({coordinateSpace:`logical-page-points`,flowDomainId:w(C.pageIndex),entries:Object.freeze([]),nextParagraphId:0}),O=NO(w(C.pageIndex),`logical-page-points`),k=(e,t)=>{let n=t.section.geometry;e.sectionLayout=t.section,e.pageIndex=t.pageIndex;let r=i_(_).resolveDestinationPage?.(t.pageIndex);e.displayPageNumber=r?.displayPageNumber??t.pageIndex+1,e.pageNumberFormat=r?.pageNumberFormat??e.pageNumberFormat,e.pageWidth=n.pageWidth,e.pageH=n.pageHeight,e.marginLeft=n.marginLeft,e.marginRight=n.marginRight,e.marginTop=Mm(n.marginTop),e.marginBottom=Mm(n.marginBottom),e.contentX=t.availableBounds.xPt,e.contentW=t.availableBounds.widthPt,e.y=t.cursorPt.yPt},A=e=>{C=e,k(b,e)};A(C);let j=(e,t,n,r,i=T.nextParagraphId)=>{let a=new Set(T.entries.map(e=>e.occurrenceId)),o=e.runs.flatMap((i,o)=>{if(i.type!==`shape`&&i.type!==`image`&&i.type!==`chart`)return[];let c=s(i,t,o);return!c||r&&!r.has(c.occurrenceId)||a.has(c.occurrenceId)||c.pageOwned&&n.pageAnchorPrescanned?.has(e)?[]:[{run:i,occurrenceId:c.occurrenceId}]});if(o.length===0)return Object.freeze([]);let c=n.floats.length;E({...e,runs:o.map(({run:e})=>e)},n,n.y);let l=n.floats.slice(c);if(l.length!==o.length)throw Error(`Public paragraph anchor acquisition did not retain every wrap float`);return Object.freeze(l.map((e,t)=>{let n=o[t].occurrenceId;return Object.freeze({kind:`shape`,occurrenceId:n,exclusionId:n,paragraphId:i,bounds:Object.freeze({xPt:e.imageX,yPt:e.imageY,widthPt:e.imageW,heightPt:e.imageH}),exclusionBounds:Object.freeze({xPt:e.xLeft,yPt:e.yTop,widthPt:e.xRight-e.xLeft,heightPt:e.yBottom-e.yTop}),wrap:o[t].run.wrapMode,wrapSide:e.side,wrapDistances:Object.freeze({topPt:e.distTop,rightPt:e.distRight,bottomPt:e.distBottom,leftPt:e.distLeft}),...e.wrapPolygon?{wrapPolygon:Object.freeze([...e.wrapPolygon])}:{}})}))},M=e=>{let t=new Map((e.anchorFrames??[]).flatMap(e=>{if(e.status!==`resolved`)return[];let t=e=>e.status===`resolved`&&(e.referenceFrame===`paragraph`||e.referenceFrame===`line`||e.referenceFrame===`character`);return t(e.axes.horizontal)||t(e.axes.vertical)?[[e.occurrenceId,e]]:[]}));if(t.size===0)return Object.freeze([]);let n=new Map(e.exclusions.flatMap(e=>e.anchorOccurrenceId?[[e.anchorOccurrenceId,e]]:[]));return Object.freeze((e.anchorCollisions??[]).flatMap(e=>{let r=t.get(e.occurrenceId);if(!r||r.geometry.wrap.kind===`none`)return[];let i=n.get(e.occurrenceId);if(!i)throw Error(`Wrapped anchor omitted exclusion geometry: ${e.occurrenceId}`);return[Object.freeze({kind:`shape`,occurrenceId:e.occurrenceId,exclusionId:e.occurrenceId,paragraphId:T.nextParagraphId,bounds:e.bounds,exclusionBounds:i.bounds,horizontalOwnership:e.horizontalOwnership,verticalOwnership:e.verticalOwnership,wrap:r.geometry.wrap.kind,wrapSide:r.geometry.wrap.side,wrapDistances:r.geometry.wrap.distances,...r.geometry.wrap.polygon?{wrapPolygon:r.geometry.wrap.polygon.points}:{}})]}))},N=e=>{if(e.acquired.kind!==`paragraph`)return e.acquired;let t=l(e.acquired.source);if(t.type!==`paragraph`)throw Error(`Table paragraph re-acquisition source kind mismatch`);let n={...aD(b),contentX:0,contentW:e.acquired.flowBounds.widthPt,y:e.acquired.flowBounds.yPt,floats:(e.floatingTableExclusions??[]).map((e,t)=>({kind:`table`,tableOverlap:`never`,mode:`square`,imageKey:`table-final-frame:${t}`,imageX:e.xPt,imageY:e.yPt,imageW:e.widthPt,imageH:e.heightPt,xLeft:e.xPt,xRight:e.xPt+e.widthPt,yTop:e.yPt,yBottom:e.yPt+e.heightPt,side:`bothSides`,distLeft:0,distRight:0,distTop:0,distBottom:0,paraId:t})),floatParaSeq:e.floatingTableExclusions?.length??0,pageAnchorPrescanned:new Set},r=cC(e.acquired);return b.retainedTableAcquisition.acquireParagraph(n,t,e.acquired.flowBounds.widthPt,e.acquired.source.path,e.acquired.flowDomainId,void 0,r)},ee=cT(e.endnotes??[]),te=new Map,P=e=>{if(e.path.length!==0)throw Error(`Story acquisition requires a story-root source`);if(e.story===`header`||e.story===`footer`){let t=S.get(`${e.story}:${e.storyInstance}`);if(!t)throw Error(`Unknown ${e.story} story source`);return t.body}if(e.story===`footnote`||e.story===`endnote`){let t=(e.story===`footnote`?x:ee).get(e.storyInstance);if(!t)throw Error(`Unknown ${e.story} story source`);return t.content}throw Error(`Unsupported shared story source: ${e.story}`)},ne=(e,t)=>{if(t.path.length===0||(t.path.length-1)%3!=0)throw Error(`Story block acquisition requires a canonical source path`);let n=e[t.path[0]];for(let e=1;e<t.path.length;e+=3){if(!n||n.type!==`table`)throw Error(`Story source leaves table ownership: ${t.path.join(`.`)}`);n=n.rows?.[t.path[e]]?.cells[t.path[e+1]]?.content[t.path[e+2]]}if(!n||n.type!==`paragraph`&&n.type!==`table`)throw Error(`Story source does not identify a flow block: ${t.path.join(`.`)}`);return n},F=(e,t)=>{let n=JSON.stringify({source:e.source,pageIndex:e.pageIndex,section:e.section,container:e.container}),r=te.get(n);if(r)return r;let i=t??P(e.source),a=e.source.story===`footnote`||e.source.story===`endnote`?b.noteNumbers?.get(`${e.source.story}:${e.source.storyInstance}`):void 0,o=i_(_),c=o.resolveDestinationPage?.(e.pageIndex),l=qE(e.section.textDirection),u={...b,sectionLayout:e.section,pageIndex:e.pageIndex,totalPages:o.totalPages,displayPageNumber:c?.displayPageNumber??e.pageIndex+1,pageNumberFormat:c?.pageNumberFormat??b.pageNumberFormat,pageWidth:e.section.geometry.pageWidth,pageH:e.container.capacity===`unbounded`?2**53-1:e.section.geometry.pageHeight,marginLeft:e.section.geometry.marginLeft,marginRight:e.section.geometry.marginRight,marginTop:Mm(e.section.geometry.marginTop),marginBottom:Mm(e.section.geometry.marginBottom),contentX:e.container.bounds.xPt,contentW:e.container.bounds.widthPt,y:e.container.bounds.yPt,floats:[],floatParaSeq:0,retainedTablesBySourceIndex:new Map,pageAnchorPrescanned:new Set,noteReferenceNumber:a,verticalCJK:l,verticalAllRotated:l&&JE(e.section.textDirection),...l?{}:{verticalPhys:void 0},storyContext:{story:e.source.story,containers:[],lineNumberingEligible:!1}};D(i,0,u);let d=e_(_);u.layoutServices=d;let f=i.flatMap((t,n)=>{let r={story:e.source.story,storyInstance:e.source.storyInstance,path:[n]};if(t.type===`unsupportedTextBoxBlock`)return[{type:`unsupportedTextBoxBlock`,qName:t.qName,sourcePath:t.sourcePath}];if(t.type===`paragraph`)return[{kind:`paragraph`,source:r}];if(t.type!==`table`)throw Error(`Unsupported ${e.source.story} story block: ${t.type}`);let i=u.retainedTableAcquisition,a=t;return[KD(a,m(a,e.container.bounds.widthPt,u),e.container.bounds.widthPt,u,r,i).input]}),p=null;PT(d,{layoutParagraph(e,t){let n=ne(i,e.source);if(n.type!==`paragraph`)throw Error(`Story paragraph source kind mismatch`);let r=e.source.path[0],a=r>0&&i[r-1]?.type===`paragraph`?i[r-1]:null,o=i[r+1]?.type===`paragraph`?i[r+1]:null,c=p?.spaceAfter??0,l=nC(p,n,c,n.spaceBefore),d=Math.max(t.container.bounds.yPt,t.cursor.yPt-l.overlap);u.y=d,u.contentX=t.container.bounds.xPt,u.contentW=t.container.bounds.widthPt;let f=n.runs.filter((t,n)=>s(t,e.source,n)!==null);f.length>0&&E({...n,runs:f},u,u.y);let m=iD(u,n),h=im(a,n,o),g=OO(u,u.acquisitionInputs.paragraphAcquisitionInput(n,e.source),{id:`${e.source.story}:${e.source.storyInstance}:${e.source.path.join(`.`)}`,source:e.source,flowDomainId:t.container.id,ordinaryFlow:!0,context:m,placement:{startYPt:d,paragraphXPt:t.container.bounds.xPt,availableWidthPt:t.container.bounds.widthPt,maximumYPt:t.availableBounds.yPt+t.availableBounds.heightPt,suppressSpaceBefore:l.suppressBefore},measurer:{context:u.ctx,fontFamilyClasses:u.fontFamilyClasses},environment:QE(u),exclusions:kO(u.floats,t.container.id),anchorCollisions:AO(u.floats),containerShading:u.containerShading,paragraphBorderEdges:h,trailingExtentPt:Math.max(m.spaceAfterPt,h.bottom===`none`?0:Qp(n.borders)),continuesFromPrevious:!1,anchorFrames:tD(u),acquireCompleteStory:u.acquireCompleteTextBoxStory});p=n;let _={xPt:t.cursor.xPt,yPt:d+g.layout.advancePt};return u.y=_.yPt,{layout:g.layout,nextCursor:_}},layoutTable(e,t){p=null;let n=BD({...e,flowDomainId:t.container.id},t,d);return u.y=n.nextCursor.yPt,n}});let h=LT({source:e.source,container:e.container,blocks:Object.freeze(f)},d),g=Object.freeze({...h,blocks:Object.freeze(h.blocks.map((t,n)=>{if(t.kind!==`paragraph`&&t.kind!==`table`)throw Error(`Shared story emitted unsupported node: ${t.kind}`);return gx(t,{occurrenceId:`${e.container.id}:block:${n}`,destination:{coordinateSpace:`logical-page-points`,flowDomainId:e.container.id,translation:{xPt:0,yPt:0}}})}))});return te.set(n,g),g};b.acquireCompleteTextBoxStory=e=>{let t=e.coordinateSpace===`upright-physical`?{...b.sectionLayout,geometry:Pm(b.sectionLayout.geometry),textDirection:`lrTb`}:b.sectionLayout;return F({source:e.source,pageIndex:b.pageIndex,section:t,container:e.container},e.blocks)};let I={hasPaginationFields:oC(e.body,e.footnotes??[],[...[...S.values()].map(e=>e.body),...(e.endnotes??[]).map(e=>e.content)]),measureParagraph(t){A(t.location);let n=i(t.input.source);if(n.type!==`paragraph`)throw Error(`Paragraph source kind mismatch`);if(n.framePr){if(t.continuation.boundary!==null)throw Error(`Body frame acquisition cannot continue across flow regions`);let r,i=dm(n);if(!i)throw Error(`Body frame acquisition requires an indexed adjacency group`);let a=g(n,i,b,h(e.body,n,b),e=>{r=e});if(!r)throw Error(`Body frame acquisition omitted its retained group`);let o=r.members.find(e=>e.paragraph===n);if(!o)throw Error(`Body frame acquisition omitted its retained member`);let s=n.framePr.vAnchor===`page`||n.framePr.vAnchor===`margin`,c=a.exclusionId??`frame:${t.input.source.path.join(`:`)}`,l=Object.freeze({kind:`frame`,occurrenceId:c,exclusionId:c,paragraphId:T.nextParagraphId,bounds:Object.freeze({xPt:a.x,yPt:a.y,widthPt:a.w,heightPt:a.h}),exclusionBounds:Object.freeze({xPt:a.exLeft,yPt:a.exTop,widthPt:a.exRight-a.exLeft,heightPt:a.exBottom-a.exTop})});return Object.freeze({layout:o.fragment,blockExtentPt:0,lineEndBoundaries:Object.freeze([]),placement:Object.freeze({coordinateSpace:`logical-body`,xPt:o.fragment.flowBounds.xPt,yPt:o.fragment.flowBounds.yPt,sectionFlowOwnership:s?`page`:`host-flow`}),...n===i.owner?{retainedFootnoteReferenceIds:Object.freeze([...new Set(r.members.flatMap(e=>mT(e.fragment)))])}:{},...s?{}:{relocationBlockExtentPt:Math.max(0,a.y+a.h-t.location.cursorPt.yPt)},...a.registerExclusion===!1?{}:{flowRegistryDelta:Object.freeze({floats:RE(T,Object.freeze([l]),T.nextParagraphId+1)})}})}let r={...b,floats:[...b.floats],pageAnchorPrescanned:new Set(b.pageAnchorPrescanned)};k(r,t.location);let a=t.continuation.boundary===null?j(n,t.input.source,r):Object.freeze([]),{measured:o,layout:s}=d(r,n,t.input.source,t.location,t.availableInlineExtentPt,t.suppressSpaceBefore,t.continuation,O.entries),c=o.lines.map(e=>{let t=e.layout.consumedEnd;if(!t)throw Error(`Measured line omitted its source boundary`);return t}),l=M(s),u=Object.freeze([...a,...l]),f=uC(s);return Object.freeze({layout:s,blockExtentPt:s.advancePt,lineEndBoundaries:Object.freeze(c),...o.markOnly?{markBelowBaselinePt:o.lastLineBelowBaselinePt}:{},...o.uniformRubyAdvancePt==null?{}:{uniformRubyAdvancePt:o.uniformRubyAdvancePt},...u.length===0&&f.length===0?{}:{flowRegistryDelta:Object.freeze({...u.length===0?{}:{floats:RE(T,u,T.nextParagraphId+u.length)},...f.length===0?{}:{drawingCollisions:PO(O,f)}})}})},measureTable(e){if(A(e.location),e.input.kind===`adjacent-table-group`){if(e.cursor&&e.cursor.kind!==`adjacent-table-group`)throw Error(`Adjacent table group acquisition received an ordinary table cursor`);let t=e.input.tables.map(t=>{let n=i(t.source);if(n.type!==`table`)throw Error(`Table source kind mismatch`);let r=t.source.path[0];return p(b,n,e.availableInlineExtentPt,r),oD(b,r).acquisition}),n=r(rO(e.input.logicalSequenceId,t.map(e=>e.input))),a={container:{id:e.location.flowDomainId,kind:`body`,bounds:{xPt:0,yPt:0,widthPt:e.availableInlineExtentPt,heightPt:e.freshPageBlockExtentPt}},cursor:{xPt:0,yPt:0},availableBounds:{xPt:0,yPt:0,widthPt:e.availableInlineExtentPt,heightPt:e.freshPageBlockExtentPt}},o=BD(n,a,_).layout,s={};t.forEach(e=>Object.entries(e.nestedById).forEach(([e,t])=>{if(s[e]&&s[e]!==t)throw Error(`Adjacent table group has duplicate nested table id: ${e}`);s[e]=t}));let c=Object.freeze({input:n,layout:o,nestedById:Object.freeze(s),floatingTables:Object.freeze(t.flatMap(e=>e.floatingTables))}),l=e.cursor?.cursor??Object.freeze({tableIndex:0,sourceRowIndex:0}),u=e.input.tables.slice(0,l.tableIndex).reduce((e,t)=>e+(t.rowCount??0),0)+l.sourceRowIndex,d=l.tableCursor??Object.freeze({...oO(),rowIndex:u});if(d.rowIndex!==u)throw Error(`Adjacent-table group and table-fragment cursors disagree`);let f=DO(c,d,{availableHeightPt:e.availableBlockExtentPt,freshPageHeightPt:e.freshPageBlockExtentPt,placement:a,services:_,compatibility:`word`,page:{physicalPageIndex:e.location.pageIndex,displayPageNumber:e.location.pageIndex+1,occurrenceId:`${n.id}:body:${e.location.pageIndex}`}});if(!f.fragment||f.requiresFreshPage)return Object.freeze({layout:c.layout,blockExtentPt:0,nextCursor:Object.freeze({kind:`adjacent-table-group`,cursor:l}),requiresFreshFlowRegion:!0});let m=f.nextCursor?(()=>{let t=0,n=0;for(;t<e.input.tables.length;){let r=e.input.tables[t].rowCount??0;if(f.nextCursor.rowIndex<n+r)break;n+=r,t+=1}return t>=e.input.tables.length?null:Object.freeze({tableIndex:t,sourceRowIndex:f.nextCursor.rowIndex-n,tableCursor:f.nextCursor})})():null;return Object.freeze({layout:f.fragment,blockExtentPt:f.fragment.advancePt,nextCursor:m?Object.freeze({kind:`adjacent-table-group`,cursor:m}):null,...f.floatingTableRegistryDelta?{flowRegistryDelta:Object.freeze({floats:f.floatingTableRegistryDelta})}:{}})}let t=i(e.input.source);if(t.type!==`table`)throw Error(`Table source kind mismatch`);let n=e.input.source.path[0];p(b,t,e.availableInlineExtentPt,n);let a=oD(b,n).acquisition;if(e.cursor&&e.cursor.kind!==`table`)throw Error(`Ordinary table acquisition received an adjacent-group cursor`);let s=e.cursor?.cursor??oO(),c=b.pageH,l=b.acquisitionInputs.tableFormatInput(t).positioning;if(l){let n=e.cursor?.kind===`table`&&e.cursor.floatingContinuationFrame===`fresh-text`?Object.freeze({...l,vertAnchor:`text`,yPt:0,yAlign:void 0}):l,r=a.layout.columnWidthsPt.reduce((e,t)=>e+t,0),i=Object.freeze({page:Object.freeze({xPt:0,yPt:0,widthPt:b.pageWidth,heightPt:c}),margin:Object.freeze({xPt:b.marginLeft,yPt:b.marginTop,widthPt:Math.max(0,b.pageWidth-b.marginLeft-b.marginRight),heightPt:Math.max(0,c-b.marginTop-b.marginBottom)}),text:Object.freeze({xPt:e.location.cursorPt.xPt,yPt:e.location.cursorPt.yPt,widthPt:e.availableInlineExtentPt,heightPt:a.layout.advancePt})}),o=FE(n,i,r,a.layout.advancePt);if(e.cursor?.kind!==`table`&&(n.vertAnchor===`page`||n.vertAnchor===`margin`)&&ad({bounds:{xPt:o.x,yPt:o.y,widthPt:o.w,heightPt:o.h},blockers:T.entries.map(Xu),overlapEpsilonPt:.01}).defer)return Object.freeze({layout:a.layout,blockExtentPt:0,nextCursor:Object.freeze({kind:`table`,cursor:s,floatingContinuationFrame:`authored`}),requiresFreshFlowRegion:!0});let u=(n.vertAnchor===`page`||n.vertAnchor===`margin`)&&a.layout.advancePt>e.freshPageBlockExtentPt,d=u?e.location.availableBounds.yPt+e.location.availableBounds.heightPt:n.vertAnchor===`page`?i.page.yPt+i.page.heightPt:n.vertAnchor===`margin`?i.margin.yPt+i.margin.heightPt:e.location.availableBounds.yPt+e.location.availableBounds.heightPt,f=u?e.freshPageBlockExtentPt:n.vertAnchor===`page`?i.page.heightPt:n.vertAnchor===`margin`?i.margin.heightPt:e.freshPageBlockExtentPt,p;try{p=Kd({step:r=>{if(r?.kind===`fresh-flow-region`||r?.kind===`candidate`&&r.resolved.placement.xPt===r.parentFrame.xPt&&r.resolved.placement.yPt===r.parentFrame.yPt)return r;let c=r?.resolved.placement??{xPt:o.x,yPt:o.y},l=Math.max(0,d-c.yPt),u=DO(a,s,{availableHeightPt:l,freshPageHeightPt:f,placement:{container:{id:`${e.location.flowDomainId}:floating-table`,kind:`body`,bounds:{xPt:0,yPt:0,widthPt:e.availableInlineExtentPt,heightPt:l}},cursor:{xPt:0,yPt:0},availableBounds:{xPt:0,yPt:0,widthPt:e.availableInlineExtentPt,heightPt:l}},services:_,compatibility:`word`,oversizedRowPolicy:`atomic`,page:{physicalPageIndex:e.location.pageIndex,displayPageNumber:b.displayPageNumber??e.location.pageIndex+1,occurrenceId:`${a.input.id}:fitting-outer:${e.location.pageIndex}:${s.rowIndex}:${s.rowFragmentIndex}`},floatingTableFrames:{page:i.page,margin:i.margin,column:i.text},floatingTableRegistry:T,finalPlacementTranslationPt:c,reacquirePageDependentBlock:N});if(!u.fragment||u.requiresFreshPage)return Object.freeze({kind:`fresh-flow-region`,result:u});let p=Object.freeze({kind:`floating-table-placement`,occurrenceId:`${a.input.id}:root:${e.location.pageIndex}:${s.rowIndex}:${s.rowFragmentIndex}`,ownership:`source`,physicalPageIndex:e.location.pageIndex,displayPageNumber:b.displayPageNumber??e.location.pageIndex+1,hostCellId:e.location.flowDomainId,sourceBlockIndex:e.input.source.path[0],anchorBlockIndex:e.input.source.path[0],tableId:u.fragment.id,overlap:t.overlap===`never`?`never`:`overlap`,positioning:n,anchorBounds:i.text,child:u.fragment}),m=u.floatingTableRegistryDelta?.entries??[],h=u.floatingTableRegistryDelta?.nextParagraphId??T.nextParagraphId,g=VE(p,i,BE(T.entries,h,T.coordinateSpace,T.flowDomainId)),v=JSON.stringify({parentFrame:{xPt:g.placement.xPt,yPt:g.placement.yPt},fragment:u.fragment,nestedEntries:m,resolvedBounds:g.placement.bounds});return Object.freeze({kind:`candidate`,parentFrame:Object.freeze({xPt:c.xPt,yPt:c.yPt}),result:u,fragment:u.fragment,resolved:g,nestedEntries:m,fingerprint:v})},stateOf:e=>e.kind===`fresh-flow-region`?`fresh-flow-region`:e.fingerprint,limit:16}).value}catch(e){throw e instanceof Gd?new Z(`NON_CONVERGENCE`,e.reason===`cycle`?`Floating table parent/child transaction repeated an exact-state cycle`:`Floating table parent/child transaction reached the operational pass limit 16`):e}if(p.kind===`fresh-flow-region`)return Object.freeze({layout:a.layout,blockExtentPt:0,nextCursor:Object.freeze({kind:`table`,cursor:s,floatingContinuationFrame:`fresh-text`}),requiresFreshFlowRegion:!0});let{result:m,fragment:h,resolved:g,nestedEntries:v}=p,y=e.cursor?.kind===`table`&&e.cursor.floatingContinuationFrame!==void 0,x=e.location.availableBounds.yPt+e.location.availableBounds.heightPt,S=[...h.resolvedFloatingTables??[],g.placement].filter(e=>e.source.positioning.vertAnchor===`text`);return!y&&S.some(e=>e.exclusionBounds.yPt+e.exclusionBounds.heightPt>x)?Object.freeze({layout:h,blockExtentPt:0,nextCursor:Object.freeze({kind:`table`,cursor:s,floatingContinuationFrame:`fresh-text`}),requiresFreshFlowRegion:!0}):Object.freeze({layout:h,blockExtentPt:0,nextCursor:m.nextCursor?Object.freeze({kind:`table`,cursor:m.nextCursor,floatingContinuationFrame:`fresh-text`}):null,flowRegistryDelta:Object.freeze({floats:RE(T,Object.freeze([...v,...g.transaction.delta]),g.transaction.nextParagraphId)}),placement:Object.freeze({coordinateSpace:`logical-body`,xPt:g.placement.xPt,yPt:g.placement.yPt,sectionFlowOwnership:n.vertAnchor===`page`||n.vertAnchor===`margin`?`page`:`host-flow`})})}if(b.verticalPhys&&!o(t)){if(e.cursor)throw Error(`An upright physical table must remain atomic`);let t=b.verticalPhys,n=a.layout.columnWidthsPt.reduce((e,t)=>e+t,0);if(n>e.availableBlockExtentPt&&e.availableBlockExtentPt<e.freshPageBlockExtentPt)return Object.freeze({layout:a.layout,blockExtentPt:0,nextCursor:Object.freeze({kind:`table`,cursor:s}),requiresFreshFlowRegion:!0});let r=t.physicalPageWidthPt-e.location.cursorPt.yPt-n,i=e.location.cursorPt.xPt,o=Math.max(a.layout.advancePt,t.pageHeight-t.marginTop-t.marginBottom),c=`upright-physical-page:${e.location.pageIndex}`,l=DO(a,oO(),{availableHeightPt:o,freshPageHeightPt:o,placement:{container:{id:c,kind:`body`,bounds:{xPt:0,yPt:0,widthPt:n,heightPt:o}},cursor:{xPt:0,yPt:0},availableBounds:{xPt:0,yPt:0,widthPt:n,heightPt:o}},services:_,compatibility:`word`,oversizedRowPolicy:`atomic`,page:{physicalPageIndex:e.location.pageIndex,displayPageNumber:b.displayPageNumber??e.location.pageIndex+1,occurrenceId:`${a.input.id}:upright-page:${e.location.pageIndex}`},floatingTableFrames:{page:{xPt:0,yPt:0,widthPt:t.pageWidth,heightPt:t.pageHeight},margin:{xPt:t.marginLeft,yPt:t.marginTop,widthPt:Math.max(0,t.pageWidth-t.marginLeft-t.marginRight),heightPt:Math.max(0,t.pageHeight-t.marginTop-t.marginBottom)},column:{xPt:t.marginLeft,yPt:t.marginTop,widthPt:Math.max(0,t.pageWidth-t.marginLeft-t.marginRight),heightPt:Math.max(0,t.pageHeight-t.marginTop-t.marginBottom)}},floatingTableRegistry:Object.freeze({coordinateSpace:`upright-physical-page-points`,flowDomainId:c,entries:Object.freeze([]),nextParagraphId:0}),finalPlacementTranslationPt:{xPt:r,yPt:i},reacquirePageDependentBlock:N});if(!l.fragment||l.nextCursor||l.requiresFreshPage)throw Error(`Upright table final-frame layout must remain atomic`);return Object.freeze({layout:l.fragment,blockExtentPt:n,nextCursor:null,placement:Object.freeze({coordinateSpace:`upright-physical`,xPt:r+l.fragment.flowBounds.xPt,yPt:i+l.fragment.flowBounds.yPt,sectionFlowOwnership:`host-flow`})})}let u=DO(a,s,{availableHeightPt:e.availableBlockExtentPt,freshPageHeightPt:e.freshPageBlockExtentPt,placement:{container:{id:e.location.flowDomainId,kind:`body`,bounds:{xPt:0,yPt:0,widthPt:e.availableInlineExtentPt,heightPt:e.availableBlockExtentPt}},cursor:{xPt:0,yPt:0},availableBounds:{xPt:0,yPt:0,widthPt:e.availableInlineExtentPt,heightPt:e.availableBlockExtentPt}},services:_,compatibility:`word`,page:{physicalPageIndex:e.location.pageIndex,displayPageNumber:e.location.pageIndex+1,occurrenceId:`${a.input.id}:body:${e.location.pageIndex}`},floatingTableFrames:{page:{xPt:0,yPt:0,widthPt:b.pageWidth,heightPt:c},margin:{xPt:b.marginLeft,yPt:b.marginTop,widthPt:Math.max(0,b.pageWidth-b.marginLeft-b.marginRight),heightPt:Math.max(0,c-b.marginTop-b.marginBottom)},column:e.location.availableBounds},floatingTableRegistry:T,finalPlacementTranslationPt:{xPt:e.location.availableBounds.xPt,yPt:e.location.cursorPt.yPt},reacquirePageDependentBlock:N}),d=e.location.availableBounds.xPt+a.layout.flowBounds.xPt,f=d+a.layout.flowBounds.widthPt,m=u.fragment?.advancePt??0,h=id({inlineStartPt:d,inlineEndPt:f,blockStartPt:e.location.cursorPt.yPt,blockExtentPt:m,blockers:T.entries.map(Xu),overlapEpsilonPt:Ku}).blockStartPt;return h>e.location.cursorPt.yPt?Object.freeze({layout:a.layout,blockExtentPt:0,nextCursor:e.cursor??null,retryAtBlockStartPt:h}):!u.fragment||u.requiresFreshPage?Object.freeze({layout:a.layout,blockExtentPt:0,nextCursor:Object.freeze({kind:`table`,cursor:s}),requiresFreshFlowRegion:!0}):Object.freeze({layout:u.fragment,blockExtentPt:u.fragment.advancePt,nextCursor:u.nextCursor?Object.freeze({kind:`table`,cursor:u.nextCursor}):null,...u.floatingTableRegistryDelta?{flowRegistryDelta:Object.freeze({floats:u.floatingTableRegistryDelta})}:{}})},layoutStory:F,layoutNotes(e){let t=[],n=e.container.bounds.yPt,r=e.firstOnPage;for(let i of e.referenceIds){if(!(e.kind===`footnote`?x:ee).has(i))continue;let a={story:e.kind,storyInstance:i,path:[]},o=r?6:0,s={...e.container,id:`${e.container.id}:${e.kind}:${i}`,bounds:{...e.container.bounds,yPt:n+o,heightPt:Math.max(0,e.container.bounds.yPt+e.container.bounds.heightPt-n-o)}},c;try{c=F({source:a,pageIndex:e.pageIndex,section:e.section,container:s})}catch(t){throw t instanceof kT&&t.containerId===s.id?new Rb(e.kind,e.pageIndex,e.container.id):t}let l=Object.freeze(r?[Object.freeze({edge:`top`,from:Object.freeze({xPt:e.container.bounds.xPt,yPt:n+o/2}),to:Object.freeze({xPt:e.container.bounds.xPt+e.container.bounds.widthPt/3,yPt:n+o/2}),color:`#000000`,widthPt:.5,authoredStyle:`single`,style:`solid`})]:[]),u=o+c.advancePt,d=Object.freeze({xPt:e.container.bounds.xPt,yPt:n,widthPt:e.container.bounds.widthPt,heightPt:u}),f=Object.freeze({kind:`note`,id:`${e.kind}:${i}:page:${e.pageIndex}`,source:a,flowDomainId:e.container.id,ordinaryFlow:!0,flowBounds:d,inkBounds:Object.freeze({xPt:Math.min(d.xPt,c.inkBounds.xPt),yPt:Math.min(d.yPt,c.inkBounds.yPt),widthPt:Math.max(d.xPt+d.widthPt,c.inkBounds.xPt+c.inkBounds.widthPt)-Math.min(d.xPt,c.inkBounds.xPt),heightPt:Math.max(d.yPt+d.heightPt,c.inkBounds.yPt+c.inkBounds.heightPt)-Math.min(d.yPt,c.inkBounds.yPt)}),clipBounds:e.container.bounds,advancePt:u,separator:l,story:c});t.push(f),n+=u,r=!1}return Object.freeze(t)},measureFollowingBlock(e){let t={...b,floats:[...b.floats],retainedTablesBySourceIndex:new Map(b.retainedTablesBySourceIndex)};if(k(t,e.location),e.input.kind===`adjacent-table-group`){let n=e.input.tables.map(n=>{let r=i(n.source);if(r.type!==`table`)throw Error(`Following table source kind mismatch`);let a=n.source.path[0];return p(t,r,e.availableInlineExtentPt,a),oD(t,a).acquisition}),a=BD(r(rO(e.input.logicalSequenceId,n.map(e=>e.input))),{container:{id:e.location.flowDomainId,kind:`body`,bounds:e.location.availableBounds},cursor:e.location.cursorPt,availableBounds:e.location.availableBounds},_).layout;return Object.freeze({fullExtentPt:a.advancePt,leadContentExtentPt:a.rows[0]?.advancePt??a.advancePt,fullFootnoteReferenceIds:mT(a),leadFootnoteReferenceIds:mT({...a,rows:a.rows.slice(0,1)})})}let n=i(e.input.source);if(e.input.kind===`paragraph`){if(n.type!==`paragraph`)throw Error(`Following paragraph source kind mismatch`);let{layout:r}=d(t,n,e.input.source,e.location,e.availableInlineExtentPt,!1,void 0,O.entries),i=r.lines[0];return Object.freeze({fullExtentPt:r.advancePt,leadContentExtentPt:i?i.bounds.yPt+i.advancePt-r.flowBounds.yPt:r.advancePt,fullFootnoteReferenceIds:mT(r),leadFootnoteReferenceIds:i?pT([i]):[]})}if(n.type!==`table`)throw Error(`Following table source kind mismatch`);let a=e.input.source.path[0];p(t,n,e.availableInlineExtentPt,a);let o=oD(t,a).acquisition.layout;return Object.freeze({fullExtentPt:o.advancePt,leadContentExtentPt:o.rows[0]?.advancePt??o.advancePt,fullFootnoteReferenceIds:mT(o),leadFootnoteReferenceIds:mT({...o,rows:o.rows.slice(0,1)})})},prescanPageAnchors(e){let t=e.location.section.geometry,n=Mm(t.marginTop),r=Mm(t.marginBottom),a=Object.freeze({page:Object.freeze({xPt:0,yPt:0,widthPt:t.pageWidth,heightPt:t.pageHeight}),margin:Object.freeze({xPt:t.marginLeft,yPt:n,widthPt:Math.max(0,t.pageWidth-t.marginLeft-t.marginRight),heightPt:Math.max(0,t.pageHeight-n-r)}),column:Object.freeze({xPt:e.location.availableBounds.xPt,yPt:n,widthPt:e.availableInlineExtentPt,heightPt:Math.max(0,t.pageHeight-n-r)}),paragraph:null,line:null,character:null,pageParity:e.location.pageIndex%2==0?`odd`:`even`}),o=new Set,c=e=>`${e.story}:${e.storyInstance}:${e.path.join(`.`)}`,l=new Map,u=e=>{let t=c(e);return l.has(t)||l.set(t,T.nextParagraphId+l.size),l.get(t)},d=e.anchors.flatMap(t=>{let n=i(t.paragraphSource);if(n.type!==`paragraph`)throw Error(`Page-anchor prescan source kind mismatch`);let r=b.acquisitionInputs.paragraphAcquisitionInput(n,t.paragraphSource),c=r.runs.filter(e=>e.type===`anchorHost`&&e.anchorOccurrenceId===t.occurrenceId),l=r.runs.map((e,t)=>({run:e,runIndex:t})).filter(e=>(e.run.type===`image`||e.run.type===`chart`||e.run.type===`shape`||e.run.type===`unavailableDrawing`)&&e.run.anchorAcquisitionInput?.occurrenceId===t.occurrenceId).sort((e,t)=>(e.run.anchorAcquisitionInput.group?.sourceIndex??0)-(t.run.anchorAcquisitionInput.group?.sourceIndex??0)||e.runIndex-t.runIndex);if(c.length!==1||l.length===0){let r=n.runs.find((e,n)=>s(e,t.paragraphSource,n)?.occurrenceId===t.occurrenceId);if(r){if((r.type===`image`||r.type===`chart`||r.type===`shape`)&&r.wrapMode===`none`)return[];let i={...b,floats:[...b.floats],pageAnchorPrescanned:new Set(b.pageAnchorPrescanned)};k(i,e.location);let a=j(n,t.paragraphSource,i,new Set([t.occurrenceId]),u(t.paragraphSource));if(a.length!==1)throw Error(`Public page-anchor prescan occurrence mismatch: ${t.occurrenceId}`);return o.add(n),a}throw Error(`Page-anchor prescan occurrence acquisition mismatch: ${t.occurrenceId}`)}let d=eC({acquisition:l[0].run.anchorAcquisitionInput,frames:a});if(d.status!==`resolved`)throw Error(`Page-anchor prescan could not resolve occurrence: ${t.occurrenceId}`);let f=qE(e.location.section.textDirection)?(()=>{let t=N_(e.location.section.textDirection);return bw(d,V_(t,z_({widthPt:a.page.widthPt,heightPt:a.page.heightPt},t)))})():d,p=f.geometry.wrapBounds;if(p===null||f.geometry.wrap.kind===`none`)return[];let m=f.geometry.wrap.polygon?.points??Object.freeze([Object.freeze({xPt:p.xPt,yPt:p.yPt}),Object.freeze({xPt:p.xPt+p.widthPt,yPt:p.yPt}),Object.freeze({xPt:p.xPt+p.widthPt,yPt:p.yPt+p.heightPt}),Object.freeze({xPt:p.xPt,yPt:p.yPt+p.heightPt})]);return[Object.freeze({kind:`shape`,occurrenceId:t.occurrenceId,paragraphId:u(t.paragraphSource),bounds:f.geometry.objectFrame,exclusionBounds:p,wrap:f.geometry.wrap.kind,wrapSide:f.geometry.wrap.side,wrapDistances:f.geometry.wrap.distances,wrapPolygon:Object.freeze([...m])})]});return o.forEach(e=>b.pageAnchorPrescanned?.add(e)),d.length===0?null:Object.freeze({floats:Object.freeze({coordinateSpace:`logical-page-points`,flowDomainId:T.flowDomainId,baseEntries:T.entries,baseNextParagraphId:T.nextParagraphId,nextParagraphId:T.nextParagraphId+d.length,entries:Object.freeze(d)})})},measureLineNumberGlyph(n){let r=t.font;try{let r=ZE(e),i=jf(!1,!1,r,null,{});t.font=i;let a=t.measureText(n);return Object.freeze({widthPt:a.width,ascentPt:a.fontBoundingBoxAscent??a.actualBoundingBoxAscent??r*.8,descentPt:a.fontBoundingBoxDescent??a.actualBoundingBoxDescent??r*.2,font:i})}finally{t.font=r}},resetPageAcquisition(e){b.floats=[],b.floatParaSeq=0,b.pageAnchorPrescanned=new Set,T=Object.freeze({coordinateSpace:`logical-page-points`,flowDomainId:w(e.pageIndex),entries:Object.freeze([]),nextParagraphId:0}),O=NO(w(e.pageIndex),`logical-page-points`),A(e)},moveAcquisitionCursor:A,flowRegistrySnapshot(){return Object.freeze({floats:T,drawingCollisions:O})},commitFlowRegistryDelta(e){if(!e.floats&&!e.drawingCollisions)throw Error(`Body flow registry delta must update at least one registry`);e.floats&&zE(e.floats,{coordinateSpace:T.coordinateSpace,flowDomainId:T.flowDomainId,entries:T.entries,nextParagraphId:T.nextParagraphId}),e.drawingCollisions&&FO(O,e.drawingCollisions);let t=e.drawingCollisions?IO(O,e.drawingCollisions):O,n=(e.floats?.entries??[]).map(e=>{let t=e.wrapDistances?.leftPt??e.bounds.xPt-e.exclusionBounds.xPt,n=e.wrapDistances?.topPt??e.bounds.yPt-e.exclusionBounds.yPt,r=e.wrapDistances?.rightPt??e.exclusionBounds.xPt+e.exclusionBounds.widthPt-e.bounds.xPt-e.bounds.widthPt,i=e.wrapDistances?.bottomPt??e.exclusionBounds.yPt+e.exclusionBounds.heightPt-e.bounds.yPt-e.bounds.heightPt,a={mode:e.wrap===`topAndBottom`?`topAndBottom`:`square`,...e.kind===`shape`?{anchorOccurrenceId:e.occurrenceId,acquisitionOccurrenceId:e.occurrenceId}:{},...e.wrap?{authoredWrap:e.wrap,wrapPolygon:e.wrapPolygon}:{},imageKey:e.exclusionId??(e.kind===`table`?`body:float:${e.paragraphId}`:``),imageX:e.bounds.xPt,imageY:e.bounds.yPt,imageW:e.bounds.widthPt,imageH:e.bounds.heightPt,xLeft:e.exclusionBounds.xPt,xRight:e.exclusionBounds.xPt+e.exclusionBounds.widthPt,yTop:e.exclusionBounds.yPt,yBottom:e.exclusionBounds.yPt+e.exclusionBounds.heightPt,side:e.wrapSide??`bothSides`,distLeft:t,distRight:r,distTop:n,distBottom:i,paraId:e.paragraphId};return e.kind===`table`?{...a,kind:`table`,tableOverlap:e.overlap}:{...a,kind:e.kind}});e.floats&&(b.floats.push(...n),T=Object.freeze({...T,entries:Object.freeze([...T.entries,...e.floats.entries]),nextParagraphId:e.floats.nextParagraphId}),b.floatParaSeq=e.floats.nextParagraphId),O=t}};return Object.freeze(I)}})}function f(e,t){return $E(t,iD(t,e))}function p(e,t,n,r){let i=e.retainedTablesBySourceIndex.get(r),a=m(t,n,e),o=e.retainedTableAcquisition,s=KD(t,a,n,e,[r],o),c=i?.contentWidthPt===n?Object.freeze({...s,layout:Object.freeze({...s.layout,columnWidthsPt:i.acquisition.layout.columnWidthsPt})}):s;e.retainedTablesBySourceIndex.set(r,Object.freeze({sourceIndex:r,acquisition:c,contentWidthPt:n,anchorYPt:e.y}));let l=c.layout.rows.map(e=>e.advancePt);return{colWidthsPt:a,rowContentHeightsPt:l,rowHeightsPt:l}}function m(e,t,n){let r=n.acquisitionInputs.tableFormatInput(e),i=new WeakMap;e.rows.forEach((t,n)=>t.cells.forEach((t,a)=>{let o=r.rows[n]?.cells[a]?.marginsPt;i.set(t,o??j(t,e))}));let a=Number.isFinite(e.tblInd)?e.tblInd??0:0,o=r.rows.map(e=>{let t=e.exception;return t?.indentAuthored?t.indentPt??0:a}),s=n.storyContext?.story,c=n.storyContext?.containers.length===0&&(s===`header`||s===`footer`||s===`body`&&n.sectionLayout?.columns.length===1),l=r.ordinaryFlow&&c&&!qE(n.sectionLayout.textDirection)&&[a,...o].some(e=>e<0),u=r.rows.length===0?[{justification:e.jc,indentPt:a}]:r.rows.map((t,n)=>({justification:t.justification??e.jc,indentPt:o[n]??a})),d=e.bidiVisual===!0,f=Math.min(n.pageWidth,...u.map(({justification:e,indentPt:r})=>{let i=e===`right`||e===`end`,a=e===`center`?`center`:(d?!i:i)?`right`:`left`,o=d?-r:r;if(a===`left`){let e=n.contentX+o;return n.pageWidth-e}if(a===`right`)return n.contentX+t+o;let s=n.contentX+t/2+o;return 2*Math.min(s,n.pageWidth-s)})),p=l?Math.max(t,f):t;return[...Il(n.acquisitionInputs.tableColumnLayoutInput(e,t,r=>Gp(r,i.get(r)??j(r,e),{paragraph:e=>{let r=wm(n.layoutSettings,n.sectionLayout,n.storyContext??eD,e),i=e.numbering?n.acquisitionInputs.numberingMarkerShapeInput(e.numbering,Pf(e)):void 0,a=Vp(r,{numbering:e.numbering,...i?{markerInput:i}:{},authoredFirstIndentPt:e.indentFirst,tabStops:e.tabStops,defaultTabPt:n.defaultTabPt,service:n.layoutServices?.text,clusterGeometry:!1}),o=a.numberingMarkerGeometry??(e.numbering&&i&&n.layoutServices?.text?Wp(e.numbering,i,{authoredFirstIndentPt:e.indentFirst,physicalIndentLeftPt:a.physicalIndentLeftPt,tabStops:e.tabStops,defaultTabPt:n.defaultTabPt},n.layoutServices.text,!1):void 0);return Zp(e,a,t,{context:n.ctx,fontFamilyClasses:n.fontFamilyClasses},QE(n),o)},nestedTable:e=>{let r=m(e,t,n).reduce((e,t)=>e+t,0);return{minWidthPt:r,maxWidthPt:r}}}),n.acquisitionInputs.tableParticipatesInOrdinaryFlow(e)?p:Math.max(t,n.pageWidth)))]}function h(e,t,n){let r=e.indexOf(t);for(let t=r+1;t<e.length;t++){let r=e[t];if(r.type!==`paragraph`)continue;let i=r;if(!i.framePr)return rp(i,1,f(i,n),rD(n,i).hasRuby,n.docEastAsian,n.ctx,n.fontFamilyClasses,i.lineSpacing,n.resolvedLocalFonts,n.layoutServices?.text,n.acquisitionInputs.paragraphMarkShapeInput(i))}let i=t;return rp(i,1,f(i,n),rD(n,i).hasRuby,n.docEastAsian,n.ctx,n.fontFamilyClasses,i.lineSpacing,n.resolvedLocalFonts,n.layoutServices?.text,n.acquisitionInputs.paragraphMarkShapeInput(i))}function g(e,t,n,r,i){let a={context:n.ctx,fontFamilyClasses:n.fontFamilyClasses},o=QE(n),s=t.members.map(fm),c=CE(t.framePr.hAnchor,n),l={contentXPt:n.contentX,contentWidthPt:n.contentW,pageHeightPt:n.pageH,yPt:n.y,anchorLineHeightPt:r},u=Jw(t,{contexts:t.members.map(e=>rD(n,e)),inputs:t.members.map((e,r)=>n.acquisitionInputs.paragraphAcquisitionInput(e,{story:`body`,storyInstance:`body`,path:[t.sourceIndices[r]]})),borderEdges:s,borderExtentsPt:t.members.map((e,t)=>s[t]?.bottom===`none`?0:Qp(e.borders)),measurer:a,environment:o,containerShading:n.containerShading,maximumWidthPt:Math.max(0,c.right-c.left),acquisitionSession:n,placementSignature:[l.contentXPt,l.contentWidthPt,l.pageHeightPt,l.yPt,l.anchorLineHeightPt,n.pageWidth,n.marginLeft,n.marginRight,n.marginTop,n.marginBottom].join(`|`),place:(e,r)=>{let i=OE(t.framePr,n,l.yPt,e,r,l.anchorLineHeightPt);return Object.freeze({bounds:Object.freeze({xPt:i.x,yPt:i.y,widthPt:i.w,heightPt:i.h}),exclusionBounds:Object.freeze({xPt:i.exLeft,yPt:i.exTop,widthPt:i.exRight-i.exLeft,heightPt:i.exBottom-i.exTop})})},anchorFrames:tD(n)});i?.(u);let d={x:u.box.bounds.xPt,y:u.box.bounds.yPt,w:u.box.bounds.widthPt,h:u.box.bounds.heightPt,exLeft:u.box.exclusionBounds.xPt,exTop:u.box.exclusionBounds.yPt,exRight:u.box.exclusionBounds.xPt+u.box.exclusionBounds.widthPt,exBottom:u.box.exclusionBounds.yPt+u.box.exclusionBounds.heightPt,registerExclusion:!0,exclusionId:u.box.exclusionId};return e===t.owner?d:{...d,registerExclusion:!1}}function _(e,t,n){if(t.verticalPhys){let n=_(e,w(t),t.contentX);return ek(n.x,n.y,n.w,n.h,t.verticalPhys.physicalPageWidthPt)}let r=e.widthPt,i=e.heightPt,a=e.anchorXPt,o=e.anchorYPt,s=e.groupWidthPt??null,c=e.groupHeightPt??null;if(e.widthPct!=null){let n=HE(e.widthRelativeFrom,!1,t),i=(n.end-n.start)*e.widthPct;if(e.groupWidthPt!=null&&e.groupWidthPt>0){let t=i/e.groupWidthPt;r=e.widthPt*t,a=e.anchorXPt*t}else r=i;s=i}if(e.heightPct!=null){let r=UE(e.heightRelativeFrom,!1,n,t),a=(r.end-r.start)*e.heightPct;if(e.groupHeightPt!=null&&e.groupHeightPt>0){let t=a/e.groupHeightPt;i=e.heightPt*t,o=e.anchorYPt*t}else i=a;c=a}return{x:WE(e.anchorXAlign,e.anchorXFromMargin,a,r,t,e.anchorXRelativeFrom,e.pctPosH,s),y:GE(e.anchorYAlign,e.anchorYFromPara,o,i,n,t,e.anchorYRelativeFrom,e.pctPosV,c),w:r,h:i}}let v=(e,t,n)=>T(e,t,n),y=(e,t,n)=>_(e,t,n),b=e=>XE(e),x=e=>YE(e),S=(e,t,n)=>D(e,t,n);function C(e){let t=e.verticalPhys;return t?{...e,pageWidth:t.pageWidth,marginLeft:t.marginLeft,marginRight:t.marginRight,marginTop:t.marginTop,marginBottom:t.marginBottom,pageH:t.pageHeight}:e}function w(e){let t=e.verticalPhys;return t?{...C(e),contentX:t.marginLeft,contentW:t.pageWidth-t.marginLeft-t.marginRight,verticalCJK:!1,verticalAllRotated:!1,verticalPhys:void 0,floats:[]}:e}function T(e,t,n){let r=e.widthPt,i=e.heightPt,a=e.distLeft??0,o=e.distRight??0,s=e.distTop??0,c=e.distBottom??0;if(t.verticalPhys){let n=C(t),l=ek(WE(e.anchorXAlign,e.anchorXFromMargin??!1,e.anchorXPt??0,r,n,e.anchorXRelativeFrom??null,null,null),GE(e.anchorYAlign,e.anchorYFromPara??!1,e.anchorYPt??0,i,t.contentX,n,e.anchorYRelativeFrom??null,null,null),r,i,t.verticalPhys.physicalPageWidthPt);return{x:l.x,y:l.y,w:l.w,h:l.h,dl:s,dr:c,dt:o,db:a}}return{x:WE(e.anchorXAlign,e.anchorXFromMargin??!1,e.anchorXPt??0,r,t,e.anchorXRelativeFrom??null,null,null),y:GE(e.anchorYAlign,e.anchorYFromPara??!1,e.anchorYPt??0,i,n,t,e.anchorYRelativeFrom??null,null,null),w:r,h:i,dl:a,dr:o,dt:s,db:c}}function E(e,t,n){let r=t.floatParaSeq++,i=t.pageAnchorPrescanned?.has(e)??!1;for(let a of e.runs)if(a.type===`image`){let e=a;if(i&&RO(e))continue;O(e,t,n,r)}else if(a.type===`chart`){let e=a;if(i&&RO(e))continue;k(e,t,n,r)}else if(a.type===`shape`){let e=a;if(i&&RO(e))continue;A(e,t,n,r)}}function D(e,t,n){n.pageAnchorPrescanned||=new Set;for(let r=t;r<e.length;r++){let t=e[r];if(!t)continue;if(t.type===`pageBreak`)break;if(t.type===`sectionBreak`){let e=t;if(e.kind&&e.kind!==`continuous`)break;continue}if(t.type!==`paragraph`)continue;let i=t;if(n.pageAnchorPrescanned.has(i))continue;let a=!1;for(let e of i.runs)if(e.type===`image`){if(RO(e)){a=!0;break}}else if(e.type===`chart`){if(RO(e)){a=!0;break}}else if(e.type===`shape`&&RO(e)){a=!0;break}if(!a)continue;let o=n.floatParaSeq++;for(let e of i.runs)if(e.type===`image`){let t=e;if(!RO(t))continue;O(t,n,0,o)}else if(e.type===`chart`){let t=e;if(!RO(t))continue;k(t,n,0,o)}else if(e.type===`shape`){let t=e;if(!RO(t))continue;A(t,n,0,o)}n.pageAnchorPrescanned.add(i)}}function O(e,t,n,r){if(!e.anchor||!fd(e.wrapMode))return;let i=e.wrapMode===`topAndBottom`?`topAndBottom`:`square`,a=T(e,t,n),{w:o,h:s,dl:c,dr:u,dt:d,db:f}=a,p=e.allowOverlap??!0,m=l(e.imagePath,e.colorReplaceFrom,e.duotone);kE(t,{x:a.x,y:a.y,w:o,h:s,dl:c,dr:u,dt:d,db:f,kind:`shape`,mode:i,side:e.wrapSide??`bothSides`,imageKey:m,paraId:r,avoidOverlap:!0,allowOverlap:p})}function k(e,t,n,r){if(!e.anchor||!fd(e.wrapMode))return;let i=T(e,t,n),{w:a,h:o,dl:s,dr:c,dt:l,db:u}=i;a<=0||o<=0||kE(t,{x:i.x,y:i.y,w:a,h:o,dl:s,dr:c,dt:l,db:u,kind:`shape`,mode:e.wrapMode===`topAndBottom`?`topAndBottom`:`square`,side:e.wrapSide??`bothSides`,allowOverlap:e.allowOverlap??!0,avoidOverlap:!0,paraId:r,imageKey:``})}function A(e,t,n,r){if(!fd(e.wrapMode))return;let{x:i,y:a,w:o,h:s}=_(e,t,n);if(o<=0||s<=0)return;let c=e.wrapMode===`topAndBottom`?`topAndBottom`:`square`,l=e.distLeft??0,u=e.distRight??0,d=e.distTop??0,f=e.distBottom??0,p=!!t.verticalPhys;kE(t,{x:i,y:a,w:o,h:s,dl:p?d:l,dr:p?f:u,dt:p?u:d,db:p?l:f,kind:`shape`,mode:c,side:e.wrapSide??`bothSides`,imageKey:``,paraId:r,avoidOverlap:!0,allowOverlap:!0})}function j(e,t){return{top:e.marginTop??t.cellMarginTop,bottom:e.marginBottom??t.cellMarginBottom,left:e.marginLeft??t.cellMarginLeft,right:e.marginRight??t.cellMarginRight}}let M=d(e,t,n);return Object.freeze({kernel:M,internals:Object.freeze({resolveColumnWidths:m,resolveAnchorBox:v,resolveShapeBox:y,physicalLayoutSection:b,verticalLayoutSection:x,preRegisterPageFloats:S})})}function*nk(e){e.textPath&&(yield{text:e.textPath.string,fontFamilies:[e.textPath.fontFamily],bold:e.textPath.bold,italic:e.textPath.italic});for(let t of e.textBlocks??[])yield*rk(t)}function*rk(e){if(e.numbering&&(yield{text:e.numbering.text,fontFamilies:[e.numbering.fontFamily,e.numbering.fontFamilyEastAsia],bold:!1,italic:!1}),e.runs?.length)for(let t of e.runs)yield{text:t.text,fontFamilies:[t.fontFamily,t.fontFamilyEastAsia,e.fontFamily],bold:t.bold??e.bold,italic:t.italic??e.italic};else yield{text:e.text,fontFamilies:[e.fontFamily],bold:e.bold,italic:e.italic}}function*ik(e){if(e.type===`text`){let t=e;yield{text:e.text,fontFamilies:[e.fontFamily,t.fontFamilyHighAnsi,e.fontFamilyEastAsia],bold:e.bold,italic:e.italic},yield{text:e.text,fontFamilies:[e.fontFamilyCs],bold:e.boldCs??!1,italic:e.italicCs??!1}}else if(e.type===`field`){let t=e;yield{text:t.fallbackText,fontFamilies:[t.fontFamily,t.fontFamilyHighAnsi,t.fontFamilyEastAsia],bold:t.bold,italic:t.italic},yield{text:t.fallbackText,fontFamilies:[t.fontFamilyCs],bold:t.boldCs??!1,italic:t.italicCs??!1}}else e.type===`shape`?yield*nk(e):e.type===`anchorHost`&&(yield{text:``,fontFamilies:[e.fontFamily,e.fontFamilyEastAsia],bold:e.bold,italic:e.italic})}function*ak(e){yield{text:``,fontFamilies:[e.defaultFontFamily,e.defaultFontFamilyEastAsia]},e.numbering&&(yield{text:e.numbering.text,fontFamilies:[e.numbering.fontFamily,e.numbering.fontFamilyEastAsia]});for(let t of e.runs)yield*ik(t)}function*ok(e){for(let t of e.rows)for(let e of t.cells)yield*ck(e.content)}function*sk(e){if(e)for(let t of[e.default,e.first,e.even])t&&(yield*ck(t.body))}function*ck(e){for(let t of e)t.type===`paragraph`?yield*ak(t):t.type===`table`?yield*ok(t):t.type===`sectionBreak`&&(yield*sk(t.headers),yield*sk(t.footers))}function*lk(e){yield*ck(e.body??[]),yield*sk(e.headers),yield*sk(e.footers);for(let t of[...e.footnotes??[],...e.endnotes??[]])yield*ck(t.content)}function uk(e){let t=new Set;for(let n of lk(e))for(let e of n.fontFamilies){let n=e?.trim();n&&t.add(n)}return[...t]}const dk={...F,...re};function*fk(e){for(let t of lk(e))yield t.text}function pk(e){let t=R(e.majorFont)??R(e.minorFont)??null;return[e.majorFont,e.minorFont,...ie(fk(e),t)]}function mk(e){return e.trim().toLocaleLowerCase(`en-US`)}function hk(e){return e==null||!Number.isFinite(e)?400:Math.min(900,Math.max(100,Math.round(e/100)*100))}function gk(e){return Object.freeze({...e,diagnostics:Object.freeze([...e.diagnostics])})}function _k(e){return`\"${e.replaceAll(`\\\\`,`\\\\\\\\`).replaceAll(`\"`,`\\\\\"`)}\"`}function vk(e,t){return`${_k(e)}, ${t}`}function yk(e,t={}){let n={embedded:0,local:1,google:2,substitute:3},r=e.filter(e=>e.requestedFamily.trim()&&e.resolvedFamily.trim()).map(e=>Object.freeze({...e,weight:hk(e.weight),style:e.style??`normal`})).sort((e,t)=>mk(e.requestedFamily).localeCompare(mk(t.requestedFamily))||n[e.source]-n[t.source]||e.resolvedFamily.localeCompare(t.resolvedFamily)||e.weight-t.weight||e.style.localeCompare(t.style)),i=new Map;for(let e of r){let t=mk(e.requestedFamily);i.set(t,[...i.get(t)??[],e])}let a=Object.freeze(Object.fromEntries(Object.entries(t.nativeFamilyLists??{}).filter(([e,t])=>e.trim()&&t.trim()).map(([e,t])=>[mk(e),t]).sort(([e],[t])=>e.localeCompare(t)))),o=Uc(`fonts`,{faces:r,nativeFamilyLists:a});return Object.freeze({fingerprint:o,resolve(e){let t=e.requestedFamily?.trim()||e.genericFamily||`sans-serif`,n=hk(e.weight),r=e.style??`normal`,o=(i.get(mk(t))??[]).find(e=>e.weight===n&&e.style===r);if(o){let i=o.source===`substitute`?[{code:`UNSUPPORTED_FEATURE`,severity:`warning`,message:`ECMA-376 §17.8.2 implementation-dependent font substitution: ${t} resolved to ${o.resolvedFamily}`}]:[],a=vk(o.resolvedFamily,e.genericFamily??`sans-serif`);return gk({requestedFamily:t,resolvedFamily:o.resolvedFamily,route:I(a,`registered`),source:o.source,weight:n,style:r,diagnostics:i,genericFamily:e.genericFamily??`sans-serif`})}let s=e.genericFamily??`sans-serif`,c=e.requestedFamily?.trim();return gk(c?{requestedFamily:t,resolvedFamily:c,route:I(a[mk(c)]??vk(c,s),`native`),source:`native`,weight:n,style:r,diagnostics:[],genericFamily:s}:{requestedFamily:t,resolvedFamily:s,route:I(s,`generic`),source:`generic`,weight:n,style:r,diagnostics:[],genericFamily:s})}})}function bk(e,t){if(typeof e!=`string`||e.trim().length===0)throw TypeError(`${t} must be a non-empty string`)}function xk(e,t){if(!Number.isFinite(e)||e<0)throw TypeError(`${t} must be finite and non-negative`)}function Sk(e,t){if(!Number.isFinite(e))throw TypeError(`${t} must be finite`)}function Ck(e,t){if(!Number.isFinite(e)||e<0||e>1)throw TypeError(`${t} must be between 0 and 1`)}function wk(e,t){xk(e.widthPt,`${t}.widthPt`),xk(e.heightPt,`${t}.heightPt`)}function Tk(e){switch(bk(e.resourceKey,`resourceKey`),e.kind){case`image`:case`picture-bullet`:if(e.documentOrder!==void 0&&(!Number.isSafeInteger(e.documentOrder)||e.documentOrder<0))throw TypeError(`documentOrder must be a non-negative safe integer`);if(bk(e.partPath,`partPath`),bk(e.mimeType,`mimeType`),e.svgImagePath!==void 0&&bk(e.svgImagePath,`svgImagePath`),wk(e.intrinsicSize,`intrinsicSize`),e.alpha!==void 0&&Ck(e.alpha,`alpha`),e.rotation!==void 0&&!Number.isFinite(e.rotation))throw TypeError(`rotation must be finite`);e.srcRect!==void 0&&(Sk(e.srcRect.l,`srcRect.l`),Sk(e.srcRect.t,`srcRect.t`),Sk(e.srcRect.r,`srcRect.r`),Sk(e.srcRect.b,`srcRect.b`));break;case`chart`:wk(e.intrinsicSize,`intrinsicSize`);break;case`math`:break;default:throw TypeError(`Unknown paint resource kind: ${String(e)}`)}}function Ek(e){return Tk(e),Zc(e,`paint resource ${e.resourceKey}`)}function Dk(e,t,n){return Error(`Paint resource kind mismatch for ${e}: expected ${t}, got ${n}`)}function Ok(e){let t=new Set;for(let n of e){if(t.has(n.resourceKey))throw Error(`Duplicate paint resource key: ${n.resourceKey}`);t.add(n.resourceKey)}let n=e.map(Ek).sort((e,t)=>e.resourceKey.localeCompare(t.resourceKey)),r=Object.freeze(n),i=new Map(r.map(e=>[e.resourceKey,e])),a=Object.freeze(r.map(e=>e.resourceKey));return Object.freeze({keys:a,descriptors:r,resolve(e,t){let n=i.get(e);if(!n)throw Error(`Unknown paint resource: ${e}`);if(n.kind!==t)throw Dk(e,t,n.kind);return n}})}function kk(e){return Uc(`chart-resource`,e)}function Ak(e,t,n,r={}){return{kind:e,resourceKey:t,partPath:n,...r.svgImagePath===void 0?{}:{svgImagePath:r.svgImagePath},...r.srcRect==null?{}:{srcRect:{...r.srcRect}},...r.rotation===void 0?{}:{rotation:r.rotation},...r.flipH===void 0?{}:{flipH:r.flipH},...r.flipV===void 0?{}:{flipV:r.flipV},...r.alpha===void 0?{}:{alpha:r.alpha},...r.colorReplaceFrom===void 0?{}:{colorReplaceFrom:r.colorReplaceFrom},...r.duotone===void 0?{}:{duotone:{...r.duotone}}}}function jk(e,t,n){let r=[],i=[],a=(e,t)=>{if(e.type===`image`){r.push(Ak(`image`,Kc(t,e.imagePath),e.imagePath,e));return}if(e.type===`chart`){i.push({kind:`chart`,resourceKey:kk(t),intrinsicSize:{widthPt:e.widthPt,heightPt:e.heightPt},model:e.chart});return}if(e.type!==`shape`)return;let n=`${t.story}:${t.storyInstance}:${t.path.join(`.`)}`;e.textBlocks?.forEach((e,t)=>{if(!e.imagePath)return;let i={story:`textbox`,storyInstance:n,path:[t,0]};r.push(Ak(`image`,Kc(i,e.imagePath),e.imagePath,{svgImagePath:e.svgImagePath}))})},o=(e,t,n,r)=>{e.rows.forEach((e,i)=>e.cells.forEach((e,a)=>{l(e.content,t,n,[...r,i,a])}))},s=(e,t,n)=>{if(e)for(let r of[`default`,`first`,`even`]){let i=e[r];i&&l(i.body,t,n?`${n}:${r}`:r)}},c=(e,t)=>{let i=e.numbering;i?.picBulletImagePath&&r.push(Ak(`picture-bullet`,Kc(t,i.picBulletImagePath),i.picBulletImagePath)),(n?.paragraphAcquisitionInput(e,t).runs??e.runs).forEach((e,n)=>{(e.type===`image`||e.type===`chart`||e.type===`shape`)&&a(e,{...t,path:[...t.path,n]})})},l=(e,t,n,r=[])=>{e.forEach((e,i)=>{let a=[...r,i];e.type===`paragraph`?c(e,{story:t,storyInstance:n,path:a}):e.type===`table`?o(e,t,n,a):e.type===`sectionBreak`&&(s(e.headers,`header`,`section:${i}`),s(e.footers,`footer`,`section:${i}`))})};l(e.body,`body`,`body`),s(e.headers,`header`),s(e.footers,`footer`);for(let t of e.footnotes??[])l(t.content,`footnote`,t.id);for(let t of e.endnotes??[])l(t.content,`endnote`,t.id);let u=t??Pg(e,void 0,n),d=new Map(u.map(e=>[e.resourceKey,e])),f=r.map(e=>e.resourceKey).sort(),p=u.map(e=>e.resourceKey).sort();if(f.length!==p.length||f.some((e,t)=>e!==p[t]))throw Error(`Paint image descriptor membership differs from layout image metadata`);for(let[e,t]of r.entries()){let n=d.get(t.resourceKey);if(!n)throw Error(`Missing layout image metadata: ${t.resourceKey}`);i.push({...t,documentOrder:e,mimeType:n.mimeType,intrinsicSize:{widthPt:n.widthPt,heightPt:n.heightPt}})}for(let t of Ag(e))i.push({kind:`math`,resourceKey:t.resourceKey});return i}function Mk(e,t,n){return Ok(jk(e,t,n))}function Nk(e,t){let n=Wl(t.localMetrics),r=Object.freeze(Object.fromEntries(Object.entries(t.fontFamilyCharsets).map(([e,t])=>[e.trim().toLowerCase(),t]))),i=e=>e.trim().replace(/^(['\"])(.*)\\1$/,`$2`),a=e=>i(e).toLocaleLowerCase(`en-US`),o=e=>{let t=e.style.trim().toLocaleLowerCase(`en-US`);return t===`normal`||t===`italic`?t:null},s=e=>{let t=e.weight.trim().toLocaleLowerCase(`en-US`);if(t===`normal`)return 400;if(t===`bold`)return 700;if(!/^\\d+$/.test(t))return null;let n=Number(t);return n>=100&&n<=900?n:null},c=e=>e.flatMap(e=>{if(e.status!==`loaded`)return[];let t=s(e),n=o(e);return t==null||n==null?[]:[{family:a(e.family),displayFamily:i(e.family),weight:t,style:n}]}),l=new Map(c(t.embeddedFaces??[]).map(e=>[`${e.family}:${e.weight}:${e.style}`,e])),u=(e.embeddedFonts??[]).flatMap(e=>{let t=e.style===`bold`||e.style===`boldItalic`?700:400,n=e.style===`italic`||e.style===`boldItalic`?`italic`:`normal`,r=l.get(`${a(e.fontName)}:${t}:${n}`);return r?[{requestedFamily:e.fontName,resolvedFamily:r.displayFamily,source:`embedded`,weight:t,style:n}]:[]});for(let[e,t]of Object.entries(n))u.push({requestedFamily:t.requestedFamily??e,resolvedFamily:t.family,source:`local`,weight:t.weight??400,style:t.style??`normal`});if(t.useGoogleFonts){let n=c(t.googleFaces??[]),r=new Set;for(let t of pk(e)){if(!t)continue;let e=t.toLocaleLowerCase(`en-US`);if(r.has(e))continue;r.add(e);let i=dk[e],o=i?.loadFamily??t;if(i)for(let e of n.filter(e=>e.family===a(o)))u.push({requestedFamily:t,resolvedFamily:e.displayFamily,source:a(o)===a(t)?`google`:`substitute`,weight:e.weight,style:e.style})}}let d=t.measureContext,f=[...new Set([...Object.keys(e.fontFamilyClasses??{}),...Object.keys(e.fontFamilyPitches??{}),...uk(e),...e.majorFont?[e.majorFont]:[],...e.minorFont?[e.minorFont]:[]])],p=Yl({fonts:yk(u,{nativeFamilyLists:Object.fromEntries(f.map(t=>[t,Af(t,e.fontFamilyClasses??{},e.fontFamilyPitches??{})]))}),localMetrics:n,eastAsiaFontCharsets:r,genericFamilies:Object.fromEntries(f.map(t=>[t,Hl(t,e.fontFamilyClasses,e.fontFamilyPitches)])),measurer:{fingerprint:d?`canvas-text-metrics-v1`:`deterministic-text-metrics-v1`,measure(e){if(!d)return{advancePt:[...e.text].length*e.fontSizePt*.5,ascentPt:e.fontSizePt*.8,descentPt:e.fontSizePt*.2};let t=d.font,n=d.letterSpacing,r=d.fontKerning;try{d.font=L(e.fontRoute,e.fontSizePt,e.weight,e.style),d.letterSpacing=`${e.letterSpacingPt}px`,e.kerning!=null&&(d.fontKerning=e.kerning?`normal`:`none`);let t=d.measureText(e.text),n=Number.isFinite(t.actualBoundingBoxLeft)&&Number.isFinite(t.actualBoundingBoxRight),r={xMinPt:n?-t.actualBoundingBoxLeft:0,xMaxPt:n?t.actualBoundingBoxRight:t.width,ascentPt:t.actualBoundingBoxAscent,descentPt:t.actualBoundingBoxDescent};return{advancePt:t.width,ascentPt:t.fontBoundingBoxAscent??t.actualBoundingBoxAscent??0,descentPt:t.fontBoundingBoxDescent??t.actualBoundingBoxDescent??0,...Object.values(r).every(Number.isFinite)?{inkBounds:r,...n?{horizontalInkBoundsAreTight:!0}:{}}:{}}}finally{d.font=t,d.letterSpacing=n,e.kerning!=null&&(d.fontKerning=r)}}}}),m=t.mathResources??t.mathOccurrences.map(({display:e,source:t})=>({resourceKey:qc(t,e?`display`:`inline`),widthEm:0,ascentEm:0,descentEm:0,available:!1,diagnostics:[{code:`UNSUPPORTED_FEATURE`,severity:`warning`,message:`The optional DOM math engine is unavailable; using the worker-safe text fallback`}]})),h=Pg(e,e=>{let n=e.numbering;if(!n)throw Error(`Picture-bullet metadata requires numbering`);let r=t.acquisitionInputs.numberingMarkerShapeInput(n,Pf(e));return{widthPt:n.picBulletWidthPt??r.fontSizePt,heightPt:n.picBulletHeightPt??r.fontSizePt}},t.acquisitionInputs),g=Object.freeze({text:p,images:Mg(h),math:Ng(m),verticalGlyphFingerprint:t.verticalGlyphMeasurement.fingerprint}),_=t.mathOccurrences.map(({source:e,display:t})=>qc(e,t?`display`:`inline`)),v=m.map(e=>e.resourceKey),y=_.filter(e=>!v.includes(e)),b=v.filter(e=>!_.includes(e));if(y.length||b.length)throw Error(`Math metadata membership mismatch: missing [${y.join(`, `)}]; extra [${b.join(`, `)}]`);return Xg(g,t.mathDrawables??new Map,m.filter(e=>e.available!==!1).map(e=>e.resourceKey)),a_(g,Mk(e,h,t.acquisitionInputs)),Kg(g,t.verticalGlyphMeasurement),g}function Pk(e,t,n,r){return tk(e,t,n,r).kernel}function Fk(e,t={}){let n=kg(e);e=n.document;let r=t.measureContext??(()=>{if(typeof document<`u`){let e=document.createElement(`canvas`).getContext(`2d`);if(e!==null)return e}return typeof OffscreenCanvas<`u`?new OffscreenCanvas(1,1).getContext(`2d`):null})(),i=r===null?null:Object.freeze({get font(){return r.font},set font(e){r.font=e},get letterSpacing(){return r.letterSpacing},set letterSpacing(e){r.letterSpacing=e},get fontKerning(){return r.fontKerning},set fontKerning(e){r.fontKerning=e},measureText(e){return r.measureText(e)}}),a=r?.canvas,o=a?.ownerDocument?.defaultView?.HTMLCanvasElement,s=r!==null&&(typeof o==`function`&&a instanceof o||typeof HTMLCanvasElement<`u`&&a instanceof HTMLCanvasElement),c=Object.freeze({fingerprint:r===null?`vertical-glyph-measurement:deterministic-v1`:s?`vertical-glyph-measurement:dom-vert-probe-v2`:`vertical-glyph-measurement:no-dom-vert-probe-v1`,measureRunInkExtra(e){if(r===null)throw Error(`Vertical glyph measurement requires a concrete text context`);return _s(r,()=>$O(r,e))},planRun(e){if(r===null)throw Error(`Vertical glyph planning requires a concrete text context`);return _s(r,()=>{let t=r.font,n=r.fontKerning;r.font=e.font,r.fontKerning=e.fontKerning;try{return ZO(r,e.text,e.fontSizePt,e.letterSpacingPt,e.charScale,e.growTrRotateInk,e=>Cs(r,e),e.writingMode)}finally{r.font=t,r.fontKerning=n}})}}),l=Wl(t.localMetrics),u=Nk(e,{...t,localMetrics:l,measureContext:i,verticalGlyphMeasurement:c,fontFamilyCharsets:n.fontFamilyCharsets,mathOccurrences:n.mathOccurrences,acquisitionInputs:n.bodyModelGateway.acquisitionInputs});return Wg(u,Pk(e,i,l,n.bodyModelGateway)),u}function Ik(e){Ny(e)}function Lk(e,t,n,r){let i=r.layoutServices??Fk(e,e.parseError==null?{measureContext:t.getContext(`2d`)}:{}),a=r.defaultCurrentDateMs??Date.now();SE(i,a,()=>{let t=kg(e);return{model:t.document,input:t.bodyLayoutInput}});let o=oy(i,{currentDate:r.currentDate,defaultCurrentDateMs:a},n),s=Nb(o.page,r.width);return{selection:o,paintOptions:{width:r.width,dpr:r.dpr,defaultTextColor:r.defaultTextColor,showTrackChanges:r.showTrackChanges,fetchImage:r.fetchImage,parseError:e.parseError!=null,registry:o_(i),privateResources:Zg(i),textRuns:r.onTextRun?Oy(o.layout,n,{scale:s}):[],onTextRun:r.onTextRun}}}async function Rk(e,t,n,r={}){let i=Lk(e,t,n,r);return Lb(i.selection.layout,i.selection.page,t,i.paintOptions)}function zk(e){let t=new Map;for(let n of e.pages)for(let e of n.bookmarkStarts)e.name!==``&&!t.has(e.name)&&t.set(e.name,n.pageIndex);return t}async function Bk(e,t){let n=e.embeddedFonts;if(!n||n.length===0)return[];let r=(await Promise.all(n.map(async e=>{try{let n=await t(e.partPath);return{family:e.fontName,bytes:n,odttf:e.partPath.toLowerCase().endsWith(`.odttf`),fontKey:e.fontKey,weight:Vk(e.style),style:Hk(e.style)}}catch{return null}}))).filter(e=>e!==null);return r.length===0?[]:te(r)}function Vk(e){return e===`bold`||e===`boldItalic`?`bold`:`normal`}function Hk(e){return e===`italic`||e===`boldItalic`?`italic`:`normal`}function Uk(e){let t=new Set((e.embeddedFonts??[]).map(e=>{let t=e.style===`bold`||e.style===`boldItalic`?700:400,n=e.style===`italic`||e.style===`boldItalic`?`italic`:`normal`;return`${Nc(e.fontName)}:${t}:${n}`})),n=[],r=new Set,i=e=>{let i=e?.trim();if(!i)return;let a=Nc(i);if(!(a===`meiryo`||i===`メイリオ`))return;let o=`${a}:400:normal`;t.has(o)||r.has(o)||(r.add(o),n.push({family:i,localNames:[`Meiryo`],lineHeightMultiplier:1.3}))};for(let t of lk(e))if(!(t.bold||t.italic))for(let e of t.fontFamilies)i(e);return n}function Wk(e){return Lc(Uk(e))}function Gk(e,t=Fk(e),n){return xE(kg(e).bodyLayoutInput,t,n)}function Kk(e,t,n){let r=ay({model:e,services:t,defaultCurrentDateMs:n,buildLayout:n=>Gk(e,t,n)});return Object.freeze({model:e,layoutServices:t,layoutVariants:r.store,defaultCurrentDateMs:n})}const qk=new Set([`tbRl`,`tbRlV`,`tbLrV`]);function Jk(e){let t=[e],n=new Set;for(;t.length>0;){let e=t.pop();if(!(typeof e!=`object`||!e||n.has(e))){if(n.add(e),!Array.isArray(e)){let t=e;if(typeof t.textDirection==`string`&&qk.has(t.textDirection))return!0}t.push(...Object.values(e))}}return!1}const Yk=new Ba(x,{freeArchive:e=>e.free(),reinit:S});let Xk=null,Zk=[];const Qk=new Map,$k=(e,t)=>self.postMessage(e,t);function eA(e,t){let n=Qk.get(e);if(n)return n;let r=(async()=>{let n=Yk.archive;if(!n)throw Error(`No docx loaded`);let r=Yk.run(()=>n.extract_image(e));return new Blob([new Uint8Array(r).slice()],{type:t})})();return Qk.set(e,r),r}self.onmessage=async t=>{let n=t.data;if(n.type===`init`){Yk.setWasmUrl(La(n.wasmUrl)??n.wasmUrl);return}let r=n.id;try{if(await Yk.ensureReady(),n.type===`parse`){Xk=null,Zk.length>0&&(Rc(Zk),Zk=[]),Qk.clear(),ba(eA),Ik(eA),jr(eA);let t=typeof n.maxZipEntryBytes==`number`&&n.maxZipEntryBytes>0?BigInt(n.maxZipEntryBytes):void 0,i=new Uint8Array(n.data),a=Yk.run(()=>{let n=new e(i,t);return Yk.setArchive(n),JSON.parse(new TextDecoder().decode(n.parse()))}),o=Cg(a).document;if(Jk(o)){let e=new TextEncoder().encode(JSON.stringify(a)),t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);$k({type:`mainThreadVerticalFallback`,id:r,documentJson:t},[t]);return}let s=[];n.useGoogleFonts&&(s=await j(pk(o),dk));let c=[];o.embeddedFonts?.length&&(c=await Bk(o,async e=>{let t=Yk.archive;if(!t)throw Error(`No docx loaded`);return new Uint8Array(Yk.run(()=>t.extract_image(e))).slice()}));let l=await Wk(o);Zk=l.faces,Xk=Kk(o,Fk(o,{localMetrics:l.metrics,useGoogleFonts:!!n.useGoogleFonts,embeddedFaces:c,googleFaces:s}),n.defaultCurrentDateMs);let u=Xk.layoutVariants.defaultLayout,d=u.pages.map(e=>({widthPt:e.geometry.widthPt,heightPt:e.geometry.heightPt}));$k({type:`parsedMeta`,id:r,meta:{pageCount:u.pages.length,comments:o.comments??[],footnotes:o.footnotes??[],endnotes:o.endnotes??[],pageSizes:d,bookmarkPages:[...zk(u)]}});return}if(n.type===`renderPage`){if(!Xk)throw Error(`Document not loaded`);let e=new OffscreenCanvas(1,1);await Rk(Xk.model,e,n.pageIndex,{...n.opts,fetchImage:eA,layoutServices:Xk.layoutServices,defaultCurrentDateMs:Xk.defaultCurrentDateMs});let t=ky(Xk.layoutServices,n.pageIndex,{...n.opts,defaultCurrentDateMs:Xk.defaultCurrentDateMs}),i=e.transferToImageBitmap();$k({type:`pageRendered`,id:r,bitmap:i,runs:t},[i]);return}if(n.type===`collectRuns`){if(!Xk)throw Error(`Document not loaded`);$k({type:`runsCollected`,id:r,runs:ky(Xk.layoutServices,n.pageIndex,{...n.opts,defaultCurrentDateMs:Xk.defaultCurrentDateMs})});return}if(n.type===`extractImage`){let e=Yk.archive;if(!e)throw Error(`No docx loaded`);let t=Yk.run(()=>e.extract_image(n.path)),i=new Uint8Array(t).slice().buffer;$k({type:`imageExtracted`,id:r,bytes:i},[i]);return}if(n.type===`toMarkdown`){let e=Yk.archive;if(!e)throw Error(`No docx loaded`);$k({type:`markdownRendered`,id:r,markdown:Yk.run(()=>e.to_markdown())});return}}catch(e){let t=e instanceof Error?e:Error(String(e)),n=t;$k({type:`error`,id:r,message:t.message,errorName:t.name,...n.code===void 0?{}:{code:n.code},...n.reason===void 0?{}:{reason:n.reason},...n.outgoingColumnIndex===void 0?{}:{outgoingColumnIndex:n.outgoingColumnIndex},...n.outgoingColumnCount===void 0?{}:{outgoingColumnCount:n.outgoingColumnCount},...n.incomingColumnCount===void 0?{}:{incomingColumnCount:n.incomingColumnCount}})}};", t = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", e], { type: "text/javascript;charset=utf-8" });
3
3
  function n(n) {
4
4
  let r;
5
5
  try {